@lioneltay/claude-pilot 0.1.12 → 0.1.14

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 (3) hide show
  1. package/dist/cli.js +74 -74
  2. package/dist/server.js +36 -36
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -3,36 +3,36 @@
3
3
  import { createRequire as __createRequire } from 'module';
4
4
  const require = __createRequire(import.meta.url);
5
5
 
6
- var GA=Object.create;var ig=Object.defineProperty;var WA=Object.getOwnPropertyDescriptor;var JA=Object.getOwnPropertyNames;var KA=Object.getPrototypeOf,YA=Object.prototype.hasOwnProperty;var V=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var E=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var XA=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of JA(e))!YA.call(t,s)&&s!==r&&ig(t,s,{get:()=>e[s],enumerable:!(n=WA(e,s))||n.enumerable});return t};var og=(t,e,r)=>(r=t!=null?GA(KA(t)):{},XA(e||!t||!t.__esModule?ig(r,"default",{value:t,enumerable:!0}):r,t));var Ws=E(Du=>{var ko=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},ju=class extends ko{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Du.CommanderError=ko;Du.InvalidArgumentError=ju});var xo=E(Mu=>{var{InvalidArgumentError:QA}=Ws(),Fu=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new QA(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function ZA(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Mu.Argument=Fu;Mu.humanReadableArgName=ZA});var Vu=E(ag=>{var{humanReadableArgName:eC}=xo(),Hu=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let r=e.commands.filter(s=>!s._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((s,i)=>s.name().localeCompare(i.name())),r}compareOptions(e,r){let n=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(s=>!s.hidden),n=e._getHelpOption();if(n&&!n.hidden){let s=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!s&&!i?r.push(n):n.long&&!i?r.push(e.createOption(n.long,n.description)):n.short&&!s&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let s=n.options.filter(i=>!i.hidden);r.push(...s)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>eC(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,s)=>Math.max(n,r.subcommandTerm(s).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,s)=>Math.max(n,r.optionTerm(s).length),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,s)=>Math.max(n,r.optionTerm(s).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,s)=>Math.max(n,r.argumentTerm(s).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let s=e.parent;s;s=s.parent)n=s.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),s=r.helpWidth||80,i=2,o=2;function a(d,m){if(m){let g=`${d.padEnd(n+o)}${m}`;return r.wrap(g,s-i,n+o)}return d}function l(d){return d.join(`
6
+ var XA=Object.create;var og=Object.defineProperty;var QA=Object.getOwnPropertyDescriptor;var ZA=Object.getOwnPropertyNames;var eC=Object.getPrototypeOf,tC=Object.prototype.hasOwnProperty;var V=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var E=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var rC=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ZA(e))!tC.call(t,s)&&s!==r&&og(t,s,{get:()=>e[s],enumerable:!(n=QA(e,s))||n.enumerable});return t};var ag=(t,e,r)=>(r=t!=null?XA(eC(t)):{},rC(e||!t||!t.__esModule?og(r,"default",{value:t,enumerable:!0}):r,t));var Js=E(Fu=>{var xo=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},Du=class extends xo{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Fu.CommanderError=xo;Fu.InvalidArgumentError=Du});var Lo=E(Hu=>{var{InvalidArgumentError:nC}=Js(),Mu=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new nC(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function sC(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Hu.Argument=Mu;Hu.humanReadableArgName=sC});var zu=E(lg=>{var{humanReadableArgName:iC}=Lo(),Vu=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let r=e.commands.filter(s=>!s._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((s,i)=>s.name().localeCompare(i.name())),r}compareOptions(e,r){let n=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(s=>!s.hidden),n=e._getHelpOption();if(n&&!n.hidden){let s=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!s&&!i?r.push(n):n.long&&!i?r.push(e.createOption(n.long,n.description)):n.short&&!s&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let s=n.options.filter(i=>!i.hidden);r.push(...s)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>iC(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,s)=>Math.max(n,r.subcommandTerm(s).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,s)=>Math.max(n,r.optionTerm(s).length),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,s)=>Math.max(n,r.optionTerm(s).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,s)=>Math.max(n,r.argumentTerm(s).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let s=e.parent;s;s=s.parent)n=s.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),s=r.helpWidth||80,i=2,o=2;function a(d,m){if(m){let g=`${d.padEnd(n+o)}${m}`;return r.wrap(g,s-i,n+o)}return d}function l(d){return d.join(`
7
7
  `).replace(/^/gm," ".repeat(i))}let u=[`Usage: ${r.commandUsage(e)}`,""],c=r.commandDescription(e);c.length>0&&(u=u.concat([r.wrap(c,s,0),""]));let f=r.visibleArguments(e).map(d=>a(r.argumentTerm(d),r.argumentDescription(d)));f.length>0&&(u=u.concat(["Arguments:",l(f),""]));let p=r.visibleOptions(e).map(d=>a(r.optionTerm(d),r.optionDescription(d)));if(p.length>0&&(u=u.concat(["Options:",l(p),""])),this.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(m=>a(r.optionTerm(m),r.optionDescription(m)));d.length>0&&(u=u.concat(["Global Options:",l(d),""]))}let h=r.visibleCommands(e).map(d=>a(r.subcommandTerm(d),r.subcommandDescription(d)));return h.length>0&&(u=u.concat(["Commands:",l(h),""])),u.join(`
8
8
  `)}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}wrap(e,r,n,s=40){let i=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",o=new RegExp(`[\\n][${i}]+`);if(e.match(o))return e;let a=r-n;if(a<s)return e;let l=e.slice(0,n),u=e.slice(n).replace(`\r
9
9
  `,`
10
10
  `),c=" ".repeat(n),p="\\s\u200B",h=new RegExp(`
11
11
  |.{1,${a-1}}([${p}]|$)|[^${p}]+?([${p}]|$)`,"g"),d=u.match(h)||[];return l+d.map((m,g)=>m===`
12
12
  `?"":(g>0?c:"")+m.trimEnd()).join(`
13
- `)}};ag.Help=Hu});var Gu=E(Bu=>{var{InvalidArgumentError:tC}=Ws(),zu=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=nC(e);this.short=n.shortFlag,this.long=n.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}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new tC(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return rC(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Uu=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let s=this.negativeOptions.get(n).presetArg,i=s!==void 0?s:!1;return r.negate===(i===e)}};function rC(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function nC(t){let e,r,n=t.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),r=n.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}Bu.Option=zu;Bu.DualOptions=Uu});var ug=E(lg=>{function sC(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let s=1;s<=t.length;s++){let i=1;t[s-1]===e[n-1]?i=0:i=1,r[s][n]=Math.min(r[s-1][n]+1,r[s][n-1]+1,r[s-1][n-1]+i),s>1&&n>1&&t[s-1]===e[n-2]&&t[s-2]===e[n-1]&&(r[s][n]=Math.min(r[s][n],r[s-2][n-2]+1))}return r[t.length][e.length]}function iC(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(o=>o.slice(2)));let n=[],s=3,i=.4;return e.forEach(o=>{if(o.length<=1)return;let a=sC(t,o),l=Math.max(t.length,o.length);(l-a)/l>i&&(a<s?(s=a,n=[o]):a===s&&n.push(o))}),n.sort((o,a)=>o.localeCompare(a)),r&&(n=n.map(o=>`--${o}`)),n.length>1?`
13
+ `)}};lg.Help=Vu});var Wu=E(Gu=>{var{InvalidArgumentError:oC}=Js(),Uu=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=lC(e);this.short=n.shortFlag,this.long=n.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}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new oC(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return aC(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Bu=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let s=this.negativeOptions.get(n).presetArg,i=s!==void 0?s:!1;return r.negate===(i===e)}};function aC(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function lC(t){let e,r,n=t.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),r=n.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}Gu.Option=Uu;Gu.DualOptions=Bu});var cg=E(ug=>{function uC(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let s=1;s<=t.length;s++){let i=1;t[s-1]===e[n-1]?i=0:i=1,r[s][n]=Math.min(r[s-1][n]+1,r[s][n-1]+1,r[s-1][n-1]+i),s>1&&n>1&&t[s-1]===e[n-2]&&t[s-2]===e[n-1]&&(r[s][n]=Math.min(r[s][n],r[s-2][n-2]+1))}return r[t.length][e.length]}function cC(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(o=>o.slice(2)));let n=[],s=3,i=.4;return e.forEach(o=>{if(o.length<=1)return;let a=uC(t,o),l=Math.max(t.length,o.length);(l-a)/l>i&&(a<s?(s=a,n=[o]):a===s&&n.push(o))}),n.sort((o,a)=>o.localeCompare(a)),r&&(n=n.map(o=>`--${o}`)),n.length>1?`
14
14
  (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
15
- (Did you mean ${n[0]}?)`:""}lg.suggestSimilar=iC});var pg=E(hg=>{var oC=V("node:events").EventEmitter,Wu=V("node:child_process"),_r=V("node:path"),Ju=V("node:fs"),Ne=V("node:process"),{Argument:aC,humanReadableArgName:lC}=xo(),{CommanderError:Ku}=Ws(),{Help:uC}=Vu(),{Option:cg,DualOptions:cC}=Gu(),{suggestSimilar:fg}=ug(),Yu=class t extends oC{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",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._outputConfiguration={writeOut:r=>Ne.stdout.write(r),writeErr:r=>Ne.stderr.write(r),getOutHelpWidth:()=>Ne.stdout.isTTY?Ne.stdout.columns:void 0,getErrHelpWidth:()=>Ne.stderr.isTTY?Ne.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let s=r,i=n;typeof s=="object"&&s!==null&&(i=s,s=null),i=i||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),l=this.createCommand(o);return s&&(l.description(s),l._executableHandler=!0),i.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(i.noHelp||i.hidden),l._executableFile=i.executableFile||null,a&&l.arguments(a),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),s?this:l}createCommand(e){return new t(e)}createHelp(){return Object.assign(new uC,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
16
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new aC(e,r)}argument(e,r,n,s){let i=this.createArgument(e,r);return typeof n=="function"?i.default(s).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,s]=e.match(/([^ ]+) *(.*)/),i=r??"display help for command",o=this.createCommand(n);return o.helpOption(!1),s&&o.arguments(s),i&&o.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=o,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,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(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
17
- Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Ku(e,r,n)),Ne.exit(e)}action(e){let r=n=>{let s=this.registeredArguments.length,i=n.slice(0,s);return this._storeOptionsAsProperties?i[s]=this:i[s]=this.opts(),i.push(this),e.apply(this,i)};return this._actionHandler=r,this}createOption(e,r){return new cg(e,r)}_callParseArg(e,r,n,s){try{return e.parseArg(r,n)}catch(i){if(i.code==="commander.invalidArgument"){let o=`${s} ${i.message}`;this.error(o,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
18
- - already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=s=>[s.name()].concat(s.aliases()),n=r(e).find(s=>this._findCommand(s));if(n){let s=r(this._findCommand(n)).join("|"),i=r(e).join("|");throw new Error(`cannot add command '${i}' as already have command '${s}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let i=e.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let s=(i,o,a)=>{i==null&&e.presetArg!==void 0&&(i=e.presetArg);let l=this.getOptionValue(n);i!==null&&e.parseArg?i=this._callParseArg(e,i,l,o):i!==null&&e.variadic&&(i=e._concatValue(i,l)),i==null&&(e.negate?i=!1:e.isBoolean()||e.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,a)};return this.on("option:"+r,i=>{let o=`error: option '${e.flags}' argument '${i}' is invalid.`;s(i,o,"cli")}),e.envVar&&this.on("optionEnv:"+r,i=>{let o=`error: option '${e.flags}' value '${i}' from env '${e.envVar}' is invalid.`;s(i,o,"env")}),this}_optionEx(e,r,n,s,i){if(typeof r=="object"&&r instanceof cg)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,n);if(o.makeOptionMandatory(!!e.mandatory),typeof s=="function")o.default(i).argParser(s);else if(s instanceof RegExp){let a=s;s=(l,u)=>{let c=a.exec(l);return c?c[0]:u},o.default(i).argParser(s)}else o.default(s);return this.addOption(o)}option(e,r,n,s){return this._optionEx({},e,r,n,s)}requiredOption(e,r,n,s){return this._optionEx({mandatory:!0},e,r,n,s)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,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(e=!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=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){Ne.versions?.electron&&(r.from="electron");let s=Ne.execArgv??[];(s.includes("-e")||s.includes("--eval")||s.includes("-p")||s.includes("--print"))&&(r.from="eval")}e===void 0&&(e=Ne.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":Ne.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.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",n}parse(e,r){let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_executeSubCommand(e,r){r=r.slice();let n=!1,s=[".js",".ts",".tsx",".mjs",".cjs"];function i(c,f){let p=_r.resolve(c,f);if(Ju.existsSync(p))return p;if(s.includes(_r.extname(f)))return;let h=s.find(d=>Ju.existsSync(`${p}${d}`));if(h)return`${p}${h}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let c;try{c=Ju.realpathSync(this._scriptPath)}catch{c=this._scriptPath}a=_r.resolve(_r.dirname(c),a)}if(a){let c=i(a,o);if(!c&&!e._executableFile&&this._scriptPath){let f=_r.basename(this._scriptPath,_r.extname(this._scriptPath));f!==this._name&&(c=i(a,`${f}-${e._name}`))}o=c||o}n=s.includes(_r.extname(o));let l;Ne.platform!=="win32"?n?(r.unshift(o),r=dg(Ne.execArgv).concat(r),l=Wu.spawn(Ne.argv[0],r,{stdio:"inherit"})):l=Wu.spawn(o,r,{stdio:"inherit"}):(r.unshift(o),r=dg(Ne.execArgv).concat(r),l=Wu.spawn(Ne.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{Ne.on(f,()=>{l.killed===!1&&l.exitCode===null&&l.kill(f)})});let u=this._exitCallback;l.on("close",c=>{c=c??1,u?u(new Ku(c,"commander.executeSubCommandAsync","(close)")):Ne.exit(c)}),l.on("error",c=>{if(c.code==="ENOENT"){let f=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",p=`'${o}' does not exist
15
+ (Did you mean ${n[0]}?)`:""}ug.suggestSimilar=cC});var mg=E(pg=>{var fC=V("node:events").EventEmitter,Ju=V("node:child_process"),_r=V("node:path"),Ku=V("node:fs"),Ne=V("node:process"),{Argument:dC,humanReadableArgName:hC}=Lo(),{CommanderError:Yu}=Js(),{Help:pC}=zu(),{Option:fg,DualOptions:mC}=Wu(),{suggestSimilar:dg}=cg(),Xu=class t extends fC{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",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._outputConfiguration={writeOut:r=>Ne.stdout.write(r),writeErr:r=>Ne.stderr.write(r),getOutHelpWidth:()=>Ne.stdout.isTTY?Ne.stdout.columns:void 0,getErrHelpWidth:()=>Ne.stderr.isTTY?Ne.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let s=r,i=n;typeof s=="object"&&s!==null&&(i=s,s=null),i=i||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),l=this.createCommand(o);return s&&(l.description(s),l._executableHandler=!0),i.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(i.noHelp||i.hidden),l._executableFile=i.executableFile||null,a&&l.arguments(a),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),s?this:l}createCommand(e){return new t(e)}createHelp(){return Object.assign(new pC,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
16
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new dC(e,r)}argument(e,r,n,s){let i=this.createArgument(e,r);return typeof n=="function"?i.default(s).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,s]=e.match(/([^ ]+) *(.*)/),i=r??"display help for command",o=this.createCommand(n);return o.helpOption(!1),s&&o.arguments(s),i&&o.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=o,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,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(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
17
+ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Yu(e,r,n)),Ne.exit(e)}action(e){let r=n=>{let s=this.registeredArguments.length,i=n.slice(0,s);return this._storeOptionsAsProperties?i[s]=this:i[s]=this.opts(),i.push(this),e.apply(this,i)};return this._actionHandler=r,this}createOption(e,r){return new fg(e,r)}_callParseArg(e,r,n,s){try{return e.parseArg(r,n)}catch(i){if(i.code==="commander.invalidArgument"){let o=`${s} ${i.message}`;this.error(o,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
18
+ - already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=s=>[s.name()].concat(s.aliases()),n=r(e).find(s=>this._findCommand(s));if(n){let s=r(this._findCommand(n)).join("|"),i=r(e).join("|");throw new Error(`cannot add command '${i}' as already have command '${s}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let i=e.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let s=(i,o,a)=>{i==null&&e.presetArg!==void 0&&(i=e.presetArg);let l=this.getOptionValue(n);i!==null&&e.parseArg?i=this._callParseArg(e,i,l,o):i!==null&&e.variadic&&(i=e._concatValue(i,l)),i==null&&(e.negate?i=!1:e.isBoolean()||e.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,a)};return this.on("option:"+r,i=>{let o=`error: option '${e.flags}' argument '${i}' is invalid.`;s(i,o,"cli")}),e.envVar&&this.on("optionEnv:"+r,i=>{let o=`error: option '${e.flags}' value '${i}' from env '${e.envVar}' is invalid.`;s(i,o,"env")}),this}_optionEx(e,r,n,s,i){if(typeof r=="object"&&r instanceof fg)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,n);if(o.makeOptionMandatory(!!e.mandatory),typeof s=="function")o.default(i).argParser(s);else if(s instanceof RegExp){let a=s;s=(l,u)=>{let c=a.exec(l);return c?c[0]:u},o.default(i).argParser(s)}else o.default(s);return this.addOption(o)}option(e,r,n,s){return this._optionEx({},e,r,n,s)}requiredOption(e,r,n,s){return this._optionEx({mandatory:!0},e,r,n,s)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,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(e=!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=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){Ne.versions?.electron&&(r.from="electron");let s=Ne.execArgv??[];(s.includes("-e")||s.includes("--eval")||s.includes("-p")||s.includes("--print"))&&(r.from="eval")}e===void 0&&(e=Ne.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":Ne.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.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",n}parse(e,r){let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_executeSubCommand(e,r){r=r.slice();let n=!1,s=[".js",".ts",".tsx",".mjs",".cjs"];function i(c,f){let p=_r.resolve(c,f);if(Ku.existsSync(p))return p;if(s.includes(_r.extname(f)))return;let h=s.find(d=>Ku.existsSync(`${p}${d}`));if(h)return`${p}${h}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let c;try{c=Ku.realpathSync(this._scriptPath)}catch{c=this._scriptPath}a=_r.resolve(_r.dirname(c),a)}if(a){let c=i(a,o);if(!c&&!e._executableFile&&this._scriptPath){let f=_r.basename(this._scriptPath,_r.extname(this._scriptPath));f!==this._name&&(c=i(a,`${f}-${e._name}`))}o=c||o}n=s.includes(_r.extname(o));let l;Ne.platform!=="win32"?n?(r.unshift(o),r=hg(Ne.execArgv).concat(r),l=Ju.spawn(Ne.argv[0],r,{stdio:"inherit"})):l=Ju.spawn(o,r,{stdio:"inherit"}):(r.unshift(o),r=hg(Ne.execArgv).concat(r),l=Ju.spawn(Ne.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{Ne.on(f,()=>{l.killed===!1&&l.exitCode===null&&l.kill(f)})});let u=this._exitCallback;l.on("close",c=>{c=c??1,u?u(new Yu(c,"commander.executeSubCommandAsync","(close)")):Ne.exit(c)}),l.on("error",c=>{if(c.code==="ENOENT"){let f=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",p=`'${o}' does not exist
19
19
  - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${f}`;throw new Error(p)}else if(c.code==="EACCES")throw new Error(`'${o}' not executable`);if(!u)Ne.exit(1);else{let f=new Ku(1,"commander.executeSubCommandAsync","(error)");f.nestedError=c,u(f)}}),this.runningCommand=l}_dispatchSubcommand(e,r,n){let s=this._findCommand(e);s||this.help({error:!0});let i;return i=this._chainOrCallSubCommandHook(i,s,"preSubcommand"),i=this._chainOrCall(i,()=>{if(s._executableHandler)this._executeSubCommand(s,r.concat(n));else return s._parseCommand(r,n)}),i}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,s,i)=>{let o=s;if(s!==null&&n.parseArg){let a=`error: command-argument value '${s}' is invalid for argument '${n.name()}'.`;o=this._callParseArg(n,s,i,a)}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,s)=>{let i=n.defaultValue;n.variadic?s<this.args.length?(i=this.args.slice(s),n.parseArg&&(i=i.reduce((o,a)=>e(n,a,o),n.defaultValue))):i===void 0&&(i=[]):s<this.args.length&&(i=this.args[s],n.parseArg&&(i=e(n,i,n.defaultValue))),r[s]=i}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let n=e,s=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(o=>{s.push({hookedCommand:i,callback:o})})}),r==="postAction"&&s.reverse(),s.forEach(i=>{n=this._chainOrCall(n,()=>i.callback(i.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let s=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(i=>{s=this._chainOrCall(s,()=>i(this,r))}),s}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){s(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(i,e,r)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(i))s(),this._processArguments(),this.parent.emit(i,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(s(),this._processArguments())}else this.commands.length?(s(),this.help({error:!0})):(s(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let s=n.attributeName();return this.getOptionValue(s)===void 0?!1:this.getOptionValueSource(s)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let s=e.find(i=>n.conflictsWith.includes(i.attributeName()));s&&this._conflictingOption(n,s)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],s=r,i=e.slice();function o(l){return l.length>1&&l[0]==="-"}let a=null;for(;i.length;){let l=i.shift();if(l==="--"){s===n&&s.push(l),s.push(...i);break}if(a&&!o(l)){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let u=this._findOption(l);if(u){if(u.required){let c=i.shift();c===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,c)}else if(u.optional){let c=null;i.length>0&&!o(i[0])&&(c=i.shift()),this.emit(`option:${u.name()}`,c)}else this.emit(`option:${u.name()}`);a=u.variadic?u:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let u=this._findOption(`-${l[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,l.slice(2)):(this.emit(`option:${u.name()}`),i.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let u=l.indexOf("="),c=this._findOption(l.slice(0,u));if(c&&(c.required||c.optional)){this.emit(`option:${c.name()}`,l.slice(u+1));continue}}if(o(l)&&(s=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(l)){r.push(l),i.length>0&&n.push(...i);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),i.length>0&&r.push(...i);break}else if(this._defaultCommandName){n.push(l),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){s.push(l),i.length>0&&s.push(...i);break}s.push(l)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;n<r;n++){let s=this.options[n].attributeName();e[s]=s===this._versionOptionName?this._version:this[s]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
21
+ - ${f}`;throw new Error(p)}else if(c.code==="EACCES")throw new Error(`'${o}' not executable`);if(!u)Ne.exit(1);else{let f=new Yu(1,"commander.executeSubCommandAsync","(error)");f.nestedError=c,u(f)}}),this.runningCommand=l}_dispatchSubcommand(e,r,n){let s=this._findCommand(e);s||this.help({error:!0});let i;return i=this._chainOrCallSubCommandHook(i,s,"preSubcommand"),i=this._chainOrCall(i,()=>{if(s._executableHandler)this._executeSubCommand(s,r.concat(n));else return s._parseCommand(r,n)}),i}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,s,i)=>{let o=s;if(s!==null&&n.parseArg){let a=`error: command-argument value '${s}' is invalid for argument '${n.name()}'.`;o=this._callParseArg(n,s,i,a)}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,s)=>{let i=n.defaultValue;n.variadic?s<this.args.length?(i=this.args.slice(s),n.parseArg&&(i=i.reduce((o,a)=>e(n,a,o),n.defaultValue))):i===void 0&&(i=[]):s<this.args.length&&(i=this.args[s],n.parseArg&&(i=e(n,i,n.defaultValue))),r[s]=i}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let n=e,s=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(o=>{s.push({hookedCommand:i,callback:o})})}),r==="postAction"&&s.reverse(),s.forEach(i=>{n=this._chainOrCall(n,()=>i.callback(i.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let s=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(i=>{s=this._chainOrCall(s,()=>i(this,r))}),s}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){s(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(i,e,r)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(i))s(),this._processArguments(),this.parent.emit(i,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(s(),this._processArguments())}else this.commands.length?(s(),this.help({error:!0})):(s(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let s=n.attributeName();return this.getOptionValue(s)===void 0?!1:this.getOptionValueSource(s)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let s=e.find(i=>n.conflictsWith.includes(i.attributeName()));s&&this._conflictingOption(n,s)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],s=r,i=e.slice();function o(l){return l.length>1&&l[0]==="-"}let a=null;for(;i.length;){let l=i.shift();if(l==="--"){s===n&&s.push(l),s.push(...i);break}if(a&&!o(l)){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let u=this._findOption(l);if(u){if(u.required){let c=i.shift();c===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,c)}else if(u.optional){let c=null;i.length>0&&!o(i[0])&&(c=i.shift()),this.emit(`option:${u.name()}`,c)}else this.emit(`option:${u.name()}`);a=u.variadic?u:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let u=this._findOption(`-${l[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,l.slice(2)):(this.emit(`option:${u.name()}`),i.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let u=l.indexOf("="),c=this._findOption(l.slice(0,u));if(c&&(c.required||c.optional)){this.emit(`option:${c.name()}`,l.slice(u+1));continue}}if(o(l)&&(s=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(l)){r.push(l),i.length>0&&n.push(...i);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),i.length>0&&r.push(...i);break}else if(this._defaultCommandName){n.push(l),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){s.push(l),i.length>0&&s.push(...i);break}s.push(l)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;n<r;n++){let s=this.options[n].attributeName();e[s]=s===this._versionOptionName?this._version:this[s]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0}));let n=r||{},s=n.exitCode||1,i=n.code||"commander.error";this._exit(s,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Ne.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Ne.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new cC(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(s=>!r(s)).forEach(s=>{this.setOptionValueWithSource(s,n.implied[s],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=o=>{let a=o.attributeName(),l=this.getOptionValue(a),u=this.options.find(f=>f.negate&&a===f.attributeName()),c=this.options.find(f=>!f.negate&&a===f.attributeName());return u&&(u.presetArg===void 0&&l===!1||u.presetArg!==void 0&&l===u.presetArg)?u:c||o},s=o=>{let a=n(o),l=a.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},i=`error: ${s(e)} cannot be used with ${s(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let s=[],i=this;do{let o=i.createHelp().visibleOptions(i).filter(a=>a.long).map(a=>a.long);s=s.concat(o),i=i.parent}while(i&&!i._enablePositionalOptions);r=fg(e,s)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let s=[];this.createHelp().visibleCommands(this).forEach(i=>{s.push(i.name()),i.alias()&&s.push(i.alias())}),r=fg(e,s)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let s=this.createOption(r,n);return this._versionOptionName=s.attributeName(),this._registerOption(s),this.on("option:"+s.name(),()=>{this._outputConfiguration.writeOut(`${e}
25
- `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===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]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let s=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${s}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>lC(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=_r.basename(e,_r.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(e){e=e||{};let r={error:!!e.error},n;return r.error?n=s=>this._outputConfiguration.writeErr(s):n=s=>this._outputConfiguration.writeOut(s),r.write=e.write||n,r.command=this,r}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(i=>i.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation(n);if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(i=>i.emit("afterAllHelp",n))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=Ne.exitCode||0;r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
24
+ `),this.outputHelp({error:!0}));let n=r||{},s=n.exitCode||1,i=n.code||"commander.error";this._exit(s,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Ne.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Ne.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new mC(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(s=>!r(s)).forEach(s=>{this.setOptionValueWithSource(s,n.implied[s],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=o=>{let a=o.attributeName(),l=this.getOptionValue(a),u=this.options.find(f=>f.negate&&a===f.attributeName()),c=this.options.find(f=>!f.negate&&a===f.attributeName());return u&&(u.presetArg===void 0&&l===!1||u.presetArg!==void 0&&l===u.presetArg)?u:c||o},s=o=>{let a=n(o),l=a.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},i=`error: ${s(e)} cannot be used with ${s(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let s=[],i=this;do{let o=i.createHelp().visibleOptions(i).filter(a=>a.long).map(a=>a.long);s=s.concat(o),i=i.parent}while(i&&!i._enablePositionalOptions);r=dg(e,s)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let s=[];this.createHelp().visibleCommands(this).forEach(i=>{s.push(i.name()),i.alias()&&s.push(i.alias())}),r=dg(e,s)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let s=this.createOption(r,n);return this._versionOptionName=s.attributeName(),this._registerOption(s),this.on("option:"+s.name(),()=>{this._outputConfiguration.writeOut(`${e}
25
+ `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===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]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let s=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${s}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>hC(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=_r.basename(e,_r.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(e){e=e||{};let r={error:!!e.error},n;return r.error?n=s=>this._outputConfiguration.writeErr(s):n=s=>this._outputConfiguration.writeOut(s),r.write=e.write||n,r.command=this,r}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(i=>i.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation(n);if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(i=>i.emit("afterAllHelp",n))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=Ne.exitCode||0;r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${n.join("', '")}'`);let s=`${e}Help`;return this.on(s,i=>{let o;typeof r=="function"?o=r({error:i.error,command:i.command}):o=r,o&&i.write(`${o}
27
- `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(s=>r.is(s))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function dg(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",s="9229",i;return(i=e.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?s=i[3]:n=i[3]):(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],n=i[3],s=i[4]),r&&s!=="0"?`${r}=${n}:${parseInt(s)+1}`:e})}hg.Command=Yu});var _g=E(At=>{var{Argument:mg}=xo(),{Command:Xu}=pg(),{CommanderError:fC,InvalidArgumentError:gg}=Ws(),{Help:dC}=Vu(),{Option:yg}=Gu();At.program=new Xu;At.createCommand=t=>new Xu(t);At.createOption=(t,e)=>new yg(t,e);At.createArgument=(t,e)=>new mg(t,e);At.Command=Xu;At.Option=yg;At.Argument=mg;At.Help=dC;At.CommanderError=fC;At.InvalidArgumentError=gg;At.InvalidOptionArgumentError=gg});var vg=E((E8,bg)=>{"use strict";function hC(t){var e=new t,r=e;function n(){var i=e;return i.next?e=i.next:(e=new t,r=e),i.next=null,i}function s(i){r.next=i,r=i}return{get:n,release:s}}bg.exports=hC});var Rg=E((b8,Qu)=>{"use strict";var pC=vg();function wg(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=pC(mC),s=null,i=null,o=0,a=null,l={push:m,drain:mt,saturated:mt,pause:c,paused:!1,get concurrency(){return r},set concurrency(T){if(!(T>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=T,!l.paused)for(;s&&o<r;)o++,S()},running:u,resume:h,idle:d,length:f,getQueue:p,unshift:g,empty:mt,kill:b,killAndDrain:_,error:R,abort:y};return l;function u(){return o}function c(){l.paused=!0}function f(){for(var T=s,O=0;T;)T=T.next,O++;return O}function p(){for(var T=s,O=[];T;)O.push(T.value),T=T.next;return O}function h(){if(l.paused){if(l.paused=!1,s===null){o++,S();return}for(;s&&o<r;)o++,S()}}function d(){return o===0&&l.length()===0}function m(T,O){var w=n.get();w.context=t,w.release=S,w.value=T,w.callback=O||mt,w.errorHandler=a,o>=r||l.paused?i?(i.next=w,i=w):(s=w,i=w,l.saturated()):(o++,e.call(t,w.value,w.worked))}function g(T,O){var w=n.get();w.context=t,w.release=S,w.value=T,w.callback=O||mt,w.errorHandler=a,o>=r||l.paused?s?(w.next=s,s=w):(s=w,i=w,l.saturated()):(o++,e.call(t,w.value,w.worked))}function S(T){T&&n.release(T);var O=s;O&&o<=r?l.paused?o--:(i===s&&(i=null),s=O.next,O.next=null,e.call(t,O.value,O.worked),i===null&&l.empty()):--o===0&&l.drain()}function b(){s=null,i=null,l.drain=mt}function _(){s=null,i=null,l.drain(),l.drain=mt}function y(){var T=s;for(s=null,i=null;T;){var O=T.next,w=T.callback,$=T.errorHandler,v=T.value,P=T.context;T.value=null,T.callback=mt,T.errorHandler=null,$&&$(new Error("abort"),v),w.call(P,new Error("abort")),T.release(T),T=O}l.drain=mt}function R(T){a=T}}function mt(){}function mC(){this.value=null,this.callback=mt,this.next=null,this.release=mt,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var s=t.callback,i=t.errorHandler,o=t.value;t.value=null,t.callback=mt,t.errorHandler&&i(r,o),s.call(t.context,r,n),t.release(t)}}function gC(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(c,f){e.call(this,c).then(function(p){f(null,p)},f)}var s=wg(t,n,r),i=s.push,o=s.unshift;return s.push=a,s.unshift=l,s.drained=u,s;function a(c){var f=new Promise(function(p,h){i(c,function(d,m){if(d){h(d);return}p(m)})});return f.catch(mt),f}function l(c){var f=new Promise(function(p,h){o(c,function(d,m){if(d){h(d);return}p(m)})});return f.catch(mt),f}function u(){var c=new Promise(function(f){process.nextTick(function(){if(s.idle())f();else{var p=s.drain;s.drain=function(){typeof p=="function"&&p(),f(),s.drain=p}}})});return c}}Qu.exports=wg;Qu.exports.promise=gC});var Zu=E((v8,Js)=>{"use strict";var{format:yC}=V("node:util");function _C(){return`${this.name} [${this.code}]: ${this.message}`}var Lo=Symbol.for("fastify-error-generic");function Un(t,e,r=500,n=Error,s=Un.captureStackTrace){let i=t===Lo;if(i&&(t="FST_ERR"),!t)throw new Error("Fastify error code must not be empty");if(!e)throw new Error("Fastify error message must not be empty");t=t.toUpperCase(),!r&&(r=void 0);let o=Symbol.for(`fastify-error ${t}`);function a(...l){if(!new.target)return new a(...l);this.code=t,this.name="FastifyError",this.statusCode=r;let u=l.length-1;u!==-1&&l[u]&&typeof l[u]=="object"&&"cause"in l[u]&&(this.cause=l.pop().cause),this.message=yC(e,...l),Error.stackTraceLimit&&s&&Error.captureStackTrace(this,a)}return a.prototype=Object.create(n.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0},[Lo]:{value:!0,enumerable:!1,writable:!1,configurable:!1},[o]:{value:!0,enumerable:!1,writable:!1,configurable:!1}}),i?Object.defineProperty(a,Symbol.hasInstance,{value(l){return l&&l[Lo]},configurable:!1,writable:!1,enumerable:!1}):Object.defineProperty(a,Symbol.hasInstance,{value(l){return l&&l[o]},configurable:!1,writable:!1,enumerable:!1}),a.prototype[Symbol.toStringTag]="Error",a.prototype.toString=_C,a}Un.captureStackTrace=!0;var SC=Un(Lo,"Fastify Error",500,Error);Js.exports=Un;Js.exports.FastifyError=SC;Js.exports.default=Un;Js.exports.createError=Un});var qo=E((w8,Og)=>{"use strict";var{createError:Dr}=Zu();Og.exports={AVV_ERR_EXPOSE_ALREADY_DEFINED:Dr("AVV_ERR_EXPOSE_ALREADY_DEFINED","'%s' is already defined, specify an expose option for '%s'"),AVV_ERR_ATTRIBUTE_ALREADY_DEFINED:Dr("AVV_ERR_ATTRIBUTE_ALREADY_DEFINED","'%s' is already defined"),AVV_ERR_CALLBACK_NOT_FN:Dr("AVV_ERR_CALLBACK_NOT_FN","Callback for '%s' hook is not a function. Received: '%s'"),AVV_ERR_PLUGIN_NOT_VALID:Dr("AVV_ERR_PLUGIN_NOT_VALID","Plugin must be a function or a promise. Received: '%s'"),AVV_ERR_ROOT_PLG_BOOTED:Dr("AVV_ERR_ROOT_PLG_BOOTED","Root plugin has already booted"),AVV_ERR_PARENT_PLG_LOADED:Dr("AVV_ERR_PARENT_PLG_LOADED","Impossible to load '%s' plugin because the parent '%s' was already loaded"),AVV_ERR_READY_TIMEOUT:Dr("AVV_ERR_READY_TIMEOUT","Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise"),AVV_ERR_PLUGIN_EXEC_TIMEOUT:Dr("AVV_ERR_PLUGIN_EXEC_TIMEOUT","Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise")}});var Bn=E((R8,Tg)=>{"use strict";var EC=Symbol("avvio.Boot"),bC=Symbol("isOnCloseHandler"),vC=Symbol("avvio.ThenifyDoNotWrap"),wC=Symbol("avvio.TimeTree.untrackNode"),RC=Symbol("avvio.TimeTree.trackNode"),OC=Symbol("avvio.TimeTree.getParent"),TC=Symbol("avvio.TimeTree.getNode"),$C=Symbol("avvio.TimeTree.addNode"),PC=Symbol.for("plugin-meta");Tg.exports={kAvvio:EC,kIsOnCloseHandler:bC,kThenifyDoNotWrap:vC,kUntrackNode:wC,kTrackNode:RC,kGetParent:OC,kGetNode:TC,kAddNode:$C,kPluginMeta:PC}});var kg=E((O8,Ng)=>{"use strict";var{kUntrackNode:$g,kTrackNode:ec,kGetParent:Pg,kGetNode:Ag,kAddNode:Cg}=Bn(),tc=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[ec](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[$g](e){this.tableId.delete(e.id);let r=this.tableLabel.get(e.label);r.pop(),r.length===0&&this.tableLabel.delete(e.label)}[Pg](e){if(e===null)return null;if(this.tableLabel.has(e)){let r=this.tableLabel.get(e);return r[r.length-1]}else return null}[Ag](e){return this.tableId.get(e)}[Cg](e,r,n){let s=this[Pg](e);if(s===null)return this.root={parent:null,id:"root",label:r,nodes:[],start:n,stop:null,diff:-1},this[ec](this.root),this.root.id;let o=`${r}-${Math.random()}`,a={parent:e,id:o,label:r,nodes:[],start:n,stop:null,diff:-1};return s.nodes.push(a),this[ec](a),o}start(e,r,n=Date.now()){return this[Cg](e,r,n)}stop(e,r=Date.now()){let n=this[Ag](e);n&&(n.stop=r,n.diff=n.stop-n.start||0,this[$g](n))}toJSON(){return Object.assign({},this.root)}prettyPrint(){return Ig(this.toJSON())}};function Ig(t,e=""){let r=e,n=t.nodes.length,s=n-1;r+=`${t.label} ${t.diff} ms
28
- `;for(let i=0;i<n;++i){let o=t.nodes[i],a=e+(i===s?" ":"\u2502 ");r+=e,r+=i===s?"\u2514\u2500":"\u251C\u2500",r+=o.nodes.length===0?"\u2500 ":"\u252C ",r+=Ig(o,a).slice(e.length+2)}return r}Ng.exports={TimeTree:tc}});var jo=E((T8,xg)=>{"use strict";var{debuglog:AC}=V("node:util"),CC=AC("avvio");xg.exports={debug:CC}});var qg=E(($8,Lg)=>{"use strict";function IC(){let t={resolve:null,reject:null,promise:null};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}Lg.exports={createPromise:IC}});var Dg=E((P8,jg)=>{"use strict";var{kPluginMeta:rc}=Bn();function NC(t,e){return t[rc]&&t[rc].name?t[rc].name:e&&e.name?e.name:t.name?t.name:t.toString().split(`
29
- `).slice(0,2).map(r=>r.trim()).join(" -- ")}jg.exports={getPluginName:NC}});var Do=E((A8,Fg)=>{"use strict";function kC(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}Fg.exports={isPromiseLike:kC}});var Hg=E((C8,Mg)=>{"use strict";var{EventEmitter:xC}=V("node:events"),{inherits:LC}=V("node:util"),{debug:Ge}=jo(),{createPromise:qC}=qg(),{AVV_ERR_PLUGIN_EXEC_TIMEOUT:jC}=qo(),{getPluginName:DC}=Dg(),{isPromiseLike:FC}=Do();function Gn(t,e,r,n,s){this.queue=t,this.func=e,this.options=r,this.isAfter=n,this.timeout=s,this.started=!1,this.name=DC(e,r),this.queue.pause(),this._error=null,this.loaded=!1,this._promise=null,this.startTime=null}LC(Gn,xC);Gn.prototype.exec=function(t,e){Ge("exec",this.name),this.server=t;let r=this.func,n=this.name,s=!1;this.options=typeof this.options=="function"?this.options(this.server):this.options;let i=null,o=l=>{if(s){Ge("loading complete",n);return}this._error=l,Ge(l?"exec errored":"exec completed",n),s=!0,i&&clearTimeout(i),e(l)};this.timeout>0&&(Ge("setting up timeout",n,this.timeout),i=setTimeout(function(){Ge("timed out",n),i=null;let l=new jC(n);l.fn=r,o(l)},this.timeout)),this.started=!0,this.startTime=Date.now(),this.emit("start",this.server?this.server.name:null,this.name,Date.now());let a=r(this.server,this.options,o);FC(a)?(Ge("exec: resolving promise",n),a.then(()=>process.nextTick(o),l=>process.nextTick(o,l))):r.length<3&&o()};Gn.prototype.loadedSoFar=function(){if(Ge("loadedSoFar",this.name),this.loaded)return Promise.resolve();let t=()=>{this.server.after((r,n)=>{this._error=r,this.queue.pause(),this._promise&&(r?(Ge("rejecting promise",this.name,r),this._promise.reject(r)):(Ge("resolving promise",this.name),this._promise.resolve()),this._promise=null),process.nextTick(n,r)}),this.queue.resume()},e;return this._promise?e=Promise.resolve():(this._promise=qC(),e=this._promise.promise,this.server?t():this.on("start",t)),e};Gn.prototype.enqueue=function(t,e){Ge("enqueue",this.name,t.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.queue.push(t,e)};Gn.prototype.finish=function(t,e){Ge("finish",this.name,t);let r=()=>{this.loaded||(Ge("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,e(t))};if(t){this._promise&&(this._promise.reject(t),this._promise=null),r();return}let n=()=>{if(Ge("check",this.name,this.queue.length(),this.queue.running(),this._promise),this.queue.length()===0&&this.queue.running()===0)if(this._promise){let s=()=>{Ge("wrap"),queueMicrotask(n)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else r();else Ge("delayed",this.name),this.queue.drain=()=>{Ge("drain",this.name),this.queue.drain=MC,queueMicrotask(n)}};queueMicrotask(n),this.queue.resume()};function MC(){}Mg.exports={Plugin:Gn}});var zg=E((I8,Vg)=>{"use strict";var{AVV_ERR_PLUGIN_NOT_VALID:nc}=qo();function HC(t){if(!(t&&(typeof t=="function"||typeof t.then=="function")))throw Array.isArray(t)?new nc("array"):t===null?new nc("null"):new nc(typeof t)}Vg.exports={validatePlugin:HC}});var Bg=E((N8,Ug)=>{"use strict";function VC(t){return t!==null&&typeof t=="object"&&typeof t.default=="function"}Ug.exports={isBundledOrTypescriptPlugin:VC}});var Jg=E((k8,Wg)=>{"use strict";var{debug:Gg}=jo(),{kThenifyDoNotWrap:sc}=Bn();function zC(){if(this.booted){Gg("thenify returning undefined because we are already booted");return}if(this[sc]){this[sc]=!1;return}return Gg("thenify"),(t,e)=>this._loadRegistered().then(()=>(this[sc]=!0,t(this._server)),e)}Wg.exports={thenify:zC}});var Yg=E((x8,Kg)=>{"use strict";var{isPromiseLike:UC}=Do(),{kAvvio:BC}=Bn();function GC(t,e,r){let n=t.apply(t,e);UC(n)&&!n[BC]?n.then(()=>process.nextTick(r),s=>process.nextTick(r,s)):r&&process.nextTick(r)}Kg.exports={executeWithThenable:GC}});var iy=E((L8,sy)=>{"use strict";var Fo=Rg(),WC=V("node:events").EventEmitter,JC=V("node:util").inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Ks,AVV_ERR_CALLBACK_NOT_FN:Wn,AVV_ERR_ROOT_PLG_BOOTED:KC,AVV_ERR_READY_TIMEOUT:YC,AVV_ERR_ATTRIBUTE_ALREADY_DEFINED:XC}=qo(),{kAvvio:Zg,kIsOnCloseHandler:ey}=Bn(),{TimeTree:QC}=kg(),{Plugin:ty}=Hg(),{debug:Jn}=jo(),{validatePlugin:ZC}=zg(),{isBundledOrTypescriptPlugin:eI}=Bg(),{isPromiseLike:tI}=Do(),{thenify:ry}=Jg(),{executeWithThenable:Xg}=Yg();function je(t,e,r){if(typeof t=="function"&&arguments.length===1&&(r=t,e={},t=null),typeof e=="function"&&(r=e,e={}),e=e||{},e.autostart=e.autostart!==!1,e.timeout=Number(e.timeout)||0,e.expose=e.expose||{},!new.target)return new je(t,e,r);this._server=t||this,this._opts=e,t&&this._expose(),this._current=[],this._error=null,this._lastUsed=null,this.setMaxListeners(0),r&&this.once("start",r),this.started=!1,this.booted=!1,this.pluginTree=new QC,this._readyQ=Fo(this,ny,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Qg},this._closeQ=Fo(this,nI,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Qg},this._doStart=null;let n=this;this._root=new ty(Fo(this,this._loadPluginNextTick,1),function(i,o,a){n._doStart=a,o.autostart&&n.start()},e,!1,0),this._trackPluginLoading(this._root),this._loadPlugin(this._root,s=>{Jn("root plugin ready");try{this.emit("preReady"),this._root=null}catch(i){s=s||this._error||i}if(s){if(this._error=s,this._readyQ.length()===0)throw s}else this.booted=!0;this._readyQ.resume()})}JC(je,WC);je.prototype.start=function(){return this.started=!0,process.nextTick(this._doStart),this};je.prototype.override=function(t,e,r){return t};je.prototype[Zg]=!0;je.prototype.use=function(t,e){return this._lastUsed=this._addPlugin(t,e,!1),this};je.prototype._loadRegistered=function(){let t=this._current[0];return!this.started&&!this.booted&&process.nextTick(()=>this._root.queue.resume()),t?t.loadedSoFar():Promise.resolve()};Object.defineProperty(je.prototype,"then",{get:ry});je.prototype._addPlugin=function(t,e,r){if(eI(t)&&(t=t.default),ZC(t),e=e||{},this.booted)throw new KC;let n=this._current[0],s=this._opts.timeout;if(!n.loaded&&n.timeout>0){let o=Date.now()-n.startTime;s=n.timeout-(o+3)}let i=new ty(Fo(this,this._loadPluginNextTick,1),t,e,r,s);if(this._trackPluginLoading(i),n.loaded)throw new Error(i.name,n.name);return n.enqueue(i,o=>{o&&(this._error=o)}),i};je.prototype._expose=function(){let e=this,r=e._server,{use:n="use",after:s="after",ready:i="ready",onClose:o="onClose",close:a="close"}=this._opts.expose;if(r[n])throw new Ks(n,"use");if(r[n]=function(l,u){return e.use(l,u),this},r[s])throw new Ks(s,"after");if(r[s]=function(l){return typeof l!="function"?e._loadRegistered():(e.after(ic(l,this)),this)},r[i])throw new Ks(i,"ready");if(r[i]=function(l){if(l&&typeof l!="function")throw new Wn(i,typeof l);return e.ready(l?ic(l,this):void 0)},r[o])throw new Ks(o,"onClose");if(r[o]=function(l){if(typeof l!="function")throw new Wn(o,typeof l);return e.onClose(sI(l,this)),this},r[a])throw new Ks(a,"close");if(r[a]=function(l){if(l&&typeof l!="function")throw new Wn(a,typeof l);return l?(e.close(ic(l,this)),this):e.close()},r.then)throw new XC("then");Object.defineProperty(r,"then",{get:ry.bind(e)}),r[Zg]=!0};je.prototype.after=function(t){if(!t)return this._loadRegistered();this._addPlugin(e.bind(this),{},!0);function e(r,n,s){ny.call(this,t,s)}return this};je.prototype.onClose=function(t){if(typeof t!="function")throw new Wn("onClose",typeof t);return t[ey]=!0,this._closeQ.unshift(t,e=>{e&&(this._error=e)}),this};je.prototype.close=function(t){let e;if(t){if(typeof t!="function")throw new Wn("close",typeof t)}else e=new Promise(function(r,n){t=function(s){if(s)return n(s);r()}});return this.ready(()=>{this._error=null,this._closeQ.push(t),process.nextTick(this._closeQ.resume.bind(this._closeQ))}),e};je.prototype.ready=function(t){if(t){if(typeof t!="function")throw new Wn("ready",typeof t);this._readyQ.push(t),queueMicrotask(this.start.bind(this));return}return new Promise((e,r)=>{this._readyQ.push(s),this.start();let n=this._current[0].server;function s(i,o,a){i?r(i):e(n),process.nextTick(a)}})};je.prototype._trackPluginLoading=function(t){let e=this._current[0]?.name||null;t.once("start",(r,n,s)=>{let i=this.pluginTree.start(e||null,n,s);t.once("loaded",(o,a,l)=>{this.pluginTree.stop(i,l)})})};je.prototype.prettyPrint=function(){return this.pluginTree.prettyPrint()};je.prototype.toJSON=function(){return this.pluginTree.toJSON()};je.prototype._loadPlugin=function(t,e){let r=this;if(tI(t.func)){t.func.then(o=>{typeof o.default=="function"&&(o=o.default),t.func=o,this._loadPlugin(t,e)},e);return}let n=r._current[0];if(r._current.unshift(t),r._error&&!t.isAfter){Jn("skipping loading of plugin as instance errored and it is not an after",t.name),process.nextTick(i);return}let s=n&&n.server||r._server;if(!t.isAfter)try{s=r.override(s,t.func,t.options)}catch(o){return Jn("override errored",t.name),i(o)}t.exec(s,i);function i(o){t.finish(o,a=>{r._current.shift(),e(a)})}};je.prototype._loadPluginNextTick=function(t,e){process.nextTick(this._loadPlugin.bind(this),t,e)};function Qg(){}function ny(t,e){let r=this._server,n=this._error;if(this._error=null,t.length===0)this._error=n,Xg(t,[],e);else if(t.length===1)Xg(t,[n],e);else if(this._opts.timeout===0){let s=i=>{this._error=i,e(this._error)};t.length===2?t(n,s):t(n,r,s)}else rI.call(this,t,n,r,e)}function rI(t,e,r,n){let s=t.unwrappedName??t.name;Jn("setting up ready timeout",s,this._opts.timeout);let i=setTimeout(()=>{Jn("timed out",s),i=null;let a=new YC(s);a.fn=t,this._error=a,n(a)},this._opts.timeout);t.length===2?t(e,o.bind(this)):t(e,r,o.bind(this));function o(a){i&&(clearTimeout(i),this._error=a,n(this._error))}}function nI(t,e){let r=this._server,n=t[ey];if(t.length===0||t.length===1){let s;n?s=t(r):s=t(this._error),s&&typeof s.then=="function"?(Jn("resolving close/onClose promise"),s.then(()=>process.nextTick(e),i=>process.nextTick(e,i))):process.nextTick(e)}else t.length===2?t(n?r:this._error,e):n?t(r,e):t(this._error,r,e)}function sI(t,e){return r.bind(e);function r(n,s){let i;t.length===0?(i=t(),i&&i.then?i.then(function(){process.nextTick(s)},s):process.nextTick(s)):t.length===1?(i=t(this),i&&i.then?i.then(function(){process.nextTick(s)},s):process.nextTick(s)):t(this,s)}}function ic(t,e){let r=n.bind(e);return r.unwrappedName=t.name,r;function n(s,i){let o;t?t.length===0?(o=t(),o&&o.then?o.then(function(){process.nextTick(i,s)},i):process.nextTick(i,s)):t.length===1?(o=t(s),o&&o.then?o.then(function(){process.nextTick(i)},i):process.nextTick(i)):t.length===2?t(s,i):t(s,this,i):process.nextTick(i)}}sy.exports=je});var De=E((q8,oy)=>{"use strict";var iI={kAvvioBoot:Symbol("fastify.avvioBoot"),kChildren:Symbol("fastify.children"),kServerBindings:Symbol("fastify.serverBindings"),kBodyLimit:Symbol("fastify.bodyLimit"),kSupportedHTTPMethods:Symbol("fastify.acceptedHTTPMethods"),kRoutePrefix:Symbol("fastify.routePrefix"),kLogLevel:Symbol("fastify.logLevel"),kLogSerializers:Symbol("fastify.logSerializers"),kHooks:Symbol("fastify.hooks"),kContentTypeParser:Symbol("fastify.contentTypeParser"),kState:Symbol("fastify.state"),kOptions:Symbol("fastify.options"),kDisableRequestLogging:Symbol("fastify.disableRequestLogging"),kPluginNameChain:Symbol("fastify.pluginNameChain"),kRouteContext:Symbol("fastify.context"),kGenReqId:Symbol("fastify.genReqId"),kHttp2ServerSessions:Symbol("fastify.http2ServerSessions"),kSchemaController:Symbol("fastify.schemaController"),kSchemaHeaders:Symbol("headers-schema"),kSchemaParams:Symbol("params-schema"),kSchemaQuerystring:Symbol("querystring-schema"),kSchemaBody:Symbol("body-schema"),kSchemaResponse:Symbol("response-schema"),kSchemaErrorFormatter:Symbol("fastify.schemaErrorFormatter"),kSchemaVisited:Symbol("fastify.schemas.visited"),kRequest:Symbol("fastify.Request"),kRequestPayloadStream:Symbol("fastify.RequestPayloadStream"),kRequestAcceptVersion:Symbol("fastify.RequestAcceptVersion"),kRequestCacheValidateFns:Symbol("fastify.request.cache.validateFns"),kRequestOriginalUrl:Symbol("fastify.request.originalUrl"),kFourOhFour:Symbol("fastify.404"),kCanSetNotFoundHandler:Symbol("fastify.canSetNotFoundHandler"),kFourOhFourLevelInstance:Symbol("fastify.404LogLevelInstance"),kFourOhFourContext:Symbol("fastify.404ContextKey"),kDefaultJsonParse:Symbol("fastify.defaultJSONParse"),kReply:Symbol("fastify.Reply"),kReplySerializer:Symbol("fastify.reply.serializer"),kReplyIsError:Symbol("fastify.reply.isError"),kReplyHeaders:Symbol("fastify.reply.headers"),kReplyTrailers:Symbol("fastify.reply.trailers"),kReplyHasStatusCode:Symbol("fastify.reply.hasStatusCode"),kReplyHijacked:Symbol("fastify.reply.hijacked"),kReplyStartTime:Symbol("fastify.reply.startTime"),kReplyNextErrorHandler:Symbol("fastify.reply.nextErrorHandler"),kReplyEndTime:Symbol("fastify.reply.endTime"),kReplyErrorHandlerCalled:Symbol("fastify.reply.errorHandlerCalled"),kReplyIsRunningOnErrorHook:Symbol("fastify.reply.isRunningOnErrorHook"),kReplySerializerDefault:Symbol("fastify.replySerializerDefault"),kReplyCacheSerializeFns:Symbol("fastify.reply.cache.serializeFns"),kTestInternals:Symbol("fastify.testInternals"),kErrorHandler:Symbol("fastify.errorHandler"),kErrorHandlerAlreadySet:Symbol("fastify.errorHandlerAlreadySet"),kChildLoggerFactory:Symbol("fastify.childLoggerFactory"),kHasBeenDecorated:Symbol("fastify.hasBeenDecorated"),kKeepAliveConnections:Symbol("fastify.keepAliveConnections"),kRouteByFastify:Symbol("fastify.routeByFastify")};oy.exports=iI});var ly=E((j8,Mo)=>{"use strict";var{format:oc}=V("node:util");function oI(t){return ay({...t,name:"DeprecationWarning"})}function ay({name:t,code:e,message:r,unlimited:n=!1}={}){if(!t)throw new Error("Warning name must not be empty");if(!e)throw new Error("Warning code must not be empty");if(!r)throw new Error("Warning message must not be empty");if(typeof n!="boolean")throw new Error("Warning opts.unlimited must be a boolean");e=e.toUpperCase();let s={[t]:function(o,a,l){i.emitted===!0&&i.unlimited!==!0||(i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code))}};n&&(s={[t]:function(o,a,l){i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code)}});let i=s[t];return i.emitted=!1,i.message=r,i.unlimited=n,i.code=e,i.format=function(o,a,l){let u;return o&&a&&l?u=oc(r,o,a,l):o&&a?u=oc(r,o,a):o?u=oc(r,o):u=r,u},i}var ac={createWarning:ay,createDeprecation:oI};Mo.exports=ac;Mo.exports.default=ac;Mo.exports.processWarning=ac});var Kn=E((D8,uy)=>{"use strict";var{createWarning:Ys}=ly(),aI=Ys({name:"FastifyWarning",code:"FSTWRN001",message:"The %s schema for %s: %s is missing. This may indicate the schema is not well specified.",unlimited:!0}),lI=Ys({name:"FastifyWarning",code:"FSTWRN003",message:"The %s mixes async and callback styles that may lead to unhandled rejections. Please use only one of them.",unlimited:!0}),uI=Ys({name:"FastifyWarning",code:"FSTWRN004",message:"It seems that you are overriding an errorHandler in the same scope, which can lead to subtle bugs.",unlimited:!0}),cI=Ys({name:"FastifySecurity",code:"FSTSEC001",message:'You are using /%s/ Content-Type which may be vulnerable to CORS attack. Please make sure your RegExp start with "^" or include ";?" to proper detection of the essence MIME type.',unlimited:!0}),fI=Ys({name:"FastifyWarning",code:"FSTDEP022",message:'The router options for %s property access is deprecated. Please use "options.routerOptions" instead for accessing router options. The router options will be removed in `fastify@6`.',unlimited:!0});uy.exports={FSTWRN001:aI,FSTWRN003:lI,FSTWRN004:uI,FSTSEC001:cI,FSTDEP022:fI}});var He=E((F8,Ho)=>{"use strict";var L=Zu(),fn={FST_ERR_NOT_FOUND:L("FST_ERR_NOT_FOUND","Not Found",404),FST_ERR_OPTIONS_NOT_OBJ:L("FST_ERR_OPTIONS_NOT_OBJ","Options must be an object",500,TypeError),FST_ERR_QSP_NOT_FN:L("FST_ERR_QSP_NOT_FN","querystringParser option should be a function, instead got '%s'",500,TypeError),FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN:L("FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN","schemaController.bucket option should be a function, instead got '%s'",500,TypeError),FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN:L("FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN","schemaErrorFormatter option should be a non async function. Instead got '%s'.",500,TypeError),FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ:L("FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ","ajv.customOptions option should be an object, instead got '%s'",500,TypeError),FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR:L("FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR","ajv.plugins option should be an array, instead got '%s'",500,TypeError),FST_ERR_VALIDATION:L("FST_ERR_VALIDATION","%s",400),FST_ERR_LISTEN_OPTIONS_INVALID:L("FST_ERR_LISTEN_OPTIONS_INVALID","Invalid listen options: '%s'",500,TypeError),FST_ERR_ERROR_HANDLER_NOT_FN:L("FST_ERR_ERROR_HANDLER_NOT_FN","Error Handler must be a function",500,TypeError),FST_ERR_ERROR_HANDLER_ALREADY_SET:L("FST_ERR_ERROR_HANDLER_ALREADY_SET","Error Handler already set in this scope. Set 'allowErrorHandlerOverride: true' to allow overriding.",500,TypeError),FST_ERR_CTP_ALREADY_PRESENT:L("FST_ERR_CTP_ALREADY_PRESENT","Content type parser '%s' already present."),FST_ERR_CTP_INVALID_TYPE:L("FST_ERR_CTP_INVALID_TYPE","The content type should be a string or a RegExp",500,TypeError),FST_ERR_CTP_EMPTY_TYPE:L("FST_ERR_CTP_EMPTY_TYPE","The content type cannot be an empty string",500,TypeError),FST_ERR_CTP_INVALID_HANDLER:L("FST_ERR_CTP_INVALID_HANDLER","The content type handler should be a function",500,TypeError),FST_ERR_CTP_INVALID_PARSE_TYPE:L("FST_ERR_CTP_INVALID_PARSE_TYPE","The body parser can only parse your data as 'string' or 'buffer', you asked '%s' which is not supported.",500,TypeError),FST_ERR_CTP_BODY_TOO_LARGE:L("FST_ERR_CTP_BODY_TOO_LARGE","Request body is too large",413,RangeError),FST_ERR_CTP_INVALID_MEDIA_TYPE:L("FST_ERR_CTP_INVALID_MEDIA_TYPE","Unsupported Media Type: %s",415),FST_ERR_CTP_INVALID_CONTENT_LENGTH:L("FST_ERR_CTP_INVALID_CONTENT_LENGTH","Request body size did not match Content-Length",400,RangeError),FST_ERR_CTP_EMPTY_JSON_BODY:L("FST_ERR_CTP_EMPTY_JSON_BODY","Body cannot be empty when content-type is set to 'application/json'",400),FST_ERR_CTP_INVALID_JSON_BODY:L("FST_ERR_CTP_INVALID_JSON_BODY","Body is not valid JSON but content-type is set to 'application/json'",400),FST_ERR_CTP_INSTANCE_ALREADY_STARTED:L("FST_ERR_CTP_INSTANCE_ALREADY_STARTED",'Cannot call "%s" when fastify instance is already started!',400),FST_ERR_DEC_ALREADY_PRESENT:L("FST_ERR_DEC_ALREADY_PRESENT","The decorator '%s' has already been added!"),FST_ERR_DEC_DEPENDENCY_INVALID_TYPE:L("FST_ERR_DEC_DEPENDENCY_INVALID_TYPE","The dependencies of decorator '%s' must be of type Array.",500,TypeError),FST_ERR_DEC_MISSING_DEPENDENCY:L("FST_ERR_DEC_MISSING_DEPENDENCY","The decorator is missing dependency '%s'."),FST_ERR_DEC_AFTER_START:L("FST_ERR_DEC_AFTER_START","The decorator '%s' has been added after start!"),FST_ERR_DEC_REFERENCE_TYPE:L("FST_ERR_DEC_REFERENCE_TYPE","The decorator '%s' of type '%s' is a reference type. Use the { getter, setter } interface instead."),FST_ERR_DEC_UNDECLARED:L("FST_ERR_DEC_UNDECLARED","No decorator '%s' has been declared on %s."),FST_ERR_HOOK_INVALID_TYPE:L("FST_ERR_HOOK_INVALID_TYPE","The hook name must be a string",500,TypeError),FST_ERR_HOOK_INVALID_HANDLER:L("FST_ERR_HOOK_INVALID_HANDLER","%s hook should be a function, instead got %s",500,TypeError),FST_ERR_HOOK_INVALID_ASYNC_HANDLER:L("FST_ERR_HOOK_INVALID_ASYNC_HANDLER","Async function has too many arguments. Async hooks should not use the 'done' argument.",500,TypeError),FST_ERR_HOOK_NOT_SUPPORTED:L("FST_ERR_HOOK_NOT_SUPPORTED","%s hook not supported!",500,TypeError),FST_ERR_MISSING_MIDDLEWARE:L("FST_ERR_MISSING_MIDDLEWARE","You must register a plugin for handling middlewares, visit fastify.dev/docs/latest/Reference/Middleware/ for more info.",500),FST_ERR_HOOK_TIMEOUT:L("FST_ERR_HOOK_TIMEOUT","A callback for '%s' hook%s timed out. You may have forgotten to call 'done' function or to resolve a Promise"),FST_ERR_LOG_INVALID_DESTINATION:L("FST_ERR_LOG_INVALID_DESTINATION","Cannot specify both logger.stream and logger.file options"),FST_ERR_LOG_INVALID_LOGGER:L("FST_ERR_LOG_INVALID_LOGGER","Invalid logger object provided. The logger instance should have these functions(s): '%s'.",500,TypeError),FST_ERR_LOG_INVALID_LOGGER_INSTANCE:L("FST_ERR_LOG_INVALID_LOGGER_INSTANCE","loggerInstance only accepts a logger instance.",500,TypeError),FST_ERR_LOG_INVALID_LOGGER_CONFIG:L("FST_ERR_LOG_INVALID_LOGGER_CONFIG","logger options only accepts a configuration object.",500,TypeError),FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED:L("FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED","You cannot provide both logger and loggerInstance. Please provide only one.",500,TypeError),FST_ERR_REP_INVALID_PAYLOAD_TYPE:L("FST_ERR_REP_INVALID_PAYLOAD_TYPE","Attempted to send payload of invalid type '%s'. Expected a string or Buffer.",500,TypeError),FST_ERR_REP_RESPONSE_BODY_CONSUMED:L("FST_ERR_REP_RESPONSE_BODY_CONSUMED","Response.body is already consumed."),FST_ERR_REP_READABLE_STREAM_LOCKED:L("FST_ERR_REP_READABLE_STREAM_LOCKED","ReadableStream was locked. You should call releaseLock() method on reader before sending."),FST_ERR_REP_ALREADY_SENT:L("FST_ERR_REP_ALREADY_SENT",'Reply was already sent, did you forget to "return reply" in "%s" (%s)?'),FST_ERR_REP_SENT_VALUE:L("FST_ERR_REP_SENT_VALUE","The only possible value for reply.sent is true.",500,TypeError),FST_ERR_SEND_INSIDE_ONERR:L("FST_ERR_SEND_INSIDE_ONERR","You cannot use `send` inside the `onError` hook"),FST_ERR_SEND_UNDEFINED_ERR:L("FST_ERR_SEND_UNDEFINED_ERR","Undefined error has occurred"),FST_ERR_BAD_STATUS_CODE:L("FST_ERR_BAD_STATUS_CODE","Called reply with an invalid status code: %s"),FST_ERR_BAD_TRAILER_NAME:L("FST_ERR_BAD_TRAILER_NAME","Called reply.trailer with an invalid header name: %s"),FST_ERR_BAD_TRAILER_VALUE:L("FST_ERR_BAD_TRAILER_VALUE","Called reply.trailer('%s', fn) with an invalid type: %s. Expected a function."),FST_ERR_FAILED_ERROR_SERIALIZATION:L("FST_ERR_FAILED_ERROR_SERIALIZATION","Failed to serialize an error. Error: %s. Original error: %s"),FST_ERR_MISSING_SERIALIZATION_FN:L("FST_ERR_MISSING_SERIALIZATION_FN",'Missing serialization function. Key "%s"'),FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN:L("FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN",'Missing serialization function. Key "%s:%s"'),FST_ERR_REQ_INVALID_VALIDATION_INVOCATION:L("FST_ERR_REQ_INVALID_VALIDATION_INVOCATION",'Invalid validation invocation. Missing validation function for HTTP part "%s" nor schema provided.'),FST_ERR_SCH_MISSING_ID:L("FST_ERR_SCH_MISSING_ID","Missing schema $id property"),FST_ERR_SCH_ALREADY_PRESENT:L("FST_ERR_SCH_ALREADY_PRESENT","Schema with id '%s' already declared!"),FST_ERR_SCH_CONTENT_MISSING_SCHEMA:L("FST_ERR_SCH_CONTENT_MISSING_SCHEMA","Schema is missing for the content type '%s'"),FST_ERR_SCH_DUPLICATE:L("FST_ERR_SCH_DUPLICATE","Schema with '%s' already present!"),FST_ERR_SCH_VALIDATION_BUILD:L("FST_ERR_SCH_VALIDATION_BUILD","Failed building the validation schema for %s: %s, due to error %s"),FST_ERR_SCH_SERIALIZATION_BUILD:L("FST_ERR_SCH_SERIALIZATION_BUILD","Failed building the serialization schema for %s: %s, due to error %s"),FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX:L("FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX",'response schemas should be nested under a valid status code, e.g { 2xx: { type: "object" } }'),FST_ERR_INIT_OPTS_INVALID:L("FST_ERR_INIT_OPTS_INVALID","Invalid initialization options: '%s'"),FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE:L("FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE","Cannot set forceCloseConnections to 'idle' as your HTTP server does not support closeIdleConnections method"),FST_ERR_DUPLICATED_ROUTE:L("FST_ERR_DUPLICATED_ROUTE","Method '%s' already declared for route '%s'"),FST_ERR_BAD_URL:L("FST_ERR_BAD_URL","'%s' is not a valid url component",400,URIError),FST_ERR_ASYNC_CONSTRAINT:L("FST_ERR_ASYNC_CONSTRAINT","Unexpected error from async constraint",500),FST_ERR_INVALID_URL:L("FST_ERR_INVALID_URL","URL must be a string. Received '%s'",400,TypeError),FST_ERR_ROUTE_OPTIONS_NOT_OBJ:L("FST_ERR_ROUTE_OPTIONS_NOT_OBJ",'Options for "%s:%s" route must be an object',500,TypeError),FST_ERR_ROUTE_DUPLICATED_HANDLER:L("FST_ERR_ROUTE_DUPLICATED_HANDLER",'Duplicate handler for "%s:%s" route is not allowed!',500),FST_ERR_ROUTE_HANDLER_NOT_FN:L("FST_ERR_ROUTE_HANDLER_NOT_FN","Error Handler for %s:%s route, if defined, must be a function",500,TypeError),FST_ERR_ROUTE_MISSING_HANDLER:L("FST_ERR_ROUTE_MISSING_HANDLER",'Missing handler function for "%s:%s" route.',500),FST_ERR_ROUTE_METHOD_INVALID:L("FST_ERR_ROUTE_METHOD_INVALID","Provided method is invalid!",500,TypeError),FST_ERR_ROUTE_METHOD_NOT_SUPPORTED:L("FST_ERR_ROUTE_METHOD_NOT_SUPPORTED","%s method is not supported.",500),FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED:L("FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED","Body validation schema for %s:%s route is not supported!",500),FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT:L("FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT","'bodyLimit' option must be an integer > 0. Got '%s'",500,TypeError),FST_ERR_ROUTE_REWRITE_NOT_STR:L("FST_ERR_ROUTE_REWRITE_NOT_STR",'Rewrite url for "%s" needs to be of type "string" but received "%s"',500,TypeError),FST_ERR_REOPENED_CLOSE_SERVER:L("FST_ERR_REOPENED_CLOSE_SERVER","Fastify has already been closed and cannot be reopened"),FST_ERR_REOPENED_SERVER:L("FST_ERR_REOPENED_SERVER","Fastify is already listening"),FST_ERR_INSTANCE_ALREADY_LISTENING:L("FST_ERR_INSTANCE_ALREADY_LISTENING","Fastify instance is already listening. %s"),FST_ERR_PLUGIN_VERSION_MISMATCH:L("FST_ERR_PLUGIN_VERSION_MISMATCH","fastify-plugin: %s - expected '%s' fastify version, '%s' is installed"),FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE:L("FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE","The decorator '%s'%s is not present in %s"),FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER:L("FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER","The %s plugin being registered mixes async and callback styles. Async plugin should not mix async and callback style.",500,TypeError),FST_ERR_PLUGIN_CALLBACK_NOT_FN:L("FST_ERR_PLUGIN_CALLBACK_NOT_FN","fastify-plugin: %s",500,TypeError),FST_ERR_PLUGIN_NOT_VALID:L("FST_ERR_PLUGIN_NOT_VALID","fastify-plugin: %s"),FST_ERR_ROOT_PLG_BOOTED:L("FST_ERR_ROOT_PLG_BOOTED","fastify-plugin: %s"),FST_ERR_PARENT_PLUGIN_BOOTED:L("FST_ERR_PARENT_PLUGIN_BOOTED","fastify-plugin: %s"),FST_ERR_PLUGIN_TIMEOUT:L("FST_ERR_PLUGIN_TIMEOUT","fastify-plugin: %s")};function dI(t,e){return e.cause=t,e}Ho.exports=fn;Ho.exports.appendStackTrace=dI;Ho.exports.AVVIO_ERRORS_MAP={AVV_ERR_CALLBACK_NOT_FN:fn.FST_ERR_PLUGIN_CALLBACK_NOT_FN,AVV_ERR_PLUGIN_NOT_VALID:fn.FST_ERR_PLUGIN_NOT_VALID,AVV_ERR_ROOT_PLG_BOOTED:fn.FST_ERR_ROOT_PLG_BOOTED,AVV_ERR_PARENT_PLG_LOADED:fn.FST_ERR_PARENT_PLUGIN_BOOTED,AVV_ERR_READY_TIMEOUT:fn.FST_ERR_PLUGIN_TIMEOUT,AVV_ERR_PLUGIN_EXEC_TIMEOUT:fn.FST_ERR_PLUGIN_TIMEOUT}});var Fr=E((M8,_y)=>{"use strict";var hI=["onRoute","onRegister","onReady","onListen","preClose","onClose"],hy=["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError","onRequestAbort"],pI=hy.concat(hI),{FST_ERR_HOOK_INVALID_TYPE:mI,FST_ERR_HOOK_INVALID_HANDLER:gI,FST_ERR_SEND_UNDEFINED_ERR:Vo,FST_ERR_HOOK_TIMEOUT:yI,FST_ERR_HOOK_NOT_SUPPORTED:_I,AVVIO_ERRORS_MAP:cy,appendStackTrace:fy}=He(),{kChildren:Xs,kHooks:py,kRequestPayloadStream:dy}=De();function Qs(){this.onRequest=[],this.preParsing=[],this.preValidation=[],this.preSerialization=[],this.preHandler=[],this.onResponse=[],this.onSend=[],this.onError=[],this.onRoute=[],this.onRegister=[],this.onReady=[],this.onListen=[],this.onTimeout=[],this.onRequestAbort=[],this.preClose=[]}Qs.prototype=Object.create(null);Qs.prototype.validate=function(t,e){if(typeof t!="string")throw new mI;if(Array.isArray(this[t])===!1)throw new _I(t);if(typeof e!="function")throw new gI(t,Object.prototype.toString.call(e))};Qs.prototype.add=function(t,e){this.validate(t,e),this[t].push(e)};function SI(t){let e=new Qs;return e.onRequest=t.onRequest.slice(),e.preParsing=t.preParsing.slice(),e.preValidation=t.preValidation.slice(),e.preSerialization=t.preSerialization.slice(),e.preHandler=t.preHandler.slice(),e.onSend=t.onSend.slice(),e.onResponse=t.onResponse.slice(),e.onError=t.onError.slice(),e.onRoute=t.onRoute.slice(),e.onRegister=t.onRegister.slice(),e.onTimeout=t.onTimeout.slice(),e.onRequestAbort=t.onRequestAbort.slice(),e.onReady=[],e.onListen=[],e.preClose=[],e}function my(t,e,r,n){let s=r[py][t],i=0,o=0;l();function a(c){let f=s[i-1]?.name,p=f?` "${f}"`:"";if(c){c.code==="AVV_ERR_READY_TIMEOUT"?c=fy(c,new yI(t,p)):c=cy[c.code]!=null?fy(c,new cy[c.code](c.message)):c,n(c);return}n()}function l(c){if(c){a(c);return}if(i===s.length&&o===r[Xs].length){i===0&&o===0?a():e(function(p,h){a(p),h(p)});return}if(i===s.length&&o<r[Xs].length){let f=r[Xs][o++];my(t,e,f,l);return}e(u(s[i++],r)),l()}function u(c,f){return function(p,h){if(p){h(p);return}if(c.length===1){try{c.call(f,h)}catch(d){h(d)}return}try{let d=c.call(f);if(d&&typeof d.then=="function"){d.then(h,h);return}}catch(d){p=d}h(p)}}}function gy(t){let e=t[py].onListen,r=e.length,n=0,s=0;i();function i(a){if(a&&t.log.error(a),n===r){for(;s<t[Xs].length;){let l=t[Xs][s++];gy(l)}return}o(e[n++],t,i)}async function o(a,l,u){if(a.length===1){try{a.call(l,u)}catch(c){u(c)}return}try{let c=a.call(l);if(c&&typeof c.then=="function"){c.then(u,u);return}u()}catch(c){u(c)}}}function Yn(t){return function(r,n,s,i){let o=0;function a(c){if(c||o===r.length){i(c,n,s);return}let f;try{f=t(r[o++],n,s,a)}catch(p){i(p,n,s);return}f&&typeof f.then=="function"&&f.then(l,u)}function l(){a()}function u(c){c||(c=new Vo),i(c,n,s)}a()}}function EI(t,e,r,n){return t(e,r,n)}var bI=Yn(EI),vI=Yn(Zs),wI=Yn(Zs),RI=Yn(Zs),OI=Yn(Zs);function yy(t,e,r,n,s){let i=0;function o(u,c){if(u){s(u,e,r,n);return}if(c!==void 0&&(n=c),i===t.length){s(null,e,r,n);return}let f;try{f=t[i++](e,r,n,o)}catch(p){s(p,e,r);return}f&&typeof f.then=="function"&&f.then(a,l)}function a(u){o(null,u)}function l(u){u||(u=new Vo),s(u,e,r,n)}o()}var TI=yy;function $I(t,e,r,n){let s=0;function i(l,u){if(r.sent)return;if(u!==void 0&&(e[dy]=u),l||s===t.length){n(l,e,r);return}let c;try{c=t[s++](e,r,e[dy],i)}catch(f){n(f,e,r);return}c&&typeof c.then=="function"&&c.then(o,a)}function o(l){i(null,l)}function a(l){l||(l=new Vo),n(l,e,r)}i()}function PI(t,e,r){let n=0;function s(a){if(a||n===t.length){r(a,e);return}let l;try{l=t[n++](e,s)}catch(u){r(u,e);return}l&&typeof l.then=="function"&&l.then(i,o)}function i(){s()}function o(a){a||(a=new Vo),r(a,e)}s()}function Zs(t,e,r,n){if(r.sent!==!0)return t(e,r,n)}_y.exports={Hooks:Qs,buildHooks:SI,hookRunnerGenerator:Yn,preParsingHookRunner:$I,onResponseHookRunner:bI,onSendHookRunner:yy,preSerializationHookRunner:TI,onRequestAbortHookRunner:PI,hookIterator:Zs,hookRunnerApplication:my,onListenHookRunner:gy,preHandlerHookRunner:wI,preValidationHookRunner:vI,onRequestHookRunner:OI,onTimeoutHookRunner:RI,lifecycleHooks:hy,supportedHooks:pI}});var Ey=E((H8,Sy)=>{"use strict";Sy.exports=function(){return{[Symbol.iterator]:function*(){},add(){},delete(){},has(){return!0}}}});var lc=E((V8,vy)=>{"use strict";var{kTestInternals:AI}=De();function by(){let t,e;return{promise:new Promise((n,s)=>{t=n,e=s}),resolve:t,reject:e}}vy.exports={withResolvers:typeof Promise.withResolvers=="function"?Promise.withResolvers.bind(Promise):by,[AI]:{withResolvers:by}}});var ky=E((z8,Ny)=>{"use strict";var CI=V("node:http"),II=V("node:https"),wy=V("node:http2"),NI=V("node:dns"),kI=V("node:os"),{kState:ke,kOptions:xI,kServerBindings:LI,kHttp2ServerSessions:dn}=De(),{FSTWRN003:qI}=Kn(),{onListenHookRunner:zo}=Fr(),{FST_ERR_REOPENED_CLOSE_SERVER:Oy,FST_ERR_REOPENED_SERVER:Ty,FST_ERR_LISTEN_OPTIONS_INVALID:jI,FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE:DI}=He(),FI=Ey(),$y=lc();Ny.exports.createServer=MI;function Py(t){return`Server listening at ${t}`}function MI(t,e){let r=Cy(t,e);function n(u={port:0,host:"localhost"},c=void 0){if(typeof c=="function"&&(c.constructor.name==="AsyncFunction"&&qI("listen method"),u.cb=c),u.signal){if(typeof u.signal.on!="function"&&typeof u.signal.addEventListener!="function")throw new jI("Invalid options.signal");if(this[ke].aborted=u.signal.aborted,this[ke].aborted)return this.close();{let p=()=>{this[ke].aborted=!0,this.close()};u.signal.addEventListener("abort",p,{once:!0})}}let f;if(u.path==null?f=u.host??"localhost":f=u.host,(!Object.hasOwn(u,"host")||u.host==null)&&(u.host=f),f==="localhost"?u.cb=(p,h)=>{if(p){c(p,h);return}Ry.call(this,r,e,t,u,()=>{this[ke].listening=!0,c(null,h),zo(this)})}:u.cb=(p,h)=>{if(p){c(p,h);return}this[ke].listening=!0,c(null,h),zo(this)},c===void 0)return HI.call(this,r,u).then(h=>{let{promise:d,resolve:m}=$y.withResolvers();return f==="localhost"?Ry.call(this,r,e,t,u,()=>{this[ke].listening=!0,m(h),zo(this)}):(m(h),zo(this)),d});this.ready(Ay.call(this,r,u))}let s=typeof r.closeAllConnections=="function",i=typeof r.closeIdleConnections=="function",o=typeof r.closeHttp2Sessions=="function",a=t.forceCloseConnections;if(a==="idle"&&!i)throw new DI;typeof a!="boolean"&&(a=i?"idle":!1);let l=!s&&a===!0?new Set:FI();return{server:r,listen:n,forceCloseConnections:a,serverHasCloseAllConnections:s,serverHasCloseHttp2Sessions:o,keepAliveConnections:l}}function Ry(t,e,r,n,s){this[ke].listening=!1,NI.lookup(n.host,{all:!0},(i,o)=>{if(i||this[ke].aborted){s();return}let a=t.listening&&r.serverFactory,l=0,u=0;if(!a){let f=t.address();for(let p of o)if(p.address!==f.address){l++;let h=Object.assign({},n,{host:p.address,port:f.port,cb:g=>{u++,g||this[LI].push(d),u===l&&s()}}),d=Cy(r,e),m=()=>{d.close(()=>{}),typeof d.closeAllConnections=="function"&&r.forceCloseConnections===!0&&d.closeAllConnections(),typeof d.closeHttp2Sessions=="function"&&d.closeHttp2Sessions()};d.on("upgrade",t.emit.bind(t,"upgrade")),t.on("unref",m),t.on("close",m),t.on("error",m),this[ke].listening=!1,Ay.call(this,d,h)()}}if(l===0){s();return}let c=t.unref;t.unref=function(){c.call(t),t.emit("unref")}})}function Ay(t,e){let r=n=>{if(t.removeListener("error",r),t.removeListener("listening",r),n)this[ke].listening=!1,e.cb(n,null);else{let s=Iy.call(this,t,e.listenTextResolver||Py);e.cb(null,s)}};return n=>{if(n!=null)return e.cb(n);if(this[ke].listening&&this[ke].closing)return e.cb(new Oy,null);if(this[ke].listening)return e.cb(new Ty,null);t.once("error",r),this[ke].closing||(t.once("listening",r),t.listen(e),this[ke].listening=!0)}}function HI(t,e){return this[ke].listening&&this[ke].closing?Promise.reject(new Oy):this[ke].listening?Promise.reject(new Ty):this.ready().then(()=>{if(this[ke].aborted)return;let{promise:r,resolve:n,reject:s}=$y.withResolvers(),i=l=>{a(),this[ke].listening=!1,s(l)},o=()=>{a(),this[ke].listening=!0,n(Iy.call(this,t,e.listenTextResolver||Py))};function a(){t.removeListener("error",i),t.removeListener("listening",o)}return t.once("error",i),t.once("listening",o),t.listen(e),r})}function Cy(t,e){if(t.serverFactory)return t.serverFactory(e,t);let r=t.https===!0?{}:t.https;if(t.http2){let s=typeof r=="object"?wy.createSecureServer(r,e):wy.createServer(t.http,e);return s.on("session",i=>i.setTimeout(t.http2SessionTimeout,()=>{i.close()})),t.forceCloseConnections===!0&&(s.closeHttp2Sessions=zI(s)),s.setTimeout(t.connectionTimeout),s}let n=r?II.createServer(r,e):CI.createServer(t.http,e);return n.keepAliveTimeout=t.keepAliveTimeout,n.requestTimeout=t.requestTimeout,n.setTimeout(t.connectionTimeout),t.maxRequestsPerSocket>0&&(n.maxRequestsPerSocket=t.maxRequestsPerSocket),n}function VI(t){return t.address==="0.0.0.0"?Object.values(kI.networkInterfaces()).flatMap(e=>e.filter(r=>r.family==="IPv4")).sort(e=>e.internal?-1:1).map(e=>e.address):[t.address]}function Iy(t,e){let r;typeof t.address()=="string"?r=[t.address()]:(t.address().address.indexOf(":")===-1?r=VI(t.address()).map(s=>s+":"+t.address().port):r=["["+t.address().address+"]:"+t.address().port],r=r.map(s=>"http"+(this[xI].https?"s":"")+"://"+s));for(let s of r)this.log.info(e(s));return r[0]}function zI(t){return t[dn]=new Set,t.on("session",function(e){e.once("connect",function(){t[dn].add(e)}),e.once("close",function(){t[dn].delete(e)}),e.once("frameError",function(r,n,s){s===0&&t[dn].delete(e)}),e.once("goaway",function(){t[dn].delete(e)})}),function(){if(t[dn].size!==0)for(let r of t[dn])r.close()}}});var fc=E((U8,qy)=>{"use strict";var uc=/([\w!#$%&'*+.^`|~-]+)=([^;]*)/gm,xy=/^[\w!#$%&'*+.^`|~-]+$/,Ly=/^[\w!#$%&'*+.^`|~-]+\s*/,cc=class{#e=!1;#t=!0;#r="";#n="";#s=new Map;#i;constructor(e){if(e==null||e===""||e==="undefined")return;let r=e.indexOf(";");if(r===-1){if(r=e.indexOf("/"),r===-1)return;let l=e.slice(0,r).trimStart().toLowerCase(),u=e.slice(r+1).trimEnd().toLowerCase();xy.test(l)===!0&&Ly.test(u)===!0&&(this.#e=!0,this.#t=!1,this.#r=l,this.#n=u);return}let n=e.slice(0,r).toLowerCase(),s=e.slice(r+1).trim();if(r=n.indexOf("/"),r===-1)return;let i=n.slice(0,r).trimStart(),o=n.slice(r+1).trimEnd();if(xy.test(i)===!1||Ly.test(o)===!1)return;this.#r=i,this.#n=o,this.#e=!0,this.#t=!1;let a=uc.exec(s);for(;a;){let l=a[1],u=a[2];if(u[0]==='"'){if(u.at(-1)!=='"'){this.#s.set(l,"invalid quoted string"),a=uc.exec(s);continue}this.#s.set(l,u.slice(1,u.length-1))}else this.#s.set(l,u);a=uc.exec(s)}}get[Symbol.toStringTag](){return"ContentType"}get isEmpty(){return this.#t}get isValid(){return this.#e}get mediaType(){return`${this.#r}/${this.#n}`}get type(){return this.#r}get subtype(){return this.#n}get parameters(){return this.#s}toString(){if(this.#i)return this.#i;let e=[];for(let[n,s]of this.#s.entries())e.push(`${n}="${s}"`);let r=[this.#r,"/",this.#n];return e.length>0&&(r.push("; "),r.push(e.join("; "))),this.#i=r.join(""),this.#i}};qy.exports=cc});var Uo=E((B8,jy)=>{"use strict";var{kReplyHasStatusCode:UI}=De();function BI(t,e){if(!t[UI]||t.statusCode===200){let r=e&&(e.statusCode||e.status);t.code(r>=400?r:500)}}jy.exports={setErrorStatusCode:BI}});var dc=E((G8,Fy)=>{"use strict";var{kReplyIsError:Dy,kReplyHijacked:GI}=De(),{setErrorStatusCode:WI}=Uo(),JI=V("node:diagnostics_channel"),ei=JI.tracingChannel("fastify.request.handler");function KI(t,e,r){r&&(r.async=!0),t.then(function(n){if(e[GI]!==!0){r&&ei.asyncStart.publish(r);try{if(n!==void 0||e.sent===!1&&e.raw.headersSent===!1&&e.request.raw.aborted===!1&&e.request.socket&&!e.request.socket.destroyed)try{e.send(n)}catch(s){e[Dy]=!0,e.send(s)}}finally{r&&ei.asyncEnd.publish(r)}}},function(n){r&&(r.error=n,WI(e,n),ei.error.publish(r),ei.asyncStart.publish(r));try{if(e.sent===!0){e.log.error({err:n},"Promise errored, but reply.sent = true was set");return}e[Dy]=!0,e.send(n)}catch(s){e.send(s)}finally{r&&ei.asyncEnd.publish(r)}})}Fy.exports=KI});var mc=E((W8,Hy)=>{"use strict";var{kSchemaHeaders:Wo,kSchemaParams:hc,kSchemaQuerystring:pc,kSchemaBody:hn,kSchemaResponse:My}=De(),YI=/^[1-5](?:\d{2}|xx)$|^default$/,{FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX:XI}=He(),{FSTWRN001:Bo}=Kn();function QI(t,e){if(!t.schema||!t.schema.response)return;let{method:r,url:n}=t.config||{};t[My]=Object.keys(t.schema.response).reduce(function(s,i){let o=t.schema.response[i];if(i=i.toLowerCase(),!YI.test(i))throw new XI;if(o.content){let a={};for(let l of Object.keys(o.content)){let u=o.content[l].schema;a[l]=e({schema:u,url:n,method:r,httpStatus:i,contentType:l})}s[i]=a}else s[i]=e({schema:o,url:n,method:r,httpStatus:i});return s},{})}function ZI(t,e,r){let{schema:n}=t;if(!n)return;let{method:s,url:i}=t.config||{},o=n.headers;if(o&&(r||Object.getPrototypeOf(o)!==Object.prototype))t[Wo]=e({schema:o,method:s,url:i,httpPart:"headers"});else if(o){let a={};Object.keys(o).forEach(l=>{a[l]=o[l]}),a.required instanceof Array&&(a.required=a.required.map(l=>l.toLowerCase())),o.properties&&(a.properties={},Object.keys(o.properties).forEach(l=>{a.properties[l.toLowerCase()]=o.properties[l]})),t[Wo]=e({schema:a,method:s,url:i,httpPart:"headers"})}else Object.hasOwn(n,"headers")&&Bo("headers",s,i);if(n.body){let a=n.body.content;if(a){let l={};for(let u of Object.keys(a)){let c=a[u].schema;l[u]=e({schema:c,method:s,url:i,httpPart:"body",contentType:u})}t[hn]=l}else t[hn]=e({schema:n.body,method:s,url:i,httpPart:"body"})}else Object.hasOwn(n,"body")&&Bo("body",s,i);n.querystring?t[pc]=e({schema:n.querystring,method:s,url:i,httpPart:"querystring"}):Object.hasOwn(n,"querystring")&&Bo("querystring",s,i),n.params?t[hc]=e({schema:n.params,method:s,url:i,httpPart:"params"}):Object.hasOwn(n,"params")&&Bo("params",s,i)}function Go(t,e,r){let n=e[r]===void 0,s;try{s=t?.(n?null:e[r])}catch(o){return o.statusCode=500,o}if(s&&typeof s.then=="function")return s.then(o=>i(o)).catch(o=>o);return i(s);function i(o){return o===!1?t.errors:o&&o.error?o.error:(o&&o.value&&(e[r]=o.value),!1)}}function Jo(t,e,r){let n=r===void 0;if(n||!r.skipParams){let i=Go(t[hc],e,"params");if(i)return typeof i.then!="function"?Mr(i,"params",t.schemaErrorFormatter):eN(i,t,e)}if(n||!r.skipBody){let i=null;if(typeof t[hn]=="function")i=t[hn];else if(t[hn]){let a=sN(e.headers["content-type"]),l=t[hn][a];l&&(i=l)}let o=Go(i,e,"body");if(o)return typeof o.then!="function"?Mr(o,"body",t.schemaErrorFormatter):tN(o,t,e)}if(n||!r.skipQuery){let i=Go(t[pc],e,"query");if(i)return typeof i.then!="function"?Mr(i,"querystring",t.schemaErrorFormatter):rN(i,t,e)}let s=Go(t[Wo],e,"headers");return s?typeof s.then!="function"?Mr(s,"headers",t.schemaErrorFormatter):nN(s,t,e):!1}function eN(t,e,r){return t.then(n=>n?Mr(n,"params",e.schemaErrorFormatter):Jo(e,r,{skipParams:!0}))}function tN(t,e,r){return t.then(n=>n?Mr(n,"body",e.schemaErrorFormatter):Jo(e,r,{skipParams:!0,skipBody:!0}))}function rN(t,e,r){return t.then(n=>n?Mr(n,"querystring",e.schemaErrorFormatter):Jo(e,r,{skipParams:!0,skipBody:!0,skipQuery:!0}))}function nN(t,e,r){return t.then(n=>n?Mr(n,"headers",e.schemaErrorFormatter):!1)}function Mr(t,e,r){if(t instanceof Error)return t.statusCode=t.statusCode||400,t.code=t.code||"FST_ERR_VALIDATION",t.validationContext=t.validationContext||e,t;let n=r(t,e);return n.statusCode=n.statusCode||400,n.code=n.code||"FST_ERR_VALIDATION",n.validation=t,n.validationContext=e,n}function sN(t){return t?t.split(/[ ;]/,1)[0].trim().toLowerCase():""}Hy.exports={symbols:{bodySchema:hn,querystringSchema:pc,responseSchema:My,paramsSchema:hc,headersSchema:Wo},compileSchemasForValidation:ZI,compileSchemasForSerialization:QI,validate:Jo}});var Sc=E((J8,_c)=>{"use strict";var iN=V("node:diagnostics_channel"),oN=fc(),aN=dc(),{validate:lN}=mc(),{preValidationHookRunner:uN,preHandlerHookRunner:cN}=Fr(),{FST_ERR_CTP_INVALID_MEDIA_TYPE:fN}=He(),{setErrorStatusCode:Vy}=Uo(),{kReplyIsError:ri,kRouteContext:tr,kFourOhFourContext:dN,kSupportedHTTPMethods:zy}=De(),ti=iN.tracingChannel("fastify.request.handler");function hN(t,e,r){if(r.sent===!0)return;if(t!=null){r[ri]=!0,r.send(t);return}let n=e.method;if(this[zy].bodyless.has(n)){Xn(e,r);return}if(this[zy].bodywith.has(n)){let s=e.headers,i=s["content-type"];if(i===void 0){let a=s["content-length"];if(s["transfer-encoding"]===void 0&&(a===void 0||a==="0")){Xn(e,r);return}e[tr].contentTypeParser.run("",Xn,e,r);return}let o=new oN(i);if(o.isValid===!1){r[ri]=!0,r.status(415).send(new fN);return}e[tr].contentTypeParser.run(o.toString(),Xn,e,r);return}Xn(e,r)}function Xn(t,e){try{t[tr].preValidation!==null?uN(t[tr].preValidation,t,e,gc):gc(null,t,e)}catch(r){gc(r,t,e)}}function gc(t,e,r){if(r.sent===!0)return;if(t!=null){r[ri]=!0,r.send(t);return}let n=lN(r[tr],e);if(n&&typeof n.then=="function"||!1){let i=Uy.bind(null,e,r);n.then(i,i)}else Uy(e,r,n)}function Uy(t,e,r){if(r){if(e[tr].attachValidation===!1){e.send(r);return}e.request.validationError=r}t[tr].preHandler!==null?cN(t[tr].preHandler,t,e,yc):yc(null,t,e)}function yc(t,e,r){if(r.sent)return;let n=e[tr];if(!ti.hasSubscribers||n[dN]===null)By(t,e,r);else{let s={request:e,reply:r,async:!1,route:{url:n.config.url,method:n.config.method}};ti.start.runStores(s,By,void 0,t,e,r,s)}}function By(t,e,r,n){let s=e[tr];try{if(t!=null){r[ri]=!0,n&&(n.error=t,Vy(r,t),ti.error.publish(n)),r.send(t);return}let i;try{i=s.handler(e,r)}catch(o){n&&(n.error=o,Vy(r,o),ti.error.publish(n)),r[ri]=!0,r.send(o);return}i!==void 0&&(i!==null&&typeof i.then=="function"?aN(i,r,n):r.send(i))}finally{n&&ti.end.publish(n)}}_c.exports=hN;_c.exports[Symbol.for("internals")]={handler:Xn,preHandlerCallback:yc}});var Wy=E((K8,Gy)=>{"use strict";function Qn(){}var pN={fatal:Qn,error:Qn,warn:Qn,info:Qn,debug:Qn,trace:Qn};Object.defineProperty(Gy,"exports",{get(){return Object.create(pN)}})});var bc=E((Y8,Yy)=>{"use strict";var ni=t=>t&&typeof t.message=="string",Ec=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return ni(r)?r:void 0}else return ni(e)?e:void 0},Jy=(t,e)=>{if(!ni(t))return"";let r=t.stack||"";if(e.has(t))return r+`
30
- causes have become circular...`;let n=Ec(t);return n?(e.add(t),r+`
31
- caused by: `+Jy(n,e)):r},mN=t=>Jy(t,new Set),Ky=(t,e,r)=>{if(!ni(t))return"";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let s=Ec(t);if(s){e.add(t);let i=typeof t.cause=="function";return n+(i?"":": ")+Ky(s,e,i)}else return n},gN=t=>Ky(t,new Set);Yy.exports={isErrorLike:ni,getErrorCause:Ec,stackWithCauses:mN,messageWithCauses:gN}});var vc=E((X8,Qy)=>{"use strict";var yN=Symbol("circular-ref-tag"),Ko=Symbol("pino-raw-err-ref"),Xy=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Ko]},set:function(t){this[Ko]=t}}});Object.defineProperty(Xy,Ko,{writable:!0,value:{}});Qy.exports={pinoErrProto:Xy,pinoErrorSymbols:{seen:yN,rawSymbol:Ko}}});var t_=E((Q8,e_)=>{"use strict";e_.exports=Rc;var{messageWithCauses:_N,stackWithCauses:SN,isErrorLike:Zy}=bc(),{pinoErrProto:EN,pinoErrorSymbols:bN}=vc(),{seen:wc}=bN,{toString:vN}=Object.prototype;function Rc(t){if(!Zy(t))return t;t[wc]=void 0;let e=Object.create(EN);e.type=vN.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=_N(t),e.stack=SN(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Rc(r)));for(let r in t)if(e[r]===void 0){let n=t[r];Zy(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,wc)&&(e[r]=Rc(n)):e[r]=n}return delete t[wc],e.raw=t,e}});var n_=E((Z8,r_)=>{"use strict";r_.exports=Xo;var{isErrorLike:Oc}=bc(),{pinoErrProto:wN,pinoErrorSymbols:RN}=vc(),{seen:Yo}=RN,{toString:ON}=Object.prototype;function Xo(t){if(!Oc(t))return t;t[Yo]=void 0;let e=Object.create(wN);e.type=ON.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Xo(r))),Oc(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Yo)&&(e.cause=Xo(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];Oc(n)?Object.prototype.hasOwnProperty.call(n,Yo)||(e[r]=Xo(n)):e[r]=n}return delete t[Yo],e.raw=t,e}});var a_=E((eK,o_)=>{"use strict";o_.exports={mapHttpRequest:TN,reqSerializer:i_};var Tc=Symbol("pino-raw-req-ref"),s_=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Tc]},set:function(t){this[Tc]=t}}});Object.defineProperty(s_,Tc,{writable:!0,value:{}});function i_(t){let e=t.info||t.socket,r=Object.create(s_);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else{let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function TN(t){return{req:i_(t)}}});var f_=E((tK,c_)=>{"use strict";c_.exports={mapHttpResponse:$N,resSerializer:u_};var $c=Symbol("pino-raw-res-ref"),l_=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[$c]},set:function(t){this[$c]=t}}});Object.defineProperty(l_,$c,{writable:!0,value:{}});function u_(t){let e=Object.create(l_);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function $N(t){return{res:u_(t)}}});var Ac=E((rK,d_)=>{"use strict";var Pc=t_(),PN=n_(),Qo=a_(),Zo=f_();d_.exports={err:Pc,errWithCause:PN,mapHttpRequest:Qo.mapHttpRequest,mapHttpResponse:Zo.mapHttpResponse,req:Qo.reqSerializer,res:Zo.resSerializer,wrapErrorSerializer:function(e){return e===Pc?e:function(n){return e(Pc(n))}},wrapRequestSerializer:function(e){return e===Qo.reqSerializer?e:function(n){return e(Qo.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===Zo.resSerializer?e:function(n){return e(Zo.resSerializer(n))}}}});var Cc=E((nK,h_)=>{"use strict";function AN(t,e){return e}h_.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=AN;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),s=[];for(let i of n)i&&s.push(i.getFileName());return s}});var S_=E((sK,__)=>{"use strict";function Ic(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){let e=[];for(let r=0;r<t.length;r++)e[r]=Ic(t[r]);return e}if(typeof t=="object"){let e=Object.create(Object.getPrototypeOf(t));for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=Ic(t[r]));return e}return t}function p_(t){let e=[],r="",n=!1,s=!1,i="";for(let o=0;o<t.length;o++){let a=t[o];!n&&a==="."?r&&(e.push(r),r=""):a==="["?(r&&(e.push(r),r=""),n=!0):a==="]"&&n?(e.push(r),r="",n=!1,s=!1):(a==='"'||a==="'")&&n?s?a===i?(s=!1,i=""):r+=a:(s=!0,i=a):r+=a}return r&&e.push(r),e}function m_(t,e,r){let n=t;for(let i=0;i<e.length-1;i++){let o=e[i];if(typeof n!="object"||n===null||!(o in n)||typeof n[o]!="object"||n[o]===null)return!1;n=n[o]}let s=e[e.length-1];if(s==="*"){if(Array.isArray(n))for(let i=0;i<n.length;i++)n[i]=r;else if(typeof n=="object"&&n!==null)for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=r)}else typeof n=="object"&&n!==null&&s in n&&Object.prototype.hasOwnProperty.call(n,s)&&(n[s]=r);return!0}function g_(t,e){let r=t;for(let s=0;s<e.length-1;s++){let i=e[s];if(typeof r!="object"||r===null||!(i in r)||typeof r[i]!="object"||r[i]===null)return!1;r=r[i]}let n=e[e.length-1];if(n==="*"){if(Array.isArray(r))for(let s=0;s<r.length;s++)r[s]=void 0;else if(typeof r=="object"&&r!==null)for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&delete r[s]}else typeof r=="object"&&r!==null&&n in r&&Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];return!0}var ea=Symbol("PATH_NOT_FOUND");function CN(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null||!(n in r))return ea;r=r[n]}return r}function IN(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null)return;r=r[n]}return r}function NN(t,e,r,n=!1){for(let s of e){let i=p_(s);if(i.includes("*"))y_(t,i,r,s,n);else if(n)g_(t,i);else{let o=CN(t,i);if(o===ea)continue;let a=typeof r=="function"?r(o,i):r;m_(t,i,a)}}}function y_(t,e,r,n,s=!1){let i=e.indexOf("*");if(i===e.length-1){let o=e.slice(0,-1),a=t;for(let l of o){if(a==null||typeof a!="object"||a===null)return;a=a[l]}if(Array.isArray(a))if(s)for(let l=0;l<a.length;l++)a[l]=void 0;else for(let l=0;l<a.length;l++){let u=[...o,l.toString()],c=typeof r=="function"?r(a[l],u):r;a[l]=c}else if(typeof a=="object"&&a!==null)if(s){let l=[];for(let u in a)Object.prototype.hasOwnProperty.call(a,u)&&l.push(u);for(let u of l)delete a[u]}else for(let l in a){let u=[...o,l],c=typeof r=="function"?r(a[l],u):r;a[l]=c}}else kN(t,e,r,i,n,s)}function kN(t,e,r,n,s,i=!1){let o=e.slice(0,n),a=e.slice(n+1),l=[];function u(c,f){if(f===o.length){if(Array.isArray(c))for(let p=0;p<c.length;p++)l[f]=p.toString(),u(c[p],f+1);else if(typeof c=="object"&&c!==null)for(let p in c)l[f]=p,u(c[p],f+1)}else if(f<o.length){let p=o[f];c&&typeof c=="object"&&c!==null&&p in c&&(l[f]=p,u(c[p],f+1))}else if(a.includes("*"))y_(c,a,typeof r=="function"?(h,d)=>{let m=[...l.slice(0,f),...d];return r(h,m)}:r,s,i);else if(i)g_(c,a);else{let p=typeof r=="function"?r(IN(c,a),[...l.slice(0,f),...a]):r;m_(c,a,p)}}if(o.length===0)u(t,0);else{let c=t;for(let f=0;f<o.length;f++){let p=o[f];if(c==null||typeof c!="object"||c===null)return;c=c[p],l[f]=p}c!=null&&u(c,o.length)}}function xN(t){if(t.length===0)return null;let e=new Map;for(let r of t){let n=p_(r),s=e;for(let i=0;i<n.length;i++){let o=n[i];s.has(o)||s.set(o,new Map),s=s.get(o)}}return e}function LN(t,e){if(!e)return t;function r(n,s,i=0){if(!s||s.size===0||n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(Array.isArray(n)){let a=[];for(let l=0;l<n.length;l++){let u=l.toString();s.has(u)||s.has("*")?a[l]=r(n[l],s.get(u)||s.get("*")):a[l]=n[l]}return a}let o=Object.create(Object.getPrototypeOf(n));for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(s.has(a)||s.has("*")?o[a]=r(n[a],s.get(a)||s.get("*")):o[a]=n[a]);return o}return r(t,e)}function qN(t){if(typeof t!="string")throw new Error("Paths must be (non-empty) strings");if(t==="")throw new Error("Invalid redaction path ()");if(t.includes(".."))throw new Error(`Invalid redaction path (${t})`);if(t.includes(","))throw new Error(`Invalid redaction path (${t})`);let e=0,r=!1,n="";for(let s=0;s<t.length;s++){let i=t[s];if((i==='"'||i==="'")&&e>0)r?i===n&&(r=!1,n=""):(r=!0,n=i);else if(i==="["&&!r)e++;else if(i==="]"&&!r&&(e--,e<0))throw new Error(`Invalid redaction path (${t})`)}if(e!==0)throw new Error(`Invalid redaction path (${t})`)}function jN(t){if(!Array.isArray(t))throw new TypeError("paths must be an array");for(let e of t)qN(e)}function DN(t={}){let{paths:e=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:s=!0,remove:i=!1}=t;jN(e);let o=xN(e);return function(l){if(s&&(l===null||typeof l!="object")&&(l==null||typeof l!="object"))return n?n(l):l;let u=LN(l,o),c=l,f=r;return typeof r=="function"&&(f=r),NN(u,e,f,i),n===!1?(u.restore=function(){return Ic(c)},u):typeof n=="function"?n(u):JSON.stringify(u)}}__.exports=DN});var Zn=E((iK,E_)=>{"use strict";var FN=Symbol("pino.setLevel"),MN=Symbol("pino.getLevel"),HN=Symbol("pino.levelVal"),VN=Symbol("pino.levelComp"),zN=Symbol("pino.useLevelLabels"),UN=Symbol("pino.useOnlyCustomLevels"),BN=Symbol("pino.mixin"),GN=Symbol("pino.lsCache"),WN=Symbol("pino.chindings"),JN=Symbol("pino.asJson"),KN=Symbol("pino.write"),YN=Symbol("pino.redactFmt"),XN=Symbol("pino.time"),QN=Symbol("pino.timeSliceIndex"),ZN=Symbol("pino.stream"),e1=Symbol("pino.stringify"),t1=Symbol("pino.stringifySafe"),r1=Symbol("pino.stringifiers"),n1=Symbol("pino.end"),s1=Symbol("pino.formatOpts"),i1=Symbol("pino.messageKey"),o1=Symbol("pino.errorKey"),a1=Symbol("pino.nestedKey"),l1=Symbol("pino.nestedKeyStr"),u1=Symbol("pino.mixinMergeStrategy"),c1=Symbol("pino.msgPrefix"),f1=Symbol("pino.wildcardFirst"),d1=Symbol.for("pino.serializers"),h1=Symbol.for("pino.formatters"),p1=Symbol.for("pino.hooks"),m1=Symbol.for("pino.metadata");E_.exports={setLevelSym:FN,getLevelSym:MN,levelValSym:HN,levelCompSym:VN,useLevelLabelsSym:zN,mixinSym:BN,lsCacheSym:GN,chindingsSym:WN,asJsonSym:JN,writeSym:KN,serializersSym:d1,redactFmtSym:YN,timeSym:XN,timeSliceIndexSym:QN,streamSym:ZN,stringifySym:e1,stringifySafeSym:t1,stringifiersSym:r1,endSym:n1,formatOptsSym:s1,messageKeySym:i1,errorKeySym:o1,nestedKeySym:a1,wildcardFirstSym:f1,needsMetadataGsym:m1,useOnlyCustomLevelsSym:UN,formattersSym:h1,hooksSym:p1,nestedKeyStrSym:l1,mixinMergeStrategySym:u1,msgPrefixSym:c1}});var kc=E((oK,R_)=>{"use strict";var b_=S_(),{redactFmtSym:g1,wildcardFirstSym:ta}=Zn(),Nc=/[^.[\]]+|\[([^[\]]*?)\]/g,v_="[Redacted]",w_=!1;function y1(t,e){let{paths:r,censor:n,remove:s}=_1(t),i=r.reduce((l,u)=>{Nc.lastIndex=0;let c=Nc.exec(u),f=Nc.exec(u),p=c[1]!==void 0?c[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):c[0];if(p==="*"&&(p=ta),f===null)return l[p]=null,l;if(l[p]===null)return l;let{index:h}=f,d=`${u.substr(h,u.length-1)}`;return l[p]=l[p]||[],p!==ta&&l[p].length===0&&l[p].push(...l[ta]||[]),p===ta&&Object.keys(l).forEach(function(m){l[m]&&l[m].push(d)}),l[p].push(d),l},{}),o={[g1]:b_({paths:r,censor:n,serialize:e,strict:w_,remove:s})},a=(...l)=>e(typeof n=="function"?n(...l):n);return[...Object.keys(i),...Object.getOwnPropertySymbols(i)].reduce((l,u)=>{if(i[u]===null)l[u]=c=>a(c,[u]);else{let c=typeof n=="function"?(f,p)=>n(f,[u,...p]):n;l[u]=b_({paths:i[u],censor:c,serialize:e,strict:w_,remove:s})}return l},o)}function _1(t){if(Array.isArray(t))return t={paths:t,censor:v_},t;let{paths:e,censor:r=v_,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),{paths:e,censor:r,remove:n}}R_.exports=y1});var $_=E((aK,T_)=>{"use strict";var S1=()=>"",E1=()=>`,"time":${Date.now()}`,b1=()=>`,"time":${Math.round(Date.now()/1e3)}`,v1=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,w1=1000000n,O_=1000000000n,R1=BigInt(Date.now())*w1,O1=process.hrtime.bigint(),T1=()=>{let t=process.hrtime.bigint()-O1,e=R1+t,r=e/O_,n=e%O_,s=Number(r*1000n+n/1000000n),i=new Date(s),o=i.getUTCFullYear(),a=(i.getUTCMonth()+1).toString().padStart(2,"0"),l=i.getUTCDate().toString().padStart(2,"0"),u=i.getUTCHours().toString().padStart(2,"0"),c=i.getUTCMinutes().toString().padStart(2,"0"),f=i.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${o}-${a}-${l}T${u}:${c}:${f}.${n.toString().padStart(9,"0")}Z"`};T_.exports={nullTime:S1,epochTime:E1,unixTime:b1,isoTime:v1,isoTimeNano:T1}});var A_=E((lK,P_)=>{"use strict";function $1(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}P_.exports=P1;function P1(t,e,r){var n=r&&r.stringify||$1,s=1;if(typeof t=="object"&&t!==null){var i=e.length+s;if(i===1)return t;var o=new Array(i);o[0]=n(t);for(var a=1;a<i;a++)o[a]=n(e[a]);return o.join(" ")}if(typeof t!="string")return t;var l=e.length;if(l===0)return t;for(var u="",c=1-s,f=-1,p=t&&t.length||0,h=0;h<p;){if(t.charCodeAt(h)===37&&h+1<p){switch(f=f>-1?f:0,t.charCodeAt(h+1)){case 100:case 102:if(c>=l||e[c]==null)break;f<h&&(u+=t.slice(f,h)),u+=Number(e[c]),f=h+2,h++;break;case 105:if(c>=l||e[c]==null)break;f<h&&(u+=t.slice(f,h)),u+=Math.floor(Number(e[c])),f=h+2,h++;break;case 79:case 111:case 106:if(c>=l||e[c]===void 0)break;f<h&&(u+=t.slice(f,h));var d=typeof e[c];if(d==="string"){u+="'"+e[c]+"'",f=h+2,h++;break}if(d==="function"){u+=e[c].name||"<anonymous>",f=h+2,h++;break}u+=n(e[c]),f=h+2,h++;break;case 115:if(c>=l)break;f<h&&(u+=t.slice(f,h)),u+=String(e[c]),f=h+2,h++;break;case 37:f<h&&(u+=t.slice(f,h)),u+="%",f=h+2,h++,c--;break}++c}++h}return f===-1?t:(f<p&&(u+=t.slice(f)),u)}});var Lc=E((uK,xc)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r))},t=new Int32Array(new SharedArrayBuffer(4));xc.exports=e}else{let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(e);for(;n>Date.now(););};xc.exports=t}});var j_=E((cK,q_)=>{"use strict";var xe=V("fs"),A1=V("events"),C1=V("util").inherits,C_=V("path"),jc=Lc(),I1=V("assert"),ra=100,na=Buffer.allocUnsafe(0),N1=16*1024,I_="buffer",N_="utf8",[k1,x1]=(process.versions.node||"0.0").split(".").map(Number),L1=k1>=22&&x1>=7;function k_(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(i,o){if(i){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",i)}):e.emit("error",i);return}let a=e._reopening;e.fd=o,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e.destroyed&&(!e._writing&&e._len>e.minLength||e._flushPending?e._actualWrite():a&&process.nextTick(()=>e.emit("drain")))}let n=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&xe.mkdirSync(C_.dirname(t),{recursive:!0});let i=xe.openSync(t,n,s);r(null,i)}catch(i){throw r(i),i}else e.mkdir?xe.mkdir(C_.dirname(t),{recursive:!0},i=>{if(i)return r(i);xe.open(t,n,s,r)}):xe.open(t,n,s,r)}function Vt(t){if(!(this instanceof Vt))return new Vt(t);let{fd:e,dest:r,minLength:n,maxLength:s,maxWrite:i,periodicFlush:o,sync:a,append:l=!0,mkdir:u,retryEAGAIN:c,fsync:f,contentMode:p,mode:h}=t||{};e=e||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=s||0,this.maxWrite=i||N1,this._periodicFlush=o||0,this._periodicFlushTimer=void 0,this.sync=a||!1,this.writable=!0,this._fsync=f||!1,this.append=l||!1,this.mode=h,this.retryEAGAIN=c||(()=>!0),this.mkdir=u||!1;let d,m;if(p===I_)this._writingBuf=na,this.write=D1,this.flush=M1,this.flushSync=V1,this._actualWrite=U1,d=()=>xe.writeSync(this.fd,this._writingBuf),m=()=>xe.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===N_)this._writingBuf="",this.write=j1,this.flush=F1,this.flushSync=H1,this._actualWrite=z1,d=()=>xe.writeSync(this.fd,this._writingBuf,"utf8"),m=()=>xe.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${N_}" and "${I_}", but passed ${p}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")k_(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(g,S)=>{if(g){if((g.code==="EAGAIN"||g.code==="EBUSY")&&this.retryEAGAIN(g,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{jc(ra),this.release(void 0,0)}catch(y){this.release(y)}else setTimeout(m,ra);else this._writing=!1,this.emit("error",g);return}this.emit("write",S);let b=qc(this._writingBuf,this._len,S);if(this._len=b.len,this._writingBuf=b.writingBuf,this._writingBuf.length){if(!this.sync){m();return}try{do{let y=d(),R=qc(this._writingBuf,this._len,y);this._len=R.len,this._writingBuf=R.writingBuf}while(this._writingBuf.length)}catch(y){this.release(y);return}}this._fsync&&xe.fsyncSync(this.fd);let _=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):_>this.minLength?this._actualWrite():this._ending?_>0?this._actualWrite():(this._writing=!1,sa(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(q1,this)):this.emit("drain"))},this.on("newListener",function(g){g==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function qc(t,e,r){return typeof t=="string"&&Buffer.byteLength(t)!==r&&(r=Buffer.from(t).subarray(0,r).toString().length),e=Math.max(e-r,0),t=t.slice(r),{writingBuf:t,len:e}}function q1(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}C1(Vt,A1);function x_(t,e){return t.length===0?na:t.length===1?t[0]:Buffer.concat(t,e)}function j1(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||r[r.length-1].length+t.length>this.maxWrite?r.push(""+t):r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function D1(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs,n=this._lens;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||n[n.length-1]+t.length>this.maxWrite?(r.push([t]),n.push(t.length)):(r[r.length-1].push(t),n[n.length-1]+=t.length),this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function L_(t){this._flushPending=!0;let e=()=>{if(this._fsync)this._flushPending=!1,t();else try{xe.fsync(this.fd,n=>{this._flushPending=!1,t(n)})}catch(n){t(n)}this.off("error",r)},r=n=>{this._flushPending=!1,t(n),this.off("drain",e)};this.once("drain",e),this.once("error",r)}function F1(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&L_.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function M1(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&L_.call(this,t),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}Vt.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(t&&(this.file=t),this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&xe.close(e,r=>{if(r)return this.emit("error",r)})}),k_(this.file,this)};Vt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():sa(this)))};function H1(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t;){t.length<=0&&(t=this._bufs[0]);try{let e=xe.writeSync(this.fd,t,"utf8"),r=qc(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;jc(ra)}}try{xe.fsyncSync(this.fd)}catch{}}function V1(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=na);let t=na;for(;this._bufs.length||t.length;){t.length<=0&&(t=x_(this._bufs[0],this._lens[0]));try{let e=xe.writeSync(this.fd,t);t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;jc(ra)}}}Vt.prototype.destroy=function(){this.destroyed||sa(this)};function z1(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf||this._bufs.shift()||"",this.sync)try{let e=xe.writeSync(this.fd,this._writingBuf,"utf8");t(null,e)}catch(e){t(e)}else xe.write(this.fd,this._writingBuf,"utf8",t)}function U1(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:x_(this._bufs.shift(),this._lens.shift()),this.sync)try{let e=xe.writeSync(this.fd,this._writingBuf);t(null,e)}catch(e){t(e)}else L1&&(this._writingBuf=Buffer.from(this._writingBuf)),xe.write(this.fd,this._writingBuf,t)}function sa(t){if(t.fd===-1){t.once("ready",sa.bind(null,t));return}t._periodicFlushTimer!==void 0&&clearInterval(t._periodicFlushTimer),t.destroyed=!0,t._bufs=[],t._lens=[],I1(typeof t.fd=="number",`sonic.fd must be a number, got ${typeof t.fd}`);try{xe.fsync(t.fd,e)}catch{}function e(){t.fd!==1&&t.fd!==2?xe.close(t.fd,r):r()}function r(n){if(n){t.emit("error",n);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close")}}Vt.SonicBoom=Vt;Vt.default=Vt;q_.exports=Vt});var Dc=E((fK,V_)=>{"use strict";var zt={exit:[],beforeExit:[]},D_={exit:W1,beforeExit:J1},es;function B1(){es===void 0&&(es=new FinalizationRegistry(K1))}function G1(t){zt[t].length>0||process.on(t,D_[t])}function F_(t){zt[t].length>0||(process.removeListener(t,D_[t]),zt.exit.length===0&&zt.beforeExit.length===0&&(es=void 0))}function W1(){M_("exit")}function J1(){M_("beforeExit")}function M_(t){for(let e of zt[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t)}zt[t]=[]}function K1(t){for(let e of["exit","beforeExit"]){let r=zt[e].indexOf(t);zt[e].splice(r,r+1),F_(e)}}function H_(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");G1(t);let n=new WeakRef(e);n.fn=r,B1(),es.register(e,n),zt[t].push(n)}function Y1(t,e){H_("exit",t,e)}function X1(t,e){H_("beforeExit",t,e)}function Q1(t){if(es!==void 0){es.unregister(t);for(let e of["exit","beforeExit"])zt[e]=zt[e].filter(r=>{let n=r.deref();return n&&n!==t}),F_(e)}}V_.exports={register:Y1,registerBeforeExit:X1,unregister:Q1}});var z_=E((dK,Z1)=>{Z1.exports={name:"thread-stream",version:"4.0.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",engines:{node:">=20"},dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^22.0.0","@yao-pkg/pkg":"^6.0.0",borp:"^0.21.0",desm:"^1.3.0",eslint:"^9.39.1",fastbench:"^1.0.1",husky:"^9.0.6",neostandard:"^0.12.2","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1","ts-node":"^10.8.0",typescript:"~5.7.3"},scripts:{build:"tsc --noEmit",lint:"eslint",test:"npm run lint && npm run build && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:ci":"npm run lint && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:yarn":"npm run transpile && borp --pattern 'test/*.test.js'",transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var B_=E((hK,U_)=>{"use strict";function ek(t,e,r,n,s){let i=n===1/0?1/0:Date.now()+n,o=()=>{let a=Atomics.load(t,e);if(a===r){s(null,"ok");return}if(i!==1/0&&Date.now()>i){s(null,"timed-out");return}let l=i===1/0?1e4:Math.min(1e4,Math.max(1,i-Date.now())),u=Atomics.waitAsync(t,e,a,l);u.async?u.value.then(o):setImmediate(o)};o()}function tk(t,e,r,n,s){let i=n===1/0?1/0:Date.now()+n,o=()=>{if(Atomics.load(t,e)!==r){s(null,"ok");return}if(i!==1/0&&Date.now()>i){s(null,"timed-out");return}let l=i===1/0?1e4:Math.min(1e4,Math.max(1,i-Date.now())),u=Atomics.waitAsync(t,e,r,l);u.async?u.value.then(o):setImmediate(o)};o()}U_.exports={wait:ek,waitDiff:tk}});var W_=E((pK,G_)=>{"use strict";G_.exports={WRITE_INDEX:4,READ_INDEX:8}});var Q_=E((mK,X_)=>{"use strict";var{version:rk}=z_(),{EventEmitter:nk}=V("events"),{Worker:sk}=V("worker_threads"),{join:ik}=V("path"),{pathToFileURL:ok}=V("url"),{wait:ak}=B_(),{WRITE_INDEX:yt,READ_INDEX:gt}=W_(),lk=V("buffer"),uk=V("assert"),I=Symbol("kImpl"),ck=lk.constants.MAX_STRING_LENGTH,si=class{constructor(e){this._value=e}deref(){return this._value}},oa=class{register(){}unregister(){}},fk=process.env.NODE_V8_COVERAGE?oa:global.FinalizationRegistry||oa,dk=process.env.NODE_V8_COVERAGE?si:global.WeakRef||si,J_=new fk(t=>{t.exited||t.terminate()});function hk(t,e){let{filename:r,workerData:n}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||ik(__dirname,"lib","worker.js"),o=new sk(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:ok(r).href,dataBuf:t[I].dataBuf,stateBuf:t[I].stateBuf,workerData:{$context:{threadStreamVersion:rk},...n}}});return o.stream=new si(t),o.on("message",pk),o.on("exit",Y_),J_.register(t,o),o}function K_(t){uk(!t[I].sync),t[I].needDrain&&(t[I].needDrain=!1,t.emit("drain"))}function ia(t){let e=Atomics.load(t[I].state,yt),r=t[I].data.length-e;if(r>0){if(t[I].buf.length===0){t[I].flushing=!1,t[I].ending?zc(t):t[I].needDrain&&process.nextTick(K_,t);return}let n=t[I].buf.slice(0,r),s=Buffer.byteLength(n);s<=r?(t[I].buf=t[I].buf.slice(r),aa(t,n,ia.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[I].state,gt,0),Atomics.store(t[I].state,yt,0),Atomics.notify(t[I].state,gt);s>t[I].data.length;)r=r/2,n=t[I].buf.slice(0,r),s=Buffer.byteLength(n);t[I].buf=t[I].buf.slice(r),aa(t,n,ia.bind(null,t))}})}else if(r===0){if(e===0&&t[I].buf.length===0)return;t.flush(()=>{Atomics.store(t[I].state,gt,0),Atomics.store(t[I].state,yt,0),Atomics.notify(t[I].state,gt),ia(t)})}else rr(t,new Error("overwritten"))}function pk(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new dk(e),e.flush(()=>{e[I].ready=!0,e.emit("ready")});break;case"ERROR":rr(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"WARNING":process.emitWarning(t.err);break;default:rr(e,new Error("this should not happen: "+t.code))}}function Y_(t){let e=this.stream.deref();e!==void 0&&(J_.unregister(e),e.worker.exited=!0,e.worker.off("exit",Y_),rr(e,t!==0?new Error("the worker thread exited"):null))}var Mc=class extends nk{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[I]={},this[I].stateBuf=new SharedArrayBuffer(128),this[I].state=new Int32Array(this[I].stateBuf),this[I].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[I].data=Buffer.from(this[I].dataBuf),this[I].sync=e.sync||!1,this[I].ending=!1,this[I].ended=!1,this[I].needDrain=!1,this[I].destroyed=!1,this[I].flushing=!1,this[I].ready=!1,this[I].finished=!1,this[I].errored=null,this[I].closed=!1,this[I].buf="",this.worker=hk(this,e),this.on("message",(r,n)=>{this.worker.postMessage(r,n)})}write(e){if(this[I].destroyed)return Hc(this,new Error("the worker has exited")),!1;if(this[I].ending)return Hc(this,new Error("the worker is ending")),!1;if(this[I].flushing&&this[I].buf.length+e.length>=ck)try{Fc(this),this[I].flushing=!0}catch(r){return rr(this,r),!1}if(this[I].buf+=e,this[I].sync)try{return Fc(this),!0}catch(r){return rr(this,r),!1}return this[I].flushing||(this[I].flushing=!0,setImmediate(ia,this)),this[I].needDrain=this[I].data.length-this[I].buf.length-Atomics.load(this[I].state,yt)<=0,!this[I].needDrain}end(){this[I].destroyed||(this[I].ending=!0,zc(this))}flush(e){if(this[I].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[I].state,yt);ak(this[I].state,gt,r,1/0,(n,s)=>{if(n){rr(this,n),process.nextTick(e,n);return}if(s==="not-equal"){this.flush(e);return}process.nextTick(e)})}flushSync(){this[I].destroyed||(Fc(this),Vc(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[I].ready}get destroyed(){return this[I].destroyed}get closed(){return this[I].closed}get writable(){return!this[I].destroyed&&!this[I].ending}get writableEnded(){return this[I].ending}get writableFinished(){return this[I].finished}get writableNeedDrain(){return this[I].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[I].errored}};function Hc(t,e){setImmediate(()=>{t.emit("error",e)})}function rr(t,e){t[I].destroyed||(t[I].destroyed=!0,e&&(t[I].errored=e,Hc(t,e)),t.worker.exited?setImmediate(()=>{t[I].closed=!0,t.emit("close")}):t.worker.terminate().catch(()=>{}).then(()=>{t[I].closed=!0,t.emit("close")}))}function aa(t,e,r){let n=Atomics.load(t[I].state,yt),s=Buffer.byteLength(e);return t[I].data.write(e,n),Atomics.store(t[I].state,yt,n+s),Atomics.notify(t[I].state,yt),r(),!0}function zc(t){if(!(t[I].ended||!t[I].ending||t[I].flushing)){t[I].ended=!0;try{t.flushSync();let e=Atomics.load(t[I].state,gt);Atomics.store(t[I].state,yt,-1),Atomics.notify(t[I].state,yt);let r=0;for(;e!==-1;){if(Atomics.wait(t[I].state,gt,e,1e3),e=Atomics.load(t[I].state,gt),e===-2){rr(t,new Error("end() failed"));return}if(++r===10){rr(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[I].finished=!0,t.emit("finish")})}catch(e){rr(t,e)}}}function Fc(t){let e=()=>{t[I].ending?zc(t):t[I].needDrain&&process.nextTick(K_,t)};for(t[I].flushing=!1;t[I].buf.length!==0;){let r=Atomics.load(t[I].state,yt),n=t[I].data.length-r;if(n===0){Vc(t),Atomics.store(t[I].state,gt,0),Atomics.store(t[I].state,yt,0),Atomics.notify(t[I].state,gt);continue}else if(n<0)throw new Error("overwritten");let s=t[I].buf.slice(0,n),i=Buffer.byteLength(s);if(i<=n)t[I].buf=t[I].buf.slice(n),aa(t,s,e);else{for(Vc(t),Atomics.store(t[I].state,gt,0),Atomics.store(t[I].state,yt,0),Atomics.notify(t[I].state,gt);i>t[I].buf.length;)n=n/2,s=t[I].buf.slice(0,n),i=Buffer.byteLength(s);t[I].buf=t[I].buf.slice(n),aa(t,s,e)}}}function Vc(t){if(t[I].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[I].state,yt),r=0;for(;;){let n=Atomics.load(t[I].state,gt);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[I].state,gt,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}X_.exports=Mc});var Gc=E((gK,Z_)=>{"use strict";var{createRequire:mk}=V("module"),gk=Cc(),{join:Uc,isAbsolute:yk,sep:_k}=V("node:path"),Sk=Lc(),Bc=Dc(),Ek=Q_();function bk(t){Bc.register(t,Rk),Bc.registerBeforeExit(t,Ok),t.on("close",function(){Bc.unregister(t)})}function vk(){let t=process.execArgv;for(let e=0;e<t.length;e++){let r=t[e];if(r==="--import"||r==="--require"||r==="-r"||r.startsWith("--import=")||r.startsWith("--require=")||r.startsWith("-r="))return!0}return!1}function wk(t,e,r,n,s){!r.execArgv&&vk()&&V.main===void 0&&(r={...r,execArgv:[]}),r={...r,name:s};let i=new Ek({filename:t,workerData:e,workerOpts:r,sync:n});i.on("ready",o),i.on("close",function(){process.removeListener("exit",a)}),process.on("exit",a);function o(){process.removeListener("exit",a),i.unref(),r.autoEnd!==!1&&bk(i)}function a(){i.closed||(i.flushSync(),Sk(100),i.end())}return i}function Rk(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function Ok(t){t.flushSync()}function Tk(t){let{pipeline:e,targets:r,levels:n,dedupe:s,worker:i={},caller:o=gk(),sync:a=!1}=t,l={...t.options},u=typeof o=="string"?[o]:o,c=typeof globalThis=="object"&&Object.prototype.hasOwnProperty.call(globalThis,"__bundlerPathsOverrides")&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides=="object"?globalThis.__bundlerPathsOverrides:Object.create(null),f=t.target;if(f&&r)throw new Error("only one of target or targets can be specified");r?(f=c["pino-worker"]||Uc(__dirname,"worker.js"),l.targets=r.filter(d=>d.target).map(d=>({...d,target:h(d.target)})),l.pipelines=r.filter(d=>d.pipeline).map(d=>d.pipeline.map(m=>({...m,level:d.level,target:h(m.target)})))):e&&(f=c["pino-worker"]||Uc(__dirname,"worker.js"),l.pipelines=[e.map(d=>({...d,target:h(d.target)}))]),n&&(l.levels=n),s&&(l.dedupe=s),l.pinoWillSendConfig=!0;let p=r||e?"pino.transport":f;return wk(h(f),l,i,a,p);function h(d){if(d=c[d]||d,yk(d)||d.indexOf("file://")===0)return d;if(d==="pino/file")return Uc(__dirname,"..","file.js");let m;for(let g of u)try{let S=g==="node:repl"?process.cwd()+_k:g;m=mk(S).resolve(d);break}catch{continue}if(!m)throw new Error(`unable to determine transport target for "${d}"`);return m}}Z_.exports=Tk});var ca=E((_K,d0)=>{"use strict";var $k=V("node:diagnostics_channel"),e0=A_(),{mapHttpRequest:Pk,mapHttpResponse:Ak}=Ac(),Jc=j_(),t0=Dc(),{lsCacheSym:Ck,chindingsSym:o0,writeSym:r0,serializersSym:a0,formatOptsSym:n0,endSym:Ik,stringifiersSym:l0,stringifySym:u0,stringifySafeSym:Kc,wildcardFirstSym:c0,nestedKeySym:Nk,formattersSym:f0,messageKeySym:kk,errorKeySym:xk,nestedKeyStrSym:Lk,msgPrefixSym:la}=Zn(),{isMainThread:qk}=V("worker_threads"),jk=Gc(),[Dk]=process.versions.node.split(".").map(t=>Number(t)),s0=$k.tracingChannel("pino_asJson"),Wc=Dk>=25?t=>JSON.stringify(t):Mk;function ts(){}function Fk(t,e){if(!e)return r;return function(...s){e.call(this,s,r,t)};function r(n,...s){if(typeof n=="object"){let i=n;n!==null&&(n.method&&n.headers&&n.socket?n=Pk(n):typeof n.setHeader=="function"&&(n=Ak(n)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[la]=="string"&&i!==void 0&&i!==null&&(i=this[la]+i),this[r0](n,e0(i,o,this[n0]),t)}else{let i=n===void 0?s.shift():n;typeof this[la]=="string"&&i!==void 0&&i!==null&&(i=this[la]+i),this[r0](null,e0(i,s,this[n0]),t)}}}function Mk(t){let e="",r=0,n=!1,s=255,i=t.length;if(i>100)return JSON.stringify(t);for(var o=0;o<i&&s>=32;o++)s=t.charCodeAt(o),(s===34||s===92)&&(e+=t.slice(r,o)+"\\",r=o,n=!0);return n?e+=t.slice(r):e=t,s<32?JSON.stringify(t):'"'+e+'"'}function Hk(t,e,r,n){if(s0.hasSubscribers===!1)return i0.call(this,t,e,r,n);let s={instance:this,arguments};return s0.traceSync(i0,s,this,t,e,r,n)}function i0(t,e,r,n){let s=this[u0],i=this[Kc],o=this[l0],a=this[Ik],l=this[o0],u=this[a0],c=this[f0],f=this[kk],p=this[xk],h=this[Ck][r]+n;h=h+l;let d;c.log&&(t=c.log(t));let m=o[c0],g="";for(let b in t)if(d=t[b],Object.prototype.hasOwnProperty.call(t,b)&&d!==void 0){u[b]?d=u[b](d):b===p&&u.err&&(d=u.err(d));let _=o[b]||m;switch(typeof d){case"undefined":case"function":continue;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":_&&(d=_(d));break;case"string":d=(_||Wc)(d);break;default:d=(_||s)(d,i)}if(d===void 0)continue;let y=Wc(b);g+=","+y+":"+d}let S="";if(e!==void 0){d=u[f]?u[f](e):e;let b=o[f]||m;switch(typeof d){case"function":break;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":b&&(d=b(d)),S=',"'+f+'":'+d;break;case"string":d=(b||Wc)(d),S=',"'+f+'":'+d;break;default:d=(b||s)(d,i),S=',"'+f+'":'+d}}return this[Nk]&&g?h+this[Lk]+g.slice(1)+"}"+S+a:h+g+S+a}function Vk(t,e){let r,n=t[o0],s=t[u0],i=t[Kc],o=t[l0],a=o[c0],l=t[a0],u=t[f0].bindings;e=u(e);for(let c in e)if(r=e[c],((c.length<5||c!=="level"&&c!=="serializers"&&c!=="formatters"&&c!=="customLevels")&&e.hasOwnProperty(c)&&r!==void 0)===!0){if(r=l[c]?l[c](r):r,r=(o[c]||a||s)(r,i),r===void 0)continue;n+=',"'+c+'":'+r}return n}function zk(t){return t.write!==t.constructor.prototype.write}function ua(t){let e=new Jc(t);return e.on("error",r),!t.sync&&qk&&(t0.register(e,Uk),e.on("close",function(){t0.unregister(e)})),e;function r(n){if(n.code==="EPIPE"){e.write=ts,e.end=ts,e.flushSync=ts,e.destroy=ts;return}e.removeListener("error",r),e.emit("error",n)}}function Uk(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function Bk(t){return function(r,n,s={},i){if(typeof s=="string")i=ua({dest:s}),s={};else if(typeof i=="string"){if(s&&s.transport)throw Error("only one of option.transport or stream can be specified");i=ua({dest:i})}else if(s instanceof Jc||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof Jc||s.transport.writable||s.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(s.transport.targets&&s.transport.targets.length&&s.formatters&&typeof s.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let l;s.customLevels&&(l=s.useOnlyCustomLevels?s.customLevels:Object.assign({},s.levels,s.customLevels)),i=jk({caller:n,...s.transport,levels:l})}if(s=Object.assign({},t,s),s.serializers=Object.assign({},t.serializers,s.serializers),s.formatters=Object.assign({},t.formatters,s.formatters),s.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:a}=s;return o===!1&&(s.level="silent"),a||(s.onChild=ts),i||(zk(process.stdout)?i=process.stdout:i=ua({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function Gk(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[Kc])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function Wk(t,e,r){return{level:t,bindings:e,log:r}}function Jk(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}d0.exports={noop:ts,buildSafeSonicBoom:ua,asChindings:Vk,asJson:Hk,genLog:Fk,createArgsNormalizer:Bk,stringify:Gk,buildFormatters:Wk,normalizeDestFileDescriptor:Jk}});var fa=E((SK,h0)=>{var Kk={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Yk={ASC:"ASC",DESC:"DESC"};h0.exports={DEFAULT_LEVELS:Kk,SORTING_ORDER:Yk}});var Qc=E((EK,y0)=>{"use strict";var{lsCacheSym:Xk,levelValSym:Yc,useOnlyCustomLevelsSym:Qk,streamSym:Zk,formattersSym:ex,hooksSym:tx,levelCompSym:p0}=Zn(),{noop:rx,genLog:pn}=ca(),{DEFAULT_LEVELS:nr,SORTING_ORDER:m0}=fa(),g0={fatal:t=>{let e=pn(nr.fatal,t);return function(...r){let n=this[Zk];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:t=>pn(nr.error,t),warn:t=>pn(nr.warn,t),info:t=>pn(nr.info,t),debug:t=>pn(nr.debug,t),trace:t=>pn(nr.trace,t)},Xc=Object.keys(nr).reduce((t,e)=>(t[nr[e]]=e,t),{}),nx=Object.keys(Xc).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function sx(t){let e=t[ex].level,{labels:r}=t.levels,n={};for(let s in r){let i=e(r[s],Number(s));n[s]=JSON.stringify(i).slice(0,-1)}return t[Xk]=n,t}function ix(t,e){if(e)return!1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function ox(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t]}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[Yc],s=this[Yc]=r[t],i=this[Qk],o=this[p0],a=this[tx].logMethod;for(let l in r){if(o(r[l],s)===!1){this[l]=rx;continue}this[l]=ix(l,i)?g0[l](a):pn(r[l],a)}this.emit("level-change",t,s,e[n],n,this)}function ax(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function lx(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&this[p0](r,this[Yc])}function ux(t,e,r){return t===m0.DESC?e<=r:e>=r}function cx(t){return typeof t=="string"?ux.bind(null,t):t}function fx(t=null,e=!1){let r=t?Object.keys(t).reduce((i,o)=>(i[t[o]]=o,i),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Xc,r),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:nr,t);return{labels:n,values:s}}function dx(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),r?[]:Object.keys(Xc).map(i=>+i),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:nr,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function hx(t,e){let{labels:r,values:n}=t;for(let s in e){if(s in n)throw Error("levels cannot be overridden");if(e[s]in r)throw Error("pre-existing level values cannot be used for new levels")}}function px(t){if(typeof t!="function"&&!(typeof t=="string"&&Object.values(m0).includes(t)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}y0.exports={initialLsCache:nx,genLsCache:sx,levelMethods:g0,getLevel:ax,setLevel:ox,isLevelEnabled:lx,mappings:fx,assertNoLevelCollisions:hx,assertDefaultLevelFound:dx,genLevelComparison:cx,assertLevelComparison:px}});var Zc=E((bK,_0)=>{"use strict";_0.exports={version:"10.3.0"}});var T0=E((wK,O0)=>{"use strict";var{EventEmitter:mx}=V("node:events"),{lsCacheSym:gx,levelValSym:yx,setLevelSym:tf,getLevelSym:S0,chindingsSym:ha,mixinSym:_x,asJsonSym:b0,writeSym:Sx,mixinMergeStrategySym:Ex,timeSym:bx,timeSliceIndexSym:vx,streamSym:v0,serializersSym:mn,formattersSym:ii,errorKeySym:wx,messageKeySym:Rx,useOnlyCustomLevelsSym:Ox,needsMetadataGsym:Tx,redactFmtSym:$x,stringifySym:Px,formatOptsSym:Ax,stringifiersSym:Cx,msgPrefixSym:rf,hooksSym:Ix}=Zn(),{getLevel:Nx,setLevel:kx,isLevelEnabled:xx,mappings:Lx,initialLsCache:qx,genLsCache:jx,assertNoLevelCollisions:Dx}=Qc(),{asChindings:nf,asJson:Fx,buildFormatters:ef,stringify:E0,noop:w0}=ca(),{version:Mx}=Zc(),Hx=kc(),Vx=class{},R0={constructor:Vx,child:zx,bindings:Ux,setBindings:Bx,flush:Jx,isLevelEnabled:xx,version:Mx,get level(){return this[S0]()},set level(t){this[tf](t)},get levelVal(){return this[yx]},set levelVal(t){throw Error("levelVal is read-only")},get msgPrefix(){return this[rf]},get[Symbol.toStringTag](){return"Pino"},[gx]:qx,[Sx]:Wx,[b0]:Fx,[S0]:Nx,[tf]:kx};Object.setPrototypeOf(R0,mx.prototype);O0.exports=function(){return Object.create(R0)};var da=t=>t;function zx(t,e){if(!t)throw Error("missing bindings for child Pino");let r=this[mn],n=this[ii],s=Object.create(this);if(e==null)return s[ii].bindings!==da&&(s[ii]=ef(n.level,da,n.log)),s[ha]=nf(s,t),this.onChild!==w0&&this.onChild(s),s;if(e.hasOwnProperty("serializers")===!0){s[mn]=Object.create(null);for(let u in r)s[mn][u]=r[u];let a=Object.getOwnPropertySymbols(r);for(var i=0;i<a.length;i++){let u=a[i];s[mn][u]=r[u]}for(let u in e.serializers)s[mn][u]=e.serializers[u];let l=Object.getOwnPropertySymbols(e.serializers);for(var o=0;o<l.length;o++){let u=l[o];s[mn][u]=e.serializers[u]}}else s[mn]=r;if(e.hasOwnProperty("formatters")){let{level:a,bindings:l,log:u}=e.formatters;s[ii]=ef(a||n.level,l||da,u||n.log)}else s[ii]=ef(n.level,da,n.log);if(e.hasOwnProperty("customLevels")===!0&&(Dx(this.levels,e.customLevels),s.levels=Lx(e.customLevels,s[Ox]),jx(s)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){s.redact=e.redact;let a=Hx(s.redact,E0),l={stringify:a[$x]};s[Px]=E0,s[Cx]=a,s[Ax]=l}if(typeof e.msgPrefix=="string"&&(s[rf]=(this[rf]||"")+e.msgPrefix),s[ha]=nf(s,t),e.level!==void 0&&e.level!==this.level||e.hasOwnProperty("customLevels")){let a=e.level||this.level;s[tf](a)}return this.onChild(s),s}function Ux(){let e=`{${this[ha].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function Bx(t){let e=nf(this,t);this[ha]=e}function Gx(t,e){return Object.assign(e,t)}function Wx(t,e,r){let n=this[bx](),s=this[_x],i=this[wx],o=this[Rx],a=this[Ex]||Gx,l,u=this[Ix].streamWrite;t==null?l={}:t instanceof Error?(l={[i]:t},e===void 0&&(e=t.message)):(l=t,e===void 0&&t[o]===void 0&&t[i]&&(e=t[i].message)),s&&(l=a(l,s(l,r,this)));let c=this[b0](l,e,r,n),f=this[v0];f[Tx]===!0&&(f.lastLevel=r,f.lastObj=l,f.lastMsg=e,f.lastTime=n.slice(this[vx]),f.lastLogger=this),f.write(u?u(c):c)}function Jx(t){if(t!=null&&typeof t!="function")throw Error("callback must be a function");let e=this[v0];typeof e.flush=="function"?e.flush(t||w0):t&&t()}});var C0=E((lf,A0)=>{"use strict";var{hasOwnProperty:oi}=Object.prototype,yn=af();yn.configure=af;yn.stringify=yn;yn.default=yn;lf.stringify=yn;lf.configure=af;A0.exports=yn;var Kx=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Hr(t){return t.length<5e3&&!Kx.test(t)?`"${t}"`:JSON.stringify(t)}function sf(t,e){if(t.length>200||e)return t.sort(e);for(let r=1;r<t.length;r++){let n=t[r],s=r;for(;s!==0&&t[s-1]>n;)t[s]=t[s-1],s--;t[s]=n}return t}var Yx=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function of(t){return Yx.call(t)!==void 0&&t.length!==0}function $0(t,e,r){t.length<r&&(r=t.length);let n=e===","?"":" ",s=`"0":${n}${t[0]}`;for(let i=1;i<r;i++)s+=`${e}"${i}":${n}${t[i]}`;return s}function Xx(t){if(oi.call(t,"circularValue")){let e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function Qx(t){let e;if(oi.call(t,"deterministic")&&(e=t.deterministic,typeof e!="boolean"&&typeof e!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return e===void 0?!0:e}function Zx(t,e){let r;if(oi.call(t,e)&&(r=t[e],typeof r!="boolean"))throw new TypeError(`The "${e}" argument must be of type boolean`);return r===void 0?!0:r}function P0(t,e){let r;if(oi.call(t,e)){if(r=t[e],typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function gn(t){return t===1?"1 item":`${t} items`}function eL(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function tL(t){if(oi.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function af(t){t={...t};let e=tL(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=Xx(t),n=Zx(t,"bigint"),s=Qx(t),i=typeof s=="function"?s:void 0,o=P0(t,"maximumDepth"),a=P0(t,"maximumBreadth");function l(h,d,m,g,S,b){let _=d[h];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(h)),_=g.call(d,h,_),typeof _){case"string":return Hr(_);case"object":{if(_===null)return"null";if(m.indexOf(_)!==-1)return r;let y="",R=",",T=b;if(Array.isArray(_)){if(_.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(_),S!==""&&(b+=S,y+=`
27
+ `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(s=>r.is(s))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function hg(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",s="9229",i;return(i=e.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?s=i[3]:n=i[3]):(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],n=i[3],s=i[4]),r&&s!=="0"?`${r}=${n}:${parseInt(s)+1}`:e})}pg.Command=Xu});var Sg=E(At=>{var{Argument:gg}=Lo(),{Command:Qu}=mg(),{CommanderError:gC,InvalidArgumentError:yg}=Js(),{Help:yC}=zu(),{Option:_g}=Wu();At.program=new Qu;At.createCommand=t=>new Qu(t);At.createOption=(t,e)=>new _g(t,e);At.createArgument=(t,e)=>new gg(t,e);At.Command=Qu;At.Option=_g;At.Argument=gg;At.Help=yC;At.CommanderError=gC;At.InvalidArgumentError=yg;At.InvalidOptionArgumentError=yg});var wg=E((P8,vg)=>{"use strict";function _C(t){var e=new t,r=e;function n(){var i=e;return i.next?e=i.next:(e=new t,r=e),i.next=null,i}function s(i){r.next=i,r=i}return{get:n,release:s}}vg.exports=_C});var Og=E((A8,Zu)=>{"use strict";var SC=wg();function Rg(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=SC(EC),s=null,i=null,o=0,a=null,l={push:m,drain:gt,saturated:gt,pause:c,paused:!1,get concurrency(){return r},set concurrency(T){if(!(T>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=T,!l.paused)for(;s&&o<r;)o++,S()},running:u,resume:h,idle:d,length:f,getQueue:p,unshift:g,empty:gt,kill:b,killAndDrain:_,error:R,abort:y};return l;function u(){return o}function c(){l.paused=!0}function f(){for(var T=s,O=0;T;)T=T.next,O++;return O}function p(){for(var T=s,O=[];T;)O.push(T.value),T=T.next;return O}function h(){if(l.paused){if(l.paused=!1,s===null){o++,S();return}for(;s&&o<r;)o++,S()}}function d(){return o===0&&l.length()===0}function m(T,O){var w=n.get();w.context=t,w.release=S,w.value=T,w.callback=O||gt,w.errorHandler=a,o>=r||l.paused?i?(i.next=w,i=w):(s=w,i=w,l.saturated()):(o++,e.call(t,w.value,w.worked))}function g(T,O){var w=n.get();w.context=t,w.release=S,w.value=T,w.callback=O||gt,w.errorHandler=a,o>=r||l.paused?s?(w.next=s,s=w):(s=w,i=w,l.saturated()):(o++,e.call(t,w.value,w.worked))}function S(T){T&&n.release(T);var O=s;O&&o<=r?l.paused?o--:(i===s&&(i=null),s=O.next,O.next=null,e.call(t,O.value,O.worked),i===null&&l.empty()):--o===0&&l.drain()}function b(){s=null,i=null,l.drain=gt}function _(){s=null,i=null,l.drain(),l.drain=gt}function y(){var T=s;for(s=null,i=null;T;){var O=T.next,w=T.callback,$=T.errorHandler,v=T.value,P=T.context;T.value=null,T.callback=gt,T.errorHandler=null,$&&$(new Error("abort"),v),w.call(P,new Error("abort")),T.release(T),T=O}l.drain=gt}function R(T){a=T}}function gt(){}function EC(){this.value=null,this.callback=gt,this.next=null,this.release=gt,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var s=t.callback,i=t.errorHandler,o=t.value;t.value=null,t.callback=gt,t.errorHandler&&i(r,o),s.call(t.context,r,n),t.release(t)}}function bC(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(c,f){e.call(this,c).then(function(p){f(null,p)},f)}var s=Rg(t,n,r),i=s.push,o=s.unshift;return s.push=a,s.unshift=l,s.drained=u,s;function a(c){var f=new Promise(function(p,h){i(c,function(d,m){if(d){h(d);return}p(m)})});return f.catch(gt),f}function l(c){var f=new Promise(function(p,h){o(c,function(d,m){if(d){h(d);return}p(m)})});return f.catch(gt),f}function u(){var c=new Promise(function(f){process.nextTick(function(){if(s.idle())f();else{var p=s.drain;s.drain=function(){typeof p=="function"&&p(),f(),s.drain=p}}})});return c}}Zu.exports=Rg;Zu.exports.promise=bC});var ec=E((C8,Ks)=>{"use strict";var{format:vC}=V("node:util");function wC(){return`${this.name} [${this.code}]: ${this.message}`}var qo=Symbol.for("fastify-error-generic");function Un(t,e,r=500,n=Error,s=Un.captureStackTrace){let i=t===qo;if(i&&(t="FST_ERR"),!t)throw new Error("Fastify error code must not be empty");if(!e)throw new Error("Fastify error message must not be empty");t=t.toUpperCase(),!r&&(r=void 0);let o=Symbol.for(`fastify-error ${t}`);function a(...l){if(!new.target)return new a(...l);this.code=t,this.name="FastifyError",this.statusCode=r;let u=l.length-1;u!==-1&&l[u]&&typeof l[u]=="object"&&"cause"in l[u]&&(this.cause=l.pop().cause),this.message=vC(e,...l),Error.stackTraceLimit&&s&&Error.captureStackTrace(this,a)}return a.prototype=Object.create(n.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0},[qo]:{value:!0,enumerable:!1,writable:!1,configurable:!1},[o]:{value:!0,enumerable:!1,writable:!1,configurable:!1}}),i?Object.defineProperty(a,Symbol.hasInstance,{value(l){return l&&l[qo]},configurable:!1,writable:!1,enumerable:!1}):Object.defineProperty(a,Symbol.hasInstance,{value(l){return l&&l[o]},configurable:!1,writable:!1,enumerable:!1}),a.prototype[Symbol.toStringTag]="Error",a.prototype.toString=wC,a}Un.captureStackTrace=!0;var RC=Un(qo,"Fastify Error",500,Error);Ks.exports=Un;Ks.exports.FastifyError=RC;Ks.exports.default=Un;Ks.exports.createError=Un});var jo=E((I8,Tg)=>{"use strict";var{createError:Dr}=ec();Tg.exports={AVV_ERR_EXPOSE_ALREADY_DEFINED:Dr("AVV_ERR_EXPOSE_ALREADY_DEFINED","'%s' is already defined, specify an expose option for '%s'"),AVV_ERR_ATTRIBUTE_ALREADY_DEFINED:Dr("AVV_ERR_ATTRIBUTE_ALREADY_DEFINED","'%s' is already defined"),AVV_ERR_CALLBACK_NOT_FN:Dr("AVV_ERR_CALLBACK_NOT_FN","Callback for '%s' hook is not a function. Received: '%s'"),AVV_ERR_PLUGIN_NOT_VALID:Dr("AVV_ERR_PLUGIN_NOT_VALID","Plugin must be a function or a promise. Received: '%s'"),AVV_ERR_ROOT_PLG_BOOTED:Dr("AVV_ERR_ROOT_PLG_BOOTED","Root plugin has already booted"),AVV_ERR_PARENT_PLG_LOADED:Dr("AVV_ERR_PARENT_PLG_LOADED","Impossible to load '%s' plugin because the parent '%s' was already loaded"),AVV_ERR_READY_TIMEOUT:Dr("AVV_ERR_READY_TIMEOUT","Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise"),AVV_ERR_PLUGIN_EXEC_TIMEOUT:Dr("AVV_ERR_PLUGIN_EXEC_TIMEOUT","Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise")}});var Bn=E((N8,$g)=>{"use strict";var OC=Symbol("avvio.Boot"),TC=Symbol("isOnCloseHandler"),$C=Symbol("avvio.ThenifyDoNotWrap"),PC=Symbol("avvio.TimeTree.untrackNode"),AC=Symbol("avvio.TimeTree.trackNode"),CC=Symbol("avvio.TimeTree.getParent"),IC=Symbol("avvio.TimeTree.getNode"),NC=Symbol("avvio.TimeTree.addNode"),kC=Symbol.for("plugin-meta");$g.exports={kAvvio:OC,kIsOnCloseHandler:TC,kThenifyDoNotWrap:$C,kUntrackNode:PC,kTrackNode:AC,kGetParent:CC,kGetNode:IC,kAddNode:NC,kPluginMeta:kC}});var xg=E((k8,kg)=>{"use strict";var{kUntrackNode:Pg,kTrackNode:tc,kGetParent:Ag,kGetNode:Cg,kAddNode:Ig}=Bn(),rc=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[tc](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[Pg](e){this.tableId.delete(e.id);let r=this.tableLabel.get(e.label);r.pop(),r.length===0&&this.tableLabel.delete(e.label)}[Ag](e){if(e===null)return null;if(this.tableLabel.has(e)){let r=this.tableLabel.get(e);return r[r.length-1]}else return null}[Cg](e){return this.tableId.get(e)}[Ig](e,r,n){let s=this[Ag](e);if(s===null)return this.root={parent:null,id:"root",label:r,nodes:[],start:n,stop:null,diff:-1},this[tc](this.root),this.root.id;let o=`${r}-${Math.random()}`,a={parent:e,id:o,label:r,nodes:[],start:n,stop:null,diff:-1};return s.nodes.push(a),this[tc](a),o}start(e,r,n=Date.now()){return this[Ig](e,r,n)}stop(e,r=Date.now()){let n=this[Cg](e);n&&(n.stop=r,n.diff=n.stop-n.start||0,this[Pg](n))}toJSON(){return Object.assign({},this.root)}prettyPrint(){return Ng(this.toJSON())}};function Ng(t,e=""){let r=e,n=t.nodes.length,s=n-1;r+=`${t.label} ${t.diff} ms
28
+ `;for(let i=0;i<n;++i){let o=t.nodes[i],a=e+(i===s?" ":"\u2502 ");r+=e,r+=i===s?"\u2514\u2500":"\u251C\u2500",r+=o.nodes.length===0?"\u2500 ":"\u252C ",r+=Ng(o,a).slice(e.length+2)}return r}kg.exports={TimeTree:rc}});var Do=E((x8,Lg)=>{"use strict";var{debuglog:xC}=V("node:util"),LC=xC("avvio");Lg.exports={debug:LC}});var jg=E((L8,qg)=>{"use strict";function qC(){let t={resolve:null,reject:null,promise:null};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}qg.exports={createPromise:qC}});var Fg=E((q8,Dg)=>{"use strict";var{kPluginMeta:nc}=Bn();function jC(t,e){return t[nc]&&t[nc].name?t[nc].name:e&&e.name?e.name:t.name?t.name:t.toString().split(`
29
+ `).slice(0,2).map(r=>r.trim()).join(" -- ")}Dg.exports={getPluginName:jC}});var Fo=E((j8,Mg)=>{"use strict";function DC(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}Mg.exports={isPromiseLike:DC}});var Vg=E((D8,Hg)=>{"use strict";var{EventEmitter:FC}=V("node:events"),{inherits:MC}=V("node:util"),{debug:Ge}=Do(),{createPromise:HC}=jg(),{AVV_ERR_PLUGIN_EXEC_TIMEOUT:VC}=jo(),{getPluginName:zC}=Fg(),{isPromiseLike:UC}=Fo();function Gn(t,e,r,n,s){this.queue=t,this.func=e,this.options=r,this.isAfter=n,this.timeout=s,this.started=!1,this.name=zC(e,r),this.queue.pause(),this._error=null,this.loaded=!1,this._promise=null,this.startTime=null}MC(Gn,FC);Gn.prototype.exec=function(t,e){Ge("exec",this.name),this.server=t;let r=this.func,n=this.name,s=!1;this.options=typeof this.options=="function"?this.options(this.server):this.options;let i=null,o=l=>{if(s){Ge("loading complete",n);return}this._error=l,Ge(l?"exec errored":"exec completed",n),s=!0,i&&clearTimeout(i),e(l)};this.timeout>0&&(Ge("setting up timeout",n,this.timeout),i=setTimeout(function(){Ge("timed out",n),i=null;let l=new VC(n);l.fn=r,o(l)},this.timeout)),this.started=!0,this.startTime=Date.now(),this.emit("start",this.server?this.server.name:null,this.name,Date.now());let a=r(this.server,this.options,o);UC(a)?(Ge("exec: resolving promise",n),a.then(()=>process.nextTick(o),l=>process.nextTick(o,l))):r.length<3&&o()};Gn.prototype.loadedSoFar=function(){if(Ge("loadedSoFar",this.name),this.loaded)return Promise.resolve();let t=()=>{this.server.after((r,n)=>{this._error=r,this.queue.pause(),this._promise&&(r?(Ge("rejecting promise",this.name,r),this._promise.reject(r)):(Ge("resolving promise",this.name),this._promise.resolve()),this._promise=null),process.nextTick(n,r)}),this.queue.resume()},e;return this._promise?e=Promise.resolve():(this._promise=HC(),e=this._promise.promise,this.server?t():this.on("start",t)),e};Gn.prototype.enqueue=function(t,e){Ge("enqueue",this.name,t.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.queue.push(t,e)};Gn.prototype.finish=function(t,e){Ge("finish",this.name,t);let r=()=>{this.loaded||(Ge("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,e(t))};if(t){this._promise&&(this._promise.reject(t),this._promise=null),r();return}let n=()=>{if(Ge("check",this.name,this.queue.length(),this.queue.running(),this._promise),this.queue.length()===0&&this.queue.running()===0)if(this._promise){let s=()=>{Ge("wrap"),queueMicrotask(n)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else r();else Ge("delayed",this.name),this.queue.drain=()=>{Ge("drain",this.name),this.queue.drain=BC,queueMicrotask(n)}};queueMicrotask(n),this.queue.resume()};function BC(){}Hg.exports={Plugin:Gn}});var Ug=E((F8,zg)=>{"use strict";var{AVV_ERR_PLUGIN_NOT_VALID:sc}=jo();function GC(t){if(!(t&&(typeof t=="function"||typeof t.then=="function")))throw Array.isArray(t)?new sc("array"):t===null?new sc("null"):new sc(typeof t)}zg.exports={validatePlugin:GC}});var Gg=E((M8,Bg)=>{"use strict";function WC(t){return t!==null&&typeof t=="object"&&typeof t.default=="function"}Bg.exports={isBundledOrTypescriptPlugin:WC}});var Kg=E((H8,Jg)=>{"use strict";var{debug:Wg}=Do(),{kThenifyDoNotWrap:ic}=Bn();function JC(){if(this.booted){Wg("thenify returning undefined because we are already booted");return}if(this[ic]){this[ic]=!1;return}return Wg("thenify"),(t,e)=>this._loadRegistered().then(()=>(this[ic]=!0,t(this._server)),e)}Jg.exports={thenify:JC}});var Xg=E((V8,Yg)=>{"use strict";var{isPromiseLike:KC}=Fo(),{kAvvio:YC}=Bn();function XC(t,e,r){let n=t.apply(t,e);KC(n)&&!n[YC]?n.then(()=>process.nextTick(r),s=>process.nextTick(r,s)):r&&process.nextTick(r)}Yg.exports={executeWithThenable:XC}});var oy=E((z8,iy)=>{"use strict";var Mo=Og(),QC=V("node:events").EventEmitter,ZC=V("node:util").inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Ys,AVV_ERR_CALLBACK_NOT_FN:Wn,AVV_ERR_ROOT_PLG_BOOTED:eI,AVV_ERR_READY_TIMEOUT:tI,AVV_ERR_ATTRIBUTE_ALREADY_DEFINED:rI}=jo(),{kAvvio:ey,kIsOnCloseHandler:ty}=Bn(),{TimeTree:nI}=xg(),{Plugin:ry}=Vg(),{debug:Jn}=Do(),{validatePlugin:sI}=Ug(),{isBundledOrTypescriptPlugin:iI}=Gg(),{isPromiseLike:oI}=Fo(),{thenify:ny}=Kg(),{executeWithThenable:Qg}=Xg();function je(t,e,r){if(typeof t=="function"&&arguments.length===1&&(r=t,e={},t=null),typeof e=="function"&&(r=e,e={}),e=e||{},e.autostart=e.autostart!==!1,e.timeout=Number(e.timeout)||0,e.expose=e.expose||{},!new.target)return new je(t,e,r);this._server=t||this,this._opts=e,t&&this._expose(),this._current=[],this._error=null,this._lastUsed=null,this.setMaxListeners(0),r&&this.once("start",r),this.started=!1,this.booted=!1,this.pluginTree=new nI,this._readyQ=Mo(this,sy,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Zg},this._closeQ=Mo(this,lI,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Zg},this._doStart=null;let n=this;this._root=new ry(Mo(this,this._loadPluginNextTick,1),function(i,o,a){n._doStart=a,o.autostart&&n.start()},e,!1,0),this._trackPluginLoading(this._root),this._loadPlugin(this._root,s=>{Jn("root plugin ready");try{this.emit("preReady"),this._root=null}catch(i){s=s||this._error||i}if(s){if(this._error=s,this._readyQ.length()===0)throw s}else this.booted=!0;this._readyQ.resume()})}ZC(je,QC);je.prototype.start=function(){return this.started=!0,process.nextTick(this._doStart),this};je.prototype.override=function(t,e,r){return t};je.prototype[ey]=!0;je.prototype.use=function(t,e){return this._lastUsed=this._addPlugin(t,e,!1),this};je.prototype._loadRegistered=function(){let t=this._current[0];return!this.started&&!this.booted&&process.nextTick(()=>this._root.queue.resume()),t?t.loadedSoFar():Promise.resolve()};Object.defineProperty(je.prototype,"then",{get:ny});je.prototype._addPlugin=function(t,e,r){if(iI(t)&&(t=t.default),sI(t),e=e||{},this.booted)throw new eI;let n=this._current[0],s=this._opts.timeout;if(!n.loaded&&n.timeout>0){let o=Date.now()-n.startTime;s=n.timeout-(o+3)}let i=new ry(Mo(this,this._loadPluginNextTick,1),t,e,r,s);if(this._trackPluginLoading(i),n.loaded)throw new Error(i.name,n.name);return n.enqueue(i,o=>{o&&(this._error=o)}),i};je.prototype._expose=function(){let e=this,r=e._server,{use:n="use",after:s="after",ready:i="ready",onClose:o="onClose",close:a="close"}=this._opts.expose;if(r[n])throw new Ys(n,"use");if(r[n]=function(l,u){return e.use(l,u),this},r[s])throw new Ys(s,"after");if(r[s]=function(l){return typeof l!="function"?e._loadRegistered():(e.after(oc(l,this)),this)},r[i])throw new Ys(i,"ready");if(r[i]=function(l){if(l&&typeof l!="function")throw new Wn(i,typeof l);return e.ready(l?oc(l,this):void 0)},r[o])throw new Ys(o,"onClose");if(r[o]=function(l){if(typeof l!="function")throw new Wn(o,typeof l);return e.onClose(uI(l,this)),this},r[a])throw new Ys(a,"close");if(r[a]=function(l){if(l&&typeof l!="function")throw new Wn(a,typeof l);return l?(e.close(oc(l,this)),this):e.close()},r.then)throw new rI("then");Object.defineProperty(r,"then",{get:ny.bind(e)}),r[ey]=!0};je.prototype.after=function(t){if(!t)return this._loadRegistered();this._addPlugin(e.bind(this),{},!0);function e(r,n,s){sy.call(this,t,s)}return this};je.prototype.onClose=function(t){if(typeof t!="function")throw new Wn("onClose",typeof t);return t[ty]=!0,this._closeQ.unshift(t,e=>{e&&(this._error=e)}),this};je.prototype.close=function(t){let e;if(t){if(typeof t!="function")throw new Wn("close",typeof t)}else e=new Promise(function(r,n){t=function(s){if(s)return n(s);r()}});return this.ready(()=>{this._error=null,this._closeQ.push(t),process.nextTick(this._closeQ.resume.bind(this._closeQ))}),e};je.prototype.ready=function(t){if(t){if(typeof t!="function")throw new Wn("ready",typeof t);this._readyQ.push(t),queueMicrotask(this.start.bind(this));return}return new Promise((e,r)=>{this._readyQ.push(s),this.start();let n=this._current[0].server;function s(i,o,a){i?r(i):e(n),process.nextTick(a)}})};je.prototype._trackPluginLoading=function(t){let e=this._current[0]?.name||null;t.once("start",(r,n,s)=>{let i=this.pluginTree.start(e||null,n,s);t.once("loaded",(o,a,l)=>{this.pluginTree.stop(i,l)})})};je.prototype.prettyPrint=function(){return this.pluginTree.prettyPrint()};je.prototype.toJSON=function(){return this.pluginTree.toJSON()};je.prototype._loadPlugin=function(t,e){let r=this;if(oI(t.func)){t.func.then(o=>{typeof o.default=="function"&&(o=o.default),t.func=o,this._loadPlugin(t,e)},e);return}let n=r._current[0];if(r._current.unshift(t),r._error&&!t.isAfter){Jn("skipping loading of plugin as instance errored and it is not an after",t.name),process.nextTick(i);return}let s=n&&n.server||r._server;if(!t.isAfter)try{s=r.override(s,t.func,t.options)}catch(o){return Jn("override errored",t.name),i(o)}t.exec(s,i);function i(o){t.finish(o,a=>{r._current.shift(),e(a)})}};je.prototype._loadPluginNextTick=function(t,e){process.nextTick(this._loadPlugin.bind(this),t,e)};function Zg(){}function sy(t,e){let r=this._server,n=this._error;if(this._error=null,t.length===0)this._error=n,Qg(t,[],e);else if(t.length===1)Qg(t,[n],e);else if(this._opts.timeout===0){let s=i=>{this._error=i,e(this._error)};t.length===2?t(n,s):t(n,r,s)}else aI.call(this,t,n,r,e)}function aI(t,e,r,n){let s=t.unwrappedName??t.name;Jn("setting up ready timeout",s,this._opts.timeout);let i=setTimeout(()=>{Jn("timed out",s),i=null;let a=new tI(s);a.fn=t,this._error=a,n(a)},this._opts.timeout);t.length===2?t(e,o.bind(this)):t(e,r,o.bind(this));function o(a){i&&(clearTimeout(i),this._error=a,n(this._error))}}function lI(t,e){let r=this._server,n=t[ty];if(t.length===0||t.length===1){let s;n?s=t(r):s=t(this._error),s&&typeof s.then=="function"?(Jn("resolving close/onClose promise"),s.then(()=>process.nextTick(e),i=>process.nextTick(e,i))):process.nextTick(e)}else t.length===2?t(n?r:this._error,e):n?t(r,e):t(this._error,r,e)}function uI(t,e){return r.bind(e);function r(n,s){let i;t.length===0?(i=t(),i&&i.then?i.then(function(){process.nextTick(s)},s):process.nextTick(s)):t.length===1?(i=t(this),i&&i.then?i.then(function(){process.nextTick(s)},s):process.nextTick(s)):t(this,s)}}function oc(t,e){let r=n.bind(e);return r.unwrappedName=t.name,r;function n(s,i){let o;t?t.length===0?(o=t(),o&&o.then?o.then(function(){process.nextTick(i,s)},i):process.nextTick(i,s)):t.length===1?(o=t(s),o&&o.then?o.then(function(){process.nextTick(i)},i):process.nextTick(i)):t.length===2?t(s,i):t(s,this,i):process.nextTick(i)}}iy.exports=je});var De=E((U8,ay)=>{"use strict";var cI={kAvvioBoot:Symbol("fastify.avvioBoot"),kChildren:Symbol("fastify.children"),kServerBindings:Symbol("fastify.serverBindings"),kBodyLimit:Symbol("fastify.bodyLimit"),kSupportedHTTPMethods:Symbol("fastify.acceptedHTTPMethods"),kRoutePrefix:Symbol("fastify.routePrefix"),kLogLevel:Symbol("fastify.logLevel"),kLogSerializers:Symbol("fastify.logSerializers"),kHooks:Symbol("fastify.hooks"),kContentTypeParser:Symbol("fastify.contentTypeParser"),kState:Symbol("fastify.state"),kOptions:Symbol("fastify.options"),kDisableRequestLogging:Symbol("fastify.disableRequestLogging"),kPluginNameChain:Symbol("fastify.pluginNameChain"),kRouteContext:Symbol("fastify.context"),kGenReqId:Symbol("fastify.genReqId"),kHttp2ServerSessions:Symbol("fastify.http2ServerSessions"),kSchemaController:Symbol("fastify.schemaController"),kSchemaHeaders:Symbol("headers-schema"),kSchemaParams:Symbol("params-schema"),kSchemaQuerystring:Symbol("querystring-schema"),kSchemaBody:Symbol("body-schema"),kSchemaResponse:Symbol("response-schema"),kSchemaErrorFormatter:Symbol("fastify.schemaErrorFormatter"),kSchemaVisited:Symbol("fastify.schemas.visited"),kRequest:Symbol("fastify.Request"),kRequestPayloadStream:Symbol("fastify.RequestPayloadStream"),kRequestAcceptVersion:Symbol("fastify.RequestAcceptVersion"),kRequestCacheValidateFns:Symbol("fastify.request.cache.validateFns"),kRequestOriginalUrl:Symbol("fastify.request.originalUrl"),kFourOhFour:Symbol("fastify.404"),kCanSetNotFoundHandler:Symbol("fastify.canSetNotFoundHandler"),kFourOhFourLevelInstance:Symbol("fastify.404LogLevelInstance"),kFourOhFourContext:Symbol("fastify.404ContextKey"),kDefaultJsonParse:Symbol("fastify.defaultJSONParse"),kReply:Symbol("fastify.Reply"),kReplySerializer:Symbol("fastify.reply.serializer"),kReplyIsError:Symbol("fastify.reply.isError"),kReplyHeaders:Symbol("fastify.reply.headers"),kReplyTrailers:Symbol("fastify.reply.trailers"),kReplyHasStatusCode:Symbol("fastify.reply.hasStatusCode"),kReplyHijacked:Symbol("fastify.reply.hijacked"),kReplyStartTime:Symbol("fastify.reply.startTime"),kReplyNextErrorHandler:Symbol("fastify.reply.nextErrorHandler"),kReplyEndTime:Symbol("fastify.reply.endTime"),kReplyErrorHandlerCalled:Symbol("fastify.reply.errorHandlerCalled"),kReplyIsRunningOnErrorHook:Symbol("fastify.reply.isRunningOnErrorHook"),kReplySerializerDefault:Symbol("fastify.replySerializerDefault"),kReplyCacheSerializeFns:Symbol("fastify.reply.cache.serializeFns"),kTestInternals:Symbol("fastify.testInternals"),kErrorHandler:Symbol("fastify.errorHandler"),kErrorHandlerAlreadySet:Symbol("fastify.errorHandlerAlreadySet"),kChildLoggerFactory:Symbol("fastify.childLoggerFactory"),kHasBeenDecorated:Symbol("fastify.hasBeenDecorated"),kKeepAliveConnections:Symbol("fastify.keepAliveConnections"),kRouteByFastify:Symbol("fastify.routeByFastify")};ay.exports=cI});var uy=E((B8,Ho)=>{"use strict";var{format:ac}=V("node:util");function fI(t){return ly({...t,name:"DeprecationWarning"})}function ly({name:t,code:e,message:r,unlimited:n=!1}={}){if(!t)throw new Error("Warning name must not be empty");if(!e)throw new Error("Warning code must not be empty");if(!r)throw new Error("Warning message must not be empty");if(typeof n!="boolean")throw new Error("Warning opts.unlimited must be a boolean");e=e.toUpperCase();let s={[t]:function(o,a,l){i.emitted===!0&&i.unlimited!==!0||(i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code))}};n&&(s={[t]:function(o,a,l){i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code)}});let i=s[t];return i.emitted=!1,i.message=r,i.unlimited=n,i.code=e,i.format=function(o,a,l){let u;return o&&a&&l?u=ac(r,o,a,l):o&&a?u=ac(r,o,a):o?u=ac(r,o):u=r,u},i}var lc={createWarning:ly,createDeprecation:fI};Ho.exports=lc;Ho.exports.default=lc;Ho.exports.processWarning=lc});var Kn=E((G8,cy)=>{"use strict";var{createWarning:Xs}=uy(),dI=Xs({name:"FastifyWarning",code:"FSTWRN001",message:"The %s schema for %s: %s is missing. This may indicate the schema is not well specified.",unlimited:!0}),hI=Xs({name:"FastifyWarning",code:"FSTWRN003",message:"The %s mixes async and callback styles that may lead to unhandled rejections. Please use only one of them.",unlimited:!0}),pI=Xs({name:"FastifyWarning",code:"FSTWRN004",message:"It seems that you are overriding an errorHandler in the same scope, which can lead to subtle bugs.",unlimited:!0}),mI=Xs({name:"FastifySecurity",code:"FSTSEC001",message:'You are using /%s/ Content-Type which may be vulnerable to CORS attack. Please make sure your RegExp start with "^" or include ";?" to proper detection of the essence MIME type.',unlimited:!0}),gI=Xs({name:"FastifyWarning",code:"FSTDEP022",message:'The router options for %s property access is deprecated. Please use "options.routerOptions" instead for accessing router options. The router options will be removed in `fastify@6`.',unlimited:!0});cy.exports={FSTWRN001:dI,FSTWRN003:hI,FSTWRN004:pI,FSTSEC001:mI,FSTDEP022:gI}});var He=E((W8,Vo)=>{"use strict";var L=ec(),fn={FST_ERR_NOT_FOUND:L("FST_ERR_NOT_FOUND","Not Found",404),FST_ERR_OPTIONS_NOT_OBJ:L("FST_ERR_OPTIONS_NOT_OBJ","Options must be an object",500,TypeError),FST_ERR_QSP_NOT_FN:L("FST_ERR_QSP_NOT_FN","querystringParser option should be a function, instead got '%s'",500,TypeError),FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN:L("FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN","schemaController.bucket option should be a function, instead got '%s'",500,TypeError),FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN:L("FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN","schemaErrorFormatter option should be a non async function. Instead got '%s'.",500,TypeError),FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ:L("FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ","ajv.customOptions option should be an object, instead got '%s'",500,TypeError),FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR:L("FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR","ajv.plugins option should be an array, instead got '%s'",500,TypeError),FST_ERR_VALIDATION:L("FST_ERR_VALIDATION","%s",400),FST_ERR_LISTEN_OPTIONS_INVALID:L("FST_ERR_LISTEN_OPTIONS_INVALID","Invalid listen options: '%s'",500,TypeError),FST_ERR_ERROR_HANDLER_NOT_FN:L("FST_ERR_ERROR_HANDLER_NOT_FN","Error Handler must be a function",500,TypeError),FST_ERR_ERROR_HANDLER_ALREADY_SET:L("FST_ERR_ERROR_HANDLER_ALREADY_SET","Error Handler already set in this scope. Set 'allowErrorHandlerOverride: true' to allow overriding.",500,TypeError),FST_ERR_CTP_ALREADY_PRESENT:L("FST_ERR_CTP_ALREADY_PRESENT","Content type parser '%s' already present."),FST_ERR_CTP_INVALID_TYPE:L("FST_ERR_CTP_INVALID_TYPE","The content type should be a string or a RegExp",500,TypeError),FST_ERR_CTP_EMPTY_TYPE:L("FST_ERR_CTP_EMPTY_TYPE","The content type cannot be an empty string",500,TypeError),FST_ERR_CTP_INVALID_HANDLER:L("FST_ERR_CTP_INVALID_HANDLER","The content type handler should be a function",500,TypeError),FST_ERR_CTP_INVALID_PARSE_TYPE:L("FST_ERR_CTP_INVALID_PARSE_TYPE","The body parser can only parse your data as 'string' or 'buffer', you asked '%s' which is not supported.",500,TypeError),FST_ERR_CTP_BODY_TOO_LARGE:L("FST_ERR_CTP_BODY_TOO_LARGE","Request body is too large",413,RangeError),FST_ERR_CTP_INVALID_MEDIA_TYPE:L("FST_ERR_CTP_INVALID_MEDIA_TYPE","Unsupported Media Type: %s",415),FST_ERR_CTP_INVALID_CONTENT_LENGTH:L("FST_ERR_CTP_INVALID_CONTENT_LENGTH","Request body size did not match Content-Length",400,RangeError),FST_ERR_CTP_EMPTY_JSON_BODY:L("FST_ERR_CTP_EMPTY_JSON_BODY","Body cannot be empty when content-type is set to 'application/json'",400),FST_ERR_CTP_INVALID_JSON_BODY:L("FST_ERR_CTP_INVALID_JSON_BODY","Body is not valid JSON but content-type is set to 'application/json'",400),FST_ERR_CTP_INSTANCE_ALREADY_STARTED:L("FST_ERR_CTP_INSTANCE_ALREADY_STARTED",'Cannot call "%s" when fastify instance is already started!',400),FST_ERR_DEC_ALREADY_PRESENT:L("FST_ERR_DEC_ALREADY_PRESENT","The decorator '%s' has already been added!"),FST_ERR_DEC_DEPENDENCY_INVALID_TYPE:L("FST_ERR_DEC_DEPENDENCY_INVALID_TYPE","The dependencies of decorator '%s' must be of type Array.",500,TypeError),FST_ERR_DEC_MISSING_DEPENDENCY:L("FST_ERR_DEC_MISSING_DEPENDENCY","The decorator is missing dependency '%s'."),FST_ERR_DEC_AFTER_START:L("FST_ERR_DEC_AFTER_START","The decorator '%s' has been added after start!"),FST_ERR_DEC_REFERENCE_TYPE:L("FST_ERR_DEC_REFERENCE_TYPE","The decorator '%s' of type '%s' is a reference type. Use the { getter, setter } interface instead."),FST_ERR_DEC_UNDECLARED:L("FST_ERR_DEC_UNDECLARED","No decorator '%s' has been declared on %s."),FST_ERR_HOOK_INVALID_TYPE:L("FST_ERR_HOOK_INVALID_TYPE","The hook name must be a string",500,TypeError),FST_ERR_HOOK_INVALID_HANDLER:L("FST_ERR_HOOK_INVALID_HANDLER","%s hook should be a function, instead got %s",500,TypeError),FST_ERR_HOOK_INVALID_ASYNC_HANDLER:L("FST_ERR_HOOK_INVALID_ASYNC_HANDLER","Async function has too many arguments. Async hooks should not use the 'done' argument.",500,TypeError),FST_ERR_HOOK_NOT_SUPPORTED:L("FST_ERR_HOOK_NOT_SUPPORTED","%s hook not supported!",500,TypeError),FST_ERR_MISSING_MIDDLEWARE:L("FST_ERR_MISSING_MIDDLEWARE","You must register a plugin for handling middlewares, visit fastify.dev/docs/latest/Reference/Middleware/ for more info.",500),FST_ERR_HOOK_TIMEOUT:L("FST_ERR_HOOK_TIMEOUT","A callback for '%s' hook%s timed out. You may have forgotten to call 'done' function or to resolve a Promise"),FST_ERR_LOG_INVALID_DESTINATION:L("FST_ERR_LOG_INVALID_DESTINATION","Cannot specify both logger.stream and logger.file options"),FST_ERR_LOG_INVALID_LOGGER:L("FST_ERR_LOG_INVALID_LOGGER","Invalid logger object provided. The logger instance should have these functions(s): '%s'.",500,TypeError),FST_ERR_LOG_INVALID_LOGGER_INSTANCE:L("FST_ERR_LOG_INVALID_LOGGER_INSTANCE","loggerInstance only accepts a logger instance.",500,TypeError),FST_ERR_LOG_INVALID_LOGGER_CONFIG:L("FST_ERR_LOG_INVALID_LOGGER_CONFIG","logger options only accepts a configuration object.",500,TypeError),FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED:L("FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED","You cannot provide both logger and loggerInstance. Please provide only one.",500,TypeError),FST_ERR_REP_INVALID_PAYLOAD_TYPE:L("FST_ERR_REP_INVALID_PAYLOAD_TYPE","Attempted to send payload of invalid type '%s'. Expected a string or Buffer.",500,TypeError),FST_ERR_REP_RESPONSE_BODY_CONSUMED:L("FST_ERR_REP_RESPONSE_BODY_CONSUMED","Response.body is already consumed."),FST_ERR_REP_READABLE_STREAM_LOCKED:L("FST_ERR_REP_READABLE_STREAM_LOCKED","ReadableStream was locked. You should call releaseLock() method on reader before sending."),FST_ERR_REP_ALREADY_SENT:L("FST_ERR_REP_ALREADY_SENT",'Reply was already sent, did you forget to "return reply" in "%s" (%s)?'),FST_ERR_REP_SENT_VALUE:L("FST_ERR_REP_SENT_VALUE","The only possible value for reply.sent is true.",500,TypeError),FST_ERR_SEND_INSIDE_ONERR:L("FST_ERR_SEND_INSIDE_ONERR","You cannot use `send` inside the `onError` hook"),FST_ERR_SEND_UNDEFINED_ERR:L("FST_ERR_SEND_UNDEFINED_ERR","Undefined error has occurred"),FST_ERR_BAD_STATUS_CODE:L("FST_ERR_BAD_STATUS_CODE","Called reply with an invalid status code: %s"),FST_ERR_BAD_TRAILER_NAME:L("FST_ERR_BAD_TRAILER_NAME","Called reply.trailer with an invalid header name: %s"),FST_ERR_BAD_TRAILER_VALUE:L("FST_ERR_BAD_TRAILER_VALUE","Called reply.trailer('%s', fn) with an invalid type: %s. Expected a function."),FST_ERR_FAILED_ERROR_SERIALIZATION:L("FST_ERR_FAILED_ERROR_SERIALIZATION","Failed to serialize an error. Error: %s. Original error: %s"),FST_ERR_MISSING_SERIALIZATION_FN:L("FST_ERR_MISSING_SERIALIZATION_FN",'Missing serialization function. Key "%s"'),FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN:L("FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN",'Missing serialization function. Key "%s:%s"'),FST_ERR_REQ_INVALID_VALIDATION_INVOCATION:L("FST_ERR_REQ_INVALID_VALIDATION_INVOCATION",'Invalid validation invocation. Missing validation function for HTTP part "%s" nor schema provided.'),FST_ERR_SCH_MISSING_ID:L("FST_ERR_SCH_MISSING_ID","Missing schema $id property"),FST_ERR_SCH_ALREADY_PRESENT:L("FST_ERR_SCH_ALREADY_PRESENT","Schema with id '%s' already declared!"),FST_ERR_SCH_CONTENT_MISSING_SCHEMA:L("FST_ERR_SCH_CONTENT_MISSING_SCHEMA","Schema is missing for the content type '%s'"),FST_ERR_SCH_DUPLICATE:L("FST_ERR_SCH_DUPLICATE","Schema with '%s' already present!"),FST_ERR_SCH_VALIDATION_BUILD:L("FST_ERR_SCH_VALIDATION_BUILD","Failed building the validation schema for %s: %s, due to error %s"),FST_ERR_SCH_SERIALIZATION_BUILD:L("FST_ERR_SCH_SERIALIZATION_BUILD","Failed building the serialization schema for %s: %s, due to error %s"),FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX:L("FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX",'response schemas should be nested under a valid status code, e.g { 2xx: { type: "object" } }'),FST_ERR_INIT_OPTS_INVALID:L("FST_ERR_INIT_OPTS_INVALID","Invalid initialization options: '%s'"),FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE:L("FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE","Cannot set forceCloseConnections to 'idle' as your HTTP server does not support closeIdleConnections method"),FST_ERR_DUPLICATED_ROUTE:L("FST_ERR_DUPLICATED_ROUTE","Method '%s' already declared for route '%s'"),FST_ERR_BAD_URL:L("FST_ERR_BAD_URL","'%s' is not a valid url component",400,URIError),FST_ERR_ASYNC_CONSTRAINT:L("FST_ERR_ASYNC_CONSTRAINT","Unexpected error from async constraint",500),FST_ERR_INVALID_URL:L("FST_ERR_INVALID_URL","URL must be a string. Received '%s'",400,TypeError),FST_ERR_ROUTE_OPTIONS_NOT_OBJ:L("FST_ERR_ROUTE_OPTIONS_NOT_OBJ",'Options for "%s:%s" route must be an object',500,TypeError),FST_ERR_ROUTE_DUPLICATED_HANDLER:L("FST_ERR_ROUTE_DUPLICATED_HANDLER",'Duplicate handler for "%s:%s" route is not allowed!',500),FST_ERR_ROUTE_HANDLER_NOT_FN:L("FST_ERR_ROUTE_HANDLER_NOT_FN","Error Handler for %s:%s route, if defined, must be a function",500,TypeError),FST_ERR_ROUTE_MISSING_HANDLER:L("FST_ERR_ROUTE_MISSING_HANDLER",'Missing handler function for "%s:%s" route.',500),FST_ERR_ROUTE_METHOD_INVALID:L("FST_ERR_ROUTE_METHOD_INVALID","Provided method is invalid!",500,TypeError),FST_ERR_ROUTE_METHOD_NOT_SUPPORTED:L("FST_ERR_ROUTE_METHOD_NOT_SUPPORTED","%s method is not supported.",500),FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED:L("FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED","Body validation schema for %s:%s route is not supported!",500),FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT:L("FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT","'bodyLimit' option must be an integer > 0. Got '%s'",500,TypeError),FST_ERR_ROUTE_REWRITE_NOT_STR:L("FST_ERR_ROUTE_REWRITE_NOT_STR",'Rewrite url for "%s" needs to be of type "string" but received "%s"',500,TypeError),FST_ERR_REOPENED_CLOSE_SERVER:L("FST_ERR_REOPENED_CLOSE_SERVER","Fastify has already been closed and cannot be reopened"),FST_ERR_REOPENED_SERVER:L("FST_ERR_REOPENED_SERVER","Fastify is already listening"),FST_ERR_INSTANCE_ALREADY_LISTENING:L("FST_ERR_INSTANCE_ALREADY_LISTENING","Fastify instance is already listening. %s"),FST_ERR_PLUGIN_VERSION_MISMATCH:L("FST_ERR_PLUGIN_VERSION_MISMATCH","fastify-plugin: %s - expected '%s' fastify version, '%s' is installed"),FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE:L("FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE","The decorator '%s'%s is not present in %s"),FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER:L("FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER","The %s plugin being registered mixes async and callback styles. Async plugin should not mix async and callback style.",500,TypeError),FST_ERR_PLUGIN_CALLBACK_NOT_FN:L("FST_ERR_PLUGIN_CALLBACK_NOT_FN","fastify-plugin: %s",500,TypeError),FST_ERR_PLUGIN_NOT_VALID:L("FST_ERR_PLUGIN_NOT_VALID","fastify-plugin: %s"),FST_ERR_ROOT_PLG_BOOTED:L("FST_ERR_ROOT_PLG_BOOTED","fastify-plugin: %s"),FST_ERR_PARENT_PLUGIN_BOOTED:L("FST_ERR_PARENT_PLUGIN_BOOTED","fastify-plugin: %s"),FST_ERR_PLUGIN_TIMEOUT:L("FST_ERR_PLUGIN_TIMEOUT","fastify-plugin: %s")};function yI(t,e){return e.cause=t,e}Vo.exports=fn;Vo.exports.appendStackTrace=yI;Vo.exports.AVVIO_ERRORS_MAP={AVV_ERR_CALLBACK_NOT_FN:fn.FST_ERR_PLUGIN_CALLBACK_NOT_FN,AVV_ERR_PLUGIN_NOT_VALID:fn.FST_ERR_PLUGIN_NOT_VALID,AVV_ERR_ROOT_PLG_BOOTED:fn.FST_ERR_ROOT_PLG_BOOTED,AVV_ERR_PARENT_PLG_LOADED:fn.FST_ERR_PARENT_PLUGIN_BOOTED,AVV_ERR_READY_TIMEOUT:fn.FST_ERR_PLUGIN_TIMEOUT,AVV_ERR_PLUGIN_EXEC_TIMEOUT:fn.FST_ERR_PLUGIN_TIMEOUT}});var Fr=E((J8,Sy)=>{"use strict";var _I=["onRoute","onRegister","onReady","onListen","preClose","onClose"],py=["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError","onRequestAbort"],SI=py.concat(_I),{FST_ERR_HOOK_INVALID_TYPE:EI,FST_ERR_HOOK_INVALID_HANDLER:bI,FST_ERR_SEND_UNDEFINED_ERR:zo,FST_ERR_HOOK_TIMEOUT:vI,FST_ERR_HOOK_NOT_SUPPORTED:wI,AVVIO_ERRORS_MAP:fy,appendStackTrace:dy}=He(),{kChildren:Qs,kHooks:my,kRequestPayloadStream:hy}=De();function Zs(){this.onRequest=[],this.preParsing=[],this.preValidation=[],this.preSerialization=[],this.preHandler=[],this.onResponse=[],this.onSend=[],this.onError=[],this.onRoute=[],this.onRegister=[],this.onReady=[],this.onListen=[],this.onTimeout=[],this.onRequestAbort=[],this.preClose=[]}Zs.prototype=Object.create(null);Zs.prototype.validate=function(t,e){if(typeof t!="string")throw new EI;if(Array.isArray(this[t])===!1)throw new wI(t);if(typeof e!="function")throw new bI(t,Object.prototype.toString.call(e))};Zs.prototype.add=function(t,e){this.validate(t,e),this[t].push(e)};function RI(t){let e=new Zs;return e.onRequest=t.onRequest.slice(),e.preParsing=t.preParsing.slice(),e.preValidation=t.preValidation.slice(),e.preSerialization=t.preSerialization.slice(),e.preHandler=t.preHandler.slice(),e.onSend=t.onSend.slice(),e.onResponse=t.onResponse.slice(),e.onError=t.onError.slice(),e.onRoute=t.onRoute.slice(),e.onRegister=t.onRegister.slice(),e.onTimeout=t.onTimeout.slice(),e.onRequestAbort=t.onRequestAbort.slice(),e.onReady=[],e.onListen=[],e.preClose=[],e}function gy(t,e,r,n){let s=r[my][t],i=0,o=0;l();function a(c){let f=s[i-1]?.name,p=f?` "${f}"`:"";if(c){c.code==="AVV_ERR_READY_TIMEOUT"?c=dy(c,new vI(t,p)):c=fy[c.code]!=null?dy(c,new fy[c.code](c.message)):c,n(c);return}n()}function l(c){if(c){a(c);return}if(i===s.length&&o===r[Qs].length){i===0&&o===0?a():e(function(p,h){a(p),h(p)});return}if(i===s.length&&o<r[Qs].length){let f=r[Qs][o++];gy(t,e,f,l);return}e(u(s[i++],r)),l()}function u(c,f){return function(p,h){if(p){h(p);return}if(c.length===1){try{c.call(f,h)}catch(d){h(d)}return}try{let d=c.call(f);if(d&&typeof d.then=="function"){d.then(h,h);return}}catch(d){p=d}h(p)}}}function yy(t){let e=t[my].onListen,r=e.length,n=0,s=0;i();function i(a){if(a&&t.log.error(a),n===r){for(;s<t[Qs].length;){let l=t[Qs][s++];yy(l)}return}o(e[n++],t,i)}async function o(a,l,u){if(a.length===1){try{a.call(l,u)}catch(c){u(c)}return}try{let c=a.call(l);if(c&&typeof c.then=="function"){c.then(u,u);return}u()}catch(c){u(c)}}}function Yn(t){return function(r,n,s,i){let o=0;function a(c){if(c||o===r.length){i(c,n,s);return}let f;try{f=t(r[o++],n,s,a)}catch(p){i(p,n,s);return}f&&typeof f.then=="function"&&f.then(l,u)}function l(){a()}function u(c){c||(c=new zo),i(c,n,s)}a()}}function OI(t,e,r,n){return t(e,r,n)}var TI=Yn(OI),$I=Yn(ei),PI=Yn(ei),AI=Yn(ei),CI=Yn(ei);function _y(t,e,r,n,s){let i=0;function o(u,c){if(u){s(u,e,r,n);return}if(c!==void 0&&(n=c),i===t.length){s(null,e,r,n);return}let f;try{f=t[i++](e,r,n,o)}catch(p){s(p,e,r);return}f&&typeof f.then=="function"&&f.then(a,l)}function a(u){o(null,u)}function l(u){u||(u=new zo),s(u,e,r,n)}o()}var II=_y;function NI(t,e,r,n){let s=0;function i(l,u){if(r.sent)return;if(u!==void 0&&(e[hy]=u),l||s===t.length){n(l,e,r);return}let c;try{c=t[s++](e,r,e[hy],i)}catch(f){n(f,e,r);return}c&&typeof c.then=="function"&&c.then(o,a)}function o(l){i(null,l)}function a(l){l||(l=new zo),n(l,e,r)}i()}function kI(t,e,r){let n=0;function s(a){if(a||n===t.length){r(a,e);return}let l;try{l=t[n++](e,s)}catch(u){r(u,e);return}l&&typeof l.then=="function"&&l.then(i,o)}function i(){s()}function o(a){a||(a=new zo),r(a,e)}s()}function ei(t,e,r,n){if(r.sent!==!0)return t(e,r,n)}Sy.exports={Hooks:Zs,buildHooks:RI,hookRunnerGenerator:Yn,preParsingHookRunner:NI,onResponseHookRunner:TI,onSendHookRunner:_y,preSerializationHookRunner:II,onRequestAbortHookRunner:kI,hookIterator:ei,hookRunnerApplication:gy,onListenHookRunner:yy,preHandlerHookRunner:PI,preValidationHookRunner:$I,onRequestHookRunner:CI,onTimeoutHookRunner:AI,lifecycleHooks:py,supportedHooks:SI}});var by=E((K8,Ey)=>{"use strict";Ey.exports=function(){return{[Symbol.iterator]:function*(){},add(){},delete(){},has(){return!0}}}});var uc=E((Y8,wy)=>{"use strict";var{kTestInternals:xI}=De();function vy(){let t,e;return{promise:new Promise((n,s)=>{t=n,e=s}),resolve:t,reject:e}}wy.exports={withResolvers:typeof Promise.withResolvers=="function"?Promise.withResolvers.bind(Promise):vy,[xI]:{withResolvers:vy}}});var xy=E((X8,ky)=>{"use strict";var LI=V("node:http"),qI=V("node:https"),Ry=V("node:http2"),jI=V("node:dns"),DI=V("node:os"),{kState:ke,kOptions:FI,kServerBindings:MI,kHttp2ServerSessions:dn}=De(),{FSTWRN003:HI}=Kn(),{onListenHookRunner:Uo}=Fr(),{FST_ERR_REOPENED_CLOSE_SERVER:Ty,FST_ERR_REOPENED_SERVER:$y,FST_ERR_LISTEN_OPTIONS_INVALID:VI,FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE:zI}=He(),UI=by(),Py=uc();ky.exports.createServer=BI;function Ay(t){return`Server listening at ${t}`}function BI(t,e){let r=Iy(t,e);function n(u={port:0,host:"localhost"},c=void 0){if(typeof c=="function"&&(c.constructor.name==="AsyncFunction"&&HI("listen method"),u.cb=c),u.signal){if(typeof u.signal.on!="function"&&typeof u.signal.addEventListener!="function")throw new VI("Invalid options.signal");if(this[ke].aborted=u.signal.aborted,this[ke].aborted)return this.close();{let p=()=>{this[ke].aborted=!0,this.close()};u.signal.addEventListener("abort",p,{once:!0})}}let f;if(u.path==null?f=u.host??"localhost":f=u.host,(!Object.hasOwn(u,"host")||u.host==null)&&(u.host=f),f==="localhost"?u.cb=(p,h)=>{if(p){c(p,h);return}Oy.call(this,r,e,t,u,()=>{this[ke].listening=!0,c(null,h),Uo(this)})}:u.cb=(p,h)=>{if(p){c(p,h);return}this[ke].listening=!0,c(null,h),Uo(this)},c===void 0)return GI.call(this,r,u).then(h=>{let{promise:d,resolve:m}=Py.withResolvers();return f==="localhost"?Oy.call(this,r,e,t,u,()=>{this[ke].listening=!0,m(h),Uo(this)}):(m(h),Uo(this)),d});this.ready(Cy.call(this,r,u))}let s=typeof r.closeAllConnections=="function",i=typeof r.closeIdleConnections=="function",o=typeof r.closeHttp2Sessions=="function",a=t.forceCloseConnections;if(a==="idle"&&!i)throw new zI;typeof a!="boolean"&&(a=i?"idle":!1);let l=!s&&a===!0?new Set:UI();return{server:r,listen:n,forceCloseConnections:a,serverHasCloseAllConnections:s,serverHasCloseHttp2Sessions:o,keepAliveConnections:l}}function Oy(t,e,r,n,s){this[ke].listening=!1,jI.lookup(n.host,{all:!0},(i,o)=>{if(i||this[ke].aborted){s();return}let a=t.listening&&r.serverFactory,l=0,u=0;if(!a){let f=t.address();for(let p of o)if(p.address!==f.address){l++;let h=Object.assign({},n,{host:p.address,port:f.port,cb:g=>{u++,g||this[MI].push(d),u===l&&s()}}),d=Iy(r,e),m=()=>{d.close(()=>{}),typeof d.closeAllConnections=="function"&&r.forceCloseConnections===!0&&d.closeAllConnections(),typeof d.closeHttp2Sessions=="function"&&d.closeHttp2Sessions()};d.on("upgrade",t.emit.bind(t,"upgrade")),t.on("unref",m),t.on("close",m),t.on("error",m),this[ke].listening=!1,Cy.call(this,d,h)()}}if(l===0){s();return}let c=t.unref;t.unref=function(){c.call(t),t.emit("unref")}})}function Cy(t,e){let r=n=>{if(t.removeListener("error",r),t.removeListener("listening",r),n)this[ke].listening=!1,e.cb(n,null);else{let s=Ny.call(this,t,e.listenTextResolver||Ay);e.cb(null,s)}};return n=>{if(n!=null)return e.cb(n);if(this[ke].listening&&this[ke].closing)return e.cb(new Ty,null);if(this[ke].listening)return e.cb(new $y,null);t.once("error",r),this[ke].closing||(t.once("listening",r),t.listen(e),this[ke].listening=!0)}}function GI(t,e){return this[ke].listening&&this[ke].closing?Promise.reject(new Ty):this[ke].listening?Promise.reject(new $y):this.ready().then(()=>{if(this[ke].aborted)return;let{promise:r,resolve:n,reject:s}=Py.withResolvers(),i=l=>{a(),this[ke].listening=!1,s(l)},o=()=>{a(),this[ke].listening=!0,n(Ny.call(this,t,e.listenTextResolver||Ay))};function a(){t.removeListener("error",i),t.removeListener("listening",o)}return t.once("error",i),t.once("listening",o),t.listen(e),r})}function Iy(t,e){if(t.serverFactory)return t.serverFactory(e,t);let r=t.https===!0?{}:t.https;if(t.http2){let s=typeof r=="object"?Ry.createSecureServer(r,e):Ry.createServer(t.http,e);return s.on("session",i=>i.setTimeout(t.http2SessionTimeout,()=>{i.close()})),t.forceCloseConnections===!0&&(s.closeHttp2Sessions=JI(s)),s.setTimeout(t.connectionTimeout),s}let n=r?qI.createServer(r,e):LI.createServer(t.http,e);return n.keepAliveTimeout=t.keepAliveTimeout,n.requestTimeout=t.requestTimeout,n.setTimeout(t.connectionTimeout),t.maxRequestsPerSocket>0&&(n.maxRequestsPerSocket=t.maxRequestsPerSocket),n}function WI(t){return t.address==="0.0.0.0"?Object.values(DI.networkInterfaces()).flatMap(e=>e.filter(r=>r.family==="IPv4")).sort(e=>e.internal?-1:1).map(e=>e.address):[t.address]}function Ny(t,e){let r;typeof t.address()=="string"?r=[t.address()]:(t.address().address.indexOf(":")===-1?r=WI(t.address()).map(s=>s+":"+t.address().port):r=["["+t.address().address+"]:"+t.address().port],r=r.map(s=>"http"+(this[FI].https?"s":"")+"://"+s));for(let s of r)this.log.info(e(s));return r[0]}function JI(t){return t[dn]=new Set,t.on("session",function(e){e.once("connect",function(){t[dn].add(e)}),e.once("close",function(){t[dn].delete(e)}),e.once("frameError",function(r,n,s){s===0&&t[dn].delete(e)}),e.once("goaway",function(){t[dn].delete(e)})}),function(){if(t[dn].size!==0)for(let r of t[dn])r.close()}}});var dc=E((Q8,jy)=>{"use strict";var cc=/([\w!#$%&'*+.^`|~-]+)=([^;]*)/gm,Ly=/^[\w!#$%&'*+.^`|~-]+$/,qy=/^[\w!#$%&'*+.^`|~-]+\s*/,fc=class{#e=!1;#t=!0;#r="";#n="";#s=new Map;#i;constructor(e){if(e==null||e===""||e==="undefined")return;let r=e.indexOf(";");if(r===-1){if(r=e.indexOf("/"),r===-1)return;let l=e.slice(0,r).trimStart().toLowerCase(),u=e.slice(r+1).trimEnd().toLowerCase();Ly.test(l)===!0&&qy.test(u)===!0&&(this.#e=!0,this.#t=!1,this.#r=l,this.#n=u);return}let n=e.slice(0,r).toLowerCase(),s=e.slice(r+1).trim();if(r=n.indexOf("/"),r===-1)return;let i=n.slice(0,r).trimStart(),o=n.slice(r+1).trimEnd();if(Ly.test(i)===!1||qy.test(o)===!1)return;this.#r=i,this.#n=o,this.#e=!0,this.#t=!1;let a=cc.exec(s);for(;a;){let l=a[1],u=a[2];if(u[0]==='"'){if(u.at(-1)!=='"'){this.#s.set(l,"invalid quoted string"),a=cc.exec(s);continue}this.#s.set(l,u.slice(1,u.length-1))}else this.#s.set(l,u);a=cc.exec(s)}}get[Symbol.toStringTag](){return"ContentType"}get isEmpty(){return this.#t}get isValid(){return this.#e}get mediaType(){return`${this.#r}/${this.#n}`}get type(){return this.#r}get subtype(){return this.#n}get parameters(){return this.#s}toString(){if(this.#i)return this.#i;let e=[];for(let[n,s]of this.#s.entries())e.push(`${n}="${s}"`);let r=[this.#r,"/",this.#n];return e.length>0&&(r.push("; "),r.push(e.join("; "))),this.#i=r.join(""),this.#i}};jy.exports=fc});var Bo=E((Z8,Dy)=>{"use strict";var{kReplyHasStatusCode:KI}=De();function YI(t,e){if(!t[KI]||t.statusCode===200){let r=e&&(e.statusCode||e.status);t.code(r>=400?r:500)}}Dy.exports={setErrorStatusCode:YI}});var hc=E((eK,My)=>{"use strict";var{kReplyIsError:Fy,kReplyHijacked:XI}=De(),{setErrorStatusCode:QI}=Bo(),ZI=V("node:diagnostics_channel"),ti=ZI.tracingChannel("fastify.request.handler");function eN(t,e,r){r&&(r.async=!0),t.then(function(n){if(e[XI]!==!0){r&&ti.asyncStart.publish(r);try{if(n!==void 0||e.sent===!1&&e.raw.headersSent===!1&&e.request.raw.aborted===!1&&e.request.socket&&!e.request.socket.destroyed)try{e.send(n)}catch(s){e[Fy]=!0,e.send(s)}}finally{r&&ti.asyncEnd.publish(r)}}},function(n){r&&(r.error=n,QI(e,n),ti.error.publish(r),ti.asyncStart.publish(r));try{if(e.sent===!0){e.log.error({err:n},"Promise errored, but reply.sent = true was set");return}e[Fy]=!0,e.send(n)}catch(s){e.send(s)}finally{r&&ti.asyncEnd.publish(r)}})}My.exports=eN});var gc=E((tK,Vy)=>{"use strict";var{kSchemaHeaders:Jo,kSchemaParams:pc,kSchemaQuerystring:mc,kSchemaBody:hn,kSchemaResponse:Hy}=De(),tN=/^[1-5](?:\d{2}|xx)$|^default$/,{FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX:rN}=He(),{FSTWRN001:Go}=Kn();function nN(t,e){if(!t.schema||!t.schema.response)return;let{method:r,url:n}=t.config||{};t[Hy]=Object.keys(t.schema.response).reduce(function(s,i){let o=t.schema.response[i];if(i=i.toLowerCase(),!tN.test(i))throw new rN;if(o.content){let a={};for(let l of Object.keys(o.content)){let u=o.content[l].schema;a[l]=e({schema:u,url:n,method:r,httpStatus:i,contentType:l})}s[i]=a}else s[i]=e({schema:o,url:n,method:r,httpStatus:i});return s},{})}function sN(t,e,r){let{schema:n}=t;if(!n)return;let{method:s,url:i}=t.config||{},o=n.headers;if(o&&(r||Object.getPrototypeOf(o)!==Object.prototype))t[Jo]=e({schema:o,method:s,url:i,httpPart:"headers"});else if(o){let a={};Object.keys(o).forEach(l=>{a[l]=o[l]}),a.required instanceof Array&&(a.required=a.required.map(l=>l.toLowerCase())),o.properties&&(a.properties={},Object.keys(o.properties).forEach(l=>{a.properties[l.toLowerCase()]=o.properties[l]})),t[Jo]=e({schema:a,method:s,url:i,httpPart:"headers"})}else Object.hasOwn(n,"headers")&&Go("headers",s,i);if(n.body){let a=n.body.content;if(a){let l={};for(let u of Object.keys(a)){let c=a[u].schema;l[u]=e({schema:c,method:s,url:i,httpPart:"body",contentType:u})}t[hn]=l}else t[hn]=e({schema:n.body,method:s,url:i,httpPart:"body"})}else Object.hasOwn(n,"body")&&Go("body",s,i);n.querystring?t[mc]=e({schema:n.querystring,method:s,url:i,httpPart:"querystring"}):Object.hasOwn(n,"querystring")&&Go("querystring",s,i),n.params?t[pc]=e({schema:n.params,method:s,url:i,httpPart:"params"}):Object.hasOwn(n,"params")&&Go("params",s,i)}function Wo(t,e,r){let n=e[r]===void 0,s;try{s=t?.(n?null:e[r])}catch(o){return o.statusCode=500,o}if(s&&typeof s.then=="function")return s.then(o=>i(o)).catch(o=>o);return i(s);function i(o){return o===!1?t.errors:o&&o.error?o.error:(o&&o.value&&(e[r]=o.value),!1)}}function Ko(t,e,r){let n=r===void 0;if(n||!r.skipParams){let i=Wo(t[pc],e,"params");if(i)return typeof i.then!="function"?Mr(i,"params",t.schemaErrorFormatter):iN(i,t,e)}if(n||!r.skipBody){let i=null;if(typeof t[hn]=="function")i=t[hn];else if(t[hn]){let a=uN(e.headers["content-type"]),l=t[hn][a];l&&(i=l)}let o=Wo(i,e,"body");if(o)return typeof o.then!="function"?Mr(o,"body",t.schemaErrorFormatter):oN(o,t,e)}if(n||!r.skipQuery){let i=Wo(t[mc],e,"query");if(i)return typeof i.then!="function"?Mr(i,"querystring",t.schemaErrorFormatter):aN(i,t,e)}let s=Wo(t[Jo],e,"headers");return s?typeof s.then!="function"?Mr(s,"headers",t.schemaErrorFormatter):lN(s,t,e):!1}function iN(t,e,r){return t.then(n=>n?Mr(n,"params",e.schemaErrorFormatter):Ko(e,r,{skipParams:!0}))}function oN(t,e,r){return t.then(n=>n?Mr(n,"body",e.schemaErrorFormatter):Ko(e,r,{skipParams:!0,skipBody:!0}))}function aN(t,e,r){return t.then(n=>n?Mr(n,"querystring",e.schemaErrorFormatter):Ko(e,r,{skipParams:!0,skipBody:!0,skipQuery:!0}))}function lN(t,e,r){return t.then(n=>n?Mr(n,"headers",e.schemaErrorFormatter):!1)}function Mr(t,e,r){if(t instanceof Error)return t.statusCode=t.statusCode||400,t.code=t.code||"FST_ERR_VALIDATION",t.validationContext=t.validationContext||e,t;let n=r(t,e);return n.statusCode=n.statusCode||400,n.code=n.code||"FST_ERR_VALIDATION",n.validation=t,n.validationContext=e,n}function uN(t){return t?t.split(/[ ;]/,1)[0].trim().toLowerCase():""}Vy.exports={symbols:{bodySchema:hn,querystringSchema:mc,responseSchema:Hy,paramsSchema:pc,headersSchema:Jo},compileSchemasForValidation:sN,compileSchemasForSerialization:nN,validate:Ko}});var Ec=E((rK,Sc)=>{"use strict";var cN=V("node:diagnostics_channel"),fN=dc(),dN=hc(),{validate:hN}=gc(),{preValidationHookRunner:pN,preHandlerHookRunner:mN}=Fr(),{FST_ERR_CTP_INVALID_MEDIA_TYPE:gN}=He(),{setErrorStatusCode:zy}=Bo(),{kReplyIsError:ni,kRouteContext:rr,kFourOhFourContext:yN,kSupportedHTTPMethods:Uy}=De(),ri=cN.tracingChannel("fastify.request.handler");function _N(t,e,r){if(r.sent===!0)return;if(t!=null){r[ni]=!0,r.send(t);return}let n=e.method;if(this[Uy].bodyless.has(n)){Xn(e,r);return}if(this[Uy].bodywith.has(n)){let s=e.headers,i=s["content-type"];if(i===void 0){let a=s["content-length"];if(s["transfer-encoding"]===void 0&&(a===void 0||a==="0")){Xn(e,r);return}e[rr].contentTypeParser.run("",Xn,e,r);return}let o=new fN(i);if(o.isValid===!1){r[ni]=!0,r.status(415).send(new gN);return}e[rr].contentTypeParser.run(o.toString(),Xn,e,r);return}Xn(e,r)}function Xn(t,e){try{t[rr].preValidation!==null?pN(t[rr].preValidation,t,e,yc):yc(null,t,e)}catch(r){yc(r,t,e)}}function yc(t,e,r){if(r.sent===!0)return;if(t!=null){r[ni]=!0,r.send(t);return}let n=hN(r[rr],e);if(n&&typeof n.then=="function"||!1){let i=By.bind(null,e,r);n.then(i,i)}else By(e,r,n)}function By(t,e,r){if(r){if(e[rr].attachValidation===!1){e.send(r);return}e.request.validationError=r}t[rr].preHandler!==null?mN(t[rr].preHandler,t,e,_c):_c(null,t,e)}function _c(t,e,r){if(r.sent)return;let n=e[rr];if(!ri.hasSubscribers||n[yN]===null)Gy(t,e,r);else{let s={request:e,reply:r,async:!1,route:{url:n.config.url,method:n.config.method}};ri.start.runStores(s,Gy,void 0,t,e,r,s)}}function Gy(t,e,r,n){let s=e[rr];try{if(t!=null){r[ni]=!0,n&&(n.error=t,zy(r,t),ri.error.publish(n)),r.send(t);return}let i;try{i=s.handler(e,r)}catch(o){n&&(n.error=o,zy(r,o),ri.error.publish(n)),r[ni]=!0,r.send(o);return}i!==void 0&&(i!==null&&typeof i.then=="function"?dN(i,r,n):r.send(i))}finally{n&&ri.end.publish(n)}}Sc.exports=_N;Sc.exports[Symbol.for("internals")]={handler:Xn,preHandlerCallback:_c}});var Jy=E((nK,Wy)=>{"use strict";function Qn(){}var SN={fatal:Qn,error:Qn,warn:Qn,info:Qn,debug:Qn,trace:Qn};Object.defineProperty(Wy,"exports",{get(){return Object.create(SN)}})});var vc=E((sK,Xy)=>{"use strict";var si=t=>t&&typeof t.message=="string",bc=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return si(r)?r:void 0}else return si(e)?e:void 0},Ky=(t,e)=>{if(!si(t))return"";let r=t.stack||"";if(e.has(t))return r+`
30
+ causes have become circular...`;let n=bc(t);return n?(e.add(t),r+`
31
+ caused by: `+Ky(n,e)):r},EN=t=>Ky(t,new Set),Yy=(t,e,r)=>{if(!si(t))return"";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let s=bc(t);if(s){e.add(t);let i=typeof t.cause=="function";return n+(i?"":": ")+Yy(s,e,i)}else return n},bN=t=>Yy(t,new Set);Xy.exports={isErrorLike:si,getErrorCause:bc,stackWithCauses:EN,messageWithCauses:bN}});var wc=E((iK,Zy)=>{"use strict";var vN=Symbol("circular-ref-tag"),Yo=Symbol("pino-raw-err-ref"),Qy=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Yo]},set:function(t){this[Yo]=t}}});Object.defineProperty(Qy,Yo,{writable:!0,value:{}});Zy.exports={pinoErrProto:Qy,pinoErrorSymbols:{seen:vN,rawSymbol:Yo}}});var r_=E((oK,t_)=>{"use strict";t_.exports=Oc;var{messageWithCauses:wN,stackWithCauses:RN,isErrorLike:e_}=vc(),{pinoErrProto:ON,pinoErrorSymbols:TN}=wc(),{seen:Rc}=TN,{toString:$N}=Object.prototype;function Oc(t){if(!e_(t))return t;t[Rc]=void 0;let e=Object.create(ON);e.type=$N.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=wN(t),e.stack=RN(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Oc(r)));for(let r in t)if(e[r]===void 0){let n=t[r];e_(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Rc)&&(e[r]=Oc(n)):e[r]=n}return delete t[Rc],e.raw=t,e}});var s_=E((aK,n_)=>{"use strict";n_.exports=Qo;var{isErrorLike:Tc}=vc(),{pinoErrProto:PN,pinoErrorSymbols:AN}=wc(),{seen:Xo}=AN,{toString:CN}=Object.prototype;function Qo(t){if(!Tc(t))return t;t[Xo]=void 0;let e=Object.create(PN);e.type=CN.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Qo(r))),Tc(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Xo)&&(e.cause=Qo(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];Tc(n)?Object.prototype.hasOwnProperty.call(n,Xo)||(e[r]=Qo(n)):e[r]=n}return delete t[Xo],e.raw=t,e}});var l_=E((lK,a_)=>{"use strict";a_.exports={mapHttpRequest:IN,reqSerializer:o_};var $c=Symbol("pino-raw-req-ref"),i_=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[$c]},set:function(t){this[$c]=t}}});Object.defineProperty(i_,$c,{writable:!0,value:{}});function o_(t){let e=t.info||t.socket,r=Object.create(i_);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else{let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function IN(t){return{req:o_(t)}}});var d_=E((uK,f_)=>{"use strict";f_.exports={mapHttpResponse:NN,resSerializer:c_};var Pc=Symbol("pino-raw-res-ref"),u_=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Pc]},set:function(t){this[Pc]=t}}});Object.defineProperty(u_,Pc,{writable:!0,value:{}});function c_(t){let e=Object.create(u_);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function NN(t){return{res:c_(t)}}});var Cc=E((cK,h_)=>{"use strict";var Ac=r_(),kN=s_(),Zo=l_(),ea=d_();h_.exports={err:Ac,errWithCause:kN,mapHttpRequest:Zo.mapHttpRequest,mapHttpResponse:ea.mapHttpResponse,req:Zo.reqSerializer,res:ea.resSerializer,wrapErrorSerializer:function(e){return e===Ac?e:function(n){return e(Ac(n))}},wrapRequestSerializer:function(e){return e===Zo.reqSerializer?e:function(n){return e(Zo.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===ea.resSerializer?e:function(n){return e(ea.resSerializer(n))}}}});var Ic=E((fK,p_)=>{"use strict";function xN(t,e){return e}p_.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=xN;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),s=[];for(let i of n)i&&s.push(i.getFileName());return s}});var E_=E((dK,S_)=>{"use strict";function Nc(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){let e=[];for(let r=0;r<t.length;r++)e[r]=Nc(t[r]);return e}if(typeof t=="object"){let e=Object.create(Object.getPrototypeOf(t));for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=Nc(t[r]));return e}return t}function m_(t){let e=[],r="",n=!1,s=!1,i="";for(let o=0;o<t.length;o++){let a=t[o];!n&&a==="."?r&&(e.push(r),r=""):a==="["?(r&&(e.push(r),r=""),n=!0):a==="]"&&n?(e.push(r),r="",n=!1,s=!1):(a==='"'||a==="'")&&n?s?a===i?(s=!1,i=""):r+=a:(s=!0,i=a):r+=a}return r&&e.push(r),e}function g_(t,e,r){let n=t;for(let i=0;i<e.length-1;i++){let o=e[i];if(typeof n!="object"||n===null||!(o in n)||typeof n[o]!="object"||n[o]===null)return!1;n=n[o]}let s=e[e.length-1];if(s==="*"){if(Array.isArray(n))for(let i=0;i<n.length;i++)n[i]=r;else if(typeof n=="object"&&n!==null)for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=r)}else typeof n=="object"&&n!==null&&s in n&&Object.prototype.hasOwnProperty.call(n,s)&&(n[s]=r);return!0}function y_(t,e){let r=t;for(let s=0;s<e.length-1;s++){let i=e[s];if(typeof r!="object"||r===null||!(i in r)||typeof r[i]!="object"||r[i]===null)return!1;r=r[i]}let n=e[e.length-1];if(n==="*"){if(Array.isArray(r))for(let s=0;s<r.length;s++)r[s]=void 0;else if(typeof r=="object"&&r!==null)for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&delete r[s]}else typeof r=="object"&&r!==null&&n in r&&Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];return!0}var ta=Symbol("PATH_NOT_FOUND");function LN(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null||!(n in r))return ta;r=r[n]}return r}function qN(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null)return;r=r[n]}return r}function jN(t,e,r,n=!1){for(let s of e){let i=m_(s);if(i.includes("*"))__(t,i,r,s,n);else if(n)y_(t,i);else{let o=LN(t,i);if(o===ta)continue;let a=typeof r=="function"?r(o,i):r;g_(t,i,a)}}}function __(t,e,r,n,s=!1){let i=e.indexOf("*");if(i===e.length-1){let o=e.slice(0,-1),a=t;for(let l of o){if(a==null||typeof a!="object"||a===null)return;a=a[l]}if(Array.isArray(a))if(s)for(let l=0;l<a.length;l++)a[l]=void 0;else for(let l=0;l<a.length;l++){let u=[...o,l.toString()],c=typeof r=="function"?r(a[l],u):r;a[l]=c}else if(typeof a=="object"&&a!==null)if(s){let l=[];for(let u in a)Object.prototype.hasOwnProperty.call(a,u)&&l.push(u);for(let u of l)delete a[u]}else for(let l in a){let u=[...o,l],c=typeof r=="function"?r(a[l],u):r;a[l]=c}}else DN(t,e,r,i,n,s)}function DN(t,e,r,n,s,i=!1){let o=e.slice(0,n),a=e.slice(n+1),l=[];function u(c,f){if(f===o.length){if(Array.isArray(c))for(let p=0;p<c.length;p++)l[f]=p.toString(),u(c[p],f+1);else if(typeof c=="object"&&c!==null)for(let p in c)l[f]=p,u(c[p],f+1)}else if(f<o.length){let p=o[f];c&&typeof c=="object"&&c!==null&&p in c&&(l[f]=p,u(c[p],f+1))}else if(a.includes("*"))__(c,a,typeof r=="function"?(h,d)=>{let m=[...l.slice(0,f),...d];return r(h,m)}:r,s,i);else if(i)y_(c,a);else{let p=typeof r=="function"?r(qN(c,a),[...l.slice(0,f),...a]):r;g_(c,a,p)}}if(o.length===0)u(t,0);else{let c=t;for(let f=0;f<o.length;f++){let p=o[f];if(c==null||typeof c!="object"||c===null)return;c=c[p],l[f]=p}c!=null&&u(c,o.length)}}function FN(t){if(t.length===0)return null;let e=new Map;for(let r of t){let n=m_(r),s=e;for(let i=0;i<n.length;i++){let o=n[i];s.has(o)||s.set(o,new Map),s=s.get(o)}}return e}function MN(t,e){if(!e)return t;function r(n,s,i=0){if(!s||s.size===0||n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(Array.isArray(n)){let a=[];for(let l=0;l<n.length;l++){let u=l.toString();s.has(u)||s.has("*")?a[l]=r(n[l],s.get(u)||s.get("*")):a[l]=n[l]}return a}let o=Object.create(Object.getPrototypeOf(n));for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(s.has(a)||s.has("*")?o[a]=r(n[a],s.get(a)||s.get("*")):o[a]=n[a]);return o}return r(t,e)}function HN(t){if(typeof t!="string")throw new Error("Paths must be (non-empty) strings");if(t==="")throw new Error("Invalid redaction path ()");if(t.includes(".."))throw new Error(`Invalid redaction path (${t})`);if(t.includes(","))throw new Error(`Invalid redaction path (${t})`);let e=0,r=!1,n="";for(let s=0;s<t.length;s++){let i=t[s];if((i==='"'||i==="'")&&e>0)r?i===n&&(r=!1,n=""):(r=!0,n=i);else if(i==="["&&!r)e++;else if(i==="]"&&!r&&(e--,e<0))throw new Error(`Invalid redaction path (${t})`)}if(e!==0)throw new Error(`Invalid redaction path (${t})`)}function VN(t){if(!Array.isArray(t))throw new TypeError("paths must be an array");for(let e of t)HN(e)}function zN(t={}){let{paths:e=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:s=!0,remove:i=!1}=t;VN(e);let o=FN(e);return function(l){if(s&&(l===null||typeof l!="object")&&(l==null||typeof l!="object"))return n?n(l):l;let u=MN(l,o),c=l,f=r;return typeof r=="function"&&(f=r),jN(u,e,f,i),n===!1?(u.restore=function(){return Nc(c)},u):typeof n=="function"?n(u):JSON.stringify(u)}}S_.exports=zN});var Zn=E((hK,b_)=>{"use strict";var UN=Symbol("pino.setLevel"),BN=Symbol("pino.getLevel"),GN=Symbol("pino.levelVal"),WN=Symbol("pino.levelComp"),JN=Symbol("pino.useLevelLabels"),KN=Symbol("pino.useOnlyCustomLevels"),YN=Symbol("pino.mixin"),XN=Symbol("pino.lsCache"),QN=Symbol("pino.chindings"),ZN=Symbol("pino.asJson"),e1=Symbol("pino.write"),t1=Symbol("pino.redactFmt"),r1=Symbol("pino.time"),n1=Symbol("pino.timeSliceIndex"),s1=Symbol("pino.stream"),i1=Symbol("pino.stringify"),o1=Symbol("pino.stringifySafe"),a1=Symbol("pino.stringifiers"),l1=Symbol("pino.end"),u1=Symbol("pino.formatOpts"),c1=Symbol("pino.messageKey"),f1=Symbol("pino.errorKey"),d1=Symbol("pino.nestedKey"),h1=Symbol("pino.nestedKeyStr"),p1=Symbol("pino.mixinMergeStrategy"),m1=Symbol("pino.msgPrefix"),g1=Symbol("pino.wildcardFirst"),y1=Symbol.for("pino.serializers"),_1=Symbol.for("pino.formatters"),S1=Symbol.for("pino.hooks"),E1=Symbol.for("pino.metadata");b_.exports={setLevelSym:UN,getLevelSym:BN,levelValSym:GN,levelCompSym:WN,useLevelLabelsSym:JN,mixinSym:YN,lsCacheSym:XN,chindingsSym:QN,asJsonSym:ZN,writeSym:e1,serializersSym:y1,redactFmtSym:t1,timeSym:r1,timeSliceIndexSym:n1,streamSym:s1,stringifySym:i1,stringifySafeSym:o1,stringifiersSym:a1,endSym:l1,formatOptsSym:u1,messageKeySym:c1,errorKeySym:f1,nestedKeySym:d1,wildcardFirstSym:g1,needsMetadataGsym:E1,useOnlyCustomLevelsSym:KN,formattersSym:_1,hooksSym:S1,nestedKeyStrSym:h1,mixinMergeStrategySym:p1,msgPrefixSym:m1}});var xc=E((pK,O_)=>{"use strict";var v_=E_(),{redactFmtSym:b1,wildcardFirstSym:ra}=Zn(),kc=/[^.[\]]+|\[([^[\]]*?)\]/g,w_="[Redacted]",R_=!1;function v1(t,e){let{paths:r,censor:n,remove:s}=w1(t),i=r.reduce((l,u)=>{kc.lastIndex=0;let c=kc.exec(u),f=kc.exec(u),p=c[1]!==void 0?c[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):c[0];if(p==="*"&&(p=ra),f===null)return l[p]=null,l;if(l[p]===null)return l;let{index:h}=f,d=`${u.substr(h,u.length-1)}`;return l[p]=l[p]||[],p!==ra&&l[p].length===0&&l[p].push(...l[ra]||[]),p===ra&&Object.keys(l).forEach(function(m){l[m]&&l[m].push(d)}),l[p].push(d),l},{}),o={[b1]:v_({paths:r,censor:n,serialize:e,strict:R_,remove:s})},a=(...l)=>e(typeof n=="function"?n(...l):n);return[...Object.keys(i),...Object.getOwnPropertySymbols(i)].reduce((l,u)=>{if(i[u]===null)l[u]=c=>a(c,[u]);else{let c=typeof n=="function"?(f,p)=>n(f,[u,...p]):n;l[u]=v_({paths:i[u],censor:c,serialize:e,strict:R_,remove:s})}return l},o)}function w1(t){if(Array.isArray(t))return t={paths:t,censor:w_},t;let{paths:e,censor:r=w_,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),{paths:e,censor:r,remove:n}}O_.exports=v1});var P_=E((mK,$_)=>{"use strict";var R1=()=>"",O1=()=>`,"time":${Date.now()}`,T1=()=>`,"time":${Math.round(Date.now()/1e3)}`,$1=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,P1=1000000n,T_=1000000000n,A1=BigInt(Date.now())*P1,C1=process.hrtime.bigint(),I1=()=>{let t=process.hrtime.bigint()-C1,e=A1+t,r=e/T_,n=e%T_,s=Number(r*1000n+n/1000000n),i=new Date(s),o=i.getUTCFullYear(),a=(i.getUTCMonth()+1).toString().padStart(2,"0"),l=i.getUTCDate().toString().padStart(2,"0"),u=i.getUTCHours().toString().padStart(2,"0"),c=i.getUTCMinutes().toString().padStart(2,"0"),f=i.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${o}-${a}-${l}T${u}:${c}:${f}.${n.toString().padStart(9,"0")}Z"`};$_.exports={nullTime:R1,epochTime:O1,unixTime:T1,isoTime:$1,isoTimeNano:I1}});var C_=E((gK,A_)=>{"use strict";function N1(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}A_.exports=k1;function k1(t,e,r){var n=r&&r.stringify||N1,s=1;if(typeof t=="object"&&t!==null){var i=e.length+s;if(i===1)return t;var o=new Array(i);o[0]=n(t);for(var a=1;a<i;a++)o[a]=n(e[a]);return o.join(" ")}if(typeof t!="string")return t;var l=e.length;if(l===0)return t;for(var u="",c=1-s,f=-1,p=t&&t.length||0,h=0;h<p;){if(t.charCodeAt(h)===37&&h+1<p){switch(f=f>-1?f:0,t.charCodeAt(h+1)){case 100:case 102:if(c>=l||e[c]==null)break;f<h&&(u+=t.slice(f,h)),u+=Number(e[c]),f=h+2,h++;break;case 105:if(c>=l||e[c]==null)break;f<h&&(u+=t.slice(f,h)),u+=Math.floor(Number(e[c])),f=h+2,h++;break;case 79:case 111:case 106:if(c>=l||e[c]===void 0)break;f<h&&(u+=t.slice(f,h));var d=typeof e[c];if(d==="string"){u+="'"+e[c]+"'",f=h+2,h++;break}if(d==="function"){u+=e[c].name||"<anonymous>",f=h+2,h++;break}u+=n(e[c]),f=h+2,h++;break;case 115:if(c>=l)break;f<h&&(u+=t.slice(f,h)),u+=String(e[c]),f=h+2,h++;break;case 37:f<h&&(u+=t.slice(f,h)),u+="%",f=h+2,h++,c--;break}++c}++h}return f===-1?t:(f<p&&(u+=t.slice(f)),u)}});var qc=E((yK,Lc)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r))},t=new Int32Array(new SharedArrayBuffer(4));Lc.exports=e}else{let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(e);for(;n>Date.now(););};Lc.exports=t}});var D_=E((_K,j_)=>{"use strict";var xe=V("fs"),x1=V("events"),L1=V("util").inherits,I_=V("path"),Dc=qc(),q1=V("assert"),na=100,sa=Buffer.allocUnsafe(0),j1=16*1024,N_="buffer",k_="utf8",[D1,F1]=(process.versions.node||"0.0").split(".").map(Number),M1=D1>=22&&F1>=7;function x_(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(i,o){if(i){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",i)}):e.emit("error",i);return}let a=e._reopening;e.fd=o,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e.destroyed&&(!e._writing&&e._len>e.minLength||e._flushPending?e._actualWrite():a&&process.nextTick(()=>e.emit("drain")))}let n=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&xe.mkdirSync(I_.dirname(t),{recursive:!0});let i=xe.openSync(t,n,s);r(null,i)}catch(i){throw r(i),i}else e.mkdir?xe.mkdir(I_.dirname(t),{recursive:!0},i=>{if(i)return r(i);xe.open(t,n,s,r)}):xe.open(t,n,s,r)}function zt(t){if(!(this instanceof zt))return new zt(t);let{fd:e,dest:r,minLength:n,maxLength:s,maxWrite:i,periodicFlush:o,sync:a,append:l=!0,mkdir:u,retryEAGAIN:c,fsync:f,contentMode:p,mode:h}=t||{};e=e||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=s||0,this.maxWrite=i||j1,this._periodicFlush=o||0,this._periodicFlushTimer=void 0,this.sync=a||!1,this.writable=!0,this._fsync=f||!1,this.append=l||!1,this.mode=h,this.retryEAGAIN=c||(()=>!0),this.mkdir=u||!1;let d,m;if(p===N_)this._writingBuf=sa,this.write=z1,this.flush=B1,this.flushSync=W1,this._actualWrite=K1,d=()=>xe.writeSync(this.fd,this._writingBuf),m=()=>xe.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===k_)this._writingBuf="",this.write=V1,this.flush=U1,this.flushSync=G1,this._actualWrite=J1,d=()=>xe.writeSync(this.fd,this._writingBuf,"utf8"),m=()=>xe.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${k_}" and "${N_}", but passed ${p}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")x_(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(g,S)=>{if(g){if((g.code==="EAGAIN"||g.code==="EBUSY")&&this.retryEAGAIN(g,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Dc(na),this.release(void 0,0)}catch(y){this.release(y)}else setTimeout(m,na);else this._writing=!1,this.emit("error",g);return}this.emit("write",S);let b=jc(this._writingBuf,this._len,S);if(this._len=b.len,this._writingBuf=b.writingBuf,this._writingBuf.length){if(!this.sync){m();return}try{do{let y=d(),R=jc(this._writingBuf,this._len,y);this._len=R.len,this._writingBuf=R.writingBuf}while(this._writingBuf.length)}catch(y){this.release(y);return}}this._fsync&&xe.fsyncSync(this.fd);let _=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):_>this.minLength?this._actualWrite():this._ending?_>0?this._actualWrite():(this._writing=!1,ia(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(H1,this)):this.emit("drain"))},this.on("newListener",function(g){g==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function jc(t,e,r){return typeof t=="string"&&Buffer.byteLength(t)!==r&&(r=Buffer.from(t).subarray(0,r).toString().length),e=Math.max(e-r,0),t=t.slice(r),{writingBuf:t,len:e}}function H1(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}L1(zt,x1);function L_(t,e){return t.length===0?sa:t.length===1?t[0]:Buffer.concat(t,e)}function V1(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||r[r.length-1].length+t.length>this.maxWrite?r.push(""+t):r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function z1(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs,n=this._lens;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||n[n.length-1]+t.length>this.maxWrite?(r.push([t]),n.push(t.length)):(r[r.length-1].push(t),n[n.length-1]+=t.length),this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function q_(t){this._flushPending=!0;let e=()=>{if(this._fsync)this._flushPending=!1,t();else try{xe.fsync(this.fd,n=>{this._flushPending=!1,t(n)})}catch(n){t(n)}this.off("error",r)},r=n=>{this._flushPending=!1,t(n),this.off("drain",e)};this.once("drain",e),this.once("error",r)}function U1(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&q_.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function B1(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&q_.call(this,t),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}zt.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(t&&(this.file=t),this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&xe.close(e,r=>{if(r)return this.emit("error",r)})}),x_(this.file,this)};zt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():ia(this)))};function G1(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t;){t.length<=0&&(t=this._bufs[0]);try{let e=xe.writeSync(this.fd,t,"utf8"),r=jc(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;Dc(na)}}try{xe.fsyncSync(this.fd)}catch{}}function W1(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=sa);let t=sa;for(;this._bufs.length||t.length;){t.length<=0&&(t=L_(this._bufs[0],this._lens[0]));try{let e=xe.writeSync(this.fd,t);t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;Dc(na)}}}zt.prototype.destroy=function(){this.destroyed||ia(this)};function J1(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf||this._bufs.shift()||"",this.sync)try{let e=xe.writeSync(this.fd,this._writingBuf,"utf8");t(null,e)}catch(e){t(e)}else xe.write(this.fd,this._writingBuf,"utf8",t)}function K1(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:L_(this._bufs.shift(),this._lens.shift()),this.sync)try{let e=xe.writeSync(this.fd,this._writingBuf);t(null,e)}catch(e){t(e)}else M1&&(this._writingBuf=Buffer.from(this._writingBuf)),xe.write(this.fd,this._writingBuf,t)}function ia(t){if(t.fd===-1){t.once("ready",ia.bind(null,t));return}t._periodicFlushTimer!==void 0&&clearInterval(t._periodicFlushTimer),t.destroyed=!0,t._bufs=[],t._lens=[],q1(typeof t.fd=="number",`sonic.fd must be a number, got ${typeof t.fd}`);try{xe.fsync(t.fd,e)}catch{}function e(){t.fd!==1&&t.fd!==2?xe.close(t.fd,r):r()}function r(n){if(n){t.emit("error",n);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close")}}zt.SonicBoom=zt;zt.default=zt;j_.exports=zt});var Fc=E((SK,z_)=>{"use strict";var Ut={exit:[],beforeExit:[]},F_={exit:Q1,beforeExit:Z1},es;function Y1(){es===void 0&&(es=new FinalizationRegistry(ek))}function X1(t){Ut[t].length>0||process.on(t,F_[t])}function M_(t){Ut[t].length>0||(process.removeListener(t,F_[t]),Ut.exit.length===0&&Ut.beforeExit.length===0&&(es=void 0))}function Q1(){H_("exit")}function Z1(){H_("beforeExit")}function H_(t){for(let e of Ut[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t)}Ut[t]=[]}function ek(t){for(let e of["exit","beforeExit"]){let r=Ut[e].indexOf(t);Ut[e].splice(r,r+1),M_(e)}}function V_(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");X1(t);let n=new WeakRef(e);n.fn=r,Y1(),es.register(e,n),Ut[t].push(n)}function tk(t,e){V_("exit",t,e)}function rk(t,e){V_("beforeExit",t,e)}function nk(t){if(es!==void 0){es.unregister(t);for(let e of["exit","beforeExit"])Ut[e]=Ut[e].filter(r=>{let n=r.deref();return n&&n!==t}),M_(e)}}z_.exports={register:tk,registerBeforeExit:rk,unregister:nk}});var U_=E((EK,sk)=>{sk.exports={name:"thread-stream",version:"4.0.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",engines:{node:">=20"},dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^22.0.0","@yao-pkg/pkg":"^6.0.0",borp:"^0.21.0",desm:"^1.3.0",eslint:"^9.39.1",fastbench:"^1.0.1",husky:"^9.0.6",neostandard:"^0.12.2","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1","ts-node":"^10.8.0",typescript:"~5.7.3"},scripts:{build:"tsc --noEmit",lint:"eslint",test:"npm run lint && npm run build && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:ci":"npm run lint && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:yarn":"npm run transpile && borp --pattern 'test/*.test.js'",transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var G_=E((bK,B_)=>{"use strict";function ik(t,e,r,n,s){let i=n===1/0?1/0:Date.now()+n,o=()=>{let a=Atomics.load(t,e);if(a===r){s(null,"ok");return}if(i!==1/0&&Date.now()>i){s(null,"timed-out");return}let l=i===1/0?1e4:Math.min(1e4,Math.max(1,i-Date.now())),u=Atomics.waitAsync(t,e,a,l);u.async?u.value.then(o):setImmediate(o)};o()}function ok(t,e,r,n,s){let i=n===1/0?1/0:Date.now()+n,o=()=>{if(Atomics.load(t,e)!==r){s(null,"ok");return}if(i!==1/0&&Date.now()>i){s(null,"timed-out");return}let l=i===1/0?1e4:Math.min(1e4,Math.max(1,i-Date.now())),u=Atomics.waitAsync(t,e,r,l);u.async?u.value.then(o):setImmediate(o)};o()}B_.exports={wait:ik,waitDiff:ok}});var J_=E((vK,W_)=>{"use strict";W_.exports={WRITE_INDEX:4,READ_INDEX:8}});var Z_=E((wK,Q_)=>{"use strict";var{version:ak}=U_(),{EventEmitter:lk}=V("events"),{Worker:uk}=V("worker_threads"),{join:ck}=V("path"),{pathToFileURL:fk}=V("url"),{wait:dk}=G_(),{WRITE_INDEX:_t,READ_INDEX:yt}=J_(),hk=V("buffer"),pk=V("assert"),I=Symbol("kImpl"),mk=hk.constants.MAX_STRING_LENGTH,ii=class{constructor(e){this._value=e}deref(){return this._value}},aa=class{register(){}unregister(){}},gk=process.env.NODE_V8_COVERAGE?aa:global.FinalizationRegistry||aa,yk=process.env.NODE_V8_COVERAGE?ii:global.WeakRef||ii,K_=new gk(t=>{t.exited||t.terminate()});function _k(t,e){let{filename:r,workerData:n}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||ck(__dirname,"lib","worker.js"),o=new uk(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:fk(r).href,dataBuf:t[I].dataBuf,stateBuf:t[I].stateBuf,workerData:{$context:{threadStreamVersion:ak},...n}}});return o.stream=new ii(t),o.on("message",Sk),o.on("exit",X_),K_.register(t,o),o}function Y_(t){pk(!t[I].sync),t[I].needDrain&&(t[I].needDrain=!1,t.emit("drain"))}function oa(t){let e=Atomics.load(t[I].state,_t),r=t[I].data.length-e;if(r>0){if(t[I].buf.length===0){t[I].flushing=!1,t[I].ending?Uc(t):t[I].needDrain&&process.nextTick(Y_,t);return}let n=t[I].buf.slice(0,r),s=Buffer.byteLength(n);s<=r?(t[I].buf=t[I].buf.slice(r),la(t,n,oa.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[I].state,yt,0),Atomics.store(t[I].state,_t,0),Atomics.notify(t[I].state,yt);s>t[I].data.length;)r=r/2,n=t[I].buf.slice(0,r),s=Buffer.byteLength(n);t[I].buf=t[I].buf.slice(r),la(t,n,oa.bind(null,t))}})}else if(r===0){if(e===0&&t[I].buf.length===0)return;t.flush(()=>{Atomics.store(t[I].state,yt,0),Atomics.store(t[I].state,_t,0),Atomics.notify(t[I].state,yt),oa(t)})}else nr(t,new Error("overwritten"))}function Sk(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new yk(e),e.flush(()=>{e[I].ready=!0,e.emit("ready")});break;case"ERROR":nr(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"WARNING":process.emitWarning(t.err);break;default:nr(e,new Error("this should not happen: "+t.code))}}function X_(t){let e=this.stream.deref();e!==void 0&&(K_.unregister(e),e.worker.exited=!0,e.worker.off("exit",X_),nr(e,t!==0?new Error("the worker thread exited"):null))}var Hc=class extends lk{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[I]={},this[I].stateBuf=new SharedArrayBuffer(128),this[I].state=new Int32Array(this[I].stateBuf),this[I].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[I].data=Buffer.from(this[I].dataBuf),this[I].sync=e.sync||!1,this[I].ending=!1,this[I].ended=!1,this[I].needDrain=!1,this[I].destroyed=!1,this[I].flushing=!1,this[I].ready=!1,this[I].finished=!1,this[I].errored=null,this[I].closed=!1,this[I].buf="",this.worker=_k(this,e),this.on("message",(r,n)=>{this.worker.postMessage(r,n)})}write(e){if(this[I].destroyed)return Vc(this,new Error("the worker has exited")),!1;if(this[I].ending)return Vc(this,new Error("the worker is ending")),!1;if(this[I].flushing&&this[I].buf.length+e.length>=mk)try{Mc(this),this[I].flushing=!0}catch(r){return nr(this,r),!1}if(this[I].buf+=e,this[I].sync)try{return Mc(this),!0}catch(r){return nr(this,r),!1}return this[I].flushing||(this[I].flushing=!0,setImmediate(oa,this)),this[I].needDrain=this[I].data.length-this[I].buf.length-Atomics.load(this[I].state,_t)<=0,!this[I].needDrain}end(){this[I].destroyed||(this[I].ending=!0,Uc(this))}flush(e){if(this[I].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[I].state,_t);dk(this[I].state,yt,r,1/0,(n,s)=>{if(n){nr(this,n),process.nextTick(e,n);return}if(s==="not-equal"){this.flush(e);return}process.nextTick(e)})}flushSync(){this[I].destroyed||(Mc(this),zc(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[I].ready}get destroyed(){return this[I].destroyed}get closed(){return this[I].closed}get writable(){return!this[I].destroyed&&!this[I].ending}get writableEnded(){return this[I].ending}get writableFinished(){return this[I].finished}get writableNeedDrain(){return this[I].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[I].errored}};function Vc(t,e){setImmediate(()=>{t.emit("error",e)})}function nr(t,e){t[I].destroyed||(t[I].destroyed=!0,e&&(t[I].errored=e,Vc(t,e)),t.worker.exited?setImmediate(()=>{t[I].closed=!0,t.emit("close")}):t.worker.terminate().catch(()=>{}).then(()=>{t[I].closed=!0,t.emit("close")}))}function la(t,e,r){let n=Atomics.load(t[I].state,_t),s=Buffer.byteLength(e);return t[I].data.write(e,n),Atomics.store(t[I].state,_t,n+s),Atomics.notify(t[I].state,_t),r(),!0}function Uc(t){if(!(t[I].ended||!t[I].ending||t[I].flushing)){t[I].ended=!0;try{t.flushSync();let e=Atomics.load(t[I].state,yt);Atomics.store(t[I].state,_t,-1),Atomics.notify(t[I].state,_t);let r=0;for(;e!==-1;){if(Atomics.wait(t[I].state,yt,e,1e3),e=Atomics.load(t[I].state,yt),e===-2){nr(t,new Error("end() failed"));return}if(++r===10){nr(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[I].finished=!0,t.emit("finish")})}catch(e){nr(t,e)}}}function Mc(t){let e=()=>{t[I].ending?Uc(t):t[I].needDrain&&process.nextTick(Y_,t)};for(t[I].flushing=!1;t[I].buf.length!==0;){let r=Atomics.load(t[I].state,_t),n=t[I].data.length-r;if(n===0){zc(t),Atomics.store(t[I].state,yt,0),Atomics.store(t[I].state,_t,0),Atomics.notify(t[I].state,yt);continue}else if(n<0)throw new Error("overwritten");let s=t[I].buf.slice(0,n),i=Buffer.byteLength(s);if(i<=n)t[I].buf=t[I].buf.slice(n),la(t,s,e);else{for(zc(t),Atomics.store(t[I].state,yt,0),Atomics.store(t[I].state,_t,0),Atomics.notify(t[I].state,yt);i>t[I].buf.length;)n=n/2,s=t[I].buf.slice(0,n),i=Buffer.byteLength(s);t[I].buf=t[I].buf.slice(n),la(t,s,e)}}}function zc(t){if(t[I].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[I].state,_t),r=0;for(;;){let n=Atomics.load(t[I].state,yt);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[I].state,yt,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}Q_.exports=Hc});var Wc=E((RK,e0)=>{"use strict";var{createRequire:Ek}=V("module"),bk=Ic(),{join:Bc,isAbsolute:vk,sep:wk}=V("node:path"),Rk=qc(),Gc=Fc(),Ok=Z_();function Tk(t){Gc.register(t,Ak),Gc.registerBeforeExit(t,Ck),t.on("close",function(){Gc.unregister(t)})}function $k(){let t=process.execArgv;for(let e=0;e<t.length;e++){let r=t[e];if(r==="--import"||r==="--require"||r==="-r"||r.startsWith("--import=")||r.startsWith("--require=")||r.startsWith("-r="))return!0}return!1}function Pk(t,e,r,n,s){!r.execArgv&&$k()&&V.main===void 0&&(r={...r,execArgv:[]}),r={...r,name:s};let i=new Ok({filename:t,workerData:e,workerOpts:r,sync:n});i.on("ready",o),i.on("close",function(){process.removeListener("exit",a)}),process.on("exit",a);function o(){process.removeListener("exit",a),i.unref(),r.autoEnd!==!1&&Tk(i)}function a(){i.closed||(i.flushSync(),Rk(100),i.end())}return i}function Ak(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function Ck(t){t.flushSync()}function Ik(t){let{pipeline:e,targets:r,levels:n,dedupe:s,worker:i={},caller:o=bk(),sync:a=!1}=t,l={...t.options},u=typeof o=="string"?[o]:o,c=typeof globalThis=="object"&&Object.prototype.hasOwnProperty.call(globalThis,"__bundlerPathsOverrides")&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides=="object"?globalThis.__bundlerPathsOverrides:Object.create(null),f=t.target;if(f&&r)throw new Error("only one of target or targets can be specified");r?(f=c["pino-worker"]||Bc(__dirname,"worker.js"),l.targets=r.filter(d=>d.target).map(d=>({...d,target:h(d.target)})),l.pipelines=r.filter(d=>d.pipeline).map(d=>d.pipeline.map(m=>({...m,level:d.level,target:h(m.target)})))):e&&(f=c["pino-worker"]||Bc(__dirname,"worker.js"),l.pipelines=[e.map(d=>({...d,target:h(d.target)}))]),n&&(l.levels=n),s&&(l.dedupe=s),l.pinoWillSendConfig=!0;let p=r||e?"pino.transport":f;return Pk(h(f),l,i,a,p);function h(d){if(d=c[d]||d,vk(d)||d.indexOf("file://")===0)return d;if(d==="pino/file")return Bc(__dirname,"..","file.js");let m;for(let g of u)try{let S=g==="node:repl"?process.cwd()+wk:g;m=Ek(S).resolve(d);break}catch{continue}if(!m)throw new Error(`unable to determine transport target for "${d}"`);return m}}e0.exports=Ik});var fa=E((TK,h0)=>{"use strict";var Nk=V("node:diagnostics_channel"),t0=C_(),{mapHttpRequest:kk,mapHttpResponse:xk}=Cc(),Kc=D_(),r0=Fc(),{lsCacheSym:Lk,chindingsSym:a0,writeSym:n0,serializersSym:l0,formatOptsSym:s0,endSym:qk,stringifiersSym:u0,stringifySym:c0,stringifySafeSym:Yc,wildcardFirstSym:f0,nestedKeySym:jk,formattersSym:d0,messageKeySym:Dk,errorKeySym:Fk,nestedKeyStrSym:Mk,msgPrefixSym:ua}=Zn(),{isMainThread:Hk}=V("worker_threads"),Vk=Wc(),[zk]=process.versions.node.split(".").map(t=>Number(t)),i0=Nk.tracingChannel("pino_asJson"),Jc=zk>=25?t=>JSON.stringify(t):Bk;function ts(){}function Uk(t,e){if(!e)return r;return function(...s){e.call(this,s,r,t)};function r(n,...s){if(typeof n=="object"){let i=n;n!==null&&(n.method&&n.headers&&n.socket?n=kk(n):typeof n.setHeader=="function"&&(n=xk(n)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[ua]=="string"&&i!==void 0&&i!==null&&(i=this[ua]+i),this[n0](n,t0(i,o,this[s0]),t)}else{let i=n===void 0?s.shift():n;typeof this[ua]=="string"&&i!==void 0&&i!==null&&(i=this[ua]+i),this[n0](null,t0(i,s,this[s0]),t)}}}function Bk(t){let e="",r=0,n=!1,s=255,i=t.length;if(i>100)return JSON.stringify(t);for(var o=0;o<i&&s>=32;o++)s=t.charCodeAt(o),(s===34||s===92)&&(e+=t.slice(r,o)+"\\",r=o,n=!0);return n?e+=t.slice(r):e=t,s<32?JSON.stringify(t):'"'+e+'"'}function Gk(t,e,r,n){if(i0.hasSubscribers===!1)return o0.call(this,t,e,r,n);let s={instance:this,arguments};return i0.traceSync(o0,s,this,t,e,r,n)}function o0(t,e,r,n){let s=this[c0],i=this[Yc],o=this[u0],a=this[qk],l=this[a0],u=this[l0],c=this[d0],f=this[Dk],p=this[Fk],h=this[Lk][r]+n;h=h+l;let d;c.log&&(t=c.log(t));let m=o[f0],g="";for(let b in t)if(d=t[b],Object.prototype.hasOwnProperty.call(t,b)&&d!==void 0){u[b]?d=u[b](d):b===p&&u.err&&(d=u.err(d));let _=o[b]||m;switch(typeof d){case"undefined":case"function":continue;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":_&&(d=_(d));break;case"string":d=(_||Jc)(d);break;default:d=(_||s)(d,i)}if(d===void 0)continue;let y=Jc(b);g+=","+y+":"+d}let S="";if(e!==void 0){d=u[f]?u[f](e):e;let b=o[f]||m;switch(typeof d){case"function":break;case"number":Number.isFinite(d)===!1&&(d=null);case"boolean":b&&(d=b(d)),S=',"'+f+'":'+d;break;case"string":d=(b||Jc)(d),S=',"'+f+'":'+d;break;default:d=(b||s)(d,i),S=',"'+f+'":'+d}}return this[jk]&&g?h+this[Mk]+g.slice(1)+"}"+S+a:h+g+S+a}function Wk(t,e){let r,n=t[a0],s=t[c0],i=t[Yc],o=t[u0],a=o[f0],l=t[l0],u=t[d0].bindings;e=u(e);for(let c in e)if(r=e[c],((c.length<5||c!=="level"&&c!=="serializers"&&c!=="formatters"&&c!=="customLevels")&&e.hasOwnProperty(c)&&r!==void 0)===!0){if(r=l[c]?l[c](r):r,r=(o[c]||a||s)(r,i),r===void 0)continue;n+=',"'+c+'":'+r}return n}function Jk(t){return t.write!==t.constructor.prototype.write}function ca(t){let e=new Kc(t);return e.on("error",r),!t.sync&&Hk&&(r0.register(e,Kk),e.on("close",function(){r0.unregister(e)})),e;function r(n){if(n.code==="EPIPE"){e.write=ts,e.end=ts,e.flushSync=ts,e.destroy=ts;return}e.removeListener("error",r),e.emit("error",n)}}function Kk(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function Yk(t){return function(r,n,s={},i){if(typeof s=="string")i=ca({dest:s}),s={};else if(typeof i=="string"){if(s&&s.transport)throw Error("only one of option.transport or stream can be specified");i=ca({dest:i})}else if(s instanceof Kc||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof Kc||s.transport.writable||s.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(s.transport.targets&&s.transport.targets.length&&s.formatters&&typeof s.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let l;s.customLevels&&(l=s.useOnlyCustomLevels?s.customLevels:Object.assign({},s.levels,s.customLevels)),i=Vk({caller:n,...s.transport,levels:l})}if(s=Object.assign({},t,s),s.serializers=Object.assign({},t.serializers,s.serializers),s.formatters=Object.assign({},t.formatters,s.formatters),s.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:a}=s;return o===!1&&(s.level="silent"),a||(s.onChild=ts),i||(Jk(process.stdout)?i=process.stdout:i=ca({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function Xk(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[Yc])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function Qk(t,e,r){return{level:t,bindings:e,log:r}}function Zk(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}h0.exports={noop:ts,buildSafeSonicBoom:ca,asChindings:Wk,asJson:Gk,genLog:Uk,createArgsNormalizer:Yk,stringify:Xk,buildFormatters:Qk,normalizeDestFileDescriptor:Zk}});var da=E(($K,p0)=>{var ex={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},tx={ASC:"ASC",DESC:"DESC"};p0.exports={DEFAULT_LEVELS:ex,SORTING_ORDER:tx}});var Zc=E((PK,_0)=>{"use strict";var{lsCacheSym:rx,levelValSym:Xc,useOnlyCustomLevelsSym:nx,streamSym:sx,formattersSym:ix,hooksSym:ox,levelCompSym:m0}=Zn(),{noop:ax,genLog:pn}=fa(),{DEFAULT_LEVELS:sr,SORTING_ORDER:g0}=da(),y0={fatal:t=>{let e=pn(sr.fatal,t);return function(...r){let n=this[sx];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:t=>pn(sr.error,t),warn:t=>pn(sr.warn,t),info:t=>pn(sr.info,t),debug:t=>pn(sr.debug,t),trace:t=>pn(sr.trace,t)},Qc=Object.keys(sr).reduce((t,e)=>(t[sr[e]]=e,t),{}),lx=Object.keys(Qc).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function ux(t){let e=t[ix].level,{labels:r}=t.levels,n={};for(let s in r){let i=e(r[s],Number(s));n[s]=JSON.stringify(i).slice(0,-1)}return t[rx]=n,t}function cx(t,e){if(e)return!1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function fx(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t]}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[Xc],s=this[Xc]=r[t],i=this[nx],o=this[m0],a=this[ox].logMethod;for(let l in r){if(o(r[l],s)===!1){this[l]=ax;continue}this[l]=cx(l,i)?y0[l](a):pn(r[l],a)}this.emit("level-change",t,s,e[n],n,this)}function dx(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function hx(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&this[m0](r,this[Xc])}function px(t,e,r){return t===g0.DESC?e<=r:e>=r}function mx(t){return typeof t=="string"?px.bind(null,t):t}function gx(t=null,e=!1){let r=t?Object.keys(t).reduce((i,o)=>(i[t[o]]=o,i),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Qc,r),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:sr,t);return{labels:n,values:s}}function yx(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),r?[]:Object.keys(Qc).map(i=>+i),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:sr,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function _x(t,e){let{labels:r,values:n}=t;for(let s in e){if(s in n)throw Error("levels cannot be overridden");if(e[s]in r)throw Error("pre-existing level values cannot be used for new levels")}}function Sx(t){if(typeof t!="function"&&!(typeof t=="string"&&Object.values(g0).includes(t)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}_0.exports={initialLsCache:lx,genLsCache:ux,levelMethods:y0,getLevel:dx,setLevel:fx,isLevelEnabled:hx,mappings:gx,assertNoLevelCollisions:_x,assertDefaultLevelFound:yx,genLevelComparison:mx,assertLevelComparison:Sx}});var ef=E((AK,S0)=>{"use strict";S0.exports={version:"10.3.0"}});var $0=E((IK,T0)=>{"use strict";var{EventEmitter:Ex}=V("node:events"),{lsCacheSym:bx,levelValSym:vx,setLevelSym:rf,getLevelSym:E0,chindingsSym:pa,mixinSym:wx,asJsonSym:v0,writeSym:Rx,mixinMergeStrategySym:Ox,timeSym:Tx,timeSliceIndexSym:$x,streamSym:w0,serializersSym:mn,formattersSym:oi,errorKeySym:Px,messageKeySym:Ax,useOnlyCustomLevelsSym:Cx,needsMetadataGsym:Ix,redactFmtSym:Nx,stringifySym:kx,formatOptsSym:xx,stringifiersSym:Lx,msgPrefixSym:nf,hooksSym:qx}=Zn(),{getLevel:jx,setLevel:Dx,isLevelEnabled:Fx,mappings:Mx,initialLsCache:Hx,genLsCache:Vx,assertNoLevelCollisions:zx}=Zc(),{asChindings:sf,asJson:Ux,buildFormatters:tf,stringify:b0,noop:R0}=fa(),{version:Bx}=ef(),Gx=xc(),Wx=class{},O0={constructor:Wx,child:Jx,bindings:Kx,setBindings:Yx,flush:Zx,isLevelEnabled:Fx,version:Bx,get level(){return this[E0]()},set level(t){this[rf](t)},get levelVal(){return this[vx]},set levelVal(t){throw Error("levelVal is read-only")},get msgPrefix(){return this[nf]},get[Symbol.toStringTag](){return"Pino"},[bx]:Hx,[Rx]:Qx,[v0]:Ux,[E0]:jx,[rf]:Dx};Object.setPrototypeOf(O0,Ex.prototype);T0.exports=function(){return Object.create(O0)};var ha=t=>t;function Jx(t,e){if(!t)throw Error("missing bindings for child Pino");let r=this[mn],n=this[oi],s=Object.create(this);if(e==null)return s[oi].bindings!==ha&&(s[oi]=tf(n.level,ha,n.log)),s[pa]=sf(s,t),this.onChild!==R0&&this.onChild(s),s;if(e.hasOwnProperty("serializers")===!0){s[mn]=Object.create(null);for(let u in r)s[mn][u]=r[u];let a=Object.getOwnPropertySymbols(r);for(var i=0;i<a.length;i++){let u=a[i];s[mn][u]=r[u]}for(let u in e.serializers)s[mn][u]=e.serializers[u];let l=Object.getOwnPropertySymbols(e.serializers);for(var o=0;o<l.length;o++){let u=l[o];s[mn][u]=e.serializers[u]}}else s[mn]=r;if(e.hasOwnProperty("formatters")){let{level:a,bindings:l,log:u}=e.formatters;s[oi]=tf(a||n.level,l||ha,u||n.log)}else s[oi]=tf(n.level,ha,n.log);if(e.hasOwnProperty("customLevels")===!0&&(zx(this.levels,e.customLevels),s.levels=Mx(e.customLevels,s[Cx]),Vx(s)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){s.redact=e.redact;let a=Gx(s.redact,b0),l={stringify:a[Nx]};s[kx]=b0,s[Lx]=a,s[xx]=l}if(typeof e.msgPrefix=="string"&&(s[nf]=(this[nf]||"")+e.msgPrefix),s[pa]=sf(s,t),e.level!==void 0&&e.level!==this.level||e.hasOwnProperty("customLevels")){let a=e.level||this.level;s[rf](a)}return this.onChild(s),s}function Kx(){let e=`{${this[pa].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function Yx(t){let e=sf(this,t);this[pa]=e}function Xx(t,e){return Object.assign(e,t)}function Qx(t,e,r){let n=this[Tx](),s=this[wx],i=this[Px],o=this[Ax],a=this[Ox]||Xx,l,u=this[qx].streamWrite;t==null?l={}:t instanceof Error?(l={[i]:t},e===void 0&&(e=t.message)):(l=t,e===void 0&&t[o]===void 0&&t[i]&&(e=t[i].message)),s&&(l=a(l,s(l,r,this)));let c=this[v0](l,e,r,n),f=this[w0];f[Ix]===!0&&(f.lastLevel=r,f.lastObj=l,f.lastMsg=e,f.lastTime=n.slice(this[$x]),f.lastLogger=this),f.write(u?u(c):c)}function Zx(t){if(t!=null&&typeof t!="function")throw Error("callback must be a function");let e=this[w0];typeof e.flush=="function"?e.flush(t||R0):t&&t()}});var I0=E((uf,C0)=>{"use strict";var{hasOwnProperty:ai}=Object.prototype,yn=lf();yn.configure=lf;yn.stringify=yn;yn.default=yn;uf.stringify=yn;uf.configure=lf;C0.exports=yn;var eL=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Hr(t){return t.length<5e3&&!eL.test(t)?`"${t}"`:JSON.stringify(t)}function of(t,e){if(t.length>200||e)return t.sort(e);for(let r=1;r<t.length;r++){let n=t[r],s=r;for(;s!==0&&t[s-1]>n;)t[s]=t[s-1],s--;t[s]=n}return t}var tL=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function af(t){return tL.call(t)!==void 0&&t.length!==0}function P0(t,e,r){t.length<r&&(r=t.length);let n=e===","?"":" ",s=`"0":${n}${t[0]}`;for(let i=1;i<r;i++)s+=`${e}"${i}":${n}${t[i]}`;return s}function rL(t){if(ai.call(t,"circularValue")){let e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function nL(t){let e;if(ai.call(t,"deterministic")&&(e=t.deterministic,typeof e!="boolean"&&typeof e!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return e===void 0?!0:e}function sL(t,e){let r;if(ai.call(t,e)&&(r=t[e],typeof r!="boolean"))throw new TypeError(`The "${e}" argument must be of type boolean`);return r===void 0?!0:r}function A0(t,e){let r;if(ai.call(t,e)){if(r=t[e],typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function gn(t){return t===1?"1 item":`${t} items`}function iL(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function oL(t){if(ai.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function lf(t){t={...t};let e=oL(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=rL(t),n=sL(t,"bigint"),s=nL(t),i=typeof s=="function"?s:void 0,o=A0(t,"maximumDepth"),a=A0(t,"maximumBreadth");function l(h,d,m,g,S,b){let _=d[h];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(h)),_=g.call(d,h,_),typeof _){case"string":return Hr(_);case"object":{if(_===null)return"null";if(m.indexOf(_)!==-1)return r;let y="",R=",",T=b;if(Array.isArray(_)){if(_.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(_),S!==""&&(b+=S,y+=`
32
32
  ${b}`,R=`,
33
33
  ${b}`);let C=Math.min(_.length,a),k=0;for(;k<C-1;k++){let J=l(String(k),_,m,g,S,b);y+=J!==void 0?J:"null",y+=R}let M=l(String(k),_,m,g,S,b);if(y+=M!==void 0?M:"null",_.length-1>a){let J=_.length-a-1;y+=`${R}"... ${gn(J)} not stringified"`}return S!==""&&(y+=`
34
34
  ${T}`),m.pop(),`[${y}]`}let O=Object.keys(_),w=O.length;if(w===0)return"{}";if(o<m.length+1)return'"[Object]"';let $="",v="";S!==""&&(b+=S,R=`,
35
- ${b}`,$=" ");let P=Math.min(w,a);s&&!of(_)&&(O=sf(O,i)),m.push(_);for(let C=0;C<P;C++){let k=O[C],M=l(k,_,m,g,S,b);M!==void 0&&(y+=`${v}${Hr(k)}:${$}${M}`,v=R)}if(w>a){let C=w-a;y+=`${v}"...":${$}"${gn(C)} not stringified"`,v=R}return S!==""&&v.length>1&&(y=`
35
+ ${b}`,$=" ");let P=Math.min(w,a);s&&!af(_)&&(O=of(O,i)),m.push(_);for(let C=0;C<P;C++){let k=O[C],M=l(k,_,m,g,S,b);M!==void 0&&(y+=`${v}${Hr(k)}:${$}${M}`,v=R)}if(w>a){let C=w-a;y+=`${v}"...":${$}"${gn(C)} not stringified"`,v=R}return S!==""&&v.length>1&&(y=`
36
36
  ${b}${y}
37
37
  ${T}`),m.pop(),`{${y}}`}case"number":return isFinite(_)?String(_):e?e(_):"null";case"boolean":return _===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(_);default:return e?e(_):void 0}}function u(h,d,m,g,S,b){switch(typeof d=="object"&&d!==null&&typeof d.toJSON=="function"&&(d=d.toJSON(h)),typeof d){case"string":return Hr(d);case"object":{if(d===null)return"null";if(m.indexOf(d)!==-1)return r;let _=b,y="",R=",";if(Array.isArray(d)){if(d.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(d),S!==""&&(b+=S,y+=`
38
38
  ${b}`,R=`,
@@ -44,19 +44,19 @@ ${_}`),m.pop(),`{${y}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";
44
44
  ${S}`,v=`,
45
45
  ${S}`,P=Math.min(d.length,a),C=0;for(;C<P-1;C++){let M=c(String(C),d[C],m,g,S);$+=M!==void 0?M:"null",$+=v}let k=c(String(C),d[C],m,g,S);if($+=k!==void 0?k:"null",d.length-1>a){let M=d.length-a-1;$+=`${v}"... ${gn(M)} not stringified"`}return $+=`
46
46
  ${b}`,m.pop(),`[${$}]`}let _=Object.keys(d),y=_.length;if(y===0)return"{}";if(o<m.length+1)return'"[Object]"';S+=g;let R=`,
47
- ${S}`,T="",O="",w=Math.min(y,a);of(d)&&(T+=$0(d,R,a),_=_.slice(d.length),w-=d.length,O=R),s&&(_=sf(_,i)),m.push(d);for(let $=0;$<w;$++){let v=_[$],P=c(v,d[v],m,g,S);P!==void 0&&(T+=`${O}${Hr(v)}: ${P}`,O=R)}if(y>a){let $=y-a;T+=`${O}"...": "${gn($)} not stringified"`,O=R}return O!==""&&(T=`
47
+ ${S}`,T="",O="",w=Math.min(y,a);af(d)&&(T+=P0(d,R,a),_=_.slice(d.length),w-=d.length,O=R),s&&(_=of(_,i)),m.push(d);for(let $=0;$<w;$++){let v=_[$],P=c(v,d[v],m,g,S);P!==void 0&&(T+=`${O}${Hr(v)}: ${P}`,O=R)}if(y>a){let $=y-a;T+=`${O}"...": "${gn($)} not stringified"`,O=R}return O!==""&&(T=`
48
48
  ${S}${T}
49
- ${b}`),m.pop(),`{${T}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(d);default:return e?e(d):void 0}}function f(h,d,m){switch(typeof d){case"string":return Hr(d);case"object":{if(d===null)return"null";if(typeof d.toJSON=="function"){if(d=d.toJSON(h),typeof d!="object")return f(h,d,m);if(d===null)return"null"}if(m.indexOf(d)!==-1)return r;let g="",S=d.length!==void 0;if(S&&Array.isArray(d)){if(d.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(d);let T=Math.min(d.length,a),O=0;for(;O<T-1;O++){let $=f(String(O),d[O],m);g+=$!==void 0?$:"null",g+=","}let w=f(String(O),d[O],m);if(g+=w!==void 0?w:"null",d.length-1>a){let $=d.length-a-1;g+=`,"... ${gn($)} not stringified"`}return m.pop(),`[${g}]`}let b=Object.keys(d),_=b.length;if(_===0)return"{}";if(o<m.length+1)return'"[Object]"';let y="",R=Math.min(_,a);S&&of(d)&&(g+=$0(d,",",a),b=b.slice(d.length),R-=d.length,y=","),s&&(b=sf(b,i)),m.push(d);for(let T=0;T<R;T++){let O=b[T],w=f(O,d[O],m);w!==void 0&&(g+=`${y}${Hr(O)}:${w}`,y=",")}if(_>a){let T=_-a;g+=`${y}"...":"${gn(T)} not stringified"`}return m.pop(),`{${g}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(d);default:return e?e(d):void 0}}function p(h,d,m){if(arguments.length>1){let g="";if(typeof m=="number"?g=" ".repeat(Math.min(m,10)):typeof m=="string"&&(g=m.slice(0,10)),d!=null){if(typeof d=="function")return l("",{"":h},[],d,g,"");if(Array.isArray(d))return u("",h,[],eL(d),g,"")}if(g.length!==0)return c("",h,[],g,"")}return f("",h,[])}return p}});var x0=E((RK,k0)=>{"use strict";var uf=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:N0}=fa(),rL=N0.info;function nL(t,e){t=t||[],e=e||{dedupe:!1};let r=Object.create(N0);r.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(f=>{r[f]=e.levels[f]});let n={write:s,add:a,remove:l,emit:i,flushSync:o,end:u,minLevel:0,lastId:0,streams:[],clone:c,[uf]:!0,streamLevels:r};return Array.isArray(t)?t.forEach(a,n):a.call(n,t),t=null,n;function s(f){let p,h=this.lastLevel,{streams:d}=this,m=0,g;for(let S=sL(d.length,e.dedupe);oL(S,d.length,e.dedupe);S=iL(S,e.dedupe))if(p=d[S],p.level<=h){if(m!==0&&m!==p.level)break;if(g=p.stream,g[uf]){let{lastTime:b,lastMsg:_,lastObj:y,lastLogger:R}=this;g.lastLevel=h,g.lastTime=b,g.lastMsg=_,g.lastObj=y,g.lastLogger=R}g.write(f),e.dedupe&&(m=p.level)}else if(!e.dedupe)break}function i(...f){for(let{stream:p}of this.streams)typeof p.emit=="function"&&p.emit(...f)}function o(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync()}function a(f){if(!f)return n;let p=typeof f.write=="function"||f.stream,h=f.write?f:f.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:d,streamLevels:m}=this,g;typeof f.levelVal=="number"?g=f.levelVal:typeof f.level=="string"?g=m[f.level]:typeof f.level=="number"?g=f.level:g=rL;let S={stream:h,level:g,levelVal:void 0,id:++n.lastId};return d.unshift(S),d.sort(I0),this.minLevel=d[0].level,n}function l(f){let{streams:p}=this,h=p.findIndex(d=>d.id===f);return h>=0&&(p.splice(h,1),p.sort(I0),this.minLevel=p.length>0?p[0].level:-1),n}function u(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync(),f.end()}function c(f){let p=new Array(this.streams.length);for(let h=0;h<p.length;h++)p[h]={level:f,stream:this.streams[h].stream};return{write:s,add:a,remove:l,minLevel:f,streams:p,clone:c,emit:i,flushSync:o,[uf]:!0}}}function I0(t,e){return t.level-e.level}function sL(t,e){return e?t-1:0}function iL(t,e){return e?t-1:t+1}function oL(t,e,r){return r?t>=0:t<e}k0.exports=nL});var J0=E((OK,Ct)=>{"use strict";var aL=V("node:os"),V0=Ac(),lL=Cc(),uL=kc(),z0=$_(),cL=T0(),U0=Zn(),{configure:fL}=C0(),{assertDefaultLevelFound:dL,mappings:B0,genLsCache:hL,genLevelComparison:pL,assertLevelComparison:mL}=Qc(),{DEFAULT_LEVELS:G0,SORTING_ORDER:gL}=fa(),{createArgsNormalizer:yL,asChindings:_L,buildSafeSonicBoom:L0,buildFormatters:SL,stringify:cf,normalizeDestFileDescriptor:q0,noop:EL}=ca(),{version:bL}=Zc(),{chindingsSym:j0,redactFmtSym:vL,serializersSym:D0,timeSym:wL,timeSliceIndexSym:RL,streamSym:OL,stringifySym:F0,stringifySafeSym:ff,stringifiersSym:M0,setLevelSym:TL,endSym:$L,formatOptsSym:PL,messageKeySym:AL,errorKeySym:CL,nestedKeySym:IL,mixinSym:NL,levelCompSym:kL,useOnlyCustomLevelsSym:xL,formattersSym:H0,hooksSym:LL,nestedKeyStrSym:qL,mixinMergeStrategySym:jL,msgPrefixSym:DL}=U0,{epochTime:W0,nullTime:FL}=z0,{pid:ML}=process,HL=aL.hostname(),VL=V0.err,zL={level:"info",levelComparison:gL.ASC,levels:G0,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:ML,hostname:HL},serializers:Object.assign(Object.create(null),{err:VL}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:W0,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},UL=yL(zL),BL=Object.assign(Object.create(null),V0);function df(...t){let e={},{opts:r,stream:n}=UL(e,lL(),...t);r.level&&typeof r.level=="string"&&G0[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:s,crlf:i,serializers:o,timestamp:a,messageKey:l,errorKey:u,nestedKey:c,base:f,name:p,level:h,customLevels:d,levelComparison:m,mixin:g,mixinMergeStrategy:S,useOnlyCustomLevels:b,formatters:_,hooks:y,depthLimit:R,edgeLimit:T,onChild:O,msgPrefix:w}=r,$=fL({maximumDepth:R,maximumBreadth:T}),v=SL(_.level,_.bindings,_.log),P=cf.bind({[ff]:$}),C=s?uL(s,P):{},k=s?{stringify:C[vL]}:{stringify:P},M="}"+(i?`\r
49
+ ${b}`),m.pop(),`{${T}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(d);default:return e?e(d):void 0}}function f(h,d,m){switch(typeof d){case"string":return Hr(d);case"object":{if(d===null)return"null";if(typeof d.toJSON=="function"){if(d=d.toJSON(h),typeof d!="object")return f(h,d,m);if(d===null)return"null"}if(m.indexOf(d)!==-1)return r;let g="",S=d.length!==void 0;if(S&&Array.isArray(d)){if(d.length===0)return"[]";if(o<m.length+1)return'"[Array]"';m.push(d);let T=Math.min(d.length,a),O=0;for(;O<T-1;O++){let $=f(String(O),d[O],m);g+=$!==void 0?$:"null",g+=","}let w=f(String(O),d[O],m);if(g+=w!==void 0?w:"null",d.length-1>a){let $=d.length-a-1;g+=`,"... ${gn($)} not stringified"`}return m.pop(),`[${g}]`}let b=Object.keys(d),_=b.length;if(_===0)return"{}";if(o<m.length+1)return'"[Object]"';let y="",R=Math.min(_,a);S&&af(d)&&(g+=P0(d,",",a),b=b.slice(d.length),R-=d.length,y=","),s&&(b=of(b,i)),m.push(d);for(let T=0;T<R;T++){let O=b[T],w=f(O,d[O],m);w!==void 0&&(g+=`${y}${Hr(O)}:${w}`,y=",")}if(_>a){let T=_-a;g+=`${y}"...":"${gn(T)} not stringified"`}return m.pop(),`{${g}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";case"boolean":return d===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(d);default:return e?e(d):void 0}}function p(h,d,m){if(arguments.length>1){let g="";if(typeof m=="number"?g=" ".repeat(Math.min(m,10)):typeof m=="string"&&(g=m.slice(0,10)),d!=null){if(typeof d=="function")return l("",{"":h},[],d,g,"");if(Array.isArray(d))return u("",h,[],iL(d),g,"")}if(g.length!==0)return c("",h,[],g,"")}return f("",h,[])}return p}});var L0=E((NK,x0)=>{"use strict";var cf=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:k0}=da(),aL=k0.info;function lL(t,e){t=t||[],e=e||{dedupe:!1};let r=Object.create(k0);r.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(f=>{r[f]=e.levels[f]});let n={write:s,add:a,remove:l,emit:i,flushSync:o,end:u,minLevel:0,lastId:0,streams:[],clone:c,[cf]:!0,streamLevels:r};return Array.isArray(t)?t.forEach(a,n):a.call(n,t),t=null,n;function s(f){let p,h=this.lastLevel,{streams:d}=this,m=0,g;for(let S=uL(d.length,e.dedupe);fL(S,d.length,e.dedupe);S=cL(S,e.dedupe))if(p=d[S],p.level<=h){if(m!==0&&m!==p.level)break;if(g=p.stream,g[cf]){let{lastTime:b,lastMsg:_,lastObj:y,lastLogger:R}=this;g.lastLevel=h,g.lastTime=b,g.lastMsg=_,g.lastObj=y,g.lastLogger=R}g.write(f),e.dedupe&&(m=p.level)}else if(!e.dedupe)break}function i(...f){for(let{stream:p}of this.streams)typeof p.emit=="function"&&p.emit(...f)}function o(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync()}function a(f){if(!f)return n;let p=typeof f.write=="function"||f.stream,h=f.write?f:f.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:d,streamLevels:m}=this,g;typeof f.levelVal=="number"?g=f.levelVal:typeof f.level=="string"?g=m[f.level]:typeof f.level=="number"?g=f.level:g=aL;let S={stream:h,level:g,levelVal:void 0,id:++n.lastId};return d.unshift(S),d.sort(N0),this.minLevel=d[0].level,n}function l(f){let{streams:p}=this,h=p.findIndex(d=>d.id===f);return h>=0&&(p.splice(h,1),p.sort(N0),this.minLevel=p.length>0?p[0].level:-1),n}function u(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync(),f.end()}function c(f){let p=new Array(this.streams.length);for(let h=0;h<p.length;h++)p[h]={level:f,stream:this.streams[h].stream};return{write:s,add:a,remove:l,minLevel:f,streams:p,clone:c,emit:i,flushSync:o,[cf]:!0}}}function N0(t,e){return t.level-e.level}function uL(t,e){return e?t-1:0}function cL(t,e){return e?t-1:t+1}function fL(t,e,r){return r?t>=0:t<e}x0.exports=lL});var K0=E((kK,Ct)=>{"use strict";var dL=V("node:os"),z0=Cc(),hL=Ic(),pL=xc(),U0=P_(),mL=$0(),B0=Zn(),{configure:gL}=I0(),{assertDefaultLevelFound:yL,mappings:G0,genLsCache:_L,genLevelComparison:SL,assertLevelComparison:EL}=Zc(),{DEFAULT_LEVELS:W0,SORTING_ORDER:bL}=da(),{createArgsNormalizer:vL,asChindings:wL,buildSafeSonicBoom:q0,buildFormatters:RL,stringify:ff,normalizeDestFileDescriptor:j0,noop:OL}=fa(),{version:TL}=ef(),{chindingsSym:D0,redactFmtSym:$L,serializersSym:F0,timeSym:PL,timeSliceIndexSym:AL,streamSym:CL,stringifySym:M0,stringifySafeSym:df,stringifiersSym:H0,setLevelSym:IL,endSym:NL,formatOptsSym:kL,messageKeySym:xL,errorKeySym:LL,nestedKeySym:qL,mixinSym:jL,levelCompSym:DL,useOnlyCustomLevelsSym:FL,formattersSym:V0,hooksSym:ML,nestedKeyStrSym:HL,mixinMergeStrategySym:VL,msgPrefixSym:zL}=B0,{epochTime:J0,nullTime:UL}=U0,{pid:BL}=process,GL=dL.hostname(),WL=z0.err,JL={level:"info",levelComparison:bL.ASC,levels:W0,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:BL,hostname:GL},serializers:Object.assign(Object.create(null),{err:WL}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:J0,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},KL=vL(JL),YL=Object.assign(Object.create(null),z0);function hf(...t){let e={},{opts:r,stream:n}=KL(e,hL(),...t);r.level&&typeof r.level=="string"&&W0[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:s,crlf:i,serializers:o,timestamp:a,messageKey:l,errorKey:u,nestedKey:c,base:f,name:p,level:h,customLevels:d,levelComparison:m,mixin:g,mixinMergeStrategy:S,useOnlyCustomLevels:b,formatters:_,hooks:y,depthLimit:R,edgeLimit:T,onChild:O,msgPrefix:w}=r,$=gL({maximumDepth:R,maximumBreadth:T}),v=RL(_.level,_.bindings,_.log),P=ff.bind({[df]:$}),C=s?pL(s,P):{},k=s?{stringify:C[$L]}:{stringify:P},M="}"+(i?`\r
50
50
  `:`
51
- `),J=_L.bind(null,{[j0]:"",[D0]:o,[M0]:C,[F0]:cf,[ff]:$,[H0]:v}),U="";f!==null&&(p===void 0?U=J(f):U=J(Object.assign({},f,{name:p})));let H=a instanceof Function?a:a?W0:FL,fe=H().indexOf(":")+1;if(b&&!d)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(g&&typeof g!="function")throw Error(`Unknown mixin type "${typeof g}" - expected "function"`);if(w&&typeof w!="string")throw Error(`Unknown msgPrefix type "${typeof w}" - expected "string"`);dL(h,d,b);let ze=B0(d,b);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:ze,messageKey:l,errorKey:u}}),mL(m);let G=pL(m);return Object.assign(e,{levels:ze,[kL]:G,[xL]:b,[OL]:n,[wL]:H,[RL]:fe,[F0]:cf,[ff]:$,[M0]:C,[$L]:M,[PL]:k,[AL]:l,[CL]:u,[IL]:c,[qL]:c?`,${JSON.stringify(c)}:{`:"",[D0]:o,[NL]:g,[jL]:S,[j0]:U,[H0]:v,[LL]:y,silent:EL,onChild:O,[DL]:w}),Object.setPrototypeOf(e,cL()),hL(e),e[TL](h),e}Ct.exports=df;Ct.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=q0(t.dest||process.stdout.fd),L0(t)):L0({dest:q0(t),minLength:0});Ct.exports.transport=Gc();Ct.exports.multistream=x0();Ct.exports.levels=B0();Ct.exports.stdSerializers=BL;Ct.exports.stdTimeFunctions=Object.assign({},z0);Ct.exports.symbols=U0;Ct.exports.version=bL;Ct.exports.default=df;Ct.exports.pino=df});var X0=E((TK,Y0)=>{"use strict";var pa=J0(),{serializersSym:K0}=pa.symbols,{FST_ERR_LOG_INVALID_DESTINATION:GL}=He();function WL(t){if(t.stream&&t.file)throw new GL;t.file&&(t.stream=pa.destination(t.file),delete t.file);let e=t.logger,r=t.genReqId,n=null;return e?(t.logger=void 0,t.genReqId=void 0,e[K0]&&(t.serializers=Object.assign({},t.serializers,e[K0])),n=e.child({},t),t.logger=e,t.genReqId=r):n=pa(t,t.stream),n}var JL={req:function(e){return{method:e.method,url:e.url,version:e.headers&&e.headers["accept-version"],host:e.host,remoteAddress:e.ip,remotePort:e.socket?e.socket.remotePort:void 0}},err:pa.stdSerializers.err,res:function(e){return{statusCode:e.statusCode}}};Y0.exports={serializers:JL,createPinoLogger:WL}});var ai=E(($K,Z0)=>{"use strict";var{FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED:KL,FST_ERR_LOG_INVALID_LOGGER_CONFIG:YL,FST_ERR_LOG_INVALID_LOGGER_INSTANCE:XL,FST_ERR_LOG_INVALID_LOGGER:QL}=He();function ZL(t,e,r,n,s){let i={[t.requestIdLogLabel]:n},o=t.childLoggerFactory.call(t.server,e,i,s||{},r);return t.childLoggerFactory!==Q0&&ma(o,!0),o}function Q0(t,e,r){return t.child(e,r)}function ma(t,e){let r=["info","error","debug","fatal","warn","trace","child"],n=t?r.filter(s=>!t[s]||typeof t[s]!="function"):r;if(n.length){if(n.length===r.length&&!e)return!1;throw QL(n.join(","))}else return!0}function eq(t){if(t.logger&&t.loggerInstance)throw new KL;if(!t.loggerInstance&&!t.logger){let o=Wy();return o.child=()=>o,{logger:o,hasLogger:!1}}let{createPinoLogger:e,serializers:r}=X0();if(ma(t.loggerInstance))return{logger:e({logger:t.loggerInstance,serializers:Object.assign({},r,t.loggerInstance.serializers)}),hasLogger:!0};if(ma(t.logger))throw YL();if(t.loggerInstance)throw XL();let n={};return Object.prototype.toString.call(t.logger)==="[object Object]"&&Reflect.ownKeys(t.logger).forEach(i=>{Object.defineProperty(n,i,{value:t.logger[i],writable:!0,enumerable:!0,configurable:!0})}),n.level=n.level||"info",n.serializers=Object.assign({},r,n.serializers),t.logger=n,{logger:e(t.logger),hasLogger:!0}}function tq(){let t=process.hrtime();return t[0]*1e3+t[1]/1e6}Z0.exports={createChildLogger:ZL,defaultChildLoggerFactory:Q0,createLogger:eq,validateLogger:ma,now:tq}});var ga=E((PK,eS)=>{"use strict";eS.exports=rq;function rs(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function rq(t){if(t=t||{},t.circles)return nq(t);let e=new Map;if(e.set(Date,o=>new Date(o)),e.set(Map,(o,a)=>new Map(n(Array.from(o),a))),e.set(Set,(o,a)=>new Set(n(Array.from(o),a))),t.constructorHandlers)for(let o of t.constructorHandlers)e.set(o[0],o[1]);let r=null;return t.proto?i:s;function n(o,a){let l=Object.keys(o),u=new Array(l.length);for(let c=0;c<l.length;c++){let f=l[c],p=o[f];typeof p!="object"||p===null?u[f]=p:p.constructor!==Object&&(r=e.get(p.constructor))?u[f]=r(p,a):ArrayBuffer.isView(p)?u[f]=rs(p):u[f]=a(p)}return u}function s(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,s);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,s);let a={};for(let l in o){if(Object.hasOwnProperty.call(o,l)===!1)continue;let u=o[l];typeof u!="object"||u===null?a[l]=u:u.constructor!==Object&&(r=e.get(u.constructor))?a[l]=r(u,s):ArrayBuffer.isView(u)?a[l]=rs(u):a[l]=s(u)}return a}function i(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,i);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,i);let a={};for(let l in o){let u=o[l];typeof u!="object"||u===null?a[l]=u:u.constructor!==Object&&(r=e.get(u.constructor))?a[l]=r(u,i):ArrayBuffer.isView(u)?a[l]=rs(u):a[l]=i(u)}return a}}function nq(t){let e=[],r=[],n=new Map;if(n.set(Date,l=>new Date(l)),n.set(Map,(l,u)=>new Map(i(Array.from(l),u))),n.set(Set,(l,u)=>new Set(i(Array.from(l),u))),t.constructorHandlers)for(let l of t.constructorHandlers)n.set(l[0],l[1]);let s=null;return t.proto?a:o;function i(l,u){let c=Object.keys(l),f=new Array(c.length);for(let p=0;p<c.length;p++){let h=c[p],d=l[h];if(typeof d!="object"||d===null)f[h]=d;else if(d.constructor!==Object&&(s=n.get(d.constructor)))f[h]=s(d,u);else if(ArrayBuffer.isView(d))f[h]=rs(d);else{let m=e.indexOf(d);m!==-1?f[h]=r[m]:f[h]=u(d)}}return f}function o(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return i(l,o);if(l.constructor!==Object&&(s=n.get(l.constructor)))return s(l,o);let u={};e.push(l),r.push(u);for(let c in l){if(Object.hasOwnProperty.call(l,c)===!1)continue;let f=l[c];if(typeof f!="object"||f===null)u[c]=f;else if(f.constructor!==Object&&(s=n.get(f.constructor)))u[c]=s(f,o);else if(ArrayBuffer.isView(f))u[c]=rs(f);else{let p=e.indexOf(f);p!==-1?u[c]=r[p]:u[c]=o(f)}}return e.pop(),r.pop(),u}function a(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return i(l,a);if(l.constructor!==Object&&(s=n.get(l.constructor)))return s(l,a);let u={};e.push(l),r.push(u);for(let c in l){let f=l[c];if(typeof f!="object"||f===null)u[c]=f;else if(f.constructor!==Object&&(s=n.get(f.constructor)))u[c]=s(f,a);else if(ArrayBuffer.isView(f))u[c]=rs(f);else{let p=e.indexOf(f);p!==-1?u[c]=r[p]:u[c]=a(f)}}return e.pop(),r.pop(),u}}});var li=E((AK,iS)=>{"use strict";var sq=ga()({circles:!1,proto:!0}),{kSchemaVisited:tS,kSchemaResponse:iq}=De(),hf=Symbol.for("fluent-schema-object"),{FST_ERR_SCH_MISSING_ID:oq,FST_ERR_SCH_ALREADY_PRESENT:aq,FST_ERR_SCH_DUPLICATE:lq,FST_ERR_SCH_CONTENT_MISSING_SCHEMA:rS}=He(),sS=["params","body","querystring","query","headers"];function ya(t){this.store=t||{}}ya.prototype.add=function(t){let e=sq(t.isFluentSchema||t.isFluentJSONSchema||t[hf]?t.valueOf():t),r=e.$id;if(!r)throw new oq;if(this.store[r])throw new aq(r);this.store[r]=e};ya.prototype.getSchemas=function(){return Object.assign({},this.store)};ya.prototype.getSchema=function(t){return this.store[t]};function nS(t){return typeof t=="object"&&Object.getPrototypeOf(t)!==Object.prototype}function uq(t,e){if(t[tS])return t;if(t.query){if(t.querystring)throw new lq("querystring");t.querystring=t.query}cq(t);for(let r of sS){let n=t[r];if(n&&!nS(n)&&r==="body"&&n.content){let s=n.content,i=Object.keys(s);for(let o=0;o<i.length;o++){let a=i[o];if(!s[a].schema)throw new rS(a)}continue}}if(t.response){let r=Object.keys(t.response);for(let n of r){if(nS(t.response[n]))continue;let s=t.response[n].content;if(s){let i=Object.keys(s);for(let o=0;o<i.length;o++){let a=i[o];if(!s[a].schema)throw new rS(a)}}}}return t[tS]=!0,t}function cq(t){for(let e of sS)t[e]&&(t[e].isFluentSchema||t[e][hf])&&(t[e]=t[e].valueOf());if(t.response){let e=Object.keys(t.response);for(let r of e)(t.response[r].isFluentSchema||t.response[r][hf])&&(t.response[r]=t.response[r].valueOf())}}function fq(t,e,r){let n=t[iq];if(!n)return!1;if(n[e]){if(n[e].constructor===Object&&r){let i=r.split(";",1)[0];return n[e][i]?n[e][i]:n[e]["*/*"]?n[e]["*/*"]:!1}return n[e]}let s=(e+"")[0]+"xx";if(n[s]){if(n[s].constructor===Object&&r){let i=r.split(";",1)[0];return n[s][i]?n[s][i]:n[s]["*/*"]?n[s]["*/*"]:!1}return n[s]}if(n.default){if(n.default.constructor===Object&&r){let i=r.split(";",1)[0];return n.default[i]?n.default[i]:n.default["*/*"]?n.default["*/*"]:!1}return n.default}return!1}iS.exports={buildSchemas(t){return new ya(t)},getSchemaSerializer:fq,normalizeSchema:uq}});var _a=E((CK,aS)=>{"use strict";var dq=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;aS.exports=class oS{constructor(e){switch(e&&e.rounding){case"floor":this.parseInteger=Math.floor;break;case"ceil":this.parseInteger=Math.ceil;break;case"round":this.parseInteger=Math.round;break;case"trunc":default:this.parseInteger=Math.trunc;break}this._options=e}asInteger(e){if(Number.isInteger(e))return""+e;if(typeof e=="bigint")return e.toString();let r=this.parseInteger(e);if(r===1/0||r===-1/0||r!==r)throw new Error(`The value "${e}" cannot be converted to an integer.`);return""+r}asNumber(e){let r=Number(e);if(r!==r)throw new Error(`The value "${e}" cannot be converted to a number.`);return r===1/0||r===-1/0?"null":""+r}asBoolean(e){return e&&"true"||"false"}asDateTime(e){if(e===null)return'""';if(e instanceof Date)return'"'+e.toISOString()+'"';if(typeof e=="string")return'"'+e+'"';throw new Error(`The value "${e}" cannot be converted to a date-time.`)}asDate(e){if(e===null)return'""';if(e instanceof Date)return'"'+new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,10)+'"';if(typeof e=="string")return'"'+e+'"';throw new Error(`The value "${e}" cannot be converted to a date.`)}asTime(e){if(e===null)return'""';if(e instanceof Date)return'"'+new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(11,19)+'"';if(typeof e=="string")return'"'+e+'"';throw new Error(`The value "${e}" cannot be converted to a time.`)}asString(e){let r=e.length;if(r===0)return'""';if(r<42){let n="",s=-1,i=255;for(let o=0;o<r;o++)if(i=e.charCodeAt(o),i===34||i===92)s===-1&&(s=0),n+=e.slice(s,o)+"\\",s=o;else if(i<32||i>=55296&&i<=57343)return JSON.stringify(e);return s===-1&&'"'+e+'"'||'"'+n+e.slice(s)+'"'}else return r<5e3&&dq.test(e)===!1?'"'+e+'"':JSON.stringify(e)}asUnsafeString(e){return'"'+e+'"'}getState(){return this._options}static restoreFromState(e){return new oS(e)}}});var uS=E((IK,lS)=>{"use strict";var hq=_a(),pq={mode:"standalone"},mq=hq.restoreFromState(pq),gq=null;lS.exports=function(e,r){let{asString:n,asNumber:s,asBoolean:i,asDateTime:o,asDate:a,asTime:l,asUnsafeString:u}=r,c=r.asInteger.bind(r),f="{",p="}",h="[",d="]",m=",",g=":",S='"',b=f+p,_=h+d,y=S+S,R="null";function T(w){let $=w&&typeof w.toJSON=="function"?w.toJSON():w;if($===null)return b;let v,P=f,C=!1;return v=$.statusCode,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"statusCode":',P+=s(v)),v=$.code,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"code":',typeof v!="string"?v===null?P+=y:v instanceof Date?P+=S+v.toISOString()+S:v instanceof RegExp?P+=n(v.source):P+=n(v.toString()):P+=n(v)),v=$.error,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"error":',typeof v!="string"?v===null?P+=y:v instanceof Date?P+=S+v.toISOString()+S:v instanceof RegExp?P+=n(v.source):P+=n(v.toString()):P+=n(v)),v=$.message,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"message":',typeof v!="string"?v===null?P+=y:v instanceof Date?P+=S+v.toISOString()+S:v instanceof RegExp?P+=n(v.source):P+=n(v.toString()):P+=n(v)),P+p}return T}(gq,mq)});var ui=E((NK,hS)=>{"use strict";var cS=V("node:http").STATUS_CODES,yq=dc(),{setErrorStatusCode:_q}=Uo(),{kReplyHeaders:_n,kReplyNextErrorHandler:Sa,kReplyIsRunningOnErrorHook:Sq,kRouteContext:dS,kDisableRequestLogging:Ea}=De(),{FST_ERR_REP_INVALID_PAYLOAD_TYPE:Eq,FST_ERR_FAILED_ERROR_SERIALIZATION:bq}=He(),{getSchemaSerializer:vq}=li(),pf=uS(),wq={func:Oq,toJSON(){return this.func.name.toString()+"()"}};function Rq(t,e,r){t[Sq]=!1;let n=t[dS];if(t[Sa]===!1){fS(e,t,function(o,a){try{o.raw.writeHead(o.raw.statusCode,o[_n])}catch(l){o.log[Ea]||o.log.warn({req:o.request,res:o,err:l},l?.message),o.raw.writeHead(o.raw.statusCode)}o.raw.end(a)});return}let s=t[Sa]||n.errorHandler;t[Sa]=Object.getPrototypeOf(s),delete t[_n]["content-type"],delete t[_n]["content-length"];let i=s.func;if(!i){t[Sa]=!1,fS(e,t,r);return}try{let o=i(e,t.request,t);o!==void 0&&(o!==null&&typeof o.then=="function"?yq(o,t):t.send(o))}catch(o){t.send(o)}}function Oq(t,e,r){$q(t,r),_q(r,t),r.statusCode<500?r.log[Ea]||r.log.info({res:r,err:t},t?.message):r.log[Ea]||r.log.error({req:e,res:r,err:t},t?.message),r.send(t)}function fS(t,e,r){let n=e.raw,s=e.statusCode;e[_n]["content-type"]=e[_n]["content-type"]??"application/json; charset=utf-8";let i;try{let o=vq(e[dS],s,e[_n]["content-type"]);o===!1?i=pf({error:cS[s+""],code:t.code,message:t.message,statusCode:s}):i=o(Object.create(t,{error:{value:cS[s+""]},message:{value:t.message},statusCode:{value:s}}))}catch(o){e.log[Ea]||e.log.error({err:o,statusCode:n.statusCode},"The serializer for the given status code failed"),e.code(500),i=pf(new bq(o.message,t.message))}typeof i!="string"&&!Buffer.isBuffer(i)&&(i=pf(new Eq(typeof i))),e[_n]["content-length"]=""+Buffer.byteLength(i),r(e,i)}function Tq(t=wq,e){if(!e)return t;let r=Object.create(t);return r.func=e,r}function $q(t,e){let r=e.raw,n=r.statusCode;n=n>=400?n:500,t!=null&&(t.headers!==void 0&&e.headers(t.headers),t.status>=400?n=t.status:t.statusCode>=400&&(n=t.statusCode)),r.statusCode=n}hS.exports={buildErrorHandler:Tq,handleError:Rq}});var di=E((kK,yS)=>{"use strict";var{kReply:mf,kRequest:gf,kState:Pq,kHasBeenDecorated:Aq}=De(),{FST_ERR_DEC_ALREADY_PRESENT:pS,FST_ERR_DEC_MISSING_DEPENDENCY:Cq,FST_ERR_DEC_AFTER_START:Iq,FST_ERR_DEC_REFERENCE_TYPE:Nq,FST_ERR_DEC_DEPENDENCY_INVALID_TYPE:kq,FST_ERR_DEC_UNDECLARED:xq}=He();function Lq(t,e,r,n){if(Object.hasOwn(t,e))throw new pS(e);yf(t,e,n),r&&(typeof r.getter=="function"||typeof r.setter=="function")?Object.defineProperty(t,e,{get:r.getter,set:r.setter}):t[e]=r}function qq(t){if(!ci(this,t))throw new xq(t,"instance");return typeof this[t]=="function"?this[t].bind(this):this[t]}function mS(t,e,r,n){let s=t.prototype;if(Object.hasOwn(s,e)||fi(t,e))throw new pS(e);t[Aq]=!0,yf(t,e,n),r&&(typeof r.getter=="function"||typeof r.setter=="function")?Object.defineProperty(s,e,{get:r.getter,set:r.setter}):typeof r=="function"?s[e]=r:t.props.push({key:e,value:r})}function gS(t,e){if(typeof e=="object"&&e&&!(typeof e.getter=="function"||typeof e.setter=="function"))throw new Nq(t,typeof e)}function jq(t,e,r){return _f(this,t),Lq(this,t,e,r),this}function ci(t,e){return e?e in t||t.prototype&&e in t.prototype||fi(t,e):t in this}function fi(t,e){return t.props?t.props.find(({key:r})=>r===e):!1}function Dq(t){return t&&fi(this[gf],t)?!0:ci(this[gf].prototype,t)}function Fq(t){return t&&fi(this[mf],t)?!0:ci(this[mf].prototype,t)}function yf(t,e,r){if(r!=null){if(!Array.isArray(r))throw new kq(e);for(let n=0;n!==r.length;++n)if(!ci(t,r[n]))throw new Cq(r[n])}}function Mq(t,e,r){return _f(this,t),gS(t,e),mS(this[mf],t,e,r),this}function Hq(t,e,r){return _f(this,t),gS(t,e),mS(this[gf],t,e,r),this}function _f(t,e){if(t[Pq].started)throw new Iq(e)}yS.exports={add:jq,exist:ci,existRequest:Dq,existReply:Fq,dependencies:yf,decorateReply:Mq,decorateRequest:Hq,getInstanceDecorator:qq,hasKey:fi}});var Pa=E((xK,$a)=>{"use strict";var ba=V("node:stream").finished,{kFourOhFourContext:_S,kReplyErrorHandlerCalled:OS,kReplyHijacked:wf,kReplyStartTime:pi,kReplyEndTime:Rf,kReplySerializer:Sr,kReplySerializerDefault:va,kReplyIsError:wa,kReplyHeaders:ge,kReplyTrailers:Ve,kReplyHasStatusCode:Of,kReplyIsRunningOnErrorHook:Tf,kReplyNextErrorHandler:Vq,kDisableRequestLogging:TS,kSchemaResponse:Ra,kReplyCacheSerializeFns:Vr,kSchemaController:Sf,kOptions:zq,kRouteContext:ne}=De(),{onSendHookRunner:$S,onResponseHookRunner:Uq,preHandlerHookRunner:Bq,preSerializationHookRunner:Gq}=Fr(),SS=Sc()[Symbol.for("internals")],Wq=ai(),vf=Wq.now,{handleError:ES}=ui(),{getSchemaSerializer:Jq}=li(),Ef={JSON:"application/json; charset=utf-8",PLAIN:"text/plain; charset=utf-8",OCTET:"application/octet-stream"},{FST_ERR_REP_INVALID_PAYLOAD_TYPE:Kq,FST_ERR_REP_RESPONSE_BODY_CONSUMED:Yq,FST_ERR_REP_READABLE_STREAM_LOCKED:Xq,FST_ERR_REP_ALREADY_SENT:Qq,FST_ERR_SEND_INSIDE_ONERR:Zq,FST_ERR_BAD_STATUS_CODE:ej,FST_ERR_BAD_TRAILER_NAME:tj,FST_ERR_BAD_TRAILER_VALUE:rj,FST_ERR_MISSING_SERIALIZATION_FN:nj,FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN:sj,FST_ERR_DEC_UNDECLARED:ij}=He(),bS=di(),PS=Object.prototype.toString;function ye(t,e,r){this.raw=t,this[Sr]=null,this[OS]=!1,this[wa]=!1,this[Tf]=!1,this.request=e,this[ge]={},this[Ve]=null,this[Of]=!1,this[pi]=void 0,this.log=r}ye.props=[];Object.defineProperties(ye.prototype,{[ne]:{get(){return this.request[ne]}},elapsedTime:{get(){return this[pi]===void 0?0:(this[Rf]||vf())-this[pi]}},server:{get(){return this.request[ne].server}},sent:{enumerable:!0,get(){return(this[wf]||this.raw.writableEnded)===!0}},statusCode:{get(){return this.raw.statusCode},set(t){this.code(t)}},routeOptions:{get(){return this.request.routeOptions}}});ye.prototype.writeEarlyHints=function(t,e){return this.raw.writeEarlyHints(t,e),this};ye.prototype.hijack=function(){return this[wf]=!0,this};ye.prototype.send=function(t){if(this[Tf])throw new Zq;if(this.sent===!0)return this.log.warn({err:new Qq(this.request.url,this.request.method)}),this;if(this[wa]||t instanceof Error)return this[wa]=!1,ns(this,t,Sn),this;if(t===void 0)return Sn(this,t),this;let e=this.getHeader("content-type"),r=e!==void 0;if(t!==null){if(typeof t.pipe=="function"||typeof t.getReader=="function"||PS.call(t)==="[object Response]")return Sn(this,t),this;if(t.buffer instanceof ArrayBuffer){r||(this[ge]["content-type"]=Ef.OCTET);let n=Buffer.isBuffer(t)?t:Buffer.from(t.buffer,t.byteOffset,t.byteLength);return Sn(this,n),this}if(!r&&typeof t=="string")return this[ge]["content-type"]=Ef.PLAIN,Sn(this,t),this}if(this[Sr]!==null){if(typeof t!="string")return vS(this,t),this;t=this[Sr](t)}else if(!r||e.indexOf("json")!==-1){if(!r)this[ge]["content-type"]=Ef.JSON;else if(e.indexOf("charset")===-1){let n=e.trim();n.endsWith(";")?this[ge]["content-type"]=`${n} charset=utf-8`:this[ge]["content-type"]=`${n}; charset=utf-8`}if(typeof t!="string")return vS(this,t),this}return Sn(this,t),this};ye.prototype.getHeader=function(t){t=t.toLowerCase();let e=this[ge][t];return e!==void 0?e:this.raw.getHeader(t)};ye.prototype.getHeaders=function(){return{...this.raw.getHeaders(),...this[ge]}};ye.prototype.hasHeader=function(t){return t=t.toLowerCase(),this[ge][t]!==void 0||this.raw.hasHeader(t)};ye.prototype.removeHeader=function(t){return delete this[ge][t.toLowerCase()],this};ye.prototype.header=function(t,e=""){return t=t.toLowerCase(),this[ge][t]&&t==="set-cookie"?(typeof this[ge][t]=="string"&&(this[ge][t]=[this[ge][t]]),Array.isArray(e)?Array.prototype.push.apply(this[ge][t],e):this[ge][t].push(e)):this[ge][t]=e,this};ye.prototype.headers=function(t){let e=Object.keys(t);for(let r=0;r!==e.length;++r){let n=e[r];this.header(n,t[n])}return this};var oj=new Set(["transfer-encoding","content-length","host","cache-control","max-forwards","te","authorization","set-cookie","content-encoding","content-type","content-range","trailer"]);ye.prototype.trailer=function(t,e){if(t=t.toLowerCase(),oj.has(t))throw new tj(t);if(typeof e!="function")throw new rj(t,typeof e);return this[Ve]===null&&(this[Ve]={}),this[Ve][t]=e,this};ye.prototype.hasTrailer=function(t){return this[Ve]?.[t.toLowerCase()]!==void 0};ye.prototype.removeTrailer=function(t){return this[Ve]===null?this:(this[Ve][t.toLowerCase()]=void 0,this)};ye.prototype.code=function(t){let e=+t;if(!(e>=100&&e<=599))throw new ej(t||String(t));return this.raw.statusCode=e,this[Of]=!0,this};ye.prototype.status=ye.prototype.code;ye.prototype.getSerializationFunction=function(t,e){let r;return typeof t=="string"||typeof t=="number"?typeof e=="string"?r=this[ne][Ra]?.[t]?.[e]:r=this[ne][Ra]?.[t]:typeof t=="object"&&(r=this[ne][Vr]?.get(t)),r};ye.prototype.compileSerializationSchema=function(t,e=null,r=null){let{request:n}=this,{method:s,url:i}=n;if(this[ne][Vr]?.has(t))return this[ne][Vr].get(t);let a=(this[ne].serializerCompiler||this.server[Sf].serializerCompiler||this.server[Sf].setupSerializer(this.server[zq])||this.server[Sf].serializerCompiler)({schema:t,method:s,url:i,httpStatus:e,contentType:r});return this[ne][Vr]==null&&(this[ne][Vr]=new WeakMap),this[ne][Vr].set(t,a),a};ye.prototype.serializeInput=function(t,e,r,n){let s=r,i;if(r=typeof e=="string"||typeof e=="number"?e:r,n=r&&s!==r?s:n,r!=null){if(n!=null?i=this[ne][Ra]?.[r]?.[n]:i=this[ne][Ra]?.[r],i==null)throw n?new sj(r,n):new nj(r)}else this[ne][Vr]?.has(e)?i=this[ne][Vr].get(e):i=this.compileSerializationSchema(e,r,n);return i(t)};ye.prototype.serialize=function(t){return this[Sr]!==null?this[Sr](t):this[ne]&&this[ne][va]?this[ne][va](t,this.raw.statusCode):CS(this[ne],t,this.raw.statusCode)};ye.prototype.serializer=function(t){return this[Sr]=t,this};ye.prototype.type=function(t){return this[ge]["content-type"]=t,this};ye.prototype.redirect=function(t,e){return e||(e=this[Of]?this.raw.statusCode:302),this.header("location",t).code(e).send()};ye.prototype.callNotFound=function(){return pj(this),this};ye.prototype.then=function(t,e){if(this.sent){t();return}ba(this.raw,r=>{r&&r.code!=="ERR_STREAM_PREMATURE_CLOSE"?e?e(r):this.log&&this.log.warn("unhandled rejection on reply.then"):t()})};ye.prototype.getDecorator=function(t){if(!bS.hasKey(this,t)&&!bS.exist(this,t))throw new ij(t,"reply");let e=this[t];return typeof e=="function"?e.bind(this):e};function vS(t,e){t[ne].preSerialization!==null?Gq(t[ne].preSerialization,t.request,t,e,wS):wS(null,void 0,t,e)}function wS(t,e,r,n){if(t!=null){ns(r,t);return}try{r[Sr]!==null?n=r[Sr](n):r[ne]&&r[ne][va]?n=r[ne][va](n,r.raw.statusCode):n=CS(r[ne],n,r.raw.statusCode,r[ge]["content-type"])}catch(s){aj(s,r),ns(r,s);return}Sn(r,n)}function aj(t,e){t.serialization=e[ne].config}function Sn(t,e){t[ne].onSend!==null?$S(t[ne].onSend,t.request,t,e,lj):AS(t,e)}function lj(t,e,r,n){t!=null?ns(r,t):AS(r,n)}function bf(t,e){let r=t.raw;try{r.writeHead(e,t[ge])}catch(n){throw n.code==="ERR_HTTP_HEADERS_SENT"&&t.log.warn(`Reply was already sent, did you forget to "return reply" in the "${t.request.raw.url}" (${t.request.raw.method}) route?`),n}}function AS(t,e){let r=t.raw,n=t.request;if(t[Ve]!==null){let i=Object.keys(t[Ve]),o="";for(let a of i)typeof t[Ve][a]=="function"&&(o+=" ",o+=a);t.header("Transfer-Encoding","chunked"),t.header("Trailer",o.trim())}if(PS.call(e)==="[object Response]"){if(typeof e.status=="number"&&t.code(e.status),typeof e.headers=="object"&&typeof e.headers.forEach=="function")for(let[i,o]of e.headers)t.header(i,o);if(e.body!==null&&e.bodyUsed)throw new Yq;e=e.body}let s=r.statusCode;if(e==null){s>=200&&s!==204&&s!==304&&n.method!=="HEAD"&&t[Ve]===null&&(t[ge]["content-length"]="0"),bf(t,s),hi(e,r,t);return}if(s>=100&&s<200||s===204){t.removeHeader("content-type"),t.removeHeader("content-length"),bf(t,s),hi(void 0,r,t),typeof e.resume=="function"&&(e.on("error",Ta),e.resume());return}if(typeof e.pipe=="function"){cj(e,r,t);return}if(typeof e.getReader=="function"){uj(e,r,t);return}if(typeof e!="string"&&!Buffer.isBuffer(e))throw new Kq(typeof e);if(t[Ve]===null){let i=t[ge]["content-length"];(!i||n.raw.method!=="HEAD"&&Number(i)!==Buffer.byteLength(e))&&(t[ge]["content-length"]=""+Buffer.byteLength(e))}bf(t,s),r.write(e),hi(e,r,t)}function Oa(t,e,r){e.code==="ERR_STREAM_PREMATURE_CLOSE"?t[TS]||t.info({res:r},"stream closed prematurely"):t.warn({err:e},"response terminated with an error with headers already sent")}function uj(t,e,r){if(t.locked)throw new Xq;let n=!0,s=!1,i=t.getReader();if(ba(e,function(l){n&&(l!=null&&e.headersSent&&!s&&(s=!0,Oa(r.log,l,e)),i.cancel().catch(Ta))}),e.headersSent)r.log.warn("response will send, but you shouldn't use res.writeHead in stream mode");else for(let l in r[ge])e.setHeader(l,r[ge][l]);function o(l){if(l.done){n=!1,hi(null,e,r);return}if(e.destroyed){n=!1,i.cancel().catch(Ta);return}e.write(l.value),i.read().then(o,a)}function a(l){n=!1,e.headersSent||r.request.raw.aborted===!0?(s||(s=!0,Oa(r.log,l,r)),e.destroy()):ns(r,l)}i.read().then(o,a)}function cj(t,e,r){let n=!0,s=!1;if(fj(t,e,r),ba(t,{readable:!0,writable:!1},function(i){n=!1,i!=null&&(e.headersSent||r.request.raw.aborted===!0?(s||(s=!0,Oa(r.log,i,r)),e.destroy()):ns(r,i))}),ba(e,function(i){n&&(i!=null&&e.headersSent&&!s&&(s=!0,Oa(r.log,i,e)),typeof t.destroy=="function"?t.destroy():typeof t.close=="function"?t.close(Ta):typeof t.abort=="function"?t.abort():r.log.warn("stream payload does not end properly"))}),e.headersSent)r.log.warn("response will send, but you shouldn't use res.writeHead in stream mode");else for(let i in r[ge])e.setHeader(i,r[ge][i]);t.pipe(e)}function hi(t,e,r){if(r[Ve]===null){e.end(null,null,null);return}let n=Object.keys(r[Ve]),s={},i=0,o=!0;function a(){i===0&&(e.addTrailers(s),e.end(null,null,null))}for(let l of n){let u=function(f,p){i++,f?r.log.debug(f):s[l]=p,process.nextTick(a)};if(typeof r[Ve][l]!="function")continue;o=!1,i--;let c=r[Ve][l](r,t,u);typeof c=="object"&&typeof c.then=="function"&&c.then(f=>u(null,f),u)}o&&e.end(null,null,null)}function fj(t,e,r){r[Ve]!==null&&t.on("end",()=>hi(null,e,r))}function ns(t,e,r){t[ne].onError!==null&&!t[Vq]?(t[Tf]=!0,$S(t[ne].onError,t.request,t,e,()=>ES(t,e,r))):ES(t,e,r)}function dj(t){t[pi]=vf();let e=r=>{t[Rf]=vf(),t.raw.removeListener("finish",e),t.raw.removeListener("error",e);let n=t[ne];n&&n.onResponse!==null?Uq(n.onResponse,t.request,t,RS):RS(r,t.request,t)};t.raw.on("finish",e),t.raw.on("error",e)}function RS(t,e,r){if(r.log[TS])return;let n=r.elapsedTime;if(t!=null){r.log.error({res:r,err:t,responseTime:n},"request errored");return}r.log.info({res:r,responseTime:n},"request completed")}function hj(t){let e=t.props.slice();function r(n,s,i){this.raw=n,this[wa]=!1,this[OS]=!1,this[wf]=!1,this[Sr]=null,this.request=s,this[ge]={},this[Ve]=null,this[pi]=void 0,this[Rf]=void 0,this.log=i;let o;for(let a=0;a<e.length;a++)o=e[a],this[o.key]=o.value}return Object.setPrototypeOf(r.prototype,t.prototype),Object.setPrototypeOf(r,t),r.parent=t,r.props=e,r}function pj(t){if(t[ne][_S]===null){t.log.warn("Trying to send a NotFound error inside a 404 handler. Sending basic 404 response."),t.code(404).send("404 Not Found");return}t.request[ne]=t[ne][_S],t[ne].preHandler!==null?Bq(t[ne].preHandler,t.request,t,SS.preHandlerCallback):SS.preHandlerCallback(null,t.request,t)}function CS(t,e,r,n){let s=Jq(t,r,n);return s?s(e):JSON.stringify(e)}function Ta(){}$a.exports=ye;$a.exports.buildReply=hj;$a.exports.setupResponseListeners=dj});var IS=E((LK,Aa)=>{"use strict";function $f(t){if(!t)throw new TypeError("argument req is required");let e=t.headers["x-forwarded-for"],r=t.socket.remoteAddress;if(!e||typeof e!="string")return[r];if(e.indexOf(",")===-1){let n=e.trim();return n.length?[r,n]:[r]}else return mj(e,r)}function mj(t,e){let r=[e],n=t.length,s=n,i,o;for(o=n-1;o>=0;--o)i=t[o],i===" "?s===n&&(s=n=o):i===","?(s!==n&&r.push(t.slice(s,n)),s=n=o):s=o;return s!==n&&r.push(t.substring(s,n)),r}Aa.exports=$f;Aa.exports.default=$f;Aa.exports.forwarded=$f});var kS=E((NS,Ca)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),i="%[0-9a-z]{1,}",o="(?:[0-9a-f]+::?)+",a={zoneIndex:new RegExp(i,"i"),native:new RegExp(`^(::)?(${o})?([0-9a-f]+)?(::)?(${i})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${i})?)$`,"i"),transitional:new RegExp(`^((?:${o})|(?:::)(?:${o})?)${e}\\.${e}\\.${e}\\.${e}(${i})?$`,"i")};function l(h,d){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let m=0,g=-1,S=(h.match(a.zoneIndex)||[])[0],b,_;for(S&&(S=S.substring(1),h=h.replace(/%.+$/,""));(g=h.indexOf(":",g+1))>=0;)m++;if(h.substr(0,2)==="::"&&m--,h.substr(-2,2)==="::"&&m--,m>d)return null;for(_=d-m,b=":";_--;)b+="0:";return h=h.replace("::",b),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),d=function(){let y=h.split(":"),R=[];for(let T=0;T<y.length;T++)R.push(parseInt(y[T],16));return R}(),{parts:d,zoneId:S}}function u(h,d,m,g){if(h.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let S=0,b;for(;g>0;){if(b=m-g,b<0&&(b=0),h[S]>>b!==d[S]>>b)return!1;g-=m,S+=1}return!0}function c(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(n.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function f(h,d){for(;h.length<d;)h=`0${h}`;return h}let p={};p.IPv4=function(){function h(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let m,g;for(m=0;m<d.length;m++)if(g=d[m],!(0<=g&&g<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]],as112:[[new h([192,175,48,0]),24],[new h([192,31,196,0]),24]],amt:[[new h([192,52,193,0]),24]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(d,m){let g;if(m===void 0&&(g=d,d=g[0],m=g[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return u(this.octets,d.octets,8,m)},h.prototype.prefixLengthFromSubnetMask=function(){let d=0,m=!1,g={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},S,b,_;for(S=3;S>=0;S-=1)if(b=this.octets[S],b in g){if(_=g[b],m&&_!==0)return null;_!==8&&(m=!0),d+=_}else return null;return 32-d},h.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),p.IPv4.broadcastAddressFromCIDR=function(h){try{let d=this.parseCIDR(h),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],b=0;for(;b<4;)S.push(parseInt(m[b],10)|parseInt(g[b],10)^255),b++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},p.IPv4.isIPv4=function(h){return this.parser(h)!==null},p.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(h){try{return this.parseCIDR(h),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(h){return!!(p.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(h){let d=h.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(h)||!d?!1:p.IPv4.isValidFourPartDecimal(d[1])},p.IPv4.networkAddressFromCIDR=function(h){let d,m,g,S,b;try{for(d=this.parseCIDR(h),g=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],m=0;m<4;)S.push(parseInt(g[m],10)&parseInt(b[m],10)),m++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},p.IPv4.parse=function(h){let d=this.parser(h);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},p.IPv4.parseCIDR=function(h){let d;if(d=h.match(/^(.+)\/(\d+)$/)){let m=parseInt(d[2]);if(m>=0&&m<=32){let g=[this.parse(d[1]),m];return Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},p.IPv4.parser=function(h){let d,m,g;if(d=h.match(r.fourOctet))return function(){let S=d.slice(1,6),b=[];for(let _=0;_<S.length;_++)m=S[_],b.push(c(m));return b}();if(d=h.match(r.longValue)){if(g=c(d[1]),g>4294967295||g<0)throw new Error("ipaddr: address outside defined range");return function(){let S=[],b;for(b=0;b<=24;b+=8)S.push(g>>b&255);return S}().reverse()}else return(d=h.match(r.twoOctet))?function(){let S=d.slice(1,4),b=[];if(g=c(S[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return b.push(c(S[0])),b.push(g>>16&255),b.push(g>>8&255),b.push(g&255),b}():(d=h.match(r.threeOctet))?function(){let S=d.slice(1,5),b=[];if(g=c(S[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return b.push(c(S[0])),b.push(c(S[1])),b.push(g>>8&255),b.push(g&255),b}():null},p.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],m=0,g=Math.floor(h/8);for(;m<g;)d[m]=255,m++;return g<4&&(d[g]=Math.pow(2,h%8)-1<<8-h%8),new this(d)},p.IPv6=function(){function h(d,m){let g,S;if(d.length===16)for(this.parts=[],g=0;g<=14;g+=2)this.parts.push(d[g]<<8|d[g+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(g=0;g<this.parts.length;g++)if(S=this.parts[g],!(0<=S&&S<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");m&&(this.zoneId=m)}return h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],discard:[new h([256,0,0,0,0,0,0,0]),64],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[[new h([8193,4,274,0,0,0,0,0]),48],[new h([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new h([8193,48,0,0,0,0,0,0]),28],reserved:[[new h([8193,0,0,0,0,0,0,0]),23],[new h([8193,3512,0,0,0,0,0,0]),32]]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(d,m){let g;if(m===void 0&&(g=d,d=g[0],m=g[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return u(this.parts,d.parts,16,m)},h.prototype.prefixLengthFromSubnetMask=function(){let d=0,m=!1,g={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},S,b;for(let _=7;_>=0;_-=1)if(S=this.parts[_],S in g){if(b=g[S],m&&b!==0)return null;b!==16&&(m=!0),d+=b}else return null;return 128-d},h.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let d,m=[],g=this.parts;for(let S=0;S<g.length;S++)d=g[S],m.push(d>>8),m.push(d&255);return m},h.prototype.toFixedLengthString=function(){let d=function(){let g=[];for(let S=0;S<this.parts.length;S++)g.push(f(this.parts[S].toString(16),4));return g}.call(this).join(":"),m="";return this.zoneId&&(m=`%${this.zoneId}`),d+m},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),m=d[0],g=d[1];return new p.IPv4([m>>8,m&255,g>>8,g&255])},h.prototype.toNormalizedString=function(){let d=function(){let g=[];for(let S=0;S<this.parts.length;S++)g.push(this.parts[S].toString(16));return g}.call(this).join(":"),m="";return this.zoneId&&(m=`%${this.zoneId}`),d+m},h.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,m=this.toNormalizedString(),g=0,S=-1,b;for(;b=d.exec(m);)b[0].length>S&&(g=b.index,S=b[0].length);return S<0?m:`${m.substring(0,g)}::${m.substring(g+S)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),p.IPv6.broadcastAddressFromCIDR=function(h){try{let d=this.parseCIDR(h),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],b=0;for(;b<16;)S.push(parseInt(m[b],10)|parseInt(g[b],10)^255),b++;return new this(S)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},p.IPv6.isIPv6=function(h){return this.parser(h)!==null},p.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{let d=this.parser(h);return new this(d.parts,d.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{return this.parseCIDR(h),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(h){let d,m,g,S,b;try{for(d=this.parseCIDR(h),g=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],m=0;m<16;)S.push(parseInt(g[m],10)&parseInt(b[m],10)),m++;return new this(S)}catch(_){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${_})`)}},p.IPv6.parse=function(h){let d=this.parser(h);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},p.IPv6.parseCIDR=function(h){let d,m,g;if((m=h.match(/^(.+)\/(\d+)$/))&&(d=parseInt(m[2]),d>=0&&d<=128))return g=[this.parse(m[1]),d],Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},p.IPv6.parser=function(h){let d,m,g,S,b,_;if(g=h.match(a.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(a.native.test(h))return l(h,8);if((g=h.match(a.transitional))&&(_=g[6]||"",d=g[1],g[1].endsWith("::")||(d=d.slice(0,-1)),d=l(d+_,6),d.parts)){for(b=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],m=0;m<b.length;m++)if(S=b[m],!(0<=S&&S<=255))return null;return d.parts.push(b[0]<<8|b[1]),d.parts.push(b[2]<<8|b[3]),{parts:d.parts,zoneId:d.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=0,g=Math.floor(h/8);for(;m<g;)d[m]=255,m++;return g<16&&(d[g]=Math.pow(2,h%8)-1<<8-h%8),new this(d)},p.fromByteArray=function(h){let d=h.length;if(d===4)return new p.IPv4(h);if(d===16)return new p.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},p.isValid=function(h){return p.IPv6.isValid(h)||p.IPv4.isValid(h)},p.isValidCIDR=function(h){return p.IPv6.isValidCIDR(h)||p.IPv4.isValidCIDR(h)},p.parse=function(h){if(p.IPv6.isValid(h))return p.IPv6.parse(h);if(p.IPv4.isValid(h))return p.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},p.parseCIDR=function(h){try{return p.IPv6.parseCIDR(h)}catch{try{return p.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},p.process=function(h){let d=this.parse(h);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},p.subnetMatch=function(h,d,m){let g,S,b,_;m==null&&(m="unicast");for(S in d)if(Object.prototype.hasOwnProperty.call(d,S)){for(b=d[S],b[0]&&!(b[0]instanceof Array)&&(b=[b]),g=0;g<b.length;g++)if(_=b[g],h.kind()===_[0].kind()&&h.match.apply(h,_))return S}return m},typeof Ca<"u"&&Ca.exports?Ca.exports=p:t.ipaddr=p})(NS)});var DS=E((qK,ss)=>{"use strict";ss.exports=Pf;ss.exports.default=Pf;ss.exports.proxyaddr=Pf;ss.exports.all=qS;ss.exports.compile=jS;var gj=IS(),LS=kS(),yj=/^\d+$/u,Ia=LS.isValid,Na=LS.parse,xS={linklocal:["169.254.0.0/16","fe80::/10"],loopback:["127.0.0.1/8","::1/128"],uniquelocal:["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16","fc00::/7"]};function qS(t,e){let r=gj(t);if(!e)return r;typeof e!="function"&&(e=jS(e));for(let n=0;n<r.length-1;n++)e(r[n],n)||(r.length=n+1);return r}function jS(t){if(!t)throw new TypeError("argument is required");let e;if(typeof t=="string")e=[t];else if(Array.isArray(t))e=t.slice();else throw new TypeError("unsupported trust argument");for(let r=0;r<e.length;r++)t=e[r],Object.hasOwn(xS,t)&&(t=xS[t],e.splice.apply(e,[r,1].concat(t)),r+=t.length-1);return Sj(_j(e))}function _j(t){let e=new Array(t.length);for(let r=0;r<t.length;r++)e[r]=Ej(t[r]);return e}function Sj(t){let e=t.length;return e===0?vj:e===1?Rj(t[0]):wj(t)}function Ej(t){let e=t.lastIndexOf("/"),r=e!==-1?t.substring(0,e):t;if(!Ia(r))throw new TypeError("invalid IP address: "+r);let n=Na(r);e===-1&&n.kind()==="ipv6"&&n.isIPv4MappedAddress()&&(n=n.toIPv4Address());let s=n.kind()==="ipv6"?128:32,i=e!==-1?t.substring(e+1,t.length):null;if(i===null?i=s:yj.test(i)?i=parseInt(i,10):n.kind()==="ipv4"&&Ia(i)?i=bj(i):i=null,i<=0||i>s)throw new TypeError("invalid range on address: "+t);return[n,i]}function bj(t){let e=Na(t);return e.kind()==="ipv4"?e.prefixLengthFromSubnetMask():null}function Pf(t,e){if(!t)throw new TypeError("req argument is required");if(!e)throw new TypeError("trust argument is required");let r=qS(t,e);return r[r.length-1]}function vj(){return!1}function wj(t){return function(r){if(!Ia(r))return!1;let n=Na(r),s,i=n.kind();for(let o=0;o<t.length;o++){let a=t[o],l=a[0],u=l.kind(),c=a[1],f=n;if(i!==u){let p=u==="ipv4";if(p&&!n.isIPv4MappedAddress())continue;s||(s=p?n.toIPv4Address():n.toIPv4MappedAddress()),f=s}if(f.match(l,c))return!0}return!1}}function Rj(t){let e=t[0],r=e.kind(),n=r==="ipv4",s=t[1];return function(o){if(!Ia(o))return!1;let a=Na(o);if(a.kind()!==r){if(n&&!a.isIPv4MappedAddress())return!1;a=n?a.toIPv4Address():a.toIPv4MappedAddress()}return a.match(e,s)}}});var xa=E((jK,Nf)=>{"use strict";var ka=DS(),{kHasBeenDecorated:Oj,kSchemaBody:Tj,kSchemaHeaders:$j,kSchemaParams:Pj,kSchemaQuerystring:FS,kSchemaController:Af,kOptions:Aj,kRequestCacheValidateFns:zr,kRouteContext:Xe,kRequestOriginalUrl:Cf}=De(),{FST_ERR_REQ_INVALID_VALIDATION_INVOCATION:Cj,FST_ERR_DEC_UNDECLARED:Ij}=He(),MS=di(),HS={body:Tj,headers:$j,params:Pj,querystring:FS,query:FS};function If(t,e,r,n,s,i){this.id=t,this[Xe]=i,this.params=e,this.raw=r,this.query=n,this.log=s,this.body=void 0}If.props=[];function Nj(t){if(typeof t=="function")return t;if(t===!0)return null;if(typeof t=="number")return function(e,r){return r<t};if(typeof t=="string"){let e=t.split(",").map(r=>r.trim());return ka.compile(e)}return ka.compile(t)}function kj(t,e){return e?xj(t,e):US(t)}function US(t){let e=t.props.slice();function r(n,s,i,o,a,l){this.id=n,this[Xe]=l,this.params=s,this.raw=i,this.query=o,this.log=a,this.body=void 0;let u;for(let c=0;c<e.length;c++)u=e[c],this[u.key]=u.value}return Object.setPrototypeOf(r.prototype,t.prototype),Object.setPrototypeOf(r,t),r.props=e,r.parent=t,r}function VS(t){let e=t.lastIndexOf(",");return e===-1?t.trim():t.slice(e+1).trim()}function xj(t,e){let r=US(t),n=Nj(e);return r[Oj]=!0,Object.defineProperties(r.prototype,{ip:{get(){let s=ka.all(this.raw,n);return s[s.length-1]}},ips:{get(){return ka.all(this.raw,n)}},host:{get(){return this.ip!==void 0&&this.headers["x-forwarded-host"]?VS(this.headers["x-forwarded-host"]):this.headers.host??this.headers[":authority"]??""}},protocol:{get(){if(this.headers["x-forwarded-proto"])return VS(this.headers["x-forwarded-proto"]);if(this.socket)return this.socket.encrypted?"https":"http"}}}),r}function zS(t,e){if(!MS.hasKey(t,e)&&!MS.exist(t,e))throw new Ij(e,"request")}Object.defineProperties(If.prototype,{server:{get(){return this[Xe].server}},url:{get(){return this.raw.url}},originalUrl:{get(){return this[Cf]||(this[Cf]=this.raw.originalUrl||this.raw.url),this[Cf]}},method:{get(){return this.raw.method}},routeOptions:{get(){let t=this[Xe],e=t._parserOptions.limit,r=t.server.initialConfig.bodyLimit,n=t.server.hasConstraintStrategy("version")?this.raw.headers["accept-version"]:void 0;return{method:t.config?.method,url:t.config?.url,bodyLimit:e||r,attachValidation:t.attachValidation,logLevel:t.logLevel,exposeHeadRoute:t.exposeHeadRoute,prefixTrailingSlash:t.prefixTrailingSlash,handler:t.handler,config:t.config,schema:t.schema,version:n}}},is404:{get(){return this[Xe].config?.url===void 0}},socket:{get(){return this.raw.socket}},ip:{get(){if(this.socket)return this.socket.remoteAddress}},host:{get(){return this.raw.headers.host??this.raw.headers[":authority"]??""}},hostname:{get(){return this.host[0]==="["?this.host.slice(0,this.host.indexOf("]")+1):this.host.split(":",1)[0]}},port:{get(){let t=parseInt(this.host.split(":").slice(-1)[0]);if(!isNaN(t))return t;let e=this.headers.host??this.headers[":authority"]??"",r=parseInt(e.split(":").slice(-1)[0]);return isNaN(r)?null:r}},protocol:{get(){if(this.socket)return this.socket.encrypted?"https":"http"}},headers:{get(){return this.additionalHeaders?Object.assign({},this.raw.headers,this.additionalHeaders):this.raw.headers},set(t){this.additionalHeaders=t}},getValidationFunction:{value:function(t){if(typeof t=="string"){let e=HS[t];return this[Xe][e]}else if(typeof t=="object")return this[Xe][zr]?.get(t)}},compileValidationSchema:{value:function(t,e=null){let{method:r,url:n}=this;if(this[Xe][zr]?.has(t))return this[Xe][zr].get(t);let i=(this[Xe].validatorCompiler||this.server[Af].validatorCompiler||this.server[Af].setupValidator(this.server[Aj])||this.server[Af].validatorCompiler)({schema:t,method:r,url:n,httpPart:e});return this[Xe][zr]==null&&(this[Xe][zr]=new WeakMap),this[Xe][zr].set(t,i),i}},validateInput:{value:function(t,e,r){r=typeof e=="string"?e:r;let n=r!=null&&typeof r=="string"&&HS[r],s;if(n&&(s=this[Xe][n]),s==null&&(e==null||typeof e!="object"||Array.isArray(e)))throw new Cj(r);return s==null&&(this[Xe][zr]?.has(e)?s=this[Xe][zr].get(e):s=this.compileValidationSchema(e,r)),s(t)}},getDecorator:{value:function(t){zS(this,t);let e=this[t];return typeof e=="function"?e.bind(this):e}},setDecorator:{value:function(t,e){zS(this,t),this[t]=e}}});Nf.exports=If;Nf.exports.buildRequest=kj});var La=E((DK,BS)=>{"use strict";var{kFourOhFourContext:Lj,kReplySerializerDefault:qj,kSchemaErrorFormatter:jj,kErrorHandler:Dj,kChildLoggerFactory:Fj,kOptions:Mj,kReply:Hj,kRequest:Vj,kBodyLimit:zj,kLogLevel:Uj,kContentTypeParser:Bj,kRouteByFastify:Gj,kRequestCacheValidateFns:Wj,kReplyCacheSerializeFns:Jj}=De();function Kj({schema:t,handler:e,config:r,requestIdLogLabel:n,childLoggerFactory:s,errorHandler:i,bodyLimit:o,logLevel:a,logSerializers:l,attachValidation:u,validatorCompiler:c,serializerCompiler:f,replySerializer:p,schemaErrorFormatter:h,exposeHeadRoute:d,prefixTrailingSlash:m,server:g,isFastify:S}){this.schema=t,this.handler=e,this.Reply=g[Hj],this.Request=g[Vj],this.contentTypeParser=g[Bj],this.onRequest=null,this.onSend=null,this.onError=null,this.onTimeout=null,this.preHandler=null,this.onResponse=null,this.preSerialization=null,this.onRequestAbort=null,this.config=r,this.errorHandler=i||g[Dj],this.requestIdLogLabel=n||g[Mj].requestIdLogLabel,this.childLoggerFactory=s||g[Fj],this._middie=null,this._parserOptions={limit:o||g[zj]},this.exposeHeadRoute=d,this.prefixTrailingSlash=m,this.logLevel=a||g[Uj],this.logSerializers=l,this[Lj]=null,this.attachValidation=u,this[qj]=p,this.schemaErrorFormatter=h||g[jj]||Yj,this[Gj]=S,this[Wj]=null,this[Jj]=null,this.validatorCompiler=c||null,this.serializerCompiler=f||null,this.server=g}function Yj(t,e){let r="",n=", ";for(let s=0;s!==t.length;++s){let i=t[s];r+=e+(i.instancePath||"")+" "+i.message+n}return new Error(r.slice(0,-n.length))}BS.exports=Kj});var WS=E(sr=>{"use strict";var kf=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=new Map,this.last=null,this.max=e,this.ttl=r}get size(){return this.items.size}clear(){this.items=new Map,this.first=null,this.last=null}delete(e){if(this.items.has(e)){let r=this.items.get(e);this.items.delete(e),r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;this.items.delete(e.key),this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(this.items.has(e))return this.items.get(e).expiry}get(e){if(this.items.has(e)){let r=this.items.get(e);if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return this.items.keys()}set(e,r){if(this.items.has(e)){let s=this.items.get(e);s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl;return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items.set(e,n),this.size===1?this.first=n:this.last.next=n,this.last=n}},xf=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=new Map,this.last=null,this.max=e,this.ttl=r}get size(){return this.items.size}bumpLru(e){if(this.last===e)return;let r=this.last,n=e.next,s=e.prev;this.first===e&&(this.first=n),e.next=null,e.prev=r,r.next=e,s!==null&&(s.next=n),n!==null&&(n.prev=s),this.last=e}clear(){this.items=new Map,this.first=null,this.last=null}delete(e){if(this.items.has(e)){let r=this.items.get(e);this.items.delete(e),r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;this.items.delete(e.key),this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(this.items.has(e))return this.items.get(e).expiry}get(e){if(this.items.has(e)){let r=this.items.get(e);if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return this.bumpLru(r),r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return this.items.keys()}set(e,r){if(this.items.has(e)){let s=this.items.get(e);s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl,this.last!==s&&this.bumpLru(s);return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items.set(e,n),this.size===1?this.first=n:this.last.next=n,this.last=n}},mi=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this.max=e,this.ttl=r}bumpLru(e){if(this.last===e)return;let r=this.last,n=e.next,s=e.prev;this.first===e&&(this.first=n),e.next=null,e.prev=r,r.next=e,s!==null&&(s.next=n),n!==null&&(n.prev=s),this.last=e}clear(){this.items=Object.create(null),this.first=null,this.last=null,this.size=0}delete(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];delete this.items[e],this.size--,r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(Object.prototype.hasOwnProperty.call(this.items,e))return this.items[e].expiry}get(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return this.bumpLru(r),r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return Object.keys(this.items)}set(e,r){if(Object.prototype.hasOwnProperty.call(this.items,e)){let s=this.items[e];s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl,this.last!==s&&this.bumpLru(s);return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items[e]=n,++this.size===1?this.first=n:this.last.next=n,this.last=n}},qa=class{constructor(){this.records={}}initForCache(e,r){this.records[e]={[r]:{cacheSize:0,hits:0,falsyHits:0,emptyHits:0,misses:0,expirations:0,evictions:0,invalidateOne:0,invalidateAll:0,sets:0}}}resetForCache(e){for(let r of Object.keys(this.records[e]))this.records[e][r]={cacheSize:0,hits:0,falsyHits:0,emptyHits:0,misses:0,expirations:0,evictions:0,invalidateOne:0,invalidateAll:0,sets:0}}getStatistics(){return this.records}};function GS(t){return`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,"0")}-${t.getDate().toString().padStart(2,"0")}`}var Lf=class{constructor(e,r,n){this.cacheId=e,this.statisticTtlInHours=r,this.collectionStart=new Date,this.currentTimeStamp=GS(this.collectionStart),this.records=n||new qa,this.records.initForCache(this.cacheId,this.currentTimeStamp)}get currentRecord(){return this.records.records[this.cacheId][this.currentTimeStamp]||(this.records.records[this.cacheId][this.currentTimeStamp]={cacheSize:0,hits:0,falsyHits:0,emptyHits:0,misses:0,expirations:0,evictions:0,sets:0,invalidateOne:0,invalidateAll:0}),this.records.records[this.cacheId][this.currentTimeStamp]}hoursPassed(){return(Date.now()-this.collectionStart)/1e3/60/60}addHit(){this.archiveIfNeeded(),this.currentRecord.hits++}addFalsyHit(){this.archiveIfNeeded(),this.currentRecord.falsyHits++}addEmptyHit(){this.archiveIfNeeded(),this.currentRecord.emptyHits++}addMiss(){this.archiveIfNeeded(),this.currentRecord.misses++}addEviction(){this.archiveIfNeeded(),this.currentRecord.evictions++}setCacheSize(e){this.archiveIfNeeded(),this.currentRecord.cacheSize=e}addExpiration(){this.archiveIfNeeded(),this.currentRecord.expirations++}addSet(){this.archiveIfNeeded(),this.currentRecord.sets++}addInvalidateOne(){this.archiveIfNeeded(),this.currentRecord.invalidateOne++}addInvalidateAll(){this.archiveIfNeeded(),this.currentRecord.invalidateAll++}getStatistics(){return this.records.getStatistics()}archiveIfNeeded(){this.hoursPassed()>=this.statisticTtlInHours&&(this.collectionStart=new Date,this.currentTimeStamp=GS(this.collectionStart),this.records.initForCache(this.cacheId,this.currentTimeStamp))}},ja=class extends mi{constructor(e,r,n,s,i){if(super(e||1e3,r||0),!n)throw new Error("Cache id is mandatory");this.hitStatistics=new Lf(n,i!==void 0?i:24,s)}getStatistics(){return this.hitStatistics.getStatistics()}set(e,r){super.set(e,r),this.hitStatistics.addSet(),this.hitStatistics.setCacheSize(this.size)}evict(){super.evict(),this.hitStatistics.addEviction(),this.hitStatistics.setCacheSize(this.size)}delete(e,r=!1){super.delete(e),r||this.hitStatistics.addInvalidateOne(),this.hitStatistics.setCacheSize(this.size)}clear(){super.clear(),this.hitStatistics.addInvalidateAll(),this.hitStatistics.setCacheSize(this.size)}get(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e,!0),this.hitStatistics.addExpiration();return}return this.bumpLru(r),r.value||this.hitStatistics.addFalsyHit(),(r.value===void 0||r.value===null||r.value==="")&&this.hitStatistics.addEmptyHit(),this.hitStatistics.addHit(),r.value}this.hitStatistics.addMiss()}},Da=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this.max=e,this.ttl=r}clear(){this.items=Object.create(null),this.first=null,this.last=null,this.size=0}delete(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];delete this.items[e],this.size--,r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(Object.prototype.hasOwnProperty.call(this.items,e))return this.items[e].expiry}get(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return Object.keys(this.items)}set(e,r){if(Object.prototype.hasOwnProperty.call(this.items,e)){let s=this.items[e];s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl;return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items[e]=n,++this.size===1?this.first=n:this.last.next=n,this.last=n}};sr.Fifo=Da;sr.FifoMap=kf;sr.FifoObject=Da;sr.HitStatisticsRecord=qa;sr.Lru=mi;sr.LruHitStatistics=ja;sr.LruMap=xf;sr.LruObject=mi;sr.LruObjectHitStatistics=ja});var QS=E((MK,is)=>{"use strict";var Xj=typeof Buffer<"u",JS=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,KS=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function YS(t,e,r){r==null&&e!==null&&typeof e=="object"&&(r=e,e=void 0),Xj&&Buffer.isBuffer(t)&&(t=t.toString()),t&&t.charCodeAt(0)===65279&&(t=t.slice(1));let n=JSON.parse(t,e);if(n===null||typeof n!="object")return n;let s=r&&r.protoAction||"error",i=r&&r.constructorAction||"error";if(s==="ignore"&&i==="ignore")return n;if(s!=="ignore"&&i!=="ignore"){if(JS.test(t)===!1&&KS.test(t)===!1)return n}else if(s!=="ignore"&&i==="ignore"){if(JS.test(t)===!1)return n}else if(KS.test(t)===!1)return n;return XS(n,{protoAction:s,constructorAction:i,safe:r&&r.safe})}function XS(t,{protoAction:e="error",constructorAction:r="error",safe:n}={}){let s=[t];for(;s.length;){let i=s;s=[];for(let o of i){if(e!=="ignore"&&Object.prototype.hasOwnProperty.call(o,"__proto__")){if(n===!0)return null;if(e==="error")throw new SyntaxError("Object contains forbidden prototype property");delete o.__proto__}if(r!=="ignore"&&Object.prototype.hasOwnProperty.call(o,"constructor")&&o.constructor!==null&&typeof o.constructor=="object"&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype")){if(n===!0)return null;if(r==="error")throw new SyntaxError("Object contains forbidden prototype property");delete o.constructor}for(let a in o){let l=o[a];l&&typeof l=="object"&&s.push(l)}}}return t}function qf(t,e,r){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;try{return YS(t,e,r)}finally{Error.stackTraceLimit=n}}function Qj(t,e){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return YS(t,e,{safe:!0})}catch{return}finally{Error.stackTraceLimit=r}}is.exports=qf;is.exports.default=qf;is.exports.parse=qf;is.exports.safeParse=Qj;is.exports.scan=XS});var Hf=E((HK,_i)=>{"use strict";var{AsyncResource:Zj}=V("node:async_hooks"),{FifoMap:tE}=WS(),{parse:eD}=QS(),yi=fc(),{kDefaultJsonParse:gi,kContentTypeParser:os,kBodyLimit:tD,kRequestPayloadStream:rE,kState:Df,kTestInternals:rD,kReplyIsError:ZS,kRouteContext:nD}=De(),{FST_ERR_CTP_INVALID_TYPE:Fa,FST_ERR_CTP_EMPTY_TYPE:sD,FST_ERR_CTP_ALREADY_PRESENT:iD,FST_ERR_CTP_INVALID_HANDLER:oD,FST_ERR_CTP_INVALID_PARSE_TYPE:aD,FST_ERR_CTP_BODY_TOO_LARGE:eE,FST_ERR_CTP_INVALID_MEDIA_TYPE:lD,FST_ERR_CTP_INVALID_CONTENT_LENGTH:uD,FST_ERR_CTP_EMPTY_JSON_BODY:cD,FST_ERR_CTP_INSTANCE_ALREADY_STARTED:Ff,FST_ERR_CTP_INVALID_JSON_BODY:fD}=He(),{FSTSEC001:dD}=Kn();function Er(t,e,r){this[gi]=sE(e,r),this.customParsers=new Map,this.customParsers.set("application/json",new jf(!0,!1,t,this[gi])),this.customParsers.set("text/plain",new jf(!0,!1,t,Mf)),this.parserList=["application/json","text/plain"],this.parserRegExpList=[],this.cache=new tE(100)}Er.prototype.add=function(t,e,r){let n=typeof t=="string";if(n){if(t=t.trim().toLowerCase(),t.length===0)throw new sD}else if(!(t instanceof RegExp))throw new Fa;if(typeof r!="function")throw new oD;if(this.existingParser(t))throw new iD(t);if(e.parseAs!==void 0&&e.parseAs!=="string"&&e.parseAs!=="buffer")throw new aD(e.parseAs);let s=new jf(e.parseAs==="string",e.parseAs==="buffer",e.bodyLimit,r);if(t==="*")this.customParsers.set("",s);else if(n){let i=new yi(t);if(i.isValid===!1)throw new Fa;let o=i.toString();this.parserList.unshift(o),this.customParsers.set(o,s)}else _D(t),this.parserRegExpList.unshift(t),this.customParsers.set(t.toString(),s)};Er.prototype.hasParser=function(t){if(typeof t=="string")t=new yi(t).toString();else{if(!(t instanceof RegExp))throw new Fa;t=t.toString()}return this.customParsers.has(t)};Er.prototype.existingParser=function(t){if(typeof t=="string"){let e=new yi(t).toString();if(t==="application/json"&&this.customParsers.has(t))return this.customParsers.get(e).fn!==this[gi];if(t==="text/plain"&&this.customParsers.has(t))return this.customParsers.get(e).fn!==Mf}return this.hasParser(t)};Er.prototype.getParser=function(t){typeof t=="string"&&(t=new yi(t));let e=t.toString(),r=this.cache.get(e);if(r!==void 0)return r;if(r=this.customParsers.get(e),r!==void 0)return this.cache.set(e,r),r;if(r=this.customParsers.get(t.mediaType),r!==void 0)return r;for(let n=0;n!==this.parserRegExpList.length;++n){let s=this.parserRegExpList[n];if(s.test(e))return r=this.customParsers.get(s.toString()),this.cache.set(e,r),r}return this.customParsers.get("")};Er.prototype.removeAll=function(){this.customParsers=new Map,this.parserRegExpList=[],this.parserList=[],this.cache=new tE(100)};Er.prototype.remove=function(t){let e;if(typeof t=="string")t=new yi(t).toString(),e=this.parserList;else{if(!(t instanceof RegExp))throw new Fa;t=t.toString(),e=this.parserRegExpList}let r=this.customParsers.delete(t),n=e.findIndex(s=>s.toString()===t);return n>-1&&e.splice(n,1),r||n>-1};Er.prototype.run=function(t,e,r,n){let s=this.getParser(t);if(s===void 0){if(r.is404===!0){e(r,n);return}n[ZS]=!0,n.send(new lD(t||void 0));return}let i=new Zj("content-type-parser:run",r),o=i.bind(l);if(s.asString===!0||s.asBuffer===!0){nE(r,n,n[nD]._parserOptions,s,o);return}let a=s.fn(r,r[rE],o);a&&typeof a.then=="function"&&a.then(u=>{o(null,u)},o);function l(u,c){if(i.emitDestroy(),u!=null){n.header("connection","close"),n[ZS]=!0,n.send(u);return}r.body=c,e(r,n)}};function nE(t,e,r,n,s){let i=n.asString===!0,o=r.limit===null?n.bodyLimit:r.limit,a=Number(t.headers["content-length"]);if(a>o){s(new eE,void 0);return}let l=0,u=i?"":[],c=t[rE]||t.raw;i&&c.setEncoding("utf8"),c.on("data",f),c.on("end",p),c.on("error",p),c.resume();function f(h){l+=i?Buffer.byteLength(h):h.length;let{receivedEncodedLength:d=0}=c;if(l>o||d>o){c.removeListener("data",f),c.removeListener("end",p),c.removeListener("error",p),s(new eE,void 0);return}i?u+=h:u.push(h)}function p(h){if(c.removeListener("data",f),c.removeListener("end",p),c.removeListener("error",p),h!=null){typeof h.statusCode=="number"&&h.statusCode>=400||(h.statusCode=400),s(h,void 0);return}if(!Number.isNaN(a)&&(c.receivedEncodedLength||l)!==a){s(new uD,void 0);return}i||(u=Buffer.concat(u));let d=n.fn(t,u,s);d&&typeof d.then=="function"&&d.then(m=>{s(null,m)},s)}}function sE(t,e){let r={protoAction:t,constructorAction:e};return n;function n(s,i,o){if(i.length===0){o(new cD,void 0);return}try{o(null,eD(i,r))}catch{o(new fD,void 0)}}}function Mf(t,e,r){r(null,e)}function jf(t,e,r,n){this.asString=t,this.asBuffer=e,this.bodyLimit=r,this.fn=n}function hD(t){let e=new Er;return e[gi]=t[gi],e.customParsers=new Map(t.customParsers.entries()),e.parserList=t.parserList.slice(),e.parserRegExpList=t.parserRegExpList.slice(),e}function pD(t,e,r){if(this[Df].started)throw new Ff("addContentTypeParser");return typeof e=="function"&&(r=e,e={}),e||(e={}),e.bodyLimit||(e.bodyLimit=this[tD]),Array.isArray(t)?t.forEach(n=>this[os].add(n,e,r)):this[os].add(t,e,r),this}function mD(t){return this[os].hasParser(t)}function gD(t){if(this[Df].started)throw new Ff("removeContentTypeParser");if(Array.isArray(t))for(let e of t)this[os].remove(e);else this[os].remove(t)}function yD(){if(this[Df].started)throw new Ff("removeAllContentTypeParsers");this[os].removeAll()}function _D(t){t.source[0]!=="^"&&t.source.includes(";?")===!1&&dD(t.source)}_i.exports=Er;_i.exports.helpers={buildContentTypeParser:hD,addContentTypeParser:pD,hasContentTypeParser:mD,removeContentTypeParser:gD,removeAllContentTypeParsers:yD};_i.exports.defaultParsers={getDefaultJsonParser:sE,defaultTextParser:Mf};_i.exports[rD]={rawBody:nE}});var as=E(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.regexpCode=ce.getEsmExportName=ce.getProperty=ce.safeStringify=ce.stringify=ce.strConcat=ce.addCodeArg=ce.str=ce._=ce.nil=ce._Code=ce.Name=ce.IDENTIFIER=ce._CodeOrName=void 0;var Si=class{};ce._CodeOrName=Si;ce.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var En=class extends Si{constructor(e){if(super(),!ce.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ce.Name=En;var It=class extends Si{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof En&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ce._Code=It;ce.nil=new It("");function iE(t,...e){let r=[t[0]],n=0;for(;n<e.length;)zf(r,e[n]),r.push(t[++n]);return new It(r)}ce._=iE;var Vf=new It("+");function oE(t,...e){let r=[Ei(t[0])],n=0;for(;n<e.length;)r.push(Vf),zf(r,e[n]),r.push(Vf,Ei(t[++n]));return SD(r),new It(r)}ce.str=oE;function zf(t,e){e instanceof It?t.push(...e._items):e instanceof En?t.push(e):t.push(vD(e))}ce.addCodeArg=zf;function SD(t){let e=1;for(;e<t.length-1;){if(t[e]===Vf){let r=ED(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function ED(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof En||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof En))return`"${t}${e.slice(1)}`}function bD(t,e){return e.emptyStr()?t:t.emptyStr()?e:oE`${t}${e}`}ce.strConcat=bD;function vD(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ei(Array.isArray(t)?t.join(","):t)}function wD(t){return new It(Ei(t))}ce.stringify=wD;function Ei(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ce.safeStringify=Ei;function RD(t){return typeof t=="string"&&ce.IDENTIFIER.test(t)?new It(`.${t}`):iE`[${t}]`}ce.getProperty=RD;function OD(t){if(typeof t=="string"&&ce.IDENTIFIER.test(t))return new It(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ce.getEsmExportName=OD;function TD(t){return new It(t.toString())}ce.regexpCode=TD});var za=E(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.ValueScope=St.ValueScopeName=St.Scope=St.varKinds=St.UsedValueState=void 0;var _t=as(),Uf=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Ma;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Ma||(St.UsedValueState=Ma={}));St.varKinds={const:new _t.Name("const"),let:new _t.Name("let"),var:new _t.Name("var")};var Ha=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof _t.Name?e:this.name(e)}name(e){return new _t.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};St.Scope=Ha;var Va=class extends _t.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,_t._)`.${new _t.Name(r)}[${n}]`}};St.ValueScopeName=Va;var $D=(0,_t._)`\n`,Bf=class extends Ha{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?$D:_t.nil}}get(){return this._scope}name(e){return new Va(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let c=a.get(o);if(c)return c}else a=this._values[i]=new Map;a.set(o,s);let l=this._scope[i]||(this._scope[i]=[]),u=l.length;return l[u]=r.ref,s.setValue(r,{property:i,itemIndex:u}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,_t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let i=_t.nil;for(let o in e){let a=e[o];if(!a)continue;let l=n[o]=n[o]||new Map;a.forEach(u=>{if(l.has(u))return;l.set(u,Ma.Started);let c=r(u);if(c){let f=this.opts.es5?St.varKinds.var:St.varKinds.const;i=(0,_t._)`${i}${f} ${u} = ${c};${this.opts._n}`}else if(c=s?.(u))i=(0,_t._)`${i}${c}${this.opts._n}`;else throw new Uf(u);l.set(u,Ma.Completed)})}return i}};St.ValueScope=Bf});var W=E(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.or=te.and=te.not=te.CodeGen=te.operators=te.varKinds=te.ValueScopeName=te.ValueScope=te.Scope=te.Name=te.regexpCode=te.stringify=te.getProperty=te.nil=te.strConcat=te.str=te._=void 0;var oe=as(),Ut=za(),Ur=as();Object.defineProperty(te,"_",{enumerable:!0,get:function(){return Ur._}});Object.defineProperty(te,"str",{enumerable:!0,get:function(){return Ur.str}});Object.defineProperty(te,"strConcat",{enumerable:!0,get:function(){return Ur.strConcat}});Object.defineProperty(te,"nil",{enumerable:!0,get:function(){return Ur.nil}});Object.defineProperty(te,"getProperty",{enumerable:!0,get:function(){return Ur.getProperty}});Object.defineProperty(te,"stringify",{enumerable:!0,get:function(){return Ur.stringify}});Object.defineProperty(te,"regexpCode",{enumerable:!0,get:function(){return Ur.regexpCode}});Object.defineProperty(te,"Name",{enumerable:!0,get:function(){return Ur.Name}});var Wa=za();Object.defineProperty(te,"Scope",{enumerable:!0,get:function(){return Wa.Scope}});Object.defineProperty(te,"ValueScope",{enumerable:!0,get:function(){return Wa.ValueScope}});Object.defineProperty(te,"ValueScopeName",{enumerable:!0,get:function(){return Wa.ValueScopeName}});Object.defineProperty(te,"varKinds",{enumerable:!0,get:function(){return Wa.varKinds}});te.operators={GT:new oe._Code(">"),GTE:new oe._Code(">="),LT:new oe._Code("<"),LTE:new oe._Code("<="),EQ:new oe._Code("==="),NEQ:new oe._Code("!=="),NOT:new oe._Code("!"),OR:new oe._Code("||"),AND:new oe._Code("&&"),ADD:new oe._Code("+")};var br=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Gf=class extends br{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Ut.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=us(this.rhs,e,r)),this}get names(){return this.rhs instanceof oe._CodeOrName?this.rhs.names:{}}},Ua=class extends br{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof oe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=us(this.rhs,e,r),this}get names(){let e=this.lhs instanceof oe.Name?{}:{...this.lhs.names};return Ga(e,this.rhs)}},Wf=class extends Ua{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Jf=class extends br{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Kf=class extends br{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Yf=class extends br{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Xf=class extends br{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=us(this.code,e,r),this}get names(){return this.code instanceof oe._CodeOrName?this.code.names:{}}},bi=class extends br{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let i=n[s];i.optimizeNames(e,r)||(PD(e,i.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>wn(e,r.names),{})}},vr=class extends bi{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Qf=class extends bi{},ls=class extends vr{};ls.kind="else";var bn=class t extends vr{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new ls(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(aE(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=us(this.condition,e,r),this}get names(){let e=super.names;return Ga(e,this.condition),this.else&&wn(e,this.else.names),e}};bn.kind="if";var vn=class extends vr{};vn.kind="for";var Zf=class extends vn{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=us(this.iteration,e,r),this}get names(){return wn(super.names,this.iteration.names)}},ed=class extends vn{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?Ut.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${r} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=Ga(super.names,this.from);return Ga(e,this.to)}},Ba=class extends vn{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=us(this.iterable,e,r),this}get names(){return wn(super.names,this.iterable.names)}},vi=class extends vr{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};vi.kind="func";var wi=class extends bi{render(e){return"return "+super.render(e)}};wi.kind="return";var td=class extends vr{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&wn(e,this.catch.names),this.finally&&wn(e,this.finally.names),e}},Ri=class extends vr{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Ri.kind="catch";var Oi=class extends vr{render(e){return"finally"+super.render(e)}};Oi.kind="finally";var rd=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
52
- `:""},this._extScope=e,this._scope=new Ut.Scope({parent:e}),this._nodes=[new Qf]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,s){let i=this._scope.toName(r);return n!==void 0&&s&&(this._constants[i.str]=n),this._leafNode(new Gf(e,i,n)),i}const(e,r,n){return this._def(Ut.varKinds.const,e,r,n)}let(e,r,n){return this._def(Ut.varKinds.let,e,r,n)}var(e,r,n){return this._def(Ut.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Ua(e,r,n))}add(e,r){return this._leafNode(new Wf(e,te.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==oe.nil&&this._leafNode(new Xf(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,oe.addCodeArg)(r,s));return r.push("}"),new oe._Code(r)}if(e,r,n){if(this._blockNode(new bn(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new bn(e))}else(){return this._elseNode(new ls)}endIf(){return this._endBlockNode(bn,ls)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Zf(e),r)}forRange(e,r,n,s,i=this.opts.es5?Ut.varKinds.var:Ut.varKinds.let){let o=this._scope.toName(e);return this._for(new ed(i,o,r,n),()=>s(o))}forOf(e,r,n,s=Ut.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=r instanceof oe.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,oe._)`${o}.length`,a=>{this.var(i,(0,oe._)`${o}[${a}]`),n(i)})}return this._for(new Ba("of",s,i,r),()=>n(i))}forIn(e,r,n,s=this.opts.es5?Ut.varKinds.var:Ut.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,oe._)`Object.keys(${r})`,n);let i=this._scope.toName(e);return this._for(new Ba("in",s,i,r),()=>n(i))}endFor(){return this._endBlockNode(vn)}label(e){return this._leafNode(new Jf(e))}break(e){return this._leafNode(new Kf(e))}return(e){let r=new wi;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(wi)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new td;if(this._blockNode(s),this.code(e),r){let i=this.name("e");this._currNode=s.catch=new Ri(i),r(i)}return n&&(this._currNode=s.finally=new Oi,this.code(n)),this._endBlockNode(Ri,Oi)}throw(e){return this._leafNode(new Yf(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=oe.nil,n,s){return this._blockNode(new vi(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(vi)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof bn))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};te.CodeGen=rd;function wn(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Ga(t,e){return e instanceof oe._CodeOrName?wn(t,e.names):t}function us(t,e,r){if(t instanceof oe.Name)return n(t);if(!s(t))return t;return new oe._Code(t._items.reduce((i,o)=>(o instanceof oe.Name&&(o=n(o)),o instanceof oe._Code?i.push(...o._items):i.push(o),i),[]));function n(i){let o=r[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof oe._Code&&i._items.some(o=>o instanceof oe.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function PD(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function aE(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,oe._)`!${nd(t)}`}te.not=aE;var AD=lE(te.operators.AND);function CD(...t){return t.reduce(AD)}te.and=CD;var ID=lE(te.operators.OR);function ND(...t){return t.reduce(ID)}te.or=ND;function lE(t){return(e,r)=>e===oe.nil?r:r===oe.nil?e:(0,oe._)`${nd(e)} ${t} ${nd(r)}`}function nd(t){return t instanceof oe.Name?t:(0,oe._)`(${t})`}});var ee=E(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.checkStrictMode=re.getErrorPath=re.Type=re.useFunc=re.setEvaluated=re.evaluatedPropsToName=re.mergeEvaluated=re.eachItem=re.unescapeJsonPointer=re.escapeJsonPointer=re.escapeFragment=re.unescapeFragment=re.schemaRefOrVal=re.schemaHasRulesButRef=re.schemaHasRules=re.checkUnknownRules=re.alwaysValidSchema=re.toHash=void 0;var Se=W(),kD=as();function xD(t){let e={};for(let r of t)e[r]=!0;return e}re.toHash=xD;function LD(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(fE(t,e),!dE(e,t.self.RULES.all))}re.alwaysValidSchema=LD;function fE(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let i in e)s[i]||mE(t,`unknown keyword: "${i}"`)}re.checkUnknownRules=fE;function dE(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}re.schemaHasRules=dE;function qD(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}re.schemaHasRulesButRef=qD;function jD({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Se._)`${r}`}return(0,Se._)`${t}${e}${(0,Se.getProperty)(n)}`}re.schemaRefOrVal=jD;function DD(t){return hE(decodeURIComponent(t))}re.unescapeFragment=DD;function FD(t){return encodeURIComponent(id(t))}re.escapeFragment=FD;function id(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}re.escapeJsonPointer=id;function hE(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}re.unescapeJsonPointer=hE;function MD(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}re.eachItem=MD;function uE({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,i,o,a)=>{let l=o===void 0?i:o instanceof Se.Name?(i instanceof Se.Name?t(s,i,o):e(s,i,o),o):i instanceof Se.Name?(e(s,o,i),i):r(i,o);return a===Se.Name&&!(l instanceof Se.Name)?n(s,l):l}}re.mergeEvaluated={props:uE({mergeNames:(t,e,r)=>t.if((0,Se._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Se._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Se._)`${r} || {}`).code((0,Se._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Se._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Se._)`${r} || {}`),od(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:pE}),items:uE({mergeNames:(t,e,r)=>t.if((0,Se._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Se._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Se._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Se._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function pE(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Se._)`{}`);return e!==void 0&&od(t,r,e),r}re.evaluatedPropsToName=pE;function od(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Se._)`${e}${(0,Se.getProperty)(n)}`,!0))}re.setEvaluated=od;var cE={};function HD(t,e){return t.scopeValue("func",{ref:e,code:cE[e.code]||(cE[e.code]=new kD._Code(e.code))})}re.useFunc=HD;var sd;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(sd||(re.Type=sd={}));function VD(t,e,r){if(t instanceof Se.Name){let n=e===sd.Num;return r?n?(0,Se._)`"[" + ${t} + "]"`:(0,Se._)`"['" + ${t} + "']"`:n?(0,Se._)`"/" + ${t}`:(0,Se._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Se.getProperty)(t).toString():"/"+id(t)}re.getErrorPath=VD;function mE(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}re.checkStrictMode=mE});var Nt=E(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var Qe=W(),zD={data:new Qe.Name("data"),valCxt:new Qe.Name("valCxt"),instancePath:new Qe.Name("instancePath"),parentData:new Qe.Name("parentData"),parentDataProperty:new Qe.Name("parentDataProperty"),rootData:new Qe.Name("rootData"),dynamicAnchors:new Qe.Name("dynamicAnchors"),vErrors:new Qe.Name("vErrors"),errors:new Qe.Name("errors"),this:new Qe.Name("this"),self:new Qe.Name("self"),scope:new Qe.Name("scope"),json:new Qe.Name("json"),jsonPos:new Qe.Name("jsonPos"),jsonLen:new Qe.Name("jsonLen"),jsonPart:new Qe.Name("jsonPart")};ad.default=zD});var Ti=E(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.extendErrors=Ze.resetErrorsCount=Ze.reportExtraError=Ze.reportError=Ze.keyword$DataError=Ze.keywordError=void 0;var le=W(),Ja=ee(),it=Nt();Ze.keywordError={message:({keyword:t})=>(0,le.str)`must pass "${t}" keyword validation`};Ze.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,le.str)`"${t}" keyword must be ${e} ($data)`:(0,le.str)`"${t}" keyword is invalid ($data)`};function UD(t,e=Ze.keywordError,r,n){let{it:s}=t,{gen:i,compositeRule:o,allErrors:a}=s,l=_E(t,e,r);n??(o||a)?gE(i,l):yE(s,(0,le._)`[${l}]`)}Ze.reportError=UD;function BD(t,e=Ze.keywordError,r){let{it:n}=t,{gen:s,compositeRule:i,allErrors:o}=n,a=_E(t,e,r);gE(s,a),i||o||yE(n,it.default.vErrors)}Ze.reportExtraError=BD;function GD(t,e){t.assign(it.default.errors,e),t.if((0,le._)`${it.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,le._)`${it.default.vErrors}.length`,e),()=>t.assign(it.default.vErrors,null)))}Ze.resetErrorsCount=GD;function WD({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",s,it.default.errors,a=>{t.const(o,(0,le._)`${it.default.vErrors}[${a}]`),t.if((0,le._)`${o}.instancePath === undefined`,()=>t.assign((0,le._)`${o}.instancePath`,(0,le.strConcat)(it.default.instancePath,i.errorPath))),t.assign((0,le._)`${o}.schemaPath`,(0,le.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,le._)`${o}.schema`,r),t.assign((0,le._)`${o}.data`,n))})}Ze.extendErrors=WD;function gE(t,e){let r=t.const("err",e);t.if((0,le._)`${it.default.vErrors} === null`,()=>t.assign(it.default.vErrors,(0,le._)`[${r}]`),(0,le._)`${it.default.vErrors}.push(${r})`),t.code((0,le._)`${it.default.errors}++`)}function yE(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,le._)`new ${t.ValidationError}(${e})`):(r.assign((0,le._)`${n}.errors`,e),r.return(!1))}var Rn={keyword:new le.Name("keyword"),schemaPath:new le.Name("schemaPath"),params:new le.Name("params"),propertyName:new le.Name("propertyName"),message:new le.Name("message"),schema:new le.Name("schema"),parentSchema:new le.Name("parentSchema")};function _E(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,le._)`{}`:JD(t,e,r)}function JD(t,e,r={}){let{gen:n,it:s}=t,i=[KD(s,r),YD(t,r)];return XD(t,e,i),n.object(...i)}function KD({errorPath:t},{instancePath:e}){let r=e?(0,le.str)`${t}${(0,Ja.getErrorPath)(e,Ja.Type.Str)}`:t;return[it.default.instancePath,(0,le.strConcat)(it.default.instancePath,r)]}function YD({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,le.str)`${e}/${t}`;return r&&(s=(0,le.str)`${s}${(0,Ja.getErrorPath)(r,Ja.Type.Str)}`),[Rn.schemaPath,s]}function XD(t,{params:e,message:r},n){let{keyword:s,data:i,schemaValue:o,it:a}=t,{opts:l,propertyName:u,topSchemaRef:c,schemaPath:f}=a;n.push([Rn.keyword,s],[Rn.params,typeof e=="function"?e(t):e||(0,le._)`{}`]),l.messages&&n.push([Rn.message,typeof r=="function"?r(t):r]),l.verbose&&n.push([Rn.schema,o],[Rn.parentSchema,(0,le._)`${c}${f}`],[it.default.data,i]),u&&n.push([Rn.propertyName,u])}});var EE=E(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.boolOrEmptySchema=cs.topBoolOrEmptySchema=void 0;var QD=Ti(),ZD=W(),eF=Nt(),tF={message:"boolean schema is false"};function rF(t){let{gen:e,schema:r,validateName:n}=t;r===!1?SE(t,!1):typeof r=="object"&&r.$async===!0?e.return(eF.default.data):(e.assign((0,ZD._)`${n}.errors`,null),e.return(!0))}cs.topBoolOrEmptySchema=rF;function nF(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),SE(t)):r.var(e,!0)}cs.boolOrEmptySchema=nF;function SE(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,QD.reportError)(s,tF,void 0,e)}});var ld=E(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.getRules=fs.isJSONType=void 0;var sF=["string","number","integer","boolean","null","object","array"],iF=new Set(sF);function oF(t){return typeof t=="string"&&iF.has(t)}fs.isJSONType=oF;function aF(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}fs.getRules=aF});var ud=E(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.shouldUseRule=Br.shouldUseGroup=Br.schemaHasRulesForType=void 0;function lF({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&bE(t,n)}Br.schemaHasRulesForType=lF;function bE(t,e){return e.rules.some(r=>vE(t,r))}Br.shouldUseGroup=bE;function vE(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Br.shouldUseRule=vE});var $i=E(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.reportTypeError=et.checkDataTypes=et.checkDataType=et.coerceAndCheckDataType=et.getJSONTypes=et.getSchemaTypes=et.DataType=void 0;var uF=ld(),cF=ud(),fF=Ti(),Z=W(),wE=ee(),ds;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ds||(et.DataType=ds={}));function dF(t){let e=RE(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}et.getSchemaTypes=dF;function RE(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(uF.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}et.getJSONTypes=RE;function hF(t,e){let{gen:r,data:n,opts:s}=t,i=pF(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,cF.schemaHasRulesForType)(t,e[0]));if(o){let a=fd(e,n,s.strictNumbers,ds.Wrong);r.if(a,()=>{i.length?mF(t,e,i):dd(t)})}return o}et.coerceAndCheckDataType=hF;var OE=new Set(["string","number","integer","boolean","null"]);function pF(t,e){return e?t.filter(r=>OE.has(r)||e==="array"&&r==="array"):[]}function mF(t,e,r){let{gen:n,data:s,opts:i}=t,o=n.let("dataType",(0,Z._)`typeof ${s}`),a=n.let("coerced",(0,Z._)`undefined`);i.coerceTypes==="array"&&n.if((0,Z._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,Z._)`${s}[0]`).assign(o,(0,Z._)`typeof ${s}`).if(fd(e,s,i.strictNumbers),()=>n.assign(a,s))),n.if((0,Z._)`${a} !== undefined`);for(let u of r)(OE.has(u)||u==="array"&&i.coerceTypes==="array")&&l(u);n.else(),dd(t),n.endIf(),n.if((0,Z._)`${a} !== undefined`,()=>{n.assign(s,a),gF(t,a)});function l(u){switch(u){case"string":n.elseIf((0,Z._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,Z._)`"" + ${s}`).elseIf((0,Z._)`${s} === null`).assign(a,(0,Z._)`""`);return;case"number":n.elseIf((0,Z._)`${o} == "boolean" || ${s} === null
51
+ `),J=wL.bind(null,{[D0]:"",[F0]:o,[H0]:C,[M0]:ff,[df]:$,[V0]:v}),U="";f!==null&&(p===void 0?U=J(f):U=J(Object.assign({},f,{name:p})));let H=a instanceof Function?a:a?J0:UL,fe=H().indexOf(":")+1;if(b&&!d)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(g&&typeof g!="function")throw Error(`Unknown mixin type "${typeof g}" - expected "function"`);if(w&&typeof w!="string")throw Error(`Unknown msgPrefix type "${typeof w}" - expected "string"`);yL(h,d,b);let ze=G0(d,b);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:ze,messageKey:l,errorKey:u}}),EL(m);let G=SL(m);return Object.assign(e,{levels:ze,[DL]:G,[FL]:b,[CL]:n,[PL]:H,[AL]:fe,[M0]:ff,[df]:$,[H0]:C,[NL]:M,[kL]:k,[xL]:l,[LL]:u,[qL]:c,[HL]:c?`,${JSON.stringify(c)}:{`:"",[F0]:o,[jL]:g,[VL]:S,[D0]:U,[V0]:v,[ML]:y,silent:OL,onChild:O,[zL]:w}),Object.setPrototypeOf(e,mL()),_L(e),e[IL](h),e}Ct.exports=hf;Ct.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=j0(t.dest||process.stdout.fd),q0(t)):q0({dest:j0(t),minLength:0});Ct.exports.transport=Wc();Ct.exports.multistream=L0();Ct.exports.levels=G0();Ct.exports.stdSerializers=YL;Ct.exports.stdTimeFunctions=Object.assign({},U0);Ct.exports.symbols=B0;Ct.exports.version=TL;Ct.exports.default=hf;Ct.exports.pino=hf});var Q0=E((xK,X0)=>{"use strict";var ma=K0(),{serializersSym:Y0}=ma.symbols,{FST_ERR_LOG_INVALID_DESTINATION:XL}=He();function QL(t){if(t.stream&&t.file)throw new XL;t.file&&(t.stream=ma.destination(t.file),delete t.file);let e=t.logger,r=t.genReqId,n=null;return e?(t.logger=void 0,t.genReqId=void 0,e[Y0]&&(t.serializers=Object.assign({},t.serializers,e[Y0])),n=e.child({},t),t.logger=e,t.genReqId=r):n=ma(t,t.stream),n}var ZL={req:function(e){return{method:e.method,url:e.url,version:e.headers&&e.headers["accept-version"],host:e.host,remoteAddress:e.ip,remotePort:e.socket?e.socket.remotePort:void 0}},err:ma.stdSerializers.err,res:function(e){return{statusCode:e.statusCode}}};X0.exports={serializers:ZL,createPinoLogger:QL}});var li=E((LK,eS)=>{"use strict";var{FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED:eq,FST_ERR_LOG_INVALID_LOGGER_CONFIG:tq,FST_ERR_LOG_INVALID_LOGGER_INSTANCE:rq,FST_ERR_LOG_INVALID_LOGGER:nq}=He();function sq(t,e,r,n,s){let i={[t.requestIdLogLabel]:n},o=t.childLoggerFactory.call(t.server,e,i,s||{},r);return t.childLoggerFactory!==Z0&&ga(o,!0),o}function Z0(t,e,r){return t.child(e,r)}function ga(t,e){let r=["info","error","debug","fatal","warn","trace","child"],n=t?r.filter(s=>!t[s]||typeof t[s]!="function"):r;if(n.length){if(n.length===r.length&&!e)return!1;throw nq(n.join(","))}else return!0}function iq(t){if(t.logger&&t.loggerInstance)throw new eq;if(!t.loggerInstance&&!t.logger){let o=Jy();return o.child=()=>o,{logger:o,hasLogger:!1}}let{createPinoLogger:e,serializers:r}=Q0();if(ga(t.loggerInstance))return{logger:e({logger:t.loggerInstance,serializers:Object.assign({},r,t.loggerInstance.serializers)}),hasLogger:!0};if(ga(t.logger))throw tq();if(t.loggerInstance)throw rq();let n={};return Object.prototype.toString.call(t.logger)==="[object Object]"&&Reflect.ownKeys(t.logger).forEach(i=>{Object.defineProperty(n,i,{value:t.logger[i],writable:!0,enumerable:!0,configurable:!0})}),n.level=n.level||"info",n.serializers=Object.assign({},r,n.serializers),t.logger=n,{logger:e(t.logger),hasLogger:!0}}function oq(){let t=process.hrtime();return t[0]*1e3+t[1]/1e6}eS.exports={createChildLogger:sq,defaultChildLoggerFactory:Z0,createLogger:iq,validateLogger:ga,now:oq}});var ya=E((qK,tS)=>{"use strict";tS.exports=aq;function rs(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function aq(t){if(t=t||{},t.circles)return lq(t);let e=new Map;if(e.set(Date,o=>new Date(o)),e.set(Map,(o,a)=>new Map(n(Array.from(o),a))),e.set(Set,(o,a)=>new Set(n(Array.from(o),a))),t.constructorHandlers)for(let o of t.constructorHandlers)e.set(o[0],o[1]);let r=null;return t.proto?i:s;function n(o,a){let l=Object.keys(o),u=new Array(l.length);for(let c=0;c<l.length;c++){let f=l[c],p=o[f];typeof p!="object"||p===null?u[f]=p:p.constructor!==Object&&(r=e.get(p.constructor))?u[f]=r(p,a):ArrayBuffer.isView(p)?u[f]=rs(p):u[f]=a(p)}return u}function s(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,s);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,s);let a={};for(let l in o){if(Object.hasOwnProperty.call(o,l)===!1)continue;let u=o[l];typeof u!="object"||u===null?a[l]=u:u.constructor!==Object&&(r=e.get(u.constructor))?a[l]=r(u,s):ArrayBuffer.isView(u)?a[l]=rs(u):a[l]=s(u)}return a}function i(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return n(o,i);if(o.constructor!==Object&&(r=e.get(o.constructor)))return r(o,i);let a={};for(let l in o){let u=o[l];typeof u!="object"||u===null?a[l]=u:u.constructor!==Object&&(r=e.get(u.constructor))?a[l]=r(u,i):ArrayBuffer.isView(u)?a[l]=rs(u):a[l]=i(u)}return a}}function lq(t){let e=[],r=[],n=new Map;if(n.set(Date,l=>new Date(l)),n.set(Map,(l,u)=>new Map(i(Array.from(l),u))),n.set(Set,(l,u)=>new Set(i(Array.from(l),u))),t.constructorHandlers)for(let l of t.constructorHandlers)n.set(l[0],l[1]);let s=null;return t.proto?a:o;function i(l,u){let c=Object.keys(l),f=new Array(c.length);for(let p=0;p<c.length;p++){let h=c[p],d=l[h];if(typeof d!="object"||d===null)f[h]=d;else if(d.constructor!==Object&&(s=n.get(d.constructor)))f[h]=s(d,u);else if(ArrayBuffer.isView(d))f[h]=rs(d);else{let m=e.indexOf(d);m!==-1?f[h]=r[m]:f[h]=u(d)}}return f}function o(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return i(l,o);if(l.constructor!==Object&&(s=n.get(l.constructor)))return s(l,o);let u={};e.push(l),r.push(u);for(let c in l){if(Object.hasOwnProperty.call(l,c)===!1)continue;let f=l[c];if(typeof f!="object"||f===null)u[c]=f;else if(f.constructor!==Object&&(s=n.get(f.constructor)))u[c]=s(f,o);else if(ArrayBuffer.isView(f))u[c]=rs(f);else{let p=e.indexOf(f);p!==-1?u[c]=r[p]:u[c]=o(f)}}return e.pop(),r.pop(),u}function a(l){if(typeof l!="object"||l===null)return l;if(Array.isArray(l))return i(l,a);if(l.constructor!==Object&&(s=n.get(l.constructor)))return s(l,a);let u={};e.push(l),r.push(u);for(let c in l){let f=l[c];if(typeof f!="object"||f===null)u[c]=f;else if(f.constructor!==Object&&(s=n.get(f.constructor)))u[c]=s(f,a);else if(ArrayBuffer.isView(f))u[c]=rs(f);else{let p=e.indexOf(f);p!==-1?u[c]=r[p]:u[c]=a(f)}}return e.pop(),r.pop(),u}}});var ui=E((jK,oS)=>{"use strict";var uq=ya()({circles:!1,proto:!0}),{kSchemaVisited:rS,kSchemaResponse:cq}=De(),pf=Symbol.for("fluent-schema-object"),{FST_ERR_SCH_MISSING_ID:fq,FST_ERR_SCH_ALREADY_PRESENT:dq,FST_ERR_SCH_DUPLICATE:hq,FST_ERR_SCH_CONTENT_MISSING_SCHEMA:nS}=He(),iS=["params","body","querystring","query","headers"];function _a(t){this.store=t||{}}_a.prototype.add=function(t){let e=uq(t.isFluentSchema||t.isFluentJSONSchema||t[pf]?t.valueOf():t),r=e.$id;if(!r)throw new fq;if(this.store[r])throw new dq(r);this.store[r]=e};_a.prototype.getSchemas=function(){return Object.assign({},this.store)};_a.prototype.getSchema=function(t){return this.store[t]};function sS(t){return typeof t=="object"&&Object.getPrototypeOf(t)!==Object.prototype}function pq(t,e){if(t[rS])return t;if(t.query){if(t.querystring)throw new hq("querystring");t.querystring=t.query}mq(t);for(let r of iS){let n=t[r];if(n&&!sS(n)&&r==="body"&&n.content){let s=n.content,i=Object.keys(s);for(let o=0;o<i.length;o++){let a=i[o];if(!s[a].schema)throw new nS(a)}continue}}if(t.response){let r=Object.keys(t.response);for(let n of r){if(sS(t.response[n]))continue;let s=t.response[n].content;if(s){let i=Object.keys(s);for(let o=0;o<i.length;o++){let a=i[o];if(!s[a].schema)throw new nS(a)}}}}return t[rS]=!0,t}function mq(t){for(let e of iS)t[e]&&(t[e].isFluentSchema||t[e][pf])&&(t[e]=t[e].valueOf());if(t.response){let e=Object.keys(t.response);for(let r of e)(t.response[r].isFluentSchema||t.response[r][pf])&&(t.response[r]=t.response[r].valueOf())}}function gq(t,e,r){let n=t[cq];if(!n)return!1;if(n[e]){if(n[e].constructor===Object&&r){let i=r.split(";",1)[0];return n[e][i]?n[e][i]:n[e]["*/*"]?n[e]["*/*"]:!1}return n[e]}let s=(e+"")[0]+"xx";if(n[s]){if(n[s].constructor===Object&&r){let i=r.split(";",1)[0];return n[s][i]?n[s][i]:n[s]["*/*"]?n[s]["*/*"]:!1}return n[s]}if(n.default){if(n.default.constructor===Object&&r){let i=r.split(";",1)[0];return n.default[i]?n.default[i]:n.default["*/*"]?n.default["*/*"]:!1}return n.default}return!1}oS.exports={buildSchemas(t){return new _a(t)},getSchemaSerializer:gq,normalizeSchema:pq}});var Sa=E((DK,lS)=>{"use strict";var yq=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;lS.exports=class aS{constructor(e){switch(e&&e.rounding){case"floor":this.parseInteger=Math.floor;break;case"ceil":this.parseInteger=Math.ceil;break;case"round":this.parseInteger=Math.round;break;case"trunc":default:this.parseInteger=Math.trunc;break}this._options=e}asInteger(e){if(Number.isInteger(e))return""+e;if(typeof e=="bigint")return e.toString();let r=this.parseInteger(e);if(r===1/0||r===-1/0||r!==r)throw new Error(`The value "${e}" cannot be converted to an integer.`);return""+r}asNumber(e){let r=Number(e);if(r!==r)throw new Error(`The value "${e}" cannot be converted to a number.`);return r===1/0||r===-1/0?"null":""+r}asBoolean(e){return e&&"true"||"false"}asDateTime(e){if(e===null)return'""';if(e instanceof Date)return'"'+e.toISOString()+'"';if(typeof e=="string")return'"'+e+'"';throw new Error(`The value "${e}" cannot be converted to a date-time.`)}asDate(e){if(e===null)return'""';if(e instanceof Date)return'"'+new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,10)+'"';if(typeof e=="string")return'"'+e+'"';throw new Error(`The value "${e}" cannot be converted to a date.`)}asTime(e){if(e===null)return'""';if(e instanceof Date)return'"'+new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(11,19)+'"';if(typeof e=="string")return'"'+e+'"';throw new Error(`The value "${e}" cannot be converted to a time.`)}asString(e){let r=e.length;if(r===0)return'""';if(r<42){let n="",s=-1,i=255;for(let o=0;o<r;o++)if(i=e.charCodeAt(o),i===34||i===92)s===-1&&(s=0),n+=e.slice(s,o)+"\\",s=o;else if(i<32||i>=55296&&i<=57343)return JSON.stringify(e);return s===-1&&'"'+e+'"'||'"'+n+e.slice(s)+'"'}else return r<5e3&&yq.test(e)===!1?'"'+e+'"':JSON.stringify(e)}asUnsafeString(e){return'"'+e+'"'}getState(){return this._options}static restoreFromState(e){return new aS(e)}}});var cS=E((FK,uS)=>{"use strict";var _q=Sa(),Sq={mode:"standalone"},Eq=_q.restoreFromState(Sq),bq=null;uS.exports=function(e,r){let{asString:n,asNumber:s,asBoolean:i,asDateTime:o,asDate:a,asTime:l,asUnsafeString:u}=r,c=r.asInteger.bind(r),f="{",p="}",h="[",d="]",m=",",g=":",S='"',b=f+p,_=h+d,y=S+S,R="null";function T(w){let $=w&&typeof w.toJSON=="function"?w.toJSON():w;if($===null)return b;let v,P=f,C=!1;return v=$.statusCode,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"statusCode":',P+=s(v)),v=$.code,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"code":',typeof v!="string"?v===null?P+=y:v instanceof Date?P+=S+v.toISOString()+S:v instanceof RegExp?P+=n(v.source):P+=n(v.toString()):P+=n(v)),v=$.error,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"error":',typeof v!="string"?v===null?P+=y:v instanceof Date?P+=S+v.toISOString()+S:v instanceof RegExp?P+=n(v.source):P+=n(v.toString()):P+=n(v)),v=$.message,v!==void 0&&(!C&&(C=!0)||(P+=m),P+='"message":',typeof v!="string"?v===null?P+=y:v instanceof Date?P+=S+v.toISOString()+S:v instanceof RegExp?P+=n(v.source):P+=n(v.toString()):P+=n(v)),P+p}return T}(bq,Eq)});var ci=E((MK,pS)=>{"use strict";var fS=V("node:http").STATUS_CODES,vq=hc(),{setErrorStatusCode:wq}=Bo(),{kReplyHeaders:_n,kReplyNextErrorHandler:Ea,kReplyIsRunningOnErrorHook:Rq,kRouteContext:hS,kDisableRequestLogging:ba}=De(),{FST_ERR_REP_INVALID_PAYLOAD_TYPE:Oq,FST_ERR_FAILED_ERROR_SERIALIZATION:Tq}=He(),{getSchemaSerializer:$q}=ui(),mf=cS(),Pq={func:Cq,toJSON(){return this.func.name.toString()+"()"}};function Aq(t,e,r){t[Rq]=!1;let n=t[hS];if(t[Ea]===!1){dS(e,t,function(o,a){try{o.raw.writeHead(o.raw.statusCode,o[_n])}catch(l){o.log[ba]||o.log.warn({req:o.request,res:o,err:l},l?.message),o.raw.writeHead(o.raw.statusCode)}o.raw.end(a)});return}let s=t[Ea]||n.errorHandler;t[Ea]=Object.getPrototypeOf(s),delete t[_n]["content-type"],delete t[_n]["content-length"];let i=s.func;if(!i){t[Ea]=!1,dS(e,t,r);return}try{let o=i(e,t.request,t);o!==void 0&&(o!==null&&typeof o.then=="function"?vq(o,t):t.send(o))}catch(o){t.send(o)}}function Cq(t,e,r){Nq(t,r),wq(r,t),r.statusCode<500?r.log[ba]||r.log.info({res:r,err:t},t?.message):r.log[ba]||r.log.error({req:e,res:r,err:t},t?.message),r.send(t)}function dS(t,e,r){let n=e.raw,s=e.statusCode;e[_n]["content-type"]=e[_n]["content-type"]??"application/json; charset=utf-8";let i;try{let o=$q(e[hS],s,e[_n]["content-type"]);o===!1?i=mf({error:fS[s+""],code:t.code,message:t.message,statusCode:s}):i=o(Object.create(t,{error:{value:fS[s+""]},message:{value:t.message},statusCode:{value:s}}))}catch(o){e.log[ba]||e.log.error({err:o,statusCode:n.statusCode},"The serializer for the given status code failed"),e.code(500),i=mf(new Tq(o.message,t.message))}typeof i!="string"&&!Buffer.isBuffer(i)&&(i=mf(new Oq(typeof i))),e[_n]["content-length"]=""+Buffer.byteLength(i),r(e,i)}function Iq(t=Pq,e){if(!e)return t;let r=Object.create(t);return r.func=e,r}function Nq(t,e){let r=e.raw,n=r.statusCode;n=n>=400?n:500,t!=null&&(t.headers!==void 0&&e.headers(t.headers),t.status>=400?n=t.status:t.statusCode>=400&&(n=t.statusCode)),r.statusCode=n}pS.exports={buildErrorHandler:Iq,handleError:Aq}});var hi=E((HK,_S)=>{"use strict";var{kReply:gf,kRequest:yf,kState:kq,kHasBeenDecorated:xq}=De(),{FST_ERR_DEC_ALREADY_PRESENT:mS,FST_ERR_DEC_MISSING_DEPENDENCY:Lq,FST_ERR_DEC_AFTER_START:qq,FST_ERR_DEC_REFERENCE_TYPE:jq,FST_ERR_DEC_DEPENDENCY_INVALID_TYPE:Dq,FST_ERR_DEC_UNDECLARED:Fq}=He();function Mq(t,e,r,n){if(Object.hasOwn(t,e))throw new mS(e);_f(t,e,n),r&&(typeof r.getter=="function"||typeof r.setter=="function")?Object.defineProperty(t,e,{get:r.getter,set:r.setter}):t[e]=r}function Hq(t){if(!fi(this,t))throw new Fq(t,"instance");return typeof this[t]=="function"?this[t].bind(this):this[t]}function gS(t,e,r,n){let s=t.prototype;if(Object.hasOwn(s,e)||di(t,e))throw new mS(e);t[xq]=!0,_f(t,e,n),r&&(typeof r.getter=="function"||typeof r.setter=="function")?Object.defineProperty(s,e,{get:r.getter,set:r.setter}):typeof r=="function"?s[e]=r:t.props.push({key:e,value:r})}function yS(t,e){if(typeof e=="object"&&e&&!(typeof e.getter=="function"||typeof e.setter=="function"))throw new jq(t,typeof e)}function Vq(t,e,r){return Sf(this,t),Mq(this,t,e,r),this}function fi(t,e){return e?e in t||t.prototype&&e in t.prototype||di(t,e):t in this}function di(t,e){return t.props?t.props.find(({key:r})=>r===e):!1}function zq(t){return t&&di(this[yf],t)?!0:fi(this[yf].prototype,t)}function Uq(t){return t&&di(this[gf],t)?!0:fi(this[gf].prototype,t)}function _f(t,e,r){if(r!=null){if(!Array.isArray(r))throw new Dq(e);for(let n=0;n!==r.length;++n)if(!fi(t,r[n]))throw new Lq(r[n])}}function Bq(t,e,r){return Sf(this,t),yS(t,e),gS(this[gf],t,e,r),this}function Gq(t,e,r){return Sf(this,t),yS(t,e),gS(this[yf],t,e,r),this}function Sf(t,e){if(t[kq].started)throw new qq(e)}_S.exports={add:Vq,exist:fi,existRequest:zq,existReply:Uq,dependencies:_f,decorateReply:Bq,decorateRequest:Gq,getInstanceDecorator:Hq,hasKey:di}});var Aa=E((VK,Pa)=>{"use strict";var va=V("node:stream").finished,{kFourOhFourContext:SS,kReplyErrorHandlerCalled:TS,kReplyHijacked:Rf,kReplyStartTime:mi,kReplyEndTime:Of,kReplySerializer:Sr,kReplySerializerDefault:wa,kReplyIsError:Ra,kReplyHeaders:ge,kReplyTrailers:Ve,kReplyHasStatusCode:Tf,kReplyIsRunningOnErrorHook:$f,kReplyNextErrorHandler:Wq,kDisableRequestLogging:$S,kSchemaResponse:Oa,kReplyCacheSerializeFns:Vr,kSchemaController:Ef,kOptions:Jq,kRouteContext:ne}=De(),{onSendHookRunner:PS,onResponseHookRunner:Kq,preHandlerHookRunner:Yq,preSerializationHookRunner:Xq}=Fr(),ES=Ec()[Symbol.for("internals")],Qq=li(),wf=Qq.now,{handleError:bS}=ci(),{getSchemaSerializer:Zq}=ui(),bf={JSON:"application/json; charset=utf-8",PLAIN:"text/plain; charset=utf-8",OCTET:"application/octet-stream"},{FST_ERR_REP_INVALID_PAYLOAD_TYPE:ej,FST_ERR_REP_RESPONSE_BODY_CONSUMED:tj,FST_ERR_REP_READABLE_STREAM_LOCKED:rj,FST_ERR_REP_ALREADY_SENT:nj,FST_ERR_SEND_INSIDE_ONERR:sj,FST_ERR_BAD_STATUS_CODE:ij,FST_ERR_BAD_TRAILER_NAME:oj,FST_ERR_BAD_TRAILER_VALUE:aj,FST_ERR_MISSING_SERIALIZATION_FN:lj,FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN:uj,FST_ERR_DEC_UNDECLARED:cj}=He(),vS=hi(),AS=Object.prototype.toString;function ye(t,e,r){this.raw=t,this[Sr]=null,this[TS]=!1,this[Ra]=!1,this[$f]=!1,this.request=e,this[ge]={},this[Ve]=null,this[Tf]=!1,this[mi]=void 0,this.log=r}ye.props=[];Object.defineProperties(ye.prototype,{[ne]:{get(){return this.request[ne]}},elapsedTime:{get(){return this[mi]===void 0?0:(this[Of]||wf())-this[mi]}},server:{get(){return this.request[ne].server}},sent:{enumerable:!0,get(){return(this[Rf]||this.raw.writableEnded)===!0}},statusCode:{get(){return this.raw.statusCode},set(t){this.code(t)}},routeOptions:{get(){return this.request.routeOptions}}});ye.prototype.writeEarlyHints=function(t,e){return this.raw.writeEarlyHints(t,e),this};ye.prototype.hijack=function(){return this[Rf]=!0,this};ye.prototype.send=function(t){if(this[$f])throw new sj;if(this.sent===!0)return this.log.warn({err:new nj(this.request.url,this.request.method)}),this;if(this[Ra]||t instanceof Error)return this[Ra]=!1,ns(this,t,Sn),this;if(t===void 0)return Sn(this,t),this;let e=this.getHeader("content-type"),r=e!==void 0;if(t!==null){if(typeof t.pipe=="function"||typeof t.getReader=="function"||AS.call(t)==="[object Response]")return Sn(this,t),this;if(t.buffer instanceof ArrayBuffer){r||(this[ge]["content-type"]=bf.OCTET);let n=Buffer.isBuffer(t)?t:Buffer.from(t.buffer,t.byteOffset,t.byteLength);return Sn(this,n),this}if(!r&&typeof t=="string")return this[ge]["content-type"]=bf.PLAIN,Sn(this,t),this}if(this[Sr]!==null){if(typeof t!="string")return wS(this,t),this;t=this[Sr](t)}else if(!r||e.indexOf("json")!==-1){if(!r)this[ge]["content-type"]=bf.JSON;else if(e.indexOf("charset")===-1){let n=e.trim();n.endsWith(";")?this[ge]["content-type"]=`${n} charset=utf-8`:this[ge]["content-type"]=`${n}; charset=utf-8`}if(typeof t!="string")return wS(this,t),this}return Sn(this,t),this};ye.prototype.getHeader=function(t){t=t.toLowerCase();let e=this[ge][t];return e!==void 0?e:this.raw.getHeader(t)};ye.prototype.getHeaders=function(){return{...this.raw.getHeaders(),...this[ge]}};ye.prototype.hasHeader=function(t){return t=t.toLowerCase(),this[ge][t]!==void 0||this.raw.hasHeader(t)};ye.prototype.removeHeader=function(t){return delete this[ge][t.toLowerCase()],this};ye.prototype.header=function(t,e=""){return t=t.toLowerCase(),this[ge][t]&&t==="set-cookie"?(typeof this[ge][t]=="string"&&(this[ge][t]=[this[ge][t]]),Array.isArray(e)?Array.prototype.push.apply(this[ge][t],e):this[ge][t].push(e)):this[ge][t]=e,this};ye.prototype.headers=function(t){let e=Object.keys(t);for(let r=0;r!==e.length;++r){let n=e[r];this.header(n,t[n])}return this};var fj=new Set(["transfer-encoding","content-length","host","cache-control","max-forwards","te","authorization","set-cookie","content-encoding","content-type","content-range","trailer"]);ye.prototype.trailer=function(t,e){if(t=t.toLowerCase(),fj.has(t))throw new oj(t);if(typeof e!="function")throw new aj(t,typeof e);return this[Ve]===null&&(this[Ve]={}),this[Ve][t]=e,this};ye.prototype.hasTrailer=function(t){return this[Ve]?.[t.toLowerCase()]!==void 0};ye.prototype.removeTrailer=function(t){return this[Ve]===null?this:(this[Ve][t.toLowerCase()]=void 0,this)};ye.prototype.code=function(t){let e=+t;if(!(e>=100&&e<=599))throw new ij(t||String(t));return this.raw.statusCode=e,this[Tf]=!0,this};ye.prototype.status=ye.prototype.code;ye.prototype.getSerializationFunction=function(t,e){let r;return typeof t=="string"||typeof t=="number"?typeof e=="string"?r=this[ne][Oa]?.[t]?.[e]:r=this[ne][Oa]?.[t]:typeof t=="object"&&(r=this[ne][Vr]?.get(t)),r};ye.prototype.compileSerializationSchema=function(t,e=null,r=null){let{request:n}=this,{method:s,url:i}=n;if(this[ne][Vr]?.has(t))return this[ne][Vr].get(t);let a=(this[ne].serializerCompiler||this.server[Ef].serializerCompiler||this.server[Ef].setupSerializer(this.server[Jq])||this.server[Ef].serializerCompiler)({schema:t,method:s,url:i,httpStatus:e,contentType:r});return this[ne][Vr]==null&&(this[ne][Vr]=new WeakMap),this[ne][Vr].set(t,a),a};ye.prototype.serializeInput=function(t,e,r,n){let s=r,i;if(r=typeof e=="string"||typeof e=="number"?e:r,n=r&&s!==r?s:n,r!=null){if(n!=null?i=this[ne][Oa]?.[r]?.[n]:i=this[ne][Oa]?.[r],i==null)throw n?new uj(r,n):new lj(r)}else this[ne][Vr]?.has(e)?i=this[ne][Vr].get(e):i=this.compileSerializationSchema(e,r,n);return i(t)};ye.prototype.serialize=function(t){return this[Sr]!==null?this[Sr](t):this[ne]&&this[ne][wa]?this[ne][wa](t,this.raw.statusCode):IS(this[ne],t,this.raw.statusCode)};ye.prototype.serializer=function(t){return this[Sr]=t,this};ye.prototype.type=function(t){return this[ge]["content-type"]=t,this};ye.prototype.redirect=function(t,e){return e||(e=this[Tf]?this.raw.statusCode:302),this.header("location",t).code(e).send()};ye.prototype.callNotFound=function(){return Sj(this),this};ye.prototype.then=function(t,e){if(this.sent){t();return}va(this.raw,r=>{r&&r.code!=="ERR_STREAM_PREMATURE_CLOSE"?e?e(r):this.log&&this.log.warn("unhandled rejection on reply.then"):t()})};ye.prototype.getDecorator=function(t){if(!vS.hasKey(this,t)&&!vS.exist(this,t))throw new cj(t,"reply");let e=this[t];return typeof e=="function"?e.bind(this):e};function wS(t,e){t[ne].preSerialization!==null?Xq(t[ne].preSerialization,t.request,t,e,RS):RS(null,void 0,t,e)}function RS(t,e,r,n){if(t!=null){ns(r,t);return}try{r[Sr]!==null?n=r[Sr](n):r[ne]&&r[ne][wa]?n=r[ne][wa](n,r.raw.statusCode):n=IS(r[ne],n,r.raw.statusCode,r[ge]["content-type"])}catch(s){dj(s,r),ns(r,s);return}Sn(r,n)}function dj(t,e){t.serialization=e[ne].config}function Sn(t,e){t[ne].onSend!==null?PS(t[ne].onSend,t.request,t,e,hj):CS(t,e)}function hj(t,e,r,n){t!=null?ns(r,t):CS(r,n)}function vf(t,e){let r=t.raw;try{r.writeHead(e,t[ge])}catch(n){throw n.code==="ERR_HTTP_HEADERS_SENT"&&t.log.warn(`Reply was already sent, did you forget to "return reply" in the "${t.request.raw.url}" (${t.request.raw.method}) route?`),n}}function CS(t,e){let r=t.raw,n=t.request;if(t[Ve]!==null){let i=Object.keys(t[Ve]),o="";for(let a of i)typeof t[Ve][a]=="function"&&(o+=" ",o+=a);t.header("Transfer-Encoding","chunked"),t.header("Trailer",o.trim())}if(AS.call(e)==="[object Response]"){if(typeof e.status=="number"&&t.code(e.status),typeof e.headers=="object"&&typeof e.headers.forEach=="function")for(let[i,o]of e.headers)t.header(i,o);if(e.body!==null&&e.bodyUsed)throw new tj;e=e.body}let s=r.statusCode;if(e==null){s>=200&&s!==204&&s!==304&&n.method!=="HEAD"&&t[Ve]===null&&(t[ge]["content-length"]="0"),vf(t,s),pi(e,r,t);return}if(s>=100&&s<200||s===204){t.removeHeader("content-type"),t.removeHeader("content-length"),vf(t,s),pi(void 0,r,t),typeof e.resume=="function"&&(e.on("error",$a),e.resume());return}if(typeof e.pipe=="function"){mj(e,r,t);return}if(typeof e.getReader=="function"){pj(e,r,t);return}if(typeof e!="string"&&!Buffer.isBuffer(e))throw new ej(typeof e);if(t[Ve]===null){let i=t[ge]["content-length"];(!i||n.raw.method!=="HEAD"&&Number(i)!==Buffer.byteLength(e))&&(t[ge]["content-length"]=""+Buffer.byteLength(e))}vf(t,s),r.write(e),pi(e,r,t)}function Ta(t,e,r){e.code==="ERR_STREAM_PREMATURE_CLOSE"?t[$S]||t.info({res:r},"stream closed prematurely"):t.warn({err:e},"response terminated with an error with headers already sent")}function pj(t,e,r){if(t.locked)throw new rj;let n=!0,s=!1,i=t.getReader();if(va(e,function(l){n&&(l!=null&&e.headersSent&&!s&&(s=!0,Ta(r.log,l,e)),i.cancel().catch($a))}),e.headersSent)r.log.warn("response will send, but you shouldn't use res.writeHead in stream mode");else for(let l in r[ge])e.setHeader(l,r[ge][l]);function o(l){if(l.done){n=!1,pi(null,e,r);return}if(e.destroyed){n=!1,i.cancel().catch($a);return}e.write(l.value),i.read().then(o,a)}function a(l){n=!1,e.headersSent||r.request.raw.aborted===!0?(s||(s=!0,Ta(r.log,l,r)),e.destroy()):ns(r,l)}i.read().then(o,a)}function mj(t,e,r){let n=!0,s=!1;if(gj(t,e,r),va(t,{readable:!0,writable:!1},function(i){n=!1,i!=null&&(e.headersSent||r.request.raw.aborted===!0?(s||(s=!0,Ta(r.log,i,r)),e.destroy()):ns(r,i))}),va(e,function(i){n&&(i!=null&&e.headersSent&&!s&&(s=!0,Ta(r.log,i,e)),typeof t.destroy=="function"?t.destroy():typeof t.close=="function"?t.close($a):typeof t.abort=="function"?t.abort():r.log.warn("stream payload does not end properly"))}),e.headersSent)r.log.warn("response will send, but you shouldn't use res.writeHead in stream mode");else for(let i in r[ge])e.setHeader(i,r[ge][i]);t.pipe(e)}function pi(t,e,r){if(r[Ve]===null){e.end(null,null,null);return}let n=Object.keys(r[Ve]),s={},i=0,o=!0;function a(){i===0&&(e.addTrailers(s),e.end(null,null,null))}for(let l of n){let u=function(f,p){i++,f?r.log.debug(f):s[l]=p,process.nextTick(a)};if(typeof r[Ve][l]!="function")continue;o=!1,i--;let c=r[Ve][l](r,t,u);typeof c=="object"&&typeof c.then=="function"&&c.then(f=>u(null,f),u)}o&&e.end(null,null,null)}function gj(t,e,r){r[Ve]!==null&&t.on("end",()=>pi(null,e,r))}function ns(t,e,r){t[ne].onError!==null&&!t[Wq]?(t[$f]=!0,PS(t[ne].onError,t.request,t,e,()=>bS(t,e,r))):bS(t,e,r)}function yj(t){t[mi]=wf();let e=r=>{t[Of]=wf(),t.raw.removeListener("finish",e),t.raw.removeListener("error",e);let n=t[ne];n&&n.onResponse!==null?Kq(n.onResponse,t.request,t,OS):OS(r,t.request,t)};t.raw.on("finish",e),t.raw.on("error",e)}function OS(t,e,r){if(r.log[$S])return;let n=r.elapsedTime;if(t!=null){r.log.error({res:r,err:t,responseTime:n},"request errored");return}r.log.info({res:r,responseTime:n},"request completed")}function _j(t){let e=t.props.slice();function r(n,s,i){this.raw=n,this[Ra]=!1,this[TS]=!1,this[Rf]=!1,this[Sr]=null,this.request=s,this[ge]={},this[Ve]=null,this[mi]=void 0,this[Of]=void 0,this.log=i;let o;for(let a=0;a<e.length;a++)o=e[a],this[o.key]=o.value}return Object.setPrototypeOf(r.prototype,t.prototype),Object.setPrototypeOf(r,t),r.parent=t,r.props=e,r}function Sj(t){if(t[ne][SS]===null){t.log.warn("Trying to send a NotFound error inside a 404 handler. Sending basic 404 response."),t.code(404).send("404 Not Found");return}t.request[ne]=t[ne][SS],t[ne].preHandler!==null?Yq(t[ne].preHandler,t.request,t,ES.preHandlerCallback):ES.preHandlerCallback(null,t.request,t)}function IS(t,e,r,n){let s=Zq(t,r,n);return s?s(e):JSON.stringify(e)}function $a(){}Pa.exports=ye;Pa.exports.buildReply=_j;Pa.exports.setupResponseListeners=yj});var NS=E((zK,Ca)=>{"use strict";function Pf(t){if(!t)throw new TypeError("argument req is required");let e=t.headers["x-forwarded-for"],r=t.socket.remoteAddress;if(!e||typeof e!="string")return[r];if(e.indexOf(",")===-1){let n=e.trim();return n.length?[r,n]:[r]}else return Ej(e,r)}function Ej(t,e){let r=[e],n=t.length,s=n,i,o;for(o=n-1;o>=0;--o)i=t[o],i===" "?s===n&&(s=n=o):i===","?(s!==n&&r.push(t.slice(s,n)),s=n=o):s=o;return s!==n&&r.push(t.substring(s,n)),r}Ca.exports=Pf;Ca.exports.default=Pf;Ca.exports.forwarded=Pf});var xS=E((kS,Ia)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),i="%[0-9a-z]{1,}",o="(?:[0-9a-f]+::?)+",a={zoneIndex:new RegExp(i,"i"),native:new RegExp(`^(::)?(${o})?([0-9a-f]+)?(::)?(${i})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${i})?)$`,"i"),transitional:new RegExp(`^((?:${o})|(?:::)(?:${o})?)${e}\\.${e}\\.${e}\\.${e}(${i})?$`,"i")};function l(h,d){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let m=0,g=-1,S=(h.match(a.zoneIndex)||[])[0],b,_;for(S&&(S=S.substring(1),h=h.replace(/%.+$/,""));(g=h.indexOf(":",g+1))>=0;)m++;if(h.substr(0,2)==="::"&&m--,h.substr(-2,2)==="::"&&m--,m>d)return null;for(_=d-m,b=":";_--;)b+="0:";return h=h.replace("::",b),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),d=function(){let y=h.split(":"),R=[];for(let T=0;T<y.length;T++)R.push(parseInt(y[T],16));return R}(),{parts:d,zoneId:S}}function u(h,d,m,g){if(h.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let S=0,b;for(;g>0;){if(b=m-g,b<0&&(b=0),h[S]>>b!==d[S]>>b)return!1;g-=m,S+=1}return!0}function c(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(n.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function f(h,d){for(;h.length<d;)h=`0${h}`;return h}let p={};p.IPv4=function(){function h(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let m,g;for(m=0;m<d.length;m++)if(g=d[m],!(0<=g&&g<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]],as112:[[new h([192,175,48,0]),24],[new h([192,31,196,0]),24]],amt:[[new h([192,52,193,0]),24]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(d,m){let g;if(m===void 0&&(g=d,d=g[0],m=g[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return u(this.octets,d.octets,8,m)},h.prototype.prefixLengthFromSubnetMask=function(){let d=0,m=!1,g={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},S,b,_;for(S=3;S>=0;S-=1)if(b=this.octets[S],b in g){if(_=g[b],m&&_!==0)return null;_!==8&&(m=!0),d+=_}else return null;return 32-d},h.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),p.IPv4.broadcastAddressFromCIDR=function(h){try{let d=this.parseCIDR(h),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],b=0;for(;b<4;)S.push(parseInt(m[b],10)|parseInt(g[b],10)^255),b++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},p.IPv4.isIPv4=function(h){return this.parser(h)!==null},p.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(h){try{return this.parseCIDR(h),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(h){return!!(p.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(h){let d=h.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(h)||!d?!1:p.IPv4.isValidFourPartDecimal(d[1])},p.IPv4.networkAddressFromCIDR=function(h){let d,m,g,S,b;try{for(d=this.parseCIDR(h),g=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],m=0;m<4;)S.push(parseInt(g[m],10)&parseInt(b[m],10)),m++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},p.IPv4.parse=function(h){let d=this.parser(h);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},p.IPv4.parseCIDR=function(h){let d;if(d=h.match(/^(.+)\/(\d+)$/)){let m=parseInt(d[2]);if(m>=0&&m<=32){let g=[this.parse(d[1]),m];return Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},p.IPv4.parser=function(h){let d,m,g;if(d=h.match(r.fourOctet))return function(){let S=d.slice(1,6),b=[];for(let _=0;_<S.length;_++)m=S[_],b.push(c(m));return b}();if(d=h.match(r.longValue)){if(g=c(d[1]),g>4294967295||g<0)throw new Error("ipaddr: address outside defined range");return function(){let S=[],b;for(b=0;b<=24;b+=8)S.push(g>>b&255);return S}().reverse()}else return(d=h.match(r.twoOctet))?function(){let S=d.slice(1,4),b=[];if(g=c(S[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return b.push(c(S[0])),b.push(g>>16&255),b.push(g>>8&255),b.push(g&255),b}():(d=h.match(r.threeOctet))?function(){let S=d.slice(1,5),b=[];if(g=c(S[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return b.push(c(S[0])),b.push(c(S[1])),b.push(g>>8&255),b.push(g&255),b}():null},p.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],m=0,g=Math.floor(h/8);for(;m<g;)d[m]=255,m++;return g<4&&(d[g]=Math.pow(2,h%8)-1<<8-h%8),new this(d)},p.IPv6=function(){function h(d,m){let g,S;if(d.length===16)for(this.parts=[],g=0;g<=14;g+=2)this.parts.push(d[g]<<8|d[g+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(g=0;g<this.parts.length;g++)if(S=this.parts[g],!(0<=S&&S<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");m&&(this.zoneId=m)}return h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],discard:[new h([256,0,0,0,0,0,0,0]),64],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[[new h([8193,4,274,0,0,0,0,0]),48],[new h([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new h([8193,48,0,0,0,0,0,0]),28],reserved:[[new h([8193,0,0,0,0,0,0,0]),23],[new h([8193,3512,0,0,0,0,0,0]),32]]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(d,m){let g;if(m===void 0&&(g=d,d=g[0],m=g[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return u(this.parts,d.parts,16,m)},h.prototype.prefixLengthFromSubnetMask=function(){let d=0,m=!1,g={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},S,b;for(let _=7;_>=0;_-=1)if(S=this.parts[_],S in g){if(b=g[S],m&&b!==0)return null;b!==16&&(m=!0),d+=b}else return null;return 128-d},h.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let d,m=[],g=this.parts;for(let S=0;S<g.length;S++)d=g[S],m.push(d>>8),m.push(d&255);return m},h.prototype.toFixedLengthString=function(){let d=function(){let g=[];for(let S=0;S<this.parts.length;S++)g.push(f(this.parts[S].toString(16),4));return g}.call(this).join(":"),m="";return this.zoneId&&(m=`%${this.zoneId}`),d+m},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),m=d[0],g=d[1];return new p.IPv4([m>>8,m&255,g>>8,g&255])},h.prototype.toNormalizedString=function(){let d=function(){let g=[];for(let S=0;S<this.parts.length;S++)g.push(this.parts[S].toString(16));return g}.call(this).join(":"),m="";return this.zoneId&&(m=`%${this.zoneId}`),d+m},h.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,m=this.toNormalizedString(),g=0,S=-1,b;for(;b=d.exec(m);)b[0].length>S&&(g=b.index,S=b[0].length);return S<0?m:`${m.substring(0,g)}::${m.substring(g+S)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),p.IPv6.broadcastAddressFromCIDR=function(h){try{let d=this.parseCIDR(h),m=d[0].toByteArray(),g=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],b=0;for(;b<16;)S.push(parseInt(m[b],10)|parseInt(g[b],10)^255),b++;return new this(S)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},p.IPv6.isIPv6=function(h){return this.parser(h)!==null},p.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{let d=this.parser(h);return new this(d.parts,d.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{return this.parseCIDR(h),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(h){let d,m,g,S,b;try{for(d=this.parseCIDR(h),g=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),S=[],m=0;m<16;)S.push(parseInt(g[m],10)&parseInt(b[m],10)),m++;return new this(S)}catch(_){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${_})`)}},p.IPv6.parse=function(h){let d=this.parser(h);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},p.IPv6.parseCIDR=function(h){let d,m,g;if((m=h.match(/^(.+)\/(\d+)$/))&&(d=parseInt(m[2]),d>=0&&d<=128))return g=[this.parse(m[1]),d],Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},p.IPv6.parser=function(h){let d,m,g,S,b,_;if(g=h.match(a.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(a.native.test(h))return l(h,8);if((g=h.match(a.transitional))&&(_=g[6]||"",d=g[1],g[1].endsWith("::")||(d=d.slice(0,-1)),d=l(d+_,6),d.parts)){for(b=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],m=0;m<b.length;m++)if(S=b[m],!(0<=S&&S<=255))return null;return d.parts.push(b[0]<<8|b[1]),d.parts.push(b[2]<<8|b[3]),{parts:d.parts,zoneId:d.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=0,g=Math.floor(h/8);for(;m<g;)d[m]=255,m++;return g<16&&(d[g]=Math.pow(2,h%8)-1<<8-h%8),new this(d)},p.fromByteArray=function(h){let d=h.length;if(d===4)return new p.IPv4(h);if(d===16)return new p.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},p.isValid=function(h){return p.IPv6.isValid(h)||p.IPv4.isValid(h)},p.isValidCIDR=function(h){return p.IPv6.isValidCIDR(h)||p.IPv4.isValidCIDR(h)},p.parse=function(h){if(p.IPv6.isValid(h))return p.IPv6.parse(h);if(p.IPv4.isValid(h))return p.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},p.parseCIDR=function(h){try{return p.IPv6.parseCIDR(h)}catch{try{return p.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},p.process=function(h){let d=this.parse(h);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},p.subnetMatch=function(h,d,m){let g,S,b,_;m==null&&(m="unicast");for(S in d)if(Object.prototype.hasOwnProperty.call(d,S)){for(b=d[S],b[0]&&!(b[0]instanceof Array)&&(b=[b]),g=0;g<b.length;g++)if(_=b[g],h.kind()===_[0].kind()&&h.match.apply(h,_))return S}return m},typeof Ia<"u"&&Ia.exports?Ia.exports=p:t.ipaddr=p})(kS)});var FS=E((UK,ss)=>{"use strict";ss.exports=Af;ss.exports.default=Af;ss.exports.proxyaddr=Af;ss.exports.all=jS;ss.exports.compile=DS;var bj=NS(),qS=xS(),vj=/^\d+$/u,Na=qS.isValid,ka=qS.parse,LS={linklocal:["169.254.0.0/16","fe80::/10"],loopback:["127.0.0.1/8","::1/128"],uniquelocal:["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16","fc00::/7"]};function jS(t,e){let r=bj(t);if(!e)return r;typeof e!="function"&&(e=DS(e));for(let n=0;n<r.length-1;n++)e(r[n],n)||(r.length=n+1);return r}function DS(t){if(!t)throw new TypeError("argument is required");let e;if(typeof t=="string")e=[t];else if(Array.isArray(t))e=t.slice();else throw new TypeError("unsupported trust argument");for(let r=0;r<e.length;r++)t=e[r],Object.hasOwn(LS,t)&&(t=LS[t],e.splice.apply(e,[r,1].concat(t)),r+=t.length-1);return Rj(wj(e))}function wj(t){let e=new Array(t.length);for(let r=0;r<t.length;r++)e[r]=Oj(t[r]);return e}function Rj(t){let e=t.length;return e===0?$j:e===1?Aj(t[0]):Pj(t)}function Oj(t){let e=t.lastIndexOf("/"),r=e!==-1?t.substring(0,e):t;if(!Na(r))throw new TypeError("invalid IP address: "+r);let n=ka(r);e===-1&&n.kind()==="ipv6"&&n.isIPv4MappedAddress()&&(n=n.toIPv4Address());let s=n.kind()==="ipv6"?128:32,i=e!==-1?t.substring(e+1,t.length):null;if(i===null?i=s:vj.test(i)?i=parseInt(i,10):n.kind()==="ipv4"&&Na(i)?i=Tj(i):i=null,i<=0||i>s)throw new TypeError("invalid range on address: "+t);return[n,i]}function Tj(t){let e=ka(t);return e.kind()==="ipv4"?e.prefixLengthFromSubnetMask():null}function Af(t,e){if(!t)throw new TypeError("req argument is required");if(!e)throw new TypeError("trust argument is required");let r=jS(t,e);return r[r.length-1]}function $j(){return!1}function Pj(t){return function(r){if(!Na(r))return!1;let n=ka(r),s,i=n.kind();for(let o=0;o<t.length;o++){let a=t[o],l=a[0],u=l.kind(),c=a[1],f=n;if(i!==u){let p=u==="ipv4";if(p&&!n.isIPv4MappedAddress())continue;s||(s=p?n.toIPv4Address():n.toIPv4MappedAddress()),f=s}if(f.match(l,c))return!0}return!1}}function Aj(t){let e=t[0],r=e.kind(),n=r==="ipv4",s=t[1];return function(o){if(!Na(o))return!1;let a=ka(o);if(a.kind()!==r){if(n&&!a.isIPv4MappedAddress())return!1;a=n?a.toIPv4Address():a.toIPv4MappedAddress()}return a.match(e,s)}}});var La=E((BK,kf)=>{"use strict";var xa=FS(),{kHasBeenDecorated:Cj,kSchemaBody:Ij,kSchemaHeaders:Nj,kSchemaParams:kj,kSchemaQuerystring:MS,kSchemaController:Cf,kOptions:xj,kRequestCacheValidateFns:zr,kRouteContext:Xe,kRequestOriginalUrl:If}=De(),{FST_ERR_REQ_INVALID_VALIDATION_INVOCATION:Lj,FST_ERR_DEC_UNDECLARED:qj}=He(),HS=hi(),VS={body:Ij,headers:Nj,params:kj,querystring:MS,query:MS};function Nf(t,e,r,n,s,i){this.id=t,this[Xe]=i,this.params=e,this.raw=r,this.query=n,this.log=s,this.body=void 0}Nf.props=[];function jj(t){if(typeof t=="function")return t;if(t===!0)return null;if(typeof t=="number")return function(e,r){return r<t};if(typeof t=="string"){let e=t.split(",").map(r=>r.trim());return xa.compile(e)}return xa.compile(t)}function Dj(t,e){return e?Fj(t,e):BS(t)}function BS(t){let e=t.props.slice();function r(n,s,i,o,a,l){this.id=n,this[Xe]=l,this.params=s,this.raw=i,this.query=o,this.log=a,this.body=void 0;let u;for(let c=0;c<e.length;c++)u=e[c],this[u.key]=u.value}return Object.setPrototypeOf(r.prototype,t.prototype),Object.setPrototypeOf(r,t),r.props=e,r.parent=t,r}function zS(t){let e=t.lastIndexOf(",");return e===-1?t.trim():t.slice(e+1).trim()}function Fj(t,e){let r=BS(t),n=jj(e);return r[Cj]=!0,Object.defineProperties(r.prototype,{ip:{get(){let s=xa.all(this.raw,n);return s[s.length-1]}},ips:{get(){return xa.all(this.raw,n)}},host:{get(){return this.ip!==void 0&&this.headers["x-forwarded-host"]?zS(this.headers["x-forwarded-host"]):this.headers.host??this.headers[":authority"]??""}},protocol:{get(){if(this.headers["x-forwarded-proto"])return zS(this.headers["x-forwarded-proto"]);if(this.socket)return this.socket.encrypted?"https":"http"}}}),r}function US(t,e){if(!HS.hasKey(t,e)&&!HS.exist(t,e))throw new qj(e,"request")}Object.defineProperties(Nf.prototype,{server:{get(){return this[Xe].server}},url:{get(){return this.raw.url}},originalUrl:{get(){return this[If]||(this[If]=this.raw.originalUrl||this.raw.url),this[If]}},method:{get(){return this.raw.method}},routeOptions:{get(){let t=this[Xe],e=t._parserOptions.limit,r=t.server.initialConfig.bodyLimit,n=t.server.hasConstraintStrategy("version")?this.raw.headers["accept-version"]:void 0;return{method:t.config?.method,url:t.config?.url,bodyLimit:e||r,attachValidation:t.attachValidation,logLevel:t.logLevel,exposeHeadRoute:t.exposeHeadRoute,prefixTrailingSlash:t.prefixTrailingSlash,handler:t.handler,config:t.config,schema:t.schema,version:n}}},is404:{get(){return this[Xe].config?.url===void 0}},socket:{get(){return this.raw.socket}},ip:{get(){if(this.socket)return this.socket.remoteAddress}},host:{get(){return this.raw.headers.host??this.raw.headers[":authority"]??""}},hostname:{get(){return this.host[0]==="["?this.host.slice(0,this.host.indexOf("]")+1):this.host.split(":",1)[0]}},port:{get(){let t=parseInt(this.host.split(":").slice(-1)[0]);if(!isNaN(t))return t;let e=this.headers.host??this.headers[":authority"]??"",r=parseInt(e.split(":").slice(-1)[0]);return isNaN(r)?null:r}},protocol:{get(){if(this.socket)return this.socket.encrypted?"https":"http"}},headers:{get(){return this.additionalHeaders?Object.assign({},this.raw.headers,this.additionalHeaders):this.raw.headers},set(t){this.additionalHeaders=t}},getValidationFunction:{value:function(t){if(typeof t=="string"){let e=VS[t];return this[Xe][e]}else if(typeof t=="object")return this[Xe][zr]?.get(t)}},compileValidationSchema:{value:function(t,e=null){let{method:r,url:n}=this;if(this[Xe][zr]?.has(t))return this[Xe][zr].get(t);let i=(this[Xe].validatorCompiler||this.server[Cf].validatorCompiler||this.server[Cf].setupValidator(this.server[xj])||this.server[Cf].validatorCompiler)({schema:t,method:r,url:n,httpPart:e});return this[Xe][zr]==null&&(this[Xe][zr]=new WeakMap),this[Xe][zr].set(t,i),i}},validateInput:{value:function(t,e,r){r=typeof e=="string"?e:r;let n=r!=null&&typeof r=="string"&&VS[r],s;if(n&&(s=this[Xe][n]),s==null&&(e==null||typeof e!="object"||Array.isArray(e)))throw new Lj(r);return s==null&&(this[Xe][zr]?.has(e)?s=this[Xe][zr].get(e):s=this.compileValidationSchema(e,r)),s(t)}},getDecorator:{value:function(t){US(this,t);let e=this[t];return typeof e=="function"?e.bind(this):e}},setDecorator:{value:function(t,e){US(this,t),this[t]=e}}});kf.exports=Nf;kf.exports.buildRequest=Dj});var qa=E((GK,GS)=>{"use strict";var{kFourOhFourContext:Mj,kReplySerializerDefault:Hj,kSchemaErrorFormatter:Vj,kErrorHandler:zj,kChildLoggerFactory:Uj,kOptions:Bj,kReply:Gj,kRequest:Wj,kBodyLimit:Jj,kLogLevel:Kj,kContentTypeParser:Yj,kRouteByFastify:Xj,kRequestCacheValidateFns:Qj,kReplyCacheSerializeFns:Zj}=De();function eD({schema:t,handler:e,config:r,requestIdLogLabel:n,childLoggerFactory:s,errorHandler:i,bodyLimit:o,logLevel:a,logSerializers:l,attachValidation:u,validatorCompiler:c,serializerCompiler:f,replySerializer:p,schemaErrorFormatter:h,exposeHeadRoute:d,prefixTrailingSlash:m,server:g,isFastify:S}){this.schema=t,this.handler=e,this.Reply=g[Gj],this.Request=g[Wj],this.contentTypeParser=g[Yj],this.onRequest=null,this.onSend=null,this.onError=null,this.onTimeout=null,this.preHandler=null,this.onResponse=null,this.preSerialization=null,this.onRequestAbort=null,this.config=r,this.errorHandler=i||g[zj],this.requestIdLogLabel=n||g[Bj].requestIdLogLabel,this.childLoggerFactory=s||g[Uj],this._middie=null,this._parserOptions={limit:o||g[Jj]},this.exposeHeadRoute=d,this.prefixTrailingSlash=m,this.logLevel=a||g[Kj],this.logSerializers=l,this[Mj]=null,this.attachValidation=u,this[Hj]=p,this.schemaErrorFormatter=h||g[Vj]||tD,this[Xj]=S,this[Qj]=null,this[Zj]=null,this.validatorCompiler=c||null,this.serializerCompiler=f||null,this.server=g}function tD(t,e){let r="",n=", ";for(let s=0;s!==t.length;++s){let i=t[s];r+=e+(i.instancePath||"")+" "+i.message+n}return new Error(r.slice(0,-n.length))}GS.exports=eD});var JS=E(ir=>{"use strict";var xf=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=new Map,this.last=null,this.max=e,this.ttl=r}get size(){return this.items.size}clear(){this.items=new Map,this.first=null,this.last=null}delete(e){if(this.items.has(e)){let r=this.items.get(e);this.items.delete(e),r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;this.items.delete(e.key),this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(this.items.has(e))return this.items.get(e).expiry}get(e){if(this.items.has(e)){let r=this.items.get(e);if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return this.items.keys()}set(e,r){if(this.items.has(e)){let s=this.items.get(e);s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl;return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items.set(e,n),this.size===1?this.first=n:this.last.next=n,this.last=n}},Lf=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=new Map,this.last=null,this.max=e,this.ttl=r}get size(){return this.items.size}bumpLru(e){if(this.last===e)return;let r=this.last,n=e.next,s=e.prev;this.first===e&&(this.first=n),e.next=null,e.prev=r,r.next=e,s!==null&&(s.next=n),n!==null&&(n.prev=s),this.last=e}clear(){this.items=new Map,this.first=null,this.last=null}delete(e){if(this.items.has(e)){let r=this.items.get(e);this.items.delete(e),r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;this.items.delete(e.key),this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(this.items.has(e))return this.items.get(e).expiry}get(e){if(this.items.has(e)){let r=this.items.get(e);if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return this.bumpLru(r),r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return this.items.keys()}set(e,r){if(this.items.has(e)){let s=this.items.get(e);s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl,this.last!==s&&this.bumpLru(s);return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items.set(e,n),this.size===1?this.first=n:this.last.next=n,this.last=n}},gi=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this.max=e,this.ttl=r}bumpLru(e){if(this.last===e)return;let r=this.last,n=e.next,s=e.prev;this.first===e&&(this.first=n),e.next=null,e.prev=r,r.next=e,s!==null&&(s.next=n),n!==null&&(n.prev=s),this.last=e}clear(){this.items=Object.create(null),this.first=null,this.last=null,this.size=0}delete(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];delete this.items[e],this.size--,r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(Object.prototype.hasOwnProperty.call(this.items,e))return this.items[e].expiry}get(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return this.bumpLru(r),r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return Object.keys(this.items)}set(e,r){if(Object.prototype.hasOwnProperty.call(this.items,e)){let s=this.items[e];s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl,this.last!==s&&this.bumpLru(s);return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items[e]=n,++this.size===1?this.first=n:this.last.next=n,this.last=n}},ja=class{constructor(){this.records={}}initForCache(e,r){this.records[e]={[r]:{cacheSize:0,hits:0,falsyHits:0,emptyHits:0,misses:0,expirations:0,evictions:0,invalidateOne:0,invalidateAll:0,sets:0}}}resetForCache(e){for(let r of Object.keys(this.records[e]))this.records[e][r]={cacheSize:0,hits:0,falsyHits:0,emptyHits:0,misses:0,expirations:0,evictions:0,invalidateOne:0,invalidateAll:0,sets:0}}getStatistics(){return this.records}};function WS(t){return`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,"0")}-${t.getDate().toString().padStart(2,"0")}`}var qf=class{constructor(e,r,n){this.cacheId=e,this.statisticTtlInHours=r,this.collectionStart=new Date,this.currentTimeStamp=WS(this.collectionStart),this.records=n||new ja,this.records.initForCache(this.cacheId,this.currentTimeStamp)}get currentRecord(){return this.records.records[this.cacheId][this.currentTimeStamp]||(this.records.records[this.cacheId][this.currentTimeStamp]={cacheSize:0,hits:0,falsyHits:0,emptyHits:0,misses:0,expirations:0,evictions:0,sets:0,invalidateOne:0,invalidateAll:0}),this.records.records[this.cacheId][this.currentTimeStamp]}hoursPassed(){return(Date.now()-this.collectionStart)/1e3/60/60}addHit(){this.archiveIfNeeded(),this.currentRecord.hits++}addFalsyHit(){this.archiveIfNeeded(),this.currentRecord.falsyHits++}addEmptyHit(){this.archiveIfNeeded(),this.currentRecord.emptyHits++}addMiss(){this.archiveIfNeeded(),this.currentRecord.misses++}addEviction(){this.archiveIfNeeded(),this.currentRecord.evictions++}setCacheSize(e){this.archiveIfNeeded(),this.currentRecord.cacheSize=e}addExpiration(){this.archiveIfNeeded(),this.currentRecord.expirations++}addSet(){this.archiveIfNeeded(),this.currentRecord.sets++}addInvalidateOne(){this.archiveIfNeeded(),this.currentRecord.invalidateOne++}addInvalidateAll(){this.archiveIfNeeded(),this.currentRecord.invalidateAll++}getStatistics(){return this.records.getStatistics()}archiveIfNeeded(){this.hoursPassed()>=this.statisticTtlInHours&&(this.collectionStart=new Date,this.currentTimeStamp=WS(this.collectionStart),this.records.initForCache(this.cacheId,this.currentTimeStamp))}},Da=class extends gi{constructor(e,r,n,s,i){if(super(e||1e3,r||0),!n)throw new Error("Cache id is mandatory");this.hitStatistics=new qf(n,i!==void 0?i:24,s)}getStatistics(){return this.hitStatistics.getStatistics()}set(e,r){super.set(e,r),this.hitStatistics.addSet(),this.hitStatistics.setCacheSize(this.size)}evict(){super.evict(),this.hitStatistics.addEviction(),this.hitStatistics.setCacheSize(this.size)}delete(e,r=!1){super.delete(e),r||this.hitStatistics.addInvalidateOne(),this.hitStatistics.setCacheSize(this.size)}clear(){super.clear(),this.hitStatistics.addInvalidateAll(),this.hitStatistics.setCacheSize(this.size)}get(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e,!0),this.hitStatistics.addExpiration();return}return this.bumpLru(r),r.value||this.hitStatistics.addFalsyHit(),(r.value===void 0||r.value===null||r.value==="")&&this.hitStatistics.addEmptyHit(),this.hitStatistics.addHit(),r.value}this.hitStatistics.addMiss()}},Fa=class{constructor(e=1e3,r=0){if(isNaN(e)||e<0)throw new Error("Invalid max value");if(isNaN(r)||r<0)throw new Error("Invalid ttl value");this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this.max=e,this.ttl=r}clear(){this.items=Object.create(null),this.first=null,this.last=null,this.size=0}delete(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];delete this.items[e],this.size--,r.prev!==null&&(r.prev.next=r.next),r.next!==null&&(r.next.prev=r.prev),this.first===r&&(this.first=r.next),this.last===r&&(this.last=r.prev)}}deleteMany(e){for(var r=0;r<e.length;r++)this.delete(e[r])}evict(){if(this.size>0){let e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}}expiresAt(e){if(Object.prototype.hasOwnProperty.call(this.items,e))return this.items[e].expiry}get(e){if(Object.prototype.hasOwnProperty.call(this.items,e)){let r=this.items[e];if(this.ttl>0&&r.expiry<=Date.now()){this.delete(e);return}return r.value}}getMany(e){let r=[];for(var n=0;n<e.length;n++)r.push(this.get(e[n]));return r}keys(){return Object.keys(this.items)}set(e,r){if(Object.prototype.hasOwnProperty.call(this.items,e)){let s=this.items[e];s.value=r,s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl;return}this.max>0&&this.size===this.max&&this.evict();let n={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:r};this.items[e]=n,++this.size===1?this.first=n:this.last.next=n,this.last=n}};ir.Fifo=Fa;ir.FifoMap=xf;ir.FifoObject=Fa;ir.HitStatisticsRecord=ja;ir.Lru=gi;ir.LruHitStatistics=Da;ir.LruMap=Lf;ir.LruObject=gi;ir.LruObjectHitStatistics=Da});var ZS=E((JK,is)=>{"use strict";var rD=typeof Buffer<"u",KS=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,YS=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function XS(t,e,r){r==null&&e!==null&&typeof e=="object"&&(r=e,e=void 0),rD&&Buffer.isBuffer(t)&&(t=t.toString()),t&&t.charCodeAt(0)===65279&&(t=t.slice(1));let n=JSON.parse(t,e);if(n===null||typeof n!="object")return n;let s=r&&r.protoAction||"error",i=r&&r.constructorAction||"error";if(s==="ignore"&&i==="ignore")return n;if(s!=="ignore"&&i!=="ignore"){if(KS.test(t)===!1&&YS.test(t)===!1)return n}else if(s!=="ignore"&&i==="ignore"){if(KS.test(t)===!1)return n}else if(YS.test(t)===!1)return n;return QS(n,{protoAction:s,constructorAction:i,safe:r&&r.safe})}function QS(t,{protoAction:e="error",constructorAction:r="error",safe:n}={}){let s=[t];for(;s.length;){let i=s;s=[];for(let o of i){if(e!=="ignore"&&Object.prototype.hasOwnProperty.call(o,"__proto__")){if(n===!0)return null;if(e==="error")throw new SyntaxError("Object contains forbidden prototype property");delete o.__proto__}if(r!=="ignore"&&Object.prototype.hasOwnProperty.call(o,"constructor")&&o.constructor!==null&&typeof o.constructor=="object"&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype")){if(n===!0)return null;if(r==="error")throw new SyntaxError("Object contains forbidden prototype property");delete o.constructor}for(let a in o){let l=o[a];l&&typeof l=="object"&&s.push(l)}}}return t}function jf(t,e,r){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;try{return XS(t,e,r)}finally{Error.stackTraceLimit=n}}function nD(t,e){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return XS(t,e,{safe:!0})}catch{return}finally{Error.stackTraceLimit=r}}is.exports=jf;is.exports.default=jf;is.exports.parse=jf;is.exports.safeParse=nD;is.exports.scan=QS});var Vf=E((KK,Si)=>{"use strict";var{AsyncResource:sD}=V("node:async_hooks"),{FifoMap:rE}=JS(),{parse:iD}=ZS(),_i=dc(),{kDefaultJsonParse:yi,kContentTypeParser:os,kBodyLimit:oD,kRequestPayloadStream:nE,kState:Ff,kTestInternals:aD,kReplyIsError:eE,kRouteContext:lD}=De(),{FST_ERR_CTP_INVALID_TYPE:Ma,FST_ERR_CTP_EMPTY_TYPE:uD,FST_ERR_CTP_ALREADY_PRESENT:cD,FST_ERR_CTP_INVALID_HANDLER:fD,FST_ERR_CTP_INVALID_PARSE_TYPE:dD,FST_ERR_CTP_BODY_TOO_LARGE:tE,FST_ERR_CTP_INVALID_MEDIA_TYPE:hD,FST_ERR_CTP_INVALID_CONTENT_LENGTH:pD,FST_ERR_CTP_EMPTY_JSON_BODY:mD,FST_ERR_CTP_INSTANCE_ALREADY_STARTED:Mf,FST_ERR_CTP_INVALID_JSON_BODY:gD}=He(),{FSTSEC001:yD}=Kn();function Er(t,e,r){this[yi]=iE(e,r),this.customParsers=new Map,this.customParsers.set("application/json",new Df(!0,!1,t,this[yi])),this.customParsers.set("text/plain",new Df(!0,!1,t,Hf)),this.parserList=["application/json","text/plain"],this.parserRegExpList=[],this.cache=new rE(100)}Er.prototype.add=function(t,e,r){let n=typeof t=="string";if(n){if(t=t.trim().toLowerCase(),t.length===0)throw new uD}else if(!(t instanceof RegExp))throw new Ma;if(typeof r!="function")throw new fD;if(this.existingParser(t))throw new cD(t);if(e.parseAs!==void 0&&e.parseAs!=="string"&&e.parseAs!=="buffer")throw new dD(e.parseAs);let s=new Df(e.parseAs==="string",e.parseAs==="buffer",e.bodyLimit,r);if(t==="*")this.customParsers.set("",s);else if(n){let i=new _i(t);if(i.isValid===!1)throw new Ma;let o=i.toString();this.parserList.unshift(o),this.customParsers.set(o,s)}else wD(t),this.parserRegExpList.unshift(t),this.customParsers.set(t.toString(),s)};Er.prototype.hasParser=function(t){if(typeof t=="string")t=new _i(t).toString();else{if(!(t instanceof RegExp))throw new Ma;t=t.toString()}return this.customParsers.has(t)};Er.prototype.existingParser=function(t){if(typeof t=="string"){let e=new _i(t).toString();if(t==="application/json"&&this.customParsers.has(t))return this.customParsers.get(e).fn!==this[yi];if(t==="text/plain"&&this.customParsers.has(t))return this.customParsers.get(e).fn!==Hf}return this.hasParser(t)};Er.prototype.getParser=function(t){typeof t=="string"&&(t=new _i(t));let e=t.toString(),r=this.cache.get(e);if(r!==void 0)return r;if(r=this.customParsers.get(e),r!==void 0)return this.cache.set(e,r),r;if(r=this.customParsers.get(t.mediaType),r!==void 0)return r;for(let n=0;n!==this.parserRegExpList.length;++n){let s=this.parserRegExpList[n];if(s.test(e))return r=this.customParsers.get(s.toString()),this.cache.set(e,r),r}return this.customParsers.get("")};Er.prototype.removeAll=function(){this.customParsers=new Map,this.parserRegExpList=[],this.parserList=[],this.cache=new rE(100)};Er.prototype.remove=function(t){let e;if(typeof t=="string")t=new _i(t).toString(),e=this.parserList;else{if(!(t instanceof RegExp))throw new Ma;t=t.toString(),e=this.parserRegExpList}let r=this.customParsers.delete(t),n=e.findIndex(s=>s.toString()===t);return n>-1&&e.splice(n,1),r||n>-1};Er.prototype.run=function(t,e,r,n){let s=this.getParser(t);if(s===void 0){if(r.is404===!0){e(r,n);return}n[eE]=!0,n.send(new hD(t||void 0));return}let i=new sD("content-type-parser:run",r),o=i.bind(l);if(s.asString===!0||s.asBuffer===!0){sE(r,n,n[lD]._parserOptions,s,o);return}let a=s.fn(r,r[nE],o);a&&typeof a.then=="function"&&a.then(u=>{o(null,u)},o);function l(u,c){if(i.emitDestroy(),u!=null){n.header("connection","close"),n[eE]=!0,n.send(u);return}r.body=c,e(r,n)}};function sE(t,e,r,n,s){let i=n.asString===!0,o=r.limit===null?n.bodyLimit:r.limit,a=Number(t.headers["content-length"]);if(a>o){s(new tE,void 0);return}let l=0,u=i?"":[],c=t[nE]||t.raw;i&&c.setEncoding("utf8"),c.on("data",f),c.on("end",p),c.on("error",p),c.resume();function f(h){l+=i?Buffer.byteLength(h):h.length;let{receivedEncodedLength:d=0}=c;if(l>o||d>o){c.removeListener("data",f),c.removeListener("end",p),c.removeListener("error",p),s(new tE,void 0);return}i?u+=h:u.push(h)}function p(h){if(c.removeListener("data",f),c.removeListener("end",p),c.removeListener("error",p),h!=null){typeof h.statusCode=="number"&&h.statusCode>=400||(h.statusCode=400),s(h,void 0);return}if(!Number.isNaN(a)&&(c.receivedEncodedLength||l)!==a){s(new pD,void 0);return}i||(u=Buffer.concat(u));let d=n.fn(t,u,s);d&&typeof d.then=="function"&&d.then(m=>{s(null,m)},s)}}function iE(t,e){let r={protoAction:t,constructorAction:e};return n;function n(s,i,o){if(i.length===0){o(new mD,void 0);return}try{o(null,iD(i,r))}catch{o(new gD,void 0)}}}function Hf(t,e,r){r(null,e)}function Df(t,e,r,n){this.asString=t,this.asBuffer=e,this.bodyLimit=r,this.fn=n}function _D(t){let e=new Er;return e[yi]=t[yi],e.customParsers=new Map(t.customParsers.entries()),e.parserList=t.parserList.slice(),e.parserRegExpList=t.parserRegExpList.slice(),e}function SD(t,e,r){if(this[Ff].started)throw new Mf("addContentTypeParser");return typeof e=="function"&&(r=e,e={}),e||(e={}),e.bodyLimit||(e.bodyLimit=this[oD]),Array.isArray(t)?t.forEach(n=>this[os].add(n,e,r)):this[os].add(t,e,r),this}function ED(t){return this[os].hasParser(t)}function bD(t){if(this[Ff].started)throw new Mf("removeContentTypeParser");if(Array.isArray(t))for(let e of t)this[os].remove(e);else this[os].remove(t)}function vD(){if(this[Ff].started)throw new Mf("removeAllContentTypeParsers");this[os].removeAll()}function wD(t){t.source[0]!=="^"&&t.source.includes(";?")===!1&&yD(t.source)}Si.exports=Er;Si.exports.helpers={buildContentTypeParser:_D,addContentTypeParser:SD,hasContentTypeParser:ED,removeContentTypeParser:bD,removeAllContentTypeParsers:vD};Si.exports.defaultParsers={getDefaultJsonParser:iE,defaultTextParser:Hf};Si.exports[aD]={rawBody:sE}});var as=E(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.regexpCode=ce.getEsmExportName=ce.getProperty=ce.safeStringify=ce.stringify=ce.strConcat=ce.addCodeArg=ce.str=ce._=ce.nil=ce._Code=ce.Name=ce.IDENTIFIER=ce._CodeOrName=void 0;var Ei=class{};ce._CodeOrName=Ei;ce.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var En=class extends Ei{constructor(e){if(super(),!ce.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ce.Name=En;var It=class extends Ei{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof En&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ce._Code=It;ce.nil=new It("");function oE(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Uf(r,e[n]),r.push(t[++n]);return new It(r)}ce._=oE;var zf=new It("+");function aE(t,...e){let r=[bi(t[0])],n=0;for(;n<e.length;)r.push(zf),Uf(r,e[n]),r.push(zf,bi(t[++n]));return RD(r),new It(r)}ce.str=aE;function Uf(t,e){e instanceof It?t.push(...e._items):e instanceof En?t.push(e):t.push($D(e))}ce.addCodeArg=Uf;function RD(t){let e=1;for(;e<t.length-1;){if(t[e]===zf){let r=OD(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function OD(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof En||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof En))return`"${t}${e.slice(1)}`}function TD(t,e){return e.emptyStr()?t:t.emptyStr()?e:aE`${t}${e}`}ce.strConcat=TD;function $D(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:bi(Array.isArray(t)?t.join(","):t)}function PD(t){return new It(bi(t))}ce.stringify=PD;function bi(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ce.safeStringify=bi;function AD(t){return typeof t=="string"&&ce.IDENTIFIER.test(t)?new It(`.${t}`):oE`[${t}]`}ce.getProperty=AD;function CD(t){if(typeof t=="string"&&ce.IDENTIFIER.test(t))return new It(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ce.getEsmExportName=CD;function ID(t){return new It(t.toString())}ce.regexpCode=ID});var Ua=E(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.ValueScope=Et.ValueScopeName=Et.Scope=Et.varKinds=Et.UsedValueState=void 0;var St=as(),Bf=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Ha;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Ha||(Et.UsedValueState=Ha={}));Et.varKinds={const:new St.Name("const"),let:new St.Name("let"),var:new St.Name("var")};var Va=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof St.Name?e:this.name(e)}name(e){return new St.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Et.Scope=Va;var za=class extends St.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,St._)`.${new St.Name(r)}[${n}]`}};Et.ValueScopeName=za;var ND=(0,St._)`\n`,Gf=class extends Va{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ND:St.nil}}get(){return this._scope}name(e){return new za(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let c=a.get(o);if(c)return c}else a=this._values[i]=new Map;a.set(o,s);let l=this._scope[i]||(this._scope[i]=[]),u=l.length;return l[u]=r.ref,s.setValue(r,{property:i,itemIndex:u}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,St._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let i=St.nil;for(let o in e){let a=e[o];if(!a)continue;let l=n[o]=n[o]||new Map;a.forEach(u=>{if(l.has(u))return;l.set(u,Ha.Started);let c=r(u);if(c){let f=this.opts.es5?Et.varKinds.var:Et.varKinds.const;i=(0,St._)`${i}${f} ${u} = ${c};${this.opts._n}`}else if(c=s?.(u))i=(0,St._)`${i}${c}${this.opts._n}`;else throw new Bf(u);l.set(u,Ha.Completed)})}return i}};Et.ValueScope=Gf});var W=E(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.or=te.and=te.not=te.CodeGen=te.operators=te.varKinds=te.ValueScopeName=te.ValueScope=te.Scope=te.Name=te.regexpCode=te.stringify=te.getProperty=te.nil=te.strConcat=te.str=te._=void 0;var oe=as(),Bt=Ua(),Ur=as();Object.defineProperty(te,"_",{enumerable:!0,get:function(){return Ur._}});Object.defineProperty(te,"str",{enumerable:!0,get:function(){return Ur.str}});Object.defineProperty(te,"strConcat",{enumerable:!0,get:function(){return Ur.strConcat}});Object.defineProperty(te,"nil",{enumerable:!0,get:function(){return Ur.nil}});Object.defineProperty(te,"getProperty",{enumerable:!0,get:function(){return Ur.getProperty}});Object.defineProperty(te,"stringify",{enumerable:!0,get:function(){return Ur.stringify}});Object.defineProperty(te,"regexpCode",{enumerable:!0,get:function(){return Ur.regexpCode}});Object.defineProperty(te,"Name",{enumerable:!0,get:function(){return Ur.Name}});var Ja=Ua();Object.defineProperty(te,"Scope",{enumerable:!0,get:function(){return Ja.Scope}});Object.defineProperty(te,"ValueScope",{enumerable:!0,get:function(){return Ja.ValueScope}});Object.defineProperty(te,"ValueScopeName",{enumerable:!0,get:function(){return Ja.ValueScopeName}});Object.defineProperty(te,"varKinds",{enumerable:!0,get:function(){return Ja.varKinds}});te.operators={GT:new oe._Code(">"),GTE:new oe._Code(">="),LT:new oe._Code("<"),LTE:new oe._Code("<="),EQ:new oe._Code("==="),NEQ:new oe._Code("!=="),NOT:new oe._Code("!"),OR:new oe._Code("||"),AND:new oe._Code("&&"),ADD:new oe._Code("+")};var br=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Wf=class extends br{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Bt.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=us(this.rhs,e,r)),this}get names(){return this.rhs instanceof oe._CodeOrName?this.rhs.names:{}}},Ba=class extends br{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof oe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=us(this.rhs,e,r),this}get names(){let e=this.lhs instanceof oe.Name?{}:{...this.lhs.names};return Wa(e,this.rhs)}},Jf=class extends Ba{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Kf=class extends br{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Yf=class extends br{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Xf=class extends br{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Qf=class extends br{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=us(this.code,e,r),this}get names(){return this.code instanceof oe._CodeOrName?this.code.names:{}}},vi=class extends br{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let i=n[s];i.optimizeNames(e,r)||(kD(e,i.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>wn(e,r.names),{})}},vr=class extends vi{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Zf=class extends vi{},ls=class extends vr{};ls.kind="else";var bn=class t extends vr{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new ls(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(lE(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=us(this.condition,e,r),this}get names(){let e=super.names;return Wa(e,this.condition),this.else&&wn(e,this.else.names),e}};bn.kind="if";var vn=class extends vr{};vn.kind="for";var ed=class extends vn{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=us(this.iteration,e,r),this}get names(){return wn(super.names,this.iteration.names)}},td=class extends vn{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?Bt.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${r} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=Wa(super.names,this.from);return Wa(e,this.to)}},Ga=class extends vn{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=us(this.iterable,e,r),this}get names(){return wn(super.names,this.iterable.names)}},wi=class extends vr{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};wi.kind="func";var Ri=class extends vi{render(e){return"return "+super.render(e)}};Ri.kind="return";var rd=class extends vr{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&wn(e,this.catch.names),this.finally&&wn(e,this.finally.names),e}},Oi=class extends vr{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Oi.kind="catch";var Ti=class extends vr{render(e){return"finally"+super.render(e)}};Ti.kind="finally";var nd=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
52
+ `:""},this._extScope=e,this._scope=new Bt.Scope({parent:e}),this._nodes=[new Zf]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,s){let i=this._scope.toName(r);return n!==void 0&&s&&(this._constants[i.str]=n),this._leafNode(new Wf(e,i,n)),i}const(e,r,n){return this._def(Bt.varKinds.const,e,r,n)}let(e,r,n){return this._def(Bt.varKinds.let,e,r,n)}var(e,r,n){return this._def(Bt.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Ba(e,r,n))}add(e,r){return this._leafNode(new Jf(e,te.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==oe.nil&&this._leafNode(new Qf(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,oe.addCodeArg)(r,s));return r.push("}"),new oe._Code(r)}if(e,r,n){if(this._blockNode(new bn(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new bn(e))}else(){return this._elseNode(new ls)}endIf(){return this._endBlockNode(bn,ls)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new ed(e),r)}forRange(e,r,n,s,i=this.opts.es5?Bt.varKinds.var:Bt.varKinds.let){let o=this._scope.toName(e);return this._for(new td(i,o,r,n),()=>s(o))}forOf(e,r,n,s=Bt.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=r instanceof oe.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,oe._)`${o}.length`,a=>{this.var(i,(0,oe._)`${o}[${a}]`),n(i)})}return this._for(new Ga("of",s,i,r),()=>n(i))}forIn(e,r,n,s=this.opts.es5?Bt.varKinds.var:Bt.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,oe._)`Object.keys(${r})`,n);let i=this._scope.toName(e);return this._for(new Ga("in",s,i,r),()=>n(i))}endFor(){return this._endBlockNode(vn)}label(e){return this._leafNode(new Kf(e))}break(e){return this._leafNode(new Yf(e))}return(e){let r=new Ri;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ri)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new rd;if(this._blockNode(s),this.code(e),r){let i=this.name("e");this._currNode=s.catch=new Oi(i),r(i)}return n&&(this._currNode=s.finally=new Ti,this.code(n)),this._endBlockNode(Oi,Ti)}throw(e){return this._leafNode(new Xf(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=oe.nil,n,s){return this._blockNode(new wi(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(wi)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof bn))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};te.CodeGen=nd;function wn(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Wa(t,e){return e instanceof oe._CodeOrName?wn(t,e.names):t}function us(t,e,r){if(t instanceof oe.Name)return n(t);if(!s(t))return t;return new oe._Code(t._items.reduce((i,o)=>(o instanceof oe.Name&&(o=n(o)),o instanceof oe._Code?i.push(...o._items):i.push(o),i),[]));function n(i){let o=r[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof oe._Code&&i._items.some(o=>o instanceof oe.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function kD(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function lE(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,oe._)`!${sd(t)}`}te.not=lE;var xD=uE(te.operators.AND);function LD(...t){return t.reduce(xD)}te.and=LD;var qD=uE(te.operators.OR);function jD(...t){return t.reduce(qD)}te.or=jD;function uE(t){return(e,r)=>e===oe.nil?r:r===oe.nil?e:(0,oe._)`${sd(e)} ${t} ${sd(r)}`}function sd(t){return t instanceof oe.Name?t:(0,oe._)`(${t})`}});var ee=E(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.checkStrictMode=re.getErrorPath=re.Type=re.useFunc=re.setEvaluated=re.evaluatedPropsToName=re.mergeEvaluated=re.eachItem=re.unescapeJsonPointer=re.escapeJsonPointer=re.escapeFragment=re.unescapeFragment=re.schemaRefOrVal=re.schemaHasRulesButRef=re.schemaHasRules=re.checkUnknownRules=re.alwaysValidSchema=re.toHash=void 0;var Se=W(),DD=as();function FD(t){let e={};for(let r of t)e[r]=!0;return e}re.toHash=FD;function MD(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(dE(t,e),!hE(e,t.self.RULES.all))}re.alwaysValidSchema=MD;function dE(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let i in e)s[i]||gE(t,`unknown keyword: "${i}"`)}re.checkUnknownRules=dE;function hE(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}re.schemaHasRules=hE;function HD(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}re.schemaHasRulesButRef=HD;function VD({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Se._)`${r}`}return(0,Se._)`${t}${e}${(0,Se.getProperty)(n)}`}re.schemaRefOrVal=VD;function zD(t){return pE(decodeURIComponent(t))}re.unescapeFragment=zD;function UD(t){return encodeURIComponent(od(t))}re.escapeFragment=UD;function od(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}re.escapeJsonPointer=od;function pE(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}re.unescapeJsonPointer=pE;function BD(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}re.eachItem=BD;function cE({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,i,o,a)=>{let l=o===void 0?i:o instanceof Se.Name?(i instanceof Se.Name?t(s,i,o):e(s,i,o),o):i instanceof Se.Name?(e(s,o,i),i):r(i,o);return a===Se.Name&&!(l instanceof Se.Name)?n(s,l):l}}re.mergeEvaluated={props:cE({mergeNames:(t,e,r)=>t.if((0,Se._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Se._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Se._)`${r} || {}`).code((0,Se._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Se._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Se._)`${r} || {}`),ad(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:mE}),items:cE({mergeNames:(t,e,r)=>t.if((0,Se._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Se._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Se._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Se._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function mE(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Se._)`{}`);return e!==void 0&&ad(t,r,e),r}re.evaluatedPropsToName=mE;function ad(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Se._)`${e}${(0,Se.getProperty)(n)}`,!0))}re.setEvaluated=ad;var fE={};function GD(t,e){return t.scopeValue("func",{ref:e,code:fE[e.code]||(fE[e.code]=new DD._Code(e.code))})}re.useFunc=GD;var id;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(id||(re.Type=id={}));function WD(t,e,r){if(t instanceof Se.Name){let n=e===id.Num;return r?n?(0,Se._)`"[" + ${t} + "]"`:(0,Se._)`"['" + ${t} + "']"`:n?(0,Se._)`"/" + ${t}`:(0,Se._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Se.getProperty)(t).toString():"/"+od(t)}re.getErrorPath=WD;function gE(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}re.checkStrictMode=gE});var Nt=E(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});var Qe=W(),JD={data:new Qe.Name("data"),valCxt:new Qe.Name("valCxt"),instancePath:new Qe.Name("instancePath"),parentData:new Qe.Name("parentData"),parentDataProperty:new Qe.Name("parentDataProperty"),rootData:new Qe.Name("rootData"),dynamicAnchors:new Qe.Name("dynamicAnchors"),vErrors:new Qe.Name("vErrors"),errors:new Qe.Name("errors"),this:new Qe.Name("this"),self:new Qe.Name("self"),scope:new Qe.Name("scope"),json:new Qe.Name("json"),jsonPos:new Qe.Name("jsonPos"),jsonLen:new Qe.Name("jsonLen"),jsonPart:new Qe.Name("jsonPart")};ld.default=JD});var $i=E(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.extendErrors=Ze.resetErrorsCount=Ze.reportExtraError=Ze.reportError=Ze.keyword$DataError=Ze.keywordError=void 0;var le=W(),Ka=ee(),it=Nt();Ze.keywordError={message:({keyword:t})=>(0,le.str)`must pass "${t}" keyword validation`};Ze.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,le.str)`"${t}" keyword must be ${e} ($data)`:(0,le.str)`"${t}" keyword is invalid ($data)`};function KD(t,e=Ze.keywordError,r,n){let{it:s}=t,{gen:i,compositeRule:o,allErrors:a}=s,l=SE(t,e,r);n??(o||a)?yE(i,l):_E(s,(0,le._)`[${l}]`)}Ze.reportError=KD;function YD(t,e=Ze.keywordError,r){let{it:n}=t,{gen:s,compositeRule:i,allErrors:o}=n,a=SE(t,e,r);yE(s,a),i||o||_E(n,it.default.vErrors)}Ze.reportExtraError=YD;function XD(t,e){t.assign(it.default.errors,e),t.if((0,le._)`${it.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,le._)`${it.default.vErrors}.length`,e),()=>t.assign(it.default.vErrors,null)))}Ze.resetErrorsCount=XD;function QD({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",s,it.default.errors,a=>{t.const(o,(0,le._)`${it.default.vErrors}[${a}]`),t.if((0,le._)`${o}.instancePath === undefined`,()=>t.assign((0,le._)`${o}.instancePath`,(0,le.strConcat)(it.default.instancePath,i.errorPath))),t.assign((0,le._)`${o}.schemaPath`,(0,le.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,le._)`${o}.schema`,r),t.assign((0,le._)`${o}.data`,n))})}Ze.extendErrors=QD;function yE(t,e){let r=t.const("err",e);t.if((0,le._)`${it.default.vErrors} === null`,()=>t.assign(it.default.vErrors,(0,le._)`[${r}]`),(0,le._)`${it.default.vErrors}.push(${r})`),t.code((0,le._)`${it.default.errors}++`)}function _E(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,le._)`new ${t.ValidationError}(${e})`):(r.assign((0,le._)`${n}.errors`,e),r.return(!1))}var Rn={keyword:new le.Name("keyword"),schemaPath:new le.Name("schemaPath"),params:new le.Name("params"),propertyName:new le.Name("propertyName"),message:new le.Name("message"),schema:new le.Name("schema"),parentSchema:new le.Name("parentSchema")};function SE(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,le._)`{}`:ZD(t,e,r)}function ZD(t,e,r={}){let{gen:n,it:s}=t,i=[eF(s,r),tF(t,r)];return rF(t,e,i),n.object(...i)}function eF({errorPath:t},{instancePath:e}){let r=e?(0,le.str)`${t}${(0,Ka.getErrorPath)(e,Ka.Type.Str)}`:t;return[it.default.instancePath,(0,le.strConcat)(it.default.instancePath,r)]}function tF({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,le.str)`${e}/${t}`;return r&&(s=(0,le.str)`${s}${(0,Ka.getErrorPath)(r,Ka.Type.Str)}`),[Rn.schemaPath,s]}function rF(t,{params:e,message:r},n){let{keyword:s,data:i,schemaValue:o,it:a}=t,{opts:l,propertyName:u,topSchemaRef:c,schemaPath:f}=a;n.push([Rn.keyword,s],[Rn.params,typeof e=="function"?e(t):e||(0,le._)`{}`]),l.messages&&n.push([Rn.message,typeof r=="function"?r(t):r]),l.verbose&&n.push([Rn.schema,o],[Rn.parentSchema,(0,le._)`${c}${f}`],[it.default.data,i]),u&&n.push([Rn.propertyName,u])}});var bE=E(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.boolOrEmptySchema=cs.topBoolOrEmptySchema=void 0;var nF=$i(),sF=W(),iF=Nt(),oF={message:"boolean schema is false"};function aF(t){let{gen:e,schema:r,validateName:n}=t;r===!1?EE(t,!1):typeof r=="object"&&r.$async===!0?e.return(iF.default.data):(e.assign((0,sF._)`${n}.errors`,null),e.return(!0))}cs.topBoolOrEmptySchema=aF;function lF(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),EE(t)):r.var(e,!0)}cs.boolOrEmptySchema=lF;function EE(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,nF.reportError)(s,oF,void 0,e)}});var ud=E(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.getRules=fs.isJSONType=void 0;var uF=["string","number","integer","boolean","null","object","array"],cF=new Set(uF);function fF(t){return typeof t=="string"&&cF.has(t)}fs.isJSONType=fF;function dF(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}fs.getRules=dF});var cd=E(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.shouldUseRule=Br.shouldUseGroup=Br.schemaHasRulesForType=void 0;function hF({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&vE(t,n)}Br.schemaHasRulesForType=hF;function vE(t,e){return e.rules.some(r=>wE(t,r))}Br.shouldUseGroup=vE;function wE(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Br.shouldUseRule=wE});var Pi=E(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.reportTypeError=et.checkDataTypes=et.checkDataType=et.coerceAndCheckDataType=et.getJSONTypes=et.getSchemaTypes=et.DataType=void 0;var pF=ud(),mF=cd(),gF=$i(),Z=W(),RE=ee(),ds;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ds||(et.DataType=ds={}));function yF(t){let e=OE(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}et.getSchemaTypes=yF;function OE(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(pF.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}et.getJSONTypes=OE;function _F(t,e){let{gen:r,data:n,opts:s}=t,i=SF(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,mF.schemaHasRulesForType)(t,e[0]));if(o){let a=dd(e,n,s.strictNumbers,ds.Wrong);r.if(a,()=>{i.length?EF(t,e,i):hd(t)})}return o}et.coerceAndCheckDataType=_F;var TE=new Set(["string","number","integer","boolean","null"]);function SF(t,e){return e?t.filter(r=>TE.has(r)||e==="array"&&r==="array"):[]}function EF(t,e,r){let{gen:n,data:s,opts:i}=t,o=n.let("dataType",(0,Z._)`typeof ${s}`),a=n.let("coerced",(0,Z._)`undefined`);i.coerceTypes==="array"&&n.if((0,Z._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,Z._)`${s}[0]`).assign(o,(0,Z._)`typeof ${s}`).if(dd(e,s,i.strictNumbers),()=>n.assign(a,s))),n.if((0,Z._)`${a} !== undefined`);for(let u of r)(TE.has(u)||u==="array"&&i.coerceTypes==="array")&&l(u);n.else(),hd(t),n.endIf(),n.if((0,Z._)`${a} !== undefined`,()=>{n.assign(s,a),bF(t,a)});function l(u){switch(u){case"string":n.elseIf((0,Z._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,Z._)`"" + ${s}`).elseIf((0,Z._)`${s} === null`).assign(a,(0,Z._)`""`);return;case"number":n.elseIf((0,Z._)`${o} == "boolean" || ${s} === null
53
53
  || (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,Z._)`+${s}`);return;case"integer":n.elseIf((0,Z._)`${o} === "boolean" || ${s} === null
54
54
  || (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,Z._)`+${s}`);return;case"boolean":n.elseIf((0,Z._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,Z._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf((0,Z._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf((0,Z._)`${o} === "string" || ${o} === "number"
55
- || ${o} === "boolean" || ${s} === null`).assign(a,(0,Z._)`[${s}]`)}}}function gF({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Z._)`${e} !== undefined`,()=>t.assign((0,Z._)`${e}[${r}]`,n))}function cd(t,e,r,n=ds.Correct){let s=n===ds.Correct?Z.operators.EQ:Z.operators.NEQ,i;switch(t){case"null":return(0,Z._)`${e} ${s} null`;case"array":i=(0,Z._)`Array.isArray(${e})`;break;case"object":i=(0,Z._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,Z._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,Z._)`typeof ${e} ${s} ${t}`}return n===ds.Correct?i:(0,Z.not)(i);function o(a=Z.nil){return(0,Z.and)((0,Z._)`typeof ${e} == "number"`,a,r?(0,Z._)`isFinite(${e})`:Z.nil)}}et.checkDataType=cd;function fd(t,e,r,n){if(t.length===1)return cd(t[0],e,r,n);let s,i=(0,wE.toHash)(t);if(i.array&&i.object){let o=(0,Z._)`typeof ${e} != "object"`;s=i.null?o:(0,Z._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=Z.nil;i.number&&delete i.integer;for(let o in i)s=(0,Z.and)(s,cd(o,e,r,n));return s}et.checkDataTypes=fd;var yF={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Z._)`{type: ${t}}`:(0,Z._)`{type: ${e}}`};function dd(t){let e=_F(t);(0,fF.reportError)(e,yF)}et.reportTypeError=dd;function _F(t){let{gen:e,data:r,schema:n}=t,s=(0,wE.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:t}}});var $E=E(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.assignDefaults=void 0;var hs=W(),SF=ee();function EF(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let s in r)TE(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>TE(t,i,s.default))}Ka.assignDefaults=EF;function TE(t,e,r){let{gen:n,compositeRule:s,data:i,opts:o}=t;if(r===void 0)return;let a=(0,hs._)`${i}${(0,hs.getProperty)(e)}`;if(s){(0,SF.checkStrictMode)(t,`default is ignored for: ${a}`);return}let l=(0,hs._)`${a} === undefined`;o.useDefaults==="empty"&&(l=(0,hs._)`${l} || ${a} === null || ${a} === ""`),n.if(l,(0,hs._)`${a} = ${(0,hs.stringify)(r)}`)}});var We=E(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.validateUnion=_e.validateArray=_e.usePattern=_e.callValidateCode=_e.schemaProperties=_e.allSchemaProperties=_e.noPropertyInData=_e.propertyInData=_e.isOwnProperty=_e.hasPropFunc=_e.reportMissingProp=_e.checkMissingProp=_e.checkReportMissingProp=void 0;var be=W(),hd=ee(),Gr=Nt(),bF=ee();function vF(t,e){let{gen:r,data:n,it:s}=t;r.if(md(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,be._)`${e}`},!0),t.error()})}_e.checkReportMissingProp=vF;function wF({gen:t,data:e,it:{opts:r}},n,s){return(0,be.or)(...n.map(i=>(0,be.and)(md(t,e,i,r.ownProperties),(0,be._)`${s} = ${i}`)))}_e.checkMissingProp=wF;function RF(t,e){t.setParams({missingProperty:e},!0),t.error()}_e.reportMissingProp=RF;function PE(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,be._)`Object.prototype.hasOwnProperty`})}_e.hasPropFunc=PE;function pd(t,e,r){return(0,be._)`${PE(t)}.call(${e}, ${r})`}_e.isOwnProperty=pd;function OF(t,e,r,n){let s=(0,be._)`${e}${(0,be.getProperty)(r)} !== undefined`;return n?(0,be._)`${s} && ${pd(t,e,r)}`:s}_e.propertyInData=OF;function md(t,e,r,n){let s=(0,be._)`${e}${(0,be.getProperty)(r)} === undefined`;return n?(0,be.or)(s,(0,be.not)(pd(t,e,r))):s}_e.noPropertyInData=md;function AE(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}_e.allSchemaProperties=AE;function TF(t,e){return AE(e).filter(r=>!(0,hd.alwaysValidSchema)(t,e[r]))}_e.schemaProperties=TF;function $F({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},a,l,u){let c=u?(0,be._)`${t}, ${e}, ${n}${s}`:e,f=[[Gr.default.instancePath,(0,be.strConcat)(Gr.default.instancePath,i)],[Gr.default.parentData,o.parentData],[Gr.default.parentDataProperty,o.parentDataProperty],[Gr.default.rootData,Gr.default.rootData]];o.opts.dynamicRef&&f.push([Gr.default.dynamicAnchors,Gr.default.dynamicAnchors]);let p=(0,be._)`${c}, ${r.object(...f)}`;return l!==be.nil?(0,be._)`${a}.call(${l}, ${p})`:(0,be._)`${a}(${p})`}_e.callValidateCode=$F;var PF=(0,be._)`new RegExp`;function AF({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(r,n);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,be._)`${s.code==="new RegExp"?PF:(0,bF.useFunc)(t,s)}(${r}, ${n})`})}_e.usePattern=AF;function CF(t){let{gen:e,data:r,keyword:n,it:s}=t,i=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(i,!0),o(()=>e.break()),i;function o(a){let l=e.const("len",(0,be._)`${r}.length`);e.forRange("i",0,l,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:hd.Type.Num},i),e.if((0,be.not)(i),a)})}}_e.validateArray=CF;function IF(t){let{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,hd.alwaysValidSchema)(s,l))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((l,u)=>{let c=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);e.assign(o,(0,be._)`${o} || ${a}`),t.mergeValidEvaluated(c,a)||e.if((0,be.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}_e.validateUnion=IF});var NE=E(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.validateKeywordUsage=ir.validSchemaType=ir.funcKeywordCode=ir.macroKeywordCode=void 0;var ot=W(),On=Nt(),NF=We(),kF=Ti();function xF(t,e){let{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=t,a=e.macro.call(o.self,s,i,o),l=IE(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:ot.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}ir.macroKeywordCode=xF;function LF(t,e){var r;let{gen:n,keyword:s,schema:i,parentSchema:o,$data:a,it:l}=t;jF(l,e);let u=!a&&e.compile?e.compile.call(l.self,i,o,l):e.validate,c=IE(n,s,u),f=n.let("valid");t.block$data(f,p),t.ok((r=e.valid)!==null&&r!==void 0?r:f);function p(){if(e.errors===!1)m(),e.modifying&&CE(t),g(()=>t.error());else{let S=e.async?h():d();e.modifying&&CE(t),g(()=>qF(t,S))}}function h(){let S=n.let("ruleErrs",null);return n.try(()=>m((0,ot._)`await `),b=>n.assign(f,!1).if((0,ot._)`${b} instanceof ${l.ValidationError}`,()=>n.assign(S,(0,ot._)`${b}.errors`),()=>n.throw(b))),S}function d(){let S=(0,ot._)`${c}.errors`;return n.assign(S,null),m(ot.nil),S}function m(S=e.async?(0,ot._)`await `:ot.nil){let b=l.opts.passContext?On.default.this:On.default.self,_=!("compile"in e&&!a||e.schema===!1);n.assign(f,(0,ot._)`${S}${(0,NF.callValidateCode)(t,c,b,_)}`,e.modifying)}function g(S){var b;n.if((0,ot.not)((b=e.valid)!==null&&b!==void 0?b:f),S)}}ir.funcKeywordCode=LF;function CE(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,ot._)`${n.parentData}[${n.parentDataProperty}]`))}function qF(t,e){let{gen:r}=t;r.if((0,ot._)`Array.isArray(${e})`,()=>{r.assign(On.default.vErrors,(0,ot._)`${On.default.vErrors} === null ? ${e} : ${On.default.vErrors}.concat(${e})`).assign(On.default.errors,(0,ot._)`${On.default.vErrors}.length`),(0,kF.extendErrors)(t)},()=>t.error())}function jF({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function IE(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,ot.stringify)(r)})}function DF(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}ir.validSchemaType=DF;function FF({schema:t,opts:e,self:r,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[i])){let l=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}ir.validateKeywordUsage=FF});var xE=E(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.extendSubschemaMode=Wr.extendSubschemaData=Wr.getSubschema=void 0;var or=W(),kE=ee();function MF(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,or._)`${t.schemaPath}${(0,or.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,or._)`${t.schemaPath}${(0,or.getProperty)(e)}${(0,or.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,kE.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Wr.getSubschema=MF;function HF(t,e,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:u,dataPathArr:c,opts:f}=e,p=a.let("data",(0,or._)`${e.data}${(0,or.getProperty)(r)}`,!0);l(p),t.errorPath=(0,or.str)`${u}${(0,kE.getErrorPath)(r,n,f.jsPropertySyntax)}`,t.parentDataProperty=(0,or._)`${r}`,t.dataPathArr=[...c,t.parentDataProperty]}if(s!==void 0){let u=s instanceof or.Name?s:a.let("data",s,!0);l(u),o!==void 0&&(t.propertyName=o)}i&&(t.dataTypes=i);function l(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}Wr.extendSubschemaData=HF;function VF(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}Wr.extendSubschemaMode=VF});var Pi=E((rY,LE)=>{"use strict";LE.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var jE=E((nY,qE)=>{"use strict";var Jr=qE.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};Ya(e,n,s,t,"",t)};Jr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Jr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Jr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Jr.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Ya(t,e,r,n,s,i,o,a,l,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,o,a,l,u);for(var c in n){var f=n[c];if(Array.isArray(f)){if(c in Jr.arrayKeywords)for(var p=0;p<f.length;p++)Ya(t,e,r,f[p],s+"/"+c+"/"+p,i,s,c,n,p)}else if(c in Jr.propsKeywords){if(f&&typeof f=="object")for(var h in f)Ya(t,e,r,f[h],s+"/"+c+"/"+zF(h),i,s,c,n,h)}else(c in Jr.keywords||t.allKeys&&!(c in Jr.skipKeywords))&&Ya(t,e,r,f,s+"/"+c,i,s,c,n)}r(n,s,i,o,a,l,u)}}function zF(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Ai=E(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.getSchemaRefs=Et.resolveUrl=Et.normalizeId=Et._getFullPath=Et.getFullPath=Et.inlineRef=void 0;var UF=ee(),BF=Pi(),GF=jE(),WF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function JF(t,e=!0){return typeof t=="boolean"?!0:e===!0?!gd(t):e?DE(t)<=e:!1}Et.inlineRef=JF;var KF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function gd(t){for(let e in t){if(KF.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(gd)||typeof r=="object"&&gd(r))return!0}return!1}function DE(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!WF.has(r)&&(typeof t[r]=="object"&&(0,UF.eachItem)(t[r],n=>e+=DE(n)),e===1/0))return 1/0}return e}function FE(t,e="",r){r!==!1&&(e=ps(e));let n=t.parse(e);return ME(t,n)}Et.getFullPath=FE;function ME(t,e){return t.serialize(e).split("#")[0]+"#"}Et._getFullPath=ME;var YF=/#\/?$/;function ps(t){return t?t.replace(YF,""):""}Et.normalizeId=ps;function XF(t,e,r){return r=ps(r),t.resolve(e,r)}Et.resolveUrl=XF;var QF=/^[a-z_][-a-z0-9._]*$/i;function ZF(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=ps(t[r]||e),i={"":s},o=FE(n,s,!1),a={},l=new Set;return GF(t,{allKeys:!0},(f,p,h,d)=>{if(d===void 0)return;let m=o+p,g=i[d];typeof f[r]=="string"&&(g=S.call(this,f[r])),b.call(this,f.$anchor),b.call(this,f.$dynamicAnchor),i[p]=g;function S(_){let y=this.opts.uriResolver.resolve;if(_=ps(g?y(g,_):_),l.has(_))throw c(_);l.add(_);let R=this.refs[_];return typeof R=="string"&&(R=this.refs[R]),typeof R=="object"?u(f,R.schema,_):_!==ps(m)&&(_[0]==="#"?(u(f,a[_],_),a[_]=f):this.refs[_]=m),_}function b(_){if(typeof _=="string"){if(!QF.test(_))throw new Error(`invalid anchor "${_}"`);S.call(this,`#${_}`)}}}),a;function u(f,p,h){if(p!==void 0&&!BF(f,p))throw c(h)}function c(f){return new Error(`reference "${f}" resolves to more than one schema`)}}Et.getSchemaRefs=ZF});var ms=E(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.getData=Kr.KeywordCxt=Kr.validateFunctionCode=void 0;var BE=EE(),HE=$i(),_d=ud(),Xa=$i(),eM=$E(),Ii=NE(),yd=xE(),z=W(),K=Nt(),tM=Ai(),wr=ee(),Ci=Ti();function rM(t){if(JE(t)&&(KE(t),WE(t))){iM(t);return}GE(t,()=>(0,BE.topBoolOrEmptySchema)(t))}Kr.validateFunctionCode=rM;function GE({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},i){s.code.es5?t.func(e,(0,z._)`${K.default.data}, ${K.default.valCxt}`,n.$async,()=>{t.code((0,z._)`"use strict"; ${VE(r,s)}`),sM(t,s),t.code(i)}):t.func(e,(0,z._)`${K.default.data}, ${nM(s)}`,n.$async,()=>t.code(VE(r,s)).code(i))}function nM(t){return(0,z._)`{${K.default.instancePath}="", ${K.default.parentData}, ${K.default.parentDataProperty}, ${K.default.rootData}=${K.default.data}${t.dynamicRef?(0,z._)`, ${K.default.dynamicAnchors}={}`:z.nil}}={}`}function sM(t,e){t.if(K.default.valCxt,()=>{t.var(K.default.instancePath,(0,z._)`${K.default.valCxt}.${K.default.instancePath}`),t.var(K.default.parentData,(0,z._)`${K.default.valCxt}.${K.default.parentData}`),t.var(K.default.parentDataProperty,(0,z._)`${K.default.valCxt}.${K.default.parentDataProperty}`),t.var(K.default.rootData,(0,z._)`${K.default.valCxt}.${K.default.rootData}`),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,z._)`${K.default.valCxt}.${K.default.dynamicAnchors}`)},()=>{t.var(K.default.instancePath,(0,z._)`""`),t.var(K.default.parentData,(0,z._)`undefined`),t.var(K.default.parentDataProperty,(0,z._)`undefined`),t.var(K.default.rootData,K.default.data),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,z._)`{}`)})}function iM(t){let{schema:e,opts:r,gen:n}=t;GE(t,()=>{r.$comment&&e.$comment&&XE(t),cM(t),n.let(K.default.vErrors,null),n.let(K.default.errors,0),r.unevaluated&&oM(t),YE(t),hM(t)})}function oM(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,z._)`${r}.evaluated`),e.if((0,z._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,z._)`${t.evaluated}.props`,(0,z._)`undefined`)),e.if((0,z._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,z._)`${t.evaluated}.items`,(0,z._)`undefined`))}function VE(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,z._)`/*# sourceURL=${r} */`:z.nil}function aM(t,e){if(JE(t)&&(KE(t),WE(t))){lM(t,e);return}(0,BE.boolOrEmptySchema)(t,e)}function WE({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function JE(t){return typeof t.schema!="boolean"}function lM(t,e){let{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&XE(t),fM(t),dM(t);let i=n.const("_errs",K.default.errors);YE(t,i),n.var(e,(0,z._)`${i} === ${K.default.errors}`)}function KE(t){(0,wr.checkUnknownRules)(t),uM(t)}function YE(t,e){if(t.opts.jtd)return zE(t,[],!1,e);let r=(0,HE.getSchemaTypes)(t.schema),n=(0,HE.coerceAndCheckDataType)(t,r);zE(t,r,!n,e)}function uM(t){let{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,wr.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function cM(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,wr.checkStrictMode)(t,"default is ignored in the schema root")}function fM(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,tM.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function dM(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function XE({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){let i=r.$comment;if(s.$comment===!0)t.code((0,z._)`${K.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,z.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,z._)`${K.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function hM(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=t;r.$async?e.if((0,z._)`${K.default.errors} === 0`,()=>e.return(K.default.data),()=>e.throw((0,z._)`new ${s}(${K.default.vErrors})`)):(e.assign((0,z._)`${n}.errors`,K.default.vErrors),i.unevaluated&&pM(t),e.return((0,z._)`${K.default.errors} === 0`))}function pM({gen:t,evaluated:e,props:r,items:n}){r instanceof z.Name&&t.assign((0,z._)`${e}.props`,r),n instanceof z.Name&&t.assign((0,z._)`${e}.items`,n)}function zE(t,e,r,n){let{gen:s,schema:i,data:o,allErrors:a,opts:l,self:u}=t,{RULES:c}=u;if(i.$ref&&(l.ignoreKeywordsWithRef||!(0,wr.schemaHasRulesButRef)(i,c))){s.block(()=>ZE(t,"$ref",c.all.$ref.definition));return}l.jtd||mM(t,e),s.block(()=>{for(let p of c.rules)f(p);f(c.post)});function f(p){(0,_d.shouldUseGroup)(i,p)&&(p.type?(s.if((0,Xa.checkDataType)(p.type,o,l.strictNumbers)),UE(t,p),e.length===1&&e[0]===p.type&&r&&(s.else(),(0,Xa.reportTypeError)(t)),s.endIf()):UE(t,p),a||s.if((0,z._)`${K.default.errors} === ${n||0}`))}}function UE(t,e){let{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,eM.assignDefaults)(t,e.type),r.block(()=>{for(let i of e.rules)(0,_d.shouldUseRule)(n,i)&&ZE(t,i.keyword,i.definition,e.type)})}function mM(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(gM(t,e),t.opts.allowUnionTypes||yM(t,e),_M(t,t.dataTypes))}function gM(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{QE(t.dataTypes,r)||Sd(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),EM(t,e)}}function yM(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Sd(t,"use allowUnionTypes to allow union type keyword")}function _M(t,e){let r=t.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&(0,_d.shouldUseRule)(t.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>SM(e,o))&&Sd(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function SM(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function QE(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function EM(t,e){let r=[];for(let n of t.dataTypes)QE(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Sd(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,wr.checkStrictMode)(t,e,t.opts.strictTypes)}var Qa=class{constructor(e,r,n){if((0,Ii.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,wr.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",eb(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Ii.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",K.default.errors))}result(e,r,n){this.failResult((0,z.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,z.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,z._)`${r} !== undefined && (${(0,z.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Ci.reportExtraError:Ci.reportError)(this,this.def.error,r)}$dataError(){(0,Ci.reportError)(this,this.def.$dataError||Ci.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ci.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=z.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=z.nil,r=z.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,z.or)((0,z._)`${s} === undefined`,r)),e!==z.nil&&n.assign(e,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==z.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,z.or)(o(),a());function o(){if(n.length){if(!(r instanceof z.Name))throw new Error("ajv implementation error");let l=Array.isArray(n)?n:[n];return(0,z._)`${(0,Xa.checkDataTypes)(l,r,i.opts.strictNumbers,Xa.DataType.Wrong)}`}return z.nil}function a(){if(s.validateSchema){let l=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,z._)`!${l}(${r})`}return z.nil}}subschema(e,r){let n=(0,yd.getSubschema)(this.it,e);(0,yd.extendSubschemaData)(n,this.it,e),(0,yd.extendSubschemaMode)(n,e);let s={...this.it,...n,items:void 0,props:void 0};return aM(s,r),s}mergeEvaluated(e,r){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=wr.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=wr.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,z.Name)),!0}};Kr.KeywordCxt=Qa;function ZE(t,e,r,n){let s=new Qa(t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Ii.funcKeywordCode)(s,r):"macro"in r?(0,Ii.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Ii.funcKeywordCode)(s,r)}var bM=/^\/(?:[^~]|~0|~1)*$/,vM=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function eb(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,i;if(t==="")return K.default.rootData;if(t[0]==="/"){if(!bM.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,i=K.default.rootData}else{let u=vM.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let c=+u[1];if(s=u[2],s==="#"){if(c>=e)throw new Error(l("property/index",c));return n[e-c]}if(c>e)throw new Error(l("data",c));if(i=r[e-c],!s)return i}let o=i,a=s.split("/");for(let u of a)u&&(i=(0,z._)`${i}${(0,z.getProperty)((0,wr.unescapeJsonPointer)(u))}`,o=(0,z._)`${o} && ${i}`);return o;function l(u,c){return`Cannot access ${u} ${c} levels up, current level is ${e}`}}Kr.getData=eb});var Ni=E(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});var Ed=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};bd.default=Ed});var Rr=E(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});var vd=Ai(),wd=class extends Error{constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,vd.resolveUrl)(e,r,n),this.missingSchema=(0,vd.normalizeId)((0,vd.getFullPath)(e,this.missingRef))}};Rd.default=wd});var $n=E(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.resolveSchema=kt.getCompilingSchema=kt.resolveRef=kt.compileSchema=kt.SchemaEnv=void 0;var Bt=W(),wM=Ni(),Tn=Nt(),Gt=Ai(),tb=ee(),RM=ms(),gs=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Gt.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};kt.SchemaEnv=gs;function Td(t){let e=rb.call(this,t);if(e)return e;let r=(0,Gt.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Bt.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a;t.$async&&(a=o.scopeValue("Error",{ref:wM.default,code:(0,Bt._)`require("ajv/dist/runtime/validation_error").default`}));let l=o.scopeName("validate");t.validateName=l;let u={gen:o,allErrors:this.opts.allErrors,data:Tn.default.data,parentData:Tn.default.parentData,parentDataProperty:Tn.default.parentDataProperty,dataNames:[Tn.default.data],dataPathArr:[Bt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Bt.stringify)(t.schema)}:{ref:t.schema}),validateName:l,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Bt.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Bt._)`""`,opts:this.opts,self:this},c;try{this._compilations.add(t),(0,RM.validateFunctionCode)(u),o.optimize(this.opts.code.optimize);let f=o.toString();c=`${o.scopeRefs(Tn.default.scope)}return ${f}`,this.opts.code.process&&(c=this.opts.code.process(c,t));let h=new Function(`${Tn.default.self}`,`${Tn.default.scope}`,c)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:f,scopeValues:o._values}),this.opts.unevaluated){let{props:d,items:m}=u;h.evaluated={props:d instanceof Bt.Name?void 0:d,items:m instanceof Bt.Name?void 0:m,dynamicProps:d instanceof Bt.Name,dynamicItems:m instanceof Bt.Name},h.source&&(h.source.evaluated=(0,Bt.stringify)(h.evaluated))}return t.validate=h,t}catch(f){throw delete t.validate,delete t.validateName,c&&this.logger.error("Error compiling schema, function code:",c),f}finally{this._compilations.delete(t)}}kt.compileSchema=Td;function OM(t,e,r){var n;r=(0,Gt.resolveUrl)(this.opts.uriResolver,e,r);let s=t.refs[r];if(s)return s;let i=PM.call(this,t,r);if(i===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(i=new gs({schema:o,schemaId:a,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=TM.call(this,i)}kt.resolveRef=OM;function TM(t){return(0,Gt.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Td.call(this,t)}function rb(t){for(let e of this._compilations)if($M(e,t))return e}kt.getCompilingSchema=rb;function $M(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function PM(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Za.call(this,t,e)}function Za(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Gt._getFullPath)(this.opts.uriResolver,r),s=(0,Gt.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return Od.call(this,r,t);let i=(0,Gt.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=Za.call(this,t,o);return typeof a?.schema!="object"?void 0:Od.call(this,r,a)}if(typeof o?.schema=="object"){if(o.validate||Td.call(this,o),i===(0,Gt.normalizeId)(e)){let{schema:a}=o,{schemaId:l}=this.opts,u=a[l];return u&&(s=(0,Gt.resolveUrl)(this.opts.uriResolver,s,u)),new gs({schema:a,schemaId:l,root:t,baseId:s})}return Od.call(this,r,o)}}kt.resolveSchema=Za;var AM=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Od(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,tb.unescapeFragment)(a)];if(l===void 0)return;r=l;let u=typeof r=="object"&&r[this.opts.schemaId];!AM.has(a)&&u&&(e=(0,Gt.resolveUrl)(this.opts.uriResolver,e,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,tb.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Gt.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=Za.call(this,n,a)}let{schemaId:o}=this.opts;if(i=i||new gs({schema:r,schemaId:o,root:n,baseId:e}),i.schema!==i.root.schema)return i}});var nb=E((uY,CM)=>{CM.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Pd=E((cY,ab)=>{"use strict";var IM=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),ib=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function $d(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var NM=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function sb(t){return t.length=0,!0}function kM(t,e,r){if(t.length){let n=$d(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function xM(t){let e=0,r={error:!1,address:"",zone:""},n=[],s=[],i=!1,o=!1,a=kM;for(let l=0;l<t.length;l++){let u=t[l];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(o=!0),!a(s,n,r))break;if(++e>7){r.error=!0;break}l>0&&t[l-1]===":"&&(i=!0),n.push(":");continue}else if(u==="%"){if(!a(s,n,r))break;a=sb}else{s.push(u);continue}}return s.length&&(a===sb?r.zone=s.join(""):o?n.push(s.join("")):n.push($d(s))),r.address=n.join(""),r}function ob(t){if(LM(t,":")<2)return{host:t,isIPV6:!1};let e=xM(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function LM(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function qM(t){let e=t,r=[],n=-1,s=0;for(;s=e.length;){if(s===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(s===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(s===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function jM(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function DM(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!ib(r)){let n=ob(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}ab.exports={nonSimpleDomain:NM,recomposeAuthority:DM,normalizeComponentEncoding:jM,removeDotSegments:qM,isIPv4:ib,isUUID:IM,normalizeIPv6:ob,stringArrayToHexStripped:$d}});var db=E((fY,fb)=>{"use strict";var{isUUID:FM}=Pd(),MM=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,HM=["http","https","ws","wss","urn","urn:uuid"];function VM(t){return HM.indexOf(t)!==-1}function Ad(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function lb(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function ub(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function zM(t){return t.secure=Ad(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function UM(t){if((t.port===(Ad(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function BM(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(MM);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let s=`${n}:${e.nid||t.nid}`,i=Cd(s);t.path=void 0,i&&(t=i.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function GM(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),s=`${r}:${e.nid||n}`,i=Cd(s);i&&(t=i.serialize(t,e));let o=t,a=t.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function WM(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!FM(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function JM(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var cb={scheme:"http",domainHost:!0,parse:lb,serialize:ub},KM={scheme:"https",domainHost:cb.domainHost,parse:lb,serialize:ub},el={scheme:"ws",domainHost:!0,parse:zM,serialize:UM},YM={scheme:"wss",domainHost:el.domainHost,parse:el.parse,serialize:el.serialize},XM={scheme:"urn",parse:BM,serialize:GM,skipNormalize:!0},QM={scheme:"urn:uuid",parse:WM,serialize:JM,skipNormalize:!0},tl={http:cb,https:KM,ws:el,wss:YM,urn:XM,"urn:uuid":QM};Object.setPrototypeOf(tl,null);function Cd(t){return t&&(tl[t]||tl[t.toLowerCase()])||void 0}fb.exports={wsIsSecure:Ad,SCHEMES:tl,isValidSchemeName:VM,getSchemeHandler:Cd}});var sl=E((dY,nl)=>{"use strict";var{normalizeIPv6:ZM,removeDotSegments:ki,recomposeAuthority:eH,normalizeComponentEncoding:rl,isIPv4:tH,nonSimpleDomain:rH}=Pd(),{SCHEMES:nH,getSchemeHandler:hb}=db();function sH(t,e){return typeof t=="string"?t=ar(Or(t,e),e):typeof t=="object"&&(t=Or(ar(t,e),e)),t}function iH(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=pb(Or(t,n),Or(e,n),n,!0);return n.skipEscape=!0,ar(s,n)}function pb(t,e,r,n){let s={};return n||(t=Or(ar(t,r),r),e=Or(ar(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=ki(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=ki(e.path||""),s.query=e.query):(e.path?(e.path[0]==="/"?s.path=ki(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?s.path="/"+e.path:t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=ki(s.path)),s.query=e.query):(s.path=t.path,e.query!==void 0?s.query=e.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=e.fragment,s}function oH(t,e,r){return typeof t=="string"?(t=unescape(t),t=ar(rl(Or(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=ar(rl(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=ar(rl(Or(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=ar(rl(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function ar(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),s=[],i=hb(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");let o=eH(r);if(o!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(o),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=ki(a)),o===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),s.push(a)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}var aH=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Or(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(aH);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host)if(tH(n.host)===!1){let l=ZM(n.host);n.host=l.host.toLowerCase(),s=l.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let o=hb(r.scheme||n.scheme);if(!r.unicodeSupport&&(!o||!o.unicodeSupport)&&n.host&&(r.domainHost||o&&o.domainHost)&&s===!1&&rH(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!o||o&&!o.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),o&&o.parse&&o.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var Id={SCHEMES:nH,normalize:sH,resolve:iH,resolveComponent:pb,equal:oH,serialize:ar,parse:Or};nl.exports=Id;nl.exports.default=Id;nl.exports.fastUri=Id});var gb=E(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});var mb=sl();mb.code='require("ajv/dist/runtime/uri").default';Nd.default=mb});var Ld=E(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.CodeGen=Je.Name=Je.nil=Je.stringify=Je.str=Je._=Je.KeywordCxt=void 0;var lH=ms();Object.defineProperty(Je,"KeywordCxt",{enumerable:!0,get:function(){return lH.KeywordCxt}});var ys=W();Object.defineProperty(Je,"_",{enumerable:!0,get:function(){return ys._}});Object.defineProperty(Je,"str",{enumerable:!0,get:function(){return ys.str}});Object.defineProperty(Je,"stringify",{enumerable:!0,get:function(){return ys.stringify}});Object.defineProperty(Je,"nil",{enumerable:!0,get:function(){return ys.nil}});Object.defineProperty(Je,"Name",{enumerable:!0,get:function(){return ys.Name}});Object.defineProperty(Je,"CodeGen",{enumerable:!0,get:function(){return ys.CodeGen}});var uH=Ni(),bb=Rr(),cH=ld(),xi=$n(),fH=W(),Li=Ai(),il=$i(),xd=ee(),yb=nb(),dH=gb(),vb=(t,e)=>new RegExp(t,e);vb.code="new RegExp";var hH=["removeAdditional","useDefaults","coerceTypes"],pH=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),mH={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},gH={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},_b=200;function yH(t){var e,r,n,s,i,o,a,l,u,c,f,p,h,d,m,g,S,b,_,y,R,T,O,w,$;let v=t.strict,P=(e=t.code)===null||e===void 0?void 0:e.optimize,C=P===!0||P===void 0?1:P||0,k=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:vb,M=(s=t.uriResolver)!==null&&s!==void 0?s:dH.default;return{strictSchema:(o=(i=t.strictSchema)!==null&&i!==void 0?i:v)!==null&&o!==void 0?o:!0,strictNumbers:(l=(a=t.strictNumbers)!==null&&a!==void 0?a:v)!==null&&l!==void 0?l:!0,strictTypes:(c=(u=t.strictTypes)!==null&&u!==void 0?u:v)!==null&&c!==void 0?c:"log",strictTuples:(p=(f=t.strictTuples)!==null&&f!==void 0?f:v)!==null&&p!==void 0?p:"log",strictRequired:(d=(h=t.strictRequired)!==null&&h!==void 0?h:v)!==null&&d!==void 0?d:!1,code:t.code?{...t.code,optimize:C,regExp:k}:{optimize:C,regExp:k},loopRequired:(m=t.loopRequired)!==null&&m!==void 0?m:_b,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:_b,meta:(S=t.meta)!==null&&S!==void 0?S:!0,messages:(b=t.messages)!==null&&b!==void 0?b:!0,inlineRefs:(_=t.inlineRefs)!==null&&_!==void 0?_:!0,schemaId:(y=t.schemaId)!==null&&y!==void 0?y:"$id",addUsedSchema:(R=t.addUsedSchema)!==null&&R!==void 0?R:!0,validateSchema:(T=t.validateSchema)!==null&&T!==void 0?T:!0,validateFormats:(O=t.validateFormats)!==null&&O!==void 0?O:!0,unicodeRegExp:(w=t.unicodeRegExp)!==null&&w!==void 0?w:!0,int32range:($=t.int32range)!==null&&$!==void 0?$:!0,uriResolver:M}}var qi=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...yH(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new fH.ValueScope({scope:{},prefixes:pH,es5:r,lines:n}),this.logger=wH(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,cH.getRules)(),Sb.call(this,mH,e,"NOT SUPPORTED"),Sb.call(this,gH,e,"DEPRECATED","warn"),this._metaOpts=bH.call(this),e.formats&&SH.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&EH.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),_H.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,s=yb;n==="id"&&(s={...yb},s.id=s.$id,delete s.$id),r&&e&&this.addMetaSchema(s,s[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(r);return"$async"in n||(this.errors=n.errors),s}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,e,r);async function s(c,f){await i.call(this,c.$schema);let p=this._addSchema(c,f);return p.validate||o.call(this,p)}async function i(c){c&&!this.getSchema(c)&&await s.call(this,{$ref:c},!0)}async function o(c){try{return this._compileSchemaEnv(c)}catch(f){if(!(f instanceof bb.default))throw f;return a.call(this,f),await l.call(this,f.missingSchema),o.call(this,c)}}function a({missingSchema:c,missingRef:f}){if(this.refs[c])throw new Error(`AnySchema ${c} is loaded but ${f} cannot be resolved`)}async function l(c){let f=await u.call(this,c);this.refs[c]||await i.call(this,f.$schema),this.refs[c]||this.addSchema(f,c,r)}async function u(c){let f=this._loading[c];if(f)return f;try{return await(this._loading[c]=n(c))}finally{delete this._loading[c]}}}addSchema(e,r,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,s);return this}let i;if(typeof e=="object"){let{schemaId:o}=this.opts;if(i=e[o],i!==void 0&&typeof i!="string")throw new Error(`schema ${o} must be string`)}return r=(0,Li.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,s,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,e);if(!s&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let r;for(;typeof(r=Eb.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,s=new xi.SchemaEnv({schema:{},schemaId:n});if(r=xi.resolveSchema.call(this,s,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Eb.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,Li.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(OH.call(this,n,r),!r)return(0,xd.eachItem)(n,i=>kd.call(this,i)),this;$H.call(this,r);let s={...r,type:(0,il.getJSONTypes)(r.type),schemaType:(0,il.getJSONTypes)(r.schemaType)};return(0,xd.eachItem)(n,s.type.length===0?i=>kd.call(this,i,s):i=>s.type.forEach(o=>kd.call(this,i,s,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let s=n.rules.findIndex(i=>i.keyword===e);s>=0&&n.rules.splice(s,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,i)=>s+r+i)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of r){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in n){let l=n[a];if(typeof l!="object")continue;let{$data:u}=l.definition,c=o[a];u&&c&&(o[a]=wb(c))}}return e}_removeAllSchemas(e,r){for(let n in e){let s=e[n];(!r||r.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,r,n,s=this.opts.validateSchema,i=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let l=this._cache.get(e);if(l!==void 0)return l;n=(0,Li.normalizeId)(o||n);let u=Li.getSchemaRefs.call(this,e,n);return l=new xi.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(l.schema,l),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=l),s&&this.validateSchema(e,!0),l}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):xi.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{xi.compileSchema.call(this,e)}finally{this.opts=r}}};qi.ValidationError=uH.default;qi.MissingRefError=bb.default;Je.default=qi;function Sb(t,e,r,n="error"){for(let s in t){let i=s;i in e&&this.logger[n](`${r}: option ${s}. ${t[i]}`)}}function Eb(t){return t=(0,Li.normalizeId)(t),this.schemas[t]||this.refs[t]}function _H(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function SH(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function EH(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function bH(){let t={...this.opts};for(let e of hH)delete t[e];return t}var vH={log(){},warn(){},error(){}};function wH(t){if(t===!1)return vH;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var RH=/^[a-z_$][a-z0-9_$:-]*$/i;function OH(t,e){let{RULES:r}=this;if((0,xd.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!RH.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function kd(t,e,r){var n;let s=e?.post;if(r&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:l})=>l===r);if(o||(o={type:r,rules:[]},i.rules.push(o)),i.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,il.getJSONTypes)(e.type),schemaType:(0,il.getJSONTypes)(e.schemaType)}};e.before?TH.call(this,o,a,e.before):o.rules.push(a),i.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(l=>this.addKeyword(l))}function TH(t,e,r){let n=t.rules.findIndex(s=>s.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function $H(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=wb(e)),t.validateSchema=this.compile(e,!0))}var PH={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function wb(t){return{anyOf:[t,PH]}}});var Rb=E(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var AH={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};qd.default=AH});var jd=E(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.callRef=Pn.getValidate=void 0;var CH=Rr(),Ob=We(),bt=W(),_s=Nt(),Tb=$n(),ol=ee(),IH={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:l}=n,{root:u}=i;if((r==="#"||r==="#/")&&s===u.baseId)return f();let c=Tb.resolveRef.call(l,u,s,r);if(c===void 0)throw new CH.default(n.opts.uriResolver,s,r);if(c instanceof Tb.SchemaEnv)return p(c);return h(c);function f(){if(i===u)return al(t,o,i,i.$async);let d=e.scopeValue("root",{ref:u});return al(t,(0,bt._)`${d}.validate`,u,u.$async)}function p(d){let m=$b(t,d);al(t,m,d,d.$async)}function h(d){let m=e.scopeValue("schema",a.code.source===!0?{ref:d,code:(0,bt.stringify)(d)}:{ref:d}),g=e.name("valid"),S=t.subschema({schema:d,dataTypes:[],schemaPath:bt.nil,topSchemaRef:m,errSchemaPath:r},g);t.mergeEvaluated(S),t.ok(g)}}};function $b(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,bt._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Pn.getValidate=$b;function al(t,e,r,n){let{gen:s,it:i}=t,{allErrors:o,schemaEnv:a,opts:l}=i,u=l.passContext?_s.default.this:bt.nil;n?c():f();function c(){if(!a.$async)throw new Error("async schema referenced by sync schema");let d=s.let("valid");s.try(()=>{s.code((0,bt._)`await ${(0,Ob.callValidateCode)(t,e,u)}`),h(e),o||s.assign(d,!0)},m=>{s.if((0,bt._)`!(${m} instanceof ${i.ValidationError})`,()=>s.throw(m)),p(m),o||s.assign(d,!1)}),t.ok(d)}function f(){t.result((0,Ob.callValidateCode)(t,e,u),()=>h(e),()=>p(e))}function p(d){let m=(0,bt._)`${d}.errors`;s.assign(_s.default.vErrors,(0,bt._)`${_s.default.vErrors} === null ? ${m} : ${_s.default.vErrors}.concat(${m})`),s.assign(_s.default.errors,(0,bt._)`${_s.default.vErrors}.length`)}function h(d){var m;if(!i.opts.unevaluated)return;let g=(m=r?.validate)===null||m===void 0?void 0:m.evaluated;if(i.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(i.props=ol.mergeEvaluated.props(s,g.props,i.props));else{let S=s.var("props",(0,bt._)`${d}.evaluated.props`);i.props=ol.mergeEvaluated.props(s,S,i.props,bt.Name)}if(i.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(i.items=ol.mergeEvaluated.items(s,g.items,i.items));else{let S=s.var("items",(0,bt._)`${d}.evaluated.items`);i.items=ol.mergeEvaluated.items(s,S,i.items,bt.Name)}}}Pn.callRef=al;Pn.default=IH});var Pb=E(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var NH=Rb(),kH=jd(),xH=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",NH.default,kH.default];Dd.default=xH});var Ab=E(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var ll=W(),Yr=ll.operators,ul={maximum:{okStr:"<=",ok:Yr.LTE,fail:Yr.GT},minimum:{okStr:">=",ok:Yr.GTE,fail:Yr.LT},exclusiveMaximum:{okStr:"<",ok:Yr.LT,fail:Yr.GTE},exclusiveMinimum:{okStr:">",ok:Yr.GT,fail:Yr.LTE}},LH={message:({keyword:t,schemaCode:e})=>(0,ll.str)`must be ${ul[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,ll._)`{comparison: ${ul[t].okStr}, limit: ${e}}`},qH={keyword:Object.keys(ul),type:"number",schemaType:"number",$data:!0,error:LH,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,ll._)`${r} ${ul[e].fail} ${n} || isNaN(${r})`)}};Fd.default=qH});var Cb=E(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var ji=W(),jH={message:({schemaCode:t})=>(0,ji.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ji._)`{multipleOf: ${t}}`},DH={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:jH,code(t){let{gen:e,data:r,schemaCode:n,it:s}=t,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,ji._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,ji._)`${o} !== parseInt(${o})`;t.fail$data((0,ji._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};Md.default=DH});var Nb=E(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});function Ib(t){let e=t.length,r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}Hd.default=Ib;Ib.code='require("ajv/dist/runtime/ucs2length").default'});var kb=E(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});var An=W(),FH=ee(),MH=Nb(),HH={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,An.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,An._)`{limit: ${t}}`},VH={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:HH,code(t){let{keyword:e,data:r,schemaCode:n,it:s}=t,i=e==="maxLength"?An.operators.GT:An.operators.LT,o=s.opts.unicode===!1?(0,An._)`${r}.length`:(0,An._)`${(0,FH.useFunc)(t.gen,MH.default)}(${r})`;t.fail$data((0,An._)`${o} ${i} ${n}`)}};Vd.default=VH});var xb=E(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});var zH=We(),cl=W(),UH={message:({schemaCode:t})=>(0,cl.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,cl._)`{pattern: ${t}}`},BH={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:UH,code(t){let{data:e,$data:r,schema:n,schemaCode:s,it:i}=t,o=i.opts.unicodeRegExp?"u":"",a=r?(0,cl._)`(new RegExp(${s}, ${o}))`:(0,zH.usePattern)(t,n);t.fail$data((0,cl._)`!${a}.test(${e})`)}};zd.default=BH});var Lb=E(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var Di=W(),GH={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Di.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Di._)`{limit: ${t}}`},WH={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:GH,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?Di.operators.GT:Di.operators.LT;t.fail$data((0,Di._)`Object.keys(${r}).length ${s} ${n}`)}};Ud.default=WH});var qb=E(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});var Fi=We(),Mi=W(),JH=ee(),KH={message:({params:{missingProperty:t}})=>(0,Mi.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Mi._)`{missingProperty: ${t}}`},YH={keyword:"required",type:"object",schemaType:"array",$data:!0,error:KH,code(t){let{gen:e,schema:r,schemaCode:n,data:s,$data:i,it:o}=t,{opts:a}=o;if(!i&&r.length===0)return;let l=r.length>=a.loopRequired;if(o.allErrors?u():c(),a.strictRequired){let h=t.parentSchema.properties,{definedProperties:d}=t.it;for(let m of r)if(h?.[m]===void 0&&!d.has(m)){let g=o.schemaEnv.baseId+o.errSchemaPath,S=`required property "${m}" is not defined at "${g}" (strictRequired)`;(0,JH.checkStrictMode)(o,S,o.opts.strictRequired)}}function u(){if(l||i)t.block$data(Mi.nil,f);else for(let h of r)(0,Fi.checkReportMissingProp)(t,h)}function c(){let h=e.let("missing");if(l||i){let d=e.let("valid",!0);t.block$data(d,()=>p(h,d)),t.ok(d)}else e.if((0,Fi.checkMissingProp)(t,r,h)),(0,Fi.reportMissingProp)(t,h),e.else()}function f(){e.forOf("prop",n,h=>{t.setParams({missingProperty:h}),e.if((0,Fi.noPropertyInData)(e,s,h,a.ownProperties),()=>t.error())})}function p(h,d){t.setParams({missingProperty:h}),e.forOf(h,n,()=>{e.assign(d,(0,Fi.propertyInData)(e,s,h,a.ownProperties)),e.if((0,Mi.not)(d),()=>{t.error(),e.break()})},Mi.nil)}}};Bd.default=YH});var jb=E(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var Hi=W(),XH={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Hi.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Hi._)`{limit: ${t}}`},QH={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:XH,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?Hi.operators.GT:Hi.operators.LT;t.fail$data((0,Hi._)`${r}.length ${s} ${n}`)}};Gd.default=QH});var Vi=E(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});var Db=Pi();Db.code='require("ajv/dist/runtime/equal").default';Wd.default=Db});var Fb=E(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});var Jd=$i(),Ke=W(),ZH=ee(),e2=Vi(),t2={message:({params:{i:t,j:e}})=>(0,Ke.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Ke._)`{i: ${t}, j: ${e}}`},r2={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:t2,code(t){let{gen:e,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:a}=t;if(!n&&!s)return;let l=e.let("valid"),u=i.items?(0,Jd.getSchemaTypes)(i.items):[];t.block$data(l,c,(0,Ke._)`${o} === false`),t.ok(l);function c(){let d=e.let("i",(0,Ke._)`${r}.length`),m=e.let("j");t.setParams({i:d,j:m}),e.assign(l,!0),e.if((0,Ke._)`${d} > 1`,()=>(f()?p:h)(d,m))}function f(){return u.length>0&&!u.some(d=>d==="object"||d==="array")}function p(d,m){let g=e.name("item"),S=(0,Jd.checkDataTypes)(u,g,a.opts.strictNumbers,Jd.DataType.Wrong),b=e.const("indices",(0,Ke._)`{}`);e.for((0,Ke._)`;${d}--;`,()=>{e.let(g,(0,Ke._)`${r}[${d}]`),e.if(S,(0,Ke._)`continue`),u.length>1&&e.if((0,Ke._)`typeof ${g} == "string"`,(0,Ke._)`${g} += "_"`),e.if((0,Ke._)`typeof ${b}[${g}] == "number"`,()=>{e.assign(m,(0,Ke._)`${b}[${g}]`),t.error(),e.assign(l,!1).break()}).code((0,Ke._)`${b}[${g}] = ${d}`)})}function h(d,m){let g=(0,ZH.useFunc)(e,e2.default),S=e.name("outer");e.label(S).for((0,Ke._)`;${d}--;`,()=>e.for((0,Ke._)`${m} = ${d}; ${m}--;`,()=>e.if((0,Ke._)`${g}(${r}[${d}], ${r}[${m}])`,()=>{t.error(),e.assign(l,!1).break(S)})))}}};Kd.default=r2});var Mb=E(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});var Yd=W(),n2=ee(),s2=Vi(),i2={message:"must be equal to constant",params:({schemaCode:t})=>(0,Yd._)`{allowedValue: ${t}}`},o2={keyword:"const",$data:!0,error:i2,code(t){let{gen:e,data:r,$data:n,schemaCode:s,schema:i}=t;n||i&&typeof i=="object"?t.fail$data((0,Yd._)`!${(0,n2.useFunc)(e,s2.default)}(${r}, ${s})`):t.fail((0,Yd._)`${i} !== ${r}`)}};Xd.default=o2});var Hb=E(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});var zi=W(),a2=ee(),l2=Vi(),u2={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,zi._)`{allowedValues: ${t}}`},c2={keyword:"enum",schemaType:"array",$data:!0,error:u2,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:o}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,l,u=()=>l??(l=(0,a2.useFunc)(e,l2.default)),c;if(a||n)c=e.let("valid"),t.block$data(c,f);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let h=e.const("vSchema",i);c=(0,zi.or)(...s.map((d,m)=>p(h,m)))}t.pass(c);function f(){e.assign(c,!1),e.forOf("v",i,h=>e.if((0,zi._)`${u()}(${r}, ${h})`,()=>e.assign(c,!0).break()))}function p(h,d){let m=s[d];return typeof m=="object"&&m!==null?(0,zi._)`${u()}(${r}, ${h}[${d}])`:(0,zi._)`${r} === ${m}`}}};Qd.default=c2});var Vb=E(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});var f2=Ab(),d2=Cb(),h2=kb(),p2=xb(),m2=Lb(),g2=qb(),y2=jb(),_2=Fb(),S2=Mb(),E2=Hb(),b2=[f2.default,d2.default,h2.default,p2.default,m2.default,g2.default,y2.default,_2.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},S2.default,E2.default];Zd.default=b2});var th=E(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.validateAdditionalItems=void 0;var Cn=W(),eh=ee(),v2={message:({params:{len:t}})=>(0,Cn.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Cn._)`{limit: ${t}}`},w2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:v2,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,eh.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}zb(t,n)}};function zb(t,e){let{gen:r,schema:n,data:s,keyword:i,it:o}=t;o.items=!0;let a=r.const("len",(0,Cn._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Cn._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,eh.alwaysValidSchema)(o,n)){let u=r.var("valid",(0,Cn._)`${a} <= ${e.length}`);r.if((0,Cn.not)(u),()=>l(u)),t.ok(u)}function l(u){r.forRange("i",e.length,a,c=>{t.subschema({keyword:i,dataProp:c,dataPropType:eh.Type.Num},u),o.allErrors||r.if((0,Cn.not)(u),()=>r.break())})}}Ui.validateAdditionalItems=zb;Ui.default=w2});var rh=E(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.validateTuple=void 0;var Ub=W(),fl=ee(),R2=We(),O2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Bb(t,"additionalItems",e);r.items=!0,!(0,fl.alwaysValidSchema)(r,e)&&t.ok((0,R2.validateArray)(t))}};function Bb(t,e,r=t.schema){let{gen:n,parentSchema:s,data:i,keyword:o,it:a}=t;c(s),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=fl.mergeEvaluated.items(n,r.length,a.items));let l=n.name("valid"),u=n.const("len",(0,Ub._)`${i}.length`);r.forEach((f,p)=>{(0,fl.alwaysValidSchema)(a,f)||(n.if((0,Ub._)`${u} > ${p}`,()=>t.subschema({keyword:o,schemaProp:p,dataProp:p},l)),t.ok(l))});function c(f){let{opts:p,errSchemaPath:h}=a,d=r.length,m=d===f.minItems&&(d===f.maxItems||f[e]===!1);if(p.strictTuples&&!m){let g=`"${o}" is ${d}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,fl.checkStrictMode)(a,g,p.strictTuples)}}}Bi.validateTuple=Bb;Bi.default=O2});var Gb=E(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});var T2=rh(),$2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,T2.validateTuple)(t,"items")};nh.default=$2});var Jb=E(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});var Wb=W(),P2=ee(),A2=We(),C2=th(),I2={message:({params:{len:t}})=>(0,Wb.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Wb._)`{limit: ${t}}`},N2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:I2,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,P2.alwaysValidSchema)(n,e)&&(s?(0,C2.validateAdditionalItems)(t,s):t.ok((0,A2.validateArray)(t)))}};sh.default=N2});var Kb=E(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});var xt=W(),dl=ee(),k2={message:({params:{min:t,max:e}})=>e===void 0?(0,xt.str)`must contain at least ${t} valid item(s)`:(0,xt.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,xt._)`{minContains: ${t}}`:(0,xt._)`{minContains: ${t}, maxContains: ${e}}`},x2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:k2,code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t,o,a,{minContains:l,maxContains:u}=n;i.opts.next?(o=l===void 0?1:l,a=u):o=1;let c=e.const("len",(0,xt._)`${s}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,dl.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,dl.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,dl.alwaysValidSchema)(i,r)){let m=(0,xt._)`${c} >= ${o}`;a!==void 0&&(m=(0,xt._)`${m} && ${c} <= ${a}`),t.pass(m);return}i.items=!0;let f=e.name("valid");a===void 0&&o===1?h(f,()=>e.if(f,()=>e.break())):o===0?(e.let(f,!0),a!==void 0&&e.if((0,xt._)`${s}.length > 0`,p)):(e.let(f,!1),p()),t.result(f,()=>t.reset());function p(){let m=e.name("_valid"),g=e.let("count",0);h(m,()=>e.if(m,()=>d(g)))}function h(m,g){e.forRange("i",0,c,S=>{t.subschema({keyword:"contains",dataProp:S,dataPropType:dl.Type.Num,compositeRule:!0},m),g()})}function d(m){e.code((0,xt._)`${m}++`),a===void 0?e.if((0,xt._)`${m} >= ${o}`,()=>e.assign(f,!0).break()):(e.if((0,xt._)`${m} > ${a}`,()=>e.assign(f,!1).break()),o===1?e.assign(f,!0):e.if((0,xt._)`${m} >= ${o}`,()=>e.assign(f,!0)))}}};ih.default=x2});var Qb=E(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.validateSchemaDeps=lr.validatePropertyDeps=lr.error=void 0;var oh=W(),L2=ee(),Gi=We();lr.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,oh.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,oh._)`{property: ${t},
55
+ || ${o} === "boolean" || ${s} === null`).assign(a,(0,Z._)`[${s}]`)}}}function bF({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Z._)`${e} !== undefined`,()=>t.assign((0,Z._)`${e}[${r}]`,n))}function fd(t,e,r,n=ds.Correct){let s=n===ds.Correct?Z.operators.EQ:Z.operators.NEQ,i;switch(t){case"null":return(0,Z._)`${e} ${s} null`;case"array":i=(0,Z._)`Array.isArray(${e})`;break;case"object":i=(0,Z._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,Z._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,Z._)`typeof ${e} ${s} ${t}`}return n===ds.Correct?i:(0,Z.not)(i);function o(a=Z.nil){return(0,Z.and)((0,Z._)`typeof ${e} == "number"`,a,r?(0,Z._)`isFinite(${e})`:Z.nil)}}et.checkDataType=fd;function dd(t,e,r,n){if(t.length===1)return fd(t[0],e,r,n);let s,i=(0,RE.toHash)(t);if(i.array&&i.object){let o=(0,Z._)`typeof ${e} != "object"`;s=i.null?o:(0,Z._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=Z.nil;i.number&&delete i.integer;for(let o in i)s=(0,Z.and)(s,fd(o,e,r,n));return s}et.checkDataTypes=dd;var vF={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Z._)`{type: ${t}}`:(0,Z._)`{type: ${e}}`};function hd(t){let e=wF(t);(0,gF.reportError)(e,vF)}et.reportTypeError=hd;function wF(t){let{gen:e,data:r,schema:n}=t,s=(0,RE.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:t}}});var PE=E(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.assignDefaults=void 0;var hs=W(),RF=ee();function OF(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let s in r)$E(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>$E(t,i,s.default))}Ya.assignDefaults=OF;function $E(t,e,r){let{gen:n,compositeRule:s,data:i,opts:o}=t;if(r===void 0)return;let a=(0,hs._)`${i}${(0,hs.getProperty)(e)}`;if(s){(0,RF.checkStrictMode)(t,`default is ignored for: ${a}`);return}let l=(0,hs._)`${a} === undefined`;o.useDefaults==="empty"&&(l=(0,hs._)`${l} || ${a} === null || ${a} === ""`),n.if(l,(0,hs._)`${a} = ${(0,hs.stringify)(r)}`)}});var We=E(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.validateUnion=_e.validateArray=_e.usePattern=_e.callValidateCode=_e.schemaProperties=_e.allSchemaProperties=_e.noPropertyInData=_e.propertyInData=_e.isOwnProperty=_e.hasPropFunc=_e.reportMissingProp=_e.checkMissingProp=_e.checkReportMissingProp=void 0;var be=W(),pd=ee(),Gr=Nt(),TF=ee();function $F(t,e){let{gen:r,data:n,it:s}=t;r.if(gd(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,be._)`${e}`},!0),t.error()})}_e.checkReportMissingProp=$F;function PF({gen:t,data:e,it:{opts:r}},n,s){return(0,be.or)(...n.map(i=>(0,be.and)(gd(t,e,i,r.ownProperties),(0,be._)`${s} = ${i}`)))}_e.checkMissingProp=PF;function AF(t,e){t.setParams({missingProperty:e},!0),t.error()}_e.reportMissingProp=AF;function AE(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,be._)`Object.prototype.hasOwnProperty`})}_e.hasPropFunc=AE;function md(t,e,r){return(0,be._)`${AE(t)}.call(${e}, ${r})`}_e.isOwnProperty=md;function CF(t,e,r,n){let s=(0,be._)`${e}${(0,be.getProperty)(r)} !== undefined`;return n?(0,be._)`${s} && ${md(t,e,r)}`:s}_e.propertyInData=CF;function gd(t,e,r,n){let s=(0,be._)`${e}${(0,be.getProperty)(r)} === undefined`;return n?(0,be.or)(s,(0,be.not)(md(t,e,r))):s}_e.noPropertyInData=gd;function CE(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}_e.allSchemaProperties=CE;function IF(t,e){return CE(e).filter(r=>!(0,pd.alwaysValidSchema)(t,e[r]))}_e.schemaProperties=IF;function NF({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},a,l,u){let c=u?(0,be._)`${t}, ${e}, ${n}${s}`:e,f=[[Gr.default.instancePath,(0,be.strConcat)(Gr.default.instancePath,i)],[Gr.default.parentData,o.parentData],[Gr.default.parentDataProperty,o.parentDataProperty],[Gr.default.rootData,Gr.default.rootData]];o.opts.dynamicRef&&f.push([Gr.default.dynamicAnchors,Gr.default.dynamicAnchors]);let p=(0,be._)`${c}, ${r.object(...f)}`;return l!==be.nil?(0,be._)`${a}.call(${l}, ${p})`:(0,be._)`${a}(${p})`}_e.callValidateCode=NF;var kF=(0,be._)`new RegExp`;function xF({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(r,n);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,be._)`${s.code==="new RegExp"?kF:(0,TF.useFunc)(t,s)}(${r}, ${n})`})}_e.usePattern=xF;function LF(t){let{gen:e,data:r,keyword:n,it:s}=t,i=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(i,!0),o(()=>e.break()),i;function o(a){let l=e.const("len",(0,be._)`${r}.length`);e.forRange("i",0,l,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:pd.Type.Num},i),e.if((0,be.not)(i),a)})}}_e.validateArray=LF;function qF(t){let{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,pd.alwaysValidSchema)(s,l))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((l,u)=>{let c=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);e.assign(o,(0,be._)`${o} || ${a}`),t.mergeValidEvaluated(c,a)||e.if((0,be.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}_e.validateUnion=qF});var kE=E(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.validateKeywordUsage=or.validSchemaType=or.funcKeywordCode=or.macroKeywordCode=void 0;var ot=W(),On=Nt(),jF=We(),DF=$i();function FF(t,e){let{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=t,a=e.macro.call(o.self,s,i,o),l=NE(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:ot.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}or.macroKeywordCode=FF;function MF(t,e){var r;let{gen:n,keyword:s,schema:i,parentSchema:o,$data:a,it:l}=t;VF(l,e);let u=!a&&e.compile?e.compile.call(l.self,i,o,l):e.validate,c=NE(n,s,u),f=n.let("valid");t.block$data(f,p),t.ok((r=e.valid)!==null&&r!==void 0?r:f);function p(){if(e.errors===!1)m(),e.modifying&&IE(t),g(()=>t.error());else{let S=e.async?h():d();e.modifying&&IE(t),g(()=>HF(t,S))}}function h(){let S=n.let("ruleErrs",null);return n.try(()=>m((0,ot._)`await `),b=>n.assign(f,!1).if((0,ot._)`${b} instanceof ${l.ValidationError}`,()=>n.assign(S,(0,ot._)`${b}.errors`),()=>n.throw(b))),S}function d(){let S=(0,ot._)`${c}.errors`;return n.assign(S,null),m(ot.nil),S}function m(S=e.async?(0,ot._)`await `:ot.nil){let b=l.opts.passContext?On.default.this:On.default.self,_=!("compile"in e&&!a||e.schema===!1);n.assign(f,(0,ot._)`${S}${(0,jF.callValidateCode)(t,c,b,_)}`,e.modifying)}function g(S){var b;n.if((0,ot.not)((b=e.valid)!==null&&b!==void 0?b:f),S)}}or.funcKeywordCode=MF;function IE(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,ot._)`${n.parentData}[${n.parentDataProperty}]`))}function HF(t,e){let{gen:r}=t;r.if((0,ot._)`Array.isArray(${e})`,()=>{r.assign(On.default.vErrors,(0,ot._)`${On.default.vErrors} === null ? ${e} : ${On.default.vErrors}.concat(${e})`).assign(On.default.errors,(0,ot._)`${On.default.vErrors}.length`),(0,DF.extendErrors)(t)},()=>t.error())}function VF({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function NE(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,ot.stringify)(r)})}function zF(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}or.validSchemaType=zF;function UF({schema:t,opts:e,self:r,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[i])){let l=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}or.validateKeywordUsage=UF});var LE=E(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.extendSubschemaMode=Wr.extendSubschemaData=Wr.getSubschema=void 0;var ar=W(),xE=ee();function BF(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,ar._)`${t.schemaPath}${(0,ar.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,ar._)`${t.schemaPath}${(0,ar.getProperty)(e)}${(0,ar.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,xE.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Wr.getSubschema=BF;function GF(t,e,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:u,dataPathArr:c,opts:f}=e,p=a.let("data",(0,ar._)`${e.data}${(0,ar.getProperty)(r)}`,!0);l(p),t.errorPath=(0,ar.str)`${u}${(0,xE.getErrorPath)(r,n,f.jsPropertySyntax)}`,t.parentDataProperty=(0,ar._)`${r}`,t.dataPathArr=[...c,t.parentDataProperty]}if(s!==void 0){let u=s instanceof ar.Name?s:a.let("data",s,!0);l(u),o!==void 0&&(t.propertyName=o)}i&&(t.dataTypes=i);function l(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}Wr.extendSubschemaData=GF;function WF(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}Wr.extendSubschemaMode=WF});var Ai=E((cY,qE)=>{"use strict";qE.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var DE=E((fY,jE)=>{"use strict";var Jr=jE.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};Xa(e,n,s,t,"",t)};Jr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Jr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Jr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Jr.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Xa(t,e,r,n,s,i,o,a,l,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,o,a,l,u);for(var c in n){var f=n[c];if(Array.isArray(f)){if(c in Jr.arrayKeywords)for(var p=0;p<f.length;p++)Xa(t,e,r,f[p],s+"/"+c+"/"+p,i,s,c,n,p)}else if(c in Jr.propsKeywords){if(f&&typeof f=="object")for(var h in f)Xa(t,e,r,f[h],s+"/"+c+"/"+JF(h),i,s,c,n,h)}else(c in Jr.keywords||t.allKeys&&!(c in Jr.skipKeywords))&&Xa(t,e,r,f,s+"/"+c,i,s,c,n)}r(n,s,i,o,a,l,u)}}function JF(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Ci=E(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.getSchemaRefs=bt.resolveUrl=bt.normalizeId=bt._getFullPath=bt.getFullPath=bt.inlineRef=void 0;var KF=ee(),YF=Ai(),XF=DE(),QF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function ZF(t,e=!0){return typeof t=="boolean"?!0:e===!0?!yd(t):e?FE(t)<=e:!1}bt.inlineRef=ZF;var eM=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function yd(t){for(let e in t){if(eM.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(yd)||typeof r=="object"&&yd(r))return!0}return!1}function FE(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!QF.has(r)&&(typeof t[r]=="object"&&(0,KF.eachItem)(t[r],n=>e+=FE(n)),e===1/0))return 1/0}return e}function ME(t,e="",r){r!==!1&&(e=ps(e));let n=t.parse(e);return HE(t,n)}bt.getFullPath=ME;function HE(t,e){return t.serialize(e).split("#")[0]+"#"}bt._getFullPath=HE;var tM=/#\/?$/;function ps(t){return t?t.replace(tM,""):""}bt.normalizeId=ps;function rM(t,e,r){return r=ps(r),t.resolve(e,r)}bt.resolveUrl=rM;var nM=/^[a-z_][-a-z0-9._]*$/i;function sM(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=ps(t[r]||e),i={"":s},o=ME(n,s,!1),a={},l=new Set;return XF(t,{allKeys:!0},(f,p,h,d)=>{if(d===void 0)return;let m=o+p,g=i[d];typeof f[r]=="string"&&(g=S.call(this,f[r])),b.call(this,f.$anchor),b.call(this,f.$dynamicAnchor),i[p]=g;function S(_){let y=this.opts.uriResolver.resolve;if(_=ps(g?y(g,_):_),l.has(_))throw c(_);l.add(_);let R=this.refs[_];return typeof R=="string"&&(R=this.refs[R]),typeof R=="object"?u(f,R.schema,_):_!==ps(m)&&(_[0]==="#"?(u(f,a[_],_),a[_]=f):this.refs[_]=m),_}function b(_){if(typeof _=="string"){if(!nM.test(_))throw new Error(`invalid anchor "${_}"`);S.call(this,`#${_}`)}}}),a;function u(f,p,h){if(p!==void 0&&!YF(f,p))throw c(h)}function c(f){return new Error(`reference "${f}" resolves to more than one schema`)}}bt.getSchemaRefs=sM});var ms=E(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.getData=Kr.KeywordCxt=Kr.validateFunctionCode=void 0;var GE=bE(),VE=Pi(),Sd=cd(),Qa=Pi(),iM=PE(),Ni=kE(),_d=LE(),z=W(),K=Nt(),oM=Ci(),wr=ee(),Ii=$i();function aM(t){if(KE(t)&&(YE(t),JE(t))){cM(t);return}WE(t,()=>(0,GE.topBoolOrEmptySchema)(t))}Kr.validateFunctionCode=aM;function WE({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},i){s.code.es5?t.func(e,(0,z._)`${K.default.data}, ${K.default.valCxt}`,n.$async,()=>{t.code((0,z._)`"use strict"; ${zE(r,s)}`),uM(t,s),t.code(i)}):t.func(e,(0,z._)`${K.default.data}, ${lM(s)}`,n.$async,()=>t.code(zE(r,s)).code(i))}function lM(t){return(0,z._)`{${K.default.instancePath}="", ${K.default.parentData}, ${K.default.parentDataProperty}, ${K.default.rootData}=${K.default.data}${t.dynamicRef?(0,z._)`, ${K.default.dynamicAnchors}={}`:z.nil}}={}`}function uM(t,e){t.if(K.default.valCxt,()=>{t.var(K.default.instancePath,(0,z._)`${K.default.valCxt}.${K.default.instancePath}`),t.var(K.default.parentData,(0,z._)`${K.default.valCxt}.${K.default.parentData}`),t.var(K.default.parentDataProperty,(0,z._)`${K.default.valCxt}.${K.default.parentDataProperty}`),t.var(K.default.rootData,(0,z._)`${K.default.valCxt}.${K.default.rootData}`),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,z._)`${K.default.valCxt}.${K.default.dynamicAnchors}`)},()=>{t.var(K.default.instancePath,(0,z._)`""`),t.var(K.default.parentData,(0,z._)`undefined`),t.var(K.default.parentDataProperty,(0,z._)`undefined`),t.var(K.default.rootData,K.default.data),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,z._)`{}`)})}function cM(t){let{schema:e,opts:r,gen:n}=t;WE(t,()=>{r.$comment&&e.$comment&&QE(t),mM(t),n.let(K.default.vErrors,null),n.let(K.default.errors,0),r.unevaluated&&fM(t),XE(t),_M(t)})}function fM(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,z._)`${r}.evaluated`),e.if((0,z._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,z._)`${t.evaluated}.props`,(0,z._)`undefined`)),e.if((0,z._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,z._)`${t.evaluated}.items`,(0,z._)`undefined`))}function zE(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,z._)`/*# sourceURL=${r} */`:z.nil}function dM(t,e){if(KE(t)&&(YE(t),JE(t))){hM(t,e);return}(0,GE.boolOrEmptySchema)(t,e)}function JE({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function KE(t){return typeof t.schema!="boolean"}function hM(t,e){let{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&QE(t),gM(t),yM(t);let i=n.const("_errs",K.default.errors);XE(t,i),n.var(e,(0,z._)`${i} === ${K.default.errors}`)}function YE(t){(0,wr.checkUnknownRules)(t),pM(t)}function XE(t,e){if(t.opts.jtd)return UE(t,[],!1,e);let r=(0,VE.getSchemaTypes)(t.schema),n=(0,VE.coerceAndCheckDataType)(t,r);UE(t,r,!n,e)}function pM(t){let{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,wr.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function mM(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,wr.checkStrictMode)(t,"default is ignored in the schema root")}function gM(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,oM.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function yM(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function QE({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){let i=r.$comment;if(s.$comment===!0)t.code((0,z._)`${K.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,z.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,z._)`${K.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function _M(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=t;r.$async?e.if((0,z._)`${K.default.errors} === 0`,()=>e.return(K.default.data),()=>e.throw((0,z._)`new ${s}(${K.default.vErrors})`)):(e.assign((0,z._)`${n}.errors`,K.default.vErrors),i.unevaluated&&SM(t),e.return((0,z._)`${K.default.errors} === 0`))}function SM({gen:t,evaluated:e,props:r,items:n}){r instanceof z.Name&&t.assign((0,z._)`${e}.props`,r),n instanceof z.Name&&t.assign((0,z._)`${e}.items`,n)}function UE(t,e,r,n){let{gen:s,schema:i,data:o,allErrors:a,opts:l,self:u}=t,{RULES:c}=u;if(i.$ref&&(l.ignoreKeywordsWithRef||!(0,wr.schemaHasRulesButRef)(i,c))){s.block(()=>eb(t,"$ref",c.all.$ref.definition));return}l.jtd||EM(t,e),s.block(()=>{for(let p of c.rules)f(p);f(c.post)});function f(p){(0,Sd.shouldUseGroup)(i,p)&&(p.type?(s.if((0,Qa.checkDataType)(p.type,o,l.strictNumbers)),BE(t,p),e.length===1&&e[0]===p.type&&r&&(s.else(),(0,Qa.reportTypeError)(t)),s.endIf()):BE(t,p),a||s.if((0,z._)`${K.default.errors} === ${n||0}`))}}function BE(t,e){let{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,iM.assignDefaults)(t,e.type),r.block(()=>{for(let i of e.rules)(0,Sd.shouldUseRule)(n,i)&&eb(t,i.keyword,i.definition,e.type)})}function EM(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(bM(t,e),t.opts.allowUnionTypes||vM(t,e),wM(t,t.dataTypes))}function bM(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{ZE(t.dataTypes,r)||Ed(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),OM(t,e)}}function vM(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Ed(t,"use allowUnionTypes to allow union type keyword")}function wM(t,e){let r=t.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&(0,Sd.shouldUseRule)(t.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>RM(e,o))&&Ed(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function RM(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function ZE(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function OM(t,e){let r=[];for(let n of t.dataTypes)ZE(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Ed(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,wr.checkStrictMode)(t,e,t.opts.strictTypes)}var Za=class{constructor(e,r,n){if((0,Ni.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,wr.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",tb(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Ni.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",K.default.errors))}result(e,r,n){this.failResult((0,z.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,z.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,z._)`${r} !== undefined && (${(0,z.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Ii.reportExtraError:Ii.reportError)(this,this.def.error,r)}$dataError(){(0,Ii.reportError)(this,this.def.$dataError||Ii.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ii.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=z.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=z.nil,r=z.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,z.or)((0,z._)`${s} === undefined`,r)),e!==z.nil&&n.assign(e,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==z.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,z.or)(o(),a());function o(){if(n.length){if(!(r instanceof z.Name))throw new Error("ajv implementation error");let l=Array.isArray(n)?n:[n];return(0,z._)`${(0,Qa.checkDataTypes)(l,r,i.opts.strictNumbers,Qa.DataType.Wrong)}`}return z.nil}function a(){if(s.validateSchema){let l=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,z._)`!${l}(${r})`}return z.nil}}subschema(e,r){let n=(0,_d.getSubschema)(this.it,e);(0,_d.extendSubschemaData)(n,this.it,e),(0,_d.extendSubschemaMode)(n,e);let s={...this.it,...n,items:void 0,props:void 0};return dM(s,r),s}mergeEvaluated(e,r){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=wr.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=wr.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,z.Name)),!0}};Kr.KeywordCxt=Za;function eb(t,e,r,n){let s=new Za(t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Ni.funcKeywordCode)(s,r):"macro"in r?(0,Ni.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Ni.funcKeywordCode)(s,r)}var TM=/^\/(?:[^~]|~0|~1)*$/,$M=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function tb(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,i;if(t==="")return K.default.rootData;if(t[0]==="/"){if(!TM.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,i=K.default.rootData}else{let u=$M.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let c=+u[1];if(s=u[2],s==="#"){if(c>=e)throw new Error(l("property/index",c));return n[e-c]}if(c>e)throw new Error(l("data",c));if(i=r[e-c],!s)return i}let o=i,a=s.split("/");for(let u of a)u&&(i=(0,z._)`${i}${(0,z.getProperty)((0,wr.unescapeJsonPointer)(u))}`,o=(0,z._)`${o} && ${i}`);return o;function l(u,c){return`Cannot access ${u} ${c} levels up, current level is ${e}`}}Kr.getData=tb});var ki=E(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var bd=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};vd.default=bd});var Rr=E(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});var wd=Ci(),Rd=class extends Error{constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,wd.resolveUrl)(e,r,n),this.missingSchema=(0,wd.normalizeId)((0,wd.getFullPath)(e,this.missingRef))}};Od.default=Rd});var $n=E(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.resolveSchema=kt.getCompilingSchema=kt.resolveRef=kt.compileSchema=kt.SchemaEnv=void 0;var Gt=W(),PM=ki(),Tn=Nt(),Wt=Ci(),rb=ee(),AM=ms(),gs=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Wt.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};kt.SchemaEnv=gs;function $d(t){let e=nb.call(this,t);if(e)return e;let r=(0,Wt.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Gt.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a;t.$async&&(a=o.scopeValue("Error",{ref:PM.default,code:(0,Gt._)`require("ajv/dist/runtime/validation_error").default`}));let l=o.scopeName("validate");t.validateName=l;let u={gen:o,allErrors:this.opts.allErrors,data:Tn.default.data,parentData:Tn.default.parentData,parentDataProperty:Tn.default.parentDataProperty,dataNames:[Tn.default.data],dataPathArr:[Gt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Gt.stringify)(t.schema)}:{ref:t.schema}),validateName:l,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Gt.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Gt._)`""`,opts:this.opts,self:this},c;try{this._compilations.add(t),(0,AM.validateFunctionCode)(u),o.optimize(this.opts.code.optimize);let f=o.toString();c=`${o.scopeRefs(Tn.default.scope)}return ${f}`,this.opts.code.process&&(c=this.opts.code.process(c,t));let h=new Function(`${Tn.default.self}`,`${Tn.default.scope}`,c)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:f,scopeValues:o._values}),this.opts.unevaluated){let{props:d,items:m}=u;h.evaluated={props:d instanceof Gt.Name?void 0:d,items:m instanceof Gt.Name?void 0:m,dynamicProps:d instanceof Gt.Name,dynamicItems:m instanceof Gt.Name},h.source&&(h.source.evaluated=(0,Gt.stringify)(h.evaluated))}return t.validate=h,t}catch(f){throw delete t.validate,delete t.validateName,c&&this.logger.error("Error compiling schema, function code:",c),f}finally{this._compilations.delete(t)}}kt.compileSchema=$d;function CM(t,e,r){var n;r=(0,Wt.resolveUrl)(this.opts.uriResolver,e,r);let s=t.refs[r];if(s)return s;let i=kM.call(this,t,r);if(i===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(i=new gs({schema:o,schemaId:a,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=IM.call(this,i)}kt.resolveRef=CM;function IM(t){return(0,Wt.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:$d.call(this,t)}function nb(t){for(let e of this._compilations)if(NM(e,t))return e}kt.getCompilingSchema=nb;function NM(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function kM(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||el.call(this,t,e)}function el(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Wt._getFullPath)(this.opts.uriResolver,r),s=(0,Wt.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return Td.call(this,r,t);let i=(0,Wt.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=el.call(this,t,o);return typeof a?.schema!="object"?void 0:Td.call(this,r,a)}if(typeof o?.schema=="object"){if(o.validate||$d.call(this,o),i===(0,Wt.normalizeId)(e)){let{schema:a}=o,{schemaId:l}=this.opts,u=a[l];return u&&(s=(0,Wt.resolveUrl)(this.opts.uriResolver,s,u)),new gs({schema:a,schemaId:l,root:t,baseId:s})}return Td.call(this,r,o)}}kt.resolveSchema=el;var xM=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Td(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,rb.unescapeFragment)(a)];if(l===void 0)return;r=l;let u=typeof r=="object"&&r[this.opts.schemaId];!xM.has(a)&&u&&(e=(0,Wt.resolveUrl)(this.opts.uriResolver,e,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,rb.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Wt.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=el.call(this,n,a)}let{schemaId:o}=this.opts;if(i=i||new gs({schema:r,schemaId:o,root:n,baseId:e}),i.schema!==i.root.schema)return i}});var sb=E((yY,LM)=>{LM.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Ad=E((_Y,lb)=>{"use strict";var qM=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),ob=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function Pd(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var jM=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function ib(t){return t.length=0,!0}function DM(t,e,r){if(t.length){let n=Pd(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function FM(t){let e=0,r={error:!1,address:"",zone:""},n=[],s=[],i=!1,o=!1,a=DM;for(let l=0;l<t.length;l++){let u=t[l];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(o=!0),!a(s,n,r))break;if(++e>7){r.error=!0;break}l>0&&t[l-1]===":"&&(i=!0),n.push(":");continue}else if(u==="%"){if(!a(s,n,r))break;a=ib}else{s.push(u);continue}}return s.length&&(a===ib?r.zone=s.join(""):o?n.push(s.join("")):n.push(Pd(s))),r.address=n.join(""),r}function ab(t){if(MM(t,":")<2)return{host:t,isIPV6:!1};let e=FM(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function MM(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function HM(t){let e=t,r=[],n=-1,s=0;for(;s=e.length;){if(s===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(s===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(s===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function VM(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function zM(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!ob(r)){let n=ab(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}lb.exports={nonSimpleDomain:jM,recomposeAuthority:zM,normalizeComponentEncoding:VM,removeDotSegments:HM,isIPv4:ob,isUUID:qM,normalizeIPv6:ab,stringArrayToHexStripped:Pd}});var hb=E((SY,db)=>{"use strict";var{isUUID:UM}=Ad(),BM=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,GM=["http","https","ws","wss","urn","urn:uuid"];function WM(t){return GM.indexOf(t)!==-1}function Cd(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function ub(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function cb(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function JM(t){return t.secure=Cd(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function KM(t){if((t.port===(Cd(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function YM(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(BM);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let s=`${n}:${e.nid||t.nid}`,i=Id(s);t.path=void 0,i&&(t=i.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function XM(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),s=`${r}:${e.nid||n}`,i=Id(s);i&&(t=i.serialize(t,e));let o=t,a=t.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function QM(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!UM(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function ZM(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var fb={scheme:"http",domainHost:!0,parse:ub,serialize:cb},eH={scheme:"https",domainHost:fb.domainHost,parse:ub,serialize:cb},tl={scheme:"ws",domainHost:!0,parse:JM,serialize:KM},tH={scheme:"wss",domainHost:tl.domainHost,parse:tl.parse,serialize:tl.serialize},rH={scheme:"urn",parse:YM,serialize:XM,skipNormalize:!0},nH={scheme:"urn:uuid",parse:QM,serialize:ZM,skipNormalize:!0},rl={http:fb,https:eH,ws:tl,wss:tH,urn:rH,"urn:uuid":nH};Object.setPrototypeOf(rl,null);function Id(t){return t&&(rl[t]||rl[t.toLowerCase()])||void 0}db.exports={wsIsSecure:Cd,SCHEMES:rl,isValidSchemeName:WM,getSchemeHandler:Id}});var il=E((EY,sl)=>{"use strict";var{normalizeIPv6:sH,removeDotSegments:xi,recomposeAuthority:iH,normalizeComponentEncoding:nl,isIPv4:oH,nonSimpleDomain:aH}=Ad(),{SCHEMES:lH,getSchemeHandler:pb}=hb();function uH(t,e){return typeof t=="string"?t=lr(Or(t,e),e):typeof t=="object"&&(t=Or(lr(t,e),e)),t}function cH(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=mb(Or(t,n),Or(e,n),n,!0);return n.skipEscape=!0,lr(s,n)}function mb(t,e,r,n){let s={};return n||(t=Or(lr(t,r),r),e=Or(lr(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=xi(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=xi(e.path||""),s.query=e.query):(e.path?(e.path[0]==="/"?s.path=xi(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?s.path="/"+e.path:t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=xi(s.path)),s.query=e.query):(s.path=t.path,e.query!==void 0?s.query=e.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=e.fragment,s}function fH(t,e,r){return typeof t=="string"?(t=unescape(t),t=lr(nl(Or(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=lr(nl(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=lr(nl(Or(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=lr(nl(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function lr(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),s=[],i=pb(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");let o=iH(r);if(o!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(o),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=xi(a)),o===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),s.push(a)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}var dH=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Or(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(dH);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host)if(oH(n.host)===!1){let l=sH(n.host);n.host=l.host.toLowerCase(),s=l.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let o=pb(r.scheme||n.scheme);if(!r.unicodeSupport&&(!o||!o.unicodeSupport)&&n.host&&(r.domainHost||o&&o.domainHost)&&s===!1&&aH(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!o||o&&!o.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),o&&o.parse&&o.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var Nd={SCHEMES:lH,normalize:uH,resolve:cH,resolveComponent:mb,equal:fH,serialize:lr,parse:Or};sl.exports=Nd;sl.exports.default=Nd;sl.exports.fastUri=Nd});var yb=E(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});var gb=il();gb.code='require("ajv/dist/runtime/uri").default';kd.default=gb});var qd=E(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.CodeGen=Je.Name=Je.nil=Je.stringify=Je.str=Je._=Je.KeywordCxt=void 0;var hH=ms();Object.defineProperty(Je,"KeywordCxt",{enumerable:!0,get:function(){return hH.KeywordCxt}});var ys=W();Object.defineProperty(Je,"_",{enumerable:!0,get:function(){return ys._}});Object.defineProperty(Je,"str",{enumerable:!0,get:function(){return ys.str}});Object.defineProperty(Je,"stringify",{enumerable:!0,get:function(){return ys.stringify}});Object.defineProperty(Je,"nil",{enumerable:!0,get:function(){return ys.nil}});Object.defineProperty(Je,"Name",{enumerable:!0,get:function(){return ys.Name}});Object.defineProperty(Je,"CodeGen",{enumerable:!0,get:function(){return ys.CodeGen}});var pH=ki(),vb=Rr(),mH=ud(),Li=$n(),gH=W(),qi=Ci(),ol=Pi(),Ld=ee(),_b=sb(),yH=yb(),wb=(t,e)=>new RegExp(t,e);wb.code="new RegExp";var _H=["removeAdditional","useDefaults","coerceTypes"],SH=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),EH={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},bH={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Sb=200;function vH(t){var e,r,n,s,i,o,a,l,u,c,f,p,h,d,m,g,S,b,_,y,R,T,O,w,$;let v=t.strict,P=(e=t.code)===null||e===void 0?void 0:e.optimize,C=P===!0||P===void 0?1:P||0,k=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:wb,M=(s=t.uriResolver)!==null&&s!==void 0?s:yH.default;return{strictSchema:(o=(i=t.strictSchema)!==null&&i!==void 0?i:v)!==null&&o!==void 0?o:!0,strictNumbers:(l=(a=t.strictNumbers)!==null&&a!==void 0?a:v)!==null&&l!==void 0?l:!0,strictTypes:(c=(u=t.strictTypes)!==null&&u!==void 0?u:v)!==null&&c!==void 0?c:"log",strictTuples:(p=(f=t.strictTuples)!==null&&f!==void 0?f:v)!==null&&p!==void 0?p:"log",strictRequired:(d=(h=t.strictRequired)!==null&&h!==void 0?h:v)!==null&&d!==void 0?d:!1,code:t.code?{...t.code,optimize:C,regExp:k}:{optimize:C,regExp:k},loopRequired:(m=t.loopRequired)!==null&&m!==void 0?m:Sb,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Sb,meta:(S=t.meta)!==null&&S!==void 0?S:!0,messages:(b=t.messages)!==null&&b!==void 0?b:!0,inlineRefs:(_=t.inlineRefs)!==null&&_!==void 0?_:!0,schemaId:(y=t.schemaId)!==null&&y!==void 0?y:"$id",addUsedSchema:(R=t.addUsedSchema)!==null&&R!==void 0?R:!0,validateSchema:(T=t.validateSchema)!==null&&T!==void 0?T:!0,validateFormats:(O=t.validateFormats)!==null&&O!==void 0?O:!0,unicodeRegExp:(w=t.unicodeRegExp)!==null&&w!==void 0?w:!0,int32range:($=t.int32range)!==null&&$!==void 0?$:!0,uriResolver:M}}var ji=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...vH(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new gH.ValueScope({scope:{},prefixes:SH,es5:r,lines:n}),this.logger=PH(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,mH.getRules)(),Eb.call(this,EH,e,"NOT SUPPORTED"),Eb.call(this,bH,e,"DEPRECATED","warn"),this._metaOpts=TH.call(this),e.formats&&RH.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&OH.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),wH.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,s=_b;n==="id"&&(s={..._b},s.id=s.$id,delete s.$id),r&&e&&this.addMetaSchema(s,s[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(r);return"$async"in n||(this.errors=n.errors),s}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,e,r);async function s(c,f){await i.call(this,c.$schema);let p=this._addSchema(c,f);return p.validate||o.call(this,p)}async function i(c){c&&!this.getSchema(c)&&await s.call(this,{$ref:c},!0)}async function o(c){try{return this._compileSchemaEnv(c)}catch(f){if(!(f instanceof vb.default))throw f;return a.call(this,f),await l.call(this,f.missingSchema),o.call(this,c)}}function a({missingSchema:c,missingRef:f}){if(this.refs[c])throw new Error(`AnySchema ${c} is loaded but ${f} cannot be resolved`)}async function l(c){let f=await u.call(this,c);this.refs[c]||await i.call(this,f.$schema),this.refs[c]||this.addSchema(f,c,r)}async function u(c){let f=this._loading[c];if(f)return f;try{return await(this._loading[c]=n(c))}finally{delete this._loading[c]}}}addSchema(e,r,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,s);return this}let i;if(typeof e=="object"){let{schemaId:o}=this.opts;if(i=e[o],i!==void 0&&typeof i!="string")throw new Error(`schema ${o} must be string`)}return r=(0,qi.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,s,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,e);if(!s&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let r;for(;typeof(r=bb.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,s=new Li.SchemaEnv({schema:{},schemaId:n});if(r=Li.resolveSchema.call(this,s,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=bb.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,qi.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(CH.call(this,n,r),!r)return(0,Ld.eachItem)(n,i=>xd.call(this,i)),this;NH.call(this,r);let s={...r,type:(0,ol.getJSONTypes)(r.type),schemaType:(0,ol.getJSONTypes)(r.schemaType)};return(0,Ld.eachItem)(n,s.type.length===0?i=>xd.call(this,i,s):i=>s.type.forEach(o=>xd.call(this,i,s,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let s=n.rules.findIndex(i=>i.keyword===e);s>=0&&n.rules.splice(s,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,i)=>s+r+i)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of r){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in n){let l=n[a];if(typeof l!="object")continue;let{$data:u}=l.definition,c=o[a];u&&c&&(o[a]=Rb(c))}}return e}_removeAllSchemas(e,r){for(let n in e){let s=e[n];(!r||r.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,r,n,s=this.opts.validateSchema,i=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let l=this._cache.get(e);if(l!==void 0)return l;n=(0,qi.normalizeId)(o||n);let u=qi.getSchemaRefs.call(this,e,n);return l=new Li.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(l.schema,l),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=l),s&&this.validateSchema(e,!0),l}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Li.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Li.compileSchema.call(this,e)}finally{this.opts=r}}};ji.ValidationError=pH.default;ji.MissingRefError=vb.default;Je.default=ji;function Eb(t,e,r,n="error"){for(let s in t){let i=s;i in e&&this.logger[n](`${r}: option ${s}. ${t[i]}`)}}function bb(t){return t=(0,qi.normalizeId)(t),this.schemas[t]||this.refs[t]}function wH(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function RH(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function OH(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function TH(){let t={...this.opts};for(let e of _H)delete t[e];return t}var $H={log(){},warn(){},error(){}};function PH(t){if(t===!1)return $H;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var AH=/^[a-z_$][a-z0-9_$:-]*$/i;function CH(t,e){let{RULES:r}=this;if((0,Ld.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!AH.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function xd(t,e,r){var n;let s=e?.post;if(r&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:l})=>l===r);if(o||(o={type:r,rules:[]},i.rules.push(o)),i.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,ol.getJSONTypes)(e.type),schemaType:(0,ol.getJSONTypes)(e.schemaType)}};e.before?IH.call(this,o,a,e.before):o.rules.push(a),i.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(l=>this.addKeyword(l))}function IH(t,e,r){let n=t.rules.findIndex(s=>s.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function NH(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Rb(e)),t.validateSchema=this.compile(e,!0))}var kH={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Rb(t){return{anyOf:[t,kH]}}});var Ob=E(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});var xH={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};jd.default=xH});var Dd=E(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.callRef=Pn.getValidate=void 0;var LH=Rr(),Tb=We(),vt=W(),_s=Nt(),$b=$n(),al=ee(),qH={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:l}=n,{root:u}=i;if((r==="#"||r==="#/")&&s===u.baseId)return f();let c=$b.resolveRef.call(l,u,s,r);if(c===void 0)throw new LH.default(n.opts.uriResolver,s,r);if(c instanceof $b.SchemaEnv)return p(c);return h(c);function f(){if(i===u)return ll(t,o,i,i.$async);let d=e.scopeValue("root",{ref:u});return ll(t,(0,vt._)`${d}.validate`,u,u.$async)}function p(d){let m=Pb(t,d);ll(t,m,d,d.$async)}function h(d){let m=e.scopeValue("schema",a.code.source===!0?{ref:d,code:(0,vt.stringify)(d)}:{ref:d}),g=e.name("valid"),S=t.subschema({schema:d,dataTypes:[],schemaPath:vt.nil,topSchemaRef:m,errSchemaPath:r},g);t.mergeEvaluated(S),t.ok(g)}}};function Pb(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,vt._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Pn.getValidate=Pb;function ll(t,e,r,n){let{gen:s,it:i}=t,{allErrors:o,schemaEnv:a,opts:l}=i,u=l.passContext?_s.default.this:vt.nil;n?c():f();function c(){if(!a.$async)throw new Error("async schema referenced by sync schema");let d=s.let("valid");s.try(()=>{s.code((0,vt._)`await ${(0,Tb.callValidateCode)(t,e,u)}`),h(e),o||s.assign(d,!0)},m=>{s.if((0,vt._)`!(${m} instanceof ${i.ValidationError})`,()=>s.throw(m)),p(m),o||s.assign(d,!1)}),t.ok(d)}function f(){t.result((0,Tb.callValidateCode)(t,e,u),()=>h(e),()=>p(e))}function p(d){let m=(0,vt._)`${d}.errors`;s.assign(_s.default.vErrors,(0,vt._)`${_s.default.vErrors} === null ? ${m} : ${_s.default.vErrors}.concat(${m})`),s.assign(_s.default.errors,(0,vt._)`${_s.default.vErrors}.length`)}function h(d){var m;if(!i.opts.unevaluated)return;let g=(m=r?.validate)===null||m===void 0?void 0:m.evaluated;if(i.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(i.props=al.mergeEvaluated.props(s,g.props,i.props));else{let S=s.var("props",(0,vt._)`${d}.evaluated.props`);i.props=al.mergeEvaluated.props(s,S,i.props,vt.Name)}if(i.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(i.items=al.mergeEvaluated.items(s,g.items,i.items));else{let S=s.var("items",(0,vt._)`${d}.evaluated.items`);i.items=al.mergeEvaluated.items(s,S,i.items,vt.Name)}}}Pn.callRef=ll;Pn.default=qH});var Ab=E(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var jH=Ob(),DH=Dd(),FH=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",jH.default,DH.default];Fd.default=FH});var Cb=E(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var ul=W(),Yr=ul.operators,cl={maximum:{okStr:"<=",ok:Yr.LTE,fail:Yr.GT},minimum:{okStr:">=",ok:Yr.GTE,fail:Yr.LT},exclusiveMaximum:{okStr:"<",ok:Yr.LT,fail:Yr.GTE},exclusiveMinimum:{okStr:">",ok:Yr.GT,fail:Yr.LTE}},MH={message:({keyword:t,schemaCode:e})=>(0,ul.str)`must be ${cl[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,ul._)`{comparison: ${cl[t].okStr}, limit: ${e}}`},HH={keyword:Object.keys(cl),type:"number",schemaType:"number",$data:!0,error:MH,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,ul._)`${r} ${cl[e].fail} ${n} || isNaN(${r})`)}};Md.default=HH});var Ib=E(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});var Di=W(),VH={message:({schemaCode:t})=>(0,Di.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Di._)`{multipleOf: ${t}}`},zH={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:VH,code(t){let{gen:e,data:r,schemaCode:n,it:s}=t,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,Di._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,Di._)`${o} !== parseInt(${o})`;t.fail$data((0,Di._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};Hd.default=zH});var kb=E(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});function Nb(t){let e=t.length,r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}Vd.default=Nb;Nb.code='require("ajv/dist/runtime/ucs2length").default'});var xb=E(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});var An=W(),UH=ee(),BH=kb(),GH={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,An.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,An._)`{limit: ${t}}`},WH={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:GH,code(t){let{keyword:e,data:r,schemaCode:n,it:s}=t,i=e==="maxLength"?An.operators.GT:An.operators.LT,o=s.opts.unicode===!1?(0,An._)`${r}.length`:(0,An._)`${(0,UH.useFunc)(t.gen,BH.default)}(${r})`;t.fail$data((0,An._)`${o} ${i} ${n}`)}};zd.default=WH});var Lb=E(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var JH=We(),fl=W(),KH={message:({schemaCode:t})=>(0,fl.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,fl._)`{pattern: ${t}}`},YH={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:KH,code(t){let{data:e,$data:r,schema:n,schemaCode:s,it:i}=t,o=i.opts.unicodeRegExp?"u":"",a=r?(0,fl._)`(new RegExp(${s}, ${o}))`:(0,JH.usePattern)(t,n);t.fail$data((0,fl._)`!${a}.test(${e})`)}};Ud.default=YH});var qb=E(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});var Fi=W(),XH={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Fi.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Fi._)`{limit: ${t}}`},QH={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:XH,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?Fi.operators.GT:Fi.operators.LT;t.fail$data((0,Fi._)`Object.keys(${r}).length ${s} ${n}`)}};Bd.default=QH});var jb=E(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var Mi=We(),Hi=W(),ZH=ee(),e2={message:({params:{missingProperty:t}})=>(0,Hi.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Hi._)`{missingProperty: ${t}}`},t2={keyword:"required",type:"object",schemaType:"array",$data:!0,error:e2,code(t){let{gen:e,schema:r,schemaCode:n,data:s,$data:i,it:o}=t,{opts:a}=o;if(!i&&r.length===0)return;let l=r.length>=a.loopRequired;if(o.allErrors?u():c(),a.strictRequired){let h=t.parentSchema.properties,{definedProperties:d}=t.it;for(let m of r)if(h?.[m]===void 0&&!d.has(m)){let g=o.schemaEnv.baseId+o.errSchemaPath,S=`required property "${m}" is not defined at "${g}" (strictRequired)`;(0,ZH.checkStrictMode)(o,S,o.opts.strictRequired)}}function u(){if(l||i)t.block$data(Hi.nil,f);else for(let h of r)(0,Mi.checkReportMissingProp)(t,h)}function c(){let h=e.let("missing");if(l||i){let d=e.let("valid",!0);t.block$data(d,()=>p(h,d)),t.ok(d)}else e.if((0,Mi.checkMissingProp)(t,r,h)),(0,Mi.reportMissingProp)(t,h),e.else()}function f(){e.forOf("prop",n,h=>{t.setParams({missingProperty:h}),e.if((0,Mi.noPropertyInData)(e,s,h,a.ownProperties),()=>t.error())})}function p(h,d){t.setParams({missingProperty:h}),e.forOf(h,n,()=>{e.assign(d,(0,Mi.propertyInData)(e,s,h,a.ownProperties)),e.if((0,Hi.not)(d),()=>{t.error(),e.break()})},Hi.nil)}}};Gd.default=t2});var Db=E(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});var Vi=W(),r2={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Vi.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Vi._)`{limit: ${t}}`},n2={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:r2,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?Vi.operators.GT:Vi.operators.LT;t.fail$data((0,Vi._)`${r}.length ${s} ${n}`)}};Wd.default=n2});var zi=E(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});var Fb=Ai();Fb.code='require("ajv/dist/runtime/equal").default';Jd.default=Fb});var Mb=E(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});var Kd=Pi(),Ke=W(),s2=ee(),i2=zi(),o2={message:({params:{i:t,j:e}})=>(0,Ke.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Ke._)`{i: ${t}, j: ${e}}`},a2={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:o2,code(t){let{gen:e,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:a}=t;if(!n&&!s)return;let l=e.let("valid"),u=i.items?(0,Kd.getSchemaTypes)(i.items):[];t.block$data(l,c,(0,Ke._)`${o} === false`),t.ok(l);function c(){let d=e.let("i",(0,Ke._)`${r}.length`),m=e.let("j");t.setParams({i:d,j:m}),e.assign(l,!0),e.if((0,Ke._)`${d} > 1`,()=>(f()?p:h)(d,m))}function f(){return u.length>0&&!u.some(d=>d==="object"||d==="array")}function p(d,m){let g=e.name("item"),S=(0,Kd.checkDataTypes)(u,g,a.opts.strictNumbers,Kd.DataType.Wrong),b=e.const("indices",(0,Ke._)`{}`);e.for((0,Ke._)`;${d}--;`,()=>{e.let(g,(0,Ke._)`${r}[${d}]`),e.if(S,(0,Ke._)`continue`),u.length>1&&e.if((0,Ke._)`typeof ${g} == "string"`,(0,Ke._)`${g} += "_"`),e.if((0,Ke._)`typeof ${b}[${g}] == "number"`,()=>{e.assign(m,(0,Ke._)`${b}[${g}]`),t.error(),e.assign(l,!1).break()}).code((0,Ke._)`${b}[${g}] = ${d}`)})}function h(d,m){let g=(0,s2.useFunc)(e,i2.default),S=e.name("outer");e.label(S).for((0,Ke._)`;${d}--;`,()=>e.for((0,Ke._)`${m} = ${d}; ${m}--;`,()=>e.if((0,Ke._)`${g}(${r}[${d}], ${r}[${m}])`,()=>{t.error(),e.assign(l,!1).break(S)})))}}};Yd.default=a2});var Hb=E(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});var Xd=W(),l2=ee(),u2=zi(),c2={message:"must be equal to constant",params:({schemaCode:t})=>(0,Xd._)`{allowedValue: ${t}}`},f2={keyword:"const",$data:!0,error:c2,code(t){let{gen:e,data:r,$data:n,schemaCode:s,schema:i}=t;n||i&&typeof i=="object"?t.fail$data((0,Xd._)`!${(0,l2.useFunc)(e,u2.default)}(${r}, ${s})`):t.fail((0,Xd._)`${i} !== ${r}`)}};Qd.default=f2});var Vb=E(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});var Ui=W(),d2=ee(),h2=zi(),p2={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Ui._)`{allowedValues: ${t}}`},m2={keyword:"enum",schemaType:"array",$data:!0,error:p2,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:o}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,l,u=()=>l??(l=(0,d2.useFunc)(e,h2.default)),c;if(a||n)c=e.let("valid"),t.block$data(c,f);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let h=e.const("vSchema",i);c=(0,Ui.or)(...s.map((d,m)=>p(h,m)))}t.pass(c);function f(){e.assign(c,!1),e.forOf("v",i,h=>e.if((0,Ui._)`${u()}(${r}, ${h})`,()=>e.assign(c,!0).break()))}function p(h,d){let m=s[d];return typeof m=="object"&&m!==null?(0,Ui._)`${u()}(${r}, ${h}[${d}])`:(0,Ui._)`${r} === ${m}`}}};Zd.default=m2});var zb=E(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});var g2=Cb(),y2=Ib(),_2=xb(),S2=Lb(),E2=qb(),b2=jb(),v2=Db(),w2=Mb(),R2=Hb(),O2=Vb(),T2=[g2.default,y2.default,_2.default,S2.default,E2.default,b2.default,v2.default,w2.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},R2.default,O2.default];eh.default=T2});var rh=E(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.validateAdditionalItems=void 0;var Cn=W(),th=ee(),$2={message:({params:{len:t}})=>(0,Cn.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Cn._)`{limit: ${t}}`},P2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:$2,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,th.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Ub(t,n)}};function Ub(t,e){let{gen:r,schema:n,data:s,keyword:i,it:o}=t;o.items=!0;let a=r.const("len",(0,Cn._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Cn._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,th.alwaysValidSchema)(o,n)){let u=r.var("valid",(0,Cn._)`${a} <= ${e.length}`);r.if((0,Cn.not)(u),()=>l(u)),t.ok(u)}function l(u){r.forRange("i",e.length,a,c=>{t.subschema({keyword:i,dataProp:c,dataPropType:th.Type.Num},u),o.allErrors||r.if((0,Cn.not)(u),()=>r.break())})}}Bi.validateAdditionalItems=Ub;Bi.default=P2});var nh=E(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.validateTuple=void 0;var Bb=W(),dl=ee(),A2=We(),C2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Gb(t,"additionalItems",e);r.items=!0,!(0,dl.alwaysValidSchema)(r,e)&&t.ok((0,A2.validateArray)(t))}};function Gb(t,e,r=t.schema){let{gen:n,parentSchema:s,data:i,keyword:o,it:a}=t;c(s),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=dl.mergeEvaluated.items(n,r.length,a.items));let l=n.name("valid"),u=n.const("len",(0,Bb._)`${i}.length`);r.forEach((f,p)=>{(0,dl.alwaysValidSchema)(a,f)||(n.if((0,Bb._)`${u} > ${p}`,()=>t.subschema({keyword:o,schemaProp:p,dataProp:p},l)),t.ok(l))});function c(f){let{opts:p,errSchemaPath:h}=a,d=r.length,m=d===f.minItems&&(d===f.maxItems||f[e]===!1);if(p.strictTuples&&!m){let g=`"${o}" is ${d}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,dl.checkStrictMode)(a,g,p.strictTuples)}}}Gi.validateTuple=Gb;Gi.default=C2});var Wb=E(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});var I2=nh(),N2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,I2.validateTuple)(t,"items")};sh.default=N2});var Kb=E(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});var Jb=W(),k2=ee(),x2=We(),L2=rh(),q2={message:({params:{len:t}})=>(0,Jb.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Jb._)`{limit: ${t}}`},j2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:q2,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,k2.alwaysValidSchema)(n,e)&&(s?(0,L2.validateAdditionalItems)(t,s):t.ok((0,x2.validateArray)(t)))}};ih.default=j2});var Yb=E(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});var xt=W(),hl=ee(),D2={message:({params:{min:t,max:e}})=>e===void 0?(0,xt.str)`must contain at least ${t} valid item(s)`:(0,xt.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,xt._)`{minContains: ${t}}`:(0,xt._)`{minContains: ${t}, maxContains: ${e}}`},F2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:D2,code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t,o,a,{minContains:l,maxContains:u}=n;i.opts.next?(o=l===void 0?1:l,a=u):o=1;let c=e.const("len",(0,xt._)`${s}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,hl.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,hl.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,hl.alwaysValidSchema)(i,r)){let m=(0,xt._)`${c} >= ${o}`;a!==void 0&&(m=(0,xt._)`${m} && ${c} <= ${a}`),t.pass(m);return}i.items=!0;let f=e.name("valid");a===void 0&&o===1?h(f,()=>e.if(f,()=>e.break())):o===0?(e.let(f,!0),a!==void 0&&e.if((0,xt._)`${s}.length > 0`,p)):(e.let(f,!1),p()),t.result(f,()=>t.reset());function p(){let m=e.name("_valid"),g=e.let("count",0);h(m,()=>e.if(m,()=>d(g)))}function h(m,g){e.forRange("i",0,c,S=>{t.subschema({keyword:"contains",dataProp:S,dataPropType:hl.Type.Num,compositeRule:!0},m),g()})}function d(m){e.code((0,xt._)`${m}++`),a===void 0?e.if((0,xt._)`${m} >= ${o}`,()=>e.assign(f,!0).break()):(e.if((0,xt._)`${m} > ${a}`,()=>e.assign(f,!1).break()),o===1?e.assign(f,!0):e.if((0,xt._)`${m} >= ${o}`,()=>e.assign(f,!0)))}}};oh.default=F2});var Zb=E(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.validateSchemaDeps=ur.validatePropertyDeps=ur.error=void 0;var ah=W(),M2=ee(),Wi=We();ur.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,ah.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,ah._)`{property: ${t},
56
56
  missingProperty: ${n},
57
57
  depsCount: ${e},
58
- deps: ${r}}`};var q2={keyword:"dependencies",type:"object",schemaType:"object",error:lr.error,code(t){let[e,r]=j2(t);Yb(t,e),Xb(t,r)}};function j2({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let s=Array.isArray(t[n])?e:r;s[n]=t[n]}return[e,r]}function Yb(t,e=t.schema){let{gen:r,data:n,it:s}=t;if(Object.keys(e).length===0)return;let i=r.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let l=(0,Gi.propertyInData)(r,n,o,s.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?r.if(l,()=>{for(let u of a)(0,Gi.checkReportMissingProp)(t,u)}):(r.if((0,oh._)`${l} && (${(0,Gi.checkMissingProp)(t,a,i)})`),(0,Gi.reportMissingProp)(t,i),r.else())}}lr.validatePropertyDeps=Yb;function Xb(t,e=t.schema){let{gen:r,data:n,keyword:s,it:i}=t,o=r.name("valid");for(let a in e)(0,L2.alwaysValidSchema)(i,e[a])||(r.if((0,Gi.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let l=t.subschema({keyword:s,schemaProp:a},o);t.mergeValidEvaluated(l,o)},()=>r.var(o,!0)),t.ok(o))}lr.validateSchemaDeps=Xb;lr.default=q2});var ev=E(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});var Zb=W(),D2=ee(),F2={message:"property name must be valid",params:({params:t})=>(0,Zb._)`{propertyName: ${t.propertyName}}`},M2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:F2,code(t){let{gen:e,schema:r,data:n,it:s}=t;if((0,D2.alwaysValidSchema)(s,r))return;let i=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,Zb.not)(i),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(i)}};ah.default=M2});var uh=E(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});var hl=We(),Wt=W(),H2=Nt(),pl=ee(),V2={message:"must NOT have additional properties",params:({params:t})=>(0,Wt._)`{additionalProperty: ${t.additionalProperty}}`},z2={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:V2,code(t){let{gen:e,schema:r,parentSchema:n,data:s,errsCount:i,it:o}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:l}=o;if(o.props=!0,l.removeAdditional!=="all"&&(0,pl.alwaysValidSchema)(o,r))return;let u=(0,hl.allSchemaProperties)(n.properties),c=(0,hl.allSchemaProperties)(n.patternProperties);f(),t.ok((0,Wt._)`${i} === ${H2.default.errors}`);function f(){e.forIn("key",s,g=>{!u.length&&!c.length?d(g):e.if(p(g),()=>d(g))})}function p(g){let S;if(u.length>8){let b=(0,pl.schemaRefOrVal)(o,n.properties,"properties");S=(0,hl.isOwnProperty)(e,b,g)}else u.length?S=(0,Wt.or)(...u.map(b=>(0,Wt._)`${g} === ${b}`)):S=Wt.nil;return c.length&&(S=(0,Wt.or)(S,...c.map(b=>(0,Wt._)`${(0,hl.usePattern)(t,b)}.test(${g})`))),(0,Wt.not)(S)}function h(g){e.code((0,Wt._)`delete ${s}[${g}]`)}function d(g){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){h(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,pl.alwaysValidSchema)(o,r)){let S=e.name("valid");l.removeAdditional==="failing"?(m(g,S,!1),e.if((0,Wt.not)(S),()=>{t.reset(),h(g)})):(m(g,S),a||e.if((0,Wt.not)(S),()=>e.break()))}}function m(g,S,b){let _={keyword:"additionalProperties",dataProp:g,dataPropType:pl.Type.Str};b===!1&&Object.assign(_,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(_,S)}}};lh.default=z2});var nv=E(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});var U2=ms(),tv=We(),ch=ee(),rv=uh(),B2={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&rv.default.code(new U2.KeywordCxt(i,rv.default,"additionalProperties"));let o=(0,tv.allSchemaProperties)(r);for(let f of o)i.definedProperties.add(f);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=ch.mergeEvaluated.props(e,(0,ch.toHash)(o),i.props));let a=o.filter(f=>!(0,ch.alwaysValidSchema)(i,r[f]));if(a.length===0)return;let l=e.name("valid");for(let f of a)u(f)?c(f):(e.if((0,tv.propertyInData)(e,s,f,i.opts.ownProperties)),c(f),i.allErrors||e.else().var(l,!0),e.endIf()),t.it.definedProperties.add(f),t.ok(l);function u(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}function c(f){t.subschema({keyword:"properties",schemaProp:f,dataProp:f},l)}}};fh.default=B2});var av=E(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});var sv=We(),ml=W(),iv=ee(),ov=ee(),G2={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:s,it:i}=t,{opts:o}=i,a=(0,sv.allSchemaProperties)(r),l=a.filter(m=>(0,iv.alwaysValidSchema)(i,r[m]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=o.strictSchema&&!o.allowMatchingProperties&&s.properties,c=e.name("valid");i.props!==!0&&!(i.props instanceof ml.Name)&&(i.props=(0,ov.evaluatedPropsToName)(e,i.props));let{props:f}=i;p();function p(){for(let m of a)u&&h(m),i.allErrors?d(m):(e.var(c,!0),d(m),e.if(c))}function h(m){for(let g in u)new RegExp(m).test(g)&&(0,iv.checkStrictMode)(i,`property ${g} matches pattern ${m} (use allowMatchingProperties)`)}function d(m){e.forIn("key",n,g=>{e.if((0,ml._)`${(0,sv.usePattern)(t,m)}.test(${g})`,()=>{let S=l.includes(m);S||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:g,dataPropType:ov.Type.Str},c),i.opts.unevaluated&&f!==!0?e.assign((0,ml._)`${f}[${g}]`,!0):!S&&!i.allErrors&&e.if((0,ml.not)(c),()=>e.break())})})}}};dh.default=G2});var lv=E(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});var W2=ee(),J2={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,W2.alwaysValidSchema)(n,r)){t.fail();return}let s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};hh.default=J2});var uv=E(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});var K2=We(),Y2={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:K2.validateUnion,error:{message:"must match a schema in anyOf"}};ph.default=Y2});var cv=E(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});var gl=W(),X2=ee(),Q2={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,gl._)`{passingSchemas: ${t.passing}}`},Z2={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Q2,code(t){let{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let i=r,o=e.let("valid",!1),a=e.let("passing",null),l=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(o,()=>t.reset(),()=>t.error(!0));function u(){i.forEach((c,f)=>{let p;(0,X2.alwaysValidSchema)(s,c)?e.var(l,!0):p=t.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},l),f>0&&e.if((0,gl._)`${l} && ${o}`).assign(o,!1).assign(a,(0,gl._)`[${a}, ${f}]`).else(),e.if(l,()=>{e.assign(o,!0),e.assign(a,f),p&&t.mergeEvaluated(p,gl.Name)})})}}};mh.default=Z2});var fv=E(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});var eV=ee(),tV={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let s=e.name("valid");r.forEach((i,o)=>{if((0,eV.alwaysValidSchema)(n,i))return;let a=t.subschema({keyword:"allOf",schemaProp:o},s);t.ok(s),t.mergeEvaluated(a)})}};gh.default=tV});var pv=E(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});var yl=W(),hv=ee(),rV={message:({params:t})=>(0,yl.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,yl._)`{failingKeyword: ${t.ifClause}}`},nV={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:rV,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,hv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=dv(n,"then"),i=dv(n,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(l(),t.reset(),s&&i){let c=e.let("ifClause");t.setParams({ifClause:c}),e.if(a,u("then",c),u("else",c))}else s?e.if(a,u("then")):e.if((0,yl.not)(a),u("else"));t.pass(o,()=>t.error(!0));function l(){let c=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(c)}function u(c,f){return()=>{let p=t.subschema({keyword:c},a);e.assign(o,a),t.mergeValidEvaluated(p,o),f?e.assign(f,(0,yl._)`${c}`):t.setParams({ifClause:c})}}}};function dv(t,e){let r=t.schema[e];return r!==void 0&&!(0,hv.alwaysValidSchema)(t,r)}yh.default=nV});var mv=E(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});var sV=ee(),iV={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,sV.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};_h.default=iV});var gv=E(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});var oV=th(),aV=Gb(),lV=rh(),uV=Jb(),cV=Kb(),fV=Qb(),dV=ev(),hV=uh(),pV=nv(),mV=av(),gV=lv(),yV=uv(),_V=cv(),SV=fv(),EV=pv(),bV=mv();function vV(t=!1){let e=[gV.default,yV.default,_V.default,SV.default,EV.default,bV.default,dV.default,hV.default,fV.default,pV.default,mV.default];return t?e.push(aV.default,uV.default):e.push(oV.default,lV.default),e.push(cV.default),e}Sh.default=vV});var yv=E(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});var Le=W(),wV={message:({schemaCode:t})=>(0,Le.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Le._)`{format: ${t}}`},RV={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:wV,code(t,e){let{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:a}=t,{opts:l,errSchemaPath:u,schemaEnv:c,self:f}=a;if(!l.validateFormats)return;s?p():h();function p(){let d=r.scopeValue("formats",{ref:f.formats,code:l.code.formats}),m=r.const("fDef",(0,Le._)`${d}[${o}]`),g=r.let("fType"),S=r.let("format");r.if((0,Le._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(g,(0,Le._)`${m}.type || "string"`).assign(S,(0,Le._)`${m}.validate`),()=>r.assign(g,(0,Le._)`"string"`).assign(S,m)),t.fail$data((0,Le.or)(b(),_()));function b(){return l.strictSchema===!1?Le.nil:(0,Le._)`${o} && !${S}`}function _(){let y=c.$async?(0,Le._)`(${m}.async ? await ${S}(${n}) : ${S}(${n}))`:(0,Le._)`${S}(${n})`,R=(0,Le._)`(typeof ${S} == "function" ? ${y} : ${S}.test(${n}))`;return(0,Le._)`${S} && ${S} !== true && ${g} === ${e} && !${R}`}}function h(){let d=f.formats[i];if(!d){b();return}if(d===!0)return;let[m,g,S]=_(d);m===e&&t.pass(y());function b(){if(l.strictSchema===!1){f.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function _(R){let T=R instanceof RegExp?(0,Le.regexpCode)(R):l.code.formats?(0,Le._)`${l.code.formats}${(0,Le.getProperty)(i)}`:void 0,O=r.scopeValue("formats",{key:i,ref:R,code:T});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,Le._)`${O}.validate`]:["string",R,O]}function y(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!c.$async)throw new Error("async format in sync schema");return(0,Le._)`await ${S}(${n})`}return typeof g=="function"?(0,Le._)`${S}(${n})`:(0,Le._)`${S}.test(${n})`}}}};Eh.default=RV});var _v=E(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});var OV=yv(),TV=[OV.default];bh.default=TV});var Sv=E(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.contentVocabulary=Ss.metadataVocabulary=void 0;Ss.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ss.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var bv=E(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});var $V=Pb(),PV=Vb(),AV=gv(),CV=_v(),Ev=Sv(),IV=[$V.default,PV.default,(0,AV.default)(),CV.default,Ev.metadataVocabulary,Ev.contentVocabulary];vh.default=IV});var wh=E(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.DiscrError=void 0;var vv;(function(t){t.Tag="tag",t.Mapping="mapping"})(vv||(_l.DiscrError=vv={}))});var Rv=E(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});var Es=W(),Rh=wh(),wv=$n(),NV=Rr(),kV=ee(),xV={message:({params:{discrError:t,tagName:e}})=>t===Rh.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Es._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},LV={keyword:"discriminator",type:"object",schemaType:"object",error:xV,code(t){let{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let l=e.let("valid",!1),u=e.const("tag",(0,Es._)`${r}${(0,Es.getProperty)(a)}`);e.if((0,Es._)`typeof ${u} == "string"`,()=>c(),()=>t.error(!1,{discrError:Rh.DiscrError.Tag,tag:u,tagName:a})),t.ok(l);function c(){let h=p();e.if(!1);for(let d in h)e.elseIf((0,Es._)`${u} === ${d}`),e.assign(l,f(h[d]));e.else(),t.error(!1,{discrError:Rh.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function f(h){let d=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:h},d);return t.mergeEvaluated(m,Es.Name),d}function p(){var h;let d={},m=S(s),g=!0;for(let y=0;y<o.length;y++){let R=o[y];if(R?.$ref&&!(0,kV.schemaHasRulesButRef)(R,i.self.RULES)){let O=R.$ref;if(R=wv.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,O),R instanceof wv.SchemaEnv&&(R=R.schema),R===void 0)throw new NV.default(i.opts.uriResolver,i.baseId,O)}let T=(h=R?.properties)===null||h===void 0?void 0:h[a];if(typeof T!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(m||S(R)),b(T,y)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return d;function S({required:y}){return Array.isArray(y)&&y.includes(a)}function b(y,R){if(y.const)_(y.const,R);else if(y.enum)for(let T of y.enum)_(T,R);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function _(y,R){if(typeof y!="string"||y in d)throw new Error(`discriminator: "${a}" values must be unique strings`);d[y]=R}}}};Oh.default=LV});var Ov=E((e7,qV)=>{qV.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var El=E((ve,Th)=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.MissingRefError=ve.ValidationError=ve.CodeGen=ve.Name=ve.nil=ve.stringify=ve.str=ve._=ve.KeywordCxt=ve.Ajv=void 0;var jV=Ld(),DV=bv(),FV=Rv(),Tv=Ov(),MV=["/properties"],Sl="http://json-schema.org/draft-07/schema",bs=class extends jV.default{_addVocabularies(){super._addVocabularies(),DV.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(FV.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Tv,MV):Tv;this.addMetaSchema(e,Sl,!1),this.refs["http://json-schema.org/schema"]=Sl}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Sl)?Sl:void 0)}};ve.Ajv=bs;Th.exports=ve=bs;Th.exports.Ajv=bs;Object.defineProperty(ve,"__esModule",{value:!0});ve.default=bs;var HV=ms();Object.defineProperty(ve,"KeywordCxt",{enumerable:!0,get:function(){return HV.KeywordCxt}});var vs=W();Object.defineProperty(ve,"_",{enumerable:!0,get:function(){return vs._}});Object.defineProperty(ve,"str",{enumerable:!0,get:function(){return vs.str}});Object.defineProperty(ve,"stringify",{enumerable:!0,get:function(){return vs.stringify}});Object.defineProperty(ve,"nil",{enumerable:!0,get:function(){return vs.nil}});Object.defineProperty(ve,"Name",{enumerable:!0,get:function(){return vs.Name}});Object.defineProperty(ve,"CodeGen",{enumerable:!0,get:function(){return vs.CodeGen}});var VV=Ni();Object.defineProperty(ve,"ValidationError",{enumerable:!0,get:function(){return VV.default}});var zV=Rr();Object.defineProperty(ve,"MissingRefError",{enumerable:!0,get:function(){return zV.default}})});var Tr=E(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.checkMetadata=void 0;var UV=ee(),BV={keyword:"metadata",schemaType:"object",code(t){$v(t);let{gen:e,schema:r,it:n}=t;if((0,UV.alwaysValidSchema)(n,r))return;let s=e.name("valid");t.subschema({keyword:"metadata",jtdMetadata:!0},s),t.ok(s)}};function $v({it:t,keyword:e},r){if(t.jtdMetadata!==r)throw new Error(`JTD: "${e}" cannot be used in this schema location`)}Wi.checkMetadata=$v;Wi.default=BV});var bl=E(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.hasRef=void 0;var Pv=$n(),Ji=W(),GV=Rr(),Av=Nt(),Cv=jd(),WV=Tr(),JV={keyword:"ref",schemaType:"string",code(t){(0,WV.checkMetadata)(t);let{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{schemaEnv:{root:o}}=i,a=e.name("valid");s.nullable?(e.var(a,(0,Ji._)`${r} === null`),e.if((0,Ji.not)(a),l)):(e.var(a,!1),l()),t.ok(a);function l(){var f;let p=(f=o.schema.definitions)===null||f===void 0?void 0:f[n];if(!p)throw new GV.default(i.opts.uriResolver,"",n,`No definition ${n}`);$h(p)||!i.opts.inlineRefs?u(p):c(p)}function u(f){let p=Pv.compileSchema.call(i.self,new Pv.SchemaEnv({schema:f,root:o,schemaPath:`/definitions/${n}`})),h=(0,Cv.getValidate)(t,p),d=e.const("_errs",Av.default.errors);(0,Cv.callRef)(t,h,p,p.$async),e.assign(a,(0,Ji._)`${d} === ${Av.default.errors}`)}function c(f){let p=e.scopeValue("schema",i.opts.code.source===!0?{ref:f,code:(0,Ji.stringify)(f)}:{ref:f});t.subschema({schema:f,dataTypes:[],schemaPath:Ji.nil,topSchemaRef:p,errSchemaPath:`/definitions/${n}`},a)}}};function $h(t){for(let e in t){let r;if(e==="ref"||typeof(r=t[e])=="object"&&$h(r))return!0}return!1}Ki.hasRef=$h;Ki.default=JV});var Ah=E(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});var KV=/t|\s/i,YV=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,XV=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i,QV=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Nv(t,e){let r=t.split(KV);return r.length===2&&Iv(r[0])&&ZV(r[1])||e&&r.length===1&&Iv(r[0])}Ph.default=Nv;function Iv(t){let e=YV.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&(s<=QV[n]||n===2&&s===29&&(r%100===0?r%400===0:r%4===0))}function ZV(t){let e=XV.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3],i=+(e[4]||0),o=+(e[5]||0);return r<=23&&n<=59&&s<=59||r-i===23&&n-o===59&&s===60}Nv.code='require("ajv/dist/runtime/timestamp").default'});var ws=E(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.typeErrorParams=Xr.typeErrorMessage=Xr.typeError=void 0;var ez=W();function tz(t){return{message:e=>kv(e,t),params:e=>xv(e,t)}}Xr.typeError=tz;function kv({parentSchema:t},e){return t?.nullable?`must be ${e} or null`:`must be ${e}`}Xr.typeErrorMessage=kv;function xv({parentSchema:t},e){return(0,ez._)`{type: ${e}, nullable: ${!!t?.nullable}}`}Xr.typeErrorParams=xv});var Ch=E(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.intRange=void 0;var Ot=W(),rz=Ah(),nz=ee(),sz=Tr(),Lv=ws();Rs.intRange={int8:[-128,127,3],uint8:[0,255,3],int16:[-32768,32767,5],uint16:[0,65535,5],int32:[-2147483648,2147483647,10],uint32:[0,4294967295,10]};var iz={message:t=>(0,Lv.typeErrorMessage)(t,t.schema),params:t=>(0,Lv.typeErrorParams)(t,t.schema)};function oz(t){let{gen:e,data:r,it:n}=t,{timestamp:s,allowDate:i}=n.opts;if(s==="date")return(0,Ot._)`${r} instanceof Date `;let o=(0,nz.useFunc)(e,rz.default),a=i?(0,Ot._)`, true`:Ot.nil,l=(0,Ot._)`typeof ${r} == "string" && ${o}(${r}${a})`;return s==="string"?l:(0,Ot.or)((0,Ot._)`${r} instanceof Date`,l)}var az={keyword:"type",schemaType:"string",error:iz,code(t){(0,sz.checkMetadata)(t);let{data:e,schema:r,parentSchema:n,it:s}=t,i;switch(r){case"boolean":case"string":i=(0,Ot._)`typeof ${e} == ${r}`;break;case"timestamp":{i=oz(t);break}case"float32":case"float64":i=(0,Ot._)`typeof ${e} == "number"`;break;default:{let o=r;if(i=(0,Ot._)`typeof ${e} == "number" && isFinite(${e}) && !(${e} % 1)`,!s.opts.int32range&&(o==="int32"||o==="uint32"))o==="uint32"&&(i=(0,Ot._)`${i} && ${e} >= 0`);else{let[a,l]=Rs.intRange[o];i=(0,Ot._)`${i} && ${e} >= ${a} && ${e} <= ${l}`}}}t.pass(n.nullable?(0,Ot.or)((0,Ot._)`${e} === null`,i):i)}};Rs.default=az});var Ts=E(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.checkNullableObject=Os.checkNullable=void 0;var vl=W();function qv({gen:t,data:e,parentSchema:r},n=vl.nil){let s=t.name("valid");return r.nullable?(t.let(s,(0,vl._)`${e} === null`),n=(0,vl.not)(s)):t.let(s,!1),[s,n]}Os.checkNullable=qv;function lz(t,e){let[r,n]=qv(t,e);return[r,(0,vl._)`${n} && typeof ${t.data} == "object" && !Array.isArray(${t.data})`]}Os.checkNullableObject=lz});var jv=E(Ih=>{"use strict";Object.defineProperty(Ih,"__esModule",{value:!0});var Qr=W(),uz=Tr(),cz=Ts(),fz={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Qr._)`{allowedValues: ${t}}`},dz={keyword:"enum",schemaType:"array",error:fz,code(t){(0,uz.checkMetadata)(t);let{gen:e,data:r,schema:n,schemaValue:s,parentSchema:i,it:o}=t;if(n.length===0)throw new Error("enum must have non-empty array");if(n.length!==new Set(n).size)throw new Error("enum items must be unique");let a,l=(0,Qr._)`typeof ${r} == "string"`;if(n.length>=o.opts.loopEnum){let c;[a,c]=(0,cz.checkNullable)(t,l),e.if(c,u)}else{if(!Array.isArray(n))throw new Error("ajv implementation error");a=(0,Qr.and)(l,(0,Qr.or)(...n.map(c=>(0,Qr._)`${r} === ${c}`))),i.nullable&&(a=(0,Qr.or)((0,Qr._)`${r} === null`,a))}t.pass(a);function u(){e.forOf("v",s,c=>e.if((0,Qr._)`${a} = ${r} === ${c}`,()=>e.break()))}}};Ih.default=dz});var Fv=E(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});var hz=ee(),pz=We(),Dv=W(),mz=Tr(),gz=Ts(),yz=ws(),_z={keyword:"elements",schemaType:"object",error:(0,yz.typeError)("array"),code(t){(0,mz.checkMetadata)(t);let{gen:e,data:r,schema:n,it:s}=t;if((0,hz.alwaysValidSchema)(s,n))return;let[i]=(0,gz.checkNullable)(t);e.if((0,Dv.not)(i),()=>e.if((0,Dv._)`Array.isArray(${r})`,()=>e.assign(i,(0,pz.validateArray)(t)),()=>t.error())),t.ok(i)}};Nh.default=_z});var xh=E(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.validateProperties=Zr.error=void 0;var kh=We(),Mv=ee(),$r=W(),Sz=Tr(),Ez=Ts(),Hv=ws(),$s;(function(t){t.Additional="additional",t.Missing="missing"})($s||($s={}));Zr.error={message:t=>{let{params:e}=t;return e.propError?e.propError===$s.Additional?"must NOT have additional properties":`must have property '${e.missingProperty}'`:(0,Hv.typeErrorMessage)(t,"object")},params:t=>{let{params:e}=t;return e.propError?e.propError===$s.Additional?(0,$r._)`{error: ${e.propError}, additionalProperty: ${e.additionalProperty}}`:(0,$r._)`{error: ${e.propError}, missingProperty: ${e.missingProperty}}`:(0,Hv.typeErrorParams)(t,"object")}};var bz={keyword:"properties",schemaType:"object",error:Zr.error,code:Vv};function Vv(t){(0,Sz.checkMetadata)(t);let{gen:e,data:r,parentSchema:n,it:s}=t,{additionalProperties:i,nullable:o}=n;if(s.jtdDiscriminator&&o)throw new Error("JTD: nullable inside discriminator mapping");if(h())throw new Error("JTD: properties and optionalProperties have common members");let[a,l]=d("properties"),[u,c]=d("optionalProperties");if(l.length===0&&c.length===0&&i)return;let[f,p]=s.jtdDiscriminator===void 0?(0,Ez.checkNullableObject)(t,r):[e.let("valid",!1),!0];e.if(p,()=>e.assign(f,!0).block(()=>{m(l,"properties",!0),m(c,"optionalProperties"),i||S()})),t.pass(f);function h(){let _=n.properties,y=n.optionalProperties;if(!(_&&y))return!1;for(let R in _)if(Object.prototype.hasOwnProperty.call(y,R))return!0;return!1}function d(_){let y=n[_],R=y?(0,kh.allSchemaProperties)(y):[];if(s.jtdDiscriminator&&R.some(O=>O===s.jtdDiscriminator))throw new Error(`JTD: discriminator tag used in ${_}`);let T=R.filter(O=>!(0,Mv.alwaysValidSchema)(s,y[O]));return[R,T]}function m(_,y,R){let T=e.var("valid");for(let w of _)e.if((0,kh.propertyInData)(e,r,w,s.opts.ownProperties),()=>g(w,y,T),()=>O(w)),t.ok(T);function O(w){R?(e.assign(T,!1),t.error(!1,{propError:$s.Missing,missingProperty:w},{schemaPath:w})):e.assign(T,!0)}}function g(_,y,R){t.subschema({keyword:y,schemaProp:_,dataProp:_},R)}function S(){e.forIn("key",r,_=>{let y=b(_,a,"properties",s.jtdDiscriminator),R=b(_,u,"optionalProperties"),T=y===!0?R:R===!0?y:(0,$r.and)(y,R);e.if(T,()=>{s.opts.removeAdditional?e.code((0,$r._)`delete ${r}[${_}]`):(t.error(!1,{propError:$s.Additional,additionalProperty:_},{instancePath:_,parentSchema:!0}),s.opts.allErrors||e.break())})})}function b(_,y,R,T){let O;if(y.length>8){let w=(0,Mv.schemaRefOrVal)(s,n[R],R);O=(0,$r.not)((0,kh.isOwnProperty)(e,w,_)),T!==void 0&&(O=(0,$r.and)(O,(0,$r._)`${_} !== ${T}`))}else if(y.length||T!==void 0){let w=T===void 0?y:[T].concat(y);O=(0,$r.and)(...w.map($=>(0,$r._)`${_} !== ${$}`))}else O=!0;return O}}Zr.validateProperties=Vv;Zr.default=bz});var Uv=E(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});var zv=xh(),vz={keyword:"optionalProperties",schemaType:"object",error:zv.error,code(t){t.parentSchema.properties||(0,zv.validateProperties)(t)}};Lh.default=vz});var Gv=E(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});var In=W(),wz=Tr(),Rz=Ts(),Bv=ws(),wl=wh(),Oz={message:t=>{let{schema:e,params:r}=t;return r.discrError?r.discrError===wl.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in mapping`:(0,Bv.typeErrorMessage)(t,"object")},params:t=>{let{schema:e,params:r}=t;return r.discrError?(0,In._)`{error: ${r.discrError}, tag: ${e}, tagValue: ${r.tag}}`:(0,Bv.typeErrorParams)(t,"object")}},Tz={keyword:"discriminator",schemaType:"string",implements:["mapping"],error:Oz,code(t){(0,wz.checkMetadata)(t);let{gen:e,data:r,schema:n,parentSchema:s}=t,[i,o]=(0,Rz.checkNullableObject)(t,r);e.if(o),a(),e.elseIf((0,In.not)(i)),t.error(),e.endIf(),t.ok(i);function a(){let c=e.const("tag",(0,In._)`${r}${(0,In.getProperty)(n)}`);e.if((0,In._)`${c} === undefined`),t.error(!1,{discrError:wl.DiscrError.Tag,tag:c}),e.elseIf((0,In._)`typeof ${c} == "string"`),l(c),e.else(),t.error(!1,{discrError:wl.DiscrError.Tag,tag:c},{instancePath:n}),e.endIf()}function l(c){e.if(!1);for(let f in s.mapping)e.elseIf((0,In._)`${c} === ${f}`),e.assign(i,u(f));e.else(),t.error(!1,{discrError:wl.DiscrError.Mapping,tag:c},{instancePath:n,schemaPath:"mapping",parentSchema:!0}),e.endIf()}function u(c){let f=e.name("valid");return t.subschema({keyword:"mapping",schemaProp:c,jtdDiscriminator:n},f),f}}};qh.default=Tz});var Jv=E(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});var Wv=ee(),Rl=W(),$z=Tr(),Pz=Ts(),Az=ws(),Cz={keyword:"values",schemaType:"object",error:(0,Az.typeError)("object"),code(t){(0,$z.checkMetadata)(t);let{gen:e,data:r,schema:n,it:s}=t,[i,o]=(0,Pz.checkNullableObject)(t,r);(0,Wv.alwaysValidSchema)(s,n)?e.if((0,Rl.not)((0,Rl.or)(o,i)),()=>t.error()):(e.if(o),e.assign(i,a()),e.elseIf((0,Rl.not)(i)),t.error(),e.endIf()),t.ok(i);function a(){let l=e.name("valid");if(s.allErrors){let c=e.let("valid",!0);return u(()=>e.assign(c,!1)),c}return e.var(l,!0),u(()=>e.break()),l;function u(c){e.forIn("key",r,f=>{t.subschema({keyword:"values",dataProp:f,dataPropType:Wv.Type.Str},l),e.if((0,Rl.not)(l),c)})}}}};jh.default=Cz});var Kv=E(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});var Iz=We(),Nz={keyword:"union",schemaType:"array",trackErrors:!0,code:Iz.validateUnion,error:{message:"must match a schema in union"}};Dh.default=Nz});var Yv=E(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});var kz=bl(),xz=Ch(),Lz=jv(),qz=Fv(),jz=xh(),Dz=Uv(),Fz=Gv(),Mz=Jv(),Hz=Kv(),Vz=Tr(),zz=["definitions",kz.default,xz.default,Lz.default,qz.default,jz.default,Dz.default,Fz.default,Mz.default,Hz.default,Vz.default,{keyword:"additionalProperties",schemaType:"boolean"},{keyword:"nullable",schemaType:"boolean"}];Fh.default=zz});var ew=E(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});var Pr=t=>{let e={nullable:{type:"boolean"},metadata:{optionalProperties:{union:{elements:{ref:"schema"}}},additionalProperties:!0}};return t&&(e.definitions={values:{ref:"schema"}}),e},Uz=t=>({optionalProperties:Pr(t)}),Bz=t=>({properties:{ref:{type:"string"}},optionalProperties:Pr(t)}),Gz=t=>({properties:{type:{enum:["boolean","timestamp","string","float32","float64","int8","uint8","int16","uint16","int32","uint32"]}},optionalProperties:Pr(t)}),Wz=t=>({properties:{enum:{elements:{type:"string"}}},optionalProperties:Pr(t)}),Jz=t=>({properties:{elements:{ref:"schema"}},optionalProperties:Pr(t)}),Qv=t=>({properties:{properties:{values:{ref:"schema"}}},optionalProperties:{optionalProperties:{values:{ref:"schema"}},additionalProperties:{type:"boolean"},...Pr(t)}}),Zv=t=>({properties:{optionalProperties:{values:{ref:"schema"}}},optionalProperties:{additionalProperties:{type:"boolean"},...Pr(t)}}),Kz=t=>({properties:{discriminator:{type:"string"},mapping:{values:{metadata:{union:[Qv(!1),Zv(!1)]}}}},optionalProperties:Pr(t)}),Yz=t=>({properties:{values:{ref:"schema"}},optionalProperties:Pr(t)}),Xv=t=>({metadata:{union:[Uz,Bz,Gz,Wz,Jz,Qv,Zv,Kz,Yz].map(e=>e(t))}}),Xz={definitions:{schema:Xv(!1)},...Xv(!0)};Mh.default=Xz});var Hh=E(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.jtdForms=void 0;Ol.jtdForms=["elements","values","discriminator","properties","optionalProperties","enum","type","ref"]});var rw=E(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});var Vh=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,Qz={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function tw(t){return Vh.lastIndex=0,'"'+(Vh.test(t)?t.replace(Vh,e=>{let r=Qz[e];return typeof r=="string"?r:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}):t)+'"'}zh.default=tw;tw.code='require("ajv/dist/runtime/quote").default'});var lw=E(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});var Zz=Hh(),sw=$n(),ie=W(),eU=Rr(),Ee=Nt(),tU=We(),rU=bl(),nU=ee(),sU=rw(),iU={elements:aU,values:lU,discriminator:uU,properties:nw,optionalProperties:nw,enum:Yi,type:cU,ref:dU};function iw(t,e){let r=sw.getCompilingSchema.call(this,t);if(r)return r;let{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new ie.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a=o.scopeName("serialize"),l={self:this,gen:o,schema:t.schema,schemaEnv:t,definitions:e,data:Ee.default.data},u;try{this._compilations.add(t),t.serializeName=a,o.func(a,Ee.default.data,!1,()=>{o.let(Ee.default.json,(0,ie.str)``),Xi(l),o.return(Ee.default.json)}),o.optimize(this.opts.code.optimize);let c=o.toString();u=`${o.scopeRefs(Ee.default.scope)}return ${c}`;let p=new Function(`${Ee.default.scope}`,u)(this.scope.get());this.scope.value(a,{ref:p}),t.serialize=p}catch(c){throw u&&this.logger.error("Error compiling serializer, function code:",u),delete t.serialize,delete t.serializeName,c}finally{this._compilations.delete(t)}return t}Bh.default=iw;function Xi(t){let e;for(let r of Zz.jtdForms)if(r in t.schema){e=r;break}oU(t,e?iU[e]:pU)}function oU(t,e){let{gen:r,schema:n,data:s}=t;if(!n.nullable)return e(t);r.if((0,ie._)`${s} === undefined || ${s} === null`,()=>r.add(Ee.default.json,(0,ie._)`"null"`),()=>e(t))}function aU(t){let{gen:e,schema:r,data:n}=t;e.add(Ee.default.json,(0,ie.str)`[`);let s=e.let("first",!0);e.forOf("el",n,i=>{Uh(t,s),Xi({...t,schema:r.elements,data:i})}),e.add(Ee.default.json,(0,ie.str)`]`)}function lU(t){let{gen:e,schema:r,data:n}=t;e.add(Ee.default.json,(0,ie.str)`{`);let s=e.let("first",!0);e.forIn("key",n,i=>ow(t,i,r.values,s)),e.add(Ee.default.json,(0,ie.str)`}`)}function ow(t,e,r,n){let{gen:s,data:i}=t;Uh(t,n),Yi({...t,data:e}),s.add(Ee.default.json,(0,ie.str)`:`);let o=s.const("value",(0,ie._)`${i}${(0,ie.getProperty)(e)}`);Xi({...t,schema:r,data:o})}function uU(t){let{gen:e,schema:r,data:n}=t,{discriminator:s}=r;e.add(Ee.default.json,(0,ie.str)`{${JSON.stringify(s)}:`);let i=e.const("tag",(0,ie._)`${n}${(0,ie.getProperty)(s)}`);Yi({...t,data:i}),e.if(!1);for(let o in r.mapping){e.elseIf((0,ie._)`${i} === ${o}`);let a=r.mapping[o];aw({...t,schema:a},s)}e.endIf(),e.add(Ee.default.json,(0,ie.str)`}`)}function nw(t){let{gen:e}=t;e.add(Ee.default.json,(0,ie.str)`{`),aw(t),e.add(Ee.default.json,(0,ie.str)`}`)}function aw(t,e){let{gen:r,schema:n,data:s}=t,{properties:i,optionalProperties:o}=n,a=p(i),l=p(o),u=h(a.concat(l)),c=!e,f;for(let S of a)c?c=!1:r.add(Ee.default.json,(0,ie.str)`,`),m(S,i[S],d(S));c&&(f=r.let("first",!0));for(let S of l){let b=d(S);r.if((0,ie.and)((0,ie._)`${b} !== undefined`,(0,tU.isOwnProperty)(r,s,S)),()=>{Uh(t,f),m(S,o[S],b)})}n.additionalProperties&&r.forIn("key",s,S=>r.if(g(S,u),()=>ow(t,S,{},f)));function p(S){return S?Object.keys(S):[]}function h(S){if(e&&S.push(e),new Set(S).size!==S.length)throw new Error("JTD: properties/optionalProperties/disciminator overlap");return S}function d(S){return r.const("value",(0,ie._)`${s}${(0,ie.getProperty)(S)}`)}function m(S,b,_){r.add(Ee.default.json,(0,ie.str)`${JSON.stringify(S)}:`),Xi({...t,schema:b,data:_})}function g(S,b){return b.length?(0,ie.and)(...b.map(_=>(0,ie._)`${S} !== ${_}`)):!0}}function cU(t){let{gen:e,schema:r,data:n}=t;switch(r.type){case"boolean":e.add(Ee.default.json,(0,ie._)`${n} ? "true" : "false"`);break;case"string":Yi(t);break;case"timestamp":e.if((0,ie._)`${n} instanceof Date`,()=>e.add(Ee.default.json,(0,ie._)`'"' + ${n}.toISOString() + '"'`),()=>Yi(t));break;default:fU(t)}}function Yi({gen:t,data:e}){t.add(Ee.default.json,(0,ie._)`${(0,nU.useFunc)(t,sU.default)}(${e})`)}function fU({gen:t,data:e}){t.add(Ee.default.json,(0,ie._)`"" + ${e}`)}function dU(t){let{gen:e,self:r,data:n,definitions:s,schema:i,schemaEnv:o}=t,{ref:a}=i,l=s[a];if(!l)throw new eU.default(r.opts.uriResolver,"",a,`No definition ${a}`);if(!(0,rU.hasRef)(l))return Xi({...t,schema:l});let{root:u}=o,c=iw.call(r,new sw.SchemaEnv({schema:l,root:u}),s);e.add(Ee.default.json,(0,ie._)`${hU(e,c)}(${n})`)}function hU(t,e){return e.serialize?t.scopeValue("serialize",{ref:e.serialize}):(0,ie._)`${t.scopeValue("wrapper",{ref:e})}.serialize`}function pU({gen:t,data:e}){t.add(Ee.default.json,(0,ie._)`JSON.stringify(${e})`)}function Uh({gen:t},e){e?t.if(e,()=>t.assign(e,!1),()=>t.add(Ee.default.json,(0,ie.str)`,`)):t.add(Ee.default.json,(0,ie.str)`,`)}});var cw=E(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.parseJsonString=tn.parseJsonNumber=tn.parseJson=void 0;var mU=/position\s(\d+)(?: \(line \d+ column \d+\))?$/;function Ar(t,e){let r;Ar.message=void 0;let n;e&&(t=t.slice(e));try{return Ar.position=e+t.length,JSON.parse(t)}catch(s){if(n=mU.exec(s.message),!n){Ar.message="unexpected end";return}r=+n[1];let i=t[r];t=t.slice(0,r),Ar.position=e+r;try{return JSON.parse(t)}catch{Ar.message=`unexpected token ${i}`;return}}}tn.parseJson=Ar;Ar.message=void 0;Ar.position=0;Ar.code='require("ajv/dist/runtime/parseJson").parseJson';function Cr(t,e,r){let n="",s;if(Cr.message=void 0,t[e]==="-"&&(n+="-",e++),t[e]==="0")n+="0",e++;else if(!i(r)){o();return}if(r)return Cr.position=e,+n;if(t[e]==="."&&(n+=".",e++,!i())){o();return}if(s=t[e],(s==="e"||s==="E")&&(n+="e",e++,s=t[e],(s==="+"||s==="-")&&(n+=s,e++),!i())){o();return}return Cr.position=e,+n;function i(a){let l=!1;for(;s=t[e],s>="0"&&s<="9"&&(a===void 0||a-- >0);)l=!0,n+=s,e++;return l}function o(){Cr.position=e,Cr.message=e<t.length?`unexpected token ${t[e]}`:"unexpected end"}}tn.parseJsonNumber=Cr;Cr.message=void 0;Cr.position=0;Cr.code='require("ajv/dist/runtime/parseJson").parseJsonNumber';var uw={b:"\b",f:"\f",n:`
59
- `,r:"\r",t:" ",'"':'"',"/":"/","\\":"\\"},gU=97,yU=48;function en(t,e){let r="",n;for(en.message=void 0;n=t[e++],n!=='"';)if(n==="\\")if(n=t[e],n in uw)r+=uw[n],e++;else if(n==="u"){e++;let i=4,o=0;for(;i--;){if(o<<=4,n=t[e],n===void 0){s("unexpected end");return}if(n=n.toLowerCase(),n>="a"&&n<="f")o+=n.charCodeAt(0)-gU+10;else if(n>="0"&&n<="9")o+=n.charCodeAt(0)-yU;else{s(`unexpected token ${n}`);return}e++}r+=String.fromCharCode(o)}else{s(`unexpected token ${n}`);return}else if(n===void 0){s("unexpected end");return}else if(n.charCodeAt(0)>=32)r+=n;else{s(`unexpected token ${n}`);return}return en.position=e,r;function s(i){en.position=e,en.message=i}}tn.parseJsonString=en;en.message=void 0;en.position=0;en.code='require("ajv/dist/runtime/parseJson").parseJsonString'});var bw=E(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0});var _U=Hh(),pw=$n(),B=W(),SU=Rr(),se=Nt(),EU=We(),bU=bl(),vU=Ch(),Jh=cw(),mw=ee(),wU=Ah(),RU={elements:PU,values:AU,discriminator:IU,properties:fw,optionalProperties:fw,enum:kU,type:NU,ref:xU};function gw(t,e){let r=pw.getCompilingSchema.call(this,t);if(r)return r;let{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new B.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a=o.scopeName("parse"),l={self:this,gen:o,schema:t.schema,schemaEnv:t,definitions:e,data:se.default.data,parseName:a,char:o.name("c")},u;try{this._compilations.add(t),t.parseName=a,OU(l),o.optimize(this.opts.code.optimize);let c=o.toString();u=`${o.scopeRefs(se.default.scope)}return ${c}`;let p=new Function(`${se.default.scope}`,u)(this.scope.get());this.scope.value(a,{ref:p}),t.parse=p}catch(c){throw u&&this.logger.error("Error compiling parser, function code:",u),delete t.parse,delete t.parseName,c}finally{this._compilations.delete(t)}return t}Zh.default=gw;var Wh=(0,B._)`undefined`;function OU(t){let{gen:e,parseName:r,char:n}=t;e.func(r,(0,B._)`${se.default.json}, ${se.default.jsonPos}, ${se.default.jsonPart}`,!1,()=>{e.let(se.default.data),e.let(n),e.assign((0,B._)`${r}.message`,Wh),e.assign((0,B._)`${r}.position`,Wh),e.assign(se.default.jsonPos,(0,B._)`${se.default.jsonPos} || 0`),e.const(se.default.jsonLen,(0,B._)`${se.default.json}.length`),Tl(t),Qh(t),e.if(se.default.jsonPart,()=>{e.assign((0,B._)`${r}.position`,se.default.jsonPos),e.return(se.default.data)}),e.if((0,B._)`${se.default.jsonPos} === ${se.default.jsonLen}`,()=>e.return(se.default.data)),Ps(t)})}function Tl(t){let e;for(let r of _U.jtdForms)if(r in t.schema){e=r;break}e?$U(t,RU[e]):Yh(t)}var TU=hw(!0,hw(!1,Ps));function $U(t,e){let{gen:r,schema:n,data:s}=t;if(!n.nullable)return e(t);Qi(t,"null",e,()=>r.assign(s,null))}function PU(t){let{gen:e,schema:r,data:n}=t;ur(t,"[");let s=e.let("i",0);e.assign(n,(0,B._)`[]`),Kh(t,"]",()=>{let i=e.let("el");Tl({...t,schema:r.elements,data:i}),e.assign((0,B._)`${n}[${s}++]`,i)})}function AU(t){let{gen:e,schema:r,data:n}=t;ur(t,"{"),e.assign(n,(0,B._)`{}`),Kh(t,"}",()=>CU(t,r.values))}function Kh(t,e,r){yw(t,e,r),ur(t,e)}function yw(t,e,r){let{gen:n}=t;n.for((0,B._)`;${se.default.jsonPos}<${se.default.jsonLen} && ${$l(1)}!==${e};`,()=>{r(),Qi(t,",",()=>n.break(),s)});function s(){Qi(t,e,()=>{},Ps)}}function CU(t,e){let{gen:r}=t,n=r.let("key");Nn({...t,data:n}),ur(t,":"),Sw(t,n,e)}function IU(t){let{gen:e,data:r,schema:n}=t,{discriminator:s,mapping:i}=n;ur(t,"{"),e.assign(r,(0,B._)`{}`);let o=e.const("pos",se.default.jsonPos),a=e.let("value"),l=e.let("tag");yw(t,"}",()=>{let u=e.let("key");Nn({...t,data:u}),ur(t,":"),e.if((0,B._)`${u} === ${s}`,()=>{Nn({...t,data:l}),e.assign((0,B._)`${r}[${u}]`,l),e.break()},()=>Yh({...t,data:a}))}),e.assign(se.default.jsonPos,o),e.if((0,B._)`${l} === undefined`),Ir(t,(0,B.str)`discriminator tag not found`);for(let u in i)e.elseIf((0,B._)`${l} === ${u}`),_w({...t,schema:i[u]},s);e.else(),Ir(t,(0,B.str)`discriminator value not in schema`),e.endIf()}function fw(t){let{gen:e,data:r}=t;ur(t,"{"),e.assign(r,(0,B._)`{}`),_w(t)}function _w(t,e){let{gen:r,schema:n,data:s}=t,{properties:i,optionalProperties:o,additionalProperties:a}=n;if(Kh(t,"}",()=>{let l=r.let("key");if(Nn({...t,data:l}),ur(t,":"),r.if(!1),dw(t,l,i),dw(t,l,o),e){r.elseIf((0,B._)`${l} === ${e}`);let u=r.let("tag");Nn({...t,data:u})}r.else(),a?Yh({...t,data:(0,B._)`${s}[${l}]`}):Ir(t,(0,B.str)`property ${l} not allowed`),r.endIf()}),i){let l=(0,EU.hasPropFunc)(r),u=(0,B.and)(...Object.keys(i).map(c=>(0,B._)`${l}.call(${s}, ${c})`));r.if((0,B.not)(u),()=>Ir(t,(0,B.str)`missing required properties`))}}function dw(t,e,r={}){let{gen:n}=t;for(let s in r)n.elseIf((0,B._)`${e} === ${s}`),Sw(t,e,r[s])}function Sw(t,e,r){Tl({...t,schema:r,data:(0,B._)`${t.data}[${e}]`})}function NU(t){let{gen:e,schema:r,data:n,self:s}=t;switch(r.type){case"boolean":TU(t);break;case"string":Nn(t);break;case"timestamp":{Nn(t);let i=(0,mw.useFunc)(e,wU.default),{allowDate:o,parseDate:a}=s.opts,l=o?(0,B._)`!${i}(${n}, true)`:(0,B._)`!${i}(${n})`,u=a?(0,B.or)(l,(0,B._)`(${n} = new Date(${n}), false)`,(0,B._)`isNaN(${n}.valueOf())`):l;e.if(u,()=>Ir(t,(0,B.str)`invalid timestamp`));break}case"float32":case"float64":Gh(t);break;default:{let i=r.type;if(!s.opts.int32range&&(i==="int32"||i==="uint32"))Gh(t,16),i==="uint32"&&e.if((0,B._)`${n} < 0`,()=>Ir(t,(0,B.str)`integer out of range`));else{let[o,a,l]=vU.intRange[i];Gh(t,l),e.if((0,B._)`${n} < ${o} || ${n} > ${a}`,()=>Ir(t,(0,B.str)`integer out of range`))}}}}function Nn(t){ur(t,'"'),Xh(t,Jh.parseJsonString)}function kU(t){let{gen:e,data:r,schema:n}=t,s=n.enum;ur(t,'"'),e.if(!1);for(let i of s){let o=JSON.stringify(i).slice(1);e.elseIf((0,B._)`${$l(o.length)} === ${o}`),e.assign(r,(0,B.str)`${i}`),e.add(se.default.jsonPos,o.length)}e.else(),Ps(t),e.endIf()}function Gh(t,e){let{gen:r}=t;Qh(t),r.if((0,B._)`"-0123456789".indexOf(${$l(1)}) < 0`,()=>Ps(t),()=>Xh(t,Jh.parseJsonNumber,e))}function hw(t,e){return r=>{let{gen:n,data:s}=r;Qi(r,`${t}`,()=>e(r),()=>n.assign(s,t))}}function xU(t){let{gen:e,self:r,definitions:n,schema:s,schemaEnv:i}=t,{ref:o}=s,a=n[o];if(!a)throw new SU.default(r.opts.uriResolver,"",o,`No definition ${o}`);if(!(0,bU.hasRef)(a))return Tl({...t,schema:a});let{root:l}=i,u=gw.call(r,new pw.SchemaEnv({schema:a,root:l}),n);Ew(t,LU(e,u),!0)}function LU(t,e){return e.parse?t.scopeValue("parse",{ref:e.parse}):(0,B._)`${t.scopeValue("wrapper",{ref:e})}.parse`}function Yh(t){Xh(t,Jh.parseJson)}function Xh(t,e,r){Ew(t,(0,mw.useFunc)(t.gen,e),r)}function Ew(t,e,r){let{gen:n,data:s}=t;n.assign(s,(0,B._)`${e}(${se.default.json}, ${se.default.jsonPos}${r?(0,B._)`, ${r}`:B.nil})`),n.assign(se.default.jsonPos,(0,B._)`${e}.position`),n.if((0,B._)`${s} === undefined`,()=>Ir(t,(0,B._)`${e}.message`))}function ur(t,e){Qi(t,e,Ps)}function Qi(t,e,r,n){let{gen:s}=t,i=e.length;Qh(t),s.if((0,B._)`${$l(i)} === ${e}`,()=>{s.add(se.default.jsonPos,i),n?.(t)},()=>r(t))}function Qh({gen:t,char:e}){t.code((0,B._)`while((${e}=${se.default.json}[${se.default.jsonPos}],${e}===" "||${e}==="\\n"||${e}==="\\r"||${e}==="\\t"))${se.default.jsonPos}++;`)}function $l(t){return t===1?(0,B._)`${se.default.json}[${se.default.jsonPos}]`:(0,B._)`${se.default.json}.slice(${se.default.jsonPos}, ${se.default.jsonPos}+${t})`}function Ps(t){Ir(t,(0,B._)`"unexpected token " + ${se.default.json}[${se.default.jsonPos}]`)}function Ir({gen:t,parseName:e},r){t.assign((0,B._)`${e}.message`,r),t.assign((0,B._)`${e}.position`,se.default.jsonPos),t.return(Wh)}});var rp=E((we,tp)=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.MissingRefError=we.ValidationError=we.CodeGen=we.Name=we.nil=we.stringify=we.str=we._=we.KeywordCxt=we.Ajv=void 0;var qU=Ld(),jU=Yv(),DU=ew(),FU=lw(),MU=bw(),ep="JTD-meta-schema",As=class extends qU.default{constructor(e={}){super({...e,jtd:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(jU.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema(),this.opts.meta&&this.addMetaSchema(DU.default,ep,!1)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ep)?ep:void 0)}compileSerializer(e){let r=this._addSchema(e);return r.serialize||this._compileSerializer(r)}compileParser(e){let r=this._addSchema(e);return r.parse||this._compileParser(r)}_compileSerializer(e){if(FU.default.call(this,e,e.schema.definitions||{}),!e.serialize)throw new Error("ajv implementation error");return e.serialize}_compileParser(e){if(MU.default.call(this,e,e.schema.definitions||{}),!e.parse)throw new Error("ajv implementation error");return e.parse}};we.Ajv=As;tp.exports=we=As;tp.exports.Ajv=As;Object.defineProperty(we,"__esModule",{value:!0});we.default=As;var HU=ms();Object.defineProperty(we,"KeywordCxt",{enumerable:!0,get:function(){return HU.KeywordCxt}});var Cs=W();Object.defineProperty(we,"_",{enumerable:!0,get:function(){return Cs._}});Object.defineProperty(we,"str",{enumerable:!0,get:function(){return Cs.str}});Object.defineProperty(we,"stringify",{enumerable:!0,get:function(){return Cs.stringify}});Object.defineProperty(we,"nil",{enumerable:!0,get:function(){return Cs.nil}});Object.defineProperty(we,"Name",{enumerable:!0,get:function(){return Cs.Name}});Object.defineProperty(we,"CodeGen",{enumerable:!0,get:function(){return Cs.CodeGen}});var VU=Ni();Object.defineProperty(we,"ValidationError",{enumerable:!0,get:function(){return VU.default}});var zU=Rr();Object.defineProperty(we,"MissingRefError",{enumerable:!0,get:function(){return zU.default}})});var np=E((b7,vw)=>{"use strict";var UU=sl();vw.exports=Object.freeze({coerceTypes:"array",useDefaults:!0,removeAdditional:!0,uriResolver:UU,addUsedSchema:!1,allErrors:!1})});var Pl=E(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.formatNames=fr.fastFormats=fr.fullFormats=void 0;function cr(t,e){return{validate:t,compare:e}}fr.fullFormats={date:cr(Tw,ap),time:cr(ip(!0),lp),"date-time":cr(ww(!0),Pw),"iso-time":cr(ip(),$w),"iso-date-time":cr(ww(),Aw),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:YU,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:n4,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:XU,int32:{type:"number",validate:e4},int64:{type:"number",validate:t4},float:{type:"number",validate:Ow},double:{type:"number",validate:Ow},password:!0,binary:!0};fr.fastFormats={...fr.fullFormats,date:cr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,ap),time:cr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,lp),"date-time":cr(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Pw),"iso-time":cr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,$w),"iso-date-time":cr(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Aw),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};fr.formatNames=Object.keys(fr.fullFormats);function BU(t){return t%4===0&&(t%100!==0||t%400===0)}var GU=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,WU=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Tw(t){let e=GU.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&BU(r)?29:WU[n])}function ap(t,e){if(t&&e)return t>e?1:t<e?-1:0}var sp=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function ip(t){return function(r){let n=sp.exec(r);if(!n)return!1;let s=+n[1],i=+n[2],o=+n[3],a=n[4],l=n[5]==="-"?-1:1,u=+(n[6]||0),c=+(n[7]||0);if(u>23||c>59||t&&!a)return!1;if(s<=23&&i<=59&&o<60)return!0;let f=i-c*l,p=s-u*l-(f<0?1:0);return(p===23||p===-1)&&(f===59||f===-1)&&o<61}}function lp(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function $w(t,e){if(!(t&&e))return;let r=sp.exec(t),n=sp.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var op=/t|\s/i;function ww(t){let e=ip(t);return function(n){let s=n.split(op);return s.length===2&&Tw(s[0])&&e(s[1])}}function Pw(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function Aw(t,e){if(!(t&&e))return;let[r,n]=t.split(op),[s,i]=e.split(op),o=ap(r,s);if(o!==void 0)return o||lp(n,i)}var JU=/\/|:/,KU=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function YU(t){return JU.test(t)&&KU.test(t)}var Rw=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function XU(t){return Rw.lastIndex=0,Rw.test(t)}var QU=-(2**31),ZU=2**31-1;function e4(t){return Number.isInteger(t)&&t<=ZU&&t>=QU}function t4(t){return Number.isInteger(t)}function Ow(){return!0}var r4=/[^\\]\\Z/;function n4(t){if(r4.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Cw=E(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.formatLimitDefinition=void 0;var s4=El(),Jt=W(),rn=Jt.operators,Al={formatMaximum:{okStr:"<=",ok:rn.LTE,fail:rn.GT},formatMinimum:{okStr:">=",ok:rn.GTE,fail:rn.LT},formatExclusiveMaximum:{okStr:"<",ok:rn.LT,fail:rn.GTE},formatExclusiveMinimum:{okStr:">",ok:rn.GT,fail:rn.LTE}},i4={message:({keyword:t,schemaCode:e})=>(0,Jt.str)`should be ${Al[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Jt._)`{comparison: ${Al[t].okStr}, limit: ${e}}`};Is.formatLimitDefinition={keyword:Object.keys(Al),type:"string",schemaType:"string",$data:!0,error:i4,code(t){let{gen:e,data:r,schemaCode:n,keyword:s,it:i}=t,{opts:o,self:a}=i;if(!o.validateFormats)return;let l=new s4.KeywordCxt(i,a.RULES.all.format.definition,"format");l.$data?u():c();function u(){let p=e.scopeValue("formats",{ref:a.formats,code:o.code.formats}),h=e.const("fmt",(0,Jt._)`${p}[${l.schemaCode}]`);t.fail$data((0,Jt.or)((0,Jt._)`typeof ${h} != "object"`,(0,Jt._)`${h} instanceof RegExp`,(0,Jt._)`typeof ${h}.compare != "function"`,f(h)))}function c(){let p=l.schema,h=a.formats[p];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw new Error(`"${s}": format "${p}" does not define "compare" function`);let d=e.scopeValue("formats",{key:p,ref:h,code:o.code.formats?(0,Jt._)`${o.code.formats}${(0,Jt.getProperty)(p)}`:void 0});t.fail$data(f(d))}function f(p){return(0,Jt._)`${p}.compare(${r}, ${n}) ${Al[s].fail} 0`}},dependencies:["format"]};var o4=t=>(t.addKeyword(Is.formatLimitDefinition),t);Is.default=o4});var fp=E((Zi,kw)=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});var Ns=Pl(),a4=Cw(),up=W(),Iw=new up.Name("fullFormats"),l4=new up.Name("fastFormats"),cp=(t,e={keywords:!0})=>{if(Array.isArray(e))return Nw(t,e,Ns.fullFormats,Iw),t;let[r,n]=e.mode==="fast"?[Ns.fastFormats,l4]:[Ns.fullFormats,Iw],s=e.formats||Ns.formatNames;return Nw(t,s,r,n),e.keywords&&(0,a4.default)(t),t};cp.get=(t,e="full")=>{let n=(e==="fast"?Ns.fastFormats:Ns.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function Nw(t,e,r,n){var s,i;(s=(i=t.opts.code).formats)!==null&&s!==void 0||(i.formats=(0,up._)`require("ajv-formats/dist/formats").${n}`);for(let o of e)t.addFormat(o,r[o])}kw.exports=Zi=cp;Object.defineProperty(Zi,"__esModule",{value:!0});Zi.default=cp});var qw=E((R7,Lw)=>{"use strict";var u4=El().default,c4=rp(),xw=np(),dp=class{constructor(e,r){r.mode==="JTD"?this.ajv=new c4(Object.assign({},xw,r.customOptions)):this.ajv=new u4(Object.assign({},xw,r.customOptions));let n=!0;if(r.plugins&&r.plugins.length>0)for(let i of r.plugins)Array.isArray(i)?(n=n&&i[0].name!=="formatsPlugin",i[0](this.ajv,i[1])):(n=n&&i.name!=="formatsPlugin",i(this.ajv));n&&fp()(this.ajv),r.onCreate?.(this.ajv);let s=Object.values(e);for(let i of s)this.ajv.addSchema(i)}buildValidatorFunction({schema:e}){if(e.$id){let r=this.ajv.getSchema(e.$id);if(r)return r}return this.ajv.compile(e)}};Lw.exports=dp});var Dw=E((O7,jw)=>{"use strict";var f4=rp(),d4=np(),hp=class{constructor(e,r){this.ajv=new f4(Object.assign({},d4,r))}buildSerializerFunction({schema:e}){return this.ajv.compileSerializer(e)}};jw.exports=hp});var Hw=E((to,Mw)=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});var eo=za(),Kt=as();function Fw(t,e){if(!t.opts.code.source)throw new Error("moduleCode: ajv instance must have code.source option");let{_n:r}=t.scope.opts;return typeof e=="function"?s(e.source):e!==void 0?i(e,n):i(t.schemas,a=>a.meta?void 0:t.compile(a.schema));function n(a){let l=t.getSchema(a);if(!l)throw new Error(`moduleCode: no schema with id ${a}`);return l}function s(a){let l={},u=a?.validateName,c=o(l,a);return t.opts.code.esm?`"use strict";${r}export const validate = ${u};${r}export default ${u};${r}${c}`:`"use strict";${r}module.exports = ${u};${r}module.exports.default = ${u};${r}${c}`}function i(a,l){var u;let c={},f=(0,Kt._)`"use strict";`;for(let p in a){let h=l(a[p]);if(h){let d=o(c,h.source),m=t.opts.code.esm?(0,Kt._)`export const ${(0,Kt.getEsmExportName)(p)}`:(0,Kt._)`exports${(0,Kt.getProperty)(p)}`;f=(0,Kt._)`${f}${r}${m} = ${(u=h.source)===null||u===void 0?void 0:u.validateName};${r}${d}`}}return`${f}`}function o(a,l){if(!l)throw new Error('moduleCode: function does not have "source" property');if(p(l.validateName)===eo.UsedValueState.Completed)return Kt.nil;h(l.validateName,eo.UsedValueState.Started);let u=t.scope.scopeCode(l.scopeValues,a,f),c=new Kt._Code(`${u}${r}${l.validateCode}`);return l.evaluated?(0,Kt._)`${c}${l.validateName}.evaluated = ${l.evaluated};${r}`:c;function f(d){var m;let g=(m=d.value)===null||m===void 0?void 0:m.ref;if(d.prefix==="validate"&&typeof g=="function")return o(a,g.source);if((d.prefix==="root"||d.prefix==="wrapper")&&typeof g=="object"){let{validate:S,validateName:b}=g;if(!b)throw new Error("ajv internal error");let _=t.opts.code.es5?eo.varKinds.var:eo.varKinds.const,y=(0,Kt._)`${_} ${d} = {validate: ${b}};`;if(p(b)===eo.UsedValueState.Started)return y;let R=o(a,S?.source);return(0,Kt._)`${y}${r}${R}`}}function p(d){var m;return(m=a[d.prefix])===null||m===void 0?void 0:m.get(d)}function h(d,m){let{prefix:g}=d;(a[g]=a[g]||new Map).set(d,m)}}}Mw.exports=to=Fw;Object.defineProperty(to,"__esModule",{value:!0});to.default=Fw});var Uw=E((T7,zw)=>{"use strict";var Vw=pp(),h4=Hw().default;function p4(t={readMode:!0}){if(t.readMode===!0&&!t.restoreFunction)throw new Error("You must provide a restoreFunction options when readMode ON");if(t.readMode!==!0&&!t.storeFunction)throw new Error("You must provide a storeFunction options when readMode OFF");if(t.readMode===!0)return function(){return function(n){return t.restoreFunction(n)}};let e=Vw();return function(n,s={}){(!s.customOptions||!s.customOptions.code)&&(s.customOptions=Object.assign({},s.customOptions,{code:{source:!0}}));let i=e(n,s);return function(o){let a=i(o),l=h4(i[Vw.AjvReference].ajv,a);return t.storeFunction(o,l),a}}}zw.exports=p4});var pp=E(($7,ks)=>{"use strict";var Gw=Symbol.for("fastify.ajv-compiler.reference"),m4=qw(),g4=Dw();function mp(t){let e=new Map,r=new Map;return t&&t.jtdSerializer===!0?function(s,i){let o=Bw({},i);if(r.has(o))return r.get(o);let a=new g4(s,i),l=a.buildSerializerFunction.bind(a);return r.set(o,l),l}:function(s,i){let o=Bw(s,i.customOptions);if(e.has(o))return e.get(o);let a=new m4(s,i),l=a.buildValidatorFunction.bind(a);return e.set(o,l),i.customOptions.code!==void 0&&(l[Gw]=a),l}}function Bw(t,e){let r=JSON.stringify(t),n=JSON.stringify(e);return`${r}${n}`}ks.exports=mp;ks.exports.default=mp;ks.exports.AjvCompiler=mp;ks.exports.AjvReference=Gw;ks.exports.StandaloneValidator=Uw()});var Cl=E(Kw=>{var Ww=Object.prototype.hasOwnProperty;function Jw(t,e,r){for(r of t.keys())if(ro(r,e))return r}function ro(t,e){var r,n,s;if(t===e)return!0;if(t&&e&&(r=t.constructor)===e.constructor){if(r===Date)return t.getTime()===e.getTime();if(r===RegExp)return t.toString()===e.toString();if(r===Array){if((n=t.length)===e.length)for(;n--&&ro(t[n],e[n]););return n===-1}if(r===Set){if(t.size!==e.size)return!1;for(n of t)if(s=n,s&&typeof s=="object"&&(s=Jw(e,s),!s)||!e.has(s))return!1;return!0}if(r===Map){if(t.size!==e.size)return!1;for(n of t)if(s=n[0],s&&typeof s=="object"&&(s=Jw(e,s),!s)||!ro(n[1],e.get(s)))return!1;return!0}if(r===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(r===DataView){if((n=t.byteLength)===e.byteLength)for(;n--&&t.getInt8(n)===e.getInt8(n););return n===-1}if(ArrayBuffer.isView(t)){if((n=t.byteLength)===e.byteLength)for(;n--&&t[n]===e[n];);return n===-1}if(!r||typeof t=="object"){n=0;for(r in t)if(Ww.call(t,r)&&++n&&!Ww.call(e,r)||!(r in e)||!ro(t[r],e[r]))return!1;return Object.keys(e).length===n}}return t!==t&&e!==e}Kw.dequal=ro});var Zw=E((A7,Qw)=>{"use strict";var{dequal:Yw}=Cl(),y4=Symbol.for("json-schema-ref"),gp=class{#e;#t;#r;#n;#s;constructor(e={}){this.#e={},this.#t={},this.#r=e.insertRefSymbol??!1,this.#n=e.allowEqualDuplicates??!0,this.#s=e.cloneSchemaWithoutRefs??!1}addSchema(e,r,n=!0){n&&(e.$id!==void 0&&e.$id.charAt(0)!=="#"?r=e.$id:this.#l(e,r));let s=e.$id;s!==void 0&&typeof s=="string"&&(s.charAt(0)==="#"?this.#c(e,r,s):(this.#l(e,s),r=s));let i=e.$ref;if(i!==void 0&&typeof i=="string"){let{refSchemaId:o,refJsonPointer:a}=this.#i(i,r);this.#e[r].refs.push({schemaId:o,jsonPointer:a})}for(let o in e)typeof e[o]=="object"&&e[o]!==null&&this.addSchema(e[o],r,!1)}getSchema(e,r="#"){let n=this.#e[e];if(n===void 0)throw new Error(`Cannot resolve ref "${e}${r}". Schema with id "${e}" is not found.`);return n.anchors[r]!==void 0?n.anchors[r]:Xw(n.schema,r)}hasSchema(e){return this.#e[e]!==void 0}getSchemaRefs(e){let r=this.#e[e];if(r===void 0)throw new Error(`Schema with id "${e}" is not found.`);return r.refs}getSchemaDependencies(e,r={}){let n=this.#e[e];for(let s of n.refs){let i=s.schemaId;i===e||r[i]!==void 0||(r[i]=this.getSchema(i),this.getSchemaDependencies(i,r))}return r}derefSchema(e){if(this.#t[e]!==void 0)return;let r=this.#e[e];if(r===void 0)throw new Error(`Schema with id "${e}" is not found.`);!this.#s&&r.refs.length===0&&(this.#t[e]={schema:r.schema,anchors:r.anchors});let n=[];this.#o(r.schema,e,!0,n);let s=this.getSchemaDependencies(e);for(let i in s){let o=s[i];this.#o(o,i,!0,n)}for(let i of n){let{refSchemaId:o,refJsonPointer:a}=this.#i(i.ref,i.sourceSchemaId),l=this.getDerefSchema(o,a);if(l===null)throw new Error(`Cannot resolve ref "${i.ref}". Ref "${a}" is not found in schema "${o}".`);i.targetSchema=l,i.targetSchemaId=o}for(let i of n)this.#a(i,n)}getDerefSchema(e,r="#"){let n=this.#t[e];return n===void 0&&(this.derefSchema(e),n=this.#t[e]),n.anchors[r]!==void 0?n.anchors[r]:Xw(n.schema,r)}#i(e,r){let n=e.indexOf("#");return n===-1?{refSchemaId:e,refJsonPointer:"#"}:n===0?{refSchemaId:r,refJsonPointer:e}:{refSchemaId:e.slice(0,n),refJsonPointer:e.slice(n)}}#o(e,r,n,s=[]){let i=Array.isArray(e)?[...e]:{...e};n&&(e.$id!==void 0&&e.$id.charAt(0)!=="#"?r=e.$id:this.#u(i,r));let o=i.$id;o!==void 0&&typeof o=="string"&&(o.charAt(0)==="#"?this.#f(i,r,o):(this.#u(i,o),r=o)),i.$ref!==void 0&&s.push({ref:i.$ref,sourceSchemaId:r,sourceSchema:i});for(let a in i){let l=i[a];typeof l=="object"&&l!==null&&(i[a]=this.#o(l,r,!1,s))}return i}#a(e,r){let{sourceSchema:n,targetSchema:s}=e;if(n.$ref){if(this.#r&&(n[y4]=n.$ref),delete n.$ref,s.$ref){let i=r.find(o=>o.sourceSchema===s);this.#a(i,r)}for(let i in s)if(i!=="$id"){if(n[i]!==void 0){if(Yw(n[i],s[i]))continue;throw new Error(`Cannot resolve ref "${e.ref}". Property "${i}" already exists in schema "${e.sourceSchemaId}".`)}n[i]=s[i]}e.isResolved=!0}}#l(e,r){let n=this.#e[r];if(n!==void 0){if(this.#n&&Yw(e,n.schema))return;throw new Error(`There is already another schema with id "${r}".`)}this.#e[r]={schema:e,anchors:{},refs:[]}}#c(e,r,n){let{anchors:s}=this.#e[r];if(s[n]!==void 0)throw new Error(`There is already another anchor "${n}" in schema "${r}".`);s[n]=e}#u(e,r){this.#t[r]===void 0&&(this.#t[r]={schema:e,anchors:{}})}#f(e,r,n){let{anchors:s}=this.#t[r];s[n]=e}};function Xw(t,e){let r=e.split("/"),n=t;for(let s of r)if(!(s===""||s==="#")){if(typeof n!="object"||n===null)return null;n=n[s]}return n??null}Qw.exports={RefResolver:gp}});var _p=E((C7,eR)=>{"use strict";var _4=El(),S4=sl(),E4=fp(),b4=ga()({proto:!0}),yp=class t{constructor(e){this.ajv=new _4({...e,strictSchema:!1,validateSchema:!1,allowUnionTypes:!0,uriResolver:S4}),E4(this.ajv),this.ajv.addKeyword({keyword:"fjs_type",type:"object",errors:!1,validate:(r,n)=>n&&typeof n.toJSON=="function"}),this._ajvSchemas={},this._ajvOptions=e||{}}addSchema(e,r){let n=e.$id||r;if(e.$id!==void 0&&e.$id[0]==="#"&&(n=r+e.$id),this.ajv.refs[n]===void 0&&this.ajv.schemas[n]===void 0){let s=b4(e);this.convertSchemaToAjvFormat(s),this.ajv.addSchema(s,n),this._ajvSchemas[n]=e}}validate(e,r){return this.ajv.validate(e,r)}convertSchemaToAjvFormat(e){if(e!==null){e.type==="string"?(e.fjs_type="string",e.type=["string","object"]):Array.isArray(e.type)&&e.type.includes("string")&&!e.type.includes("object")&&(e.fjs_type="string",e.type.push("object"));for(let r in e)typeof e[r]=="object"&&this.convertSchemaToAjvFormat(e[r])}}getState(){return{ajvOptions:this._ajvOptions,ajvSchemas:this._ajvSchemas}}static restoreFromState(e){let r=new t(e.ajvOptions);for(let[n,s]of Object.entries(e.ajvSchemas))r.ajv.addSchema(s,n);return r}};eR.exports=yp});var rR=E((I7,tR)=>{"use strict";var Sp=class t{constructor(e,r,n="#"){this.schema=e,this.schemaId=r,this.jsonPointer=n}getPropertyLocation(e){return new t(this.schema[e],this.schemaId,this.jsonPointer+"/"+e)}getSchemaRef(){return this.schemaId+this.jsonPointer}};tR.exports=Sp});var aR=E((N7,bp)=>{"use strict";bp.exports=x;bp.exports.default=x;var v4={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0},nR={enum:["array","boolean","integer","null","number","object","string"]},sR=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,w4=Pl().fullFormats.uri,iR=Pl().fullFormats.regex;function Lt(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0,a=o;return typeof t=="number"&&!(t%1)&&!isNaN(t)&&isFinite(t)?o===a&&typeof t=="number"&&isFinite(t)&&(t<0||isNaN(t))?(Lt.errors=[{instancePath:e,schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1):(Lt.errors=i,o===0):(Lt.errors=[{instancePath:e,schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1)}var Ep={validate:x};function at(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0;if(o===0)if(Array.isArray(t)){if(t.length<1)return at.errors=[{instancePath:e,schemaPath:"#/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"}],!1;{var a=!0;let l=t.length;for(let u=0;u<l;u++){let c=o;Ep.validate(t[u],{instancePath:e+"/"+u,parentData:t,parentDataProperty:u,rootData:s})||(i=i===null?Ep.validate.errors:i.concat(Ep.validate.errors),o=i.length);var a=c===o;if(!a)break}}}else return at.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;return at.errors=i,o===0}var oR=Vi().default;function x(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0;if(!(t&&typeof t=="object"&&!Array.isArray(t))&&typeof t!="boolean")return x.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:v4.type},message:"must be object,boolean"}],!1;if(o===0&&t&&typeof t=="object"&&!Array.isArray(t)){if(t.$id!==void 0){let _=t.$id,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!sR.test(_))return x.errors=[{instancePath:e+"/$id",schemaPath:"#/properties/%24id/format",keyword:"format",params:{format:"uri-reference"},message:'must match format "uri-reference"'}],!1}else return x.errors=[{instancePath:e+"/$id",schemaPath:"#/properties/%24id/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.$schema!==void 0){let _=t.$schema,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!w4(_))return x.errors=[{instancePath:e+"/$schema",schemaPath:"#/properties/%24schema/format",keyword:"format",params:{format:"uri"},message:'must match format "uri"'}],!1}else return x.errors=[{instancePath:e+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.$ref!==void 0){let _=t.$ref,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!sR.test(_))return x.errors=[{instancePath:e+"/$ref",schemaPath:"#/properties/%24ref/format",keyword:"format",params:{format:"uri-reference"},message:'must match format "uri-reference"'}],!1}else return x.errors=[{instancePath:e+"/$ref",schemaPath:"#/properties/%24ref/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.$comment!==void 0){let _=o;if(typeof t.$comment!="string")return x.errors=[{instancePath:e+"/$comment",schemaPath:"#/properties/%24comment/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.title!==void 0){let _=o;if(typeof t.title!="string")return x.errors=[{instancePath:e+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.description!==void 0){let _=o;if(typeof t.description!="string")return x.errors=[{instancePath:e+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.readOnly!==void 0){let _=o;if(typeof t.readOnly!="boolean")return x.errors=[{instancePath:e+"/readOnly",schemaPath:"#/properties/readOnly/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var a=_===o}else var a=!0;if(a){if(t.examples!==void 0){let _=o;if(o===_&&!Array.isArray(t.examples))return x.errors=[{instancePath:e+"/examples",schemaPath:"#/properties/examples/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var a=_===o}else var a=!0;if(a){if(t.multipleOf!==void 0){let _=t.multipleOf,y=o;if(o===y)if(typeof _=="number"&&isFinite(_)){if(_<=0||isNaN(_))return x.errors=[{instancePath:e+"/multipleOf",schemaPath:"#/properties/multipleOf/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0"}],!1}else return x.errors=[{instancePath:e+"/multipleOf",schemaPath:"#/properties/multipleOf/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.maximum!==void 0){let _=t.maximum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/maximum",schemaPath:"#/properties/maximum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.exclusiveMaximum!==void 0){let _=t.exclusiveMaximum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/exclusiveMaximum",schemaPath:"#/properties/exclusiveMaximum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.minimum!==void 0){let _=t.minimum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/minimum",schemaPath:"#/properties/minimum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.exclusiveMinimum!==void 0){let _=t.exclusiveMinimum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/exclusiveMinimum",schemaPath:"#/properties/exclusiveMinimum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.maxLength!==void 0){let _=t.maxLength,y=o,R=o;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return x.errors=[{instancePath:e+"/maxLength",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;if(o===R&&typeof _=="number"&&isFinite(_)&&(_<0||isNaN(_)))return x.errors=[{instancePath:e+"/maxLength",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1;var a=y===o}else var a=!0;if(a){if(t.minLength!==void 0){let _=o;Lt(t.minLength,{instancePath:e+"/minLength",parentData:t,parentDataProperty:"minLength",rootData:s})||(i=i===null?Lt.errors:i.concat(Lt.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.pattern!==void 0){let _=t.pattern,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!iR(_))return x.errors=[{instancePath:e+"/pattern",schemaPath:"#/properties/pattern/format",keyword:"format",params:{format:"regex"},message:'must match format "regex"'}],!1}else return x.errors=[{instancePath:e+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.additionalItems!==void 0){let _=o;x(t.additionalItems,{instancePath:e+"/additionalItems",parentData:t,parentDataProperty:"additionalItems",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.items!==void 0){let _=t.items,y=o,R=o,T=!1,O=o;x(_,{instancePath:e+"/items",parentData:t,parentDataProperty:"items",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var l=O===o;if(T=T||l,!T){let $=o;at(_,{instancePath:e+"/items",parentData:t,parentDataProperty:"items",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var l=$===o;T=T||l}if(T)o=R,i!==null&&(R?i.length=R:i=null);else{let $={instancePath:e+"/items",schemaPath:"#/properties/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[$]:i.push($),o++,x.errors=i,!1}var a=y===o}else var a=!0;if(a){if(t.maxItems!==void 0){let _=t.maxItems,y=o,R=o;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return x.errors=[{instancePath:e+"/maxItems",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;if(o===R&&typeof _=="number"&&isFinite(_)&&(_<0||isNaN(_)))return x.errors=[{instancePath:e+"/maxItems",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1;var a=y===o}else var a=!0;if(a){if(t.minItems!==void 0){let _=o;Lt(t.minItems,{instancePath:e+"/minItems",parentData:t,parentDataProperty:"minItems",rootData:s})||(i=i===null?Lt.errors:i.concat(Lt.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.uniqueItems!==void 0){let _=o;if(typeof t.uniqueItems!="boolean")return x.errors=[{instancePath:e+"/uniqueItems",schemaPath:"#/properties/uniqueItems/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var a=_===o}else var a=!0;if(a){if(t.contains!==void 0){let _=o;x(t.contains,{instancePath:e+"/contains",parentData:t,parentDataProperty:"contains",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.maxProperties!==void 0){let _=t.maxProperties,y=o,R=o;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return x.errors=[{instancePath:e+"/maxProperties",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;if(o===R&&typeof _=="number"&&isFinite(_)&&(_<0||isNaN(_)))return x.errors=[{instancePath:e+"/maxProperties",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1;var a=y===o}else var a=!0;if(a){if(t.minProperties!==void 0){let _=o;Lt(t.minProperties,{instancePath:e+"/minProperties",parentData:t,parentDataProperty:"minProperties",rootData:s})||(i=i===null?Lt.errors:i.concat(Lt.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.required!==void 0){let _=t.required,y=o;if(o===o)if(Array.isArray(_)){var u=!0;let O=_.length;for(let w=0;w<O;w++){let $=o;if(typeof _[w]!="string")return x.errors=[{instancePath:e+"/required/"+w,schemaPath:"#/definitions/stringArray/items/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=$===o;if(!u)break}if(u){let w=_.length,$;if(w>1){let v={};for(;w--;){let P=_[w];if(typeof P=="string"){if(typeof v[P]=="number"){return $=v[P],x.errors=[{instancePath:e+"/required",schemaPath:"#/definitions/stringArray/uniqueItems",keyword:"uniqueItems",params:{i:w,j:$},message:"must NOT have duplicate items (items ## "+$+" and "+w+" are identical)"}],!1;break}v[P]=w}}}}}else return x.errors=[{instancePath:e+"/required",schemaPath:"#/definitions/stringArray/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var a=y===o}else var a=!0;if(a){if(t.additionalProperties!==void 0){let _=o;x(t.additionalProperties,{instancePath:e+"/additionalProperties",parentData:t,parentDataProperty:"additionalProperties",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.definitions!==void 0){let _=t.definitions,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_))for(let T in _){let O=o;x(_[T],{instancePath:e+"/definitions/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var c=O===o;if(!c)break}else return x.errors=[{instancePath:e+"/definitions",schemaPath:"#/properties/definitions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.properties!==void 0){let _=t.properties,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_))for(let T in _){let O=o;x(_[T],{instancePath:e+"/properties/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var f=O===o;if(!f)break}else return x.errors=[{instancePath:e+"/properties",schemaPath:"#/properties/properties/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.patternProperties!==void 0){let _=t.patternProperties,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_)){for(let T in _){let O=o;if(o===O&&typeof T=="string"&&!iR(T)){let w={instancePath:e+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames/format",keyword:"format",params:{format:"regex"},message:'must match format "regex"',propertyName:T};i===null?i=[w]:i.push(w),o++}var p=O===o;if(!p){let w={instancePath:e+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames",keyword:"propertyNames",params:{propertyName:T},message:"property name must be valid"};return i===null?i=[w]:i.push(w),o++,x.errors=i,!1;break}}if(p)for(let T in _){let O=o;x(_[T],{instancePath:e+"/patternProperties/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var h=O===o;if(!h)break}}else return x.errors=[{instancePath:e+"/patternProperties",schemaPath:"#/properties/patternProperties/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.dependencies!==void 0){let _=t.dependencies,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_))for(let T in _){let O=_[T],w=o,$=o,v=!1,P=o;x(O,{instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var d=P===o;if(v=v||d,!v){let C=o;if(o===o)if(Array.isArray(O)){var m=!0;let J=O.length;for(let U=0;U<J;U++){let H=o;if(typeof O[U]!="string"){let ze={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1")+"/"+U,schemaPath:"#/definitions/stringArray/items/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[ze]:i.push(ze),o++}var m=H===o;if(!m)break}if(m){let U=O.length,H;if(U>1){let fe={};for(;U--;){let ze=O[U];if(typeof ze=="string"){if(typeof fe[ze]=="number"){H=fe[ze];let G={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/stringArray/uniqueItems",keyword:"uniqueItems",params:{i:U,j:H},message:"must NOT have duplicate items (items ## "+H+" and "+U+" are identical)"};i===null?i=[G]:i.push(G),o++;break}fe[ze]=U}}}}}else{let J={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/stringArray/type",keyword:"type",params:{type:"array"},message:"must be array"};i===null?i=[J]:i.push(J),o++}var d=C===o;v=v||d}if(v)o=$,i!==null&&($?i.length=$:i=null);else{let C={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/dependencies/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[C]:i.push(C),o++,x.errors=i,!1}var g=w===o;if(!g)break}else return x.errors=[{instancePath:e+"/dependencies",schemaPath:"#/properties/dependencies/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.propertyNames!==void 0){let _=o;x(t.propertyNames,{instancePath:e+"/propertyNames",parentData:t,parentDataProperty:"propertyNames",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.enum!==void 0){let _=t.enum,y=o;if(o===y)if(Array.isArray(_)){if(_.length<1)return x.errors=[{instancePath:e+"/enum",schemaPath:"#/properties/enum/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"}],!1;{let T=_.length,O;if(T>1){e:for(;T--;)for(O=T;O--;)if(oR(_[T],_[O])){return x.errors=[{instancePath:e+"/enum",schemaPath:"#/properties/enum/uniqueItems",keyword:"uniqueItems",params:{i:T,j:O},message:"must NOT have duplicate items (items ## "+O+" and "+T+" are identical)"}],!1;break e}}}}else return x.errors=[{instancePath:e+"/enum",schemaPath:"#/properties/enum/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var a=y===o}else var a=!0;if(a){if(t.type!==void 0){let _=t.type,y=o,R=o,T=!1,O=o;if(!(_==="array"||_==="boolean"||_==="integer"||_==="null"||_==="number"||_==="object"||_==="string")){let $={instancePath:e+"/type",schemaPath:"#/definitions/simpleTypes/enum",keyword:"enum",params:{allowedValues:nR.enum},message:"must be equal to one of the allowed values"};i===null?i=[$]:i.push($),o++}var S=O===o;if(T=T||S,!T){let $=o;if(o===$)if(Array.isArray(_))if(_.length<1){let P={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf/1/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};i===null?i=[P]:i.push(P),o++}else{var b=!0;let P=_.length;for(let C=0;C<P;C++){let k=_[C],M=o;if(!(k==="array"||k==="boolean"||k==="integer"||k==="null"||k==="number"||k==="object"||k==="string")){let U={instancePath:e+"/type/"+C,schemaPath:"#/definitions/simpleTypes/enum",keyword:"enum",params:{allowedValues:nR.enum},message:"must be equal to one of the allowed values"};i===null?i=[U]:i.push(U),o++}var b=M===o;if(!b)break}if(b){let C=_.length,k;if(C>1){e:for(;C--;)for(k=C;k--;)if(oR(_[C],_[k])){let M={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf/1/uniqueItems",keyword:"uniqueItems",params:{i:C,j:k},message:"must NOT have duplicate items (items ## "+k+" and "+C+" are identical)"};i===null?i=[M]:i.push(M),o++;break e}}}}else{let P={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};i===null?i=[P]:i.push(P),o++}var S=$===o;T=T||S}if(T)o=R,i!==null&&(R?i.length=R:i=null);else{let $={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[$]:i.push($),o++,x.errors=i,!1}var a=y===o}else var a=!0;if(a){if(t.format!==void 0){let _=o;if(typeof t.format!="string")return x.errors=[{instancePath:e+"/format",schemaPath:"#/properties/format/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.contentMediaType!==void 0){let _=o;if(typeof t.contentMediaType!="string")return x.errors=[{instancePath:e+"/contentMediaType",schemaPath:"#/properties/contentMediaType/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.contentEncoding!==void 0){let _=o;if(typeof t.contentEncoding!="string")return x.errors=[{instancePath:e+"/contentEncoding",schemaPath:"#/properties/contentEncoding/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.if!==void 0){let _=o;x(t.if,{instancePath:e+"/if",parentData:t,parentDataProperty:"if",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.then!==void 0){let _=o;x(t.then,{instancePath:e+"/then",parentData:t,parentDataProperty:"then",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.else!==void 0){let _=o;x(t.else,{instancePath:e+"/else",parentData:t,parentDataProperty:"else",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.allOf!==void 0){let _=o;at(t.allOf,{instancePath:e+"/allOf",parentData:t,parentDataProperty:"allOf",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.anyOf!==void 0){let _=o;at(t.anyOf,{instancePath:e+"/anyOf",parentData:t,parentDataProperty:"anyOf",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.oneOf!==void 0){let _=o;at(t.oneOf,{instancePath:e+"/oneOf",parentData:t,parentDataProperty:"oneOf",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var a=_===o}else var a=!0;if(a)if(t.not!==void 0){let _=o;x(t.not,{instancePath:e+"/not",parentData:t,parentDataProperty:"not",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}return x.errors=i,o===0}});var Op=E((k7,lR)=>{"use strict";var vp=class extends Error{constructor(e,r){super(),this.name="JsonSchemaMergeError",this.code="JSON_SCHEMA_MERGE_ERROR",this.message=`Failed to merge "${e}" keyword schemas.`,this.schemas=r}},wp=class extends Error{constructor(e,r){super(),this.name="JsonSchemaMergeError",this.code="JSON_SCHEMA_MERGE_ERROR",this.message=`Resolver for "${e}" keyword not found.`,this.schemas=r}},Rp=class extends Error{constructor(e){super(),this.name="JsonSchemaMergeError",this.code="JSON_SCHEMA_MERGE_ERROR",this.message=`Invalid "onConflict" option: "${e}".`}};lR.exports={MergeError:vp,ResolverNotFoundError:wp,InvalidOnConflictOptionError:Rp}});var fR=E((x7,cR)=>{"use strict";var{dequal:R4}=Cl(),{MergeError:Tp}=Op();function uR(t){let e=t[0];for(let r=1;r<t.length;r++)e=e.filter(n=>t[r].includes(n));return e}function O4(t,e,r){let n=uR(e);if(n.length===0)throw new Tp(t,e);r[t]=n}function T4(t,e,r){for(let s=0;s<e.length;s++)Array.isArray(e[s])||(e[s]=[e[s]]);let n=uR(e);if(n.length===0)throw new Tp(t,e);n.length===1?r[t]=n[0]:r[t]=n}function $4(t,e,r){let n=[];for(let s of e)for(let i of s)n.includes(i)||n.push(i);r[t]=n}function P4(t,e,r){r[t]=Math.min(...e)}function A4(t,e,r){r[t]=Math.max(...e)}function C4(t,e,r){let n=(a,l)=>l?n(l,a%l):a,s=(a,l)=>a*l/n(a,l),i=1;for(let a of e)for(;a*i%1!==0;)i*=10;let o=e[0]*i;for(let a of e)o=s(o,a*i);r[t]=o/i}function I4(t,e,r){let n=e[0];for(let s=1;s<e.length;s++)if(!R4(e[s],n))throw new Tp(t,e);r[t]=n}function N4(){}function k4(t,e,r){for(let n of e)if(n===!1){r[t]=!1;return}r[t]=!0}function x4(t,e,r){for(let n of e)if(n===!0){r[t]=!0;return}r[t]=!1}cR.exports={arraysIntersection:O4,hybridArraysIntersection:T4,arraysUnion:$4,minNumber:P4,maxNumber:A4,commonMultiple:C4,allEqual:I4,booleanAnd:k4,booleanOr:x4,skip:N4}});var yR=E((L7,gR)=>{"use strict";var{dequal:L4}=Cl(),Oe=fR(),kl=Op(),pR={$id:Oe.skip,type:Oe.hybridArraysIntersection,enum:Oe.arraysIntersection,minLength:Oe.maxNumber,maxLength:Oe.minNumber,minimum:Oe.maxNumber,maximum:Oe.minNumber,multipleOf:Oe.commonMultiple,exclusiveMinimum:Oe.maxNumber,exclusiveMaximum:Oe.minNumber,minItems:Oe.maxNumber,maxItems:Oe.minNumber,maxProperties:Oe.minNumber,minProperties:Oe.maxNumber,const:Oe.allEqual,default:Oe.allEqual,format:Oe.allEqual,required:Oe.arraysUnion,properties:H4,patternProperties:Nl,additionalProperties:Il,items:D4,additionalItems:F4,definitions:Nl,$defs:Nl,nullable:Oe.booleanAnd,oneOf:dR,anyOf:dR,allOf:Oe.arraysUnion,not:Il,if:V4,then:Oe.skip,else:Oe.skip,dependencies:hR,dependentRequired:hR,dependentSchemas:Nl,propertyNames:Il,uniqueItems:Oe.booleanOr,contains:Il};function Il(t,e,r,n,s){r[t]=Yt(e,s)}function q4(t){let e=[[]];for(let r of t){let n=[];for(let s of e)for(let i of r)n.push([...s,i]);e=n}return e}function dR(t,e,r,n,s){if(e.length===1){r[t]=e[0];return}let i=q4(e),o=[];for(let a of i)try{let l=Yt(a,s);l!==void 0&&o.push(l)}catch(l){if(l instanceof kl.MergeError)continue;throw l}r[t]=o}function j4(t,e){let{items:r,additionalItems:n}=t;return Array.isArray(r)?e<r.length?r[e]:n:r!==void 0?r:n}function D4(t,e,r,n,s){let i=0;for(let a of e)Array.isArray(a)&&(i=Math.max(i,a.length));if(i===0){r[t]=Yt(e,s);return}let o=[];for(let a=0;a<i;a++){let l=[];for(let u of n){let c=j4(u,a);c!==void 0&&l.push(c)}o[a]=Yt(l,s)}r[t]=o}function F4(t,e,r,n,s){let i=!1;for(let a of n)if(Array.isArray(a.items)){i=!0;break}if(!i){r[t]=Yt(e,s);return}let o=[];for(let a of n){let l=a.additionalItems;l===void 0&&!Array.isArray(a.items)&&(l=a.items),l!==void 0&&o.push(l)}r[t]=Yt(o,s)}function M4(t,e){let{properties:r,patternProperties:n,additionalProperties:s}=t;if(r?.[e]!==void 0)return r[e];for(let i of Object.keys(n??{}))if(new RegExp(i).test(e))return n[i];return s}function H4(t,e,r,n,s){let i={};for(let a of n){let l=a.properties??{};for(let u of Object.keys(l)){if(i[u]!==void 0)continue;let c=l[u];i[u]=[c];for(let f of n){if(a===f)continue;let p=M4(f,u);p!==void 0&&i[u].push(p)}}}let o={};for(let a of Object.keys(i)){let l=i[a];o[a]=Yt(l,s)}r[t]=o}function Nl(t,e,r,n,s){let i={};for(let a of e)for(let l of Object.keys(a))i[l]===void 0&&(i[l]=[]),i[l].push(a[l]);let o={};for(let a of Object.keys(i)){let l=i[a],u=Yt(l,s);o[a]=u}r[t]=o}function V4(t,e,r,n,s){for(let i=0;i<n.length;i++){let o={if:n[i].if,then:n[i].then,else:n[i].else};if(o.if!==void 0){if(r.if===void 0){r.if=o.if,o.then!==void 0&&(r.then=o.then),o.else!==void 0&&(r.else=o.else);continue}r.then!==void 0&&(r.then=Yt([r.then,o],s)),r.else!==void 0&&(r.else=Yt([r.else,o],s))}}}function hR(t,e,r){let n={};for(let s of e)for(let i of Object.keys(s)){n[i]===void 0&&(n[i]=[]);let o=n[i];for(let a of s[i])o.includes(a)||o.push(a)}r[t]=n}function Yt(t,e){if(t.length===0)return{};if(t.length===1)return t[0];let r={},n={},s=!0;for(let i of t){if(i===!1)return!1;if(i!==!0){s=!1;for(let o of Object.keys(i))n[o]===void 0&&(n[o]=[]),n[o].push(i[o])}}if(s)return!0;for(let i of Object.keys(n)){let o=n[i];(e.resolvers[i]??e.defaultResolver)(i,o,r,t,e)}return r}function mR(t,e,r,n,s){let i=s.onConflict??"throw";if(e.length===1||i==="first"){r[t]=e[0];return}let o=!0;for(let a=1;a<e.length;a++)if(!L4(e[a],e[0])){o=!1;break}if(o){r[t]=e[0];return}if(i==="throw")throw new kl.ResolverNotFoundError(t,e);if(i!=="skip")throw new kl.InvalidOnConflictOptionError(i)}function z4(t,e={}){return e.defaultResolver===void 0&&(e.defaultResolver=mR),e.resolvers={...pR,...e.resolvers},Yt(t,e)}gR.exports={mergeSchemas:z4,keywordsResolvers:pR,defaultResolver:mR,...kl}});var SR=E((q7,_R)=>{"use strict";var{mergeSchemas:U4}=yR();function B4(t){return U4(t,{onConflict:"skip"})}_R.exports=B4});var ER=E((j7,$p)=>{"use strict";function G4(t,e,r,n){let s="";e.validatorSchemasIds.size>0?(s+=`const Validator = require('fast-json-stringify/lib/validator')
58
+ deps: ${r}}`};var H2={keyword:"dependencies",type:"object",schemaType:"object",error:ur.error,code(t){let[e,r]=V2(t);Xb(t,e),Qb(t,r)}};function V2({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let s=Array.isArray(t[n])?e:r;s[n]=t[n]}return[e,r]}function Xb(t,e=t.schema){let{gen:r,data:n,it:s}=t;if(Object.keys(e).length===0)return;let i=r.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let l=(0,Wi.propertyInData)(r,n,o,s.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?r.if(l,()=>{for(let u of a)(0,Wi.checkReportMissingProp)(t,u)}):(r.if((0,ah._)`${l} && (${(0,Wi.checkMissingProp)(t,a,i)})`),(0,Wi.reportMissingProp)(t,i),r.else())}}ur.validatePropertyDeps=Xb;function Qb(t,e=t.schema){let{gen:r,data:n,keyword:s,it:i}=t,o=r.name("valid");for(let a in e)(0,M2.alwaysValidSchema)(i,e[a])||(r.if((0,Wi.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let l=t.subschema({keyword:s,schemaProp:a},o);t.mergeValidEvaluated(l,o)},()=>r.var(o,!0)),t.ok(o))}ur.validateSchemaDeps=Qb;ur.default=H2});var tv=E(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});var ev=W(),z2=ee(),U2={message:"property name must be valid",params:({params:t})=>(0,ev._)`{propertyName: ${t.propertyName}}`},B2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:U2,code(t){let{gen:e,schema:r,data:n,it:s}=t;if((0,z2.alwaysValidSchema)(s,r))return;let i=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,ev.not)(i),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(i)}};lh.default=B2});var ch=E(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});var pl=We(),Jt=W(),G2=Nt(),ml=ee(),W2={message:"must NOT have additional properties",params:({params:t})=>(0,Jt._)`{additionalProperty: ${t.additionalProperty}}`},J2={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:W2,code(t){let{gen:e,schema:r,parentSchema:n,data:s,errsCount:i,it:o}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:l}=o;if(o.props=!0,l.removeAdditional!=="all"&&(0,ml.alwaysValidSchema)(o,r))return;let u=(0,pl.allSchemaProperties)(n.properties),c=(0,pl.allSchemaProperties)(n.patternProperties);f(),t.ok((0,Jt._)`${i} === ${G2.default.errors}`);function f(){e.forIn("key",s,g=>{!u.length&&!c.length?d(g):e.if(p(g),()=>d(g))})}function p(g){let S;if(u.length>8){let b=(0,ml.schemaRefOrVal)(o,n.properties,"properties");S=(0,pl.isOwnProperty)(e,b,g)}else u.length?S=(0,Jt.or)(...u.map(b=>(0,Jt._)`${g} === ${b}`)):S=Jt.nil;return c.length&&(S=(0,Jt.or)(S,...c.map(b=>(0,Jt._)`${(0,pl.usePattern)(t,b)}.test(${g})`))),(0,Jt.not)(S)}function h(g){e.code((0,Jt._)`delete ${s}[${g}]`)}function d(g){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){h(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,ml.alwaysValidSchema)(o,r)){let S=e.name("valid");l.removeAdditional==="failing"?(m(g,S,!1),e.if((0,Jt.not)(S),()=>{t.reset(),h(g)})):(m(g,S),a||e.if((0,Jt.not)(S),()=>e.break()))}}function m(g,S,b){let _={keyword:"additionalProperties",dataProp:g,dataPropType:ml.Type.Str};b===!1&&Object.assign(_,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(_,S)}}};uh.default=J2});var sv=E(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});var K2=ms(),rv=We(),fh=ee(),nv=ch(),Y2={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&nv.default.code(new K2.KeywordCxt(i,nv.default,"additionalProperties"));let o=(0,rv.allSchemaProperties)(r);for(let f of o)i.definedProperties.add(f);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=fh.mergeEvaluated.props(e,(0,fh.toHash)(o),i.props));let a=o.filter(f=>!(0,fh.alwaysValidSchema)(i,r[f]));if(a.length===0)return;let l=e.name("valid");for(let f of a)u(f)?c(f):(e.if((0,rv.propertyInData)(e,s,f,i.opts.ownProperties)),c(f),i.allErrors||e.else().var(l,!0),e.endIf()),t.it.definedProperties.add(f),t.ok(l);function u(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}function c(f){t.subschema({keyword:"properties",schemaProp:f,dataProp:f},l)}}};dh.default=Y2});var lv=E(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});var iv=We(),gl=W(),ov=ee(),av=ee(),X2={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:s,it:i}=t,{opts:o}=i,a=(0,iv.allSchemaProperties)(r),l=a.filter(m=>(0,ov.alwaysValidSchema)(i,r[m]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=o.strictSchema&&!o.allowMatchingProperties&&s.properties,c=e.name("valid");i.props!==!0&&!(i.props instanceof gl.Name)&&(i.props=(0,av.evaluatedPropsToName)(e,i.props));let{props:f}=i;p();function p(){for(let m of a)u&&h(m),i.allErrors?d(m):(e.var(c,!0),d(m),e.if(c))}function h(m){for(let g in u)new RegExp(m).test(g)&&(0,ov.checkStrictMode)(i,`property ${g} matches pattern ${m} (use allowMatchingProperties)`)}function d(m){e.forIn("key",n,g=>{e.if((0,gl._)`${(0,iv.usePattern)(t,m)}.test(${g})`,()=>{let S=l.includes(m);S||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:g,dataPropType:av.Type.Str},c),i.opts.unevaluated&&f!==!0?e.assign((0,gl._)`${f}[${g}]`,!0):!S&&!i.allErrors&&e.if((0,gl.not)(c),()=>e.break())})})}}};hh.default=X2});var uv=E(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});var Q2=ee(),Z2={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,Q2.alwaysValidSchema)(n,r)){t.fail();return}let s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};ph.default=Z2});var cv=E(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});var eV=We(),tV={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:eV.validateUnion,error:{message:"must match a schema in anyOf"}};mh.default=tV});var fv=E(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});var yl=W(),rV=ee(),nV={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,yl._)`{passingSchemas: ${t.passing}}`},sV={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:nV,code(t){let{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let i=r,o=e.let("valid",!1),a=e.let("passing",null),l=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(o,()=>t.reset(),()=>t.error(!0));function u(){i.forEach((c,f)=>{let p;(0,rV.alwaysValidSchema)(s,c)?e.var(l,!0):p=t.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},l),f>0&&e.if((0,yl._)`${l} && ${o}`).assign(o,!1).assign(a,(0,yl._)`[${a}, ${f}]`).else(),e.if(l,()=>{e.assign(o,!0),e.assign(a,f),p&&t.mergeEvaluated(p,yl.Name)})})}}};gh.default=sV});var dv=E(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});var iV=ee(),oV={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let s=e.name("valid");r.forEach((i,o)=>{if((0,iV.alwaysValidSchema)(n,i))return;let a=t.subschema({keyword:"allOf",schemaProp:o},s);t.ok(s),t.mergeEvaluated(a)})}};yh.default=oV});var mv=E(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});var _l=W(),pv=ee(),aV={message:({params:t})=>(0,_l.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,_l._)`{failingKeyword: ${t.ifClause}}`},lV={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:aV,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,pv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=hv(n,"then"),i=hv(n,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(l(),t.reset(),s&&i){let c=e.let("ifClause");t.setParams({ifClause:c}),e.if(a,u("then",c),u("else",c))}else s?e.if(a,u("then")):e.if((0,_l.not)(a),u("else"));t.pass(o,()=>t.error(!0));function l(){let c=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(c)}function u(c,f){return()=>{let p=t.subschema({keyword:c},a);e.assign(o,a),t.mergeValidEvaluated(p,o),f?e.assign(f,(0,_l._)`${c}`):t.setParams({ifClause:c})}}}};function hv(t,e){let r=t.schema[e];return r!==void 0&&!(0,pv.alwaysValidSchema)(t,r)}_h.default=lV});var gv=E(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});var uV=ee(),cV={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,uV.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Sh.default=cV});var yv=E(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});var fV=rh(),dV=Wb(),hV=nh(),pV=Kb(),mV=Yb(),gV=Zb(),yV=tv(),_V=ch(),SV=sv(),EV=lv(),bV=uv(),vV=cv(),wV=fv(),RV=dv(),OV=mv(),TV=gv();function $V(t=!1){let e=[bV.default,vV.default,wV.default,RV.default,OV.default,TV.default,yV.default,_V.default,gV.default,SV.default,EV.default];return t?e.push(dV.default,pV.default):e.push(fV.default,hV.default),e.push(mV.default),e}Eh.default=$V});var _v=E(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});var Le=W(),PV={message:({schemaCode:t})=>(0,Le.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Le._)`{format: ${t}}`},AV={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:PV,code(t,e){let{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:a}=t,{opts:l,errSchemaPath:u,schemaEnv:c,self:f}=a;if(!l.validateFormats)return;s?p():h();function p(){let d=r.scopeValue("formats",{ref:f.formats,code:l.code.formats}),m=r.const("fDef",(0,Le._)`${d}[${o}]`),g=r.let("fType"),S=r.let("format");r.if((0,Le._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(g,(0,Le._)`${m}.type || "string"`).assign(S,(0,Le._)`${m}.validate`),()=>r.assign(g,(0,Le._)`"string"`).assign(S,m)),t.fail$data((0,Le.or)(b(),_()));function b(){return l.strictSchema===!1?Le.nil:(0,Le._)`${o} && !${S}`}function _(){let y=c.$async?(0,Le._)`(${m}.async ? await ${S}(${n}) : ${S}(${n}))`:(0,Le._)`${S}(${n})`,R=(0,Le._)`(typeof ${S} == "function" ? ${y} : ${S}.test(${n}))`;return(0,Le._)`${S} && ${S} !== true && ${g} === ${e} && !${R}`}}function h(){let d=f.formats[i];if(!d){b();return}if(d===!0)return;let[m,g,S]=_(d);m===e&&t.pass(y());function b(){if(l.strictSchema===!1){f.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function _(R){let T=R instanceof RegExp?(0,Le.regexpCode)(R):l.code.formats?(0,Le._)`${l.code.formats}${(0,Le.getProperty)(i)}`:void 0,O=r.scopeValue("formats",{key:i,ref:R,code:T});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,Le._)`${O}.validate`]:["string",R,O]}function y(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!c.$async)throw new Error("async format in sync schema");return(0,Le._)`await ${S}(${n})`}return typeof g=="function"?(0,Le._)`${S}(${n})`:(0,Le._)`${S}.test(${n})`}}}};bh.default=AV});var Sv=E(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});var CV=_v(),IV=[CV.default];vh.default=IV});var Ev=E(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.contentVocabulary=Ss.metadataVocabulary=void 0;Ss.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ss.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var vv=E(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});var NV=Ab(),kV=zb(),xV=yv(),LV=Sv(),bv=Ev(),qV=[NV.default,kV.default,(0,xV.default)(),LV.default,bv.metadataVocabulary,bv.contentVocabulary];wh.default=qV});var Rh=E(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.DiscrError=void 0;var wv;(function(t){t.Tag="tag",t.Mapping="mapping"})(wv||(Sl.DiscrError=wv={}))});var Ov=E(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});var Es=W(),Oh=Rh(),Rv=$n(),jV=Rr(),DV=ee(),FV={message:({params:{discrError:t,tagName:e}})=>t===Oh.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Es._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},MV={keyword:"discriminator",type:"object",schemaType:"object",error:FV,code(t){let{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let l=e.let("valid",!1),u=e.const("tag",(0,Es._)`${r}${(0,Es.getProperty)(a)}`);e.if((0,Es._)`typeof ${u} == "string"`,()=>c(),()=>t.error(!1,{discrError:Oh.DiscrError.Tag,tag:u,tagName:a})),t.ok(l);function c(){let h=p();e.if(!1);for(let d in h)e.elseIf((0,Es._)`${u} === ${d}`),e.assign(l,f(h[d]));e.else(),t.error(!1,{discrError:Oh.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function f(h){let d=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:h},d);return t.mergeEvaluated(m,Es.Name),d}function p(){var h;let d={},m=S(s),g=!0;for(let y=0;y<o.length;y++){let R=o[y];if(R?.$ref&&!(0,DV.schemaHasRulesButRef)(R,i.self.RULES)){let O=R.$ref;if(R=Rv.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,O),R instanceof Rv.SchemaEnv&&(R=R.schema),R===void 0)throw new jV.default(i.opts.uriResolver,i.baseId,O)}let T=(h=R?.properties)===null||h===void 0?void 0:h[a];if(typeof T!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(m||S(R)),b(T,y)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return d;function S({required:y}){return Array.isArray(y)&&y.includes(a)}function b(y,R){if(y.const)_(y.const,R);else if(y.enum)for(let T of y.enum)_(T,R);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function _(y,R){if(typeof y!="string"||y in d)throw new Error(`discriminator: "${a}" values must be unique strings`);d[y]=R}}}};Th.default=MV});var Tv=E((l7,HV)=>{HV.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var bl=E((ve,$h)=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.MissingRefError=ve.ValidationError=ve.CodeGen=ve.Name=ve.nil=ve.stringify=ve.str=ve._=ve.KeywordCxt=ve.Ajv=void 0;var VV=qd(),zV=vv(),UV=Ov(),$v=Tv(),BV=["/properties"],El="http://json-schema.org/draft-07/schema",bs=class extends VV.default{_addVocabularies(){super._addVocabularies(),zV.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(UV.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema($v,BV):$v;this.addMetaSchema(e,El,!1),this.refs["http://json-schema.org/schema"]=El}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(El)?El:void 0)}};ve.Ajv=bs;$h.exports=ve=bs;$h.exports.Ajv=bs;Object.defineProperty(ve,"__esModule",{value:!0});ve.default=bs;var GV=ms();Object.defineProperty(ve,"KeywordCxt",{enumerable:!0,get:function(){return GV.KeywordCxt}});var vs=W();Object.defineProperty(ve,"_",{enumerable:!0,get:function(){return vs._}});Object.defineProperty(ve,"str",{enumerable:!0,get:function(){return vs.str}});Object.defineProperty(ve,"stringify",{enumerable:!0,get:function(){return vs.stringify}});Object.defineProperty(ve,"nil",{enumerable:!0,get:function(){return vs.nil}});Object.defineProperty(ve,"Name",{enumerable:!0,get:function(){return vs.Name}});Object.defineProperty(ve,"CodeGen",{enumerable:!0,get:function(){return vs.CodeGen}});var WV=ki();Object.defineProperty(ve,"ValidationError",{enumerable:!0,get:function(){return WV.default}});var JV=Rr();Object.defineProperty(ve,"MissingRefError",{enumerable:!0,get:function(){return JV.default}})});var Tr=E(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.checkMetadata=void 0;var KV=ee(),YV={keyword:"metadata",schemaType:"object",code(t){Pv(t);let{gen:e,schema:r,it:n}=t;if((0,KV.alwaysValidSchema)(n,r))return;let s=e.name("valid");t.subschema({keyword:"metadata",jtdMetadata:!0},s),t.ok(s)}};function Pv({it:t,keyword:e},r){if(t.jtdMetadata!==r)throw new Error(`JTD: "${e}" cannot be used in this schema location`)}Ji.checkMetadata=Pv;Ji.default=YV});var vl=E(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.hasRef=void 0;var Av=$n(),Ki=W(),XV=Rr(),Cv=Nt(),Iv=Dd(),QV=Tr(),ZV={keyword:"ref",schemaType:"string",code(t){(0,QV.checkMetadata)(t);let{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{schemaEnv:{root:o}}=i,a=e.name("valid");s.nullable?(e.var(a,(0,Ki._)`${r} === null`),e.if((0,Ki.not)(a),l)):(e.var(a,!1),l()),t.ok(a);function l(){var f;let p=(f=o.schema.definitions)===null||f===void 0?void 0:f[n];if(!p)throw new XV.default(i.opts.uriResolver,"",n,`No definition ${n}`);Ph(p)||!i.opts.inlineRefs?u(p):c(p)}function u(f){let p=Av.compileSchema.call(i.self,new Av.SchemaEnv({schema:f,root:o,schemaPath:`/definitions/${n}`})),h=(0,Iv.getValidate)(t,p),d=e.const("_errs",Cv.default.errors);(0,Iv.callRef)(t,h,p,p.$async),e.assign(a,(0,Ki._)`${d} === ${Cv.default.errors}`)}function c(f){let p=e.scopeValue("schema",i.opts.code.source===!0?{ref:f,code:(0,Ki.stringify)(f)}:{ref:f});t.subschema({schema:f,dataTypes:[],schemaPath:Ki.nil,topSchemaRef:p,errSchemaPath:`/definitions/${n}`},a)}}};function Ph(t){for(let e in t){let r;if(e==="ref"||typeof(r=t[e])=="object"&&Ph(r))return!0}return!1}Yi.hasRef=Ph;Yi.default=ZV});var Ch=E(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});var ez=/t|\s/i,tz=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,rz=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i,nz=[0,31,28,31,30,31,30,31,31,30,31,30,31];function kv(t,e){let r=t.split(ez);return r.length===2&&Nv(r[0])&&sz(r[1])||e&&r.length===1&&Nv(r[0])}Ah.default=kv;function Nv(t){let e=tz.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&(s<=nz[n]||n===2&&s===29&&(r%100===0?r%400===0:r%4===0))}function sz(t){let e=rz.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3],i=+(e[4]||0),o=+(e[5]||0);return r<=23&&n<=59&&s<=59||r-i===23&&n-o===59&&s===60}kv.code='require("ajv/dist/runtime/timestamp").default'});var ws=E(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.typeErrorParams=Xr.typeErrorMessage=Xr.typeError=void 0;var iz=W();function oz(t){return{message:e=>xv(e,t),params:e=>Lv(e,t)}}Xr.typeError=oz;function xv({parentSchema:t},e){return t?.nullable?`must be ${e} or null`:`must be ${e}`}Xr.typeErrorMessage=xv;function Lv({parentSchema:t},e){return(0,iz._)`{type: ${e}, nullable: ${!!t?.nullable}}`}Xr.typeErrorParams=Lv});var Ih=E(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.intRange=void 0;var Tt=W(),az=Ch(),lz=ee(),uz=Tr(),qv=ws();Rs.intRange={int8:[-128,127,3],uint8:[0,255,3],int16:[-32768,32767,5],uint16:[0,65535,5],int32:[-2147483648,2147483647,10],uint32:[0,4294967295,10]};var cz={message:t=>(0,qv.typeErrorMessage)(t,t.schema),params:t=>(0,qv.typeErrorParams)(t,t.schema)};function fz(t){let{gen:e,data:r,it:n}=t,{timestamp:s,allowDate:i}=n.opts;if(s==="date")return(0,Tt._)`${r} instanceof Date `;let o=(0,lz.useFunc)(e,az.default),a=i?(0,Tt._)`, true`:Tt.nil,l=(0,Tt._)`typeof ${r} == "string" && ${o}(${r}${a})`;return s==="string"?l:(0,Tt.or)((0,Tt._)`${r} instanceof Date`,l)}var dz={keyword:"type",schemaType:"string",error:cz,code(t){(0,uz.checkMetadata)(t);let{data:e,schema:r,parentSchema:n,it:s}=t,i;switch(r){case"boolean":case"string":i=(0,Tt._)`typeof ${e} == ${r}`;break;case"timestamp":{i=fz(t);break}case"float32":case"float64":i=(0,Tt._)`typeof ${e} == "number"`;break;default:{let o=r;if(i=(0,Tt._)`typeof ${e} == "number" && isFinite(${e}) && !(${e} % 1)`,!s.opts.int32range&&(o==="int32"||o==="uint32"))o==="uint32"&&(i=(0,Tt._)`${i} && ${e} >= 0`);else{let[a,l]=Rs.intRange[o];i=(0,Tt._)`${i} && ${e} >= ${a} && ${e} <= ${l}`}}}t.pass(n.nullable?(0,Tt.or)((0,Tt._)`${e} === null`,i):i)}};Rs.default=dz});var Ts=E(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.checkNullableObject=Os.checkNullable=void 0;var wl=W();function jv({gen:t,data:e,parentSchema:r},n=wl.nil){let s=t.name("valid");return r.nullable?(t.let(s,(0,wl._)`${e} === null`),n=(0,wl.not)(s)):t.let(s,!1),[s,n]}Os.checkNullable=jv;function hz(t,e){let[r,n]=jv(t,e);return[r,(0,wl._)`${n} && typeof ${t.data} == "object" && !Array.isArray(${t.data})`]}Os.checkNullableObject=hz});var Dv=E(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});var Qr=W(),pz=Tr(),mz=Ts(),gz={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Qr._)`{allowedValues: ${t}}`},yz={keyword:"enum",schemaType:"array",error:gz,code(t){(0,pz.checkMetadata)(t);let{gen:e,data:r,schema:n,schemaValue:s,parentSchema:i,it:o}=t;if(n.length===0)throw new Error("enum must have non-empty array");if(n.length!==new Set(n).size)throw new Error("enum items must be unique");let a,l=(0,Qr._)`typeof ${r} == "string"`;if(n.length>=o.opts.loopEnum){let c;[a,c]=(0,mz.checkNullable)(t,l),e.if(c,u)}else{if(!Array.isArray(n))throw new Error("ajv implementation error");a=(0,Qr.and)(l,(0,Qr.or)(...n.map(c=>(0,Qr._)`${r} === ${c}`))),i.nullable&&(a=(0,Qr.or)((0,Qr._)`${r} === null`,a))}t.pass(a);function u(){e.forOf("v",s,c=>e.if((0,Qr._)`${a} = ${r} === ${c}`,()=>e.break()))}}};Nh.default=yz});var Mv=E(kh=>{"use strict";Object.defineProperty(kh,"__esModule",{value:!0});var _z=ee(),Sz=We(),Fv=W(),Ez=Tr(),bz=Ts(),vz=ws(),wz={keyword:"elements",schemaType:"object",error:(0,vz.typeError)("array"),code(t){(0,Ez.checkMetadata)(t);let{gen:e,data:r,schema:n,it:s}=t;if((0,_z.alwaysValidSchema)(s,n))return;let[i]=(0,bz.checkNullable)(t);e.if((0,Fv.not)(i),()=>e.if((0,Fv._)`Array.isArray(${r})`,()=>e.assign(i,(0,Sz.validateArray)(t)),()=>t.error())),t.ok(i)}};kh.default=wz});var Lh=E(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.validateProperties=Zr.error=void 0;var xh=We(),Hv=ee(),$r=W(),Rz=Tr(),Oz=Ts(),Vv=ws(),$s;(function(t){t.Additional="additional",t.Missing="missing"})($s||($s={}));Zr.error={message:t=>{let{params:e}=t;return e.propError?e.propError===$s.Additional?"must NOT have additional properties":`must have property '${e.missingProperty}'`:(0,Vv.typeErrorMessage)(t,"object")},params:t=>{let{params:e}=t;return e.propError?e.propError===$s.Additional?(0,$r._)`{error: ${e.propError}, additionalProperty: ${e.additionalProperty}}`:(0,$r._)`{error: ${e.propError}, missingProperty: ${e.missingProperty}}`:(0,Vv.typeErrorParams)(t,"object")}};var Tz={keyword:"properties",schemaType:"object",error:Zr.error,code:zv};function zv(t){(0,Rz.checkMetadata)(t);let{gen:e,data:r,parentSchema:n,it:s}=t,{additionalProperties:i,nullable:o}=n;if(s.jtdDiscriminator&&o)throw new Error("JTD: nullable inside discriminator mapping");if(h())throw new Error("JTD: properties and optionalProperties have common members");let[a,l]=d("properties"),[u,c]=d("optionalProperties");if(l.length===0&&c.length===0&&i)return;let[f,p]=s.jtdDiscriminator===void 0?(0,Oz.checkNullableObject)(t,r):[e.let("valid",!1),!0];e.if(p,()=>e.assign(f,!0).block(()=>{m(l,"properties",!0),m(c,"optionalProperties"),i||S()})),t.pass(f);function h(){let _=n.properties,y=n.optionalProperties;if(!(_&&y))return!1;for(let R in _)if(Object.prototype.hasOwnProperty.call(y,R))return!0;return!1}function d(_){let y=n[_],R=y?(0,xh.allSchemaProperties)(y):[];if(s.jtdDiscriminator&&R.some(O=>O===s.jtdDiscriminator))throw new Error(`JTD: discriminator tag used in ${_}`);let T=R.filter(O=>!(0,Hv.alwaysValidSchema)(s,y[O]));return[R,T]}function m(_,y,R){let T=e.var("valid");for(let w of _)e.if((0,xh.propertyInData)(e,r,w,s.opts.ownProperties),()=>g(w,y,T),()=>O(w)),t.ok(T);function O(w){R?(e.assign(T,!1),t.error(!1,{propError:$s.Missing,missingProperty:w},{schemaPath:w})):e.assign(T,!0)}}function g(_,y,R){t.subschema({keyword:y,schemaProp:_,dataProp:_},R)}function S(){e.forIn("key",r,_=>{let y=b(_,a,"properties",s.jtdDiscriminator),R=b(_,u,"optionalProperties"),T=y===!0?R:R===!0?y:(0,$r.and)(y,R);e.if(T,()=>{s.opts.removeAdditional?e.code((0,$r._)`delete ${r}[${_}]`):(t.error(!1,{propError:$s.Additional,additionalProperty:_},{instancePath:_,parentSchema:!0}),s.opts.allErrors||e.break())})})}function b(_,y,R,T){let O;if(y.length>8){let w=(0,Hv.schemaRefOrVal)(s,n[R],R);O=(0,$r.not)((0,xh.isOwnProperty)(e,w,_)),T!==void 0&&(O=(0,$r.and)(O,(0,$r._)`${_} !== ${T}`))}else if(y.length||T!==void 0){let w=T===void 0?y:[T].concat(y);O=(0,$r.and)(...w.map($=>(0,$r._)`${_} !== ${$}`))}else O=!0;return O}}Zr.validateProperties=zv;Zr.default=Tz});var Bv=E(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});var Uv=Lh(),$z={keyword:"optionalProperties",schemaType:"object",error:Uv.error,code(t){t.parentSchema.properties||(0,Uv.validateProperties)(t)}};qh.default=$z});var Wv=E(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});var In=W(),Pz=Tr(),Az=Ts(),Gv=ws(),Rl=Rh(),Cz={message:t=>{let{schema:e,params:r}=t;return r.discrError?r.discrError===Rl.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in mapping`:(0,Gv.typeErrorMessage)(t,"object")},params:t=>{let{schema:e,params:r}=t;return r.discrError?(0,In._)`{error: ${r.discrError}, tag: ${e}, tagValue: ${r.tag}}`:(0,Gv.typeErrorParams)(t,"object")}},Iz={keyword:"discriminator",schemaType:"string",implements:["mapping"],error:Cz,code(t){(0,Pz.checkMetadata)(t);let{gen:e,data:r,schema:n,parentSchema:s}=t,[i,o]=(0,Az.checkNullableObject)(t,r);e.if(o),a(),e.elseIf((0,In.not)(i)),t.error(),e.endIf(),t.ok(i);function a(){let c=e.const("tag",(0,In._)`${r}${(0,In.getProperty)(n)}`);e.if((0,In._)`${c} === undefined`),t.error(!1,{discrError:Rl.DiscrError.Tag,tag:c}),e.elseIf((0,In._)`typeof ${c} == "string"`),l(c),e.else(),t.error(!1,{discrError:Rl.DiscrError.Tag,tag:c},{instancePath:n}),e.endIf()}function l(c){e.if(!1);for(let f in s.mapping)e.elseIf((0,In._)`${c} === ${f}`),e.assign(i,u(f));e.else(),t.error(!1,{discrError:Rl.DiscrError.Mapping,tag:c},{instancePath:n,schemaPath:"mapping",parentSchema:!0}),e.endIf()}function u(c){let f=e.name("valid");return t.subschema({keyword:"mapping",schemaProp:c,jtdDiscriminator:n},f),f}}};jh.default=Iz});var Kv=E(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});var Jv=ee(),Ol=W(),Nz=Tr(),kz=Ts(),xz=ws(),Lz={keyword:"values",schemaType:"object",error:(0,xz.typeError)("object"),code(t){(0,Nz.checkMetadata)(t);let{gen:e,data:r,schema:n,it:s}=t,[i,o]=(0,kz.checkNullableObject)(t,r);(0,Jv.alwaysValidSchema)(s,n)?e.if((0,Ol.not)((0,Ol.or)(o,i)),()=>t.error()):(e.if(o),e.assign(i,a()),e.elseIf((0,Ol.not)(i)),t.error(),e.endIf()),t.ok(i);function a(){let l=e.name("valid");if(s.allErrors){let c=e.let("valid",!0);return u(()=>e.assign(c,!1)),c}return e.var(l,!0),u(()=>e.break()),l;function u(c){e.forIn("key",r,f=>{t.subschema({keyword:"values",dataProp:f,dataPropType:Jv.Type.Str},l),e.if((0,Ol.not)(l),c)})}}}};Dh.default=Lz});var Yv=E(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});var qz=We(),jz={keyword:"union",schemaType:"array",trackErrors:!0,code:qz.validateUnion,error:{message:"must match a schema in union"}};Fh.default=jz});var Xv=E(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});var Dz=vl(),Fz=Ih(),Mz=Dv(),Hz=Mv(),Vz=Lh(),zz=Bv(),Uz=Wv(),Bz=Kv(),Gz=Yv(),Wz=Tr(),Jz=["definitions",Dz.default,Fz.default,Mz.default,Hz.default,Vz.default,zz.default,Uz.default,Bz.default,Gz.default,Wz.default,{keyword:"additionalProperties",schemaType:"boolean"},{keyword:"nullable",schemaType:"boolean"}];Mh.default=Jz});var tw=E(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});var Pr=t=>{let e={nullable:{type:"boolean"},metadata:{optionalProperties:{union:{elements:{ref:"schema"}}},additionalProperties:!0}};return t&&(e.definitions={values:{ref:"schema"}}),e},Kz=t=>({optionalProperties:Pr(t)}),Yz=t=>({properties:{ref:{type:"string"}},optionalProperties:Pr(t)}),Xz=t=>({properties:{type:{enum:["boolean","timestamp","string","float32","float64","int8","uint8","int16","uint16","int32","uint32"]}},optionalProperties:Pr(t)}),Qz=t=>({properties:{enum:{elements:{type:"string"}}},optionalProperties:Pr(t)}),Zz=t=>({properties:{elements:{ref:"schema"}},optionalProperties:Pr(t)}),Zv=t=>({properties:{properties:{values:{ref:"schema"}}},optionalProperties:{optionalProperties:{values:{ref:"schema"}},additionalProperties:{type:"boolean"},...Pr(t)}}),ew=t=>({properties:{optionalProperties:{values:{ref:"schema"}}},optionalProperties:{additionalProperties:{type:"boolean"},...Pr(t)}}),eU=t=>({properties:{discriminator:{type:"string"},mapping:{values:{metadata:{union:[Zv(!1),ew(!1)]}}}},optionalProperties:Pr(t)}),tU=t=>({properties:{values:{ref:"schema"}},optionalProperties:Pr(t)}),Qv=t=>({metadata:{union:[Kz,Yz,Xz,Qz,Zz,Zv,ew,eU,tU].map(e=>e(t))}}),rU={definitions:{schema:Qv(!1)},...Qv(!0)};Hh.default=rU});var Vh=E(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.jtdForms=void 0;Tl.jtdForms=["elements","values","discriminator","properties","optionalProperties","enum","type","ref"]});var nw=E(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});var zh=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,nU={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function rw(t){return zh.lastIndex=0,'"'+(zh.test(t)?t.replace(zh,e=>{let r=nU[e];return typeof r=="string"?r:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}):t)+'"'}Uh.default=rw;rw.code='require("ajv/dist/runtime/quote").default'});var uw=E(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});var sU=Vh(),iw=$n(),ie=W(),iU=Rr(),Ee=Nt(),oU=We(),aU=vl(),lU=ee(),uU=nw(),cU={elements:dU,values:hU,discriminator:pU,properties:sw,optionalProperties:sw,enum:Xi,type:mU,ref:yU};function ow(t,e){let r=iw.getCompilingSchema.call(this,t);if(r)return r;let{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new ie.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a=o.scopeName("serialize"),l={self:this,gen:o,schema:t.schema,schemaEnv:t,definitions:e,data:Ee.default.data},u;try{this._compilations.add(t),t.serializeName=a,o.func(a,Ee.default.data,!1,()=>{o.let(Ee.default.json,(0,ie.str)``),Qi(l),o.return(Ee.default.json)}),o.optimize(this.opts.code.optimize);let c=o.toString();u=`${o.scopeRefs(Ee.default.scope)}return ${c}`;let p=new Function(`${Ee.default.scope}`,u)(this.scope.get());this.scope.value(a,{ref:p}),t.serialize=p}catch(c){throw u&&this.logger.error("Error compiling serializer, function code:",u),delete t.serialize,delete t.serializeName,c}finally{this._compilations.delete(t)}return t}Gh.default=ow;function Qi(t){let e;for(let r of sU.jtdForms)if(r in t.schema){e=r;break}fU(t,e?cU[e]:SU)}function fU(t,e){let{gen:r,schema:n,data:s}=t;if(!n.nullable)return e(t);r.if((0,ie._)`${s} === undefined || ${s} === null`,()=>r.add(Ee.default.json,(0,ie._)`"null"`),()=>e(t))}function dU(t){let{gen:e,schema:r,data:n}=t;e.add(Ee.default.json,(0,ie.str)`[`);let s=e.let("first",!0);e.forOf("el",n,i=>{Bh(t,s),Qi({...t,schema:r.elements,data:i})}),e.add(Ee.default.json,(0,ie.str)`]`)}function hU(t){let{gen:e,schema:r,data:n}=t;e.add(Ee.default.json,(0,ie.str)`{`);let s=e.let("first",!0);e.forIn("key",n,i=>aw(t,i,r.values,s)),e.add(Ee.default.json,(0,ie.str)`}`)}function aw(t,e,r,n){let{gen:s,data:i}=t;Bh(t,n),Xi({...t,data:e}),s.add(Ee.default.json,(0,ie.str)`:`);let o=s.const("value",(0,ie._)`${i}${(0,ie.getProperty)(e)}`);Qi({...t,schema:r,data:o})}function pU(t){let{gen:e,schema:r,data:n}=t,{discriminator:s}=r;e.add(Ee.default.json,(0,ie.str)`{${JSON.stringify(s)}:`);let i=e.const("tag",(0,ie._)`${n}${(0,ie.getProperty)(s)}`);Xi({...t,data:i}),e.if(!1);for(let o in r.mapping){e.elseIf((0,ie._)`${i} === ${o}`);let a=r.mapping[o];lw({...t,schema:a},s)}e.endIf(),e.add(Ee.default.json,(0,ie.str)`}`)}function sw(t){let{gen:e}=t;e.add(Ee.default.json,(0,ie.str)`{`),lw(t),e.add(Ee.default.json,(0,ie.str)`}`)}function lw(t,e){let{gen:r,schema:n,data:s}=t,{properties:i,optionalProperties:o}=n,a=p(i),l=p(o),u=h(a.concat(l)),c=!e,f;for(let S of a)c?c=!1:r.add(Ee.default.json,(0,ie.str)`,`),m(S,i[S],d(S));c&&(f=r.let("first",!0));for(let S of l){let b=d(S);r.if((0,ie.and)((0,ie._)`${b} !== undefined`,(0,oU.isOwnProperty)(r,s,S)),()=>{Bh(t,f),m(S,o[S],b)})}n.additionalProperties&&r.forIn("key",s,S=>r.if(g(S,u),()=>aw(t,S,{},f)));function p(S){return S?Object.keys(S):[]}function h(S){if(e&&S.push(e),new Set(S).size!==S.length)throw new Error("JTD: properties/optionalProperties/disciminator overlap");return S}function d(S){return r.const("value",(0,ie._)`${s}${(0,ie.getProperty)(S)}`)}function m(S,b,_){r.add(Ee.default.json,(0,ie.str)`${JSON.stringify(S)}:`),Qi({...t,schema:b,data:_})}function g(S,b){return b.length?(0,ie.and)(...b.map(_=>(0,ie._)`${S} !== ${_}`)):!0}}function mU(t){let{gen:e,schema:r,data:n}=t;switch(r.type){case"boolean":e.add(Ee.default.json,(0,ie._)`${n} ? "true" : "false"`);break;case"string":Xi(t);break;case"timestamp":e.if((0,ie._)`${n} instanceof Date`,()=>e.add(Ee.default.json,(0,ie._)`'"' + ${n}.toISOString() + '"'`),()=>Xi(t));break;default:gU(t)}}function Xi({gen:t,data:e}){t.add(Ee.default.json,(0,ie._)`${(0,lU.useFunc)(t,uU.default)}(${e})`)}function gU({gen:t,data:e}){t.add(Ee.default.json,(0,ie._)`"" + ${e}`)}function yU(t){let{gen:e,self:r,data:n,definitions:s,schema:i,schemaEnv:o}=t,{ref:a}=i,l=s[a];if(!l)throw new iU.default(r.opts.uriResolver,"",a,`No definition ${a}`);if(!(0,aU.hasRef)(l))return Qi({...t,schema:l});let{root:u}=o,c=ow.call(r,new iw.SchemaEnv({schema:l,root:u}),s);e.add(Ee.default.json,(0,ie._)`${_U(e,c)}(${n})`)}function _U(t,e){return e.serialize?t.scopeValue("serialize",{ref:e.serialize}):(0,ie._)`${t.scopeValue("wrapper",{ref:e})}.serialize`}function SU({gen:t,data:e}){t.add(Ee.default.json,(0,ie._)`JSON.stringify(${e})`)}function Bh({gen:t},e){e?t.if(e,()=>t.assign(e,!1),()=>t.add(Ee.default.json,(0,ie.str)`,`)):t.add(Ee.default.json,(0,ie.str)`,`)}});var fw=E(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.parseJsonString=tn.parseJsonNumber=tn.parseJson=void 0;var EU=/position\s(\d+)(?: \(line \d+ column \d+\))?$/;function Ar(t,e){let r;Ar.message=void 0;let n;e&&(t=t.slice(e));try{return Ar.position=e+t.length,JSON.parse(t)}catch(s){if(n=EU.exec(s.message),!n){Ar.message="unexpected end";return}r=+n[1];let i=t[r];t=t.slice(0,r),Ar.position=e+r;try{return JSON.parse(t)}catch{Ar.message=`unexpected token ${i}`;return}}}tn.parseJson=Ar;Ar.message=void 0;Ar.position=0;Ar.code='require("ajv/dist/runtime/parseJson").parseJson';function Cr(t,e,r){let n="",s;if(Cr.message=void 0,t[e]==="-"&&(n+="-",e++),t[e]==="0")n+="0",e++;else if(!i(r)){o();return}if(r)return Cr.position=e,+n;if(t[e]==="."&&(n+=".",e++,!i())){o();return}if(s=t[e],(s==="e"||s==="E")&&(n+="e",e++,s=t[e],(s==="+"||s==="-")&&(n+=s,e++),!i())){o();return}return Cr.position=e,+n;function i(a){let l=!1;for(;s=t[e],s>="0"&&s<="9"&&(a===void 0||a-- >0);)l=!0,n+=s,e++;return l}function o(){Cr.position=e,Cr.message=e<t.length?`unexpected token ${t[e]}`:"unexpected end"}}tn.parseJsonNumber=Cr;Cr.message=void 0;Cr.position=0;Cr.code='require("ajv/dist/runtime/parseJson").parseJsonNumber';var cw={b:"\b",f:"\f",n:`
59
+ `,r:"\r",t:" ",'"':'"',"/":"/","\\":"\\"},bU=97,vU=48;function en(t,e){let r="",n;for(en.message=void 0;n=t[e++],n!=='"';)if(n==="\\")if(n=t[e],n in cw)r+=cw[n],e++;else if(n==="u"){e++;let i=4,o=0;for(;i--;){if(o<<=4,n=t[e],n===void 0){s("unexpected end");return}if(n=n.toLowerCase(),n>="a"&&n<="f")o+=n.charCodeAt(0)-bU+10;else if(n>="0"&&n<="9")o+=n.charCodeAt(0)-vU;else{s(`unexpected token ${n}`);return}e++}r+=String.fromCharCode(o)}else{s(`unexpected token ${n}`);return}else if(n===void 0){s("unexpected end");return}else if(n.charCodeAt(0)>=32)r+=n;else{s(`unexpected token ${n}`);return}return en.position=e,r;function s(i){en.position=e,en.message=i}}tn.parseJsonString=en;en.message=void 0;en.position=0;en.code='require("ajv/dist/runtime/parseJson").parseJsonString'});var vw=E(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});var wU=Vh(),mw=$n(),B=W(),RU=Rr(),se=Nt(),OU=We(),TU=vl(),$U=Ih(),Kh=fw(),gw=ee(),PU=Ch(),AU={elements:kU,values:xU,discriminator:qU,properties:dw,optionalProperties:dw,enum:DU,type:jU,ref:FU};function yw(t,e){let r=mw.getCompilingSchema.call(this,t);if(r)return r;let{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new B.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a=o.scopeName("parse"),l={self:this,gen:o,schema:t.schema,schemaEnv:t,definitions:e,data:se.default.data,parseName:a,char:o.name("c")},u;try{this._compilations.add(t),t.parseName=a,CU(l),o.optimize(this.opts.code.optimize);let c=o.toString();u=`${o.scopeRefs(se.default.scope)}return ${c}`;let p=new Function(`${se.default.scope}`,u)(this.scope.get());this.scope.value(a,{ref:p}),t.parse=p}catch(c){throw u&&this.logger.error("Error compiling parser, function code:",u),delete t.parse,delete t.parseName,c}finally{this._compilations.delete(t)}return t}ep.default=yw;var Jh=(0,B._)`undefined`;function CU(t){let{gen:e,parseName:r,char:n}=t;e.func(r,(0,B._)`${se.default.json}, ${se.default.jsonPos}, ${se.default.jsonPart}`,!1,()=>{e.let(se.default.data),e.let(n),e.assign((0,B._)`${r}.message`,Jh),e.assign((0,B._)`${r}.position`,Jh),e.assign(se.default.jsonPos,(0,B._)`${se.default.jsonPos} || 0`),e.const(se.default.jsonLen,(0,B._)`${se.default.json}.length`),$l(t),Zh(t),e.if(se.default.jsonPart,()=>{e.assign((0,B._)`${r}.position`,se.default.jsonPos),e.return(se.default.data)}),e.if((0,B._)`${se.default.jsonPos} === ${se.default.jsonLen}`,()=>e.return(se.default.data)),Ps(t)})}function $l(t){let e;for(let r of wU.jtdForms)if(r in t.schema){e=r;break}e?NU(t,AU[e]):Xh(t)}var IU=pw(!0,pw(!1,Ps));function NU(t,e){let{gen:r,schema:n,data:s}=t;if(!n.nullable)return e(t);Zi(t,"null",e,()=>r.assign(s,null))}function kU(t){let{gen:e,schema:r,data:n}=t;cr(t,"[");let s=e.let("i",0);e.assign(n,(0,B._)`[]`),Yh(t,"]",()=>{let i=e.let("el");$l({...t,schema:r.elements,data:i}),e.assign((0,B._)`${n}[${s}++]`,i)})}function xU(t){let{gen:e,schema:r,data:n}=t;cr(t,"{"),e.assign(n,(0,B._)`{}`),Yh(t,"}",()=>LU(t,r.values))}function Yh(t,e,r){_w(t,e,r),cr(t,e)}function _w(t,e,r){let{gen:n}=t;n.for((0,B._)`;${se.default.jsonPos}<${se.default.jsonLen} && ${Pl(1)}!==${e};`,()=>{r(),Zi(t,",",()=>n.break(),s)});function s(){Zi(t,e,()=>{},Ps)}}function LU(t,e){let{gen:r}=t,n=r.let("key");Nn({...t,data:n}),cr(t,":"),Ew(t,n,e)}function qU(t){let{gen:e,data:r,schema:n}=t,{discriminator:s,mapping:i}=n;cr(t,"{"),e.assign(r,(0,B._)`{}`);let o=e.const("pos",se.default.jsonPos),a=e.let("value"),l=e.let("tag");_w(t,"}",()=>{let u=e.let("key");Nn({...t,data:u}),cr(t,":"),e.if((0,B._)`${u} === ${s}`,()=>{Nn({...t,data:l}),e.assign((0,B._)`${r}[${u}]`,l),e.break()},()=>Xh({...t,data:a}))}),e.assign(se.default.jsonPos,o),e.if((0,B._)`${l} === undefined`),Ir(t,(0,B.str)`discriminator tag not found`);for(let u in i)e.elseIf((0,B._)`${l} === ${u}`),Sw({...t,schema:i[u]},s);e.else(),Ir(t,(0,B.str)`discriminator value not in schema`),e.endIf()}function dw(t){let{gen:e,data:r}=t;cr(t,"{"),e.assign(r,(0,B._)`{}`),Sw(t)}function Sw(t,e){let{gen:r,schema:n,data:s}=t,{properties:i,optionalProperties:o,additionalProperties:a}=n;if(Yh(t,"}",()=>{let l=r.let("key");if(Nn({...t,data:l}),cr(t,":"),r.if(!1),hw(t,l,i),hw(t,l,o),e){r.elseIf((0,B._)`${l} === ${e}`);let u=r.let("tag");Nn({...t,data:u})}r.else(),a?Xh({...t,data:(0,B._)`${s}[${l}]`}):Ir(t,(0,B.str)`property ${l} not allowed`),r.endIf()}),i){let l=(0,OU.hasPropFunc)(r),u=(0,B.and)(...Object.keys(i).map(c=>(0,B._)`${l}.call(${s}, ${c})`));r.if((0,B.not)(u),()=>Ir(t,(0,B.str)`missing required properties`))}}function hw(t,e,r={}){let{gen:n}=t;for(let s in r)n.elseIf((0,B._)`${e} === ${s}`),Ew(t,e,r[s])}function Ew(t,e,r){$l({...t,schema:r,data:(0,B._)`${t.data}[${e}]`})}function jU(t){let{gen:e,schema:r,data:n,self:s}=t;switch(r.type){case"boolean":IU(t);break;case"string":Nn(t);break;case"timestamp":{Nn(t);let i=(0,gw.useFunc)(e,PU.default),{allowDate:o,parseDate:a}=s.opts,l=o?(0,B._)`!${i}(${n}, true)`:(0,B._)`!${i}(${n})`,u=a?(0,B.or)(l,(0,B._)`(${n} = new Date(${n}), false)`,(0,B._)`isNaN(${n}.valueOf())`):l;e.if(u,()=>Ir(t,(0,B.str)`invalid timestamp`));break}case"float32":case"float64":Wh(t);break;default:{let i=r.type;if(!s.opts.int32range&&(i==="int32"||i==="uint32"))Wh(t,16),i==="uint32"&&e.if((0,B._)`${n} < 0`,()=>Ir(t,(0,B.str)`integer out of range`));else{let[o,a,l]=$U.intRange[i];Wh(t,l),e.if((0,B._)`${n} < ${o} || ${n} > ${a}`,()=>Ir(t,(0,B.str)`integer out of range`))}}}}function Nn(t){cr(t,'"'),Qh(t,Kh.parseJsonString)}function DU(t){let{gen:e,data:r,schema:n}=t,s=n.enum;cr(t,'"'),e.if(!1);for(let i of s){let o=JSON.stringify(i).slice(1);e.elseIf((0,B._)`${Pl(o.length)} === ${o}`),e.assign(r,(0,B.str)`${i}`),e.add(se.default.jsonPos,o.length)}e.else(),Ps(t),e.endIf()}function Wh(t,e){let{gen:r}=t;Zh(t),r.if((0,B._)`"-0123456789".indexOf(${Pl(1)}) < 0`,()=>Ps(t),()=>Qh(t,Kh.parseJsonNumber,e))}function pw(t,e){return r=>{let{gen:n,data:s}=r;Zi(r,`${t}`,()=>e(r),()=>n.assign(s,t))}}function FU(t){let{gen:e,self:r,definitions:n,schema:s,schemaEnv:i}=t,{ref:o}=s,a=n[o];if(!a)throw new RU.default(r.opts.uriResolver,"",o,`No definition ${o}`);if(!(0,TU.hasRef)(a))return $l({...t,schema:a});let{root:l}=i,u=yw.call(r,new mw.SchemaEnv({schema:a,root:l}),n);bw(t,MU(e,u),!0)}function MU(t,e){return e.parse?t.scopeValue("parse",{ref:e.parse}):(0,B._)`${t.scopeValue("wrapper",{ref:e})}.parse`}function Xh(t){Qh(t,Kh.parseJson)}function Qh(t,e,r){bw(t,(0,gw.useFunc)(t.gen,e),r)}function bw(t,e,r){let{gen:n,data:s}=t;n.assign(s,(0,B._)`${e}(${se.default.json}, ${se.default.jsonPos}${r?(0,B._)`, ${r}`:B.nil})`),n.assign(se.default.jsonPos,(0,B._)`${e}.position`),n.if((0,B._)`${s} === undefined`,()=>Ir(t,(0,B._)`${e}.message`))}function cr(t,e){Zi(t,e,Ps)}function Zi(t,e,r,n){let{gen:s}=t,i=e.length;Zh(t),s.if((0,B._)`${Pl(i)} === ${e}`,()=>{s.add(se.default.jsonPos,i),n?.(t)},()=>r(t))}function Zh({gen:t,char:e}){t.code((0,B._)`while((${e}=${se.default.json}[${se.default.jsonPos}],${e}===" "||${e}==="\\n"||${e}==="\\r"||${e}==="\\t"))${se.default.jsonPos}++;`)}function Pl(t){return t===1?(0,B._)`${se.default.json}[${se.default.jsonPos}]`:(0,B._)`${se.default.json}.slice(${se.default.jsonPos}, ${se.default.jsonPos}+${t})`}function Ps(t){Ir(t,(0,B._)`"unexpected token " + ${se.default.json}[${se.default.jsonPos}]`)}function Ir({gen:t,parseName:e},r){t.assign((0,B._)`${e}.message`,r),t.assign((0,B._)`${e}.position`,se.default.jsonPos),t.return(Jh)}});var np=E((we,rp)=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.MissingRefError=we.ValidationError=we.CodeGen=we.Name=we.nil=we.stringify=we.str=we._=we.KeywordCxt=we.Ajv=void 0;var HU=qd(),VU=Xv(),zU=tw(),UU=uw(),BU=vw(),tp="JTD-meta-schema",As=class extends HU.default{constructor(e={}){super({...e,jtd:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(VU.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema(),this.opts.meta&&this.addMetaSchema(zU.default,tp,!1)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(tp)?tp:void 0)}compileSerializer(e){let r=this._addSchema(e);return r.serialize||this._compileSerializer(r)}compileParser(e){let r=this._addSchema(e);return r.parse||this._compileParser(r)}_compileSerializer(e){if(UU.default.call(this,e,e.schema.definitions||{}),!e.serialize)throw new Error("ajv implementation error");return e.serialize}_compileParser(e){if(BU.default.call(this,e,e.schema.definitions||{}),!e.parse)throw new Error("ajv implementation error");return e.parse}};we.Ajv=As;rp.exports=we=As;rp.exports.Ajv=As;Object.defineProperty(we,"__esModule",{value:!0});we.default=As;var GU=ms();Object.defineProperty(we,"KeywordCxt",{enumerable:!0,get:function(){return GU.KeywordCxt}});var Cs=W();Object.defineProperty(we,"_",{enumerable:!0,get:function(){return Cs._}});Object.defineProperty(we,"str",{enumerable:!0,get:function(){return Cs.str}});Object.defineProperty(we,"stringify",{enumerable:!0,get:function(){return Cs.stringify}});Object.defineProperty(we,"nil",{enumerable:!0,get:function(){return Cs.nil}});Object.defineProperty(we,"Name",{enumerable:!0,get:function(){return Cs.Name}});Object.defineProperty(we,"CodeGen",{enumerable:!0,get:function(){return Cs.CodeGen}});var WU=ki();Object.defineProperty(we,"ValidationError",{enumerable:!0,get:function(){return WU.default}});var JU=Rr();Object.defineProperty(we,"MissingRefError",{enumerable:!0,get:function(){return JU.default}})});var sp=E((A7,ww)=>{"use strict";var KU=il();ww.exports=Object.freeze({coerceTypes:"array",useDefaults:!0,removeAdditional:!0,uriResolver:KU,addUsedSchema:!1,allErrors:!1})});var Al=E(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.formatNames=dr.fastFormats=dr.fullFormats=void 0;function fr(t,e){return{validate:t,compare:e}}dr.fullFormats={date:fr($w,lp),time:fr(op(!0),up),"date-time":fr(Rw(!0),Aw),"iso-time":fr(op(),Pw),"iso-date-time":fr(Rw(),Cw),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:t4,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:l4,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:r4,int32:{type:"number",validate:i4},int64:{type:"number",validate:o4},float:{type:"number",validate:Tw},double:{type:"number",validate:Tw},password:!0,binary:!0};dr.fastFormats={...dr.fullFormats,date:fr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,lp),time:fr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,up),"date-time":fr(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Aw),"iso-time":fr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Pw),"iso-date-time":fr(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Cw),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};dr.formatNames=Object.keys(dr.fullFormats);function YU(t){return t%4===0&&(t%100!==0||t%400===0)}var XU=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,QU=[0,31,28,31,30,31,30,31,31,30,31,30,31];function $w(t){let e=XU.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&YU(r)?29:QU[n])}function lp(t,e){if(t&&e)return t>e?1:t<e?-1:0}var ip=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function op(t){return function(r){let n=ip.exec(r);if(!n)return!1;let s=+n[1],i=+n[2],o=+n[3],a=n[4],l=n[5]==="-"?-1:1,u=+(n[6]||0),c=+(n[7]||0);if(u>23||c>59||t&&!a)return!1;if(s<=23&&i<=59&&o<60)return!0;let f=i-c*l,p=s-u*l-(f<0?1:0);return(p===23||p===-1)&&(f===59||f===-1)&&o<61}}function up(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function Pw(t,e){if(!(t&&e))return;let r=ip.exec(t),n=ip.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var ap=/t|\s/i;function Rw(t){let e=op(t);return function(n){let s=n.split(ap);return s.length===2&&$w(s[0])&&e(s[1])}}function Aw(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function Cw(t,e){if(!(t&&e))return;let[r,n]=t.split(ap),[s,i]=e.split(ap),o=lp(r,s);if(o!==void 0)return o||up(n,i)}var ZU=/\/|:/,e4=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function t4(t){return ZU.test(t)&&e4.test(t)}var Ow=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function r4(t){return Ow.lastIndex=0,Ow.test(t)}var n4=-(2**31),s4=2**31-1;function i4(t){return Number.isInteger(t)&&t<=s4&&t>=n4}function o4(t){return Number.isInteger(t)}function Tw(){return!0}var a4=/[^\\]\\Z/;function l4(t){if(a4.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Iw=E(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.formatLimitDefinition=void 0;var u4=bl(),Kt=W(),rn=Kt.operators,Cl={formatMaximum:{okStr:"<=",ok:rn.LTE,fail:rn.GT},formatMinimum:{okStr:">=",ok:rn.GTE,fail:rn.LT},formatExclusiveMaximum:{okStr:"<",ok:rn.LT,fail:rn.GTE},formatExclusiveMinimum:{okStr:">",ok:rn.GT,fail:rn.LTE}},c4={message:({keyword:t,schemaCode:e})=>(0,Kt.str)`should be ${Cl[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Kt._)`{comparison: ${Cl[t].okStr}, limit: ${e}}`};Is.formatLimitDefinition={keyword:Object.keys(Cl),type:"string",schemaType:"string",$data:!0,error:c4,code(t){let{gen:e,data:r,schemaCode:n,keyword:s,it:i}=t,{opts:o,self:a}=i;if(!o.validateFormats)return;let l=new u4.KeywordCxt(i,a.RULES.all.format.definition,"format");l.$data?u():c();function u(){let p=e.scopeValue("formats",{ref:a.formats,code:o.code.formats}),h=e.const("fmt",(0,Kt._)`${p}[${l.schemaCode}]`);t.fail$data((0,Kt.or)((0,Kt._)`typeof ${h} != "object"`,(0,Kt._)`${h} instanceof RegExp`,(0,Kt._)`typeof ${h}.compare != "function"`,f(h)))}function c(){let p=l.schema,h=a.formats[p];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw new Error(`"${s}": format "${p}" does not define "compare" function`);let d=e.scopeValue("formats",{key:p,ref:h,code:o.code.formats?(0,Kt._)`${o.code.formats}${(0,Kt.getProperty)(p)}`:void 0});t.fail$data(f(d))}function f(p){return(0,Kt._)`${p}.compare(${r}, ${n}) ${Cl[s].fail} 0`}},dependencies:["format"]};var f4=t=>(t.addKeyword(Is.formatLimitDefinition),t);Is.default=f4});var dp=E((eo,xw)=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});var Ns=Al(),d4=Iw(),cp=W(),Nw=new cp.Name("fullFormats"),h4=new cp.Name("fastFormats"),fp=(t,e={keywords:!0})=>{if(Array.isArray(e))return kw(t,e,Ns.fullFormats,Nw),t;let[r,n]=e.mode==="fast"?[Ns.fastFormats,h4]:[Ns.fullFormats,Nw],s=e.formats||Ns.formatNames;return kw(t,s,r,n),e.keywords&&(0,d4.default)(t),t};fp.get=(t,e="full")=>{let n=(e==="fast"?Ns.fastFormats:Ns.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function kw(t,e,r,n){var s,i;(s=(i=t.opts.code).formats)!==null&&s!==void 0||(i.formats=(0,cp._)`require("ajv-formats/dist/formats").${n}`);for(let o of e)t.addFormat(o,r[o])}xw.exports=eo=fp;Object.defineProperty(eo,"__esModule",{value:!0});eo.default=fp});var jw=E((N7,qw)=>{"use strict";var p4=bl().default,m4=np(),Lw=sp(),hp=class{constructor(e,r){r.mode==="JTD"?this.ajv=new m4(Object.assign({},Lw,r.customOptions)):this.ajv=new p4(Object.assign({},Lw,r.customOptions));let n=!0;if(r.plugins&&r.plugins.length>0)for(let i of r.plugins)Array.isArray(i)?(n=n&&i[0].name!=="formatsPlugin",i[0](this.ajv,i[1])):(n=n&&i.name!=="formatsPlugin",i(this.ajv));n&&dp()(this.ajv),r.onCreate?.(this.ajv);let s=Object.values(e);for(let i of s)this.ajv.addSchema(i)}buildValidatorFunction({schema:e}){if(e.$id){let r=this.ajv.getSchema(e.$id);if(r)return r}return this.ajv.compile(e)}};qw.exports=hp});var Fw=E((k7,Dw)=>{"use strict";var g4=np(),y4=sp(),pp=class{constructor(e,r){this.ajv=new g4(Object.assign({},y4,r))}buildSerializerFunction({schema:e}){return this.ajv.compileSerializer(e)}};Dw.exports=pp});var Vw=E((ro,Hw)=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});var to=Ua(),Yt=as();function Mw(t,e){if(!t.opts.code.source)throw new Error("moduleCode: ajv instance must have code.source option");let{_n:r}=t.scope.opts;return typeof e=="function"?s(e.source):e!==void 0?i(e,n):i(t.schemas,a=>a.meta?void 0:t.compile(a.schema));function n(a){let l=t.getSchema(a);if(!l)throw new Error(`moduleCode: no schema with id ${a}`);return l}function s(a){let l={},u=a?.validateName,c=o(l,a);return t.opts.code.esm?`"use strict";${r}export const validate = ${u};${r}export default ${u};${r}${c}`:`"use strict";${r}module.exports = ${u};${r}module.exports.default = ${u};${r}${c}`}function i(a,l){var u;let c={},f=(0,Yt._)`"use strict";`;for(let p in a){let h=l(a[p]);if(h){let d=o(c,h.source),m=t.opts.code.esm?(0,Yt._)`export const ${(0,Yt.getEsmExportName)(p)}`:(0,Yt._)`exports${(0,Yt.getProperty)(p)}`;f=(0,Yt._)`${f}${r}${m} = ${(u=h.source)===null||u===void 0?void 0:u.validateName};${r}${d}`}}return`${f}`}function o(a,l){if(!l)throw new Error('moduleCode: function does not have "source" property');if(p(l.validateName)===to.UsedValueState.Completed)return Yt.nil;h(l.validateName,to.UsedValueState.Started);let u=t.scope.scopeCode(l.scopeValues,a,f),c=new Yt._Code(`${u}${r}${l.validateCode}`);return l.evaluated?(0,Yt._)`${c}${l.validateName}.evaluated = ${l.evaluated};${r}`:c;function f(d){var m;let g=(m=d.value)===null||m===void 0?void 0:m.ref;if(d.prefix==="validate"&&typeof g=="function")return o(a,g.source);if((d.prefix==="root"||d.prefix==="wrapper")&&typeof g=="object"){let{validate:S,validateName:b}=g;if(!b)throw new Error("ajv internal error");let _=t.opts.code.es5?to.varKinds.var:to.varKinds.const,y=(0,Yt._)`${_} ${d} = {validate: ${b}};`;if(p(b)===to.UsedValueState.Started)return y;let R=o(a,S?.source);return(0,Yt._)`${y}${r}${R}`}}function p(d){var m;return(m=a[d.prefix])===null||m===void 0?void 0:m.get(d)}function h(d,m){let{prefix:g}=d;(a[g]=a[g]||new Map).set(d,m)}}}Hw.exports=ro=Mw;Object.defineProperty(ro,"__esModule",{value:!0});ro.default=Mw});var Bw=E((x7,Uw)=>{"use strict";var zw=mp(),_4=Vw().default;function S4(t={readMode:!0}){if(t.readMode===!0&&!t.restoreFunction)throw new Error("You must provide a restoreFunction options when readMode ON");if(t.readMode!==!0&&!t.storeFunction)throw new Error("You must provide a storeFunction options when readMode OFF");if(t.readMode===!0)return function(){return function(n){return t.restoreFunction(n)}};let e=zw();return function(n,s={}){(!s.customOptions||!s.customOptions.code)&&(s.customOptions=Object.assign({},s.customOptions,{code:{source:!0}}));let i=e(n,s);return function(o){let a=i(o),l=_4(i[zw.AjvReference].ajv,a);return t.storeFunction(o,l),a}}}Uw.exports=S4});var mp=E((L7,ks)=>{"use strict";var Ww=Symbol.for("fastify.ajv-compiler.reference"),E4=jw(),b4=Fw();function gp(t){let e=new Map,r=new Map;return t&&t.jtdSerializer===!0?function(s,i){let o=Gw({},i);if(r.has(o))return r.get(o);let a=new b4(s,i),l=a.buildSerializerFunction.bind(a);return r.set(o,l),l}:function(s,i){let o=Gw(s,i.customOptions);if(e.has(o))return e.get(o);let a=new E4(s,i),l=a.buildValidatorFunction.bind(a);return e.set(o,l),i.customOptions.code!==void 0&&(l[Ww]=a),l}}function Gw(t,e){let r=JSON.stringify(t),n=JSON.stringify(e);return`${r}${n}`}ks.exports=gp;ks.exports.default=gp;ks.exports.AjvCompiler=gp;ks.exports.AjvReference=Ww;ks.exports.StandaloneValidator=Bw()});var Il=E(Yw=>{var Jw=Object.prototype.hasOwnProperty;function Kw(t,e,r){for(r of t.keys())if(no(r,e))return r}function no(t,e){var r,n,s;if(t===e)return!0;if(t&&e&&(r=t.constructor)===e.constructor){if(r===Date)return t.getTime()===e.getTime();if(r===RegExp)return t.toString()===e.toString();if(r===Array){if((n=t.length)===e.length)for(;n--&&no(t[n],e[n]););return n===-1}if(r===Set){if(t.size!==e.size)return!1;for(n of t)if(s=n,s&&typeof s=="object"&&(s=Kw(e,s),!s)||!e.has(s))return!1;return!0}if(r===Map){if(t.size!==e.size)return!1;for(n of t)if(s=n[0],s&&typeof s=="object"&&(s=Kw(e,s),!s)||!no(n[1],e.get(s)))return!1;return!0}if(r===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(r===DataView){if((n=t.byteLength)===e.byteLength)for(;n--&&t.getInt8(n)===e.getInt8(n););return n===-1}if(ArrayBuffer.isView(t)){if((n=t.byteLength)===e.byteLength)for(;n--&&t[n]===e[n];);return n===-1}if(!r||typeof t=="object"){n=0;for(r in t)if(Jw.call(t,r)&&++n&&!Jw.call(e,r)||!(r in e)||!no(t[r],e[r]))return!1;return Object.keys(e).length===n}}return t!==t&&e!==e}Yw.dequal=no});var eR=E((j7,Zw)=>{"use strict";var{dequal:Xw}=Il(),v4=Symbol.for("json-schema-ref"),yp=class{#e;#t;#r;#n;#s;constructor(e={}){this.#e={},this.#t={},this.#r=e.insertRefSymbol??!1,this.#n=e.allowEqualDuplicates??!0,this.#s=e.cloneSchemaWithoutRefs??!1}addSchema(e,r,n=!0){n&&(e.$id!==void 0&&e.$id.charAt(0)!=="#"?r=e.$id:this.#l(e,r));let s=e.$id;s!==void 0&&typeof s=="string"&&(s.charAt(0)==="#"?this.#c(e,r,s):(this.#l(e,s),r=s));let i=e.$ref;if(i!==void 0&&typeof i=="string"){let{refSchemaId:o,refJsonPointer:a}=this.#i(i,r);this.#e[r].refs.push({schemaId:o,jsonPointer:a})}for(let o in e)typeof e[o]=="object"&&e[o]!==null&&this.addSchema(e[o],r,!1)}getSchema(e,r="#"){let n=this.#e[e];if(n===void 0)throw new Error(`Cannot resolve ref "${e}${r}". Schema with id "${e}" is not found.`);return n.anchors[r]!==void 0?n.anchors[r]:Qw(n.schema,r)}hasSchema(e){return this.#e[e]!==void 0}getSchemaRefs(e){let r=this.#e[e];if(r===void 0)throw new Error(`Schema with id "${e}" is not found.`);return r.refs}getSchemaDependencies(e,r={}){let n=this.#e[e];for(let s of n.refs){let i=s.schemaId;i===e||r[i]!==void 0||(r[i]=this.getSchema(i),this.getSchemaDependencies(i,r))}return r}derefSchema(e){if(this.#t[e]!==void 0)return;let r=this.#e[e];if(r===void 0)throw new Error(`Schema with id "${e}" is not found.`);!this.#s&&r.refs.length===0&&(this.#t[e]={schema:r.schema,anchors:r.anchors});let n=[];this.#o(r.schema,e,!0,n);let s=this.getSchemaDependencies(e);for(let i in s){let o=s[i];this.#o(o,i,!0,n)}for(let i of n){let{refSchemaId:o,refJsonPointer:a}=this.#i(i.ref,i.sourceSchemaId),l=this.getDerefSchema(o,a);if(l===null)throw new Error(`Cannot resolve ref "${i.ref}". Ref "${a}" is not found in schema "${o}".`);i.targetSchema=l,i.targetSchemaId=o}for(let i of n)this.#a(i,n)}getDerefSchema(e,r="#"){let n=this.#t[e];return n===void 0&&(this.derefSchema(e),n=this.#t[e]),n.anchors[r]!==void 0?n.anchors[r]:Qw(n.schema,r)}#i(e,r){let n=e.indexOf("#");return n===-1?{refSchemaId:e,refJsonPointer:"#"}:n===0?{refSchemaId:r,refJsonPointer:e}:{refSchemaId:e.slice(0,n),refJsonPointer:e.slice(n)}}#o(e,r,n,s=[]){let i=Array.isArray(e)?[...e]:{...e};n&&(e.$id!==void 0&&e.$id.charAt(0)!=="#"?r=e.$id:this.#u(i,r));let o=i.$id;o!==void 0&&typeof o=="string"&&(o.charAt(0)==="#"?this.#f(i,r,o):(this.#u(i,o),r=o)),i.$ref!==void 0&&s.push({ref:i.$ref,sourceSchemaId:r,sourceSchema:i});for(let a in i){let l=i[a];typeof l=="object"&&l!==null&&(i[a]=this.#o(l,r,!1,s))}return i}#a(e,r){let{sourceSchema:n,targetSchema:s}=e;if(n.$ref){if(this.#r&&(n[v4]=n.$ref),delete n.$ref,s.$ref){let i=r.find(o=>o.sourceSchema===s);this.#a(i,r)}for(let i in s)if(i!=="$id"){if(n[i]!==void 0){if(Xw(n[i],s[i]))continue;throw new Error(`Cannot resolve ref "${e.ref}". Property "${i}" already exists in schema "${e.sourceSchemaId}".`)}n[i]=s[i]}e.isResolved=!0}}#l(e,r){let n=this.#e[r];if(n!==void 0){if(this.#n&&Xw(e,n.schema))return;throw new Error(`There is already another schema with id "${r}".`)}this.#e[r]={schema:e,anchors:{},refs:[]}}#c(e,r,n){let{anchors:s}=this.#e[r];if(s[n]!==void 0)throw new Error(`There is already another anchor "${n}" in schema "${r}".`);s[n]=e}#u(e,r){this.#t[r]===void 0&&(this.#t[r]={schema:e,anchors:{}})}#f(e,r,n){let{anchors:s}=this.#t[r];s[n]=e}};function Qw(t,e){let r=e.split("/"),n=t;for(let s of r)if(!(s===""||s==="#")){if(typeof n!="object"||n===null)return null;n=n[s]}return n??null}Zw.exports={RefResolver:yp}});var Sp=E((D7,tR)=>{"use strict";var w4=bl(),R4=il(),O4=dp(),T4=ya()({proto:!0}),_p=class t{constructor(e){this.ajv=new w4({...e,strictSchema:!1,validateSchema:!1,allowUnionTypes:!0,uriResolver:R4}),O4(this.ajv),this.ajv.addKeyword({keyword:"fjs_type",type:"object",errors:!1,validate:(r,n)=>n&&typeof n.toJSON=="function"}),this._ajvSchemas={},this._ajvOptions=e||{}}addSchema(e,r){let n=e.$id||r;if(e.$id!==void 0&&e.$id[0]==="#"&&(n=r+e.$id),this.ajv.refs[n]===void 0&&this.ajv.schemas[n]===void 0){let s=T4(e);this.convertSchemaToAjvFormat(s),this.ajv.addSchema(s,n),this._ajvSchemas[n]=e}}validate(e,r){return this.ajv.validate(e,r)}convertSchemaToAjvFormat(e){if(e!==null){e.type==="string"?(e.fjs_type="string",e.type=["string","object"]):Array.isArray(e.type)&&e.type.includes("string")&&!e.type.includes("object")&&(e.fjs_type="string",e.type.push("object"));for(let r in e)typeof e[r]=="object"&&this.convertSchemaToAjvFormat(e[r])}}getState(){return{ajvOptions:this._ajvOptions,ajvSchemas:this._ajvSchemas}}static restoreFromState(e){let r=new t(e.ajvOptions);for(let[n,s]of Object.entries(e.ajvSchemas))r.ajv.addSchema(s,n);return r}};tR.exports=_p});var nR=E((F7,rR)=>{"use strict";var Ep=class t{constructor(e,r,n="#"){this.schema=e,this.schemaId=r,this.jsonPointer=n}getPropertyLocation(e){return new t(this.schema[e],this.schemaId,this.jsonPointer+"/"+e)}getSchemaRef(){return this.schemaId+this.jsonPointer}};rR.exports=Ep});var lR=E((M7,vp)=>{"use strict";vp.exports=x;vp.exports.default=x;var $4={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0},sR={enum:["array","boolean","integer","null","number","object","string"]},iR=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,P4=Al().fullFormats.uri,oR=Al().fullFormats.regex;function Lt(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0,a=o;return typeof t=="number"&&!(t%1)&&!isNaN(t)&&isFinite(t)?o===a&&typeof t=="number"&&isFinite(t)&&(t<0||isNaN(t))?(Lt.errors=[{instancePath:e,schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1):(Lt.errors=i,o===0):(Lt.errors=[{instancePath:e,schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1)}var bp={validate:x};function at(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0;if(o===0)if(Array.isArray(t)){if(t.length<1)return at.errors=[{instancePath:e,schemaPath:"#/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"}],!1;{var a=!0;let l=t.length;for(let u=0;u<l;u++){let c=o;bp.validate(t[u],{instancePath:e+"/"+u,parentData:t,parentDataProperty:u,rootData:s})||(i=i===null?bp.validate.errors:i.concat(bp.validate.errors),o=i.length);var a=c===o;if(!a)break}}}else return at.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;return at.errors=i,o===0}var aR=zi().default;function x(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0;if(!(t&&typeof t=="object"&&!Array.isArray(t))&&typeof t!="boolean")return x.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:$4.type},message:"must be object,boolean"}],!1;if(o===0&&t&&typeof t=="object"&&!Array.isArray(t)){if(t.$id!==void 0){let _=t.$id,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!iR.test(_))return x.errors=[{instancePath:e+"/$id",schemaPath:"#/properties/%24id/format",keyword:"format",params:{format:"uri-reference"},message:'must match format "uri-reference"'}],!1}else return x.errors=[{instancePath:e+"/$id",schemaPath:"#/properties/%24id/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.$schema!==void 0){let _=t.$schema,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!P4(_))return x.errors=[{instancePath:e+"/$schema",schemaPath:"#/properties/%24schema/format",keyword:"format",params:{format:"uri"},message:'must match format "uri"'}],!1}else return x.errors=[{instancePath:e+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.$ref!==void 0){let _=t.$ref,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!iR.test(_))return x.errors=[{instancePath:e+"/$ref",schemaPath:"#/properties/%24ref/format",keyword:"format",params:{format:"uri-reference"},message:'must match format "uri-reference"'}],!1}else return x.errors=[{instancePath:e+"/$ref",schemaPath:"#/properties/%24ref/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.$comment!==void 0){let _=o;if(typeof t.$comment!="string")return x.errors=[{instancePath:e+"/$comment",schemaPath:"#/properties/%24comment/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.title!==void 0){let _=o;if(typeof t.title!="string")return x.errors=[{instancePath:e+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.description!==void 0){let _=o;if(typeof t.description!="string")return x.errors=[{instancePath:e+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.readOnly!==void 0){let _=o;if(typeof t.readOnly!="boolean")return x.errors=[{instancePath:e+"/readOnly",schemaPath:"#/properties/readOnly/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var a=_===o}else var a=!0;if(a){if(t.examples!==void 0){let _=o;if(o===_&&!Array.isArray(t.examples))return x.errors=[{instancePath:e+"/examples",schemaPath:"#/properties/examples/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var a=_===o}else var a=!0;if(a){if(t.multipleOf!==void 0){let _=t.multipleOf,y=o;if(o===y)if(typeof _=="number"&&isFinite(_)){if(_<=0||isNaN(_))return x.errors=[{instancePath:e+"/multipleOf",schemaPath:"#/properties/multipleOf/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0"}],!1}else return x.errors=[{instancePath:e+"/multipleOf",schemaPath:"#/properties/multipleOf/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.maximum!==void 0){let _=t.maximum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/maximum",schemaPath:"#/properties/maximum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.exclusiveMaximum!==void 0){let _=t.exclusiveMaximum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/exclusiveMaximum",schemaPath:"#/properties/exclusiveMaximum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.minimum!==void 0){let _=t.minimum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/minimum",schemaPath:"#/properties/minimum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.exclusiveMinimum!==void 0){let _=t.exclusiveMinimum,y=o;if(!(typeof _=="number"&&isFinite(_)))return x.errors=[{instancePath:e+"/exclusiveMinimum",schemaPath:"#/properties/exclusiveMinimum/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var a=y===o}else var a=!0;if(a){if(t.maxLength!==void 0){let _=t.maxLength,y=o,R=o;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return x.errors=[{instancePath:e+"/maxLength",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;if(o===R&&typeof _=="number"&&isFinite(_)&&(_<0||isNaN(_)))return x.errors=[{instancePath:e+"/maxLength",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1;var a=y===o}else var a=!0;if(a){if(t.minLength!==void 0){let _=o;Lt(t.minLength,{instancePath:e+"/minLength",parentData:t,parentDataProperty:"minLength",rootData:s})||(i=i===null?Lt.errors:i.concat(Lt.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.pattern!==void 0){let _=t.pattern,y=o;if(o===y&&o===y)if(typeof _=="string"){if(!oR(_))return x.errors=[{instancePath:e+"/pattern",schemaPath:"#/properties/pattern/format",keyword:"format",params:{format:"regex"},message:'must match format "regex"'}],!1}else return x.errors=[{instancePath:e+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=y===o}else var a=!0;if(a){if(t.additionalItems!==void 0){let _=o;x(t.additionalItems,{instancePath:e+"/additionalItems",parentData:t,parentDataProperty:"additionalItems",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.items!==void 0){let _=t.items,y=o,R=o,T=!1,O=o;x(_,{instancePath:e+"/items",parentData:t,parentDataProperty:"items",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var l=O===o;if(T=T||l,!T){let $=o;at(_,{instancePath:e+"/items",parentData:t,parentDataProperty:"items",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var l=$===o;T=T||l}if(T)o=R,i!==null&&(R?i.length=R:i=null);else{let $={instancePath:e+"/items",schemaPath:"#/properties/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[$]:i.push($),o++,x.errors=i,!1}var a=y===o}else var a=!0;if(a){if(t.maxItems!==void 0){let _=t.maxItems,y=o,R=o;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return x.errors=[{instancePath:e+"/maxItems",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;if(o===R&&typeof _=="number"&&isFinite(_)&&(_<0||isNaN(_)))return x.errors=[{instancePath:e+"/maxItems",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1;var a=y===o}else var a=!0;if(a){if(t.minItems!==void 0){let _=o;Lt(t.minItems,{instancePath:e+"/minItems",parentData:t,parentDataProperty:"minItems",rootData:s})||(i=i===null?Lt.errors:i.concat(Lt.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.uniqueItems!==void 0){let _=o;if(typeof t.uniqueItems!="boolean")return x.errors=[{instancePath:e+"/uniqueItems",schemaPath:"#/properties/uniqueItems/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var a=_===o}else var a=!0;if(a){if(t.contains!==void 0){let _=o;x(t.contains,{instancePath:e+"/contains",parentData:t,parentDataProperty:"contains",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.maxProperties!==void 0){let _=t.maxProperties,y=o,R=o;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return x.errors=[{instancePath:e+"/maxProperties",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;if(o===R&&typeof _=="number"&&isFinite(_)&&(_<0||isNaN(_)))return x.errors=[{instancePath:e+"/maxProperties",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"}],!1;var a=y===o}else var a=!0;if(a){if(t.minProperties!==void 0){let _=o;Lt(t.minProperties,{instancePath:e+"/minProperties",parentData:t,parentDataProperty:"minProperties",rootData:s})||(i=i===null?Lt.errors:i.concat(Lt.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.required!==void 0){let _=t.required,y=o;if(o===o)if(Array.isArray(_)){var u=!0;let O=_.length;for(let w=0;w<O;w++){let $=o;if(typeof _[w]!="string")return x.errors=[{instancePath:e+"/required/"+w,schemaPath:"#/definitions/stringArray/items/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=$===o;if(!u)break}if(u){let w=_.length,$;if(w>1){let v={};for(;w--;){let P=_[w];if(typeof P=="string"){if(typeof v[P]=="number"){return $=v[P],x.errors=[{instancePath:e+"/required",schemaPath:"#/definitions/stringArray/uniqueItems",keyword:"uniqueItems",params:{i:w,j:$},message:"must NOT have duplicate items (items ## "+$+" and "+w+" are identical)"}],!1;break}v[P]=w}}}}}else return x.errors=[{instancePath:e+"/required",schemaPath:"#/definitions/stringArray/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var a=y===o}else var a=!0;if(a){if(t.additionalProperties!==void 0){let _=o;x(t.additionalProperties,{instancePath:e+"/additionalProperties",parentData:t,parentDataProperty:"additionalProperties",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.definitions!==void 0){let _=t.definitions,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_))for(let T in _){let O=o;x(_[T],{instancePath:e+"/definitions/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var c=O===o;if(!c)break}else return x.errors=[{instancePath:e+"/definitions",schemaPath:"#/properties/definitions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.properties!==void 0){let _=t.properties,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_))for(let T in _){let O=o;x(_[T],{instancePath:e+"/properties/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var f=O===o;if(!f)break}else return x.errors=[{instancePath:e+"/properties",schemaPath:"#/properties/properties/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.patternProperties!==void 0){let _=t.patternProperties,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_)){for(let T in _){let O=o;if(o===O&&typeof T=="string"&&!oR(T)){let w={instancePath:e+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames/format",keyword:"format",params:{format:"regex"},message:'must match format "regex"',propertyName:T};i===null?i=[w]:i.push(w),o++}var p=O===o;if(!p){let w={instancePath:e+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames",keyword:"propertyNames",params:{propertyName:T},message:"property name must be valid"};return i===null?i=[w]:i.push(w),o++,x.errors=i,!1;break}}if(p)for(let T in _){let O=o;x(_[T],{instancePath:e+"/patternProperties/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var h=O===o;if(!h)break}}else return x.errors=[{instancePath:e+"/patternProperties",schemaPath:"#/properties/patternProperties/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.dependencies!==void 0){let _=t.dependencies,y=o;if(o===y)if(_&&typeof _=="object"&&!Array.isArray(_))for(let T in _){let O=_[T],w=o,$=o,v=!1,P=o;x(O,{instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:_,parentDataProperty:T,rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var d=P===o;if(v=v||d,!v){let C=o;if(o===o)if(Array.isArray(O)){var m=!0;let J=O.length;for(let U=0;U<J;U++){let H=o;if(typeof O[U]!="string"){let ze={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1")+"/"+U,schemaPath:"#/definitions/stringArray/items/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[ze]:i.push(ze),o++}var m=H===o;if(!m)break}if(m){let U=O.length,H;if(U>1){let fe={};for(;U--;){let ze=O[U];if(typeof ze=="string"){if(typeof fe[ze]=="number"){H=fe[ze];let G={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/stringArray/uniqueItems",keyword:"uniqueItems",params:{i:U,j:H},message:"must NOT have duplicate items (items ## "+H+" and "+U+" are identical)"};i===null?i=[G]:i.push(G),o++;break}fe[ze]=U}}}}}else{let J={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/stringArray/type",keyword:"type",params:{type:"array"},message:"must be array"};i===null?i=[J]:i.push(J),o++}var d=C===o;v=v||d}if(v)o=$,i!==null&&($?i.length=$:i=null);else{let C={instancePath:e+"/dependencies/"+T.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/dependencies/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[C]:i.push(C),o++,x.errors=i,!1}var g=w===o;if(!g)break}else return x.errors=[{instancePath:e+"/dependencies",schemaPath:"#/properties/dependencies/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=y===o}else var a=!0;if(a){if(t.propertyNames!==void 0){let _=o;x(t.propertyNames,{instancePath:e+"/propertyNames",parentData:t,parentDataProperty:"propertyNames",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.enum!==void 0){let _=t.enum,y=o;if(o===y)if(Array.isArray(_)){if(_.length<1)return x.errors=[{instancePath:e+"/enum",schemaPath:"#/properties/enum/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"}],!1;{let T=_.length,O;if(T>1){e:for(;T--;)for(O=T;O--;)if(aR(_[T],_[O])){return x.errors=[{instancePath:e+"/enum",schemaPath:"#/properties/enum/uniqueItems",keyword:"uniqueItems",params:{i:T,j:O},message:"must NOT have duplicate items (items ## "+O+" and "+T+" are identical)"}],!1;break e}}}}else return x.errors=[{instancePath:e+"/enum",schemaPath:"#/properties/enum/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var a=y===o}else var a=!0;if(a){if(t.type!==void 0){let _=t.type,y=o,R=o,T=!1,O=o;if(!(_==="array"||_==="boolean"||_==="integer"||_==="null"||_==="number"||_==="object"||_==="string")){let $={instancePath:e+"/type",schemaPath:"#/definitions/simpleTypes/enum",keyword:"enum",params:{allowedValues:sR.enum},message:"must be equal to one of the allowed values"};i===null?i=[$]:i.push($),o++}var S=O===o;if(T=T||S,!T){let $=o;if(o===$)if(Array.isArray(_))if(_.length<1){let P={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf/1/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};i===null?i=[P]:i.push(P),o++}else{var b=!0;let P=_.length;for(let C=0;C<P;C++){let k=_[C],M=o;if(!(k==="array"||k==="boolean"||k==="integer"||k==="null"||k==="number"||k==="object"||k==="string")){let U={instancePath:e+"/type/"+C,schemaPath:"#/definitions/simpleTypes/enum",keyword:"enum",params:{allowedValues:sR.enum},message:"must be equal to one of the allowed values"};i===null?i=[U]:i.push(U),o++}var b=M===o;if(!b)break}if(b){let C=_.length,k;if(C>1){e:for(;C--;)for(k=C;k--;)if(aR(_[C],_[k])){let M={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf/1/uniqueItems",keyword:"uniqueItems",params:{i:C,j:k},message:"must NOT have duplicate items (items ## "+k+" and "+C+" are identical)"};i===null?i=[M]:i.push(M),o++;break e}}}}else{let P={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};i===null?i=[P]:i.push(P),o++}var S=$===o;T=T||S}if(T)o=R,i!==null&&(R?i.length=R:i=null);else{let $={instancePath:e+"/type",schemaPath:"#/properties/type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[$]:i.push($),o++,x.errors=i,!1}var a=y===o}else var a=!0;if(a){if(t.format!==void 0){let _=o;if(typeof t.format!="string")return x.errors=[{instancePath:e+"/format",schemaPath:"#/properties/format/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.contentMediaType!==void 0){let _=o;if(typeof t.contentMediaType!="string")return x.errors=[{instancePath:e+"/contentMediaType",schemaPath:"#/properties/contentMediaType/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.contentEncoding!==void 0){let _=o;if(typeof t.contentEncoding!="string")return x.errors=[{instancePath:e+"/contentEncoding",schemaPath:"#/properties/contentEncoding/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var a=_===o}else var a=!0;if(a){if(t.if!==void 0){let _=o;x(t.if,{instancePath:e+"/if",parentData:t,parentDataProperty:"if",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.then!==void 0){let _=o;x(t.then,{instancePath:e+"/then",parentData:t,parentDataProperty:"then",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.else!==void 0){let _=o;x(t.else,{instancePath:e+"/else",parentData:t,parentDataProperty:"else",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.allOf!==void 0){let _=o;at(t.allOf,{instancePath:e+"/allOf",parentData:t,parentDataProperty:"allOf",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.anyOf!==void 0){let _=o;at(t.anyOf,{instancePath:e+"/anyOf",parentData:t,parentDataProperty:"anyOf",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var a=_===o}else var a=!0;if(a){if(t.oneOf!==void 0){let _=o;at(t.oneOf,{instancePath:e+"/oneOf",parentData:t,parentDataProperty:"oneOf",rootData:s})||(i=i===null?at.errors:i.concat(at.errors),o=i.length);var a=_===o}else var a=!0;if(a)if(t.not!==void 0){let _=o;x(t.not,{instancePath:e+"/not",parentData:t,parentDataProperty:"not",rootData:s})||(i=i===null?x.errors:i.concat(x.errors),o=i.length);var a=_===o}else var a=!0}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}return x.errors=i,o===0}});var Tp=E((H7,uR)=>{"use strict";var wp=class extends Error{constructor(e,r){super(),this.name="JsonSchemaMergeError",this.code="JSON_SCHEMA_MERGE_ERROR",this.message=`Failed to merge "${e}" keyword schemas.`,this.schemas=r}},Rp=class extends Error{constructor(e,r){super(),this.name="JsonSchemaMergeError",this.code="JSON_SCHEMA_MERGE_ERROR",this.message=`Resolver for "${e}" keyword not found.`,this.schemas=r}},Op=class extends Error{constructor(e){super(),this.name="JsonSchemaMergeError",this.code="JSON_SCHEMA_MERGE_ERROR",this.message=`Invalid "onConflict" option: "${e}".`}};uR.exports={MergeError:wp,ResolverNotFoundError:Rp,InvalidOnConflictOptionError:Op}});var dR=E((V7,fR)=>{"use strict";var{dequal:A4}=Il(),{MergeError:$p}=Tp();function cR(t){let e=t[0];for(let r=1;r<t.length;r++)e=e.filter(n=>t[r].includes(n));return e}function C4(t,e,r){let n=cR(e);if(n.length===0)throw new $p(t,e);r[t]=n}function I4(t,e,r){for(let s=0;s<e.length;s++)Array.isArray(e[s])||(e[s]=[e[s]]);let n=cR(e);if(n.length===0)throw new $p(t,e);n.length===1?r[t]=n[0]:r[t]=n}function N4(t,e,r){let n=[];for(let s of e)for(let i of s)n.includes(i)||n.push(i);r[t]=n}function k4(t,e,r){r[t]=Math.min(...e)}function x4(t,e,r){r[t]=Math.max(...e)}function L4(t,e,r){let n=(a,l)=>l?n(l,a%l):a,s=(a,l)=>a*l/n(a,l),i=1;for(let a of e)for(;a*i%1!==0;)i*=10;let o=e[0]*i;for(let a of e)o=s(o,a*i);r[t]=o/i}function q4(t,e,r){let n=e[0];for(let s=1;s<e.length;s++)if(!A4(e[s],n))throw new $p(t,e);r[t]=n}function j4(){}function D4(t,e,r){for(let n of e)if(n===!1){r[t]=!1;return}r[t]=!0}function F4(t,e,r){for(let n of e)if(n===!0){r[t]=!0;return}r[t]=!1}fR.exports={arraysIntersection:C4,hybridArraysIntersection:I4,arraysUnion:N4,minNumber:k4,maxNumber:x4,commonMultiple:L4,allEqual:q4,booleanAnd:D4,booleanOr:F4,skip:j4}});var _R=E((z7,yR)=>{"use strict";var{dequal:M4}=Il(),Oe=dR(),xl=Tp(),mR={$id:Oe.skip,type:Oe.hybridArraysIntersection,enum:Oe.arraysIntersection,minLength:Oe.maxNumber,maxLength:Oe.minNumber,minimum:Oe.maxNumber,maximum:Oe.minNumber,multipleOf:Oe.commonMultiple,exclusiveMinimum:Oe.maxNumber,exclusiveMaximum:Oe.minNumber,minItems:Oe.maxNumber,maxItems:Oe.minNumber,maxProperties:Oe.minNumber,minProperties:Oe.maxNumber,const:Oe.allEqual,default:Oe.allEqual,format:Oe.allEqual,required:Oe.arraysUnion,properties:G4,patternProperties:kl,additionalProperties:Nl,items:z4,additionalItems:U4,definitions:kl,$defs:kl,nullable:Oe.booleanAnd,oneOf:hR,anyOf:hR,allOf:Oe.arraysUnion,not:Nl,if:W4,then:Oe.skip,else:Oe.skip,dependencies:pR,dependentRequired:pR,dependentSchemas:kl,propertyNames:Nl,uniqueItems:Oe.booleanOr,contains:Nl};function Nl(t,e,r,n,s){r[t]=Xt(e,s)}function H4(t){let e=[[]];for(let r of t){let n=[];for(let s of e)for(let i of r)n.push([...s,i]);e=n}return e}function hR(t,e,r,n,s){if(e.length===1){r[t]=e[0];return}let i=H4(e),o=[];for(let a of i)try{let l=Xt(a,s);l!==void 0&&o.push(l)}catch(l){if(l instanceof xl.MergeError)continue;throw l}r[t]=o}function V4(t,e){let{items:r,additionalItems:n}=t;return Array.isArray(r)?e<r.length?r[e]:n:r!==void 0?r:n}function z4(t,e,r,n,s){let i=0;for(let a of e)Array.isArray(a)&&(i=Math.max(i,a.length));if(i===0){r[t]=Xt(e,s);return}let o=[];for(let a=0;a<i;a++){let l=[];for(let u of n){let c=V4(u,a);c!==void 0&&l.push(c)}o[a]=Xt(l,s)}r[t]=o}function U4(t,e,r,n,s){let i=!1;for(let a of n)if(Array.isArray(a.items)){i=!0;break}if(!i){r[t]=Xt(e,s);return}let o=[];for(let a of n){let l=a.additionalItems;l===void 0&&!Array.isArray(a.items)&&(l=a.items),l!==void 0&&o.push(l)}r[t]=Xt(o,s)}function B4(t,e){let{properties:r,patternProperties:n,additionalProperties:s}=t;if(r?.[e]!==void 0)return r[e];for(let i of Object.keys(n??{}))if(new RegExp(i).test(e))return n[i];return s}function G4(t,e,r,n,s){let i={};for(let a of n){let l=a.properties??{};for(let u of Object.keys(l)){if(i[u]!==void 0)continue;let c=l[u];i[u]=[c];for(let f of n){if(a===f)continue;let p=B4(f,u);p!==void 0&&i[u].push(p)}}}let o={};for(let a of Object.keys(i)){let l=i[a];o[a]=Xt(l,s)}r[t]=o}function kl(t,e,r,n,s){let i={};for(let a of e)for(let l of Object.keys(a))i[l]===void 0&&(i[l]=[]),i[l].push(a[l]);let o={};for(let a of Object.keys(i)){let l=i[a],u=Xt(l,s);o[a]=u}r[t]=o}function W4(t,e,r,n,s){for(let i=0;i<n.length;i++){let o={if:n[i].if,then:n[i].then,else:n[i].else};if(o.if!==void 0){if(r.if===void 0){r.if=o.if,o.then!==void 0&&(r.then=o.then),o.else!==void 0&&(r.else=o.else);continue}r.then!==void 0&&(r.then=Xt([r.then,o],s)),r.else!==void 0&&(r.else=Xt([r.else,o],s))}}}function pR(t,e,r){let n={};for(let s of e)for(let i of Object.keys(s)){n[i]===void 0&&(n[i]=[]);let o=n[i];for(let a of s[i])o.includes(a)||o.push(a)}r[t]=n}function Xt(t,e){if(t.length===0)return{};if(t.length===1)return t[0];let r={},n={},s=!0;for(let i of t){if(i===!1)return!1;if(i!==!0){s=!1;for(let o of Object.keys(i))n[o]===void 0&&(n[o]=[]),n[o].push(i[o])}}if(s)return!0;for(let i of Object.keys(n)){let o=n[i];(e.resolvers[i]??e.defaultResolver)(i,o,r,t,e)}return r}function gR(t,e,r,n,s){let i=s.onConflict??"throw";if(e.length===1||i==="first"){r[t]=e[0];return}let o=!0;for(let a=1;a<e.length;a++)if(!M4(e[a],e[0])){o=!1;break}if(o){r[t]=e[0];return}if(i==="throw")throw new xl.ResolverNotFoundError(t,e);if(i!=="skip")throw new xl.InvalidOnConflictOptionError(i)}function J4(t,e={}){return e.defaultResolver===void 0&&(e.defaultResolver=gR),e.resolvers={...mR,...e.resolvers},Xt(t,e)}yR.exports={mergeSchemas:J4,keywordsResolvers:mR,defaultResolver:gR,...xl}});var ER=E((U7,SR)=>{"use strict";var{mergeSchemas:K4}=_R();function Y4(t){return K4(t,{onConflict:"skip"})}SR.exports=Y4});var bR=E((B7,Pp)=>{"use strict";function X4(t,e,r,n){let s="";e.validatorSchemasIds.size>0?(s+=`const Validator = require('fast-json-stringify/lib/validator')
60
60
  `,s+=`const validatorState = ${JSON.stringify(n.getState())}
61
61
  `,s+=`const validator = Validator.restoreFromState(validatorState)
62
62
  `):s+=`const validator = null
@@ -69,7 +69,7 @@ ${b}`),m.pop(),`{${T}}`}case"number":return isFinite(d)?String(d):e?e(d):"null";
69
69
 
70
70
  ${s}
71
71
 
72
- module.exports = ${t.toString()}(validator, serializer)`}$p.exports=G4;$p.exports.dependencies={Serializer:_a(),Validator:_p()}});var AR=E((D7,Ls)=>{"use strict";var{RefResolver:W4}=Zw(),J4=_a(),K4=_p(),kn=rR(),bR=aR(),Y4=SR(),X4=/'/g,no=2e4,xl="default",Q4=`
72
+ module.exports = ${t.toString()}(validator, serializer)`}Pp.exports=X4;Pp.exports.dependencies={Serializer:Sa(),Validator:Sp()}});var CR=E((G7,Ls)=>{"use strict";var{RefResolver:Q4}=eR(),Z4=Sa(),eB=Sp(),kn=nR(),vR=lR(),tB=ER(),rB=/'/g,so=2e4,Ll="default",nB=`
73
73
  const {
74
74
  asString,
75
75
  asNumber,
@@ -82,8 +82,8 @@ const {
82
82
 
83
83
  const asInteger = serializer.asInteger.bind(serializer)
84
84
 
85
- `,Z4=new Set(["floor","ceil","round","trunc"]),OR=new Set(["default","json-stringify"]),so=0;function Pp(t,e){if(!bR(t)){e?e=`"${e}" `:e="";let r=bR.errors[0],n=new Error(`${e}schema is invalid: data${r.instancePath} ${r.message}`);throw n.errors=Pp.errors,n}}function xs(t,e){let r=e.schema.$ref,n=r.indexOf("#");n===-1&&(n=r.length);let s=r.slice(0,n)||e.schemaId,i=r.slice(n)||"#",o=t.refResolver.getSchema(s,i);if(o===null)throw new Error(`Cannot find reference "${r}"`);let a=new kn(o,s,i);return o.$ref!==void 0?xs(t,a):a}function Ll(t,e){let r=t.refResolver.getSchema(e,"#");return new kn(r,e,"#")}function vR(t,e){return t.$id&&t.$id.charAt(0)!=="#"?t.$id:e}function io(t,e){let r=e.getSchemaRef()||"";return r.startsWith(t.rootSchemaId)&&(r=r.replace(t.rootSchemaId,"")||"#"),r}function Cp(t,e){Pp(t),e=e||{};let r={functions:[],functionsCounter:0,functionsNamesBySchema:new Map,options:e,refResolver:new W4,rootSchemaId:t.$id||`__fjs_root_${so++}`,validatorSchemasIds:new Set,mergedSchemasIds:new Map,recursiveSchemas:new Set,recursivePaths:new Set,buildingSet:new Set,uid:0},n=vR(t,r.rootSchemaId);if(r.refResolver.hasSchema(n)||r.refResolver.addSchema(t,r.rootSchemaId),e.schema)for(let c in e.schema){let f=e.schema[c],p=vR(f,c);r.refResolver.hasSchema(p)||(Pp(f,c),r.refResolver.addSchema(f,c))}if(e.rounding&&!Z4.has(e.rounding))throw new Error(`Unsupported integer rounding method ${e.rounding}`);if(e.largeArrayMechanism)if(OR.has(e.largeArrayMechanism))xl=e.largeArrayMechanism;else throw new Error(`Unsupported large array mechanism ${e.largeArrayMechanism}`);if(e.largeArraySize){let c=typeof e.largeArraySize,f;if(c==="string"&&Number.isFinite(f=Number.parseInt(e.largeArraySize,10)))no=f;else if(c==="number"&&Number.isInteger(e.largeArraySize))no=e.largeArraySize;else if(c==="bigint")no=Number(e.largeArraySize);else throw new Error(`Unsupported large array size. Expected integer-like, got ${typeof e.largeArraySize} with value ${e.largeArraySize}`)}let s=new kn(t,r.rootSchemaId);uB(r,s);let i=lt(r,s,"input"),o=`
86
- ${Q4}
85
+ `,sB=new Set(["floor","ceil","round","trunc"]),TR=new Set(["default","json-stringify"]),io=0;function Ap(t,e){if(!vR(t)){e?e=`"${e}" `:e="";let r=vR.errors[0],n=new Error(`${e}schema is invalid: data${r.instancePath} ${r.message}`);throw n.errors=Ap.errors,n}}function xs(t,e){let r=e.schema.$ref,n=r.indexOf("#");n===-1&&(n=r.length);let s=r.slice(0,n)||e.schemaId,i=r.slice(n)||"#",o=t.refResolver.getSchema(s,i);if(o===null)throw new Error(`Cannot find reference "${r}"`);let a=new kn(o,s,i);return o.$ref!==void 0?xs(t,a):a}function ql(t,e){let r=t.refResolver.getSchema(e,"#");return new kn(r,e,"#")}function wR(t,e){return t.$id&&t.$id.charAt(0)!=="#"?t.$id:e}function oo(t,e){let r=e.getSchemaRef()||"";return r.startsWith(t.rootSchemaId)&&(r=r.replace(t.rootSchemaId,"")||"#"),r}function Ip(t,e){Ap(t),e=e||{};let r={functions:[],functionsCounter:0,functionsNamesBySchema:new Map,options:e,refResolver:new Q4,rootSchemaId:t.$id||`__fjs_root_${io++}`,validatorSchemasIds:new Set,mergedSchemasIds:new Map,recursiveSchemas:new Set,recursivePaths:new Set,buildingSet:new Set,uid:0},n=wR(t,r.rootSchemaId);if(r.refResolver.hasSchema(n)||r.refResolver.addSchema(t,r.rootSchemaId),e.schema)for(let c in e.schema){let f=e.schema[c],p=wR(f,c);r.refResolver.hasSchema(p)||(Ap(f,c),r.refResolver.addSchema(f,c))}if(e.rounding&&!sB.has(e.rounding))throw new Error(`Unsupported integer rounding method ${e.rounding}`);if(e.largeArrayMechanism)if(TR.has(e.largeArrayMechanism))Ll=e.largeArrayMechanism;else throw new Error(`Unsupported large array mechanism ${e.largeArrayMechanism}`);if(e.largeArraySize){let c=typeof e.largeArraySize,f;if(c==="string"&&Number.isFinite(f=Number.parseInt(e.largeArraySize,10)))so=f;else if(c==="number"&&Number.isInteger(e.largeArraySize))so=e.largeArraySize;else if(c==="bigint")so=Number(e.largeArraySize);else throw new Error(`Unsupported large array size. Expected integer-like, got ${typeof e.largeArraySize} with value ${e.largeArraySize}`)}let s=new kn(t,r.rootSchemaId);pB(r,s);let i=lt(r,s,"input"),o=`
86
+ ${nB}
87
87
  const JSON_STR_BEGIN_OBJECT = '{'
88
88
  const JSON_STR_END_OBJECT = '}'
89
89
  const JSON_STR_BEGIN_ARRAY = '['
@@ -109,9 +109,9 @@ const asInteger = serializer.asInteger.bind(serializer)
109
109
  ${r.functions.join(`
110
110
  `)}
111
111
  return main
112
- `;let a=new J4(e),l=new K4(e.ajv);for(let c of r.validatorSchemasIds){let f=r.refResolver.getSchema(c);l.addSchema(f,c);let p=r.refResolver.getSchemaDependencies(c);for(let[h,d]of Object.entries(p))l.addSchema(d,h)}if(e.debugMode&&(e.mode="debug"),e.mode==="debug")return{validator:l,serializer:a,code:`validator
112
+ `;let a=new Z4(e),l=new eB(e.ajv);for(let c of r.validatorSchemasIds){let f=r.refResolver.getSchema(c);l.addSchema(f,c);let p=r.refResolver.getSchemaDependencies(c);for(let[h,d]of Object.entries(p))l.addSchema(d,h)}if(e.debugMode&&(e.mode="debug"),e.mode==="debug")return{validator:l,serializer:a,code:`validator
113
113
  serializer
114
- ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode==="standalone"?ER()(u,r,a,l):u(l,a)}var eB=["properties","required","additionalProperties","patternProperties","maxProperties","minProperties","dependencies"],tB=["items","additionalItems","maxItems","minItems","uniqueItems","contains"],rB=["maxLength","minLength","pattern"],nB=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum"];function sB(t){for(let e of eB)if(e in t)return"object";for(let e of tB)if(e in t)return"array";for(let e of rB)if(e in t)return"string";for(let e of nB)if(e in t)return"number";return t.type}function iB(t,e,r,n){let s=e.schema,i=Object.keys(s.properties||{}),o=`
114
+ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode==="standalone"?bR()(u,r,a,l):u(l,a)}var iB=["properties","required","additionalProperties","patternProperties","maxProperties","minProperties","dependencies"],oB=["items","additionalItems","maxItems","minItems","uniqueItems","contains"],aB=["maxLength","minLength","pattern"],lB=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum"];function uB(t){for(let e of iB)if(e in t)return"object";for(let e of oB)if(e in t)return"array";for(let e of aB)if(e in t)return"string";for(let e of lB)if(e in t)return"number";return t.type}function cB(t,e,r,n){let s=e.schema,i=Object.keys(s.properties||{}),o=`
115
115
  const propertiesKeys = ${JSON.stringify(i)}
116
116
  for (const [key, value] of Object.entries(${n})) {
117
117
  if (
@@ -136,7 +136,7 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
136
136
  ${lt(t,f,"value")}
137
137
  `}return o+=`
138
138
  }
139
- `,o}function wR(t,e,r){let n=e.schema,s=e.getPropertyLocation("properties"),i=n.required||[],o=Object.keys(n.properties||{}).sort((f,p)=>{let h=i.includes(f),d=i.includes(p);return h===d?0:h?-1:1}),a="";for(let f of i)if(!o.includes(f)){let p=JSON.stringify(f);a+=`if (${r}[${p}] === undefined) throw new Error('${p.replace(/'/g,"\\'")} is required!')
139
+ `,o}function RR(t,e,r){let n=e.schema,s=e.getPropertyLocation("properties"),i=n.required||[],o=Object.keys(n.properties||{}).sort((f,p)=>{let h=i.includes(f),d=i.includes(p);return h===d?0:h?-1:1}),a="";for(let f of i)if(!o.includes(f)){let p=JSON.stringify(f);a+=`if (${r}[${p}] === undefined) throw new Error('${p.replace(/'/g,"\\'")} is required!')
140
140
  `}a+=`json += JSON_STR_BEGIN_OBJECT
141
141
  `;let l=t.uid++,u="";(o.length>1||n.patternProperties||n.additionalProperties!==void 0&&n.additionalProperties!==!1)&&(a+=`let addComma_${l} = false
142
142
  `,u=`!addComma_${l} && (addComma_${l} = true) || (json += JSON_STR_COMMA)`);for(let f of o){let p=s.getPropertyLocation(f);p.schema.$ref&&(p=xs(t,p));let h=JSON.stringify(f),d=`value_${f.replace(/[^a-zA-Z0-9]/g,"_")}_${t.uid++}`,m=p.schema.default,g=i.includes(f);a+=`
@@ -153,29 +153,29 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
153
153
  throw new Error('${h.replace(/'/g,"\\'")} is required!')
154
154
  }
155
155
  `:a+=`
156
- `}return(n.patternProperties||n.additionalProperties)&&(a+=iB(t,e,u,r)),a+=`
156
+ `}return(n.patternProperties||n.additionalProperties)&&(a+=cB(t,e,u,r)),a+=`
157
157
  json += JSON_STR_END_OBJECT
158
- `,a}function ql(t,e,r){for(let o=0,a=r.length;o<a;o++){let l=r[o];l.schema.$ref&&(r[o]=xs(t,l))}let n=[];for(let o of r){let a=TR(t,o.schema,o.schemaId);delete a.$id,n.push(a)}let s=Y4(n),i=new kn(s,e);return t.refResolver.addSchema(s,e),i}function TR(t,e,r){let n=Array.isArray(e)?[]:{};e.$id!==void 0&&e.$id.charAt(0)!=="#"&&(r=e.$id);let s=t.mergedSchemasIds.get(e);s&&t.mergedSchemasIds.set(n,s);for(let i in e){let o=e[i];i==="$ref"&&typeof o=="string"&&o.charAt(0)==="#"&&(o=r+o),typeof o=="object"&&o!==null&&(o=TR(t,o,r)),n[i]=o}return n}function RR(t){return`(${t} && typeof ${t}.toJSON === 'function')
158
+ `,a}function jl(t,e,r){for(let o=0,a=r.length;o<a;o++){let l=r[o];l.schema.$ref&&(r[o]=xs(t,l))}let n=[];for(let o of r){let a=$R(t,o.schema,o.schemaId);delete a.$id,n.push(a)}let s=tB(n),i=new kn(s,e);return t.refResolver.addSchema(s,e),i}function $R(t,e,r){let n=Array.isArray(e)?[]:{};e.$id!==void 0&&e.$id.charAt(0)!=="#"&&(r=e.$id);let s=t.mergedSchemasIds.get(e);s&&t.mergedSchemasIds.set(n,s);for(let i in e){let o=e[i];i==="$ref"&&typeof o=="string"&&o.charAt(0)==="#"&&(o=r+o),typeof o=="object"&&o!==null&&(o=$R(t,o,r)),n[i]=o}return n}function OR(t){return`(${t} && typeof ${t}.toJSON === 'function')
159
159
  ? ${t}.toJSON()
160
160
  : ${t}
161
- `}function oB(t,e,r){let n=e.schema;if(t.functionsNamesBySchema.has(n))return`json += ${t.functionsNamesBySchema.get(n)}(${r})`;let s=n.nullable===!0,i=e.schemaId||"",o=e.jsonPointer||"",a=`${i}#${o}`;if(t.recursivePaths.has(a)||t.buildingSet.has(n)){let c=$R(t);t.functionsNamesBySchema.set(n,c);let p=`
162
- // ${io(t,e)}
161
+ `}function fB(t,e,r){let n=e.schema;if(t.functionsNamesBySchema.has(n))return`json += ${t.functionsNamesBySchema.get(n)}(${r})`;let s=n.nullable===!0,i=e.schemaId||"",o=e.jsonPointer||"",a=`${i}#${o}`;if(t.recursivePaths.has(a)||t.buildingSet.has(n)){let c=PR(t);t.functionsNamesBySchema.set(n,c);let p=`
162
+ // ${oo(t,e)}
163
163
  function ${c} (input) {
164
- const obj = ${RR("input")}
164
+ const obj = ${OR("input")}
165
165
  if (obj === null) return ${s?"JSON_STR_NULL":"JSON_STR_EMPTY_OBJECT"}
166
166
  let json = ''
167
167
 
168
- ${wR(t,e,"obj")}
168
+ ${RR(t,e,"obj")}
169
169
  return json
170
170
  }
171
171
  `;return t.functions.push(p),`json += ${c}(${r})`}t.buildingSet.add(n);let l=`obj_${t.uid++}`,u=`
172
- const ${l} = ${RR(r)}
172
+ const ${l} = ${OR(r)}
173
173
  if (${l} === null) {
174
174
  json += ${s?"JSON_STR_NULL":"JSON_STR_EMPTY_OBJECT"}
175
175
  } else {
176
- ${wR(t,e,l)}
176
+ ${RR(t,e,l)}
177
177
  }
178
- `;return t.buildingSet.delete(n),u}function aB(t,e,r){let n=e.schema,s=e.getPropertyLocation("items");s.schema=s.schema||{},s.schema.$ref&&(s=xs(t,s));let i=s.schema;if(t.functionsNamesBySchema.has(n))return`json += ${t.functionsNamesBySchema.get(n)}(${r})`;let o=n.nullable===!0,a=e.schemaId||"",l=e.jsonPointer||"",u=`${a}#${l}`;if(t.recursivePaths.has(u)||t.buildingSet.has(n)){let h=$R(t);t.functionsNamesBySchema.set(n,h);let d=io(t,e),m=`
178
+ `;return t.buildingSet.delete(n),u}function dB(t,e,r){let n=e.schema,s=e.getPropertyLocation("items");s.schema=s.schema||{},s.schema.$ref&&(s=xs(t,s));let i=s.schema;if(t.functionsNamesBySchema.has(n))return`json += ${t.functionsNamesBySchema.get(n)}(${r})`;let o=n.nullable===!0,a=e.schemaId||"",l=e.jsonPointer||"",u=`${a}#${l}`;if(t.recursivePaths.has(u)||t.buildingSet.has(n)){let h=PR(t);t.functionsNamesBySchema.set(n,h);let d=oo(t,e),m=`
179
179
  function ${h} (obj) {
180
180
  // ${d}
181
181
  let json = ''
@@ -189,12 +189,12 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
189
189
  if (arrayLength > ${i.length}) {
190
190
  throw new Error(\`Item at ${i.length} does not match schema definition.\`)
191
191
  }
192
- `),xl==="json-stringify"&&(m+=`if (arrayLength >= ${no}) return JSON.stringify(obj)
192
+ `),Ll==="json-stringify"&&(m+=`if (arrayLength >= ${so}) return JSON.stringify(obj)
193
193
  `),m+=`
194
194
  json += JSON_STR_BEGIN_ARRAY
195
195
  `,Array.isArray(i)){for(let g=0,S=i.length;g<S;g++){let b=i[g],_=`value_${g}`;m+=`const ${_} = obj[${g}]`;let y=lt(t,s.getPropertyLocation(g),_);m+=`
196
196
  if (${g} < arrayLength) {
197
- if (${Ap(b.type,_)}) {
197
+ if (${Cp(b.type,_)}) {
198
198
  if (${g}) {
199
199
  json += JSON_STR_COMMA
200
200
  }
@@ -218,7 +218,7 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
218
218
  ${g}
219
219
  }`}return m+=`
220
220
  return json + JSON_STR_END_ARRAY
221
- }`,t.functions.push(m),`json += ${h}(${r})`}t.buildingSet.add(n);let c=io(t,e),f=`obj_${t.uid++}`,p=`
221
+ }`,t.functions.push(m),`json += ${h}(${r})`}t.buildingSet.add(n);let c=oo(t,e),f=`obj_${t.uid++}`,p=`
222
222
  const ${f} = ${r}
223
223
  if (${f} === null) {
224
224
  json += ${o?"JSON_STR_NULL":"JSON_STR_EMPTY_ARRAY"}
@@ -230,13 +230,13 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
230
230
  if (arrayLength_${f} > ${i.length}) {
231
231
  throw new Error(\`Item at ${i.length} does not match schema definition.\`)
232
232
  }
233
- `),xl==="json-stringify"&&(p+=`if (arrayLength_${f} >= ${no}) json += JSON.stringify(${f})
233
+ `),Ll==="json-stringify"&&(p+=`if (arrayLength_${f} >= ${so}) json += JSON.stringify(${f})
234
234
  else {`),p+=`
235
235
  json += JSON_STR_BEGIN_ARRAY
236
236
  `,Array.isArray(i)){let h=t.uid++;p+=`let addComma_${h} = false
237
237
  `;for(let d=0,m=i.length;d<m;d++){let g=i[d],S=`value_${d}_${t.uid++}`;p+=`const ${S} = ${f}[${d}]`;let b=lt(t,s.getPropertyLocation(d),S);p+=`
238
238
  if (${d} < arrayLength_${f}) {
239
- if (${Ap(g.type,S)}) {
239
+ if (${Cp(g.type,S)}) {
240
240
  !addComma_${h} && (addComma_${h} = true) || (json += JSON_STR_COMMA)
241
241
  ${b}
242
242
  } else {
@@ -256,7 +256,7 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
256
256
  ${h}
257
257
  }`}return p+=`
258
258
  json += JSON_STR_END_ARRAY
259
- `,xl==="json-stringify"&&(p+="}"),p+="}",t.buildingSet.delete(n),p}function Ap(t,e){let r;switch(t){case"null":r=`${e} === null`;break;case"string":r=`typeof ${e} === 'string' ||
259
+ `,Ll==="json-stringify"&&(p+="}"),p+="}",t.buildingSet.delete(n),p}function Cp(t,e){let r;switch(t){case"null":r=`${e} === null`;break;case"string":r=`typeof ${e} === 'string' ||
260
260
  ${e} === null ||
261
261
  ${e} instanceof Date ||
262
262
  ${e} instanceof RegExp ||
@@ -264,7 +264,7 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
264
264
  typeof ${e} === "object" &&
265
265
  typeof ${e}.toString === "function" &&
266
266
  ${e}.toString !== Object.prototype.toString
267
- )`;break;case"integer":r=`Number.isInteger(${e})`;break;case"number":r=`Number.isFinite(${e})`;break;case"boolean":r=`typeof ${e} === 'boolean'`;break;case"object":r=`${e} && typeof ${e} === 'object' && ${e}.constructor === Object`;break;case"array":r=`Array.isArray(${e})`;break;default:Array.isArray(t)&&(r=`(${t.map(s=>Ap(s,e)).join(" || ")})`)}return r}function $R(t){return"anonymous"+t.functionsCounter++}function lB(t,e,r){let s=e.schema.type.sort(o=>o==="null"?-1:1),i="";return s.forEach((o,a)=>{e.schema={...e.schema,type:o};let l=PR(t,e,r),u=a===0?"if":"else if";switch(o){case"null":i+=`
267
+ )`;break;case"integer":r=`Number.isInteger(${e})`;break;case"number":r=`Number.isFinite(${e})`;break;case"boolean":r=`typeof ${e} === 'boolean'`;break;case"object":r=`${e} && typeof ${e} === 'object' && ${e}.constructor === Object`;break;case"array":r=`Array.isArray(${e})`;break;default:Array.isArray(t)&&(r=`(${t.map(s=>Cp(s,e)).join(" || ")})`)}return r}function PR(t){return"anonymous"+t.functionsCounter++}function hB(t,e,r){let s=e.schema.type.sort(o=>o==="null"?-1:1),i="";return s.forEach((o,a)=>{e.schema={...e.schema,type:o};let l=AR(t,e,r),u=a===0?"if":"else if";switch(o){case"null":i+=`
268
268
  ${u} (${r} === null) {
269
269
  ${l}
270
270
  }
@@ -295,8 +295,8 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
295
295
  ${l}
296
296
  }
297
297
  `;break}}}),i+=`
298
- else throw new TypeError(\`The value of '${io(t,e)}' does not match schema definition.\`)
299
- `,i}function PR(t,e,r){let n=e.schema;switch(n.type){case"null":return"json += JSON_STR_NULL";case"string":return n.format==="date-time"?`json += asDateTime(${r})`:n.format==="date"?`json += asDate(${r})`:n.format==="time"?`json += asTime(${r})`:n.format==="unsafe"?`json += asUnsafeString(${r})`:`
298
+ else throw new TypeError(\`The value of '${oo(t,e)}' does not match schema definition.\`)
299
+ `,i}function AR(t,e,r){let n=e.schema;switch(n.type){case"null":return"json += JSON_STR_NULL";case"string":return n.format==="date-time"?`json += asDateTime(${r})`:n.format==="date"?`json += asDate(${r})`:n.format==="time"?`json += asTime(${r})`:n.format==="unsafe"?`json += asUnsafeString(${r})`:`
300
300
  if (typeof ${r} !== 'string') {
301
301
  if (${r} === null) {
302
302
  json += JSON_STR_EMPTY_STRING
@@ -310,44 +310,44 @@ ${o}`,ajv:l.ajv};let u=new Function("validator","serializer",o);return e.mode===
310
310
  } else {
311
311
  json += asString(${r})
312
312
  }
313
- `;case"integer":return`json += asInteger(${r})`;case"number":return`json += asNumber(${r})`;case"boolean":return`json += asBoolean(${r})`;case"object":return oB(t,e,r);case"array":return aB(t,e,r);case void 0:return`json += JSON.stringify(${r})`;default:throw new Error(`${n.type} unsupported`)}}function uB(t,e){let r=new Set;function n(s){let i=s.schema;if(typeof i!="object"||i===null)return;let o=s.schemaId||"",a=s.jsonPointer||"",l=`${o}#${a}`;if(r.has(l)){let u=!1;for(let c of r)c===l&&(u=!0),u&&t.recursivePaths.add(c);t.recursivePaths.add(l);return}if(r.add(l),i.$ref)try{let u=xs(t,s);n(u)}catch{}if(i.properties){let u=s.getPropertyLocation("properties");for(let c in i.properties)n(u.getPropertyLocation(c))}if(i.additionalProperties&&typeof i.additionalProperties=="object"&&n(s.getPropertyLocation("additionalProperties")),i.patternProperties){let u=s.getPropertyLocation("patternProperties");for(let c in i.patternProperties)n(u.getPropertyLocation(c))}if(i.items){let u=s.getPropertyLocation("items");if(Array.isArray(i.items))for(let c=0;c<i.items.length;c++)n(u.getPropertyLocation(c));else n(u)}if(i.additionalItems&&typeof i.additionalItems=="object"&&n(s.getPropertyLocation("additionalItems")),i.oneOf){let u=s.getPropertyLocation("oneOf");for(let c=0;c<i.oneOf.length;c++)n(u.getPropertyLocation(c))}if(i.anyOf){let u=s.getPropertyLocation("anyOf");for(let c=0;c<i.anyOf.length;c++)n(u.getPropertyLocation(c))}if(i.allOf){let u=s.getPropertyLocation("allOf");for(let c=0;c<i.allOf.length;c++)n(u.getPropertyLocation(c))}i.then&&n(s.getPropertyLocation("then")),i.else&&n(s.getPropertyLocation("else")),r.delete(l)}n(e)}function cB(t,e){let r=t.schema,n=r.type,s=Array.isArray(n)&&n.includes("null"),i="";return s&&(i+=`
313
+ `;case"integer":return`json += asInteger(${r})`;case"number":return`json += asNumber(${r})`;case"boolean":return`json += asBoolean(${r})`;case"object":return fB(t,e,r);case"array":return dB(t,e,r);case void 0:return`json += JSON.stringify(${r})`;default:throw new Error(`${n.type} unsupported`)}}function pB(t,e){let r=new Set;function n(s){let i=s.schema;if(typeof i!="object"||i===null)return;let o=s.schemaId||"",a=s.jsonPointer||"",l=`${o}#${a}`;if(r.has(l)){let u=!1;for(let c of r)c===l&&(u=!0),u&&t.recursivePaths.add(c);t.recursivePaths.add(l);return}if(r.add(l),i.$ref)try{let u=xs(t,s);n(u)}catch{}if(i.properties){let u=s.getPropertyLocation("properties");for(let c in i.properties)n(u.getPropertyLocation(c))}if(i.additionalProperties&&typeof i.additionalProperties=="object"&&n(s.getPropertyLocation("additionalProperties")),i.patternProperties){let u=s.getPropertyLocation("patternProperties");for(let c in i.patternProperties)n(u.getPropertyLocation(c))}if(i.items){let u=s.getPropertyLocation("items");if(Array.isArray(i.items))for(let c=0;c<i.items.length;c++)n(u.getPropertyLocation(c));else n(u)}if(i.additionalItems&&typeof i.additionalItems=="object"&&n(s.getPropertyLocation("additionalItems")),i.oneOf){let u=s.getPropertyLocation("oneOf");for(let c=0;c<i.oneOf.length;c++)n(u.getPropertyLocation(c))}if(i.anyOf){let u=s.getPropertyLocation("anyOf");for(let c=0;c<i.anyOf.length;c++)n(u.getPropertyLocation(c))}if(i.allOf){let u=s.getPropertyLocation("allOf");for(let c=0;c<i.allOf.length;c++)n(u.getPropertyLocation(c))}i.then&&n(s.getPropertyLocation("then")),i.else&&n(s.getPropertyLocation("else")),r.delete(l)}n(e)}function mB(t,e){let r=t.schema,n=r.type,s=Array.isArray(n)&&n.includes("null"),i="";return s&&(i+=`
314
314
  if (${e} === null) {
315
315
  json += JSON_STR_NULL
316
316
  } else {
317
- `),i+=`json += '${JSON.stringify(r.const).replace(X4,"\\'")}'`,s&&(i+=`
317
+ `),i+=`json += '${JSON.stringify(r.const).replace(rB,"\\'")}'`,s&&(i+=`
318
318
  }
319
- `),i}function fB(t,e,r){let n=e.schema,s=t.mergedSchemasIds.get(n);if(s){let c=Ll(t,s);return lt(t,c,r)}s=`__fjs_merged_${so++}`,t.mergedSchemasIds.set(n,s);let{allOf:i,...o}=e.schema,a=[new kn(o,e.schemaId,e.jsonPointer)],l=e.getPropertyLocation("allOf");for(let c=0,f=i.length;c<f;c++)a.push(l.getPropertyLocation(c));let u=ql(t,s,a);return lt(t,u,r)}function dB(t,e,r){t.validatorSchemasIds.add(e.schemaId);let s=e.schema.anyOf?"anyOf":"oneOf",{[s]:i,...o}=e.schema,a=new kn(o,e.schemaId,e.jsonPointer),l=e.getPropertyLocation(s),u="";for(let c=0,f=i.length;c<f;c++){let p=l.getPropertyLocation(c),h=p.schema,d=t.mergedSchemasIds.get(h),m=null;d?m=Ll(t,d):(d=`__fjs_merged_${so++}`,t.mergedSchemasIds.set(h,d),m=ql(t,d,[a,p]));let g=lt(t,m,r),S=p.getSchemaRef();u+=`
319
+ `),i}function gB(t,e,r){let n=e.schema,s=t.mergedSchemasIds.get(n);if(s){let c=ql(t,s);return lt(t,c,r)}s=`__fjs_merged_${io++}`,t.mergedSchemasIds.set(n,s);let{allOf:i,...o}=e.schema,a=[new kn(o,e.schemaId,e.jsonPointer)],l=e.getPropertyLocation("allOf");for(let c=0,f=i.length;c<f;c++)a.push(l.getPropertyLocation(c));let u=jl(t,s,a);return lt(t,u,r)}function yB(t,e,r){t.validatorSchemasIds.add(e.schemaId);let s=e.schema.anyOf?"anyOf":"oneOf",{[s]:i,...o}=e.schema,a=new kn(o,e.schemaId,e.jsonPointer),l=e.getPropertyLocation(s),u="";for(let c=0,f=i.length;c<f;c++){let p=l.getPropertyLocation(c),h=p.schema,d=t.mergedSchemasIds.get(h),m=null;d?m=ql(t,d):(d=`__fjs_merged_${io++}`,t.mergedSchemasIds.set(h,d),m=jl(t,d,[a,p]));let g=lt(t,m,r),S=p.getSchemaRef();u+=`
320
320
  ${c===0?"if":"else if"}(validator.validate("${S}", ${r})) {
321
321
  ${g}
322
322
  }
323
323
  `}return u+=`
324
- else throw new TypeError(\`The value of '${io(t,e)}' does not match schema definition.\`)
325
- `,u}function hB(t,e,r){t.validatorSchemasIds.add(e.schemaId);let{if:n,then:s,else:i,...o}=e.schema,a=new kn(o,e.schemaId,e.jsonPointer),u=e.getPropertyLocation("if").getSchemaRef(),c=e.getPropertyLocation("then"),f=t.mergedSchemasIds.get(s),p=null;if(f?p=Ll(t,f):(f=`__fjs_merged_${so++}`,t.mergedSchemasIds.set(s,f),p=ql(t,f,[a,c])),!i)return`
324
+ else throw new TypeError(\`The value of '${oo(t,e)}' does not match schema definition.\`)
325
+ `,u}function _B(t,e,r){t.validatorSchemasIds.add(e.schemaId);let{if:n,then:s,else:i,...o}=e.schema,a=new kn(o,e.schemaId,e.jsonPointer),u=e.getPropertyLocation("if").getSchemaRef(),c=e.getPropertyLocation("then"),f=t.mergedSchemasIds.get(s),p=null;if(f?p=ql(t,f):(f=`__fjs_merged_${io++}`,t.mergedSchemasIds.set(s,f),p=jl(t,f,[a,c])),!i)return`
326
326
  if (validator.validate("${u}", ${r})) {
327
327
  ${lt(t,p,r)}
328
328
  } else {
329
329
  ${lt(t,a,r)}
330
330
  }
331
- `;let h=e.getPropertyLocation("else"),d=t.mergedSchemasIds.get(i),m=null;return d?m=Ll(t,d):(d=`__fjs_merged_${so++}`,t.mergedSchemasIds.set(i,d),m=ql(t,d,[a,h])),`
331
+ `;let h=e.getPropertyLocation("else"),d=t.mergedSchemasIds.get(i),m=null;return d?m=ql(t,d):(d=`__fjs_merged_${io++}`,t.mergedSchemasIds.set(i,d),m=jl(t,d,[a,h])),`
332
332
  if (validator.validate("${u}", ${r})) {
333
333
  ${lt(t,p,r)}
334
334
  } else {
335
335
  ${lt(t,m,r)}
336
336
  }
337
- `}function lt(t,e,r){let n=e.schema;if(typeof n=="boolean")return`json += JSON.stringify(${r})`;if(n.$ref&&(e=xs(t,e),n=e.schema),n.allOf)return fB(t,e,r);if(n.anyOf||n.oneOf)return dB(t,e,r);if(n.if&&n.then)return hB(t,e,r);if(n.type===void 0){let a=sB(n);a&&(n.type=a)}let s="",i=n.type,o=n.nullable===!0;return o&&(s+=`
337
+ `}function lt(t,e,r){let n=e.schema;if(typeof n=="boolean")return`json += JSON.stringify(${r})`;if(n.$ref&&(e=xs(t,e),n=e.schema),n.allOf)return gB(t,e,r);if(n.anyOf||n.oneOf)return yB(t,e,r);if(n.if&&n.then)return _B(t,e,r);if(n.type===void 0){let a=uB(n);a&&(n.type=a)}let s="",i=n.type,o=n.nullable===!0;return o&&(s+=`
338
338
  if (${r} === null) {
339
339
  json += JSON_STR_NULL
340
340
  } else {
341
- `),n.const!==void 0?s+=cB(e,r):Array.isArray(i)?s+=lB(t,e,r):s+=PR(t,e,r),o&&(s+=`
341
+ `),n.const!==void 0?s+=mB(e,r):Array.isArray(i)?s+=hB(t,e,r):s+=AR(t,e,r),o&&(s+=`
342
342
  }
343
- `),s}Ls.exports=Cp;Ls.exports.default=Cp;Ls.exports.build=Cp;Ls.exports.validLargeArrayMechanisms=OR;Ls.exports.restore=function({code:t,validator:e,serializer:r}){return Function.apply(null,["validator","serializer",t]).apply(null,[e,r])}});var NR=E((F7,jl)=>{"use strict";var pB=AR();function CR(){return function(e,r){let n=Object.assign({},r,{schema:e});return mB.bind(null,n)}}function mB(t,{schema:e}){return t.schema&&e.$id&&t.schema[e.$id]&&(t.schema={...t.schema},delete t.schema[e.$id]),pB(e,t)}function IR(t={readMode:!0}){if(t.readMode===!0&&typeof t.restoreFunction!="function")throw new Error("You must provide a function for the restoreFunction-option when readMode ON");if(t.readMode!==!0&&typeof t.storeFunction!="function")throw new Error("You must provide a function for the storeFunction-option when readMode OFF");if(t.readMode===!0)return function(){return function(n){return t.restoreFunction(n)}};let e=CR();return function(n,s={}){s.mode="standalone";let i=e(n,s);return function(o){let a=i(o);return t.storeFunction(o,a),new Function(a)}}}jl.exports.SerializerSelector=CR;jl.exports.StandaloneSerializer=IR;jl.exports.default=IR});var kR=E((M7,oo)=>{"use strict";var{SerializerSelector:Ip,StandaloneSerializer:gB}=NR();oo.exports=Ip;oo.exports.default=Ip;oo.exports.SerializerSelector=Ip;oo.exports.StandaloneSerializer=gB});var Np=E((H7,xR)=>{"use strict";var{buildSchemas:yB}=li();function _B(t,e){if(t)return new qs(t,e);let r=Object.assign({buildValidator:null,buildSerializer:null},e?.compilersFactory);if(!r.buildValidator){let s=pp();r.buildValidator=s()}if(!r.buildSerializer){let s=kR();r.buildSerializer=s()}let n={bucket:e&&e.bucket||yB,compilersFactory:r,isCustomValidatorCompiler:typeof e?.compilersFactory?.buildValidator=="function",isCustomSerializerCompiler:typeof e?.compilersFactory?.buildValidator=="function"};return new qs(void 0,n)}var qs=class{constructor(e,r){this.opts=r||e?.opts,this.addedSchemas=!1,this.compilersFactory=this.opts.compilersFactory,e?(this.schemaBucket=this.opts.bucket(e.getSchemas()),this.validatorCompiler=e.getValidatorCompiler(),this.serializerCompiler=e.getSerializerCompiler(),this.isCustomValidatorCompiler=e.isCustomValidatorCompiler,this.isCustomSerializerCompiler=e.isCustomSerializerCompiler,this.parent=e):(this.schemaBucket=this.opts.bucket(),this.isCustomValidatorCompiler=this.opts.isCustomValidatorCompiler||!1,this.isCustomSerializerCompiler=this.opts.isCustomSerializerCompiler||!1)}add(e){return this.addedSchemas=!0,this.schemaBucket.add(e)}getSchema(e){return this.schemaBucket.getSchema(e)}getSchemas(){return this.schemaBucket.getSchemas()}setValidatorCompiler(e){this.compilersFactory=Object.assign({},this.compilersFactory,{buildValidator:()=>e}),this.validatorCompiler=e,this.isCustomValidatorCompiler=!0}setSerializerCompiler(e){this.compilersFactory=Object.assign({},this.compilersFactory,{buildSerializer:()=>e}),this.serializerCompiler=e,this.isCustomSerializerCompiler=!0}getValidatorCompiler(){return this.validatorCompiler||this.parent&&this.parent.getValidatorCompiler()}getSerializerCompiler(){return this.serializerCompiler||this.parent&&this.parent.getSerializerCompiler()}getSerializerBuilder(){return this.compilersFactory.buildSerializer||this.parent&&this.parent.getSerializerBuilder()}getValidatorBuilder(){return this.compilersFactory.buildValidator||this.parent&&this.parent.getValidatorBuilder()}setupValidator(e){this.validatorCompiler!==void 0&&!this.addedSchemas||(this.validatorCompiler=this.getValidatorBuilder()(this.schemaBucket.getSchemas(),e.ajv))}setupSerializer(e){this.serializerCompiler!==void 0&&!this.addedSchemas||(this.serializerCompiler=this.getSerializerBuilder()(this.schemaBucket.getSchemas(),e.serializerOpts))}};qs.buildSchemaController=_B;xR.exports=qs});var ao=E((V7,LR)=>{"use strict";var SB="2.0.0",EB=Number.MAX_SAFE_INTEGER||9007199254740991,bB=16,vB=250,wB=["major","premajor","minor","preminor","patch","prepatch","prerelease"];LR.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:bB,MAX_SAFE_BUILD_LENGTH:vB,MAX_SAFE_INTEGER:EB,RELEASE_TYPES:wB,SEMVER_SPEC_VERSION:SB,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var lo=E((z7,qR)=>{"use strict";var RB=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};qR.exports=RB});var js=E((dr,jR)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:kp,MAX_SAFE_BUILD_LENGTH:OB,MAX_LENGTH:TB}=ao(),$B=lo();dr=jR.exports={};var PB=dr.re=[],AB=dr.safeRe=[],D=dr.src=[],CB=dr.safeSrc=[],F=dr.t={},IB=0,xp="[a-zA-Z0-9-]",NB=[["\\s",1],["\\d",TB],[xp,OB]],kB=t=>{for(let[e,r]of NB)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},X=(t,e,r)=>{let n=kB(e),s=IB++;$B(t,s,e),F[t]=s,D[s]=e,CB[s]=n,PB[s]=new RegExp(e,r?"g":void 0),AB[s]=new RegExp(n,r?"g":void 0)};X("NUMERICIDENTIFIER","0|[1-9]\\d*");X("NUMERICIDENTIFIERLOOSE","\\d+");X("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${xp}*`);X("MAINVERSION",`(${D[F.NUMERICIDENTIFIER]})\\.(${D[F.NUMERICIDENTIFIER]})\\.(${D[F.NUMERICIDENTIFIER]})`);X("MAINVERSIONLOOSE",`(${D[F.NUMERICIDENTIFIERLOOSE]})\\.(${D[F.NUMERICIDENTIFIERLOOSE]})\\.(${D[F.NUMERICIDENTIFIERLOOSE]})`);X("PRERELEASEIDENTIFIER",`(?:${D[F.NONNUMERICIDENTIFIER]}|${D[F.NUMERICIDENTIFIER]})`);X("PRERELEASEIDENTIFIERLOOSE",`(?:${D[F.NONNUMERICIDENTIFIER]}|${D[F.NUMERICIDENTIFIERLOOSE]})`);X("PRERELEASE",`(?:-(${D[F.PRERELEASEIDENTIFIER]}(?:\\.${D[F.PRERELEASEIDENTIFIER]})*))`);X("PRERELEASELOOSE",`(?:-?(${D[F.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${D[F.PRERELEASEIDENTIFIERLOOSE]})*))`);X("BUILDIDENTIFIER",`${xp}+`);X("BUILD",`(?:\\+(${D[F.BUILDIDENTIFIER]}(?:\\.${D[F.BUILDIDENTIFIER]})*))`);X("FULLPLAIN",`v?${D[F.MAINVERSION]}${D[F.PRERELEASE]}?${D[F.BUILD]}?`);X("FULL",`^${D[F.FULLPLAIN]}$`);X("LOOSEPLAIN",`[v=\\s]*${D[F.MAINVERSIONLOOSE]}${D[F.PRERELEASELOOSE]}?${D[F.BUILD]}?`);X("LOOSE",`^${D[F.LOOSEPLAIN]}$`);X("GTLT","((?:<|>)?=?)");X("XRANGEIDENTIFIERLOOSE",`${D[F.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);X("XRANGEIDENTIFIER",`${D[F.NUMERICIDENTIFIER]}|x|X|\\*`);X("XRANGEPLAIN",`[v=\\s]*(${D[F.XRANGEIDENTIFIER]})(?:\\.(${D[F.XRANGEIDENTIFIER]})(?:\\.(${D[F.XRANGEIDENTIFIER]})(?:${D[F.PRERELEASE]})?${D[F.BUILD]}?)?)?`);X("XRANGEPLAINLOOSE",`[v=\\s]*(${D[F.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[F.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[F.XRANGEIDENTIFIERLOOSE]})(?:${D[F.PRERELEASELOOSE]})?${D[F.BUILD]}?)?)?`);X("XRANGE",`^${D[F.GTLT]}\\s*${D[F.XRANGEPLAIN]}$`);X("XRANGELOOSE",`^${D[F.GTLT]}\\s*${D[F.XRANGEPLAINLOOSE]}$`);X("COERCEPLAIN",`(^|[^\\d])(\\d{1,${kp}})(?:\\.(\\d{1,${kp}}))?(?:\\.(\\d{1,${kp}}))?`);X("COERCE",`${D[F.COERCEPLAIN]}(?:$|[^\\d])`);X("COERCEFULL",D[F.COERCEPLAIN]+`(?:${D[F.PRERELEASE]})?(?:${D[F.BUILD]})?(?:$|[^\\d])`);X("COERCERTL",D[F.COERCE],!0);X("COERCERTLFULL",D[F.COERCEFULL],!0);X("LONETILDE","(?:~>?)");X("TILDETRIM",`(\\s*)${D[F.LONETILDE]}\\s+`,!0);dr.tildeTrimReplace="$1~";X("TILDE",`^${D[F.LONETILDE]}${D[F.XRANGEPLAIN]}$`);X("TILDELOOSE",`^${D[F.LONETILDE]}${D[F.XRANGEPLAINLOOSE]}$`);X("LONECARET","(?:\\^)");X("CARETTRIM",`(\\s*)${D[F.LONECARET]}\\s+`,!0);dr.caretTrimReplace="$1^";X("CARET",`^${D[F.LONECARET]}${D[F.XRANGEPLAIN]}$`);X("CARETLOOSE",`^${D[F.LONECARET]}${D[F.XRANGEPLAINLOOSE]}$`);X("COMPARATORLOOSE",`^${D[F.GTLT]}\\s*(${D[F.LOOSEPLAIN]})$|^$`);X("COMPARATOR",`^${D[F.GTLT]}\\s*(${D[F.FULLPLAIN]})$|^$`);X("COMPARATORTRIM",`(\\s*)${D[F.GTLT]}\\s*(${D[F.LOOSEPLAIN]}|${D[F.XRANGEPLAIN]})`,!0);dr.comparatorTrimReplace="$1$2$3";X("HYPHENRANGE",`^\\s*(${D[F.XRANGEPLAIN]})\\s+-\\s+(${D[F.XRANGEPLAIN]})\\s*$`);X("HYPHENRANGELOOSE",`^\\s*(${D[F.XRANGEPLAINLOOSE]})\\s+-\\s+(${D[F.XRANGEPLAINLOOSE]})\\s*$`);X("STAR","(<|>)?=?\\s*\\*");X("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");X("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Dl=E((U7,DR)=>{"use strict";var xB=Object.freeze({loose:!0}),LB=Object.freeze({}),qB=t=>t?typeof t!="object"?xB:t:LB;DR.exports=qB});var Lp=E((B7,HR)=>{"use strict";var FR=/^[0-9]+$/,MR=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=FR.test(t),n=FR.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},jB=(t,e)=>MR(e,t);HR.exports={compareIdentifiers:MR,rcompareIdentifiers:jB}});var tt=E((G7,zR)=>{"use strict";var Fl=lo(),{MAX_LENGTH:VR,MAX_SAFE_INTEGER:Ml}=ao(),{safeRe:Hl,t:Vl}=js(),DB=Dl(),{compareIdentifiers:qp}=Lp(),jp=class t{constructor(e,r){if(r=DB(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>VR)throw new TypeError(`version is longer than ${VR} characters`);Fl("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Hl[Vl.LOOSE]:Hl[Vl.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ml||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ml||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ml||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let i=+s;if(i>=0&&i<Ml)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Fl("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=e.prerelease[r];if(Fl("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return qp(n,s)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],s=e.build[r];if(Fl("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return qp(n,s)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?Hl[Vl.PRERELEASELOOSE]:Hl[Vl.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),qp(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};zR.exports=jp});var xn=E((W7,BR)=>{"use strict";var UR=tt(),FB=(t,e,r=!1)=>{if(t instanceof UR)return t;try{return new UR(t,e)}catch(n){if(!r)return null;throw n}};BR.exports=FB});var WR=E((J7,GR)=>{"use strict";var MB=xn(),HB=(t,e)=>{let r=MB(t,e);return r?r.version:null};GR.exports=HB});var KR=E((K7,JR)=>{"use strict";var VB=xn(),zB=(t,e)=>{let r=VB(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};JR.exports=zB});var QR=E((Y7,XR)=>{"use strict";var YR=tt(),UB=(t,e,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new YR(t instanceof YR?t.version:t,r).inc(e,n,s).version}catch{return null}};XR.exports=UB});var tO=E((X7,eO)=>{"use strict";var ZR=xn(),BB=(t,e)=>{let r=ZR(t,null,!0),n=ZR(e,null,!0),s=r.compare(n);if(s===0)return null;let i=s>0,o=i?r:n,a=i?n:r,l=!!o.prerelease.length;if(!!a.prerelease.length&&!l){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let c=l?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":"prerelease"};eO.exports=BB});var nO=E((Q7,rO)=>{"use strict";var GB=tt(),WB=(t,e)=>new GB(t,e).major;rO.exports=WB});var iO=E((Z7,sO)=>{"use strict";var JB=tt(),KB=(t,e)=>new JB(t,e).minor;sO.exports=KB});var aO=E((eX,oO)=>{"use strict";var YB=tt(),XB=(t,e)=>new YB(t,e).patch;oO.exports=XB});var uO=E((tX,lO)=>{"use strict";var QB=xn(),ZB=(t,e)=>{let r=QB(t,e);return r&&r.prerelease.length?r.prerelease:null};lO.exports=ZB});var qt=E((rX,fO)=>{"use strict";var cO=tt(),e5=(t,e,r)=>new cO(t,r).compare(new cO(e,r));fO.exports=e5});var hO=E((nX,dO)=>{"use strict";var t5=qt(),r5=(t,e,r)=>t5(e,t,r);dO.exports=r5});var mO=E((sX,pO)=>{"use strict";var n5=qt(),s5=(t,e)=>n5(t,e,!0);pO.exports=s5});var zl=E((iX,yO)=>{"use strict";var gO=tt(),i5=(t,e,r)=>{let n=new gO(t,r),s=new gO(e,r);return n.compare(s)||n.compareBuild(s)};yO.exports=i5});var SO=E((oX,_O)=>{"use strict";var o5=zl(),a5=(t,e)=>t.sort((r,n)=>o5(r,n,e));_O.exports=a5});var bO=E((aX,EO)=>{"use strict";var l5=zl(),u5=(t,e)=>t.sort((r,n)=>l5(n,r,e));EO.exports=u5});var uo=E((lX,vO)=>{"use strict";var c5=qt(),f5=(t,e,r)=>c5(t,e,r)>0;vO.exports=f5});var Ul=E((uX,wO)=>{"use strict";var d5=qt(),h5=(t,e,r)=>d5(t,e,r)<0;wO.exports=h5});var Dp=E((cX,RO)=>{"use strict";var p5=qt(),m5=(t,e,r)=>p5(t,e,r)===0;RO.exports=m5});var Fp=E((fX,OO)=>{"use strict";var g5=qt(),y5=(t,e,r)=>g5(t,e,r)!==0;OO.exports=y5});var Bl=E((dX,TO)=>{"use strict";var _5=qt(),S5=(t,e,r)=>_5(t,e,r)>=0;TO.exports=S5});var Gl=E((hX,$O)=>{"use strict";var E5=qt(),b5=(t,e,r)=>E5(t,e,r)<=0;$O.exports=b5});var Mp=E((pX,PO)=>{"use strict";var v5=Dp(),w5=Fp(),R5=uo(),O5=Bl(),T5=Ul(),$5=Gl(),P5=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return v5(t,r,n);case"!=":return w5(t,r,n);case">":return R5(t,r,n);case">=":return O5(t,r,n);case"<":return T5(t,r,n);case"<=":return $5(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};PO.exports=P5});var CO=E((mX,AO)=>{"use strict";var A5=tt(),C5=xn(),{safeRe:Wl,t:Jl}=js(),I5=(t,e)=>{if(t instanceof A5)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Wl[Jl.COERCEFULL]:Wl[Jl.COERCE]);else{let l=e.includePrerelease?Wl[Jl.COERCERTLFULL]:Wl[Jl.COERCERTL],u;for(;(u=l.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),l.lastIndex=u.index+u[1].length+u[2].length;l.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",i=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return C5(`${n}.${s}.${i}${o}${a}`,e)};AO.exports=I5});var NO=E((gX,IO)=>{"use strict";var Hp=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,r)}return this}};IO.exports=Hp});var jt=E((yX,qO)=>{"use strict";var N5=/\s+/g,Vp=class t{constructor(e,r){if(r=x5(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof zp)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(N5," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!xO(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&H5(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&F5)|(this.options.loose&&M5))+":"+e,s=kO.get(n);if(s)return s;let i=this.options.loose,o=i?ut[rt.HYPHENRANGELOOSE]:ut[rt.HYPHENRANGE];e=e.replace(o,X5(this.options.includePrerelease)),Re("hyphen replace",e),e=e.replace(ut[rt.COMPARATORTRIM],q5),Re("comparator trim",e),e=e.replace(ut[rt.TILDETRIM],j5),Re("tilde trim",e),e=e.replace(ut[rt.CARETTRIM],D5),Re("caret trim",e);let a=e.split(" ").map(f=>V5(f,this.options)).join(" ").split(/\s+/).map(f=>Y5(f,this.options));i&&(a=a.filter(f=>(Re("loose invalid filter",f,this.options),!!f.match(ut[rt.COMPARATORLOOSE])))),Re("range list",a);let l=new Map,u=a.map(f=>new zp(f,this.options));for(let f of u){if(xO(f))return[f];l.set(f.value,f)}l.size>1&&l.has("")&&l.delete("");let c=[...l.values()];return kO.set(n,c),c}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>LO(n,r)&&e.set.some(s=>LO(s,r)&&n.every(i=>s.every(o=>i.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new L5(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Q5(this.set[r],e,this.options))return!0;return!1}};qO.exports=Vp;var k5=NO(),kO=new k5,x5=Dl(),zp=co(),Re=lo(),L5=tt(),{safeRe:ut,t:rt,comparatorTrimReplace:q5,tildeTrimReplace:j5,caretTrimReplace:D5}=js(),{FLAG_INCLUDE_PRERELEASE:F5,FLAG_LOOSE:M5}=ao(),xO=t=>t.value==="<0.0.0-0",H5=t=>t.value==="",LO=(t,e)=>{let r=!0,n=t.slice(),s=n.pop();for(;r&&n.length;)r=n.every(i=>s.intersects(i,e)),s=n.pop();return r},V5=(t,e)=>(t=t.replace(ut[rt.BUILD],""),Re("comp",t,e),t=B5(t,e),Re("caret",t),t=z5(t,e),Re("tildes",t),t=W5(t,e),Re("xrange",t),t=K5(t,e),Re("stars",t),t),ct=t=>!t||t.toLowerCase()==="x"||t==="*",z5=(t,e)=>t.trim().split(/\s+/).map(r=>U5(r,e)).join(" "),U5=(t,e)=>{let r=e.loose?ut[rt.TILDELOOSE]:ut[rt.TILDE];return t.replace(r,(n,s,i,o,a)=>{Re("tilde",t,n,s,i,o,a);let l;return ct(s)?l="":ct(i)?l=`>=${s}.0.0 <${+s+1}.0.0-0`:ct(o)?l=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:a?(Re("replaceTilde pr",a),l=`>=${s}.${i}.${o}-${a} <${s}.${+i+1}.0-0`):l=`>=${s}.${i}.${o} <${s}.${+i+1}.0-0`,Re("tilde return",l),l})},B5=(t,e)=>t.trim().split(/\s+/).map(r=>G5(r,e)).join(" "),G5=(t,e)=>{Re("caret",t,e);let r=e.loose?ut[rt.CARETLOOSE]:ut[rt.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(s,i,o,a,l)=>{Re("caret",t,s,i,o,a,l);let u;return ct(i)?u="":ct(o)?u=`>=${i}.0.0${n} <${+i+1}.0.0-0`:ct(a)?i==="0"?u=`>=${i}.${o}.0${n} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.0${n} <${+i+1}.0.0-0`:l?(Re("replaceCaret pr",l),i==="0"?o==="0"?u=`>=${i}.${o}.${a}-${l} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}-${l} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a}-${l} <${+i+1}.0.0-0`):(Re("no pr"),i==="0"?o==="0"?u=`>=${i}.${o}.${a}${n} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}${n} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a} <${+i+1}.0.0-0`),Re("caret return",u),u})},W5=(t,e)=>(Re("replaceXRanges",t,e),t.split(/\s+/).map(r=>J5(r,e)).join(" ")),J5=(t,e)=>{t=t.trim();let r=e.loose?ut[rt.XRANGELOOSE]:ut[rt.XRANGE];return t.replace(r,(n,s,i,o,a,l)=>{Re("xRange",t,n,s,i,o,a,l);let u=ct(i),c=u||ct(o),f=c||ct(a),p=f;return s==="="&&p&&(s=""),l=e.includePrerelease?"-0":"",u?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&p?(c&&(o=0),a=0,s===">"?(s=">=",c?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):s==="<="&&(s="<",c?i=+i+1:o=+o+1),s==="<"&&(l="-0"),n=`${s+i}.${o}.${a}${l}`):c?n=`>=${i}.0.0${l} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`),Re("xRange return",n),n})},K5=(t,e)=>(Re("replaceStars",t,e),t.trim().replace(ut[rt.STAR],"")),Y5=(t,e)=>(Re("replaceGTE0",t,e),t.trim().replace(ut[e.includePrerelease?rt.GTE0PRE:rt.GTE0],"")),X5=t=>(e,r,n,s,i,o,a,l,u,c,f,p)=>(ct(n)?r="":ct(s)?r=`>=${n}.0.0${t?"-0":""}`:ct(i)?r=`>=${n}.${s}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,ct(u)?l="":ct(c)?l=`<${+u+1}.0.0-0`:ct(f)?l=`<${u}.${+c+1}.0-0`:p?l=`<=${u}.${c}.${f}-${p}`:t?l=`<${u}.${c}.${+f+1}-0`:l=`<=${l}`,`${r} ${l}`.trim()),Q5=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Re(t[n].semver),t[n].semver!==zp.ANY&&t[n].semver.prerelease.length>0){let s=t[n].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var co=E((_X,VO)=>{"use strict";var fo=Symbol("SemVer ANY"),Gp=class t{static get ANY(){return fo}constructor(e,r){if(r=jO(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Bp("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===fo?this.value="":this.value=this.operator+this.semver.version,Bp("comp",this)}parse(e){let r=this.options.loose?DO[FO.COMPARATORLOOSE]:DO[FO.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new MO(n[2],this.options.loose):this.semver=fo}toString(){return this.value}test(e){if(Bp("Comparator.test",e,this.options.loose),this.semver===fo||e===fo)return!0;if(typeof e=="string")try{e=new MO(e,this.options)}catch{return!1}return Up(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new HO(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new HO(this.value,r).test(e.semver):(r=jO(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Up(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Up(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};VO.exports=Gp;var jO=Dl(),{safeRe:DO,t:FO}=js(),Up=Mp(),Bp=lo(),MO=tt(),HO=jt()});var ho=E((SX,zO)=>{"use strict";var Z5=jt(),eG=(t,e,r)=>{try{e=new Z5(e,r)}catch{return!1}return e.test(t)};zO.exports=eG});var BO=E((EX,UO)=>{"use strict";var tG=jt(),rG=(t,e)=>new tG(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));UO.exports=rG});var WO=E((bX,GO)=>{"use strict";var nG=tt(),sG=jt(),iG=(t,e,r)=>{let n=null,s=null,i=null;try{i=new sG(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new nG(n,r))}),n};GO.exports=iG});var KO=E((vX,JO)=>{"use strict";var oG=tt(),aG=jt(),lG=(t,e,r)=>{let n=null,s=null,i=null;try{i=new aG(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new oG(n,r))}),n};JO.exports=lG});var QO=E((wX,XO)=>{"use strict";var Wp=tt(),uG=jt(),YO=uo(),cG=(t,e)=>{t=new uG(t,e);let r=new Wp("0.0.0");if(t.test(r)||(r=new Wp("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let s=t.set[n],i=null;s.forEach(o=>{let a=new Wp(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||YO(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||YO(r,i))&&(r=i)}return r&&t.test(r)?r:null};XO.exports=cG});var eT=E((RX,ZO)=>{"use strict";var fG=jt(),dG=(t,e)=>{try{return new fG(t,e).range||"*"}catch{return null}};ZO.exports=dG});var Kl=E((OX,sT)=>{"use strict";var hG=tt(),nT=co(),{ANY:pG}=nT,mG=jt(),gG=ho(),tT=uo(),rT=Ul(),yG=Gl(),_G=Bl(),SG=(t,e,r,n)=>{t=new hG(t,n),e=new mG(e,n);let s,i,o,a,l;switch(r){case">":s=tT,i=yG,o=rT,a=">",l=">=";break;case"<":s=rT,i=_G,o=tT,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(gG(t,e,n))return!1;for(let u=0;u<e.set.length;++u){let c=e.set[u],f=null,p=null;if(c.forEach(h=>{h.semver===pG&&(h=new nT(">=0.0.0")),f=f||h,p=p||h,s(h.semver,f.semver,n)?f=h:o(h.semver,p.semver,n)&&(p=h)}),f.operator===a||f.operator===l||(!p.operator||p.operator===a)&&i(t,p.semver))return!1;if(p.operator===l&&o(t,p.semver))return!1}return!0};sT.exports=SG});var oT=E((TX,iT)=>{"use strict";var EG=Kl(),bG=(t,e,r)=>EG(t,e,">",r);iT.exports=bG});var lT=E(($X,aT)=>{"use strict";var vG=Kl(),wG=(t,e,r)=>vG(t,e,"<",r);aT.exports=wG});var fT=E((PX,cT)=>{"use strict";var uT=jt(),RG=(t,e,r)=>(t=new uT(t,r),e=new uT(e,r),t.intersects(e,r));cT.exports=RG});var hT=E((AX,dT)=>{"use strict";var OG=ho(),TG=qt();dT.exports=(t,e,r)=>{let n=[],s=null,i=null,o=t.sort((c,f)=>TG(c,f,r));for(let c of o)OG(c,e,r)?(i=c,s||(s=c)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);let a=[];for(let[c,f]of n)c===f?a.push(c):!f&&c===o[0]?a.push("*"):f?c===o[0]?a.push(`<=${f}`):a.push(`${c} - ${f}`):a.push(`>=${c}`);let l=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return l.length<u.length?l:e}});var ST=E((CX,_T)=>{"use strict";var pT=jt(),Kp=co(),{ANY:Jp}=Kp,po=ho(),Yp=qt(),$G=(t,e,r={})=>{if(t===e)return!0;t=new pT(t,r),e=new pT(e,r);let n=!1;e:for(let s of t.set){for(let i of e.set){let o=AG(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},PG=[new Kp(">=0.0.0-0")],mT=[new Kp(">=0.0.0")],AG=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Jp){if(e.length===1&&e[0].semver===Jp)return!0;r.includePrerelease?t=PG:t=mT}if(e.length===1&&e[0].semver===Jp){if(r.includePrerelease)return!0;e=mT}let n=new Set,s,i;for(let h of t)h.operator===">"||h.operator===">="?s=gT(s,h,r):h.operator==="<"||h.operator==="<="?i=yT(i,h,r):n.add(h.semver);if(n.size>1)return null;let o;if(s&&i){if(o=Yp(s.semver,i.semver,r),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(let h of n){if(s&&!po(h,String(s),r)||i&&!po(h,String(i),r))return null;for(let d of e)if(!po(h,String(d),r))return!1;return!0}let a,l,u,c,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&i.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let h of e){if(c=c||h.operator===">"||h.operator===">=",u=u||h.operator==="<"||h.operator==="<=",s){if(p&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===p.major&&h.semver.minor===p.minor&&h.semver.patch===p.patch&&(p=!1),h.operator===">"||h.operator===">="){if(a=gT(s,h,r),a===h&&a!==s)return!1}else if(s.operator===">="&&!po(s.semver,String(h),r))return!1}if(i){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator==="<"||h.operator==="<="){if(l=yT(i,h,r),l===h&&l!==i)return!1}else if(i.operator==="<="&&!po(i.semver,String(h),r))return!1}if(!h.operator&&(i||s)&&o!==0)return!1}return!(s&&u&&!i&&o!==0||i&&c&&!s&&o!==0||p||f)},gT=(t,e,r)=>{if(!t)return e;let n=Yp(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},yT=(t,e,r)=>{if(!t)return e;let n=Yp(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};_T.exports=$G});var wT=E((IX,vT)=>{"use strict";var Xp=js(),ET=ao(),CG=tt(),bT=Lp(),IG=xn(),NG=WR(),kG=KR(),xG=QR(),LG=tO(),qG=nO(),jG=iO(),DG=aO(),FG=uO(),MG=qt(),HG=hO(),VG=mO(),zG=zl(),UG=SO(),BG=bO(),GG=uo(),WG=Ul(),JG=Dp(),KG=Fp(),YG=Bl(),XG=Gl(),QG=Mp(),ZG=CO(),e3=co(),t3=jt(),r3=ho(),n3=BO(),s3=WO(),i3=KO(),o3=QO(),a3=eT(),l3=Kl(),u3=oT(),c3=lT(),f3=fT(),d3=hT(),h3=ST();vT.exports={parse:IG,valid:NG,clean:kG,inc:xG,diff:LG,major:qG,minor:jG,patch:DG,prerelease:FG,compare:MG,rcompare:HG,compareLoose:VG,compareBuild:zG,sort:UG,rsort:BG,gt:GG,lt:WG,eq:JG,neq:KG,gte:YG,lte:XG,cmp:QG,coerce:ZG,Comparator:e3,Range:t3,satisfies:r3,toComparators:n3,maxSatisfying:s3,minSatisfying:i3,minVersion:o3,validRange:a3,outside:l3,gtr:u3,ltr:c3,intersects:f3,simplifyRange:d3,subset:h3,SemVer:CG,re:Xp.re,src:Xp.src,tokens:Xp.t,SEMVER_SPEC_VERSION:ET.SEMVER_SPEC_VERSION,RELEASE_TYPES:ET.RELEASE_TYPES,compareIdentifiers:bT.compareIdentifiers,rcompareIdentifiers:bT.rcompareIdentifiers}});var nm=E((NX,rm)=>{"use strict";var Qp=wT(),em=V("node:assert"),tm=Symbol.for("registered-plugin"),{kTestInternals:p3}=De(),{exist:m3,existReply:g3,existRequest:y3}=di(),{FST_ERR_PLUGIN_VERSION_MISMATCH:_3,FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE:S3,FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER:E3}=He(),b3=/-(?:rc|pre|alpha).+$/u;function mo(t){return t[Symbol.for("plugin-meta")]}function RT(t){let e=OT(t);if(e)return e;let r=V.cache;if(r){let n=Object.keys(r);for(let s=0;s<n.length;s++){let i=n[s];if(r[i].exports===t)return i}}return t.name?t.name:null}function v3(t){return t.toString().split(`
344
- `,2).map(e=>e.trim()).join(" -- ")}function OT(t){return t[Symbol.for("fastify.display-name")]}function TT(t){return!!t[Symbol.for("skip-override")]}function $T(t){let e=mo(t);if(!e)return;let r=e.dependencies;r&&(em(Array.isArray(r),"The dependencies should be an array of strings"),r.forEach(n=>{em(this[tm].indexOf(n)>-1,`The dependency '${n}' of plugin '${e.name}' is not registered`)}))}function PT(t){let e=mo(t);if(!e)return;let{decorators:r,name:n}=e;r&&(r.fastify&&Zp(this,"Fastify",r.fastify,n),r.reply&&Zp(this,"Reply",r.reply,n),r.request&&Zp(this,"Request",r.request,n))}var w3={Fastify:m3,Request:y3,Reply:g3};function Zp(t,e,r,n){em(Array.isArray(r),"The decorators should be an array of strings"),r.forEach(s=>{let i=typeof n=="string"?` required by '${n}'`:"";if(!w3[e].call(t,s))throw new S3(s,i,e)})}function R3(t){let e=mo(t);if(e?.fastify==null)return;let r=e.fastify,n=b3.test(this.version);if(!(n===!0&&Qp.gt(this.version,Qp.coerce(r))===!0)&&r&&Qp.satisfies(this.version,r,{includePrerelease:n})===!1)throw new _3(e.name,r,this.version)}function O3(t){let e=mo(t);if(!e)return;let r=e.name;if(r)return this[tm].push(r),r}function T3(t,e){if(t.constructor.name==="AsyncFunction"&&t.length===3)throw new E3(e)}function $3(t){let e=O3.call(this,t)||RT(t);return T3.call(this,t,e),R3.call(this,t),PT.call(this,t),$T.call(this,t),TT(t)}rm.exports={getPluginName:RT,getFuncPreview:v3,kRegisteredPlugins:tm,getDisplayName:OT,registerPlugin:$3};rm.exports[p3]={shouldSkipOverride:TT,getMeta:mo,checkDecorators:PT,checkDependencies:$T}});var Yl=E((xX,AT)=>{"use strict";function P3(t,e){let r=e||C3();return t?I3(t,r):r}function A3(t,e){return t.genReqId(e)}function C3(){let e=0;return function(){return e=e+1&2147483647,`req-${e.toString(36)}`}}function I3(t,e){return function(r){return r.headers[t]||e(r)}}AT.exports={getGenReqId:A3,reqIdGenFactory:P3}});var kT=E((LX,NT)=>{"use strict";var CT=12,N3=0,sm=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7];function k3(t){var e=t.indexOf("%");if(e===-1)return t;for(var r=t.length,n="",s=0,i=0,o=e,a=CT;e>-1&&e<r;){var l=IT(t[e+1],4),u=IT(t[e+2],0),c=l|u,f=sm[c];if(a=sm[256+a+f],i=i<<6|c&sm[364+f],a===CT)n+=t.slice(s,o),n+=i<=65535?String.fromCharCode(i):String.fromCharCode(55232+(i>>10),56320+(i&1023)),i=0,s=e+3,e=o=t.indexOf("%",s);else{if(a===N3)return null;if(e+=3,e<r&&t.charCodeAt(e)===37)continue;return null}}return n+t.slice(s)}var x3={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};function IT(t,e){var r=x3[t];return r===void 0?255:r<<e}NT.exports=k3});var DT=E((qX,jT)=>{"use strict";var xT=kT(),LT=/\+/g,qT=function(){};qT.prototype=Object.create(null);function L3(t){let e=new qT;if(typeof t!="string")return e;let r=t.length,n="",s="",i=-1,o=-1,a=!1,l=!1,u=!1,c=!1,f=!1,p=0;for(let h=0;h<r+1;h++)if(p=h!==r?t.charCodeAt(h):38,p===38){if(f=o>i,f||(o=h),n=t.slice(i+1,o),f||n.length>0){u&&(n=n.replace(LT," ")),a&&(n=xT(n)||n),f&&(s=t.slice(o+1,h),c&&(s=s.replace(LT," ")),l&&(s=xT(s)||s));let d=e[n];d===void 0?e[n]=s:d.pop?d.push(s):e[n]=[d,s]}s="",i=h,o=h,a=!1,l=!1,u=!1,c=!1}else p===61?o<=i?o=h:l=!0:p===43?o>i?c=!0:u=!0:p===37&&(o>i?l=!0:a=!0);return e}jT.exports=L3});var MT=E((jX,FT)=>{var hr=Array.from({length:256},(t,e)=>"%"+((e<16?"0":"")+e.toString(16)).toUpperCase()),q3=new Int8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0]);function j3(t){let e=t.length;if(e===0)return"";let r="",n=0,s=0;e:for(;s<e;s++){let i=t.charCodeAt(s);for(;i<128;){if(q3[i]!==1&&(n<s&&(r+=t.slice(n,s)),n=s+1,r+=hr[i]),++s===e)break e;i=t.charCodeAt(s)}if(n<s&&(r+=t.slice(n,s)),i<2048){n=s+1,r+=hr[192|i>>6]+hr[128|i&63];continue}if(i<55296||i>=57344){n=s+1,r+=hr[224|i>>12]+hr[128|i>>6&63]+hr[128|i&63];continue}if(++s,s>=e)throw new Error("URI malformed");let o=t.charCodeAt(s)&1023;n=s+1,i=65536+((i&1023)<<10|o),r+=hr[240|i>>18]+hr[128|i>>12&63]+hr[128|i>>6&63]+hr[128|i&63]}return n===0?t:n<e?r+t.slice(n):r}FT.exports={encodeString:j3}});var zT=E((DX,VT)=>{"use strict";var{encodeString:im}=MT();function HT(t){let e=typeof t;return e==="string"?im(t):e==="bigint"?t.toString():e==="boolean"?t?"true":"false":e==="number"&&Number.isFinite(t)?t<1e21?""+t:im(""+t):""}function D3(t){let e="";if(t===null||typeof t!="object")return e;let r="&",n=Object.keys(t),s=n.length,i=0;for(let o=0;o<s;o++){let a=n[o],l=t[a],u=im(a)+"=";if(o&&(e+=r),Array.isArray(l)){i=l.length;for(let c=0;c<i;c++)c&&(e+=r),e+=u,e+=HT(l[c])}else e+=u,e+=HT(l)}return e}VT.exports=D3});var WT=E((FX,go)=>{"use strict";var UT=DT(),BT=zT(),GT={parse:UT,stringify:BT};go.exports=GT;go.exports.default=GT;go.exports.parse=UT;go.exports.stringify=BT});var KT=E(JT=>{"use strict";Object.defineProperty(JT,"__esModule",{value:!0})});var YT=E(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.types=void 0;var F3;(function(t){t[t.ROOT=0]="ROOT",t[t.GROUP=1]="GROUP",t[t.POSITION=2]="POSITION",t[t.SET=3]="SET",t[t.RANGE=4]="RANGE",t[t.REPETITION=5]="REPETITION",t[t.REFERENCE=6]="REFERENCE",t[t.CHAR=7]="CHAR"})(F3=yo.types||(yo.types={}))});var QT=E(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0})});var kr=E(Nr=>{"use strict";var M3=Nr&&Nr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),om=Nr&&Nr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&M3(e,t,r)};Object.defineProperty(Nr,"__esModule",{value:!0});om(KT(),Nr);om(YT(),Nr);om(QT(),Nr)});var Xl=E(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.anyChar=nt.notWhitespace=nt.whitespace=nt.notInts=nt.ints=nt.notWords=nt.words=void 0;var he=kr(),ZT=()=>[{type:he.types.RANGE,from:48,to:57}],e$=()=>[{type:he.types.CHAR,value:95},{type:he.types.RANGE,from:97,to:122},{type:he.types.RANGE,from:65,to:90},{type:he.types.RANGE,from:48,to:57}],t$=()=>[{type:he.types.CHAR,value:9},{type:he.types.CHAR,value:10},{type:he.types.CHAR,value:11},{type:he.types.CHAR,value:12},{type:he.types.CHAR,value:13},{type:he.types.CHAR,value:32},{type:he.types.CHAR,value:160},{type:he.types.CHAR,value:5760},{type:he.types.RANGE,from:8192,to:8202},{type:he.types.CHAR,value:8232},{type:he.types.CHAR,value:8233},{type:he.types.CHAR,value:8239},{type:he.types.CHAR,value:8287},{type:he.types.CHAR,value:12288},{type:he.types.CHAR,value:65279}],H3=()=>[{type:he.types.CHAR,value:10},{type:he.types.CHAR,value:13},{type:he.types.CHAR,value:8232},{type:he.types.CHAR,value:8233}];nt.words=()=>({type:he.types.SET,set:e$(),not:!1});nt.notWords=()=>({type:he.types.SET,set:e$(),not:!0});nt.ints=()=>({type:he.types.SET,set:ZT(),not:!1});nt.notInts=()=>({type:he.types.SET,set:ZT(),not:!0});nt.whitespace=()=>({type:he.types.SET,set:t$(),not:!1});nt.notWhitespace=()=>({type:he.types.SET,set:t$(),not:!0});nt.anyChar=()=>({type:he.types.SET,set:H3(),not:!0})});var n$=E(Dt=>{"use strict";var V3=Dt&&Dt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),z3=Dt&&Dt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),U3=Dt&&Dt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&V3(e,t,r);return z3(e,t),e};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.tokenizeClass=Dt.strToChars=void 0;var r$=kr(),Ds=U3(Xl()),B3="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?";Dt.strToChars=t=>{let e=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return t.replace(e,(r,n,s,i,o,a,l)=>{if(s)return r;let u=n?8:i?parseInt(i,16):o?parseInt(o,16):a?B3.indexOf(a):{0:0,t:9,n:10,v:11,f:12,r:13}[l],c=String.fromCharCode(u);return/[[\]{}^$.|?*+()]/.test(c)?`\\${c}`:c})};Dt.tokenizeClass=(t,e)=>{var r,n,s,i,o,a,l;let u=[],c,f,p=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(((?:\\)])|(((?:\\)?([^\]])))))|(\])|(?:\\)?([^])/g;for(;(c=p.exec(t))!==null;){let h=(l=(a=(o=(i=(s=(n=(r=c[1]&&Ds.words())!==null&&r!==void 0?r:c[2]&&Ds.ints())!==null&&n!==void 0?n:c[3]&&Ds.whitespace())!==null&&s!==void 0?s:c[4]&&Ds.notWords())!==null&&i!==void 0?i:c[5]&&Ds.notInts())!==null&&o!==void 0?o:c[6]&&Ds.notWhitespace())!==null&&a!==void 0?a:c[7]&&{type:r$.types.RANGE,from:(c[8]||c[9]).charCodeAt(0),to:(f=c[10]).charCodeAt(f.length-1)})!==null&&l!==void 0?l:(f=c[16])&&{type:r$.types.CHAR,value:f.charCodeAt(0)};if(h)u.push(h);else return[u,p.lastIndex]}throw new SyntaxError(`Invalid regular expression: /${e}/: Unterminated character class`)}});var am=E(pr=>{"use strict";var G3=pr&&pr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),W3=pr&&pr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o$=pr&&pr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&G3(e,t,r);return W3(e,t),e};Object.defineProperty(pr,"__esModule",{value:!0});pr.tokenizer=void 0;var s$=o$(n$()),Ye=kr(),Ln=o$(Xl()),J3=/^[a-zA-Z_$]$/i,K3=/^[a-zA-Z0-9_$]$/i,i$=/\d/;pr.tokenizer=t=>{let e=0,r,n={type:Ye.types.ROOT,stack:[]},s=n,i=n.stack,o=[],a=[],l=0,u=f=>{throw new SyntaxError(`Invalid regular expression: /${t}/: Nothing to repeat at column ${f-1}`)},c=s$.strToChars(t);for(;e<c.length;)switch(r=c[e++]){case"\\":if(e===c.length)throw new SyntaxError(`Invalid regular expression: /${t}/: \\ at end of pattern`);switch(r=c[e++]){case"b":i.push({type:Ye.types.POSITION,value:"b"});break;case"B":i.push({type:Ye.types.POSITION,value:"B"});break;case"w":i.push(Ln.words());break;case"W":i.push(Ln.notWords());break;case"d":i.push(Ln.ints());break;case"D":i.push(Ln.notInts());break;case"s":i.push(Ln.whitespace());break;case"S":i.push(Ln.notWhitespace());break;default:if(i$.test(r)){let f=r;for(;e<c.length&&i$.test(c[e]);)f+=c[e++];let p=parseInt(f,10),h={type:Ye.types.REFERENCE,value:p};i.push(h),a.push({reference:h,stack:i,index:i.length-1})}else i.push({type:Ye.types.CHAR,value:r.charCodeAt(0)})}break;case"^":i.push({type:Ye.types.POSITION,value:"^"});break;case"$":i.push({type:Ye.types.POSITION,value:"$"});break;case"[":{let f;c[e]==="^"?(f=!0,e++):f=!1;let p=s$.tokenizeClass(c.slice(e),t);e+=p[1],i.push({type:Ye.types.SET,set:p[0],not:f});break}case".":i.push(Ln.anyChar());break;case"(":{let f={type:Ye.types.GROUP,stack:[],remember:!0};if(c[e]==="?")if(r=c[e+1],e+=2,r==="=")f.followedBy=!0,f.remember=!1;else if(r==="!")f.notFollowedBy=!0,f.remember=!1;else if(r==="<"){let p="";if(J3.test(c[e]))p+=c[e],e++;else throw new SyntaxError(`Invalid regular expression: /${t}/: Invalid capture group name, character '${c[e]}' after '<' at column ${e+1}`);for(;e<c.length&&K3.test(c[e]);)p+=c[e],e++;if(!p)throw new SyntaxError(`Invalid regular expression: /${t}/: Invalid capture group name, character '${c[e]}' after '<' at column ${e+1}`);if(c[e]!==">")throw new SyntaxError(`Invalid regular expression: /${t}/: Unclosed capture group name, expected '>', found '${c[e]}' at column ${e+1}`);f.name=p,e++}else if(r===":")f.remember=!1;else throw new SyntaxError(`Invalid regular expression: /${t}/: Invalid group, character '${r}' after '?' at column ${e-1}`);else l+=1;i.push(f),o.push(s),s=f,i=f.stack;break}case")":if(o.length===0)throw new SyntaxError(`Invalid regular expression: /${t}/: Unmatched ) at column ${e-1}`);s=o.pop(),i=s.options?s.options[s.options.length-1]:s.stack;break;case"|":{s.options||(s.options=[s.stack],delete s.stack);let f=[];s.options.push(f),i=f;break}case"{":{let f=/^(\d+)(,(\d+)?)?\}/.exec(c.slice(e)),p,h;f!==null?(i.length===0&&u(e),p=parseInt(f[1],10),h=f[2]?f[3]?parseInt(f[3],10):1/0:p,e+=f[0].length,i.push({type:Ye.types.REPETITION,min:p,max:h,value:i.pop()})):i.push({type:Ye.types.CHAR,value:123});break}case"?":i.length===0&&u(e),i.push({type:Ye.types.REPETITION,min:0,max:1,value:i.pop()});break;case"+":i.length===0&&u(e),i.push({type:Ye.types.REPETITION,min:1,max:1/0,value:i.pop()});break;case"*":i.length===0&&u(e),i.push({type:Ye.types.REPETITION,min:0,max:1/0,value:i.pop()});break;default:i.push({type:Ye.types.CHAR,value:r.charCodeAt(0)})}if(o.length!==0)throw new SyntaxError(`Invalid regular expression: /${t}/: Unterminated group`);return Y3(a,l),n};function Y3(t,e){for(let r of t.reverse())if(e<r.reference.value){r.reference.type=Ye.types.CHAR;let n=r.reference.value.toString();if(r.reference.value=parseInt(n,8),!/^[0-7]+$/.test(n)){let s=0;for(;n[s]!=="8"&&n[s]!=="9";)s+=1;if(s===0?(r.reference.value=n.charCodeAt(0),s+=1):r.reference.value=parseInt(n.slice(0,s),8),n.length>s){let i=r.stack.splice(r.index+1);for(let o of n.slice(s))r.stack.push({type:Ye.types.CHAR,value:o.charCodeAt(0)});r.stack.push(...i)}}}}});var l$=E(st=>{"use strict";var X3=st&&st.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Q3=st&&st.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Z3=st&&st.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&X3(e,t,r);return Q3(e,t),e};Object.defineProperty(st,"__esModule",{value:!0});st.NOTANYCHAR=st.WHITESPACE=st.WORDS=st.INTS=void 0;var Ql=Z3(Xl()),a$=kr();function Zl(t){let e={},r=0;for(let n of t)n.type===a$.types.CHAR&&(e[n.value]=!0),n.type===a$.types.RANGE&&(e[`${n.from}-${n.to}`]=!0),r+=1;return{lookup:()=>Object.assign({},e),len:r}}st.INTS=Zl(Ql.ints().set);st.WORDS=Zl(Ql.words().set);st.WHITESPACE=Zl(Ql.whitespace().set);st.NOTANYCHAR=Zl(Ql.anyChar().set)});var c$=E(Ft=>{"use strict";var e9=Ft&&Ft.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),t9=Ft&&Ft.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r9=Ft&&Ft.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&e9(e,t,r);return t9(e,t),e};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.writeSetTokens=Ft.setChar=void 0;var nu=kr(),eu=r9(l$());function ru(t){return t===94?"\\^":t===92?"\\\\":t===93?"\\]":t===45?"\\-":String.fromCharCode(t)}Ft.setChar=ru;function tu(t,{lookup:e,len:r}){if(r!==t.length)return!1;let n=e();for(let s of t){if(s.type===nu.types.SET)return!1;let i=s.type===nu.types.CHAR?s.value:`${s.from}-${s.to}`;if(n[i])n[i]=!1;else return!1}return!0}function u$(t,e=!1){if(tu(t.set,eu.INTS))return t.not?"\\D":"\\d";if(tu(t.set,eu.WORDS))return t.not?"\\W":"\\w";if(t.not&&tu(t.set,eu.NOTANYCHAR))return".";if(tu(t.set,eu.WHITESPACE))return t.not?"\\S":"\\s";let r="";for(let s=0;s<t.set.length;s++){let i=t.set[s];r+=n9(i)}let n=`${t.not?"^":""}${r}`;return e?n:`[${n}]`}Ft.writeSetTokens=u$;function n9(t){return t.type===nu.types.CHAR?ru(t.value):t.type===nu.types.RANGE?`${ru(t.from)}-${ru(t.to)}`:u$(t,!0)}});var um=E(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.reconstruct=void 0;var nn=kr(),lm=c$(),f$=t=>t.map(Fs.reconstruct).join(""),d$=t=>{if("options"in t)return t.options.map(f$).join("|");if("stack"in t)return f$(t.stack);throw new Error("options or stack must be Root or Group token")};Fs.reconstruct=t=>{switch(t.type){case nn.types.ROOT:return d$(t);case nn.types.CHAR:{let e=String.fromCharCode(t.value);return(/[[\\{}$^.|?*+()]/.test(e)?"\\":"")+e}case nn.types.POSITION:return t.value==="^"||t.value==="$"?t.value:`\\${t.value}`;case nn.types.REFERENCE:return`\\${t.value}`;case nn.types.SET:return lm.writeSetTokens(t);case nn.types.GROUP:return`(${t.name?`?<${t.name}>`:t.remember?"":t.followedBy?"?=":t.notFollowedBy?"?!":"?:"}${d$(t)})`;case nn.types.REPETITION:{let{min:e,max:r}=t,n;return e===0&&r===1?n="?":e===1&&r===1/0?n="+":e===0&&r===1/0?n="*":r===1/0?n=`{${e},}`:e===r?n=`{${e}}`:n=`{${e},${r}}`,`${Fs.reconstruct(t.value)}${n}`}case nn.types.RANGE:return`${lm.setChar(t.from)}-${lm.setChar(t.to)}`;default:throw new Error(`Invalid token type ${t}`)}}});var m$=E((Mt,su)=>{"use strict";var s9=Mt&&Mt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),cm=Mt&&Mt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&s9(e,t,r)};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.types=void 0;var h$=kr();Object.defineProperty(Mt,"types",{enumerable:!0,get:function(){return h$.types}});cm(am(),Mt);cm(um(),Mt);var p$=am(),i9=um();cm(kr(),Mt);Mt.default=p$.tokenizer;su.exports=p$.tokenizer;su.exports.types=h$.types;su.exports.reconstruct=i9.reconstruct});var y$=E((YX,iu)=>{"use strict";var g$=m$(),o9=g$.types;function fm(t,e){e||(e={});let r=e.limit===void 0?25:e.limit;a9(t)?t=t.source:typeof t!="string"&&(t=String(t));try{t=g$(t)}catch{return!1}let n=0;return function s(i,o){let a,l,u;if(i.type===o9.REPETITION&&(o++,n++,o>1||n>r))return!1;if(i.options){for(a=0,u=i.options.length;a<u;a++)if(l=s({stack:i.options[a]},o),!l)return!1}let c=i.stack||i.value?.stack;if(!c)return!0;for(a=0;a<c.length;a++)if(l=s(c[a],o),!l)return!1;return!0}(t,0)}function a9(t){return{}.toString.call(t)==="[object RegExp]"}iu.exports=fm;iu.exports.default=fm;iu.exports.safeRegex=fm});var ou=E((XX,_$)=>{"use strict";_$.exports={name:"__fmw_internal_strategy_merged_tree_http_method__",storage:function(){let t=new Map;return{get:e=>t.get(e)||null,set:(e,r)=>{t.set(e,r)}}},deriveConstraint:t=>t.method,mustMatchWhenDerived:!0}});var O$=E((QX,R$)=>{"use strict";var S$=Pi(),E$=ou(),b$=Symbol("treeData");function v$(t,e=""){let r="",n=Object.keys(t);for(let s=0;s<n.length;s++){let i=n[s],o=t[i],a=s===n.length-1,l=a?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",u=a?" ":"\u2502 ",f=(o[b$]||"").replaceAll(`
343
+ `),s}Ls.exports=Ip;Ls.exports.default=Ip;Ls.exports.build=Ip;Ls.exports.validLargeArrayMechanisms=TR;Ls.exports.restore=function({code:t,validator:e,serializer:r}){return Function.apply(null,["validator","serializer",t]).apply(null,[e,r])}});var kR=E((W7,Dl)=>{"use strict";var SB=CR();function IR(){return function(e,r){let n=Object.assign({},r,{schema:e});return EB.bind(null,n)}}function EB(t,{schema:e}){return t.schema&&e.$id&&t.schema[e.$id]&&(t.schema={...t.schema},delete t.schema[e.$id]),SB(e,t)}function NR(t={readMode:!0}){if(t.readMode===!0&&typeof t.restoreFunction!="function")throw new Error("You must provide a function for the restoreFunction-option when readMode ON");if(t.readMode!==!0&&typeof t.storeFunction!="function")throw new Error("You must provide a function for the storeFunction-option when readMode OFF");if(t.readMode===!0)return function(){return function(n){return t.restoreFunction(n)}};let e=IR();return function(n,s={}){s.mode="standalone";let i=e(n,s);return function(o){let a=i(o);return t.storeFunction(o,a),new Function(a)}}}Dl.exports.SerializerSelector=IR;Dl.exports.StandaloneSerializer=NR;Dl.exports.default=NR});var xR=E((J7,ao)=>{"use strict";var{SerializerSelector:Np,StandaloneSerializer:bB}=kR();ao.exports=Np;ao.exports.default=Np;ao.exports.SerializerSelector=Np;ao.exports.StandaloneSerializer=bB});var kp=E((K7,LR)=>{"use strict";var{buildSchemas:vB}=ui();function wB(t,e){if(t)return new qs(t,e);let r=Object.assign({buildValidator:null,buildSerializer:null},e?.compilersFactory);if(!r.buildValidator){let s=mp();r.buildValidator=s()}if(!r.buildSerializer){let s=xR();r.buildSerializer=s()}let n={bucket:e&&e.bucket||vB,compilersFactory:r,isCustomValidatorCompiler:typeof e?.compilersFactory?.buildValidator=="function",isCustomSerializerCompiler:typeof e?.compilersFactory?.buildValidator=="function"};return new qs(void 0,n)}var qs=class{constructor(e,r){this.opts=r||e?.opts,this.addedSchemas=!1,this.compilersFactory=this.opts.compilersFactory,e?(this.schemaBucket=this.opts.bucket(e.getSchemas()),this.validatorCompiler=e.getValidatorCompiler(),this.serializerCompiler=e.getSerializerCompiler(),this.isCustomValidatorCompiler=e.isCustomValidatorCompiler,this.isCustomSerializerCompiler=e.isCustomSerializerCompiler,this.parent=e):(this.schemaBucket=this.opts.bucket(),this.isCustomValidatorCompiler=this.opts.isCustomValidatorCompiler||!1,this.isCustomSerializerCompiler=this.opts.isCustomSerializerCompiler||!1)}add(e){return this.addedSchemas=!0,this.schemaBucket.add(e)}getSchema(e){return this.schemaBucket.getSchema(e)}getSchemas(){return this.schemaBucket.getSchemas()}setValidatorCompiler(e){this.compilersFactory=Object.assign({},this.compilersFactory,{buildValidator:()=>e}),this.validatorCompiler=e,this.isCustomValidatorCompiler=!0}setSerializerCompiler(e){this.compilersFactory=Object.assign({},this.compilersFactory,{buildSerializer:()=>e}),this.serializerCompiler=e,this.isCustomSerializerCompiler=!0}getValidatorCompiler(){return this.validatorCompiler||this.parent&&this.parent.getValidatorCompiler()}getSerializerCompiler(){return this.serializerCompiler||this.parent&&this.parent.getSerializerCompiler()}getSerializerBuilder(){return this.compilersFactory.buildSerializer||this.parent&&this.parent.getSerializerBuilder()}getValidatorBuilder(){return this.compilersFactory.buildValidator||this.parent&&this.parent.getValidatorBuilder()}setupValidator(e){this.validatorCompiler!==void 0&&!this.addedSchemas||(this.validatorCompiler=this.getValidatorBuilder()(this.schemaBucket.getSchemas(),e.ajv))}setupSerializer(e){this.serializerCompiler!==void 0&&!this.addedSchemas||(this.serializerCompiler=this.getSerializerBuilder()(this.schemaBucket.getSchemas(),e.serializerOpts))}};qs.buildSchemaController=wB;LR.exports=qs});var lo=E((Y7,qR)=>{"use strict";var RB="2.0.0",OB=Number.MAX_SAFE_INTEGER||9007199254740991,TB=16,$B=250,PB=["major","premajor","minor","preminor","patch","prepatch","prerelease"];qR.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:TB,MAX_SAFE_BUILD_LENGTH:$B,MAX_SAFE_INTEGER:OB,RELEASE_TYPES:PB,SEMVER_SPEC_VERSION:RB,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var uo=E((X7,jR)=>{"use strict";var AB=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};jR.exports=AB});var js=E((hr,DR)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:xp,MAX_SAFE_BUILD_LENGTH:CB,MAX_LENGTH:IB}=lo(),NB=uo();hr=DR.exports={};var kB=hr.re=[],xB=hr.safeRe=[],D=hr.src=[],LB=hr.safeSrc=[],F=hr.t={},qB=0,Lp="[a-zA-Z0-9-]",jB=[["\\s",1],["\\d",IB],[Lp,CB]],DB=t=>{for(let[e,r]of jB)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},X=(t,e,r)=>{let n=DB(e),s=qB++;NB(t,s,e),F[t]=s,D[s]=e,LB[s]=n,kB[s]=new RegExp(e,r?"g":void 0),xB[s]=new RegExp(n,r?"g":void 0)};X("NUMERICIDENTIFIER","0|[1-9]\\d*");X("NUMERICIDENTIFIERLOOSE","\\d+");X("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Lp}*`);X("MAINVERSION",`(${D[F.NUMERICIDENTIFIER]})\\.(${D[F.NUMERICIDENTIFIER]})\\.(${D[F.NUMERICIDENTIFIER]})`);X("MAINVERSIONLOOSE",`(${D[F.NUMERICIDENTIFIERLOOSE]})\\.(${D[F.NUMERICIDENTIFIERLOOSE]})\\.(${D[F.NUMERICIDENTIFIERLOOSE]})`);X("PRERELEASEIDENTIFIER",`(?:${D[F.NONNUMERICIDENTIFIER]}|${D[F.NUMERICIDENTIFIER]})`);X("PRERELEASEIDENTIFIERLOOSE",`(?:${D[F.NONNUMERICIDENTIFIER]}|${D[F.NUMERICIDENTIFIERLOOSE]})`);X("PRERELEASE",`(?:-(${D[F.PRERELEASEIDENTIFIER]}(?:\\.${D[F.PRERELEASEIDENTIFIER]})*))`);X("PRERELEASELOOSE",`(?:-?(${D[F.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${D[F.PRERELEASEIDENTIFIERLOOSE]})*))`);X("BUILDIDENTIFIER",`${Lp}+`);X("BUILD",`(?:\\+(${D[F.BUILDIDENTIFIER]}(?:\\.${D[F.BUILDIDENTIFIER]})*))`);X("FULLPLAIN",`v?${D[F.MAINVERSION]}${D[F.PRERELEASE]}?${D[F.BUILD]}?`);X("FULL",`^${D[F.FULLPLAIN]}$`);X("LOOSEPLAIN",`[v=\\s]*${D[F.MAINVERSIONLOOSE]}${D[F.PRERELEASELOOSE]}?${D[F.BUILD]}?`);X("LOOSE",`^${D[F.LOOSEPLAIN]}$`);X("GTLT","((?:<|>)?=?)");X("XRANGEIDENTIFIERLOOSE",`${D[F.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);X("XRANGEIDENTIFIER",`${D[F.NUMERICIDENTIFIER]}|x|X|\\*`);X("XRANGEPLAIN",`[v=\\s]*(${D[F.XRANGEIDENTIFIER]})(?:\\.(${D[F.XRANGEIDENTIFIER]})(?:\\.(${D[F.XRANGEIDENTIFIER]})(?:${D[F.PRERELEASE]})?${D[F.BUILD]}?)?)?`);X("XRANGEPLAINLOOSE",`[v=\\s]*(${D[F.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[F.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[F.XRANGEIDENTIFIERLOOSE]})(?:${D[F.PRERELEASELOOSE]})?${D[F.BUILD]}?)?)?`);X("XRANGE",`^${D[F.GTLT]}\\s*${D[F.XRANGEPLAIN]}$`);X("XRANGELOOSE",`^${D[F.GTLT]}\\s*${D[F.XRANGEPLAINLOOSE]}$`);X("COERCEPLAIN",`(^|[^\\d])(\\d{1,${xp}})(?:\\.(\\d{1,${xp}}))?(?:\\.(\\d{1,${xp}}))?`);X("COERCE",`${D[F.COERCEPLAIN]}(?:$|[^\\d])`);X("COERCEFULL",D[F.COERCEPLAIN]+`(?:${D[F.PRERELEASE]})?(?:${D[F.BUILD]})?(?:$|[^\\d])`);X("COERCERTL",D[F.COERCE],!0);X("COERCERTLFULL",D[F.COERCEFULL],!0);X("LONETILDE","(?:~>?)");X("TILDETRIM",`(\\s*)${D[F.LONETILDE]}\\s+`,!0);hr.tildeTrimReplace="$1~";X("TILDE",`^${D[F.LONETILDE]}${D[F.XRANGEPLAIN]}$`);X("TILDELOOSE",`^${D[F.LONETILDE]}${D[F.XRANGEPLAINLOOSE]}$`);X("LONECARET","(?:\\^)");X("CARETTRIM",`(\\s*)${D[F.LONECARET]}\\s+`,!0);hr.caretTrimReplace="$1^";X("CARET",`^${D[F.LONECARET]}${D[F.XRANGEPLAIN]}$`);X("CARETLOOSE",`^${D[F.LONECARET]}${D[F.XRANGEPLAINLOOSE]}$`);X("COMPARATORLOOSE",`^${D[F.GTLT]}\\s*(${D[F.LOOSEPLAIN]})$|^$`);X("COMPARATOR",`^${D[F.GTLT]}\\s*(${D[F.FULLPLAIN]})$|^$`);X("COMPARATORTRIM",`(\\s*)${D[F.GTLT]}\\s*(${D[F.LOOSEPLAIN]}|${D[F.XRANGEPLAIN]})`,!0);hr.comparatorTrimReplace="$1$2$3";X("HYPHENRANGE",`^\\s*(${D[F.XRANGEPLAIN]})\\s+-\\s+(${D[F.XRANGEPLAIN]})\\s*$`);X("HYPHENRANGELOOSE",`^\\s*(${D[F.XRANGEPLAINLOOSE]})\\s+-\\s+(${D[F.XRANGEPLAINLOOSE]})\\s*$`);X("STAR","(<|>)?=?\\s*\\*");X("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");X("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Fl=E((Q7,FR)=>{"use strict";var FB=Object.freeze({loose:!0}),MB=Object.freeze({}),HB=t=>t?typeof t!="object"?FB:t:MB;FR.exports=HB});var qp=E((Z7,VR)=>{"use strict";var MR=/^[0-9]+$/,HR=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=MR.test(t),n=MR.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},VB=(t,e)=>HR(e,t);VR.exports={compareIdentifiers:HR,rcompareIdentifiers:VB}});var tt=E((eX,UR)=>{"use strict";var Ml=uo(),{MAX_LENGTH:zR,MAX_SAFE_INTEGER:Hl}=lo(),{safeRe:Vl,t:zl}=js(),zB=Fl(),{compareIdentifiers:jp}=qp(),Dp=class t{constructor(e,r){if(r=zB(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>zR)throw new TypeError(`version is longer than ${zR} characters`);Ml("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Vl[zl.LOOSE]:Vl[zl.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Hl||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Hl||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Hl||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let i=+s;if(i>=0&&i<Hl)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Ml("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=e.prerelease[r];if(Ml("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return jp(n,s)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],s=e.build[r];if(Ml("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return jp(n,s)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?Vl[zl.PRERELEASELOOSE]:Vl[zl.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),jp(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};UR.exports=Dp});var xn=E((tX,GR)=>{"use strict";var BR=tt(),UB=(t,e,r=!1)=>{if(t instanceof BR)return t;try{return new BR(t,e)}catch(n){if(!r)return null;throw n}};GR.exports=UB});var JR=E((rX,WR)=>{"use strict";var BB=xn(),GB=(t,e)=>{let r=BB(t,e);return r?r.version:null};WR.exports=GB});var YR=E((nX,KR)=>{"use strict";var WB=xn(),JB=(t,e)=>{let r=WB(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};KR.exports=JB});var ZR=E((sX,QR)=>{"use strict";var XR=tt(),KB=(t,e,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new XR(t instanceof XR?t.version:t,r).inc(e,n,s).version}catch{return null}};QR.exports=KB});var rO=E((iX,tO)=>{"use strict";var eO=xn(),YB=(t,e)=>{let r=eO(t,null,!0),n=eO(e,null,!0),s=r.compare(n);if(s===0)return null;let i=s>0,o=i?r:n,a=i?n:r,l=!!o.prerelease.length;if(!!a.prerelease.length&&!l){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let c=l?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":"prerelease"};tO.exports=YB});var sO=E((oX,nO)=>{"use strict";var XB=tt(),QB=(t,e)=>new XB(t,e).major;nO.exports=QB});var oO=E((aX,iO)=>{"use strict";var ZB=tt(),e5=(t,e)=>new ZB(t,e).minor;iO.exports=e5});var lO=E((lX,aO)=>{"use strict";var t5=tt(),r5=(t,e)=>new t5(t,e).patch;aO.exports=r5});var cO=E((uX,uO)=>{"use strict";var n5=xn(),s5=(t,e)=>{let r=n5(t,e);return r&&r.prerelease.length?r.prerelease:null};uO.exports=s5});var qt=E((cX,dO)=>{"use strict";var fO=tt(),i5=(t,e,r)=>new fO(t,r).compare(new fO(e,r));dO.exports=i5});var pO=E((fX,hO)=>{"use strict";var o5=qt(),a5=(t,e,r)=>o5(e,t,r);hO.exports=a5});var gO=E((dX,mO)=>{"use strict";var l5=qt(),u5=(t,e)=>l5(t,e,!0);mO.exports=u5});var Ul=E((hX,_O)=>{"use strict";var yO=tt(),c5=(t,e,r)=>{let n=new yO(t,r),s=new yO(e,r);return n.compare(s)||n.compareBuild(s)};_O.exports=c5});var EO=E((pX,SO)=>{"use strict";var f5=Ul(),d5=(t,e)=>t.sort((r,n)=>f5(r,n,e));SO.exports=d5});var vO=E((mX,bO)=>{"use strict";var h5=Ul(),p5=(t,e)=>t.sort((r,n)=>h5(n,r,e));bO.exports=p5});var co=E((gX,wO)=>{"use strict";var m5=qt(),g5=(t,e,r)=>m5(t,e,r)>0;wO.exports=g5});var Bl=E((yX,RO)=>{"use strict";var y5=qt(),_5=(t,e,r)=>y5(t,e,r)<0;RO.exports=_5});var Fp=E((_X,OO)=>{"use strict";var S5=qt(),E5=(t,e,r)=>S5(t,e,r)===0;OO.exports=E5});var Mp=E((SX,TO)=>{"use strict";var b5=qt(),v5=(t,e,r)=>b5(t,e,r)!==0;TO.exports=v5});var Gl=E((EX,$O)=>{"use strict";var w5=qt(),R5=(t,e,r)=>w5(t,e,r)>=0;$O.exports=R5});var Wl=E((bX,PO)=>{"use strict";var O5=qt(),T5=(t,e,r)=>O5(t,e,r)<=0;PO.exports=T5});var Hp=E((vX,AO)=>{"use strict";var $5=Fp(),P5=Mp(),A5=co(),C5=Gl(),I5=Bl(),N5=Wl(),k5=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return $5(t,r,n);case"!=":return P5(t,r,n);case">":return A5(t,r,n);case">=":return C5(t,r,n);case"<":return I5(t,r,n);case"<=":return N5(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};AO.exports=k5});var IO=E((wX,CO)=>{"use strict";var x5=tt(),L5=xn(),{safeRe:Jl,t:Kl}=js(),q5=(t,e)=>{if(t instanceof x5)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Jl[Kl.COERCEFULL]:Jl[Kl.COERCE]);else{let l=e.includePrerelease?Jl[Kl.COERCERTLFULL]:Jl[Kl.COERCERTL],u;for(;(u=l.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),l.lastIndex=u.index+u[1].length+u[2].length;l.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",i=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return L5(`${n}.${s}.${i}${o}${a}`,e)};CO.exports=q5});var kO=E((RX,NO)=>{"use strict";var Vp=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,r)}return this}};NO.exports=Vp});var jt=E((OX,jO)=>{"use strict";var j5=/\s+/g,zp=class t{constructor(e,r){if(r=F5(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Up)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(j5," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!LO(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&G5(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&U5)|(this.options.loose&&B5))+":"+e,s=xO.get(n);if(s)return s;let i=this.options.loose,o=i?ut[rt.HYPHENRANGELOOSE]:ut[rt.HYPHENRANGE];e=e.replace(o,rG(this.options.includePrerelease)),Re("hyphen replace",e),e=e.replace(ut[rt.COMPARATORTRIM],H5),Re("comparator trim",e),e=e.replace(ut[rt.TILDETRIM],V5),Re("tilde trim",e),e=e.replace(ut[rt.CARETTRIM],z5),Re("caret trim",e);let a=e.split(" ").map(f=>W5(f,this.options)).join(" ").split(/\s+/).map(f=>tG(f,this.options));i&&(a=a.filter(f=>(Re("loose invalid filter",f,this.options),!!f.match(ut[rt.COMPARATORLOOSE])))),Re("range list",a);let l=new Map,u=a.map(f=>new Up(f,this.options));for(let f of u){if(LO(f))return[f];l.set(f.value,f)}l.size>1&&l.has("")&&l.delete("");let c=[...l.values()];return xO.set(n,c),c}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>qO(n,r)&&e.set.some(s=>qO(s,r)&&n.every(i=>s.every(o=>i.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new M5(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(nG(this.set[r],e,this.options))return!0;return!1}};jO.exports=zp;var D5=kO(),xO=new D5,F5=Fl(),Up=fo(),Re=uo(),M5=tt(),{safeRe:ut,t:rt,comparatorTrimReplace:H5,tildeTrimReplace:V5,caretTrimReplace:z5}=js(),{FLAG_INCLUDE_PRERELEASE:U5,FLAG_LOOSE:B5}=lo(),LO=t=>t.value==="<0.0.0-0",G5=t=>t.value==="",qO=(t,e)=>{let r=!0,n=t.slice(),s=n.pop();for(;r&&n.length;)r=n.every(i=>s.intersects(i,e)),s=n.pop();return r},W5=(t,e)=>(t=t.replace(ut[rt.BUILD],""),Re("comp",t,e),t=Y5(t,e),Re("caret",t),t=J5(t,e),Re("tildes",t),t=Q5(t,e),Re("xrange",t),t=eG(t,e),Re("stars",t),t),ct=t=>!t||t.toLowerCase()==="x"||t==="*",J5=(t,e)=>t.trim().split(/\s+/).map(r=>K5(r,e)).join(" "),K5=(t,e)=>{let r=e.loose?ut[rt.TILDELOOSE]:ut[rt.TILDE];return t.replace(r,(n,s,i,o,a)=>{Re("tilde",t,n,s,i,o,a);let l;return ct(s)?l="":ct(i)?l=`>=${s}.0.0 <${+s+1}.0.0-0`:ct(o)?l=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:a?(Re("replaceTilde pr",a),l=`>=${s}.${i}.${o}-${a} <${s}.${+i+1}.0-0`):l=`>=${s}.${i}.${o} <${s}.${+i+1}.0-0`,Re("tilde return",l),l})},Y5=(t,e)=>t.trim().split(/\s+/).map(r=>X5(r,e)).join(" "),X5=(t,e)=>{Re("caret",t,e);let r=e.loose?ut[rt.CARETLOOSE]:ut[rt.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(s,i,o,a,l)=>{Re("caret",t,s,i,o,a,l);let u;return ct(i)?u="":ct(o)?u=`>=${i}.0.0${n} <${+i+1}.0.0-0`:ct(a)?i==="0"?u=`>=${i}.${o}.0${n} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.0${n} <${+i+1}.0.0-0`:l?(Re("replaceCaret pr",l),i==="0"?o==="0"?u=`>=${i}.${o}.${a}-${l} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}-${l} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a}-${l} <${+i+1}.0.0-0`):(Re("no pr"),i==="0"?o==="0"?u=`>=${i}.${o}.${a}${n} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}${n} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a} <${+i+1}.0.0-0`),Re("caret return",u),u})},Q5=(t,e)=>(Re("replaceXRanges",t,e),t.split(/\s+/).map(r=>Z5(r,e)).join(" ")),Z5=(t,e)=>{t=t.trim();let r=e.loose?ut[rt.XRANGELOOSE]:ut[rt.XRANGE];return t.replace(r,(n,s,i,o,a,l)=>{Re("xRange",t,n,s,i,o,a,l);let u=ct(i),c=u||ct(o),f=c||ct(a),p=f;return s==="="&&p&&(s=""),l=e.includePrerelease?"-0":"",u?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&p?(c&&(o=0),a=0,s===">"?(s=">=",c?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):s==="<="&&(s="<",c?i=+i+1:o=+o+1),s==="<"&&(l="-0"),n=`${s+i}.${o}.${a}${l}`):c?n=`>=${i}.0.0${l} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`),Re("xRange return",n),n})},eG=(t,e)=>(Re("replaceStars",t,e),t.trim().replace(ut[rt.STAR],"")),tG=(t,e)=>(Re("replaceGTE0",t,e),t.trim().replace(ut[e.includePrerelease?rt.GTE0PRE:rt.GTE0],"")),rG=t=>(e,r,n,s,i,o,a,l,u,c,f,p)=>(ct(n)?r="":ct(s)?r=`>=${n}.0.0${t?"-0":""}`:ct(i)?r=`>=${n}.${s}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,ct(u)?l="":ct(c)?l=`<${+u+1}.0.0-0`:ct(f)?l=`<${u}.${+c+1}.0-0`:p?l=`<=${u}.${c}.${f}-${p}`:t?l=`<${u}.${c}.${+f+1}-0`:l=`<=${l}`,`${r} ${l}`.trim()),nG=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Re(t[n].semver),t[n].semver!==Up.ANY&&t[n].semver.prerelease.length>0){let s=t[n].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var fo=E((TX,zO)=>{"use strict";var ho=Symbol("SemVer ANY"),Wp=class t{static get ANY(){return ho}constructor(e,r){if(r=DO(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Gp("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===ho?this.value="":this.value=this.operator+this.semver.version,Gp("comp",this)}parse(e){let r=this.options.loose?FO[MO.COMPARATORLOOSE]:FO[MO.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new HO(n[2],this.options.loose):this.semver=ho}toString(){return this.value}test(e){if(Gp("Comparator.test",e,this.options.loose),this.semver===ho||e===ho)return!0;if(typeof e=="string")try{e=new HO(e,this.options)}catch{return!1}return Bp(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new VO(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new VO(this.value,r).test(e.semver):(r=DO(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Bp(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Bp(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};zO.exports=Wp;var DO=Fl(),{safeRe:FO,t:MO}=js(),Bp=Hp(),Gp=uo(),HO=tt(),VO=jt()});var po=E(($X,UO)=>{"use strict";var sG=jt(),iG=(t,e,r)=>{try{e=new sG(e,r)}catch{return!1}return e.test(t)};UO.exports=iG});var GO=E((PX,BO)=>{"use strict";var oG=jt(),aG=(t,e)=>new oG(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));BO.exports=aG});var JO=E((AX,WO)=>{"use strict";var lG=tt(),uG=jt(),cG=(t,e,r)=>{let n=null,s=null,i=null;try{i=new uG(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new lG(n,r))}),n};WO.exports=cG});var YO=E((CX,KO)=>{"use strict";var fG=tt(),dG=jt(),hG=(t,e,r)=>{let n=null,s=null,i=null;try{i=new dG(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new fG(n,r))}),n};KO.exports=hG});var ZO=E((IX,QO)=>{"use strict";var Jp=tt(),pG=jt(),XO=co(),mG=(t,e)=>{t=new pG(t,e);let r=new Jp("0.0.0");if(t.test(r)||(r=new Jp("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let s=t.set[n],i=null;s.forEach(o=>{let a=new Jp(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||XO(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||XO(r,i))&&(r=i)}return r&&t.test(r)?r:null};QO.exports=mG});var tT=E((NX,eT)=>{"use strict";var gG=jt(),yG=(t,e)=>{try{return new gG(t,e).range||"*"}catch{return null}};eT.exports=yG});var Yl=E((kX,iT)=>{"use strict";var _G=tt(),sT=fo(),{ANY:SG}=sT,EG=jt(),bG=po(),rT=co(),nT=Bl(),vG=Wl(),wG=Gl(),RG=(t,e,r,n)=>{t=new _G(t,n),e=new EG(e,n);let s,i,o,a,l;switch(r){case">":s=rT,i=vG,o=nT,a=">",l=">=";break;case"<":s=nT,i=wG,o=rT,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(bG(t,e,n))return!1;for(let u=0;u<e.set.length;++u){let c=e.set[u],f=null,p=null;if(c.forEach(h=>{h.semver===SG&&(h=new sT(">=0.0.0")),f=f||h,p=p||h,s(h.semver,f.semver,n)?f=h:o(h.semver,p.semver,n)&&(p=h)}),f.operator===a||f.operator===l||(!p.operator||p.operator===a)&&i(t,p.semver))return!1;if(p.operator===l&&o(t,p.semver))return!1}return!0};iT.exports=RG});var aT=E((xX,oT)=>{"use strict";var OG=Yl(),TG=(t,e,r)=>OG(t,e,">",r);oT.exports=TG});var uT=E((LX,lT)=>{"use strict";var $G=Yl(),PG=(t,e,r)=>$G(t,e,"<",r);lT.exports=PG});var dT=E((qX,fT)=>{"use strict";var cT=jt(),AG=(t,e,r)=>(t=new cT(t,r),e=new cT(e,r),t.intersects(e,r));fT.exports=AG});var pT=E((jX,hT)=>{"use strict";var CG=po(),IG=qt();hT.exports=(t,e,r)=>{let n=[],s=null,i=null,o=t.sort((c,f)=>IG(c,f,r));for(let c of o)CG(c,e,r)?(i=c,s||(s=c)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);let a=[];for(let[c,f]of n)c===f?a.push(c):!f&&c===o[0]?a.push("*"):f?c===o[0]?a.push(`<=${f}`):a.push(`${c} - ${f}`):a.push(`>=${c}`);let l=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return l.length<u.length?l:e}});var ET=E((DX,ST)=>{"use strict";var mT=jt(),Yp=fo(),{ANY:Kp}=Yp,mo=po(),Xp=qt(),NG=(t,e,r={})=>{if(t===e)return!0;t=new mT(t,r),e=new mT(e,r);let n=!1;e:for(let s of t.set){for(let i of e.set){let o=xG(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},kG=[new Yp(">=0.0.0-0")],gT=[new Yp(">=0.0.0")],xG=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Kp){if(e.length===1&&e[0].semver===Kp)return!0;r.includePrerelease?t=kG:t=gT}if(e.length===1&&e[0].semver===Kp){if(r.includePrerelease)return!0;e=gT}let n=new Set,s,i;for(let h of t)h.operator===">"||h.operator===">="?s=yT(s,h,r):h.operator==="<"||h.operator==="<="?i=_T(i,h,r):n.add(h.semver);if(n.size>1)return null;let o;if(s&&i){if(o=Xp(s.semver,i.semver,r),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(let h of n){if(s&&!mo(h,String(s),r)||i&&!mo(h,String(i),r))return null;for(let d of e)if(!mo(h,String(d),r))return!1;return!0}let a,l,u,c,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&i.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let h of e){if(c=c||h.operator===">"||h.operator===">=",u=u||h.operator==="<"||h.operator==="<=",s){if(p&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===p.major&&h.semver.minor===p.minor&&h.semver.patch===p.patch&&(p=!1),h.operator===">"||h.operator===">="){if(a=yT(s,h,r),a===h&&a!==s)return!1}else if(s.operator===">="&&!mo(s.semver,String(h),r))return!1}if(i){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator==="<"||h.operator==="<="){if(l=_T(i,h,r),l===h&&l!==i)return!1}else if(i.operator==="<="&&!mo(i.semver,String(h),r))return!1}if(!h.operator&&(i||s)&&o!==0)return!1}return!(s&&u&&!i&&o!==0||i&&c&&!s&&o!==0||p||f)},yT=(t,e,r)=>{if(!t)return e;let n=Xp(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},_T=(t,e,r)=>{if(!t)return e;let n=Xp(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};ST.exports=NG});var RT=E((FX,wT)=>{"use strict";var Qp=js(),bT=lo(),LG=tt(),vT=qp(),qG=xn(),jG=JR(),DG=YR(),FG=ZR(),MG=rO(),HG=sO(),VG=oO(),zG=lO(),UG=cO(),BG=qt(),GG=pO(),WG=gO(),JG=Ul(),KG=EO(),YG=vO(),XG=co(),QG=Bl(),ZG=Fp(),e3=Mp(),t3=Gl(),r3=Wl(),n3=Hp(),s3=IO(),i3=fo(),o3=jt(),a3=po(),l3=GO(),u3=JO(),c3=YO(),f3=ZO(),d3=tT(),h3=Yl(),p3=aT(),m3=uT(),g3=dT(),y3=pT(),_3=ET();wT.exports={parse:qG,valid:jG,clean:DG,inc:FG,diff:MG,major:HG,minor:VG,patch:zG,prerelease:UG,compare:BG,rcompare:GG,compareLoose:WG,compareBuild:JG,sort:KG,rsort:YG,gt:XG,lt:QG,eq:ZG,neq:e3,gte:t3,lte:r3,cmp:n3,coerce:s3,Comparator:i3,Range:o3,satisfies:a3,toComparators:l3,maxSatisfying:u3,minSatisfying:c3,minVersion:f3,validRange:d3,outside:h3,gtr:p3,ltr:m3,intersects:g3,simplifyRange:y3,subset:_3,SemVer:LG,re:Qp.re,src:Qp.src,tokens:Qp.t,SEMVER_SPEC_VERSION:bT.SEMVER_SPEC_VERSION,RELEASE_TYPES:bT.RELEASE_TYPES,compareIdentifiers:vT.compareIdentifiers,rcompareIdentifiers:vT.rcompareIdentifiers}});var sm=E((MX,nm)=>{"use strict";var Zp=RT(),tm=V("node:assert"),rm=Symbol.for("registered-plugin"),{kTestInternals:S3}=De(),{exist:E3,existReply:b3,existRequest:v3}=hi(),{FST_ERR_PLUGIN_VERSION_MISMATCH:w3,FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE:R3,FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER:O3}=He(),T3=/-(?:rc|pre|alpha).+$/u;function go(t){return t[Symbol.for("plugin-meta")]}function OT(t){let e=TT(t);if(e)return e;let r=V.cache;if(r){let n=Object.keys(r);for(let s=0;s<n.length;s++){let i=n[s];if(r[i].exports===t)return i}}return t.name?t.name:null}function $3(t){return t.toString().split(`
344
+ `,2).map(e=>e.trim()).join(" -- ")}function TT(t){return t[Symbol.for("fastify.display-name")]}function $T(t){return!!t[Symbol.for("skip-override")]}function PT(t){let e=go(t);if(!e)return;let r=e.dependencies;r&&(tm(Array.isArray(r),"The dependencies should be an array of strings"),r.forEach(n=>{tm(this[rm].indexOf(n)>-1,`The dependency '${n}' of plugin '${e.name}' is not registered`)}))}function AT(t){let e=go(t);if(!e)return;let{decorators:r,name:n}=e;r&&(r.fastify&&em(this,"Fastify",r.fastify,n),r.reply&&em(this,"Reply",r.reply,n),r.request&&em(this,"Request",r.request,n))}var P3={Fastify:E3,Request:v3,Reply:b3};function em(t,e,r,n){tm(Array.isArray(r),"The decorators should be an array of strings"),r.forEach(s=>{let i=typeof n=="string"?` required by '${n}'`:"";if(!P3[e].call(t,s))throw new R3(s,i,e)})}function A3(t){let e=go(t);if(e?.fastify==null)return;let r=e.fastify,n=T3.test(this.version);if(!(n===!0&&Zp.gt(this.version,Zp.coerce(r))===!0)&&r&&Zp.satisfies(this.version,r,{includePrerelease:n})===!1)throw new w3(e.name,r,this.version)}function C3(t){let e=go(t);if(!e)return;let r=e.name;if(r)return this[rm].push(r),r}function I3(t,e){if(t.constructor.name==="AsyncFunction"&&t.length===3)throw new O3(e)}function N3(t){let e=C3.call(this,t)||OT(t);return I3.call(this,t,e),A3.call(this,t),AT.call(this,t),PT.call(this,t),$T(t)}nm.exports={getPluginName:OT,getFuncPreview:$3,kRegisteredPlugins:rm,getDisplayName:TT,registerPlugin:N3};nm.exports[S3]={shouldSkipOverride:$T,getMeta:go,checkDecorators:AT,checkDependencies:PT}});var Xl=E((VX,CT)=>{"use strict";function k3(t,e){let r=e||L3();return t?q3(t,r):r}function x3(t,e){return t.genReqId(e)}function L3(){let e=0;return function(){return e=e+1&2147483647,`req-${e.toString(36)}`}}function q3(t,e){return function(r){return r.headers[t]||e(r)}}CT.exports={getGenReqId:x3,reqIdGenFactory:k3}});var xT=E((zX,kT)=>{"use strict";var IT=12,j3=0,im=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7];function D3(t){var e=t.indexOf("%");if(e===-1)return t;for(var r=t.length,n="",s=0,i=0,o=e,a=IT;e>-1&&e<r;){var l=NT(t[e+1],4),u=NT(t[e+2],0),c=l|u,f=im[c];if(a=im[256+a+f],i=i<<6|c&im[364+f],a===IT)n+=t.slice(s,o),n+=i<=65535?String.fromCharCode(i):String.fromCharCode(55232+(i>>10),56320+(i&1023)),i=0,s=e+3,e=o=t.indexOf("%",s);else{if(a===j3)return null;if(e+=3,e<r&&t.charCodeAt(e)===37)continue;return null}}return n+t.slice(s)}var F3={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};function NT(t,e){var r=F3[t];return r===void 0?255:r<<e}kT.exports=D3});var FT=E((UX,DT)=>{"use strict";var LT=xT(),qT=/\+/g,jT=function(){};jT.prototype=Object.create(null);function M3(t){let e=new jT;if(typeof t!="string")return e;let r=t.length,n="",s="",i=-1,o=-1,a=!1,l=!1,u=!1,c=!1,f=!1,p=0;for(let h=0;h<r+1;h++)if(p=h!==r?t.charCodeAt(h):38,p===38){if(f=o>i,f||(o=h),n=t.slice(i+1,o),f||n.length>0){u&&(n=n.replace(qT," ")),a&&(n=LT(n)||n),f&&(s=t.slice(o+1,h),c&&(s=s.replace(qT," ")),l&&(s=LT(s)||s));let d=e[n];d===void 0?e[n]=s:d.pop?d.push(s):e[n]=[d,s]}s="",i=h,o=h,a=!1,l=!1,u=!1,c=!1}else p===61?o<=i?o=h:l=!0:p===43?o>i?c=!0:u=!0:p===37&&(o>i?l=!0:a=!0);return e}DT.exports=M3});var HT=E((BX,MT)=>{var pr=Array.from({length:256},(t,e)=>"%"+((e<16?"0":"")+e.toString(16)).toUpperCase()),H3=new Int8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0]);function V3(t){let e=t.length;if(e===0)return"";let r="",n=0,s=0;e:for(;s<e;s++){let i=t.charCodeAt(s);for(;i<128;){if(H3[i]!==1&&(n<s&&(r+=t.slice(n,s)),n=s+1,r+=pr[i]),++s===e)break e;i=t.charCodeAt(s)}if(n<s&&(r+=t.slice(n,s)),i<2048){n=s+1,r+=pr[192|i>>6]+pr[128|i&63];continue}if(i<55296||i>=57344){n=s+1,r+=pr[224|i>>12]+pr[128|i>>6&63]+pr[128|i&63];continue}if(++s,s>=e)throw new Error("URI malformed");let o=t.charCodeAt(s)&1023;n=s+1,i=65536+((i&1023)<<10|o),r+=pr[240|i>>18]+pr[128|i>>12&63]+pr[128|i>>6&63]+pr[128|i&63]}return n===0?t:n<e?r+t.slice(n):r}MT.exports={encodeString:V3}});var UT=E((GX,zT)=>{"use strict";var{encodeString:om}=HT();function VT(t){let e=typeof t;return e==="string"?om(t):e==="bigint"?t.toString():e==="boolean"?t?"true":"false":e==="number"&&Number.isFinite(t)?t<1e21?""+t:om(""+t):""}function z3(t){let e="";if(t===null||typeof t!="object")return e;let r="&",n=Object.keys(t),s=n.length,i=0;for(let o=0;o<s;o++){let a=n[o],l=t[a],u=om(a)+"=";if(o&&(e+=r),Array.isArray(l)){i=l.length;for(let c=0;c<i;c++)c&&(e+=r),e+=u,e+=VT(l[c])}else e+=u,e+=VT(l)}return e}zT.exports=z3});var JT=E((WX,yo)=>{"use strict";var BT=FT(),GT=UT(),WT={parse:BT,stringify:GT};yo.exports=WT;yo.exports.default=WT;yo.exports.parse=BT;yo.exports.stringify=GT});var YT=E(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:!0})});var XT=E(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.types=void 0;var U3;(function(t){t[t.ROOT=0]="ROOT",t[t.GROUP=1]="GROUP",t[t.POSITION=2]="POSITION",t[t.SET=3]="SET",t[t.RANGE=4]="RANGE",t[t.REPETITION=5]="REPETITION",t[t.REFERENCE=6]="REFERENCE",t[t.CHAR=7]="CHAR"})(U3=_o.types||(_o.types={}))});var ZT=E(QT=>{"use strict";Object.defineProperty(QT,"__esModule",{value:!0})});var kr=E(Nr=>{"use strict";var B3=Nr&&Nr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),am=Nr&&Nr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&B3(e,t,r)};Object.defineProperty(Nr,"__esModule",{value:!0});am(YT(),Nr);am(XT(),Nr);am(ZT(),Nr)});var Ql=E(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.anyChar=nt.notWhitespace=nt.whitespace=nt.notInts=nt.ints=nt.notWords=nt.words=void 0;var he=kr(),e$=()=>[{type:he.types.RANGE,from:48,to:57}],t$=()=>[{type:he.types.CHAR,value:95},{type:he.types.RANGE,from:97,to:122},{type:he.types.RANGE,from:65,to:90},{type:he.types.RANGE,from:48,to:57}],r$=()=>[{type:he.types.CHAR,value:9},{type:he.types.CHAR,value:10},{type:he.types.CHAR,value:11},{type:he.types.CHAR,value:12},{type:he.types.CHAR,value:13},{type:he.types.CHAR,value:32},{type:he.types.CHAR,value:160},{type:he.types.CHAR,value:5760},{type:he.types.RANGE,from:8192,to:8202},{type:he.types.CHAR,value:8232},{type:he.types.CHAR,value:8233},{type:he.types.CHAR,value:8239},{type:he.types.CHAR,value:8287},{type:he.types.CHAR,value:12288},{type:he.types.CHAR,value:65279}],G3=()=>[{type:he.types.CHAR,value:10},{type:he.types.CHAR,value:13},{type:he.types.CHAR,value:8232},{type:he.types.CHAR,value:8233}];nt.words=()=>({type:he.types.SET,set:t$(),not:!1});nt.notWords=()=>({type:he.types.SET,set:t$(),not:!0});nt.ints=()=>({type:he.types.SET,set:e$(),not:!1});nt.notInts=()=>({type:he.types.SET,set:e$(),not:!0});nt.whitespace=()=>({type:he.types.SET,set:r$(),not:!1});nt.notWhitespace=()=>({type:he.types.SET,set:r$(),not:!0});nt.anyChar=()=>({type:he.types.SET,set:G3(),not:!0})});var s$=E(Dt=>{"use strict";var W3=Dt&&Dt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),J3=Dt&&Dt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),K3=Dt&&Dt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&W3(e,t,r);return J3(e,t),e};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.tokenizeClass=Dt.strToChars=void 0;var n$=kr(),Ds=K3(Ql()),Y3="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?";Dt.strToChars=t=>{let e=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return t.replace(e,(r,n,s,i,o,a,l)=>{if(s)return r;let u=n?8:i?parseInt(i,16):o?parseInt(o,16):a?Y3.indexOf(a):{0:0,t:9,n:10,v:11,f:12,r:13}[l],c=String.fromCharCode(u);return/[[\]{}^$.|?*+()]/.test(c)?`\\${c}`:c})};Dt.tokenizeClass=(t,e)=>{var r,n,s,i,o,a,l;let u=[],c,f,p=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(((?:\\)])|(((?:\\)?([^\]])))))|(\])|(?:\\)?([^])/g;for(;(c=p.exec(t))!==null;){let h=(l=(a=(o=(i=(s=(n=(r=c[1]&&Ds.words())!==null&&r!==void 0?r:c[2]&&Ds.ints())!==null&&n!==void 0?n:c[3]&&Ds.whitespace())!==null&&s!==void 0?s:c[4]&&Ds.notWords())!==null&&i!==void 0?i:c[5]&&Ds.notInts())!==null&&o!==void 0?o:c[6]&&Ds.notWhitespace())!==null&&a!==void 0?a:c[7]&&{type:n$.types.RANGE,from:(c[8]||c[9]).charCodeAt(0),to:(f=c[10]).charCodeAt(f.length-1)})!==null&&l!==void 0?l:(f=c[16])&&{type:n$.types.CHAR,value:f.charCodeAt(0)};if(h)u.push(h);else return[u,p.lastIndex]}throw new SyntaxError(`Invalid regular expression: /${e}/: Unterminated character class`)}});var lm=E(mr=>{"use strict";var X3=mr&&mr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Q3=mr&&mr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a$=mr&&mr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&X3(e,t,r);return Q3(e,t),e};Object.defineProperty(mr,"__esModule",{value:!0});mr.tokenizer=void 0;var i$=a$(s$()),Ye=kr(),Ln=a$(Ql()),Z3=/^[a-zA-Z_$]$/i,e9=/^[a-zA-Z0-9_$]$/i,o$=/\d/;mr.tokenizer=t=>{let e=0,r,n={type:Ye.types.ROOT,stack:[]},s=n,i=n.stack,o=[],a=[],l=0,u=f=>{throw new SyntaxError(`Invalid regular expression: /${t}/: Nothing to repeat at column ${f-1}`)},c=i$.strToChars(t);for(;e<c.length;)switch(r=c[e++]){case"\\":if(e===c.length)throw new SyntaxError(`Invalid regular expression: /${t}/: \\ at end of pattern`);switch(r=c[e++]){case"b":i.push({type:Ye.types.POSITION,value:"b"});break;case"B":i.push({type:Ye.types.POSITION,value:"B"});break;case"w":i.push(Ln.words());break;case"W":i.push(Ln.notWords());break;case"d":i.push(Ln.ints());break;case"D":i.push(Ln.notInts());break;case"s":i.push(Ln.whitespace());break;case"S":i.push(Ln.notWhitespace());break;default:if(o$.test(r)){let f=r;for(;e<c.length&&o$.test(c[e]);)f+=c[e++];let p=parseInt(f,10),h={type:Ye.types.REFERENCE,value:p};i.push(h),a.push({reference:h,stack:i,index:i.length-1})}else i.push({type:Ye.types.CHAR,value:r.charCodeAt(0)})}break;case"^":i.push({type:Ye.types.POSITION,value:"^"});break;case"$":i.push({type:Ye.types.POSITION,value:"$"});break;case"[":{let f;c[e]==="^"?(f=!0,e++):f=!1;let p=i$.tokenizeClass(c.slice(e),t);e+=p[1],i.push({type:Ye.types.SET,set:p[0],not:f});break}case".":i.push(Ln.anyChar());break;case"(":{let f={type:Ye.types.GROUP,stack:[],remember:!0};if(c[e]==="?")if(r=c[e+1],e+=2,r==="=")f.followedBy=!0,f.remember=!1;else if(r==="!")f.notFollowedBy=!0,f.remember=!1;else if(r==="<"){let p="";if(Z3.test(c[e]))p+=c[e],e++;else throw new SyntaxError(`Invalid regular expression: /${t}/: Invalid capture group name, character '${c[e]}' after '<' at column ${e+1}`);for(;e<c.length&&e9.test(c[e]);)p+=c[e],e++;if(!p)throw new SyntaxError(`Invalid regular expression: /${t}/: Invalid capture group name, character '${c[e]}' after '<' at column ${e+1}`);if(c[e]!==">")throw new SyntaxError(`Invalid regular expression: /${t}/: Unclosed capture group name, expected '>', found '${c[e]}' at column ${e+1}`);f.name=p,e++}else if(r===":")f.remember=!1;else throw new SyntaxError(`Invalid regular expression: /${t}/: Invalid group, character '${r}' after '?' at column ${e-1}`);else l+=1;i.push(f),o.push(s),s=f,i=f.stack;break}case")":if(o.length===0)throw new SyntaxError(`Invalid regular expression: /${t}/: Unmatched ) at column ${e-1}`);s=o.pop(),i=s.options?s.options[s.options.length-1]:s.stack;break;case"|":{s.options||(s.options=[s.stack],delete s.stack);let f=[];s.options.push(f),i=f;break}case"{":{let f=/^(\d+)(,(\d+)?)?\}/.exec(c.slice(e)),p,h;f!==null?(i.length===0&&u(e),p=parseInt(f[1],10),h=f[2]?f[3]?parseInt(f[3],10):1/0:p,e+=f[0].length,i.push({type:Ye.types.REPETITION,min:p,max:h,value:i.pop()})):i.push({type:Ye.types.CHAR,value:123});break}case"?":i.length===0&&u(e),i.push({type:Ye.types.REPETITION,min:0,max:1,value:i.pop()});break;case"+":i.length===0&&u(e),i.push({type:Ye.types.REPETITION,min:1,max:1/0,value:i.pop()});break;case"*":i.length===0&&u(e),i.push({type:Ye.types.REPETITION,min:0,max:1/0,value:i.pop()});break;default:i.push({type:Ye.types.CHAR,value:r.charCodeAt(0)})}if(o.length!==0)throw new SyntaxError(`Invalid regular expression: /${t}/: Unterminated group`);return t9(a,l),n};function t9(t,e){for(let r of t.reverse())if(e<r.reference.value){r.reference.type=Ye.types.CHAR;let n=r.reference.value.toString();if(r.reference.value=parseInt(n,8),!/^[0-7]+$/.test(n)){let s=0;for(;n[s]!=="8"&&n[s]!=="9";)s+=1;if(s===0?(r.reference.value=n.charCodeAt(0),s+=1):r.reference.value=parseInt(n.slice(0,s),8),n.length>s){let i=r.stack.splice(r.index+1);for(let o of n.slice(s))r.stack.push({type:Ye.types.CHAR,value:o.charCodeAt(0)});r.stack.push(...i)}}}}});var u$=E(st=>{"use strict";var r9=st&&st.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),n9=st&&st.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s9=st&&st.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&r9(e,t,r);return n9(e,t),e};Object.defineProperty(st,"__esModule",{value:!0});st.NOTANYCHAR=st.WHITESPACE=st.WORDS=st.INTS=void 0;var Zl=s9(Ql()),l$=kr();function eu(t){let e={},r=0;for(let n of t)n.type===l$.types.CHAR&&(e[n.value]=!0),n.type===l$.types.RANGE&&(e[`${n.from}-${n.to}`]=!0),r+=1;return{lookup:()=>Object.assign({},e),len:r}}st.INTS=eu(Zl.ints().set);st.WORDS=eu(Zl.words().set);st.WHITESPACE=eu(Zl.whitespace().set);st.NOTANYCHAR=eu(Zl.anyChar().set)});var f$=E(Ft=>{"use strict";var i9=Ft&&Ft.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),o9=Ft&&Ft.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a9=Ft&&Ft.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&i9(e,t,r);return o9(e,t),e};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.writeSetTokens=Ft.setChar=void 0;var su=kr(),tu=a9(u$());function nu(t){return t===94?"\\^":t===92?"\\\\":t===93?"\\]":t===45?"\\-":String.fromCharCode(t)}Ft.setChar=nu;function ru(t,{lookup:e,len:r}){if(r!==t.length)return!1;let n=e();for(let s of t){if(s.type===su.types.SET)return!1;let i=s.type===su.types.CHAR?s.value:`${s.from}-${s.to}`;if(n[i])n[i]=!1;else return!1}return!0}function c$(t,e=!1){if(ru(t.set,tu.INTS))return t.not?"\\D":"\\d";if(ru(t.set,tu.WORDS))return t.not?"\\W":"\\w";if(t.not&&ru(t.set,tu.NOTANYCHAR))return".";if(ru(t.set,tu.WHITESPACE))return t.not?"\\S":"\\s";let r="";for(let s=0;s<t.set.length;s++){let i=t.set[s];r+=l9(i)}let n=`${t.not?"^":""}${r}`;return e?n:`[${n}]`}Ft.writeSetTokens=c$;function l9(t){return t.type===su.types.CHAR?nu(t.value):t.type===su.types.RANGE?`${nu(t.from)}-${nu(t.to)}`:c$(t,!0)}});var cm=E(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.reconstruct=void 0;var nn=kr(),um=f$(),d$=t=>t.map(Fs.reconstruct).join(""),h$=t=>{if("options"in t)return t.options.map(d$).join("|");if("stack"in t)return d$(t.stack);throw new Error("options or stack must be Root or Group token")};Fs.reconstruct=t=>{switch(t.type){case nn.types.ROOT:return h$(t);case nn.types.CHAR:{let e=String.fromCharCode(t.value);return(/[[\\{}$^.|?*+()]/.test(e)?"\\":"")+e}case nn.types.POSITION:return t.value==="^"||t.value==="$"?t.value:`\\${t.value}`;case nn.types.REFERENCE:return`\\${t.value}`;case nn.types.SET:return um.writeSetTokens(t);case nn.types.GROUP:return`(${t.name?`?<${t.name}>`:t.remember?"":t.followedBy?"?=":t.notFollowedBy?"?!":"?:"}${h$(t)})`;case nn.types.REPETITION:{let{min:e,max:r}=t,n;return e===0&&r===1?n="?":e===1&&r===1/0?n="+":e===0&&r===1/0?n="*":r===1/0?n=`{${e},}`:e===r?n=`{${e}}`:n=`{${e},${r}}`,`${Fs.reconstruct(t.value)}${n}`}case nn.types.RANGE:return`${um.setChar(t.from)}-${um.setChar(t.to)}`;default:throw new Error(`Invalid token type ${t}`)}}});var g$=E((Mt,iu)=>{"use strict";var u9=Mt&&Mt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fm=Mt&&Mt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&u9(e,t,r)};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.types=void 0;var p$=kr();Object.defineProperty(Mt,"types",{enumerable:!0,get:function(){return p$.types}});fm(lm(),Mt);fm(cm(),Mt);var m$=lm(),c9=cm();fm(kr(),Mt);Mt.default=m$.tokenizer;iu.exports=m$.tokenizer;iu.exports.types=p$.types;iu.exports.reconstruct=c9.reconstruct});var _$=E((sQ,ou)=>{"use strict";var y$=g$(),f9=y$.types;function dm(t,e){e||(e={});let r=e.limit===void 0?25:e.limit;d9(t)?t=t.source:typeof t!="string"&&(t=String(t));try{t=y$(t)}catch{return!1}let n=0;return function s(i,o){let a,l,u;if(i.type===f9.REPETITION&&(o++,n++,o>1||n>r))return!1;if(i.options){for(a=0,u=i.options.length;a<u;a++)if(l=s({stack:i.options[a]},o),!l)return!1}let c=i.stack||i.value?.stack;if(!c)return!0;for(a=0;a<c.length;a++)if(l=s(c[a],o),!l)return!1;return!0}(t,0)}function d9(t){return{}.toString.call(t)==="[object RegExp]"}ou.exports=dm;ou.exports.default=dm;ou.exports.safeRegex=dm});var au=E((iQ,S$)=>{"use strict";S$.exports={name:"__fmw_internal_strategy_merged_tree_http_method__",storage:function(){let t=new Map;return{get:e=>t.get(e)||null,set:(e,r)=>{t.set(e,r)}}},deriveConstraint:t=>t.method,mustMatchWhenDerived:!0}});var T$=E((oQ,O$)=>{"use strict";var E$=Ai(),b$=au(),v$=Symbol("treeData");function w$(t,e=""){let r="",n=Object.keys(t);for(let s=0;s<n.length;s++){let i=n[s],o=t[i],a=s===n.length-1,l=a?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",u=a?" ":"\u2502 ",f=(o[v$]||"").replaceAll(`
345
345
  `,`
346
346
  `+e+u);r+=e+l+i+f+`
347
- `,r+=v$(o,e+u)}return r}function l9(t){let e=t.name||"";return e=e.replace("bound","").trim(),e=(e||"anonymous")+"()",e}function w$(t){return Array.isArray(t)?t.map(e=>w$(e)):typeof t=="symbol"?t.toString():typeof t=="function"?l9(t):t}function u9(t,e){if(!e.includeMeta)return{};let r=e.buildPrettyMeta(t),n={},s=e.includeMeta;Array.isArray(s)||(s=Reflect.ownKeys(r));for(let i of s){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let o=i.toString(),a=r[i];if(a!=null){let l=JSON.stringify(w$(a));n[o]=l}}return n}function c9(t){let e="";for(let[r,n]of Object.entries(t))e+=`
348
- \u2022 (${r}) ${n}`;return e}function f9(t){let e={...t.opts.constraints},r=e[E$.name];return delete e[E$.name],{...t,method:r,opts:{constraints:e}}}function d9(t){let e=` (${t.method})`,r=t.opts.constraints||{};return Object.keys(r).length!==0&&(e+=" "+JSON.stringify(r)),e+=c9(t.metaData),e}function h9(t){return t.reduce((e,r)=>{for(let n of e)if(S$(r.opts.constraints,n.opts.constraints)&&S$(r.metaData,n.metaData))return n.method+=", "+r.method,e;return e.push(r),e},[])}function p9(t,e,r){let n=t.routes;return r.method===void 0&&(n=n.map(f9)),n=n.map(s=>(s.metaData=u9(s,r),s)),r.method===void 0&&(n=h9(n)),n.map(d9).join(`
349
- ${e}`)}function au(t,e,r,n){if((t.isLeafNode||n.commonPrefix!==!1)&&(r=r||"(empty root node)",e=e[r]={},t.isLeafNode&&(e[b$]=p9(t,r,n)),r=""),t.staticChildren)for(let s of Object.values(t.staticChildren))au(s,e,r+s.prefix,n);if(t.parametricChildren)for(let s of Object.values(t.parametricChildren)){let i=Array.from(s.nodePaths).join("|");au(s,e,r+i,n)}t.wildcardChild&&au(t.wildcardChild,e,"*",n)}function m9(t,e){let r={};return au(t,r,t.prefix,e),v$(r)}R$.exports={prettyPrintTree:m9}});var P$=E((ZX,$$)=>{"use strict";var T$=function(){};T$.prototype=Object.create(null);$$.exports={NullObject:T$}});var C$=E((eQ,A$)=>{"use strict";var{NullObject:g9}=P$(),y9=ou(),dm=class{constructor(){this.unconstrainedHandler=null,this.constraints=[],this.handlers=[],this.constrainedHandlerStores=null}getMatchingHandler(e){return e===void 0?this.unconstrainedHandler:this._getHandlerMatchingConstraints(e)}addHandler(e,r){let n=r.params,s=r.opts.constraints||{},i={params:n,constraints:s,handler:r.handler,store:r.store||null,_createParamsObject:this._compileCreateParamsObject(n)},o=Object.keys(s);o.length===0&&(this.unconstrainedHandler=i);for(let l of o)this.constraints.includes(l)||(l==="version"?this.constraints.unshift(l):this.constraints.push(l));let a=o.includes(y9.name);if(!a&&this.handlers.length>=31)throw new Error("find-my-way supports a maximum of 31 route handlers per node when there are constraints, limit reached");this.handlers.push(i),this.handlers.sort((l,u)=>Object.keys(l.constraints).length-Object.keys(u.constraints).length),a||this._compileGetHandlerMatchingConstraints(e,s)}_compileCreateParamsObject(e){let r=[];r.push("const fn = function _createParamsObject (paramsArray) {"),r.push("const params = new NullObject()");for(let n=0;n<e.length;n++)r.push(`params['${e[n]}'] = paramsArray[${n}]`);return r.push("return params"),r.push("}"),r.push("return fn"),new Function("NullObject",r.join(`
350
- `))(g9)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(e,r){for(let n=0;n<this.handlers.length;n++){let i=this.handlers[n].constraints[r];if(i!==void 0){let o=e.get(i)||0;o|=1<<n,e.set(i,o)}}}_constrainedIndexBitmask(e){let r=0;for(let n=0;n<this.handlers.length;n++)this.handlers[n].constraints[e]!==void 0&&(r|=1<<n);return~r}_compileGetHandlerMatchingConstraints(e){this.constrainedHandlerStores={};for(let n of this.constraints){let s=e.newStoreForConstraint(n);this.constrainedHandlerStores[n]=s,this._buildConstraintStore(s,n)}let r=[];r.push(`
347
+ `,r+=w$(o,e+u)}return r}function h9(t){let e=t.name||"";return e=e.replace("bound","").trim(),e=(e||"anonymous")+"()",e}function R$(t){return Array.isArray(t)?t.map(e=>R$(e)):typeof t=="symbol"?t.toString():typeof t=="function"?h9(t):t}function p9(t,e){if(!e.includeMeta)return{};let r=e.buildPrettyMeta(t),n={},s=e.includeMeta;Array.isArray(s)||(s=Reflect.ownKeys(r));for(let i of s){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let o=i.toString(),a=r[i];if(a!=null){let l=JSON.stringify(R$(a));n[o]=l}}return n}function m9(t){let e="";for(let[r,n]of Object.entries(t))e+=`
348
+ \u2022 (${r}) ${n}`;return e}function g9(t){let e={...t.opts.constraints},r=e[b$.name];return delete e[b$.name],{...t,method:r,opts:{constraints:e}}}function y9(t){let e=` (${t.method})`,r=t.opts.constraints||{};return Object.keys(r).length!==0&&(e+=" "+JSON.stringify(r)),e+=m9(t.metaData),e}function _9(t){return t.reduce((e,r)=>{for(let n of e)if(E$(r.opts.constraints,n.opts.constraints)&&E$(r.metaData,n.metaData))return n.method+=", "+r.method,e;return e.push(r),e},[])}function S9(t,e,r){let n=t.routes;return r.method===void 0&&(n=n.map(g9)),n=n.map(s=>(s.metaData=p9(s,r),s)),r.method===void 0&&(n=_9(n)),n.map(y9).join(`
349
+ ${e}`)}function lu(t,e,r,n){if((t.isLeafNode||n.commonPrefix!==!1)&&(r=r||"(empty root node)",e=e[r]={},t.isLeafNode&&(e[v$]=S9(t,r,n)),r=""),t.staticChildren)for(let s of Object.values(t.staticChildren))lu(s,e,r+s.prefix,n);if(t.parametricChildren)for(let s of Object.values(t.parametricChildren)){let i=Array.from(s.nodePaths).join("|");lu(s,e,r+i,n)}t.wildcardChild&&lu(t.wildcardChild,e,"*",n)}function E9(t,e){let r={};return lu(t,r,t.prefix,e),w$(r)}O$.exports={prettyPrintTree:E9}});var A$=E((aQ,P$)=>{"use strict";var $$=function(){};$$.prototype=Object.create(null);P$.exports={NullObject:$$}});var I$=E((lQ,C$)=>{"use strict";var{NullObject:b9}=A$(),v9=au(),hm=class{constructor(){this.unconstrainedHandler=null,this.constraints=[],this.handlers=[],this.constrainedHandlerStores=null}getMatchingHandler(e){return e===void 0?this.unconstrainedHandler:this._getHandlerMatchingConstraints(e)}addHandler(e,r){let n=r.params,s=r.opts.constraints||{},i={params:n,constraints:s,handler:r.handler,store:r.store||null,_createParamsObject:this._compileCreateParamsObject(n)},o=Object.keys(s);o.length===0&&(this.unconstrainedHandler=i);for(let l of o)this.constraints.includes(l)||(l==="version"?this.constraints.unshift(l):this.constraints.push(l));let a=o.includes(v9.name);if(!a&&this.handlers.length>=31)throw new Error("find-my-way supports a maximum of 31 route handlers per node when there are constraints, limit reached");this.handlers.push(i),this.handlers.sort((l,u)=>Object.keys(l.constraints).length-Object.keys(u.constraints).length),a||this._compileGetHandlerMatchingConstraints(e,s)}_compileCreateParamsObject(e){let r=[];r.push("const fn = function _createParamsObject (paramsArray) {"),r.push("const params = new NullObject()");for(let n=0;n<e.length;n++)r.push(`params['${e[n]}'] = paramsArray[${n}]`);return r.push("return params"),r.push("}"),r.push("return fn"),new Function("NullObject",r.join(`
350
+ `))(b9)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(e,r){for(let n=0;n<this.handlers.length;n++){let i=this.handlers[n].constraints[r];if(i!==void 0){let o=e.get(i)||0;o|=1<<n,e.set(i,o)}}}_constrainedIndexBitmask(e){let r=0;for(let n=0;n<this.handlers.length;n++)this.handlers[n].constraints[e]!==void 0&&(r|=1<<n);return~r}_compileGetHandlerMatchingConstraints(e){this.constrainedHandlerStores={};for(let n of this.constraints){let s=e.newStoreForConstraint(n);this.constrainedHandlerStores[n]=s,this._buildConstraintStore(s,n)}let r=[];r.push(`
351
351
  let candidates = ${(1<<this.handlers.length)-1}
352
352
  let mask, matches
353
353
  `);for(let n of this.constraints){r.push(`
@@ -362,8 +362,8 @@ ${e}`)}function au(t,e,r,n){if((t.isLeafNode||n.commonPrefix!==!1)&&(r=r||"(empt
362
362
  }
363
363
  if (candidates === 0) return null;
364
364
  `)}for(let n in e.strategies)e.strategies[n].mustMatchWhenDerived&&!this.constraints.includes(n)&&r.push(`if (derivedConstraints.${n} !== undefined) return null`);r.push("return this.handlers[Math.floor(Math.log2(candidates))]"),this._getHandlerMatchingConstraints=new Function("derivedConstraints",r.join(`
365
- `))}};A$.exports=dm});var N$=E((tQ,I$)=>{"use strict";var _9=C$(),hu={STATIC:0,PARAMETRIC:1,WILDCARD:2},lu=class{constructor(){this.isLeafNode=!1,this.routes=null,this.handlerStorage=null}addRoute(e,r){this.routes===null&&(this.routes=[]),this.handlerStorage===null&&(this.handlerStorage=new _9),this.isLeafNode=!0,this.routes.push(e),this.handlerStorage.addHandler(r,e)}},uu=class extends lu{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(e,r){let n=this.staticChildren[e.charAt(r)];return n===void 0||!n.matchPrefix(e,r)?null:n}getStaticChild(e,r=0){if(e.length===r)return this;let n=this.findStaticMatchingChild(e,r);return n?n.getStaticChild(e,r+n.prefix.length):null}createStaticChild(e){if(e.length===0)return this;let r=this.staticChildren[e.charAt(0)];if(r){let s=1;for(;s<r.prefix.length;s++)if(e.charCodeAt(s)!==r.prefix.charCodeAt(s)){r=r.split(this,s);break}return r.createStaticChild(e.slice(s))}let n=e.charAt(0);return this.staticChildren[n]=new cu(e),this.staticChildren[n]}},cu=class t extends uu{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=hu.STATIC,this._compilePrefixMatch()}getParametricChild(e){let r=e&&e.source,n=this.parametricChildren.find(s=>(s.regex&&s.regex.source)===r);return n||null}createParametricChild(e,r,n){let s=this.getParametricChild(e);return s?(s.nodePaths.add(n),s):(s=new fu(e,r,n),this.parametricChildren.push(s),this.parametricChildren.sort((i,o)=>i.isRegex?o.isRegex?i.staticSuffix===null?1:o.staticSuffix===null?-1:o.staticSuffix.endsWith(i.staticSuffix)?1:i.staticSuffix.endsWith(o.staticSuffix)?-1:0:-1:1),s)}getWildcardChild(){return this.wildcardChild}createWildcardChild(){return this.wildcardChild=this.getWildcardChild()||new du,this.wildcardChild}split(e,r){let n=this.prefix.slice(0,r),s=this.prefix.slice(r);this.prefix=s,this._compilePrefixMatch();let i=new t(n);return i.staticChildren[s.charAt(0)]=this,e.staticChildren[n.charAt(0)]=i,i}getNextNode(e,r,n,s){let i=this.findStaticMatchingChild(e,r),o=0;if(i===null){if(this.parametricChildren.length===0)return this.wildcardChild;i=this.parametricChildren[0],o=1}this.wildcardChild!==null&&n.push({paramsCount:s,brotherPathIndex:r,brotherNode:this.wildcardChild});for(let a=this.parametricChildren.length-1;a>=o;a--)n.push({paramsCount:s,brotherPathIndex:r,brotherNode:this.parametricChildren[a]});return i}_compilePrefixMatch(){if(this.prefix.length===1){this.matchPrefix=()=>!0;return}let e=[];for(let r=1;r<this.prefix.length;r++){let n=this.prefix.charCodeAt(r);e.push(`path.charCodeAt(i + ${r}) === ${n}`)}this.matchPrefix=new Function("path","i",`return ${e.join(" && ")}`)}},fu=class extends uu{constructor(e,r,n){super(),this.isRegex=!!e,this.regex=e||null,this.staticSuffix=r||null,this.kind=hu.PARAMETRIC,this.nodePaths=new Set([n])}getNextNode(e,r){return this.findStaticMatchingChild(e,r)}},du=class extends lu{constructor(){super(),this.kind=hu.WILDCARD}getNextNode(){return null}};I$.exports={StaticNode:cu,ParametricNode:fu,WildcardNode:du,NODE_TYPES:hu}});var x$=E((rQ,k$)=>{"use strict";var S9=V("node:assert");function _o(){if(!(this instanceof _o))return new _o;this.store=new Map,this.maxMajor=0,this.maxMinors={},this.maxPatches={}}_o.prototype.set=function(t,e){if(typeof t!="string")throw new TypeError("Version should be a string");let[r,n,s]=t.split(".",3);if(isNaN(r))throw new TypeError("Major version must be a numeric value");return r=Number(r),n=Number(n)||0,s=Number(s)||0,r>=this.maxMajor&&(this.maxMajor=r,this.store.set("x",e),this.store.set("*",e),this.store.set("x.x",e),this.store.set("x.x.x",e)),n>=(this.maxMinors[r]||0)&&(this.maxMinors[r]=n,this.store.set(`${r}.x`,e),this.store.set(`${r}.x.x`,e)),s>=(this.maxPatches[`${r}.${n}`]||0)&&(this.maxPatches[`${r}.${n}`]=s,this.store.set(`${r}.${n}.x`,e)),this.store.set(`${r}.${n}.${s}`,e),this};_o.prototype.get=function(t){return this.store.get(t)};k$.exports={name:"version",mustMatchWhenDerived:!0,storage:_o,validate(t){S9(typeof t=="string","Version should be a string")}}});var q$=E((nQ,L$)=>{"use strict";var E9=V("node:assert");function b9(){let t=new Map,e=[];return{get:r=>{let n=t.get(r);if(n)return n;for(let s of e)if(s.host.test(r))return s.value},set:(r,n)=>{r instanceof RegExp?e.push({host:r,value:n}):t.set(r,n)}}}L$.exports={name:"host",mustMatchWhenDerived:!1,storage:b9,validate(t){E9(typeof t=="string"||Object.prototype.toString.call(t)==="[object RegExp]","Host should be a string or a RegExp")}}});var D$=E((sQ,j$)=>{"use strict";var v9=x$(),w9=q$(),hm=V("node:assert"),pm=class{constructor(e){if(this.strategies={version:v9,host:w9},this.strategiesInUse=new Set,this.asyncStrategiesInUse=new Set,e)for(let r of Object.values(e))this.addConstraintStrategy(r)}isStrategyUsed(e){return this.strategiesInUse.has(e)||this.asyncStrategiesInUse.has(e)}hasConstraintStrategy(e){let r=this.strategies[e];return r!==void 0?r.isCustom||this.isStrategyUsed(e):!1}addConstraintStrategy(e){if(hm(typeof e.name=="string"&&e.name!=="","strategy.name is required."),hm(e.storage&&typeof e.storage=="function","strategy.storage function is required."),hm(e.deriveConstraint&&typeof e.deriveConstraint=="function","strategy.deriveConstraint function is required."),this.strategies[e.name]&&this.strategies[e.name].isCustom)throw new Error(`There already exists a custom constraint with the name ${e.name}.`);if(this.isStrategyUsed(e.name))throw new Error(`There already exists a route with ${e.name} constraint.`);e.isCustom=!0,e.isAsync=e.deriveConstraint.length===3,this.strategies[e.name]=e,e.mustMatchWhenDerived&&this.noteUsage({[e.name]:e})}deriveConstraints(e,r,n){let s=this.deriveSyncConstraints(e,r);if(n===void 0)return s;this.deriveAsyncConstraints(s,e,r,n)}deriveSyncConstraints(e,r){}noteUsage(e){if(e){let r=this.strategiesInUse.size;for(let n in e)this.strategies[n].isAsync?this.asyncStrategiesInUse.add(n):this.strategiesInUse.add(n);r!==this.strategiesInUse.size&&this._buildDeriveConstraints()}}newStoreForConstraint(e){if(!this.strategies[e])throw new Error(`No strategy registered for constraint key ${e}`);return this.strategies[e].storage()}validateConstraints(e){for(let r in e){let n=e[r];if(typeof n>"u")throw new Error("Can't pass an undefined constraint value, must pass null or no key at all");let s=this.strategies[r];if(!s)throw new Error(`No strategy registered for constraint key ${r}`);s.validate&&s.validate(n)}}deriveAsyncConstraints(e,r,n,s){let i=this.asyncStrategiesInUse.size;if(i===0){s(null,e);return}e=e||{};for(let o of this.asyncStrategiesInUse)this.strategies[o].deriveConstraint(r,n,(l,u)=>{if(l!==null){s(l);return}e[o]=u,--i===0&&s(null,e)})}_buildDeriveConstraints(){if(this.strategiesInUse.size===0)return;let e=["return {"];for(let r of this.strategiesInUse){let n=this.strategies[r];n.isCustom?e.push(` ${n.name}: this.strategies.${r}.deriveConstraint(req, ctx),`):r==="version"?e.push(" version: req.headers['accept-version'],"):e.push(" host: req.headers.host || req.headers[':authority'],")}e.push("}"),this.deriveSyncConstraints=new Function("req","ctx",e.join(`
366
- `)).bind(this)}};j$.exports=pm});var M$=E((iQ,F$)=>{"use strict";var R9=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","QUERY","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];F$.exports=R9});var z$=E((oQ,V$)=>{"use strict";function H$(t,e){return t===50?e===53?"%":e===51?"#":e===52?"$":e===54?"&":e===66||e===98?"+":e===67||e===99?",":e===70||e===102?"/":null:t===51?e===65||e===97?":":e===66||e===98?";":e===68||e===100?"=":e===70||e===102?"?":null:t===52&&e===48?"@":null}function O9(t,e){let r=!1,n=!1,s="";for(let o=1;o<t.length;o++){let a=t.charCodeAt(o);if(a===37){let l=t.charCodeAt(o+1),u=t.charCodeAt(o+2);H$(l,u)===null?r=!0:(n=!0,l===50&&u===53&&(r=!0,t=t.slice(0,o+1)+"25"+t.slice(o+1),o+=2),o+=2)}else if(a===63||a===35||a===59&&e){s=t.slice(o+1),t=t.slice(0,o);break}}return{path:r?decodeURI(t):t,querystring:s,shouldDecodeParam:n}}function T9(t){let e=t.indexOf("%");if(e===-1)return t;let r="",n=e;for(let s=e;s<t.length;s++)if(t.charCodeAt(s)===37){let i=t.charCodeAt(s+1),o=t.charCodeAt(s+2),a=H$(i,o);r+=t.slice(n,s)+a,n=s+3}return t.slice(0,e)+r+t.slice(n)}V$.exports={safeDecodeURI:O9,safeDecodeURIComponent:T9}});var Em=E((aQ,Z$)=>{"use strict";var qe=V("node:assert"),$9=WT(),Hs=y$(),ym=Pi(),{prettyPrintTree:P9}=O$(),{StaticNode:U$,NODE_TYPES:B$}=N$(),A9=D$(),Ms=M$(),mm=ou(),{safeDecodeURI:G$,safeDecodeURIComponent:gm}=z$(),W$=/^https?:\/\/.*?\//,qn=/(\/:[^/()]*?)\?(\/?)/,J$=/[.*+?^${}()|[\]\\]/g,K$=/\/\/+/g;if(!Hs(W$))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!Hs(qn))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");if(!Hs(J$))throw new Error("the ESCAPE_REGEXP is not safe, update this module");if(!Hs(K$))throw new Error("the REMOVE_DUPLICATE_SLASHES_REGEXP is not safe, update this module");function Te(t){if(!(this instanceof Te))return new Te(t);t=t||{},this._opts=t,t.defaultRoute?(qe(typeof t.defaultRoute=="function","The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(qe(typeof t.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(qe(typeof t.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=C9,t.querystringParser?(qe(typeof t.querystringParser=="function","querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=e=>e.length===0?{}:$9.parse(e),this.caseSensitive=t.caseSensitive===void 0?!0:t.caseSensitive,this.ignoreTrailingSlash=t.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=t.ignoreDuplicateSlashes||!1,this.maxParamLength=t.maxParamLength||100,this.allowUnsafeRegex=t.allowUnsafeRegex||!1,this.constrainer=new A9(t.constraints),this.useSemicolonDelimiter=t.useSemicolonDelimiter||!1,this.routes=[],this.trees={}}Te.prototype.on=function(e,r,n,s,i){typeof n=="function"&&(s!==void 0&&(i=s),s=n,n={}),qe(typeof r=="string","Path should be a string"),qe(r.length>0,"The path could not be empty"),qe(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`"),qe(typeof s=="function","Handler should be a function");let o=r.match(qn);if(o){qe(r.length===o.index+o[0].length,"Optional Parameter needs to be the last parameter of the path");let u=r.replace(qn,"$1$2"),c=r.replace(qn,"$2")||"/";this.on(e,u,n,s,i),this.on(e,c,n,s,i);return}let a=r;this.ignoreDuplicateSlashes&&(r=_m(r)),this.ignoreTrailingSlash&&(r=Sm(r));let l=Array.isArray(e)?e:[e];for(let u of l)qe(typeof u=="string","Method should be a string"),qe(Ms.includes(u),`Method '${u}' is not an http method.`),this._on(u,r,n,s,i,a)};Te.prototype._on=function(e,r,n,s,i){let o={};n.constraints!==void 0&&(qe(typeof n.constraints=="object"&&n.constraints!==null,"Constraints should be an object"),Object.keys(n.constraints).length!==0&&(o=n.constraints)),this.constrainer.validateConstraints(o),this.constrainer.noteUsage(o),this.trees[e]===void 0&&(this.trees[e]=new U$("/"));let a=r;if(a==="*"&&this.trees[e].prefix.length!==0){let p=this.trees[e];this.trees[e]=new U$(""),this.trees[e].staticChildren["/"]=p}let l=this.trees[e],u=l.prefix.length,c=[];for(let p=0;p<=a.length;p++){if(a.charCodeAt(p)===58&&a.charCodeAt(p+1)===58){p++;continue}let h=a.charCodeAt(p)===58&&a.charCodeAt(p+1)!==58,d=a.charCodeAt(p)===42;if(h||d||p===a.length&&p!==u){let m=a.slice(u,p);this.caseSensitive||(m=m.toLowerCase()),m=m.replaceAll("::",":"),m=m.replaceAll("%","%25"),l=l.createStaticChild(m)}if(h){let m=!1,g=!0,S="",b=[],_=p+1;for(let y=_;;y++){let R=a.charCodeAt(y),T=R===40,O=R===45||R===46,w=R===47||y===a.length;if(T||O||w){let $=a.slice(_,y);if(c.push($),m=m||T||O,T){let C=Q$(a,y),k=a.slice(y,C+1);this.allowUnsafeRegex||qe(Hs(new RegExp(k)),`The regex '${k}' is not safe!`),b.push(X$(k)),y=C+1,g=!0}else b.push(g?"(.*?)":`(${S}|(?:(?!${S}).)*)`),g=!1;let v=y;for(;y<a.length;y++){let C=a.charCodeAt(y);if(C===47)break;if(C===58)if(a.charCodeAt(y+1)===58)y++;else break}let P=a.slice(v,y);if(P&&(P=P.replaceAll("::",":"),P=P.replaceAll("%","%25"),b.push(S=Y$(P))),_=y+1,w||a.charCodeAt(y)===47||y===a.length){let C=m?"()"+P:P,k=a.slice(p,y);a=a.slice(0,p+1)+C+a.slice(y),p+=C.length;let M=m?new RegExp("^"+b.join("")+"$"):null;l=l.createParametricChild(M,P||null,k),u=p+1;break}}}}else if(d&&(c.push("*"),l=l.createWildcardChild(),u=p+1,p!==a.length-1))throw new Error("Wildcard must be the last character in the route")}this.caseSensitive||(a=a.toLowerCase()),a==="*"&&(a="/*");for(let p of this.routes){let h=p.opts.constraints||{};if(p.method===e&&p.pattern===a&&ym(h,o))throw new Error(`Method '${e}' already declared for route '${a}' with constraints '${JSON.stringify(o)}'`)}let f={method:e,path:r,pattern:a,params:c,opts:n,handler:s,store:i};this.routes.push(f),l.addRoute(f,this.constrainer)};Te.prototype.hasRoute=function(e,r,n){return this.findRoute(e,r,n)!==null};Te.prototype.findRoute=function(e,r,n={}){if(this.trees[e]===void 0)return null;let s=r,i=this.trees[e],o=i.prefix.length,a=[];for(let l=0;l<=s.length;l++){if(s.charCodeAt(l)===58&&s.charCodeAt(l+1)===58){l++;continue}let u=s.charCodeAt(l)===58&&s.charCodeAt(l+1)!==58,c=s.charCodeAt(l)===42;if(u||c||l===s.length&&l!==o){let f=s.slice(o,l);if(this.caseSensitive||(f=f.toLowerCase()),f=f.replaceAll("::",":"),f=f.replaceAll("%","%25"),i=i.getStaticChild(f),i===null)return null}if(u){let f=!1,p=!0,h="",d=[],m=l+1;for(let g=m;;g++){let S=s.charCodeAt(g),b=S===40,_=S===45||S===46,y=S===47||g===s.length;if(b||_||y){let R=s.slice(m,g);if(a.push(R),f=f||b||_,b){let w=Q$(s,g),$=s.slice(g,w+1);this.allowUnsafeRegex||qe(Hs(new RegExp($)),`The regex '${$}' is not safe!`),d.push(X$($)),g=w+1,p=!1}else d.push(p?"(.*?)":`(${h}|(?:(?!${h}).)*)`),p=!1;let T=g;for(;g<s.length;g++){let w=s.charCodeAt(g);if(w===47)break;if(w===58)if(s.charCodeAt(g+1)===58)g++;else break}let O=s.slice(T,g);if(O&&(O=O.replaceAll("::",":"),O=O.replaceAll("%","%25"),d.push(h=Y$(O))),m=g+1,y||s.charCodeAt(g)===47||g===s.length){let w=f?"()"+O:O,$=s.slice(l,g);s=s.slice(0,l+1)+w+s.slice(g),l+=w.length;let v=f?new RegExp("^"+d.join("")+"$"):null;if(i=i.getParametricChild(v,O||null,$),i===null)return null;o=l+1;break}}}}else if(c&&(a.push("*"),i=i.getWildcardChild(),o=l+1,l!==s.length-1))throw new Error("Wildcard must be the last character in the route")}this.caseSensitive||(s=s.toLowerCase());for(let l of this.routes){let u=l.opts.constraints||{};if(l.method===e&&l.pattern===s&&ym(u,n))return{handler:l.handler,store:l.store,params:l.params}}return null};Te.prototype.hasConstraintStrategy=function(t){return this.constrainer.hasConstraintStrategy(t)};Te.prototype.addConstraintStrategy=function(t){this.constrainer.addConstraintStrategy(t),this._rebuild(this.routes)};Te.prototype.reset=function(){this.trees={},this.routes=[]};Te.prototype.off=function(e,r,n){qe(typeof r=="string","Path should be a string"),qe(r.length>0,"The path could not be empty"),qe(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`"),qe(typeof n>"u"||typeof n=="object"&&!Array.isArray(n)&&n!==null,"Constraints should be an object or undefined.");let s=r.match(qn);if(s){qe(r.length===s.index+s[0].length,"Optional Parameter needs to be the last parameter of the path");let o=r.replace(qn,"$1$2"),a=r.replace(qn,"$2");this.off(e,o,n),this.off(e,a,n);return}this.ignoreDuplicateSlashes&&(r=_m(r)),this.ignoreTrailingSlash&&(r=Sm(r));let i=Array.isArray(e)?e:[e];for(let o of i)this._off(o,r,n)};Te.prototype._off=function(e,r,n){qe(typeof e=="string","Method should be a string"),qe(Ms.includes(e),`Method '${e}' is not an http method.`);function s(l){return e!==l.method||r!==l.path}function i(l){return s(l)||!ym(n,l.opts.constraints||{})}let o=n?i:s,a=this.routes.filter(o);this._rebuild(a)};Te.prototype.lookup=function(e,r,n,s){if(typeof n=="function"&&(s=n,n=void 0),s===void 0){let i=this.constrainer.deriveConstraints(e,n),o=this.find(e.method,e.url,i);return this.callHandler(o,e,r,n)}this.constrainer.deriveConstraints(e,n,(i,o)=>{if(i!==null){s(i);return}try{let a=this.find(e.method,e.url,o),l=this.callHandler(a,e,r,n);s(null,l)}catch(a){s(a)}})};Te.prototype.callHandler=function(e,r,n,s){return e===null?this._defaultRoute(r,n,s):s===void 0?e.handler(r,n,e.params,e.store,e.searchParams):e.handler.call(s,r,n,e.params,e.store,e.searchParams)};Te.prototype.find=function(e,r,n){let s=this.trees[e];if(s===void 0)return null;r.charCodeAt(0)!==47&&(r=r.replace(W$,"/")),this.ignoreDuplicateSlashes&&(r=_m(r));let i,o,a;try{i=G$(r,this.useSemicolonDelimiter),r=i.path,o=i.querystring,a=i.shouldDecodeParam}catch{return this._onBadUrl(r)}this.ignoreTrailingSlash&&(r=Sm(r));let l=r;this.caseSensitive===!1&&(r=r.toLowerCase());let u=this.maxParamLength,c=s.prefix.length,f=[],p=r.length,h=[];for(;;){if(c===p&&s.isLeafNode){let S=s.handlerStorage.getMatchingHandler(n);if(S!==null)return{handler:S.handler,store:S.store,params:S._createParamsObject(f),searchParams:this.querystringParser(o)}}let d=s.getNextNode(r,c,h,f.length);if(d===null){if(h.length===0)return null;let S=h.pop();c=S.brotherPathIndex,f.splice(S.paramsCount),d=S.brotherNode}if(s=d,s.kind===B$.STATIC){c+=s.prefix.length;continue}if(s.kind===B$.WILDCARD){let S=l.slice(c);a&&(S=gm(S)),f.push(S),c=p;continue}let m=l.indexOf("/",c);m===-1&&(m=p);let g=l.slice(c,m);if(a&&(g=gm(g)),s.isRegex){let S=s.regex.exec(g);if(S===null)continue;for(let b=1;b<S.length;b++){let _=S[b];if(_.length>u)return null;f.push(_)}}else{if(g.length>u)return null;f.push(g)}c=m}};Te.prototype._rebuild=function(t){this.reset();for(let e of t){let{method:r,path:n,opts:s,handler:i,store:o}=e;this._on(r,n,s,i,o)}};Te.prototype._defaultRoute=function(t,e,r){if(this.defaultRoute!==null)return r===void 0?this.defaultRoute(t,e):this.defaultRoute.call(r,t,e);e.statusCode=404,e.end()};Te.prototype._onBadUrl=function(t){if(this.onBadUrl===null)return null;let e=this.onBadUrl;return{handler:(r,n,s)=>e(t,r,n),params:{},store:null}};Te.prototype.prettyPrint=function(t={}){let e=t.method;t.buildPrettyMeta=this.buildPrettyMeta.bind(this);let r=null;if(e===void 0){let{version:n,host:s,...i}=this.constrainer.strategies;i[mm.name]=mm;let o=new Te({...this._opts,constraints:i}),a=this.routes.map(l=>{let u={...l.opts.constraints,[mm.name]:l.method};return{...l,method:"MERGED",opts:{constraints:u}}});o._rebuild(a),r=o.trees.MERGED}else r=this.trees[e];return r==null?"(empty tree)":P9(r,t)};for(let t in Ms){if(!Ms.hasOwnProperty(t))continue;let e=Ms[t],r=e.toLowerCase();Te.prototype[r]=function(n,s,i){return this.on(e,n,s,i)}}Te.prototype.all=function(t,e,r){this.on(Ms,t,e,r)};Te.sanitizeUrlPath=function(e,r){let n=G$(e,r);return n.shouldDecodeParam?gm(n.path):n.path};Z$.exports=Te;function Y$(t){return t.replace(J$,"\\$&")}function _m(t){return t.indexOf("//")!==-1?t.replace(K$,"/"):t}function Sm(t){return t.length>1&&t.charCodeAt(t.length-1)===47?t.slice(0,-1):t}function X$(t){return t.charCodeAt(1)===94&&(t=t.slice(0,1)+t.slice(2)),t.charCodeAt(t.length-2)===36&&(t=t.slice(0,t.length-2)+t.slice(t.length-1)),t}function Q$(t,e){let r=1;for(;e<t.length;){if(e++,t.charCodeAt(e)===92){e++;continue}if(t.charCodeAt(e)===41?r--:t.charCodeAt(e)===40&&r++,!r)return e}throw new TypeError('Invalid regexp expression in "'+t+'"')}function C9(t){return t?t.store?Object.assign({},t.store):{}:{}}});var tP=E((lQ,eP)=>{"use strict";function bm(t,e,r,n){if(r===void 0){e.header("content-length","0"),n(null,null);return}if(typeof r.resume=="function"){r.on("error",i=>{e.log.error({err:i},"Error on Stream found for HEAD route")}),r.resume(),n(null,null);return}if(typeof r.getReader=="function"){r.cancel("Stream cancelled by HEAD route").catch(i=>{e.log.error({err:i},"Error on Stream found for HEAD route")}),n(null,null);return}let s=""+Buffer.byteLength(r);e.header("content-length",s),n(null,null)}function I9(t){return t==null?bm:Array.isArray(t)?[...t,bm]:[t,bm]}eP.exports={parseHeadOnSendHandlers:I9}});var SP=E((uQ,_P)=>{"use strict";var N9=Em(),k9=La(),rP=Sc(),{onRequestAbortHookRunner:x9,lifecycleHooks:nP,preParsingHookRunner:L9,onTimeoutHookRunner:q9,onRequestHookRunner:j9}=Fr(),{normalizeSchema:D9}=li(),{parseHeadOnSendHandlers:F9}=tP(),{compileSchemasForValidation:M9,compileSchemasForSerialization:H9}=mc(),{FST_ERR_SCH_VALIDATION_BUILD:V9,FST_ERR_SCH_SERIALIZATION_BUILD:z9,FST_ERR_DUPLICATED_ROUTE:U9,FST_ERR_INVALID_URL:B9,FST_ERR_HOOK_INVALID_HANDLER:sP,FST_ERR_ROUTE_OPTIONS_NOT_OBJ:G9,FST_ERR_ROUTE_DUPLICATED_HANDLER:W9,FST_ERR_ROUTE_HANDLER_NOT_FN:iP,FST_ERR_ROUTE_MISSING_HANDLER:J9,FST_ERR_ROUTE_METHOD_NOT_SUPPORTED:K9,FST_ERR_ROUTE_METHOD_INVALID:Y9,FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED:X9,FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT:Q9,FST_ERR_HOOK_INVALID_ASYNC_HANDLER:vm}=He(),{kRoutePrefix:Z9,kSupportedHTTPMethods:Om,kLogLevel:e6,kLogSerializers:oP,kHooks:aP,kSchemaController:t6,kOptions:lP,kReplySerializerDefault:wm,kReplyIsError:r6,kRequestPayloadStream:n6,kDisableRequestLogging:uP,kSchemaErrorFormatter:s6,kErrorHandler:cP,kHasBeenDecorated:fP,kRequestAcceptVersion:Rm,kRouteByFastify:i6,kRouteContext:dP}=De(),{buildErrorHandler:o6}=ui(),{createChildLogger:a6}=ai(),{getGenReqId:l6}=Yl(),{FSTDEP022:u6}=Kn(),hP=["allowUnsafeRegex","buildPrettyMeta","caseSensitive","constraints","defaultRoute","ignoreDuplicateSlashes","ignoreTrailingSlash","maxParamLength","onBadUrl","querystringParser","useSemicolonDelimiter"];function c6(t){let e=N9(t),r,n,s,i,o,a,l,u,c,f,p,h,d,m=!1;return{setup(w,$){r=$.avvio,n=$.fourOhFour,s=w.logger,i=$.hasLogger,o=$.setupResponseListeners,a=$.throwIfAlreadyStarted,h=w.exposeHeadRoutes,l=w.disableRequestLogging,typeof l=="function"&&(u=w.disableRequestLogging),c=w.routerOptions.ignoreTrailingSlash,f=w.routerOptions.ignoreDuplicateSlashes,p=Object.hasOwn(w,"return503OnClosing")?w.return503OnClosing:!0,d=$.keepAliveConnections},routing:e.lookup.bind(e),route:T,hasRoute:y,prepareRoute:_,routeHandler:O,closeRoutes:()=>{m=!0},printRoutes:e.prettyPrint.bind(e),addConstraintStrategy:g,hasConstraintStrategy:S,isAsyncConstraint:b,findRoute:R};function g(w){return a("Cannot add constraint strategy!"),e.addConstraintStrategy(w)}function S(w){return e.hasConstraintStrategy(w)}function b(){return e.constrainer.asyncStrategiesInUse.size>0}function _({method:w,url:$,options:v,handler:P,isFastify:C}){if(typeof $!="string")throw new B9(typeof $);if(!P&&typeof v=="function")P=v,v={};else if(P&&typeof P=="function"){if(Object.prototype.toString.call(v)!=="[object Object]")throw new G9(w,$);if(v.handler)throw typeof v.handler=="function"?new W9(w,$):new iP(w,$)}return v=Object.assign({},v,{method:w,url:$,path:$,handler:P||v&&v.handler}),T.call(this,{options:v,isFastify:C})}function y({options:w}){let $=w.method?.toUpperCase()??"";return e.hasRoute($,w.url||"",w.constraints)}function R(w){let $=e.find(w.method,w.url||"",w.constraints);return $?{handler:$.handler,params:$.params,searchParams:$.searchParams}:null}function T({options:w,isFastify:$}){a("Cannot add route!");let v={...w},P=v.url||v.path||"";if(!v.handler)throw new J9(v.method,P);if(v.errorHandler!==void 0&&typeof v.errorHandler!="function")throw new iP(v.method,P);yP(v.bodyLimit);let C=v.exposeHeadRoute??h,k=!1,M=!1;if(Array.isArray(v.method))for(let fe=0;fe<v.method.length;++fe)v.method[fe]=pP.call(this,v.method[fe]),mP.call(this,v.method[fe],P,v.schema),k=v.method.includes("GET"),M=v.method.includes("HEAD");else v.method=pP.call(this,v.method),mP.call(this,v.method,P,v.schema),k=v.method==="GET",M=v.method==="HEAD";let J=C&&k?{...w}:null,U=this[Z9];if(P==="/"&&U.length>0&&v.method!=="HEAD")switch(v.prefixTrailingSlash){case"slash":H.call(this,{path:P,isFastify:$});break;case"no-slash":H.call(this,{path:"",isFastify:$});break;case"both":default:H.call(this,{path:"",isFastify:$}),c!==!0&&(f!==!0||!U.endsWith("/"))&&H.call(this,{path:P,prefixing:!0,isFastify:$})}else P[0]==="/"&&U.endsWith("/")?H.call(this,{path:P.slice(1),isFastify:$}):H.call(this,{path:P,isFastify:$});return this;function H({path:fe,prefixing:ze=!1,isFastify:G=!1}){let wt=U+fe;if(v.url=wt,v.path=wt,v.routePath=fe,v.prefix=U,v.logLevel=v.logLevel||this[e6],(this[oP]||v.logSerializers)&&(v.logSerializers=Object.assign(Object.create(this[oP]),v.logSerializers)),v.attachValidation==null&&(v.attachValidation=!1),ze===!1)for(let N of this[aP].onRoute)N.call(this,v);for(let N of nP)if(v&&N in v){if(Array.isArray(v[N]))for(let q of v[N]){if(typeof q!="function")throw new sP(N,Object.prototype.toString.call(q));if(N==="onSend"||N==="preSerialization"||N==="onError"||N==="preParsing"){if(q.constructor.name==="AsyncFunction"&&q.length===4)throw new vm}else if(N==="onRequestAbort"){if(q.constructor.name==="AsyncFunction"&&q.length!==1)throw new vm}else if(q.constructor.name==="AsyncFunction"&&q.length===3)throw new vm}else if(v[N]!==void 0&&typeof v[N]!="function")throw new sP(N,Object.prototype.toString.call(v[N]))}let Lr=v.constraints||{},me={...v.config,url:wt,method:v.method},pe=new k9({schema:v.schema,handler:v.handler.bind(this),config:me,errorHandler:v.errorHandler,childLoggerFactory:v.childLoggerFactory,bodyLimit:v.bodyLimit,logLevel:v.logLevel,logSerializers:v.logSerializers,attachValidation:v.attachValidation,schemaErrorFormatter:v.schemaErrorFormatter,replySerializer:this[wm],validatorCompiler:v.validatorCompiler,serializerCompiler:v.serializerCompiler,exposeHeadRoute:C,prefixTrailingSlash:v.prefixTrailingSlash||"both",server:this,isFastify:G}),A=e.findRoute("HEAD",v.url,Lr)!==null;try{e.on(v.method,v.url,{constraints:Lr},O,pe)}catch(N){if(!pe[i6])throw N.message.includes(`Method '${v.method}' already declared for route`)?new U9(v.method,v.url):N}if(this.after((N,q)=>{pe.errorHandler=v.errorHandler?o6(this[cP],v.errorHandler):this[cP],pe._parserOptions.limit=v.bodyLimit||null,pe.logLevel=v.logLevel,pe.logSerializers=v.logSerializers,pe.attachValidation=v.attachValidation,pe[wm]=this[wm],pe.schemaErrorFormatter=v.schemaErrorFormatter||this[s6]||pe.schemaErrorFormatter,r.once("preReady",()=>{for(let j of nP){let ue=this[aP][j].concat(v[j]||[]).map(de=>de.bind(this));pe[j]=ue.length?ue:null}for(;!pe.Request[fP]&&pe.Request.parent;)pe.Request=pe.Request.parent;for(;!pe.Reply[fP]&&pe.Reply.parent;)pe.Reply=pe.Reply.parent;if(n.setContext(this,pe),v.schema){pe.schema=D9(pe.schema,this.initialConfig);let j=this[t6],ue=v.schema.body||v.schema.headers||v.schema.querystring||v.schema.params;!v.validatorCompiler&&ue&&j.setupValidator(this[lP]);try{let de=typeof v?.validatorCompiler=="function"||j.isCustomValidatorCompiler;M9(pe,v.validatorCompiler||j.validatorCompiler,de)}catch(de){throw new V9(v.method,wt,de.message)}v.schema.response&&!v.serializerCompiler&&j.setupSerializer(this[lP]);try{H9(pe,v.serializerCompiler||j.serializerCompiler)}catch(de){throw new z9(v.method,wt,de.message)}}}),q(N)}),C&&k&&!M&&!A){let N=F9(J.onSend);_.call(this,{method:"HEAD",url:fe,options:{...J,onSend:N},isFastify:!0})}}}function O(w,$,v,P,C){let k=l6(P.server,w),M={level:P.logLevel};P.logSerializers&&(M.serializers=P.logSerializers);let J=a6(P,s,w,k,M);if(J[uP]=u?!1:l,m===!0&&(w.httpVersionMajor!==2&&$.setHeader("Connection","close"),p)){let G={"Content-Type":"application/json","Content-Length":"80"};$.writeHead(503,G),$.end('{"error":"Service Unavailable","message":"Service Unavailable","statusCode":503}'),J.info({res:{statusCode:503}},"request aborted - refusing to accept new requests as server is closing");return}String.prototype.toLowerCase.call(w.headers.connection||"")==="keep-alive"&&d.has(w.socket)===!1&&(d.add(w.socket),w.socket.on("close",p6.bind({keepAliveConnections:d,socket:w.socket}))),w.headers[Rm]!==void 0&&(w.headers["accept-version"]=w.headers[Rm],w.headers[Rm]=void 0);let H=new P.Request(k,v,w,C,J,P),fe=new P.Reply($,H,J),ze=u?u(H):l;J[uP]=ze,ze===!1&&J.info({req:H},"incoming request"),(i===!0||P.onResponse!==null)&&o(fe),P.onRequest!==null?j9(P.onRequest,H,fe,gP):gP(null,H,fe),P.onRequestAbort!==null&&w.on("close",()=>{w.aborted&&x9(P.onRequestAbort,H,f6.bind(null,fe))}),P.onTimeout!==null&&(H.raw.socket._meta||H.raw.socket.on("timeout",d6),H.raw.socket._meta={context:P,request:H,reply:fe})}}function f6(t,e){e&&t.log.error({err:e},"onRequestAborted hook failed")}function d6(){let{context:t,request:e,reply:r}=this._meta;q9(t.onTimeout,e,r,m6)}function pP(t){if(typeof t!="string")throw new Y9;if(t=t.toUpperCase(),!this[Om].bodyless.has(t)&&!this[Om].bodywith.has(t))throw new K9(t);return t}function mP(t,e,r){if(this[Om].bodyless.has(t)&&r?.body)throw new X9(t,e)}function yP(t){if(t!==void 0&&(!Number.isInteger(t)||t<=0))throw new Q9(t)}function gP(t,e,r){if(r.sent!==!0){if(t!=null){r[r6]=!0,r.send(t);return}e[n6]=e.raw,e[dP].preParsing!==null?L9(e[dP].preParsing,e,r,rP.bind(e.server)):rP.call(e.server,null,e,r)}}function h6(t,e){let r=t.routerOptions||Object.create(null),n=hP.filter(s=>Object.hasOwn(t,s));n.length>0&&u6(n.join(", "));for(let s of hP)Object.hasOwn(r,s)||(r[s]=t[s]??e[s]);return r}function p6(){this.keepAliveConnections.delete(this.socket)}function m6(){}_P.exports={buildRouting:c6,validateBodyLimitOption:yP,buildRouterOptions:h6}});var TP=E((cQ,OP)=>{"use strict";var g6=Em(),EP=Pa(),bP=xa(),y6=La(),{kRoutePrefix:_6,kCanSetNotFoundHandler:So,kFourOhFourLevelInstance:Eo,kFourOhFourContext:mr,kHooks:S6,kErrorHandler:vP}=De(),{lifecycleHooks:E6}=Fr(),{buildErrorHandler:b6}=ui(),{FST_ERR_NOT_FOUND:v6}=He(),{createChildLogger:wP}=ai(),{getGenReqId:RP}=Yl();function w6(t){let{logger:e,disableRequestLogging:r}=t,n=g6({onBadUrl:a(),defaultRoute:f}),s=null;return{router:n,setNotFoundHandler:u,setContext:l,arrange404:i};function i(p){p[Eo]=p,p[So]=!0,n.onBadUrl=n.onBadUrl.bind(p),n.defaultRoute=n.defaultRoute.bind(p)}function o(p,h){let{url:d,method:m}=p.raw,g=`Route ${m}:${d} not found`;(typeof r=="function"?r(p.raw):r)||p.log.info(g),h.code(404).send({message:g,error:"Not Found",statusCode:404})}function a(){return function(h,d,m){let g=this[Eo][mr],S=RP(g.server,d),b=wP(g,e,d,S),_=new bP(S,null,d,null,b,g),y=new EP(m,_,b);s(_,y)}}function l(p,h){let d=Object.assign({},p[mr]);d.onSend=h.onSend,h[mr]=d}function u(p,h,d,m){this[So]===void 0&&(this[So]=!0),this[mr]===void 0&&(this[mr]=null);let g=this,S=this[_6]||"/";if(this[So]===!1)throw new Error(`Not found handler already set for Fastify instance with prefix: '${S}'`);typeof p=="object"&&(p.preHandler&&(Array.isArray(p.preHandler)?p.preHandler=p.preHandler.map(b=>b.bind(g)):p.preHandler=p.preHandler.bind(g)),p.preValidation&&(Array.isArray(p.preValidation)?p.preValidation=p.preValidation.map(b=>b.bind(g)):p.preValidation=p.preValidation.bind(g))),typeof p=="function"&&(h=p,p=void 0),p=p||{},h?(this[Eo][So]=!1,h=h.bind(this),s=h):(h=o,s=o),this.after((b,_)=>{c.call(this,S,p,h,d,m),_(b)})}function c(p,h,d,m,g){let S=new y6({schema:h.schema,handler:d,config:h.config||{},server:this});if(m.once("preReady",()=>{let b=this[mr];for(let _ of E6){let y=this[S6][_].concat(h[_]||[]).map(R=>R.bind(this));b[_]=y.length?y:null}b.errorHandler=h.errorHandler?b6(this[vP],h.errorHandler):this[vP]}),this[mr]!==null&&p==="/"){Object.assign(this[mr],S);return}this[Eo][mr]=S,n.all(p+(p.endsWith("/")?"*":"/*"),g,S),n.all(p,g,S)}function f(p,h){let d=this[Eo][mr],m=RP(d.server,p),g=wP(d,e,p,m);g.info({req:p},"incoming request");let S=new bP(m,null,p,null,g,d),b=new EP(h,S,g);S.log.warn("the default handler for 404 did not catch this, this is likely a fastify bug, please report it"),S.log.warn(n.prettyPrint()),b.code(404).send(new v6)}}OP.exports=w6});var $P=E((fQ,pu)=>{"use strict";pu.exports=ae;pu.exports.default=ae;var R6={type:"object",additionalProperties:!1,properties:{connectionTimeout:{type:"integer",default:0},keepAliveTimeout:{type:"integer",default:72e3},forceCloseConnections:{oneOf:[{type:"string",pattern:"idle"},{type:"boolean"}]},maxRequestsPerSocket:{type:"integer",default:0,nullable:!0},requestTimeout:{type:"integer",default:0},bodyLimit:{type:"integer",default:1048576},caseSensitive:{type:"boolean",default:!0},allowUnsafeRegex:{type:"boolean",default:!1},http2:{type:"boolean"},https:{if:{not:{oneOf:[{type:"boolean"},{type:"null"},{type:"object",additionalProperties:!1,required:["allowHTTP1"],properties:{allowHTTP1:{type:"boolean"}}}]}},then:{setDefaultValue:!0}},ignoreTrailingSlash:{type:"boolean",default:!1},ignoreDuplicateSlashes:{type:"boolean",default:!1},disableRequestLogging:{default:!1},maxParamLength:{type:"integer",default:100},onProtoPoisoning:{type:"string",default:"error"},onConstructorPoisoning:{type:"string",default:"error"},pluginTimeout:{type:"integer",default:1e4},requestIdHeader:{anyOf:[{type:"boolean"},{type:"string"}],default:!1},requestIdLogLabel:{type:"string",default:"reqId"},http2SessionTimeout:{type:"integer",default:72e3},exposeHeadRoutes:{type:"boolean",default:!0},useSemicolonDelimiter:{type:"boolean",default:!1},routerOptions:{type:"object",additionalProperties:!0,properties:{ignoreTrailingSlash:{type:"boolean",default:!1},ignoreDuplicateSlashes:{type:"boolean",default:!1},maxParamLength:{type:"integer",default:100},allowUnsafeRegex:{type:"boolean",default:!1},useSemicolonDelimiter:{type:"boolean",default:!1}}},constraints:{type:"object",additionalProperties:{type:"object",required:["name","storage","validate","deriveConstraint"],additionalProperties:!0,properties:{name:{type:"string"},storage:{},validate:{},deriveConstraint:{}}}}}},O6=Object.prototype.hasOwnProperty,T6=new RegExp("idle","u");function ae(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0;if(o===0)if(t&&typeof t=="object"&&!Array.isArray(t)){t.connectionTimeout===void 0&&(t.connectionTimeout=0),t.keepAliveTimeout===void 0&&(t.keepAliveTimeout=72e3),t.maxRequestsPerSocket===void 0&&(t.maxRequestsPerSocket=0),t.requestTimeout===void 0&&(t.requestTimeout=0),t.bodyLimit===void 0&&(t.bodyLimit=1048576),t.caseSensitive===void 0&&(t.caseSensitive=!0),t.allowUnsafeRegex===void 0&&(t.allowUnsafeRegex=!1),t.ignoreTrailingSlash===void 0&&(t.ignoreTrailingSlash=!1),t.ignoreDuplicateSlashes===void 0&&(t.ignoreDuplicateSlashes=!1),t.disableRequestLogging===void 0&&(t.disableRequestLogging=!1),t.maxParamLength===void 0&&(t.maxParamLength=100),t.onProtoPoisoning===void 0&&(t.onProtoPoisoning="error"),t.onConstructorPoisoning===void 0&&(t.onConstructorPoisoning="error"),t.pluginTimeout===void 0&&(t.pluginTimeout=1e4),t.requestIdHeader===void 0&&(t.requestIdHeader=!1),t.requestIdLogLabel===void 0&&(t.requestIdLogLabel="reqId"),t.http2SessionTimeout===void 0&&(t.http2SessionTimeout=72e3),t.exposeHeadRoutes===void 0&&(t.exposeHeadRoutes=!0),t.useSemicolonDelimiter===void 0&&(t.useSemicolonDelimiter=!1);let m=o;for(let g in t)O6.call(R6.properties,g)||delete t[g];if(m===o){let g=t.connectionTimeout,S=o;if(!(typeof g=="number"&&!(g%1)&&!isNaN(g)&&isFinite(g))){let b=typeof g,_;if(_===void 0)if(b==="boolean"||g===null||b==="string"&&g&&g==+g&&!(g%1))_=+g;else return ae.errors=[{instancePath:e+"/connectionTimeout",schemaPath:"#/properties/connectionTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;_!==void 0&&(g=_,t!==void 0&&(t.connectionTimeout=_))}var a=S===o;if(a){let b=t.keepAliveTimeout,_=o;if(!(typeof b=="number"&&!(b%1)&&!isNaN(b)&&isFinite(b))){let R=typeof b,T;if(T===void 0)if(R==="boolean"||b===null||R==="string"&&b&&b==+b&&!(b%1))T=+b;else return ae.errors=[{instancePath:e+"/keepAliveTimeout",schemaPath:"#/properties/keepAliveTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;T!==void 0&&(b=T,t!==void 0&&(t.keepAliveTimeout=T))}var a=_===o;if(a){if(t.forceCloseConnections!==void 0){let R=t.forceCloseConnections,T=o,O=o,w=!1,$=null,v=o;if(typeof R!="string"){let k=typeof R,M;if(M===void 0)if(k=="number"||k=="boolean")M=""+R;else if(R===null)M="";else{let J={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[J]:i.push(J),o++}M!==void 0&&(R=M,t!==void 0&&(t.forceCloseConnections=M))}if(o===v&&typeof R=="string"&&!T6.test(R)){let k={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/0/pattern",keyword:"pattern",params:{pattern:"idle"},message:'must match pattern "idle"'};i===null?i=[k]:i.push(k),o++}var l=v===o;l&&(w=!0,$=0);let P=o;if(typeof R!="boolean"){let k;if(k===void 0)if(R==="false"||R===0||R===null)k=!1;else if(R==="true"||R===1)k=!0;else{let M={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/1/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};i===null?i=[M]:i.push(M),o++}k!==void 0&&(R=k,t!==void 0&&(t.forceCloseConnections=k))}var l=P===o;if(l&&w?(w=!1,$=[$,1]):l&&(w=!0,$=1),w)o=O,i!==null&&(O?i.length=O:i=null);else{let k={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf",keyword:"oneOf",params:{passingSchemas:$},message:"must match exactly one schema in oneOf"};return i===null?i=[k]:i.push(k),o++,ae.errors=i,!1}var a=T===o}else var a=!0;if(a){let R=t.maxRequestsPerSocket,T=o;if(!(typeof R=="number"&&!(R%1)&&!isNaN(R)&&isFinite(R))&&R!==null){let w=typeof R,$;if($===void 0)if(w==="boolean"||R===null||w==="string"&&R&&R==+R&&!(R%1))$=+R;else if(R===""||R===0||R===!1)$=null;else return ae.errors=[{instancePath:e+"/maxRequestsPerSocket",schemaPath:"#/properties/maxRequestsPerSocket/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;$!==void 0&&(R=$,t!==void 0&&(t.maxRequestsPerSocket=$))}var a=T===o;if(a){let w=t.requestTimeout,$=o;if(!(typeof w=="number"&&!(w%1)&&!isNaN(w)&&isFinite(w))){let P=typeof w,C;if(C===void 0)if(P==="boolean"||w===null||P==="string"&&w&&w==+w&&!(w%1))C=+w;else return ae.errors=[{instancePath:e+"/requestTimeout",schemaPath:"#/properties/requestTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;C!==void 0&&(w=C,t!==void 0&&(t.requestTimeout=C))}var a=$===o;if(a){let P=t.bodyLimit,C=o;if(!(typeof P=="number"&&!(P%1)&&!isNaN(P)&&isFinite(P))){let M=typeof P,J;if(J===void 0)if(M==="boolean"||P===null||M==="string"&&P&&P==+P&&!(P%1))J=+P;else return ae.errors=[{instancePath:e+"/bodyLimit",schemaPath:"#/properties/bodyLimit/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;J!==void 0&&(P=J,t!==void 0&&(t.bodyLimit=J))}var a=C===o;if(a){let M=t.caseSensitive,J=o;if(typeof M!="boolean"){let H;if(H===void 0)if(M==="false"||M===0||M===null)H=!1;else if(M==="true"||M===1)H=!0;else return ae.errors=[{instancePath:e+"/caseSensitive",schemaPath:"#/properties/caseSensitive/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;H!==void 0&&(M=H,t!==void 0&&(t.caseSensitive=H))}var a=J===o;if(a){let H=t.allowUnsafeRegex,fe=o;if(typeof H!="boolean"){let G;if(G===void 0)if(H==="false"||H===0||H===null)G=!1;else if(H==="true"||H===1)G=!0;else return ae.errors=[{instancePath:e+"/allowUnsafeRegex",schemaPath:"#/properties/allowUnsafeRegex/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;G!==void 0&&(H=G,t!==void 0&&(t.allowUnsafeRegex=G))}var a=fe===o;if(a){if(t.http2!==void 0){let G=t.http2,wt=o;if(typeof G!="boolean"){let me;if(me===void 0)if(G==="false"||G===0||G===null)me=!1;else if(G==="true"||G===1)me=!0;else return ae.errors=[{instancePath:e+"/http2",schemaPath:"#/properties/http2/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;me!==void 0&&(G=me,t!==void 0&&(t.http2=me))}var a=wt===o}else var a=!0;if(a){if(t.https!==void 0){let G=t.https,wt=o,Lr=o,me=!0,pe=o,Hn=o,A=o,N=o,q=!1,j=null,ue=o;if(typeof G!="boolean"){let Y;if(Y===void 0)if(G==="false"||G===0||G===null)Y=!1;else if(G==="true"||G===1)Y=!0;else{let $t={};i===null?i=[$t]:i.push($t),o++}Y!==void 0&&(G=Y,t!==void 0&&(t.https=Y))}var u=ue===o;u&&(q=!0,j=0);let de=o;if(G!==null){let Y;if(Y===void 0)if(G===""||G===0||G===!1)Y=null;else{let $t={};i===null?i=[$t]:i.push($t),o++}Y!==void 0&&(G=Y,t!==void 0&&(t.https=Y))}var u=de===o;if(u&&q)q=!1,j=[j,1];else{u&&(q=!0,j=1);let Y=o;if(o===Y)if(G&&typeof G=="object"&&!Array.isArray(G)){let Pe;if(G.allowHTTP1===void 0&&(Pe="allowHTTP1")){let dt={};i===null?i=[dt]:i.push(dt),o++}else{let dt=o;for(let Xt in G)Xt!=="allowHTTP1"&&delete G[Xt];if(dt===o&&G.allowHTTP1!==void 0){let Xt=G.allowHTTP1;if(typeof Xt!="boolean"){let Ae;if(Ae===void 0)if(Xt==="false"||Xt===0||Xt===null)Ae=!1;else if(Xt==="true"||Xt===1)Ae=!0;else{let Qt={};i===null?i=[Qt]:i.push(Qt),o++}Ae!==void 0&&(Xt=Ae,G!==void 0&&(G.allowHTTP1=Ae))}}}}else{let Pe={};i===null?i=[Pe]:i.push(Pe),o++}var u=Y===o;u&&q?(q=!1,j=[j,2]):u&&(q=!0,j=2)}if(q)o=N,i!==null&&(N?i.length=N:i=null);else{let Y={};i===null?i=[Y]:i.push(Y),o++}var c=A===o;if(c){let Y={};i===null?i=[Y]:i.push(Y),o++}else o=Hn,i!==null&&(Hn?i.length=Hn:i=null);var f=pe===o;if(o=Lr,i!==null&&(Lr?i.length=Lr:i=null),f){let Y=o;t.https=!0;var f=Y===o;me=f}if(!me){let Y={instancePath:e+"/https",schemaPath:"#/properties/https/if",keyword:"if",params:{failingKeyword:"then"},message:'must match "then" schema'};return i===null?i=[Y]:i.push(Y),o++,ae.errors=i,!1}var a=wt===o}else var a=!0;if(a){let G=t.ignoreTrailingSlash,wt=o;if(typeof G!="boolean"){let me;if(me===void 0)if(G==="false"||G===0||G===null)me=!1;else if(G==="true"||G===1)me=!0;else return ae.errors=[{instancePath:e+"/ignoreTrailingSlash",schemaPath:"#/properties/ignoreTrailingSlash/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;me!==void 0&&(G=me,t!==void 0&&(t.ignoreTrailingSlash=me))}var a=wt===o;if(a){let me=t.ignoreDuplicateSlashes,pe=o;if(typeof me!="boolean"){let A;if(A===void 0)if(me==="false"||me===0||me===null)A=!1;else if(me==="true"||me===1)A=!0;else return ae.errors=[{instancePath:e+"/ignoreDuplicateSlashes",schemaPath:"#/properties/ignoreDuplicateSlashes/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;A!==void 0&&(me=A,t!==void 0&&(t.ignoreDuplicateSlashes=A))}var a=pe===o;if(a){let A=t.maxParamLength,N=o;if(!(typeof A=="number"&&!(A%1)&&!isNaN(A)&&isFinite(A))){let j=typeof A,ue;if(ue===void 0)if(j==="boolean"||A===null||j==="string"&&A&&A==+A&&!(A%1))ue=+A;else return ae.errors=[{instancePath:e+"/maxParamLength",schemaPath:"#/properties/maxParamLength/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;ue!==void 0&&(A=ue,t!==void 0&&(t.maxParamLength=ue))}var a=N===o;if(a){let j=t.onProtoPoisoning,ue=o;if(typeof j!="string"){let Me=typeof j,Y;if(Y===void 0)if(Me=="number"||Me=="boolean")Y=""+j;else if(j===null)Y="";else return ae.errors=[{instancePath:e+"/onProtoPoisoning",schemaPath:"#/properties/onProtoPoisoning/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;Y!==void 0&&(j=Y,t!==void 0&&(t.onProtoPoisoning=Y))}var a=ue===o;if(a){let Me=t.onConstructorPoisoning,Y=o;if(typeof Me!="string"){let Pe=typeof Me,dt;if(dt===void 0)if(Pe=="number"||Pe=="boolean")dt=""+Me;else if(Me===null)dt="";else return ae.errors=[{instancePath:e+"/onConstructorPoisoning",schemaPath:"#/properties/onConstructorPoisoning/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;dt!==void 0&&(Me=dt,t!==void 0&&(t.onConstructorPoisoning=dt))}var a=Y===o;if(a){let Pe=t.pluginTimeout,dt=o;if(!(typeof Pe=="number"&&!(Pe%1)&&!isNaN(Pe)&&isFinite(Pe))){let Ae=typeof Pe,Qt;if(Qt===void 0)if(Ae==="boolean"||Pe===null||Ae==="string"&&Pe&&Pe==+Pe&&!(Pe%1))Qt=+Pe;else return ae.errors=[{instancePath:e+"/pluginTimeout",schemaPath:"#/properties/pluginTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;Qt!==void 0&&(Pe=Qt,t!==void 0&&(t.pluginTimeout=Qt))}var a=dt===o;if(a){let Ae=t.requestIdHeader,Qt=o,qu=o,Vn=!1,zA=o;if(typeof Ae!="boolean"){let Ue;if(Ue===void 0)if(Ae==="false"||Ae===0||Ae===null)Ue=!1;else if(Ae==="true"||Ae===1)Ue=!0;else{let No={instancePath:e+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/0/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};i===null?i=[No]:i.push(No),o++}Ue!==void 0&&(Ae=Ue,t!==void 0&&(t.requestIdHeader=Ue))}var p=zA===o;if(Vn=Vn||p,!Vn){let Ue=o;if(typeof Ae!="string"){let sg=typeof Ae,Ce;if(Ce===void 0)if(sg=="number"||sg=="boolean")Ce=""+Ae;else if(Ae===null)Ce="";else{let Ht={instancePath:e+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[Ht]:i.push(Ht),o++}Ce!==void 0&&(Ae=Ce,t!==void 0&&(t.requestIdHeader=Ce))}var p=Ue===o;Vn=Vn||p}if(Vn)o=qu,i!==null&&(qu?i.length=qu:i=null);else{let Ue={instancePath:e+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[Ue]:i.push(Ue),o++,ae.errors=i,!1}var a=Qt===o;if(a){let Ue=t.requestIdLogLabel,No=o;if(typeof Ue!="string"){let Ce=typeof Ue,Ht;if(Ht===void 0)if(Ce=="number"||Ce=="boolean")Ht=""+Ue;else if(Ue===null)Ht="";else return ae.errors=[{instancePath:e+"/requestIdLogLabel",schemaPath:"#/properties/requestIdLogLabel/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;Ht!==void 0&&(Ue=Ht,t!==void 0&&(t.requestIdLogLabel=Ht))}var a=No===o;if(a){let Ce=t.http2SessionTimeout,Ht=o;if(!(typeof Ce=="number"&&!(Ce%1)&&!isNaN(Ce)&&isFinite(Ce))){let Zt=typeof Ce,un;if(un===void 0)if(Zt==="boolean"||Ce===null||Zt==="string"&&Ce&&Ce==+Ce&&!(Ce%1))un=+Ce;else return ae.errors=[{instancePath:e+"/http2SessionTimeout",schemaPath:"#/properties/http2SessionTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;un!==void 0&&(Ce=un,t!==void 0&&(t.http2SessionTimeout=un))}var a=Ht===o;if(a){let Zt=t.exposeHeadRoutes,un=o;if(typeof Zt!="boolean"){let ht;if(ht===void 0)if(Zt==="false"||Zt===0||Zt===null)ht=!1;else if(Zt==="true"||Zt===1)ht=!0;else return ae.errors=[{instancePath:e+"/exposeHeadRoutes",schemaPath:"#/properties/exposeHeadRoutes/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;ht!==void 0&&(Zt=ht,t!==void 0&&(t.exposeHeadRoutes=ht))}var a=un===o;if(a){let ht=t.useSemicolonDelimiter,UA=o;if(typeof ht!="boolean"){let Q;if(Q===void 0)if(ht==="false"||ht===0||ht===null)Q=!1;else if(ht==="true"||ht===1)Q=!0;else return ae.errors=[{instancePath:e+"/useSemicolonDelimiter",schemaPath:"#/properties/useSemicolonDelimiter/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;Q!==void 0&&(ht=Q,t!==void 0&&(t.useSemicolonDelimiter=Q))}var a=UA===o;if(a){if(t.routerOptions!==void 0){let Q=t.routerOptions,Bs=o;if(o===Bs)if(Q&&typeof Q=="object"&&!Array.isArray(Q)){Q.ignoreTrailingSlash===void 0&&(Q.ignoreTrailingSlash=!1),Q.ignoreDuplicateSlashes===void 0&&(Q.ignoreDuplicateSlashes=!1),Q.maxParamLength===void 0&&(Q.maxParamLength=100),Q.allowUnsafeRegex===void 0&&(Q.allowUnsafeRegex=!1),Q.useSemicolonDelimiter===void 0&&(Q.useSemicolonDelimiter=!1);let Pt=Q.ignoreTrailingSlash,Rt=o;if(typeof Pt!="boolean"){let Be;if(Be===void 0)if(Pt==="false"||Pt===0||Pt===null)Be=!1;else if(Pt==="true"||Pt===1)Be=!0;else return ae.errors=[{instancePath:e+"/routerOptions/ignoreTrailingSlash",schemaPath:"#/properties/routerOptions/properties/ignoreTrailingSlash/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;Be!==void 0&&(Pt=Be,Q!==void 0&&(Q.ignoreTrailingSlash=Be))}var h=Rt===o;if(h){let Be=Q.ignoreDuplicateSlashes,qr=o;if(typeof Be!="boolean"){let Ie;if(Ie===void 0)if(Be==="false"||Be===0||Be===null)Ie=!1;else if(Be==="true"||Be===1)Ie=!0;else return ae.errors=[{instancePath:e+"/routerOptions/ignoreDuplicateSlashes",schemaPath:"#/properties/routerOptions/properties/ignoreDuplicateSlashes/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;Ie!==void 0&&(Be=Ie,Q!==void 0&&(Q.ignoreDuplicateSlashes=Ie))}var h=qr===o;if(h){let Ie=Q.maxParamLength,jr=o;if(!(typeof Ie=="number"&&!(Ie%1)&&!isNaN(Ie)&&isFinite(Ie))){let er=typeof Ie,cn;if(cn===void 0)if(er==="boolean"||Ie===null||er==="string"&&Ie&&Ie==+Ie&&!(Ie%1))cn=+Ie;else return ae.errors=[{instancePath:e+"/routerOptions/maxParamLength",schemaPath:"#/properties/routerOptions/properties/maxParamLength/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;cn!==void 0&&(Ie=cn,Q!==void 0&&(Q.maxParamLength=cn))}var h=jr===o;if(h){let er=Q.allowUnsafeRegex,cn=o;if(typeof er!="boolean"){let pt;if(pt===void 0)if(er==="false"||er===0||er===null)pt=!1;else if(er==="true"||er===1)pt=!0;else return ae.errors=[{instancePath:e+"/routerOptions/allowUnsafeRegex",schemaPath:"#/properties/routerOptions/properties/allowUnsafeRegex/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;pt!==void 0&&(er=pt,Q!==void 0&&(Q.allowUnsafeRegex=pt))}var h=cn===o;if(h){let pt=Q.useSemicolonDelimiter,BA=o;if(typeof pt!="boolean"){let zn;if(zn===void 0)if(pt==="false"||pt===0||pt===null)zn=!1;else if(pt==="true"||pt===1)zn=!0;else return ae.errors=[{instancePath:e+"/routerOptions/useSemicolonDelimiter",schemaPath:"#/properties/routerOptions/properties/useSemicolonDelimiter/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;zn!==void 0&&(pt=zn,Q!==void 0&&(Q.useSemicolonDelimiter=zn))}var h=BA===o}}}}}else return ae.errors=[{instancePath:e+"/routerOptions",schemaPath:"#/properties/routerOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=Bs===o}else var a=!0;if(a)if(t.constraints!==void 0){let Q=t.constraints,Bs=o;if(o===Bs)if(Q&&typeof Q=="object"&&!Array.isArray(Q))for(let Pt in Q){let Rt=Q[Pt],Be=o;if(o===Be)if(Rt&&typeof Rt=="object"&&!Array.isArray(Rt)){let qr;if(Rt.name===void 0&&(qr="name")||Rt.storage===void 0&&(qr="storage")||Rt.validate===void 0&&(qr="validate")||Rt.deriveConstraint===void 0&&(qr="deriveConstraint"))return ae.errors=[{instancePath:e+"/constraints/"+Pt.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/constraints/additionalProperties/required",keyword:"required",params:{missingProperty:qr},message:"must have required property '"+qr+"'"}],!1;if(Rt.name!==void 0){let Gs=Rt.name;if(typeof Gs!="string"){let Ie=typeof Gs,jr;if(jr===void 0)if(Ie=="number"||Ie=="boolean")jr=""+Gs;else if(Gs===null)jr="";else return ae.errors=[{instancePath:e+"/constraints/"+Pt.replace(/~/g,"~0").replace(/\//g,"~1")+"/name",schemaPath:"#/properties/constraints/additionalProperties/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;jr!==void 0&&(Gs=jr,Rt!==void 0&&(Rt.name=jr))}}}else return ae.errors=[{instancePath:e+"/constraints/"+Pt.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/constraints/additionalProperties/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var d=Be===o;if(!d)break}else return ae.errors=[{instancePath:e+"/constraints",schemaPath:"#/properties/constraints/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=Bs===o}else var a=!0}}}}}}}}}}}}}}}}}}}}}}}else return ae.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return ae.errors=i,o===0}pu.exports.defaultInitOptions={connectionTimeout:0,keepAliveTimeout:72e3,maxRequestsPerSocket:0,requestTimeout:0,bodyLimit:1048576,caseSensitive:!0,allowUnsafeRegex:!1,disableRequestLogging:!1,ignoreTrailingSlash:!1,ignoreDuplicateSlashes:!1,maxParamLength:100,onProtoPoisoning:"error",onConstructorPoisoning:"error",pluginTimeout:1e4,requestIdHeader:!1,requestIdLogLabel:"reqId",http2SessionTimeout:72e3,exposeHeadRoutes:!0,useSemicolonDelimiter:!1,allowErrorHandlerOverride:!0,routerOptions:{ignoreTrailingSlash:!1,ignoreDuplicateSlashes:!1,maxParamLength:100,allowUnsafeRegex:!1,useSemicolonDelimiter:!1}}});var PP=E((dQ,gu)=>{"use strict";var mu=$P(),$6=ga()({circles:!0,proto:!1}),{FST_ERR_INIT_OPTS_INVALID:P6}=He();function A6(t){let e=$6(t);if(!mu(e)){let r=new P6(JSON.stringify(mu.errors.map(n=>n.message)));throw r.errors=mu.errors,r}return Tm(e)}function Tm(t){let e=Object.getOwnPropertyNames(t);for(let r of e){let n=t[r];ArrayBuffer.isView(n)&&!(n instanceof DataView)||(t[r]=n&&typeof n=="object"?Tm(n):n)}return Object.freeze(t)}gu.exports=A6;gu.exports.defaultInitOptions=mu.defaultInitOptions;gu.exports.utils={deepFreezeObject:Tm}});var jP=E((hQ,qP)=>{"use strict";var{kAvvioBoot:C6,kChildren:AP,kRoutePrefix:CP,kLogLevel:IP,kLogSerializers:$m,kHooks:Pm,kSchemaController:Vs,kContentTypeParser:NP,kReply:kP,kRequest:xP,kFourOhFour:I6,kPluginNameChain:LP,kErrorHandlerAlreadySet:N6}=De(),k6=Pa(),x6=xa(),L6=Np(),q6=Hf(),{buildHooks:j6}=Fr(),bo=nm();qP.exports=function(e,r,n){let s=bo.registerPlugin.call(e,r),i=bo.getPluginName(r)||bo.getFuncPreview(r);if(s)return e[LP].push(i),e;let o=Object.create(e);e[AP].push(o),o.ready=e[C6].bind(o),o[AP]=[],o[kP]=k6.buildReply(o[kP]),o[xP]=x6.buildRequest(o[xP]),o[NP]=q6.helpers.buildContentTypeParser(o[NP]),o[Pm]=j6(o[Pm]),o[CP]=D6(o[CP],n.prefix),o[IP]=n.logLevel||o[IP],o[Vs]=L6.buildSchemaController(e[Vs]),o.getSchema=o[Vs].getSchema.bind(o[Vs]),o.getSchemas=o[Vs].getSchemas.bind(o[Vs]),o[bo.kRegisteredPlugins]=Object.create(o[bo.kRegisteredPlugins]),o[LP]=[i],o[N6]=!1,(o[$m]||n.logSerializers)&&(o[$m]=Object.assign(Object.create(o[$m]),n.logSerializers)),n.prefix&&o[I6].arrange404(o);for(let a of o[Pm].onRegister)a.call(e,o,n);return o};function D6(t,e){return e?(t.endsWith("/")&&e[0]==="/"?e=e.slice(1):e[0]!=="/"&&(e="/"+e),t+e):t}});var VP=E(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.parseCookie=MP;gr.parse=MP;gr.stringifyCookie=U6;gr.stringifySetCookie=yu;gr.serialize=yu;gr.parseSetCookie=B6;gr.stringifySetCookie=yu;gr.serialize=yu;var DP=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,FP=/^[\u0021-\u003A\u003C-\u007E]*$/,F6=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,M6=/^[\u0020-\u003A\u003D-\u007E]*$/,H6=/^-?\d+$/,V6=Object.prototype.toString,z6=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function MP(t,e){let r=new z6,n=t.length;if(n<2)return r;let s=e?.decode||HP,i=0;do{let o=Cm(t,i,n);if(o===-1)break;let a=Am(t,i,n);if(o>a){i=t.lastIndexOf(";",o-1)+1;continue}let l=sn(t,i,o);r[l]===void 0&&(r[l]=s(sn(t,o+1,a))),i=a+1}while(i<n);return r}function U6(t,e){let r=e?.encode||encodeURIComponent,n=[];for(let s of Object.keys(t)){let i=t[s];if(i===void 0)continue;if(!DP.test(s))throw new TypeError(`cookie name is invalid: ${s}`);let o=r(i);if(!FP.test(o))throw new TypeError(`cookie val is invalid: ${i}`);n.push(`${s}=${o}`)}return n.join("; ")}function yu(t,e,r){let n=typeof t=="object"?t:{...r,name:t,value:String(e)},i=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!DP.test(n.name))throw new TypeError(`argument name is invalid: ${n.name}`);let o=n.value?i(n.value):"";if(!FP.test(o))throw new TypeError(`argument val is invalid: ${n.value}`);let a=n.name+"="+o;if(n.maxAge!==void 0){if(!Number.isInteger(n.maxAge))throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);a+="; Max-Age="+n.maxAge}if(n.domain){if(!F6.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);a+="; Domain="+n.domain}if(n.path){if(!M6.test(n.path))throw new TypeError(`option path is invalid: ${n.path}`);a+="; Path="+n.path}if(n.expires){if(!G6(n.expires)||!Number.isFinite(n.expires.valueOf()))throw new TypeError(`option expires is invalid: ${n.expires}`);a+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(a+="; HttpOnly"),n.secure&&(a+="; Secure"),n.partitioned&&(a+="; Partitioned"),n.priority)switch(typeof n.priority=="string"?n.priority.toLowerCase():void 0){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${n.priority}`)}if(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"none":a+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${n.sameSite}`)}return a}function B6(t,e){let r=e?.decode||HP,n=t.length,s=Am(t,0,n),i=Cm(t,0,s),o=i===-1?{name:"",value:r(sn(t,0,s))}:{name:sn(t,0,i),value:r(sn(t,i+1,s))},a=s+1;for(;a<n;){let l=Am(t,a,n),u=Cm(t,a,l),c=u===-1?sn(t,a,l):sn(t,a,u),f=u===-1?void 0:sn(t,u+1,l);switch(c.toLowerCase()){case"httponly":o.httpOnly=!0;break;case"secure":o.secure=!0;break;case"partitioned":o.partitioned=!0;break;case"domain":o.domain=f;break;case"path":o.path=f;break;case"max-age":f&&H6.test(f)&&(o.maxAge=Number(f));break;case"expires":if(!f)break;let p=new Date(f);Number.isFinite(p.valueOf())&&(o.expires=p);break;case"priority":if(!f)break;let h=f.toLowerCase();(h==="low"||h==="medium"||h==="high")&&(o.priority=h);break;case"samesite":if(!f)break;let d=f.toLowerCase();(d==="lax"||d==="strict"||d==="none")&&(o.sameSite=d);break}a=l+1}return o}function Am(t,e,r){let n=t.indexOf(";",e);return n===-1?r:n}function Cm(t,e,r){let n=t.indexOf("=",e);return n<r?n:-1}function sn(t,e,r){let n=e,s=r;do{let i=t.charCodeAt(n);if(i!==32&&i!==9)break}while(++n<s);for(;s>n;){let i=t.charCodeAt(s-1);if(i!==32&&i!==9)break;s--}return t.slice(n,s)}function HP(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function G6(t){return V6.call(t)==="[object Date]"}});var UP=E((mQ,_u)=>{"use strict";var{format:Im}=V("node:util");function W6(t){return zP({...t,name:"DeprecationWarning"})}function zP({name:t,code:e,message:r,unlimited:n=!1}={}){if(!t)throw new Error("Warning name must not be empty");if(!e)throw new Error("Warning code must not be empty");if(!r)throw new Error("Warning message must not be empty");if(typeof n!="boolean")throw new Error("Warning opts.unlimited must be a boolean");e=e.toUpperCase();let s={[t]:function(o,a,l){i.emitted===!0&&i.unlimited!==!0||(i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code))}};n&&(s={[t]:function(o,a,l){i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code)}});let i=s[t];return i.emitted=!1,i.message=r,i.unlimited=n,i.code=e,i.format=function(o,a,l){let u;return o&&a&&l?u=Im(r,o,a,l):o&&a?u=Im(r,o,a):o?u=Im(r,o):u=r,u},i}var Nm={createWarning:zP,createDeprecation:W6};_u.exports=Nm;_u.exports.default=Nm;_u.exports.processWarning=Nm});var WP=E((gQ,GP)=>{"use strict";var{URL:BP}=V("node:url"),km="http://localhost";GP.exports=function(e,r){(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]")&&e.startsWith("//")&&(e=km+e);let n=typeof e=="object"?Object.assign(new BP(km),e):new BP(e,km);if(typeof r=="string"){r=new URLSearchParams(r);for(let s of r.keys()){n.searchParams.delete(s);for(let i of r.getAll(s))n.searchParams.append(s,i)}}else{let s=Object.assign({},e.query,r);for(let i in s){let o=s[i];if(Array.isArray(o)){n.searchParams.delete(i);for(let a of o)n.searchParams.append(i,a)}else n.searchParams.set(i,o)}}return n}});var JP=E((yQ,xm)=>{"use strict";var{randomUUID:J6}=V("node:crypto"),{Readable:K6}=V("node:stream"),zs;function Y6(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}function X6(t){zs=zs??new TextEncoder;let e=`----formdata-${J6()}`,r=`--${e}\r
365
+ `))}};C$.exports=hm});var k$=E((uQ,N$)=>{"use strict";var w9=I$(),pu={STATIC:0,PARAMETRIC:1,WILDCARD:2},uu=class{constructor(){this.isLeafNode=!1,this.routes=null,this.handlerStorage=null}addRoute(e,r){this.routes===null&&(this.routes=[]),this.handlerStorage===null&&(this.handlerStorage=new w9),this.isLeafNode=!0,this.routes.push(e),this.handlerStorage.addHandler(r,e)}},cu=class extends uu{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(e,r){let n=this.staticChildren[e.charAt(r)];return n===void 0||!n.matchPrefix(e,r)?null:n}getStaticChild(e,r=0){if(e.length===r)return this;let n=this.findStaticMatchingChild(e,r);return n?n.getStaticChild(e,r+n.prefix.length):null}createStaticChild(e){if(e.length===0)return this;let r=this.staticChildren[e.charAt(0)];if(r){let s=1;for(;s<r.prefix.length;s++)if(e.charCodeAt(s)!==r.prefix.charCodeAt(s)){r=r.split(this,s);break}return r.createStaticChild(e.slice(s))}let n=e.charAt(0);return this.staticChildren[n]=new fu(e),this.staticChildren[n]}},fu=class t extends cu{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=pu.STATIC,this._compilePrefixMatch()}getParametricChild(e){let r=e&&e.source,n=this.parametricChildren.find(s=>(s.regex&&s.regex.source)===r);return n||null}createParametricChild(e,r,n){let s=this.getParametricChild(e);return s?(s.nodePaths.add(n),s):(s=new du(e,r,n),this.parametricChildren.push(s),this.parametricChildren.sort((i,o)=>i.isRegex?o.isRegex?i.staticSuffix===null?1:o.staticSuffix===null?-1:o.staticSuffix.endsWith(i.staticSuffix)?1:i.staticSuffix.endsWith(o.staticSuffix)?-1:0:-1:1),s)}getWildcardChild(){return this.wildcardChild}createWildcardChild(){return this.wildcardChild=this.getWildcardChild()||new hu,this.wildcardChild}split(e,r){let n=this.prefix.slice(0,r),s=this.prefix.slice(r);this.prefix=s,this._compilePrefixMatch();let i=new t(n);return i.staticChildren[s.charAt(0)]=this,e.staticChildren[n.charAt(0)]=i,i}getNextNode(e,r,n,s){let i=this.findStaticMatchingChild(e,r),o=0;if(i===null){if(this.parametricChildren.length===0)return this.wildcardChild;i=this.parametricChildren[0],o=1}this.wildcardChild!==null&&n.push({paramsCount:s,brotherPathIndex:r,brotherNode:this.wildcardChild});for(let a=this.parametricChildren.length-1;a>=o;a--)n.push({paramsCount:s,brotherPathIndex:r,brotherNode:this.parametricChildren[a]});return i}_compilePrefixMatch(){if(this.prefix.length===1){this.matchPrefix=()=>!0;return}let e=[];for(let r=1;r<this.prefix.length;r++){let n=this.prefix.charCodeAt(r);e.push(`path.charCodeAt(i + ${r}) === ${n}`)}this.matchPrefix=new Function("path","i",`return ${e.join(" && ")}`)}},du=class extends cu{constructor(e,r,n){super(),this.isRegex=!!e,this.regex=e||null,this.staticSuffix=r||null,this.kind=pu.PARAMETRIC,this.nodePaths=new Set([n])}getNextNode(e,r){return this.findStaticMatchingChild(e,r)}},hu=class extends uu{constructor(){super(),this.kind=pu.WILDCARD}getNextNode(){return null}};N$.exports={StaticNode:fu,ParametricNode:du,WildcardNode:hu,NODE_TYPES:pu}});var L$=E((cQ,x$)=>{"use strict";var R9=V("node:assert");function So(){if(!(this instanceof So))return new So;this.store=new Map,this.maxMajor=0,this.maxMinors={},this.maxPatches={}}So.prototype.set=function(t,e){if(typeof t!="string")throw new TypeError("Version should be a string");let[r,n,s]=t.split(".",3);if(isNaN(r))throw new TypeError("Major version must be a numeric value");return r=Number(r),n=Number(n)||0,s=Number(s)||0,r>=this.maxMajor&&(this.maxMajor=r,this.store.set("x",e),this.store.set("*",e),this.store.set("x.x",e),this.store.set("x.x.x",e)),n>=(this.maxMinors[r]||0)&&(this.maxMinors[r]=n,this.store.set(`${r}.x`,e),this.store.set(`${r}.x.x`,e)),s>=(this.maxPatches[`${r}.${n}`]||0)&&(this.maxPatches[`${r}.${n}`]=s,this.store.set(`${r}.${n}.x`,e)),this.store.set(`${r}.${n}.${s}`,e),this};So.prototype.get=function(t){return this.store.get(t)};x$.exports={name:"version",mustMatchWhenDerived:!0,storage:So,validate(t){R9(typeof t=="string","Version should be a string")}}});var j$=E((fQ,q$)=>{"use strict";var O9=V("node:assert");function T9(){let t=new Map,e=[];return{get:r=>{let n=t.get(r);if(n)return n;for(let s of e)if(s.host.test(r))return s.value},set:(r,n)=>{r instanceof RegExp?e.push({host:r,value:n}):t.set(r,n)}}}q$.exports={name:"host",mustMatchWhenDerived:!1,storage:T9,validate(t){O9(typeof t=="string"||Object.prototype.toString.call(t)==="[object RegExp]","Host should be a string or a RegExp")}}});var F$=E((dQ,D$)=>{"use strict";var $9=L$(),P9=j$(),pm=V("node:assert"),mm=class{constructor(e){if(this.strategies={version:$9,host:P9},this.strategiesInUse=new Set,this.asyncStrategiesInUse=new Set,e)for(let r of Object.values(e))this.addConstraintStrategy(r)}isStrategyUsed(e){return this.strategiesInUse.has(e)||this.asyncStrategiesInUse.has(e)}hasConstraintStrategy(e){let r=this.strategies[e];return r!==void 0?r.isCustom||this.isStrategyUsed(e):!1}addConstraintStrategy(e){if(pm(typeof e.name=="string"&&e.name!=="","strategy.name is required."),pm(e.storage&&typeof e.storage=="function","strategy.storage function is required."),pm(e.deriveConstraint&&typeof e.deriveConstraint=="function","strategy.deriveConstraint function is required."),this.strategies[e.name]&&this.strategies[e.name].isCustom)throw new Error(`There already exists a custom constraint with the name ${e.name}.`);if(this.isStrategyUsed(e.name))throw new Error(`There already exists a route with ${e.name} constraint.`);e.isCustom=!0,e.isAsync=e.deriveConstraint.length===3,this.strategies[e.name]=e,e.mustMatchWhenDerived&&this.noteUsage({[e.name]:e})}deriveConstraints(e,r,n){let s=this.deriveSyncConstraints(e,r);if(n===void 0)return s;this.deriveAsyncConstraints(s,e,r,n)}deriveSyncConstraints(e,r){}noteUsage(e){if(e){let r=this.strategiesInUse.size;for(let n in e)this.strategies[n].isAsync?this.asyncStrategiesInUse.add(n):this.strategiesInUse.add(n);r!==this.strategiesInUse.size&&this._buildDeriveConstraints()}}newStoreForConstraint(e){if(!this.strategies[e])throw new Error(`No strategy registered for constraint key ${e}`);return this.strategies[e].storage()}validateConstraints(e){for(let r in e){let n=e[r];if(typeof n>"u")throw new Error("Can't pass an undefined constraint value, must pass null or no key at all");let s=this.strategies[r];if(!s)throw new Error(`No strategy registered for constraint key ${r}`);s.validate&&s.validate(n)}}deriveAsyncConstraints(e,r,n,s){let i=this.asyncStrategiesInUse.size;if(i===0){s(null,e);return}e=e||{};for(let o of this.asyncStrategiesInUse)this.strategies[o].deriveConstraint(r,n,(l,u)=>{if(l!==null){s(l);return}e[o]=u,--i===0&&s(null,e)})}_buildDeriveConstraints(){if(this.strategiesInUse.size===0)return;let e=["return {"];for(let r of this.strategiesInUse){let n=this.strategies[r];n.isCustom?e.push(` ${n.name}: this.strategies.${r}.deriveConstraint(req, ctx),`):r==="version"?e.push(" version: req.headers['accept-version'],"):e.push(" host: req.headers.host || req.headers[':authority'],")}e.push("}"),this.deriveSyncConstraints=new Function("req","ctx",e.join(`
366
+ `)).bind(this)}};D$.exports=mm});var H$=E((hQ,M$)=>{"use strict";var A9=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","QUERY","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];M$.exports=A9});var U$=E((pQ,z$)=>{"use strict";function V$(t,e){return t===50?e===53?"%":e===51?"#":e===52?"$":e===54?"&":e===66||e===98?"+":e===67||e===99?",":e===70||e===102?"/":null:t===51?e===65||e===97?":":e===66||e===98?";":e===68||e===100?"=":e===70||e===102?"?":null:t===52&&e===48?"@":null}function C9(t,e){let r=!1,n=!1,s="";for(let o=1;o<t.length;o++){let a=t.charCodeAt(o);if(a===37){let l=t.charCodeAt(o+1),u=t.charCodeAt(o+2);V$(l,u)===null?r=!0:(n=!0,l===50&&u===53&&(r=!0,t=t.slice(0,o+1)+"25"+t.slice(o+1),o+=2),o+=2)}else if(a===63||a===35||a===59&&e){s=t.slice(o+1),t=t.slice(0,o);break}}return{path:r?decodeURI(t):t,querystring:s,shouldDecodeParam:n}}function I9(t){let e=t.indexOf("%");if(e===-1)return t;let r="",n=e;for(let s=e;s<t.length;s++)if(t.charCodeAt(s)===37){let i=t.charCodeAt(s+1),o=t.charCodeAt(s+2),a=V$(i,o);r+=t.slice(n,s)+a,n=s+3}return t.slice(0,e)+r+t.slice(n)}z$.exports={safeDecodeURI:C9,safeDecodeURIComponent:I9}});var bm=E((mQ,eP)=>{"use strict";var qe=V("node:assert"),N9=JT(),Hs=_$(),_m=Ai(),{prettyPrintTree:k9}=T$(),{StaticNode:B$,NODE_TYPES:G$}=k$(),x9=F$(),Ms=H$(),gm=au(),{safeDecodeURI:W$,safeDecodeURIComponent:ym}=U$(),J$=/^https?:\/\/.*?\//,qn=/(\/:[^/()]*?)\?(\/?)/,K$=/[.*+?^${}()|[\]\\]/g,Y$=/\/\/+/g;if(!Hs(J$))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!Hs(qn))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");if(!Hs(K$))throw new Error("the ESCAPE_REGEXP is not safe, update this module");if(!Hs(Y$))throw new Error("the REMOVE_DUPLICATE_SLASHES_REGEXP is not safe, update this module");function Te(t){if(!(this instanceof Te))return new Te(t);t=t||{},this._opts=t,t.defaultRoute?(qe(typeof t.defaultRoute=="function","The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(qe(typeof t.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(qe(typeof t.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=L9,t.querystringParser?(qe(typeof t.querystringParser=="function","querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=e=>e.length===0?{}:N9.parse(e),this.caseSensitive=t.caseSensitive===void 0?!0:t.caseSensitive,this.ignoreTrailingSlash=t.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=t.ignoreDuplicateSlashes||!1,this.maxParamLength=t.maxParamLength||100,this.allowUnsafeRegex=t.allowUnsafeRegex||!1,this.constrainer=new x9(t.constraints),this.useSemicolonDelimiter=t.useSemicolonDelimiter||!1,this.routes=[],this.trees={}}Te.prototype.on=function(e,r,n,s,i){typeof n=="function"&&(s!==void 0&&(i=s),s=n,n={}),qe(typeof r=="string","Path should be a string"),qe(r.length>0,"The path could not be empty"),qe(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`"),qe(typeof s=="function","Handler should be a function");let o=r.match(qn);if(o){qe(r.length===o.index+o[0].length,"Optional Parameter needs to be the last parameter of the path");let u=r.replace(qn,"$1$2"),c=r.replace(qn,"$2")||"/";this.on(e,u,n,s,i),this.on(e,c,n,s,i);return}let a=r;this.ignoreDuplicateSlashes&&(r=Sm(r)),this.ignoreTrailingSlash&&(r=Em(r));let l=Array.isArray(e)?e:[e];for(let u of l)qe(typeof u=="string","Method should be a string"),qe(Ms.includes(u),`Method '${u}' is not an http method.`),this._on(u,r,n,s,i,a)};Te.prototype._on=function(e,r,n,s,i){let o={};n.constraints!==void 0&&(qe(typeof n.constraints=="object"&&n.constraints!==null,"Constraints should be an object"),Object.keys(n.constraints).length!==0&&(o=n.constraints)),this.constrainer.validateConstraints(o),this.constrainer.noteUsage(o),this.trees[e]===void 0&&(this.trees[e]=new B$("/"));let a=r;if(a==="*"&&this.trees[e].prefix.length!==0){let p=this.trees[e];this.trees[e]=new B$(""),this.trees[e].staticChildren["/"]=p}let l=this.trees[e],u=l.prefix.length,c=[];for(let p=0;p<=a.length;p++){if(a.charCodeAt(p)===58&&a.charCodeAt(p+1)===58){p++;continue}let h=a.charCodeAt(p)===58&&a.charCodeAt(p+1)!==58,d=a.charCodeAt(p)===42;if(h||d||p===a.length&&p!==u){let m=a.slice(u,p);this.caseSensitive||(m=m.toLowerCase()),m=m.replaceAll("::",":"),m=m.replaceAll("%","%25"),l=l.createStaticChild(m)}if(h){let m=!1,g=!0,S="",b=[],_=p+1;for(let y=_;;y++){let R=a.charCodeAt(y),T=R===40,O=R===45||R===46,w=R===47||y===a.length;if(T||O||w){let $=a.slice(_,y);if(c.push($),m=m||T||O,T){let C=Z$(a,y),k=a.slice(y,C+1);this.allowUnsafeRegex||qe(Hs(new RegExp(k)),`The regex '${k}' is not safe!`),b.push(Q$(k)),y=C+1,g=!0}else b.push(g?"(.*?)":`(${S}|(?:(?!${S}).)*)`),g=!1;let v=y;for(;y<a.length;y++){let C=a.charCodeAt(y);if(C===47)break;if(C===58)if(a.charCodeAt(y+1)===58)y++;else break}let P=a.slice(v,y);if(P&&(P=P.replaceAll("::",":"),P=P.replaceAll("%","%25"),b.push(S=X$(P))),_=y+1,w||a.charCodeAt(y)===47||y===a.length){let C=m?"()"+P:P,k=a.slice(p,y);a=a.slice(0,p+1)+C+a.slice(y),p+=C.length;let M=m?new RegExp("^"+b.join("")+"$"):null;l=l.createParametricChild(M,P||null,k),u=p+1;break}}}}else if(d&&(c.push("*"),l=l.createWildcardChild(),u=p+1,p!==a.length-1))throw new Error("Wildcard must be the last character in the route")}this.caseSensitive||(a=a.toLowerCase()),a==="*"&&(a="/*");for(let p of this.routes){let h=p.opts.constraints||{};if(p.method===e&&p.pattern===a&&_m(h,o))throw new Error(`Method '${e}' already declared for route '${a}' with constraints '${JSON.stringify(o)}'`)}let f={method:e,path:r,pattern:a,params:c,opts:n,handler:s,store:i};this.routes.push(f),l.addRoute(f,this.constrainer)};Te.prototype.hasRoute=function(e,r,n){return this.findRoute(e,r,n)!==null};Te.prototype.findRoute=function(e,r,n={}){if(this.trees[e]===void 0)return null;let s=r,i=this.trees[e],o=i.prefix.length,a=[];for(let l=0;l<=s.length;l++){if(s.charCodeAt(l)===58&&s.charCodeAt(l+1)===58){l++;continue}let u=s.charCodeAt(l)===58&&s.charCodeAt(l+1)!==58,c=s.charCodeAt(l)===42;if(u||c||l===s.length&&l!==o){let f=s.slice(o,l);if(this.caseSensitive||(f=f.toLowerCase()),f=f.replaceAll("::",":"),f=f.replaceAll("%","%25"),i=i.getStaticChild(f),i===null)return null}if(u){let f=!1,p=!0,h="",d=[],m=l+1;for(let g=m;;g++){let S=s.charCodeAt(g),b=S===40,_=S===45||S===46,y=S===47||g===s.length;if(b||_||y){let R=s.slice(m,g);if(a.push(R),f=f||b||_,b){let w=Z$(s,g),$=s.slice(g,w+1);this.allowUnsafeRegex||qe(Hs(new RegExp($)),`The regex '${$}' is not safe!`),d.push(Q$($)),g=w+1,p=!1}else d.push(p?"(.*?)":`(${h}|(?:(?!${h}).)*)`),p=!1;let T=g;for(;g<s.length;g++){let w=s.charCodeAt(g);if(w===47)break;if(w===58)if(s.charCodeAt(g+1)===58)g++;else break}let O=s.slice(T,g);if(O&&(O=O.replaceAll("::",":"),O=O.replaceAll("%","%25"),d.push(h=X$(O))),m=g+1,y||s.charCodeAt(g)===47||g===s.length){let w=f?"()"+O:O,$=s.slice(l,g);s=s.slice(0,l+1)+w+s.slice(g),l+=w.length;let v=f?new RegExp("^"+d.join("")+"$"):null;if(i=i.getParametricChild(v,O||null,$),i===null)return null;o=l+1;break}}}}else if(c&&(a.push("*"),i=i.getWildcardChild(),o=l+1,l!==s.length-1))throw new Error("Wildcard must be the last character in the route")}this.caseSensitive||(s=s.toLowerCase());for(let l of this.routes){let u=l.opts.constraints||{};if(l.method===e&&l.pattern===s&&_m(u,n))return{handler:l.handler,store:l.store,params:l.params}}return null};Te.prototype.hasConstraintStrategy=function(t){return this.constrainer.hasConstraintStrategy(t)};Te.prototype.addConstraintStrategy=function(t){this.constrainer.addConstraintStrategy(t),this._rebuild(this.routes)};Te.prototype.reset=function(){this.trees={},this.routes=[]};Te.prototype.off=function(e,r,n){qe(typeof r=="string","Path should be a string"),qe(r.length>0,"The path could not be empty"),qe(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`"),qe(typeof n>"u"||typeof n=="object"&&!Array.isArray(n)&&n!==null,"Constraints should be an object or undefined.");let s=r.match(qn);if(s){qe(r.length===s.index+s[0].length,"Optional Parameter needs to be the last parameter of the path");let o=r.replace(qn,"$1$2"),a=r.replace(qn,"$2");this.off(e,o,n),this.off(e,a,n);return}this.ignoreDuplicateSlashes&&(r=Sm(r)),this.ignoreTrailingSlash&&(r=Em(r));let i=Array.isArray(e)?e:[e];for(let o of i)this._off(o,r,n)};Te.prototype._off=function(e,r,n){qe(typeof e=="string","Method should be a string"),qe(Ms.includes(e),`Method '${e}' is not an http method.`);function s(l){return e!==l.method||r!==l.path}function i(l){return s(l)||!_m(n,l.opts.constraints||{})}let o=n?i:s,a=this.routes.filter(o);this._rebuild(a)};Te.prototype.lookup=function(e,r,n,s){if(typeof n=="function"&&(s=n,n=void 0),s===void 0){let i=this.constrainer.deriveConstraints(e,n),o=this.find(e.method,e.url,i);return this.callHandler(o,e,r,n)}this.constrainer.deriveConstraints(e,n,(i,o)=>{if(i!==null){s(i);return}try{let a=this.find(e.method,e.url,o),l=this.callHandler(a,e,r,n);s(null,l)}catch(a){s(a)}})};Te.prototype.callHandler=function(e,r,n,s){return e===null?this._defaultRoute(r,n,s):s===void 0?e.handler(r,n,e.params,e.store,e.searchParams):e.handler.call(s,r,n,e.params,e.store,e.searchParams)};Te.prototype.find=function(e,r,n){let s=this.trees[e];if(s===void 0)return null;r.charCodeAt(0)!==47&&(r=r.replace(J$,"/")),this.ignoreDuplicateSlashes&&(r=Sm(r));let i,o,a;try{i=W$(r,this.useSemicolonDelimiter),r=i.path,o=i.querystring,a=i.shouldDecodeParam}catch{return this._onBadUrl(r)}this.ignoreTrailingSlash&&(r=Em(r));let l=r;this.caseSensitive===!1&&(r=r.toLowerCase());let u=this.maxParamLength,c=s.prefix.length,f=[],p=r.length,h=[];for(;;){if(c===p&&s.isLeafNode){let S=s.handlerStorage.getMatchingHandler(n);if(S!==null)return{handler:S.handler,store:S.store,params:S._createParamsObject(f),searchParams:this.querystringParser(o)}}let d=s.getNextNode(r,c,h,f.length);if(d===null){if(h.length===0)return null;let S=h.pop();c=S.brotherPathIndex,f.splice(S.paramsCount),d=S.brotherNode}if(s=d,s.kind===G$.STATIC){c+=s.prefix.length;continue}if(s.kind===G$.WILDCARD){let S=l.slice(c);a&&(S=ym(S)),f.push(S),c=p;continue}let m=l.indexOf("/",c);m===-1&&(m=p);let g=l.slice(c,m);if(a&&(g=ym(g)),s.isRegex){let S=s.regex.exec(g);if(S===null)continue;for(let b=1;b<S.length;b++){let _=S[b];if(_.length>u)return null;f.push(_)}}else{if(g.length>u)return null;f.push(g)}c=m}};Te.prototype._rebuild=function(t){this.reset();for(let e of t){let{method:r,path:n,opts:s,handler:i,store:o}=e;this._on(r,n,s,i,o)}};Te.prototype._defaultRoute=function(t,e,r){if(this.defaultRoute!==null)return r===void 0?this.defaultRoute(t,e):this.defaultRoute.call(r,t,e);e.statusCode=404,e.end()};Te.prototype._onBadUrl=function(t){if(this.onBadUrl===null)return null;let e=this.onBadUrl;return{handler:(r,n,s)=>e(t,r,n),params:{},store:null}};Te.prototype.prettyPrint=function(t={}){let e=t.method;t.buildPrettyMeta=this.buildPrettyMeta.bind(this);let r=null;if(e===void 0){let{version:n,host:s,...i}=this.constrainer.strategies;i[gm.name]=gm;let o=new Te({...this._opts,constraints:i}),a=this.routes.map(l=>{let u={...l.opts.constraints,[gm.name]:l.method};return{...l,method:"MERGED",opts:{constraints:u}}});o._rebuild(a),r=o.trees.MERGED}else r=this.trees[e];return r==null?"(empty tree)":k9(r,t)};for(let t in Ms){if(!Ms.hasOwnProperty(t))continue;let e=Ms[t],r=e.toLowerCase();Te.prototype[r]=function(n,s,i){return this.on(e,n,s,i)}}Te.prototype.all=function(t,e,r){this.on(Ms,t,e,r)};Te.sanitizeUrlPath=function(e,r){let n=W$(e,r);return n.shouldDecodeParam?ym(n.path):n.path};eP.exports=Te;function X$(t){return t.replace(K$,"\\$&")}function Sm(t){return t.indexOf("//")!==-1?t.replace(Y$,"/"):t}function Em(t){return t.length>1&&t.charCodeAt(t.length-1)===47?t.slice(0,-1):t}function Q$(t){return t.charCodeAt(1)===94&&(t=t.slice(0,1)+t.slice(2)),t.charCodeAt(t.length-2)===36&&(t=t.slice(0,t.length-2)+t.slice(t.length-1)),t}function Z$(t,e){let r=1;for(;e<t.length;){if(e++,t.charCodeAt(e)===92){e++;continue}if(t.charCodeAt(e)===41?r--:t.charCodeAt(e)===40&&r++,!r)return e}throw new TypeError('Invalid regexp expression in "'+t+'"')}function L9(t){return t?t.store?Object.assign({},t.store):{}:{}}});var rP=E((gQ,tP)=>{"use strict";function vm(t,e,r,n){if(r===void 0){e.header("content-length","0"),n(null,null);return}if(typeof r.resume=="function"){r.on("error",i=>{e.log.error({err:i},"Error on Stream found for HEAD route")}),r.resume(),n(null,null);return}if(typeof r.getReader=="function"){r.cancel("Stream cancelled by HEAD route").catch(i=>{e.log.error({err:i},"Error on Stream found for HEAD route")}),n(null,null);return}let s=""+Buffer.byteLength(r);e.header("content-length",s),n(null,null)}function q9(t){return t==null?vm:Array.isArray(t)?[...t,vm]:[t,vm]}tP.exports={parseHeadOnSendHandlers:q9}});var EP=E((yQ,SP)=>{"use strict";var j9=bm(),D9=qa(),nP=Ec(),{onRequestAbortHookRunner:F9,lifecycleHooks:sP,preParsingHookRunner:M9,onTimeoutHookRunner:H9,onRequestHookRunner:V9}=Fr(),{normalizeSchema:z9}=ui(),{parseHeadOnSendHandlers:U9}=rP(),{compileSchemasForValidation:B9,compileSchemasForSerialization:G9}=gc(),{FST_ERR_SCH_VALIDATION_BUILD:W9,FST_ERR_SCH_SERIALIZATION_BUILD:J9,FST_ERR_DUPLICATED_ROUTE:K9,FST_ERR_INVALID_URL:Y9,FST_ERR_HOOK_INVALID_HANDLER:iP,FST_ERR_ROUTE_OPTIONS_NOT_OBJ:X9,FST_ERR_ROUTE_DUPLICATED_HANDLER:Q9,FST_ERR_ROUTE_HANDLER_NOT_FN:oP,FST_ERR_ROUTE_MISSING_HANDLER:Z9,FST_ERR_ROUTE_METHOD_NOT_SUPPORTED:e6,FST_ERR_ROUTE_METHOD_INVALID:t6,FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED:r6,FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT:n6,FST_ERR_HOOK_INVALID_ASYNC_HANDLER:wm}=He(),{kRoutePrefix:s6,kSupportedHTTPMethods:Tm,kLogLevel:i6,kLogSerializers:aP,kHooks:lP,kSchemaController:o6,kOptions:uP,kReplySerializerDefault:Rm,kReplyIsError:a6,kRequestPayloadStream:l6,kDisableRequestLogging:cP,kSchemaErrorFormatter:u6,kErrorHandler:fP,kHasBeenDecorated:dP,kRequestAcceptVersion:Om,kRouteByFastify:c6,kRouteContext:hP}=De(),{buildErrorHandler:f6}=ci(),{createChildLogger:d6}=li(),{getGenReqId:h6}=Xl(),{FSTDEP022:p6}=Kn(),pP=["allowUnsafeRegex","buildPrettyMeta","caseSensitive","constraints","defaultRoute","ignoreDuplicateSlashes","ignoreTrailingSlash","maxParamLength","onBadUrl","querystringParser","useSemicolonDelimiter"];function m6(t){let e=j9(t),r,n,s,i,o,a,l,u,c,f,p,h,d,m=!1;return{setup(w,$){r=$.avvio,n=$.fourOhFour,s=w.logger,i=$.hasLogger,o=$.setupResponseListeners,a=$.throwIfAlreadyStarted,h=w.exposeHeadRoutes,l=w.disableRequestLogging,typeof l=="function"&&(u=w.disableRequestLogging),c=w.routerOptions.ignoreTrailingSlash,f=w.routerOptions.ignoreDuplicateSlashes,p=Object.hasOwn(w,"return503OnClosing")?w.return503OnClosing:!0,d=$.keepAliveConnections},routing:e.lookup.bind(e),route:T,hasRoute:y,prepareRoute:_,routeHandler:O,closeRoutes:()=>{m=!0},printRoutes:e.prettyPrint.bind(e),addConstraintStrategy:g,hasConstraintStrategy:S,isAsyncConstraint:b,findRoute:R};function g(w){return a("Cannot add constraint strategy!"),e.addConstraintStrategy(w)}function S(w){return e.hasConstraintStrategy(w)}function b(){return e.constrainer.asyncStrategiesInUse.size>0}function _({method:w,url:$,options:v,handler:P,isFastify:C}){if(typeof $!="string")throw new Y9(typeof $);if(!P&&typeof v=="function")P=v,v={};else if(P&&typeof P=="function"){if(Object.prototype.toString.call(v)!=="[object Object]")throw new X9(w,$);if(v.handler)throw typeof v.handler=="function"?new Q9(w,$):new oP(w,$)}return v=Object.assign({},v,{method:w,url:$,path:$,handler:P||v&&v.handler}),T.call(this,{options:v,isFastify:C})}function y({options:w}){let $=w.method?.toUpperCase()??"";return e.hasRoute($,w.url||"",w.constraints)}function R(w){let $=e.find(w.method,w.url||"",w.constraints);return $?{handler:$.handler,params:$.params,searchParams:$.searchParams}:null}function T({options:w,isFastify:$}){a("Cannot add route!");let v={...w},P=v.url||v.path||"";if(!v.handler)throw new Z9(v.method,P);if(v.errorHandler!==void 0&&typeof v.errorHandler!="function")throw new oP(v.method,P);_P(v.bodyLimit);let C=v.exposeHeadRoute??h,k=!1,M=!1;if(Array.isArray(v.method))for(let fe=0;fe<v.method.length;++fe)v.method[fe]=mP.call(this,v.method[fe]),gP.call(this,v.method[fe],P,v.schema),k=v.method.includes("GET"),M=v.method.includes("HEAD");else v.method=mP.call(this,v.method),gP.call(this,v.method,P,v.schema),k=v.method==="GET",M=v.method==="HEAD";let J=C&&k?{...w}:null,U=this[s6];if(P==="/"&&U.length>0&&v.method!=="HEAD")switch(v.prefixTrailingSlash){case"slash":H.call(this,{path:P,isFastify:$});break;case"no-slash":H.call(this,{path:"",isFastify:$});break;case"both":default:H.call(this,{path:"",isFastify:$}),c!==!0&&(f!==!0||!U.endsWith("/"))&&H.call(this,{path:P,prefixing:!0,isFastify:$})}else P[0]==="/"&&U.endsWith("/")?H.call(this,{path:P.slice(1),isFastify:$}):H.call(this,{path:P,isFastify:$});return this;function H({path:fe,prefixing:ze=!1,isFastify:G=!1}){let Rt=U+fe;if(v.url=Rt,v.path=Rt,v.routePath=fe,v.prefix=U,v.logLevel=v.logLevel||this[i6],(this[aP]||v.logSerializers)&&(v.logSerializers=Object.assign(Object.create(this[aP]),v.logSerializers)),v.attachValidation==null&&(v.attachValidation=!1),ze===!1)for(let N of this[lP].onRoute)N.call(this,v);for(let N of sP)if(v&&N in v){if(Array.isArray(v[N]))for(let q of v[N]){if(typeof q!="function")throw new iP(N,Object.prototype.toString.call(q));if(N==="onSend"||N==="preSerialization"||N==="onError"||N==="preParsing"){if(q.constructor.name==="AsyncFunction"&&q.length===4)throw new wm}else if(N==="onRequestAbort"){if(q.constructor.name==="AsyncFunction"&&q.length!==1)throw new wm}else if(q.constructor.name==="AsyncFunction"&&q.length===3)throw new wm}else if(v[N]!==void 0&&typeof v[N]!="function")throw new iP(N,Object.prototype.toString.call(v[N]))}let Lr=v.constraints||{},me={...v.config,url:Rt,method:v.method},pe=new D9({schema:v.schema,handler:v.handler.bind(this),config:me,errorHandler:v.errorHandler,childLoggerFactory:v.childLoggerFactory,bodyLimit:v.bodyLimit,logLevel:v.logLevel,logSerializers:v.logSerializers,attachValidation:v.attachValidation,schemaErrorFormatter:v.schemaErrorFormatter,replySerializer:this[Rm],validatorCompiler:v.validatorCompiler,serializerCompiler:v.serializerCompiler,exposeHeadRoute:C,prefixTrailingSlash:v.prefixTrailingSlash||"both",server:this,isFastify:G}),A=e.findRoute("HEAD",v.url,Lr)!==null;try{e.on(v.method,v.url,{constraints:Lr},O,pe)}catch(N){if(!pe[c6])throw N.message.includes(`Method '${v.method}' already declared for route`)?new K9(v.method,v.url):N}if(this.after((N,q)=>{pe.errorHandler=v.errorHandler?f6(this[fP],v.errorHandler):this[fP],pe._parserOptions.limit=v.bodyLimit||null,pe.logLevel=v.logLevel,pe.logSerializers=v.logSerializers,pe.attachValidation=v.attachValidation,pe[Rm]=this[Rm],pe.schemaErrorFormatter=v.schemaErrorFormatter||this[u6]||pe.schemaErrorFormatter,r.once("preReady",()=>{for(let j of sP){let ue=this[lP][j].concat(v[j]||[]).map(de=>de.bind(this));pe[j]=ue.length?ue:null}for(;!pe.Request[dP]&&pe.Request.parent;)pe.Request=pe.Request.parent;for(;!pe.Reply[dP]&&pe.Reply.parent;)pe.Reply=pe.Reply.parent;if(n.setContext(this,pe),v.schema){pe.schema=z9(pe.schema,this.initialConfig);let j=this[o6],ue=v.schema.body||v.schema.headers||v.schema.querystring||v.schema.params;!v.validatorCompiler&&ue&&j.setupValidator(this[uP]);try{let de=typeof v?.validatorCompiler=="function"||j.isCustomValidatorCompiler;B9(pe,v.validatorCompiler||j.validatorCompiler,de)}catch(de){throw new W9(v.method,Rt,de.message)}v.schema.response&&!v.serializerCompiler&&j.setupSerializer(this[uP]);try{G9(pe,v.serializerCompiler||j.serializerCompiler)}catch(de){throw new J9(v.method,Rt,de.message)}}}),q(N)}),C&&k&&!M&&!A){let N=U9(J.onSend);_.call(this,{method:"HEAD",url:fe,options:{...J,onSend:N},isFastify:!0})}}}function O(w,$,v,P,C){let k=h6(P.server,w),M={level:P.logLevel};P.logSerializers&&(M.serializers=P.logSerializers);let J=d6(P,s,w,k,M);if(J[cP]=u?!1:l,m===!0&&(w.httpVersionMajor!==2&&$.setHeader("Connection","close"),p)){let G={"Content-Type":"application/json","Content-Length":"80"};$.writeHead(503,G),$.end('{"error":"Service Unavailable","message":"Service Unavailable","statusCode":503}'),J.info({res:{statusCode:503}},"request aborted - refusing to accept new requests as server is closing");return}String.prototype.toLowerCase.call(w.headers.connection||"")==="keep-alive"&&d.has(w.socket)===!1&&(d.add(w.socket),w.socket.on("close",S6.bind({keepAliveConnections:d,socket:w.socket}))),w.headers[Om]!==void 0&&(w.headers["accept-version"]=w.headers[Om],w.headers[Om]=void 0);let H=new P.Request(k,v,w,C,J,P),fe=new P.Reply($,H,J),ze=u?u(H):l;J[cP]=ze,ze===!1&&J.info({req:H},"incoming request"),(i===!0||P.onResponse!==null)&&o(fe),P.onRequest!==null?V9(P.onRequest,H,fe,yP):yP(null,H,fe),P.onRequestAbort!==null&&w.on("close",()=>{w.aborted&&F9(P.onRequestAbort,H,g6.bind(null,fe))}),P.onTimeout!==null&&(H.raw.socket._meta||H.raw.socket.on("timeout",y6),H.raw.socket._meta={context:P,request:H,reply:fe})}}function g6(t,e){e&&t.log.error({err:e},"onRequestAborted hook failed")}function y6(){let{context:t,request:e,reply:r}=this._meta;H9(t.onTimeout,e,r,E6)}function mP(t){if(typeof t!="string")throw new t6;if(t=t.toUpperCase(),!this[Tm].bodyless.has(t)&&!this[Tm].bodywith.has(t))throw new e6(t);return t}function gP(t,e,r){if(this[Tm].bodyless.has(t)&&r?.body)throw new r6(t,e)}function _P(t){if(t!==void 0&&(!Number.isInteger(t)||t<=0))throw new n6(t)}function yP(t,e,r){if(r.sent!==!0){if(t!=null){r[a6]=!0,r.send(t);return}e[l6]=e.raw,e[hP].preParsing!==null?M9(e[hP].preParsing,e,r,nP.bind(e.server)):nP.call(e.server,null,e,r)}}function _6(t,e){let r=t.routerOptions||Object.create(null),n=pP.filter(s=>Object.hasOwn(t,s));n.length>0&&p6(n.join(", "));for(let s of pP)Object.hasOwn(r,s)||(r[s]=t[s]??e[s]);return r}function S6(){this.keepAliveConnections.delete(this.socket)}function E6(){}SP.exports={buildRouting:m6,validateBodyLimitOption:_P,buildRouterOptions:_6}});var $P=E((_Q,TP)=>{"use strict";var b6=bm(),bP=Aa(),vP=La(),v6=qa(),{kRoutePrefix:w6,kCanSetNotFoundHandler:Eo,kFourOhFourLevelInstance:bo,kFourOhFourContext:gr,kHooks:R6,kErrorHandler:wP}=De(),{lifecycleHooks:O6}=Fr(),{buildErrorHandler:T6}=ci(),{FST_ERR_NOT_FOUND:$6}=He(),{createChildLogger:RP}=li(),{getGenReqId:OP}=Xl();function P6(t){let{logger:e,disableRequestLogging:r}=t,n=b6({onBadUrl:a(),defaultRoute:f}),s=null;return{router:n,setNotFoundHandler:u,setContext:l,arrange404:i};function i(p){p[bo]=p,p[Eo]=!0,n.onBadUrl=n.onBadUrl.bind(p),n.defaultRoute=n.defaultRoute.bind(p)}function o(p,h){let{url:d,method:m}=p.raw,g=`Route ${m}:${d} not found`;(typeof r=="function"?r(p.raw):r)||p.log.info(g),h.code(404).send({message:g,error:"Not Found",statusCode:404})}function a(){return function(h,d,m){let g=this[bo][gr],S=OP(g.server,d),b=RP(g,e,d,S),_=new vP(S,null,d,null,b,g),y=new bP(m,_,b);s(_,y)}}function l(p,h){let d=Object.assign({},p[gr]);d.onSend=h.onSend,h[gr]=d}function u(p,h,d,m){this[Eo]===void 0&&(this[Eo]=!0),this[gr]===void 0&&(this[gr]=null);let g=this,S=this[w6]||"/";if(this[Eo]===!1)throw new Error(`Not found handler already set for Fastify instance with prefix: '${S}'`);typeof p=="object"&&(p.preHandler&&(Array.isArray(p.preHandler)?p.preHandler=p.preHandler.map(b=>b.bind(g)):p.preHandler=p.preHandler.bind(g)),p.preValidation&&(Array.isArray(p.preValidation)?p.preValidation=p.preValidation.map(b=>b.bind(g)):p.preValidation=p.preValidation.bind(g))),typeof p=="function"&&(h=p,p=void 0),p=p||{},h?(this[bo][Eo]=!1,h=h.bind(this),s=h):(h=o,s=o),this.after((b,_)=>{c.call(this,S,p,h,d,m),_(b)})}function c(p,h,d,m,g){let S=new v6({schema:h.schema,handler:d,config:h.config||{},server:this});if(m.once("preReady",()=>{let b=this[gr];for(let _ of O6){let y=this[R6][_].concat(h[_]||[]).map(R=>R.bind(this));b[_]=y.length?y:null}b.errorHandler=h.errorHandler?T6(this[wP],h.errorHandler):this[wP]}),this[gr]!==null&&p==="/"){Object.assign(this[gr],S);return}this[bo][gr]=S,n.all(p+(p.endsWith("/")?"*":"/*"),g,S),n.all(p,g,S)}function f(p,h){let d=this[bo][gr],m=OP(d.server,p),g=RP(d,e,p,m);g.info({req:p},"incoming request");let S=new vP(m,null,p,null,g,d),b=new bP(h,S,g);S.log.warn("the default handler for 404 did not catch this, this is likely a fastify bug, please report it"),S.log.warn(n.prettyPrint()),b.code(404).send(new $6)}}TP.exports=P6});var PP=E((SQ,mu)=>{"use strict";mu.exports=ae;mu.exports.default=ae;var A6={type:"object",additionalProperties:!1,properties:{connectionTimeout:{type:"integer",default:0},keepAliveTimeout:{type:"integer",default:72e3},forceCloseConnections:{oneOf:[{type:"string",pattern:"idle"},{type:"boolean"}]},maxRequestsPerSocket:{type:"integer",default:0,nullable:!0},requestTimeout:{type:"integer",default:0},bodyLimit:{type:"integer",default:1048576},caseSensitive:{type:"boolean",default:!0},allowUnsafeRegex:{type:"boolean",default:!1},http2:{type:"boolean"},https:{if:{not:{oneOf:[{type:"boolean"},{type:"null"},{type:"object",additionalProperties:!1,required:["allowHTTP1"],properties:{allowHTTP1:{type:"boolean"}}}]}},then:{setDefaultValue:!0}},ignoreTrailingSlash:{type:"boolean",default:!1},ignoreDuplicateSlashes:{type:"boolean",default:!1},disableRequestLogging:{default:!1},maxParamLength:{type:"integer",default:100},onProtoPoisoning:{type:"string",default:"error"},onConstructorPoisoning:{type:"string",default:"error"},pluginTimeout:{type:"integer",default:1e4},requestIdHeader:{anyOf:[{type:"boolean"},{type:"string"}],default:!1},requestIdLogLabel:{type:"string",default:"reqId"},http2SessionTimeout:{type:"integer",default:72e3},exposeHeadRoutes:{type:"boolean",default:!0},useSemicolonDelimiter:{type:"boolean",default:!1},routerOptions:{type:"object",additionalProperties:!0,properties:{ignoreTrailingSlash:{type:"boolean",default:!1},ignoreDuplicateSlashes:{type:"boolean",default:!1},maxParamLength:{type:"integer",default:100},allowUnsafeRegex:{type:"boolean",default:!1},useSemicolonDelimiter:{type:"boolean",default:!1}}},constraints:{type:"object",additionalProperties:{type:"object",required:["name","storage","validate","deriveConstraint"],additionalProperties:!0,properties:{name:{type:"string"},storage:{},validate:{},deriveConstraint:{}}}}}},C6=Object.prototype.hasOwnProperty,I6=new RegExp("idle","u");function ae(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0;if(o===0)if(t&&typeof t=="object"&&!Array.isArray(t)){t.connectionTimeout===void 0&&(t.connectionTimeout=0),t.keepAliveTimeout===void 0&&(t.keepAliveTimeout=72e3),t.maxRequestsPerSocket===void 0&&(t.maxRequestsPerSocket=0),t.requestTimeout===void 0&&(t.requestTimeout=0),t.bodyLimit===void 0&&(t.bodyLimit=1048576),t.caseSensitive===void 0&&(t.caseSensitive=!0),t.allowUnsafeRegex===void 0&&(t.allowUnsafeRegex=!1),t.ignoreTrailingSlash===void 0&&(t.ignoreTrailingSlash=!1),t.ignoreDuplicateSlashes===void 0&&(t.ignoreDuplicateSlashes=!1),t.disableRequestLogging===void 0&&(t.disableRequestLogging=!1),t.maxParamLength===void 0&&(t.maxParamLength=100),t.onProtoPoisoning===void 0&&(t.onProtoPoisoning="error"),t.onConstructorPoisoning===void 0&&(t.onConstructorPoisoning="error"),t.pluginTimeout===void 0&&(t.pluginTimeout=1e4),t.requestIdHeader===void 0&&(t.requestIdHeader=!1),t.requestIdLogLabel===void 0&&(t.requestIdLogLabel="reqId"),t.http2SessionTimeout===void 0&&(t.http2SessionTimeout=72e3),t.exposeHeadRoutes===void 0&&(t.exposeHeadRoutes=!0),t.useSemicolonDelimiter===void 0&&(t.useSemicolonDelimiter=!1);let m=o;for(let g in t)C6.call(A6.properties,g)||delete t[g];if(m===o){let g=t.connectionTimeout,S=o;if(!(typeof g=="number"&&!(g%1)&&!isNaN(g)&&isFinite(g))){let b=typeof g,_;if(_===void 0)if(b==="boolean"||g===null||b==="string"&&g&&g==+g&&!(g%1))_=+g;else return ae.errors=[{instancePath:e+"/connectionTimeout",schemaPath:"#/properties/connectionTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;_!==void 0&&(g=_,t!==void 0&&(t.connectionTimeout=_))}var a=S===o;if(a){let b=t.keepAliveTimeout,_=o;if(!(typeof b=="number"&&!(b%1)&&!isNaN(b)&&isFinite(b))){let R=typeof b,T;if(T===void 0)if(R==="boolean"||b===null||R==="string"&&b&&b==+b&&!(b%1))T=+b;else return ae.errors=[{instancePath:e+"/keepAliveTimeout",schemaPath:"#/properties/keepAliveTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;T!==void 0&&(b=T,t!==void 0&&(t.keepAliveTimeout=T))}var a=_===o;if(a){if(t.forceCloseConnections!==void 0){let R=t.forceCloseConnections,T=o,O=o,w=!1,$=null,v=o;if(typeof R!="string"){let k=typeof R,M;if(M===void 0)if(k=="number"||k=="boolean")M=""+R;else if(R===null)M="";else{let J={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[J]:i.push(J),o++}M!==void 0&&(R=M,t!==void 0&&(t.forceCloseConnections=M))}if(o===v&&typeof R=="string"&&!I6.test(R)){let k={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/0/pattern",keyword:"pattern",params:{pattern:"idle"},message:'must match pattern "idle"'};i===null?i=[k]:i.push(k),o++}var l=v===o;l&&(w=!0,$=0);let P=o;if(typeof R!="boolean"){let k;if(k===void 0)if(R==="false"||R===0||R===null)k=!1;else if(R==="true"||R===1)k=!0;else{let M={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf/1/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};i===null?i=[M]:i.push(M),o++}k!==void 0&&(R=k,t!==void 0&&(t.forceCloseConnections=k))}var l=P===o;if(l&&w?(w=!1,$=[$,1]):l&&(w=!0,$=1),w)o=O,i!==null&&(O?i.length=O:i=null);else{let k={instancePath:e+"/forceCloseConnections",schemaPath:"#/properties/forceCloseConnections/oneOf",keyword:"oneOf",params:{passingSchemas:$},message:"must match exactly one schema in oneOf"};return i===null?i=[k]:i.push(k),o++,ae.errors=i,!1}var a=T===o}else var a=!0;if(a){let R=t.maxRequestsPerSocket,T=o;if(!(typeof R=="number"&&!(R%1)&&!isNaN(R)&&isFinite(R))&&R!==null){let w=typeof R,$;if($===void 0)if(w==="boolean"||R===null||w==="string"&&R&&R==+R&&!(R%1))$=+R;else if(R===""||R===0||R===!1)$=null;else return ae.errors=[{instancePath:e+"/maxRequestsPerSocket",schemaPath:"#/properties/maxRequestsPerSocket/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;$!==void 0&&(R=$,t!==void 0&&(t.maxRequestsPerSocket=$))}var a=T===o;if(a){let w=t.requestTimeout,$=o;if(!(typeof w=="number"&&!(w%1)&&!isNaN(w)&&isFinite(w))){let P=typeof w,C;if(C===void 0)if(P==="boolean"||w===null||P==="string"&&w&&w==+w&&!(w%1))C=+w;else return ae.errors=[{instancePath:e+"/requestTimeout",schemaPath:"#/properties/requestTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;C!==void 0&&(w=C,t!==void 0&&(t.requestTimeout=C))}var a=$===o;if(a){let P=t.bodyLimit,C=o;if(!(typeof P=="number"&&!(P%1)&&!isNaN(P)&&isFinite(P))){let M=typeof P,J;if(J===void 0)if(M==="boolean"||P===null||M==="string"&&P&&P==+P&&!(P%1))J=+P;else return ae.errors=[{instancePath:e+"/bodyLimit",schemaPath:"#/properties/bodyLimit/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;J!==void 0&&(P=J,t!==void 0&&(t.bodyLimit=J))}var a=C===o;if(a){let M=t.caseSensitive,J=o;if(typeof M!="boolean"){let H;if(H===void 0)if(M==="false"||M===0||M===null)H=!1;else if(M==="true"||M===1)H=!0;else return ae.errors=[{instancePath:e+"/caseSensitive",schemaPath:"#/properties/caseSensitive/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;H!==void 0&&(M=H,t!==void 0&&(t.caseSensitive=H))}var a=J===o;if(a){let H=t.allowUnsafeRegex,fe=o;if(typeof H!="boolean"){let G;if(G===void 0)if(H==="false"||H===0||H===null)G=!1;else if(H==="true"||H===1)G=!0;else return ae.errors=[{instancePath:e+"/allowUnsafeRegex",schemaPath:"#/properties/allowUnsafeRegex/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;G!==void 0&&(H=G,t!==void 0&&(t.allowUnsafeRegex=G))}var a=fe===o;if(a){if(t.http2!==void 0){let G=t.http2,Rt=o;if(typeof G!="boolean"){let me;if(me===void 0)if(G==="false"||G===0||G===null)me=!1;else if(G==="true"||G===1)me=!0;else return ae.errors=[{instancePath:e+"/http2",schemaPath:"#/properties/http2/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;me!==void 0&&(G=me,t!==void 0&&(t.http2=me))}var a=Rt===o}else var a=!0;if(a){if(t.https!==void 0){let G=t.https,Rt=o,Lr=o,me=!0,pe=o,Hn=o,A=o,N=o,q=!1,j=null,ue=o;if(typeof G!="boolean"){let Y;if(Y===void 0)if(G==="false"||G===0||G===null)Y=!1;else if(G==="true"||G===1)Y=!0;else{let $t={};i===null?i=[$t]:i.push($t),o++}Y!==void 0&&(G=Y,t!==void 0&&(t.https=Y))}var u=ue===o;u&&(q=!0,j=0);let de=o;if(G!==null){let Y;if(Y===void 0)if(G===""||G===0||G===!1)Y=null;else{let $t={};i===null?i=[$t]:i.push($t),o++}Y!==void 0&&(G=Y,t!==void 0&&(t.https=Y))}var u=de===o;if(u&&q)q=!1,j=[j,1];else{u&&(q=!0,j=1);let Y=o;if(o===Y)if(G&&typeof G=="object"&&!Array.isArray(G)){let Pe;if(G.allowHTTP1===void 0&&(Pe="allowHTTP1")){let ht={};i===null?i=[ht]:i.push(ht),o++}else{let ht=o;for(let Qt in G)Qt!=="allowHTTP1"&&delete G[Qt];if(ht===o&&G.allowHTTP1!==void 0){let Qt=G.allowHTTP1;if(typeof Qt!="boolean"){let Ae;if(Ae===void 0)if(Qt==="false"||Qt===0||Qt===null)Ae=!1;else if(Qt==="true"||Qt===1)Ae=!0;else{let Zt={};i===null?i=[Zt]:i.push(Zt),o++}Ae!==void 0&&(Qt=Ae,G!==void 0&&(G.allowHTTP1=Ae))}}}}else{let Pe={};i===null?i=[Pe]:i.push(Pe),o++}var u=Y===o;u&&q?(q=!1,j=[j,2]):u&&(q=!0,j=2)}if(q)o=N,i!==null&&(N?i.length=N:i=null);else{let Y={};i===null?i=[Y]:i.push(Y),o++}var c=A===o;if(c){let Y={};i===null?i=[Y]:i.push(Y),o++}else o=Hn,i!==null&&(Hn?i.length=Hn:i=null);var f=pe===o;if(o=Lr,i!==null&&(Lr?i.length=Lr:i=null),f){let Y=o;t.https=!0;var f=Y===o;me=f}if(!me){let Y={instancePath:e+"/https",schemaPath:"#/properties/https/if",keyword:"if",params:{failingKeyword:"then"},message:'must match "then" schema'};return i===null?i=[Y]:i.push(Y),o++,ae.errors=i,!1}var a=Rt===o}else var a=!0;if(a){let G=t.ignoreTrailingSlash,Rt=o;if(typeof G!="boolean"){let me;if(me===void 0)if(G==="false"||G===0||G===null)me=!1;else if(G==="true"||G===1)me=!0;else return ae.errors=[{instancePath:e+"/ignoreTrailingSlash",schemaPath:"#/properties/ignoreTrailingSlash/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;me!==void 0&&(G=me,t!==void 0&&(t.ignoreTrailingSlash=me))}var a=Rt===o;if(a){let me=t.ignoreDuplicateSlashes,pe=o;if(typeof me!="boolean"){let A;if(A===void 0)if(me==="false"||me===0||me===null)A=!1;else if(me==="true"||me===1)A=!0;else return ae.errors=[{instancePath:e+"/ignoreDuplicateSlashes",schemaPath:"#/properties/ignoreDuplicateSlashes/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;A!==void 0&&(me=A,t!==void 0&&(t.ignoreDuplicateSlashes=A))}var a=pe===o;if(a){let A=t.maxParamLength,N=o;if(!(typeof A=="number"&&!(A%1)&&!isNaN(A)&&isFinite(A))){let j=typeof A,ue;if(ue===void 0)if(j==="boolean"||A===null||j==="string"&&A&&A==+A&&!(A%1))ue=+A;else return ae.errors=[{instancePath:e+"/maxParamLength",schemaPath:"#/properties/maxParamLength/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;ue!==void 0&&(A=ue,t!==void 0&&(t.maxParamLength=ue))}var a=N===o;if(a){let j=t.onProtoPoisoning,ue=o;if(typeof j!="string"){let Me=typeof j,Y;if(Y===void 0)if(Me=="number"||Me=="boolean")Y=""+j;else if(j===null)Y="";else return ae.errors=[{instancePath:e+"/onProtoPoisoning",schemaPath:"#/properties/onProtoPoisoning/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;Y!==void 0&&(j=Y,t!==void 0&&(t.onProtoPoisoning=Y))}var a=ue===o;if(a){let Me=t.onConstructorPoisoning,Y=o;if(typeof Me!="string"){let Pe=typeof Me,ht;if(ht===void 0)if(Pe=="number"||Pe=="boolean")ht=""+Me;else if(Me===null)ht="";else return ae.errors=[{instancePath:e+"/onConstructorPoisoning",schemaPath:"#/properties/onConstructorPoisoning/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;ht!==void 0&&(Me=ht,t!==void 0&&(t.onConstructorPoisoning=ht))}var a=Y===o;if(a){let Pe=t.pluginTimeout,ht=o;if(!(typeof Pe=="number"&&!(Pe%1)&&!isNaN(Pe)&&isFinite(Pe))){let Ae=typeof Pe,Zt;if(Zt===void 0)if(Ae==="boolean"||Pe===null||Ae==="string"&&Pe&&Pe==+Pe&&!(Pe%1))Zt=+Pe;else return ae.errors=[{instancePath:e+"/pluginTimeout",schemaPath:"#/properties/pluginTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;Zt!==void 0&&(Pe=Zt,t!==void 0&&(t.pluginTimeout=Zt))}var a=ht===o;if(a){let Ae=t.requestIdHeader,Zt=o,ju=o,Vn=!1,JA=o;if(typeof Ae!="boolean"){let Ue;if(Ue===void 0)if(Ae==="false"||Ae===0||Ae===null)Ue=!1;else if(Ae==="true"||Ae===1)Ue=!0;else{let ko={instancePath:e+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/0/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};i===null?i=[ko]:i.push(ko),o++}Ue!==void 0&&(Ae=Ue,t!==void 0&&(t.requestIdHeader=Ue))}var p=JA===o;if(Vn=Vn||p,!Vn){let Ue=o;if(typeof Ae!="string"){let ig=typeof Ae,Ce;if(Ce===void 0)if(ig=="number"||ig=="boolean")Ce=""+Ae;else if(Ae===null)Ce="";else{let Vt={instancePath:e+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[Vt]:i.push(Vt),o++}Ce!==void 0&&(Ae=Ce,t!==void 0&&(t.requestIdHeader=Ce))}var p=Ue===o;Vn=Vn||p}if(Vn)o=ju,i!==null&&(ju?i.length=ju:i=null);else{let Ue={instancePath:e+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[Ue]:i.push(Ue),o++,ae.errors=i,!1}var a=Zt===o;if(a){let Ue=t.requestIdLogLabel,ko=o;if(typeof Ue!="string"){let Ce=typeof Ue,Vt;if(Vt===void 0)if(Ce=="number"||Ce=="boolean")Vt=""+Ue;else if(Ue===null)Vt="";else return ae.errors=[{instancePath:e+"/requestIdLogLabel",schemaPath:"#/properties/requestIdLogLabel/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;Vt!==void 0&&(Ue=Vt,t!==void 0&&(t.requestIdLogLabel=Vt))}var a=ko===o;if(a){let Ce=t.http2SessionTimeout,Vt=o;if(!(typeof Ce=="number"&&!(Ce%1)&&!isNaN(Ce)&&isFinite(Ce))){let er=typeof Ce,un;if(un===void 0)if(er==="boolean"||Ce===null||er==="string"&&Ce&&Ce==+Ce&&!(Ce%1))un=+Ce;else return ae.errors=[{instancePath:e+"/http2SessionTimeout",schemaPath:"#/properties/http2SessionTimeout/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;un!==void 0&&(Ce=un,t!==void 0&&(t.http2SessionTimeout=un))}var a=Vt===o;if(a){let er=t.exposeHeadRoutes,un=o;if(typeof er!="boolean"){let pt;if(pt===void 0)if(er==="false"||er===0||er===null)pt=!1;else if(er==="true"||er===1)pt=!0;else return ae.errors=[{instancePath:e+"/exposeHeadRoutes",schemaPath:"#/properties/exposeHeadRoutes/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;pt!==void 0&&(er=pt,t!==void 0&&(t.exposeHeadRoutes=pt))}var a=un===o;if(a){let pt=t.useSemicolonDelimiter,KA=o;if(typeof pt!="boolean"){let Q;if(Q===void 0)if(pt==="false"||pt===0||pt===null)Q=!1;else if(pt==="true"||pt===1)Q=!0;else return ae.errors=[{instancePath:e+"/useSemicolonDelimiter",schemaPath:"#/properties/useSemicolonDelimiter/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;Q!==void 0&&(pt=Q,t!==void 0&&(t.useSemicolonDelimiter=Q))}var a=KA===o;if(a){if(t.routerOptions!==void 0){let Q=t.routerOptions,Gs=o;if(o===Gs)if(Q&&typeof Q=="object"&&!Array.isArray(Q)){Q.ignoreTrailingSlash===void 0&&(Q.ignoreTrailingSlash=!1),Q.ignoreDuplicateSlashes===void 0&&(Q.ignoreDuplicateSlashes=!1),Q.maxParamLength===void 0&&(Q.maxParamLength=100),Q.allowUnsafeRegex===void 0&&(Q.allowUnsafeRegex=!1),Q.useSemicolonDelimiter===void 0&&(Q.useSemicolonDelimiter=!1);let Pt=Q.ignoreTrailingSlash,Ot=o;if(typeof Pt!="boolean"){let Be;if(Be===void 0)if(Pt==="false"||Pt===0||Pt===null)Be=!1;else if(Pt==="true"||Pt===1)Be=!0;else return ae.errors=[{instancePath:e+"/routerOptions/ignoreTrailingSlash",schemaPath:"#/properties/routerOptions/properties/ignoreTrailingSlash/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;Be!==void 0&&(Pt=Be,Q!==void 0&&(Q.ignoreTrailingSlash=Be))}var h=Ot===o;if(h){let Be=Q.ignoreDuplicateSlashes,qr=o;if(typeof Be!="boolean"){let Ie;if(Ie===void 0)if(Be==="false"||Be===0||Be===null)Ie=!1;else if(Be==="true"||Be===1)Ie=!0;else return ae.errors=[{instancePath:e+"/routerOptions/ignoreDuplicateSlashes",schemaPath:"#/properties/routerOptions/properties/ignoreDuplicateSlashes/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;Ie!==void 0&&(Be=Ie,Q!==void 0&&(Q.ignoreDuplicateSlashes=Ie))}var h=qr===o;if(h){let Ie=Q.maxParamLength,jr=o;if(!(typeof Ie=="number"&&!(Ie%1)&&!isNaN(Ie)&&isFinite(Ie))){let tr=typeof Ie,cn;if(cn===void 0)if(tr==="boolean"||Ie===null||tr==="string"&&Ie&&Ie==+Ie&&!(Ie%1))cn=+Ie;else return ae.errors=[{instancePath:e+"/routerOptions/maxParamLength",schemaPath:"#/properties/routerOptions/properties/maxParamLength/type",keyword:"type",params:{type:"integer"},message:"must be integer"}],!1;cn!==void 0&&(Ie=cn,Q!==void 0&&(Q.maxParamLength=cn))}var h=jr===o;if(h){let tr=Q.allowUnsafeRegex,cn=o;if(typeof tr!="boolean"){let mt;if(mt===void 0)if(tr==="false"||tr===0||tr===null)mt=!1;else if(tr==="true"||tr===1)mt=!0;else return ae.errors=[{instancePath:e+"/routerOptions/allowUnsafeRegex",schemaPath:"#/properties/routerOptions/properties/allowUnsafeRegex/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;mt!==void 0&&(tr=mt,Q!==void 0&&(Q.allowUnsafeRegex=mt))}var h=cn===o;if(h){let mt=Q.useSemicolonDelimiter,YA=o;if(typeof mt!="boolean"){let zn;if(zn===void 0)if(mt==="false"||mt===0||mt===null)zn=!1;else if(mt==="true"||mt===1)zn=!0;else return ae.errors=[{instancePath:e+"/routerOptions/useSemicolonDelimiter",schemaPath:"#/properties/routerOptions/properties/useSemicolonDelimiter/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;zn!==void 0&&(mt=zn,Q!==void 0&&(Q.useSemicolonDelimiter=zn))}var h=YA===o}}}}}else return ae.errors=[{instancePath:e+"/routerOptions",schemaPath:"#/properties/routerOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=Gs===o}else var a=!0;if(a)if(t.constraints!==void 0){let Q=t.constraints,Gs=o;if(o===Gs)if(Q&&typeof Q=="object"&&!Array.isArray(Q))for(let Pt in Q){let Ot=Q[Pt],Be=o;if(o===Be)if(Ot&&typeof Ot=="object"&&!Array.isArray(Ot)){let qr;if(Ot.name===void 0&&(qr="name")||Ot.storage===void 0&&(qr="storage")||Ot.validate===void 0&&(qr="validate")||Ot.deriveConstraint===void 0&&(qr="deriveConstraint"))return ae.errors=[{instancePath:e+"/constraints/"+Pt.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/constraints/additionalProperties/required",keyword:"required",params:{missingProperty:qr},message:"must have required property '"+qr+"'"}],!1;if(Ot.name!==void 0){let Ws=Ot.name;if(typeof Ws!="string"){let Ie=typeof Ws,jr;if(jr===void 0)if(Ie=="number"||Ie=="boolean")jr=""+Ws;else if(Ws===null)jr="";else return ae.errors=[{instancePath:e+"/constraints/"+Pt.replace(/~/g,"~0").replace(/\//g,"~1")+"/name",schemaPath:"#/properties/constraints/additionalProperties/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;jr!==void 0&&(Ws=jr,Ot!==void 0&&(Ot.name=jr))}}}else return ae.errors=[{instancePath:e+"/constraints/"+Pt.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/constraints/additionalProperties/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var d=Be===o;if(!d)break}else return ae.errors=[{instancePath:e+"/constraints",schemaPath:"#/properties/constraints/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var a=Gs===o}else var a=!0}}}}}}}}}}}}}}}}}}}}}}}else return ae.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return ae.errors=i,o===0}mu.exports.defaultInitOptions={connectionTimeout:0,keepAliveTimeout:72e3,maxRequestsPerSocket:0,requestTimeout:0,bodyLimit:1048576,caseSensitive:!0,allowUnsafeRegex:!1,disableRequestLogging:!1,ignoreTrailingSlash:!1,ignoreDuplicateSlashes:!1,maxParamLength:100,onProtoPoisoning:"error",onConstructorPoisoning:"error",pluginTimeout:1e4,requestIdHeader:!1,requestIdLogLabel:"reqId",http2SessionTimeout:72e3,exposeHeadRoutes:!0,useSemicolonDelimiter:!1,allowErrorHandlerOverride:!0,routerOptions:{ignoreTrailingSlash:!1,ignoreDuplicateSlashes:!1,maxParamLength:100,allowUnsafeRegex:!1,useSemicolonDelimiter:!1}}});var AP=E((EQ,yu)=>{"use strict";var gu=PP(),N6=ya()({circles:!0,proto:!1}),{FST_ERR_INIT_OPTS_INVALID:k6}=He();function x6(t){let e=N6(t);if(!gu(e)){let r=new k6(JSON.stringify(gu.errors.map(n=>n.message)));throw r.errors=gu.errors,r}return $m(e)}function $m(t){let e=Object.getOwnPropertyNames(t);for(let r of e){let n=t[r];ArrayBuffer.isView(n)&&!(n instanceof DataView)||(t[r]=n&&typeof n=="object"?$m(n):n)}return Object.freeze(t)}yu.exports=x6;yu.exports.defaultInitOptions=gu.defaultInitOptions;yu.exports.utils={deepFreezeObject:$m}});var DP=E((bQ,jP)=>{"use strict";var{kAvvioBoot:L6,kChildren:CP,kRoutePrefix:IP,kLogLevel:NP,kLogSerializers:Pm,kHooks:Am,kSchemaController:Vs,kContentTypeParser:kP,kReply:xP,kRequest:LP,kFourOhFour:q6,kPluginNameChain:qP,kErrorHandlerAlreadySet:j6}=De(),D6=Aa(),F6=La(),M6=kp(),H6=Vf(),{buildHooks:V6}=Fr(),vo=sm();jP.exports=function(e,r,n){let s=vo.registerPlugin.call(e,r),i=vo.getPluginName(r)||vo.getFuncPreview(r);if(s)return e[qP].push(i),e;let o=Object.create(e);e[CP].push(o),o.ready=e[L6].bind(o),o[CP]=[],o[xP]=D6.buildReply(o[xP]),o[LP]=F6.buildRequest(o[LP]),o[kP]=H6.helpers.buildContentTypeParser(o[kP]),o[Am]=V6(o[Am]),o[IP]=z6(o[IP],n.prefix),o[NP]=n.logLevel||o[NP],o[Vs]=M6.buildSchemaController(e[Vs]),o.getSchema=o[Vs].getSchema.bind(o[Vs]),o.getSchemas=o[Vs].getSchemas.bind(o[Vs]),o[vo.kRegisteredPlugins]=Object.create(o[vo.kRegisteredPlugins]),o[qP]=[i],o[j6]=!1,(o[Pm]||n.logSerializers)&&(o[Pm]=Object.assign(Object.create(o[Pm]),n.logSerializers)),n.prefix&&o[q6].arrange404(o);for(let a of o[Am].onRegister)a.call(e,o,n);return o};function z6(t,e){return e?(t.endsWith("/")&&e[0]==="/"?e=e.slice(1):e[0]!=="/"&&(e="/"+e),t+e):t}});var zP=E(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.parseCookie=HP;yr.parse=HP;yr.stringifyCookie=K6;yr.stringifySetCookie=_u;yr.serialize=_u;yr.parseSetCookie=Y6;yr.stringifySetCookie=_u;yr.serialize=_u;var FP=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,MP=/^[\u0021-\u003A\u003C-\u007E]*$/,U6=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,B6=/^[\u0020-\u003A\u003D-\u007E]*$/,G6=/^-?\d+$/,W6=Object.prototype.toString,J6=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function HP(t,e){let r=new J6,n=t.length;if(n<2)return r;let s=e?.decode||VP,i=0;do{let o=Im(t,i,n);if(o===-1)break;let a=Cm(t,i,n);if(o>a){i=t.lastIndexOf(";",o-1)+1;continue}let l=sn(t,i,o);r[l]===void 0&&(r[l]=s(sn(t,o+1,a))),i=a+1}while(i<n);return r}function K6(t,e){let r=e?.encode||encodeURIComponent,n=[];for(let s of Object.keys(t)){let i=t[s];if(i===void 0)continue;if(!FP.test(s))throw new TypeError(`cookie name is invalid: ${s}`);let o=r(i);if(!MP.test(o))throw new TypeError(`cookie val is invalid: ${i}`);n.push(`${s}=${o}`)}return n.join("; ")}function _u(t,e,r){let n=typeof t=="object"?t:{...r,name:t,value:String(e)},i=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!FP.test(n.name))throw new TypeError(`argument name is invalid: ${n.name}`);let o=n.value?i(n.value):"";if(!MP.test(o))throw new TypeError(`argument val is invalid: ${n.value}`);let a=n.name+"="+o;if(n.maxAge!==void 0){if(!Number.isInteger(n.maxAge))throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);a+="; Max-Age="+n.maxAge}if(n.domain){if(!U6.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);a+="; Domain="+n.domain}if(n.path){if(!B6.test(n.path))throw new TypeError(`option path is invalid: ${n.path}`);a+="; Path="+n.path}if(n.expires){if(!X6(n.expires)||!Number.isFinite(n.expires.valueOf()))throw new TypeError(`option expires is invalid: ${n.expires}`);a+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(a+="; HttpOnly"),n.secure&&(a+="; Secure"),n.partitioned&&(a+="; Partitioned"),n.priority)switch(typeof n.priority=="string"?n.priority.toLowerCase():void 0){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${n.priority}`)}if(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"none":a+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${n.sameSite}`)}return a}function Y6(t,e){let r=e?.decode||VP,n=t.length,s=Cm(t,0,n),i=Im(t,0,s),o=i===-1?{name:"",value:r(sn(t,0,s))}:{name:sn(t,0,i),value:r(sn(t,i+1,s))},a=s+1;for(;a<n;){let l=Cm(t,a,n),u=Im(t,a,l),c=u===-1?sn(t,a,l):sn(t,a,u),f=u===-1?void 0:sn(t,u+1,l);switch(c.toLowerCase()){case"httponly":o.httpOnly=!0;break;case"secure":o.secure=!0;break;case"partitioned":o.partitioned=!0;break;case"domain":o.domain=f;break;case"path":o.path=f;break;case"max-age":f&&G6.test(f)&&(o.maxAge=Number(f));break;case"expires":if(!f)break;let p=new Date(f);Number.isFinite(p.valueOf())&&(o.expires=p);break;case"priority":if(!f)break;let h=f.toLowerCase();(h==="low"||h==="medium"||h==="high")&&(o.priority=h);break;case"samesite":if(!f)break;let d=f.toLowerCase();(d==="lax"||d==="strict"||d==="none")&&(o.sameSite=d);break}a=l+1}return o}function Cm(t,e,r){let n=t.indexOf(";",e);return n===-1?r:n}function Im(t,e,r){let n=t.indexOf("=",e);return n<r?n:-1}function sn(t,e,r){let n=e,s=r;do{let i=t.charCodeAt(n);if(i!==32&&i!==9)break}while(++n<s);for(;s>n;){let i=t.charCodeAt(s-1);if(i!==32&&i!==9)break;s--}return t.slice(n,s)}function VP(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function X6(t){return W6.call(t)==="[object Date]"}});var BP=E((wQ,Su)=>{"use strict";var{format:Nm}=V("node:util");function Q6(t){return UP({...t,name:"DeprecationWarning"})}function UP({name:t,code:e,message:r,unlimited:n=!1}={}){if(!t)throw new Error("Warning name must not be empty");if(!e)throw new Error("Warning code must not be empty");if(!r)throw new Error("Warning message must not be empty");if(typeof n!="boolean")throw new Error("Warning opts.unlimited must be a boolean");e=e.toUpperCase();let s={[t]:function(o,a,l){i.emitted===!0&&i.unlimited!==!0||(i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code))}};n&&(s={[t]:function(o,a,l){i.emitted=!0,process.emitWarning(i.format(o,a,l),i.name,i.code)}});let i=s[t];return i.emitted=!1,i.message=r,i.unlimited=n,i.code=e,i.format=function(o,a,l){let u;return o&&a&&l?u=Nm(r,o,a,l):o&&a?u=Nm(r,o,a):o?u=Nm(r,o):u=r,u},i}var km={createWarning:UP,createDeprecation:Q6};Su.exports=km;Su.exports.default=km;Su.exports.processWarning=km});var JP=E((RQ,WP)=>{"use strict";var{URL:GP}=V("node:url"),xm="http://localhost";WP.exports=function(e,r){(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]")&&e.startsWith("//")&&(e=xm+e);let n=typeof e=="object"?Object.assign(new GP(xm),e):new GP(e,xm);if(typeof r=="string"){r=new URLSearchParams(r);for(let s of r.keys()){n.searchParams.delete(s);for(let i of r.getAll(s))n.searchParams.append(s,i)}}else{let s=Object.assign({},e.query,r);for(let i in s){let o=s[i];if(Array.isArray(o)){n.searchParams.delete(i);for(let a of o)n.searchParams.append(i,a)}else n.searchParams.set(i,o)}}return n}});var KP=E((OQ,Lm)=>{"use strict";var{randomUUID:Z6}=V("node:crypto"),{Readable:eW}=V("node:stream"),zs;function tW(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}function rW(t){zs=zs??new TextEncoder;let e=`----formdata-${Z6()}`,r=`--${e}\r
367
367
  Content-Disposition: form-data`;let n=l=>l.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),s=l=>l.replace(/\r?\n|\r/g,`\r
368
368
  `),i=new Uint8Array([13,10]);async function*o(){for(let[l,u]of t)if(typeof u=="string")yield zs.encode(`${r}; name="${n(s(l))}"\r
369
369
  \r
@@ -371,27 +371,27 @@ Content-Disposition: form-data`;let n=l=>l.replace(/\n/g,"%0A").replace(/\r/g,"%
371
371
  `);else{let c=`${r}; name="${n(s(l))}"`;u.name&&(c+=`; filename="${n(u.name)}"`),c+=`\r
372
372
  Content-Type: ${u.type||"application/octet-stream"}\r
373
373
  \r
374
- `,yield zs.encode(c),u.stream?yield*u.stream():yield u,yield i}yield zs.encode(`--${e}--`)}return{stream:K6.from(o()),contentType:`multipart/form-data; boundary=${e}`}}xm.exports.isFormDataLike=Y6;xm.exports.formDataToStream=X6});var XP=E((_Q,Su)=>{"use strict";var{Readable:KP,addAbortSignal:Q6}=V("node:stream"),qm=V("node:util"),Z6=VP(),eW=V("node:assert"),{createDeprecation:tW}=UP(),rW=WP(),{isFormDataLike:nW,formDataToStream:sW}=JP(),{EventEmitter:iW}=V("node:events"),oW=tW({name:"FastifyDeprecationLightMyRequest",code:"FST_LIGHTMYREQUEST_DEP01",message:'You are accessing "request.connection", use "request.socket" instead.'});function aW(t){return t.port?t.host:t.hostname+(t.protocol==="https:"?":443":":80")}var Lm=class extends iW{constructor(e){super(),this.remoteAddress=e}};function YP(t){return new e(this);function e(r){on.call(r,{...t,Request:void 0}),Object.assign(this,r);for(let n of Object.keys(on.prototype))this.constructor.prototype[n]=on.prototype[n];return qm.inherits(this.constructor,t.Request),this}}function on(t){KP.call(this,{autoDestroy:!1});let e=rW(t.url||t.path,t.query);this.url=e.pathname+e.search,this.aborted=!1,this.httpVersionMajor=1,this.httpVersionMinor=1,this.httpVersion="1.1",this.method=t.method?t.method.toUpperCase():"GET",this.headers={},this.rawHeaders=[];let r=t.headers||{};for(let o in r){let a=o.toLowerCase();if((a==="user-agent"||a==="content-type")&&r[o]===void 0){this.headers[a]=void 0;continue}let l=r[o];eW(l!==void 0,'invalid value "undefined" for header '+o),this.headers[a]=""+l}if("user-agent"in this.headers||(this.headers["user-agent"]="lightMyRequest"),this.headers.host=this.headers.host||t.authority||aW(e),t.cookies){let{cookies:o}=t,a=Object.keys(o).map(l=>Z6.serialize(l,o[l]));this.headers.cookie&&a.unshift(this.headers.cookie),this.headers.cookie=a.join("; ")}this.socket=new Lm(t.remoteAddress||"127.0.0.1"),Object.defineProperty(this,"connection",{get(){return oW(),this.socket},configurable:!0});let n=t.payload||t.body||null,s=n&&typeof n.resume=="function";if(nW(n)){let o=sW(n);n=o.stream,s=!0,this.headers["content-type"]=o.contentType,this.headers["transfer-encoding"]="chunked"}n&&typeof n!="string"&&!s&&!Buffer.isBuffer(n)&&(n=JSON.stringify(n),"content-type"in this.headers||(this.headers["content-type"]="application/json")),n&&!s&&!Object.hasOwn(this.headers,"content-length")&&(this.headers["content-length"]=(Buffer.isBuffer(n)?n.length:Buffer.byteLength(n)).toString());for(let o of Object.keys(this.headers))this.rawHeaders.push(o,this.headers[o]);this._lightMyRequest={payload:n,isDone:!1,simulate:t.simulate||{},payloadAsStream:t.payloadAsStream,signal:t.signal};let i=t.signal;i&&Q6(i,this);{let o=this._lightMyRequest.payload;o?._readableState?(this._read=lW,o.on("error",a=>{this.destroy(a)}),o.on("end",()=>{this.push(null)})):this._read=uW}return this}function lW(){let t=this._lightMyRequest.payload,e=!0,r=!1,n;for(;e&&(n=t.read());)r=!0,e=this.push(n);e&&!r&&this._lightMyRequest.payload.once("readable",this._read.bind(this))}function uW(){setImmediate(()=>{if(this._lightMyRequest.isDone){this._lightMyRequest.simulate.end!==!1&&this.push(null);return}this._lightMyRequest.isDone=!0,this._lightMyRequest.payload&&(this._lightMyRequest.simulate.split?(this.push(this._lightMyRequest.payload.slice(0,1)),this.push(this._lightMyRequest.payload.slice(1))):this.push(this._lightMyRequest.payload)),this._lightMyRequest.simulate.error&&this.emit("error",new Error("Simulated")),this._lightMyRequest.simulate.close&&this.emit("close"),this._lightMyRequest.simulate.end!==!1&&this.push(null)})}qm.inherits(on,KP);qm.inherits(YP,on);on.prototype.destroy=function(t){this.destroyed||this._lightMyRequest.isDone||(this.destroyed=!0,t&&(this._error=!0,process.nextTick(()=>this.emit("error",t))),process.nextTick(()=>this.emit("close")))};Su.exports=on;Su.exports.Request=on;Su.exports.CustomRequest=YP});var ZP=E((SQ,vo)=>{"use strict";var Eu={decodeValues:!0,map:!1,silent:!1};function jm(t){return typeof t!="string"||t in{}}function Dm(){return Object.create(null)}function Fm(t){return typeof t=="string"&&!!t.trim()}function Mm(t,e){var r=t.split(";").filter(Fm),n=r.shift(),s=cW(n),i=s.name,o=s.value;if(e=e?Object.assign({},Eu,e):Eu,jm(i))return null;try{o=e.decodeValues?decodeURIComponent(o):o}catch(l){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",l)}var a=Dm();return a.name=i,a.value=o,r.forEach(function(l){var u=l.split("="),c=u.shift().trimLeft().toLowerCase();if(!jm(c)){var f=u.join("=");if(c==="expires")a.expires=new Date(f);else if(c==="max-age"){var p=parseInt(f,10);Number.isNaN(p)||(a.maxAge=p)}else c==="secure"?a.secure=!0:c==="httponly"?a.httpOnly=!0:c==="samesite"?a.sameSite=f:c==="partitioned"?a.partitioned=!0:c&&(a[c]=f)}}),a}function cW(t){var e="",r="",n=t.split("=");return n.length>1?(e=n.shift(),r=n.join("=")):r=t,{name:e,value:r}}function QP(t,e){if(e=e?Object.assign({},Eu,e):Eu,!t)return e.map?Dm():[];if(t.headers)if(typeof t.headers.getSetCookie=="function")t=t.headers.getSetCookie();else if(t.headers["set-cookie"])t=t.headers["set-cookie"];else{var r=t.headers[Object.keys(t.headers).find(function(s){return s.toLowerCase()==="set-cookie"})];!r&&t.headers.cookie&&!e.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),t=r}if(Array.isArray(t)||(t=[t]),e.map){var n=Dm();return t.filter(Fm).reduce(function(s,i){var o=Mm(i,e);return o&&!jm(o.name)&&(s[o.name]=o),s},n)}else return t.filter(Fm).map(function(s){return Mm(s,e)}).filter(Boolean)}function fW(t){if(Array.isArray(t))return t;if(typeof t!="string")return[];var e=[],r=0,n,s,i,o,a;function l(){for(;r<t.length&&/\s/.test(t.charAt(r));)r+=1;return r<t.length}function u(){return s=t.charAt(r),s!=="="&&s!==";"&&s!==","}for(;r<t.length;){for(n=r,a=!1;l();)if(s=t.charAt(r),s===","){for(i=r,r+=1,l(),o=r;r<t.length&&u();)r+=1;r<t.length&&t.charAt(r)==="="?(a=!0,r=o,e.push(t.substring(n,i)),n=r):r=i+1}else r+=1;(!a||r>=t.length)&&e.push(t.substring(n,t.length))}return e}vo.exports=QP;vo.exports.parse=QP;vo.exports.parseString=Mm;vo.exports.splitCookiesString=fW});var sA=E((EQ,nA)=>{"use strict";var wo=V("node:http"),{Writable:dW,Readable:eA,addAbortSignal:hW}=V("node:stream"),pW=V("node:util"),mW=ZP();function an(t,e,r){if(wo.ServerResponse.call(this,t),t._lightMyRequest?.payloadAsStream){let a=this.emit.bind(this,"drain");this._lightMyRequest={headers:null,trailers:{},stream:new eA({read:a})};let l=t._lightMyRequest.signal;l&&hW(l,this._lightMyRequest.stream)}else this._lightMyRequest={headers:null,trailers:{},payloadChunks:[]};this.setHeader("foo","bar"),this.removeHeader("foo"),this.assignSocket(gW()),this._promiseCallback=typeof r=="function";let n=!1,s=a=>{if(!n){if(n=!0,this._promiseCallback)return process.nextTick(()=>e(a));process.nextTick(()=>e(null,a))}};this._lightMyRequest.onEndSuccess=s;let i=!1,o=a=>{if(n){this._lightMyRequest.stream&&!i&&(a||(a=new Error("response destroyed before completion"),a.code="LIGHT_ECONNRESET"),this._lightMyRequest.stream.destroy(a),this._lightMyRequest.stream.on("error",()=>{}));return}if(n=!0,a||(a=new Error("response destroyed before completion"),a.code="LIGHT_ECONNRESET"),this._promiseCallback)return process.nextTick(()=>r(a));process.nextTick(()=>e(a,null))};this._lightMyRequest.stream?this.once("finish",()=>{i=!0,this._lightMyRequest.stream.push(null)}):this.once("finish",()=>{let a=tA(this);a.raw.req=t,s(a)}),this.connection.once("error",o),this.once("error",o),this.once("close",o)}pW.inherits(an,wo.ServerResponse);an.prototype.setTimeout=function(t,e){return this.timeoutHandle=setTimeout(()=>{this.emit("timeout")},t),this.on("timeout",e),this};an.prototype.writeHead=function(){let t=wo.ServerResponse.prototype.writeHead.apply(this,arguments);return rA(this),this._lightMyRequest.stream&&this._lightMyRequest.onEndSuccess(tA(this)),t};an.prototype.write=function(t,e,r){return this.timeoutHandle&&clearTimeout(this.timeoutHandle),wo.ServerResponse.prototype.write.call(this,t,e,r),this._lightMyRequest.stream?this._lightMyRequest.stream.push(Buffer.from(t,e)):(this._lightMyRequest.payloadChunks.push(Buffer.from(t,e)),!0)};an.prototype.end=function(t,e,r){t&&this.write(t,e),wo.ServerResponse.prototype.end.call(this,r),this.emit("finish"),this.destroy()};an.prototype.destroy=function(t){this.destroyed||(this.destroyed=!0,t&&process.nextTick(()=>this.emit("error",t)),process.nextTick(()=>this.emit("close")))};an.prototype.addTrailers=function(t){for(let e in t)this._lightMyRequest.trailers[e.toLowerCase().trim()]=t[e].toString().trim()};function tA(t){t._lightMyRequest.headers===null&&rA(t),yW(t);let e={raw:{res:t},headers:t._lightMyRequest.headers,statusCode:t.statusCode,statusMessage:t.statusMessage,trailers:{},get cookies(){return mW.parse(this)}};if(e.trailers=t._lightMyRequest.trailers,t._lightMyRequest.payloadChunks){let r=Buffer.concat(t._lightMyRequest.payloadChunks);e.rawPayload=r,e.payload=r.toString(),e.body=e.payload,e.json=function(){return JSON.parse(e.payload)}}else e.json=function(){throw new Error("Response payload is not available with payloadAsStream: true")};return e.stream=function(){return t._lightMyRequest.stream?t._lightMyRequest.stream:eA.from(t._lightMyRequest.payloadChunks)},e}function gW(){return new dW({write(t,e,r){setImmediate(r)}})}function yW(t){let e=t._lightMyRequest.headers;for(let r of Object.keys(e)){let n=e[r];Array.isArray(n)?e[r]=n.map(s=>""+s):e[r]=""+n}}function rA(t){t._lightMyRequest.headers=Object.assign({},t.getHeaders()),["Date","Connection","Transfer-Encoding"].forEach(e=>{let r=new RegExp("\\r\\n"+e+": ([^\\r]*)\\r\\n"),n=t._header?.match(r);n&&(t._lightMyRequest.headers[e.toLowerCase()]=n[1])})}nA.exports=an});var iA=E((bQ,Hm)=>{"use strict";Hm.exports=Fe;Hm.exports.default=Fe;var _W={type:"object",properties:{url:{oneOf:[{type:"string"},{type:"object",properties:{protocol:{type:"string"},hostname:{type:"string"},pathname:{type:"string"}},additionalProperties:!0,required:["pathname"]}]},path:{oneOf:[{type:"string"},{type:"object",properties:{protocol:{type:"string"},hostname:{type:"string"},pathname:{type:"string"}},additionalProperties:!0,required:["pathname"]}]},cookies:{type:"object",additionalProperties:!0},headers:{type:"object",additionalProperties:!0},query:{anyOf:[{type:"object",additionalProperties:!0},{type:"string"}]},simulate:{type:"object",properties:{end:{type:"boolean"},split:{type:"boolean"},error:{type:"boolean"},close:{type:"boolean"}}},authority:{type:"string"},remoteAddress:{type:"string"},method:{type:"string",enum:["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","QUERY","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE","acl","bind","checkout","connect","copy","delete","get","head","link","lock","m-search","merge","mkactivity","mkcalendar","mkcol","move","notify","options","patch","post","propfind","proppatch","purge","put","query","rebind","report","search","source","subscribe","trace","unbind","unlink","unlock","unsubscribe"]},validate:{type:"boolean"}},additionalProperties:!0,oneOf:[{required:["url"]},{required:["path"]}]};function Fe(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0,a=o,l=!1,u=null,c=o;if(t&&typeof t=="object"&&!Array.isArray(t)){let y;if(t.url===void 0&&(y="url")){let R={instancePath:e,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:y},message:"must have required property '"+y+"'"};i===null?i=[R]:i.push(R),o++}}var p=c===o;p&&(l=!0,u=0);let f=o;if(t&&typeof t=="object"&&!Array.isArray(t)){let y;if(t.path===void 0&&(y="path")){let R={instancePath:e,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:y},message:"must have required property '"+y+"'"};i===null?i=[R]:i.push(R),o++}}var p=f===o;if(p&&l?(l=!1,u=[u,1]):p&&(l=!0,u=1),l)o=a,i!==null&&(a?i.length=a:i=null);else{let y={instancePath:e,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas:u},message:"must match exactly one schema in oneOf"};return i===null?i=[y]:i.push(y),o++,Fe.errors=i,!1}if(o===0)if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.url!==void 0){let y=t.url,R=o,T=o,O=!1,w=null,$=o;if(typeof y!="string"){let P=typeof y,C;if(C===void 0)if(P=="number"||P=="boolean")C=""+y;else if(y===null)C="";else{let k={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[k]:i.push(k),o++}C!==void 0&&(y=C,t!==void 0&&(t.url=C))}var d=$===o;d&&(O=!0,w=0);let v=o;if(o===v)if(y&&typeof y=="object"&&!Array.isArray(y)){let P;if(y.pathname===void 0&&(P="pathname")){let C={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf/1/required",keyword:"required",params:{missingProperty:P},message:"must have required property '"+P+"'"};i===null?i=[C]:i.push(C),o++}else{if(y.protocol!==void 0){let C=y.protocol,k=o;if(typeof C!="string"){let M=typeof C,J;if(J===void 0)if(M=="number"||M=="boolean")J=""+C;else if(C===null)J="";else{let U={instancePath:e+"/url/protocol",schemaPath:"#/properties/url/oneOf/1/properties/protocol/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[U]:i.push(U),o++}J!==void 0&&(C=J,y!==void 0&&(y.protocol=J))}var h=k===o}else var h=!0;if(h){if(y.hostname!==void 0){let C=y.hostname,k=o;if(typeof C!="string"){let J=typeof C,U;if(U===void 0)if(J=="number"||J=="boolean")U=""+C;else if(C===null)U="";else{let H={instancePath:e+"/url/hostname",schemaPath:"#/properties/url/oneOf/1/properties/hostname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),o++}U!==void 0&&(C=U,y!==void 0&&(y.hostname=U))}var h=k===o}else var h=!0;if(h)if(y.pathname!==void 0){let C=y.pathname,k=o;if(typeof C!="string"){let J=typeof C,U;if(U===void 0)if(J=="number"||J=="boolean")U=""+C;else if(C===null)U="";else{let H={instancePath:e+"/url/pathname",schemaPath:"#/properties/url/oneOf/1/properties/pathname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),o++}U!==void 0&&(C=U,y!==void 0&&(y.pathname=U))}var h=k===o}else var h=!0}}}else{let P={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[P]:i.push(P),o++}var d=v===o;if(d&&O?(O=!1,w=[w,1]):d&&(O=!0,w=1),O)o=T,i!==null&&(T?i.length=T:i=null);else{let P={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf",keyword:"oneOf",params:{passingSchemas:w},message:"must match exactly one schema in oneOf"};return i===null?i=[P]:i.push(P),o++,Fe.errors=i,!1}var m=R===o}else var m=!0;if(m){if(t.path!==void 0){let y=t.path,R=o,T=o,O=!1,w=null,$=o;if(typeof y!="string"){let C=typeof y,k;if(k===void 0)if(C=="number"||C=="boolean")k=""+y;else if(y===null)k="";else{let M={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[M]:i.push(M),o++}k!==void 0&&(y=k,t!==void 0&&(t.path=k))}var S=$===o;S&&(O=!0,w=0);let v=o;if(o===v)if(y&&typeof y=="object"&&!Array.isArray(y)){let C;if(y.pathname===void 0&&(C="pathname")){let k={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf/1/required",keyword:"required",params:{missingProperty:C},message:"must have required property '"+C+"'"};i===null?i=[k]:i.push(k),o++}else{if(y.protocol!==void 0){let k=y.protocol,M=o;if(typeof k!="string"){let J=typeof k,U;if(U===void 0)if(J=="number"||J=="boolean")U=""+k;else if(k===null)U="";else{let H={instancePath:e+"/path/protocol",schemaPath:"#/properties/path/oneOf/1/properties/protocol/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),o++}U!==void 0&&(k=U,y!==void 0&&(y.protocol=U))}var g=M===o}else var g=!0;if(g){if(y.hostname!==void 0){let k=y.hostname,M=o;if(typeof k!="string"){let U=typeof k,H;if(H===void 0)if(U=="number"||U=="boolean")H=""+k;else if(k===null)H="";else{let fe={instancePath:e+"/path/hostname",schemaPath:"#/properties/path/oneOf/1/properties/hostname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[fe]:i.push(fe),o++}H!==void 0&&(k=H,y!==void 0&&(y.hostname=H))}var g=M===o}else var g=!0;if(g)if(y.pathname!==void 0){let k=y.pathname,M=o;if(typeof k!="string"){let U=typeof k,H;if(H===void 0)if(U=="number"||U=="boolean")H=""+k;else if(k===null)H="";else{let fe={instancePath:e+"/path/pathname",schemaPath:"#/properties/path/oneOf/1/properties/pathname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[fe]:i.push(fe),o++}H!==void 0&&(k=H,y!==void 0&&(y.pathname=H))}var g=M===o}else var g=!0}}}else{let C={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[C]:i.push(C),o++}var S=v===o;if(S&&O?(O=!1,w=[w,1]):S&&(O=!0,w=1),O)o=T,i!==null&&(T?i.length=T:i=null);else{let C={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf",keyword:"oneOf",params:{passingSchemas:w},message:"must match exactly one schema in oneOf"};return i===null?i=[C]:i.push(C),o++,Fe.errors=i,!1}var m=R===o}else var m=!0;if(m){if(t.cookies!==void 0){let y=t.cookies,R=o;if(o===R&&!(y&&typeof y=="object"&&!Array.isArray(y)))return Fe.errors=[{instancePath:e+"/cookies",schemaPath:"#/properties/cookies/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var m=R===o}else var m=!0;if(m){if(t.headers!==void 0){let y=t.headers,R=o;if(o===R&&!(y&&typeof y=="object"&&!Array.isArray(y)))return Fe.errors=[{instancePath:e+"/headers",schemaPath:"#/properties/headers/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var m=R===o}else var m=!0;if(m){if(t.query!==void 0){let y=t.query,R=o,T=o,O=!1,w=o;if(o===w&&!(y&&typeof y=="object"&&!Array.isArray(y))){let v={instancePath:e+"/query",schemaPath:"#/properties/query/anyOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[v]:i.push(v),o++}var b=w===o;if(O=O||b,!O){let v=o;if(typeof y!="string"){let C=typeof y,k;if(k===void 0)if(C=="number"||C=="boolean")k=""+y;else if(y===null)k="";else{let M={instancePath:e+"/query",schemaPath:"#/properties/query/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[M]:i.push(M),o++}k!==void 0&&(y=k,t!==void 0&&(t.query=k))}var b=v===o;O=O||b}if(O)o=T,i!==null&&(T?i.length=T:i=null);else{let v={instancePath:e+"/query",schemaPath:"#/properties/query/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[v]:i.push(v),o++,Fe.errors=i,!1}var m=R===o}else var m=!0;if(m){if(t.simulate!==void 0){let y=t.simulate,R=o;if(o===R)if(y&&typeof y=="object"&&!Array.isArray(y)){if(y.end!==void 0){let O=y.end,w=o;if(typeof O!="boolean"){let $;if($===void 0)if(O==="false"||O===0||O===null)$=!1;else if(O==="true"||O===1)$=!0;else return Fe.errors=[{instancePath:e+"/simulate/end",schemaPath:"#/properties/simulate/properties/end/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;$!==void 0&&(O=$,y!==void 0&&(y.end=$))}var _=w===o}else var _=!0;if(_){if(y.split!==void 0){let O=y.split,w=o;if(typeof O!="boolean"){let v;if(v===void 0)if(O==="false"||O===0||O===null)v=!1;else if(O==="true"||O===1)v=!0;else return Fe.errors=[{instancePath:e+"/simulate/split",schemaPath:"#/properties/simulate/properties/split/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;v!==void 0&&(O=v,y!==void 0&&(y.split=v))}var _=w===o}else var _=!0;if(_){if(y.error!==void 0){let O=y.error,w=o;if(typeof O!="boolean"){let v;if(v===void 0)if(O==="false"||O===0||O===null)v=!1;else if(O==="true"||O===1)v=!0;else return Fe.errors=[{instancePath:e+"/simulate/error",schemaPath:"#/properties/simulate/properties/error/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;v!==void 0&&(O=v,y!==void 0&&(y.error=v))}var _=w===o}else var _=!0;if(_)if(y.close!==void 0){let O=y.close,w=o;if(typeof O!="boolean"){let v;if(v===void 0)if(O==="false"||O===0||O===null)v=!1;else if(O==="true"||O===1)v=!0;else return Fe.errors=[{instancePath:e+"/simulate/close",schemaPath:"#/properties/simulate/properties/close/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;v!==void 0&&(O=v,y!==void 0&&(y.close=v))}var _=w===o}else var _=!0}}}else return Fe.errors=[{instancePath:e+"/simulate",schemaPath:"#/properties/simulate/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var m=R===o}else var m=!0;if(m){if(t.authority!==void 0){let y=t.authority,R=o;if(typeof y!="string"){let O=typeof y,w;if(w===void 0)if(O=="number"||O=="boolean")w=""+y;else if(y===null)w="";else return Fe.errors=[{instancePath:e+"/authority",schemaPath:"#/properties/authority/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;w!==void 0&&(y=w,t!==void 0&&(t.authority=w))}var m=R===o}else var m=!0;if(m){if(t.remoteAddress!==void 0){let y=t.remoteAddress,R=o;if(typeof y!="string"){let O=typeof y,w;if(w===void 0)if(O=="number"||O=="boolean")w=""+y;else if(y===null)w="";else return Fe.errors=[{instancePath:e+"/remoteAddress",schemaPath:"#/properties/remoteAddress/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;w!==void 0&&(y=w,t!==void 0&&(t.remoteAddress=w))}var m=R===o}else var m=!0;if(m){if(t.method!==void 0){let y=t.method,R=o;if(typeof y!="string"){let O=typeof y,w;if(w===void 0)if(O=="number"||O=="boolean")w=""+y;else if(y===null)w="";else return Fe.errors=[{instancePath:e+"/method",schemaPath:"#/properties/method/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;w!==void 0&&(y=w,t!==void 0&&(t.method=w))}if(!(y==="ACL"||y==="BIND"||y==="CHECKOUT"||y==="CONNECT"||y==="COPY"||y==="DELETE"||y==="GET"||y==="HEAD"||y==="LINK"||y==="LOCK"||y==="M-SEARCH"||y==="MERGE"||y==="MKACTIVITY"||y==="MKCALENDAR"||y==="MKCOL"||y==="MOVE"||y==="NOTIFY"||y==="OPTIONS"||y==="PATCH"||y==="POST"||y==="PROPFIND"||y==="PROPPATCH"||y==="PURGE"||y==="PUT"||y==="QUERY"||y==="REBIND"||y==="REPORT"||y==="SEARCH"||y==="SOURCE"||y==="SUBSCRIBE"||y==="TRACE"||y==="UNBIND"||y==="UNLINK"||y==="UNLOCK"||y==="UNSUBSCRIBE"||y==="acl"||y==="bind"||y==="checkout"||y==="connect"||y==="copy"||y==="delete"||y==="get"||y==="head"||y==="link"||y==="lock"||y==="m-search"||y==="merge"||y==="mkactivity"||y==="mkcalendar"||y==="mkcol"||y==="move"||y==="notify"||y==="options"||y==="patch"||y==="post"||y==="propfind"||y==="proppatch"||y==="purge"||y==="put"||y==="query"||y==="rebind"||y==="report"||y==="search"||y==="source"||y==="subscribe"||y==="trace"||y==="unbind"||y==="unlink"||y==="unlock"||y==="unsubscribe"))return Fe.errors=[{instancePath:e+"/method",schemaPath:"#/properties/method/enum",keyword:"enum",params:{allowedValues:_W.properties.method.enum},message:"must be equal to one of the allowed values"}],!1;var m=R===o}else var m=!0;if(m)if(t.validate!==void 0){let y=t.validate,R=o;if(typeof y!="boolean"){let O;if(O===void 0)if(y==="false"||y===0||y===null)O=!1;else if(y==="true"||y===1)O=!0;else return Fe.errors=[{instancePath:e+"/validate",schemaPath:"#/properties/validate/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;O!==void 0&&(y=O,t!==void 0&&(t.validate=O))}var m=R===o}else var m=!0}}}}}}}}}else return Fe.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return Fe.errors=i,o===0}});var lA=E((vQ,Oo)=>{"use strict";var SW=V("node:assert"),Vm=XP(),bu=sA(),wu="The dispatch function has already been invoked",oA=iA();function zm(t,e,r){return r===void 0?new Ro(t,e):vu(t,e,r)}function EW(t,e){let r=t._lightMyRequest.payload;if(!r||r._readableState||typeof r.resume!="function")return e();let n=[];r.on("data",s=>n.push(Buffer.from(s))),r.on("end",()=>{let s=Buffer.concat(n);return t.headers["content-length"]=t.headers["content-length"]||""+s.length,delete t.headers["transfer-encoding"],t._lightMyRequest.payload=s,e()}),r.resume()}function aA(t,e,r,n){return r.once("error",function(s){this.destroyed&&n.destroy(s)}),r.once("close",function(){this.destroyed&&!this._error&&n.destroy()}),EW(r,()=>t.call(e,r,n))}function vu(t,e,r){if(e=typeof e=="string"?{url:e}:e,e.validate!==!1&&(SW(typeof t=="function","dispatchFunc should be a function"),!oA(e)))throw new Error(oA.errors.map(o=>o.message));let n=e.server||{},s=e.Request?Vm.CustomRequest:Vm;if(t.request&&t.request.app===t&&(Object.setPrototypeOf(Object.getPrototypeOf(t.request),s.prototype),Object.setPrototypeOf(Object.getPrototypeOf(t.response),bu.prototype)),typeof r=="function"){let i=new s(e),o=new bu(i,r);return aA(t,n,i,o)}else return new Promise((i,o)=>{let a=new s(e),l=new bu(a,i,o);aA(t,n,a,l)})}function Ro(t,e){typeof e=="string"?this.option={url:e}:this.option=Object.assign({},e),this.dispatch=t,this._hasInvoked=!1,this._promise=null,this.option.autoStart!==!1&&process.nextTick(()=>{this._hasInvoked||this.end()})}var bW=["delete","get","head","options","patch","post","put","trace"];bW.forEach(t=>{Ro.prototype[t]=function(e){if(this._hasInvoked===!0||this._promise)throw new Error(wu);return this.option.url=e,this.option.method=t.toUpperCase(),this}});var vW=["body","cookies","headers","payload","query"];vW.forEach(t=>{Ro.prototype[t]=function(e){if(this._hasInvoked===!0||this._promise)throw new Error(wu);return this.option[t]=e,this}});Ro.prototype.end=function(t){if(this._hasInvoked===!0||this._promise)throw new Error(wu);if(this._hasInvoked=!0,typeof t=="function")vu(this.dispatch,this.option,t);else return this._promise=vu(this.dispatch,this.option),this._promise};Object.getOwnPropertyNames(Promise.prototype).forEach(t=>{t!=="constructor"&&(Ro.prototype[t]=function(...e){if(!this._promise){if(this._hasInvoked===!0)throw new Error(wu);this._hasInvoked=!0,this._promise=vu(this.dispatch,this.option)}return this._promise[t](...e)})});function wW(t){return t instanceof Vm||t instanceof bu||t?.constructor?.name==="_CustomLMRRequest"}Oo.exports=zm;Oo.exports.default=zm;Oo.exports.inject=zm;Oo.exports.isInjection=wW});var RA=E((wQ,Co)=>{"use strict";var RW="5.7.2",OW=iy(),$u=V("node:http"),TW=V("node:diagnostics_channel"),To,{kAvvioBoot:$o,kChildren:Um,kServerBindings:uA,kBodyLimit:$W,kSupportedHTTPMethods:jn,kRoutePrefix:cA,kLogLevel:PW,kLogSerializers:AW,kHooks:Bm,kSchemaController:ln,kRequestAcceptVersion:CW,kReplySerializerDefault:fA,kContentTypeParser:IW,kReply:NW,kRequest:kW,kFourOhFour:xW,kState:$e,kOptions:Gm,kPluginNameChain:Po,kSchemaErrorFormatter:Wm,kErrorHandler:Ru,kKeepAliveConnections:Jm,kChildLoggerFactory:Km,kGenReqId:Ym,kErrorHandlerAlreadySet:Ou}=De(),{createServer:LW}=ky(),Ao=Pa(),Tu=xa(),qW=La(),Dn=di(),Fn=Hf(),dA=Np(),{Hooks:jW,hookRunnerApplication:hA,supportedHooks:Xm}=Fr(),{createChildLogger:pA,defaultChildLoggerFactory:DW,createLogger:FW}=ai(),mA=nm(),{getGenReqId:gA,reqIdGenFactory:vA}=Yl(),{buildRouting:MW,validateBodyLimitOption:HW,buildRouterOptions:VW}=SP(),zW=TP(),wA=PP(),UW=jP(),{appendStackTrace:BW,AVVIO_ERRORS_MAP:yA,...Mn}=He(),GW=lc(),{defaultInitOptions:vt}=wA,{FST_ERR_ASYNC_CONSTRAINT:WW,FST_ERR_BAD_URL:JW,FST_ERR_OPTIONS_NOT_OBJ:KW,FST_ERR_QSP_NOT_FN:YW,FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN:XW,FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ:QW,FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR:ZW,FST_ERR_INSTANCE_ALREADY_LISTENING:eJ,FST_ERR_REOPENED_CLOSE_SERVER:tJ,FST_ERR_ROUTE_REWRITE_NOT_STR:rJ,FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN:_A,FST_ERR_ERROR_HANDLER_NOT_FN:nJ,FST_ERR_ERROR_HANDLER_ALREADY_SET:sJ,FST_ERR_ROUTE_METHOD_INVALID:iJ}=Mn,{buildErrorHandler:SA}=ui(),{FSTWRN004:oJ}=Kn(),EA=TW.channel("fastify.initialization");function Qm(t){let{options:e,genReqId:r,disableRequestLogging:n,hasLogger:s,initialConfig:i}=aJ(t,P,C),o=MW(e.routerOptions),a=zW(e),l=me(o,e),{server:u,listen:c,forceCloseConnections:f,serverHasCloseAllConnections:p,serverHasCloseHttp2Sessions:h,keepAliveConnections:d}=LW(e,l),m=Ao.setupResponseListeners,g=dA.buildSchemaController(null,e.schemaController),S={[$e]:{listening:!1,closing:!1,started:!1,ready:!1,booting:!1,aborted:!1,readyResolver:null},[Jm]:d,[jn]:{bodyless:new Set(["GET","HEAD","TRACE"]),bodywith:new Set(["DELETE","OPTIONS","PATCH","PUT","POST"])},[Gm]:e,[Um]:[],[uA]:[],[$W]:e.bodyLimit,[cA]:"",[PW]:"",[AW]:null,[Bm]:new jW,[ln]:g,[Wm]:null,[Ru]:SA(),[Ou]:!1,[Km]:e.childLoggerFactory||DW,[fA]:null,[IW]:new Fn(e.bodyLimit,e.onProtoPoisoning||vt.onProtoPoisoning,e.onConstructorPoisoning||vt.onConstructorPoisoning),[NW]:Ao.buildReply(Ao),[kW]:Tu.buildRequest(Tu,e.trustProxy),[xW]:a,[mA.kRegisteredPlugins]:[],[Po]:["fastify"],[$o]:null,[Ym]:r,routing:l,delete:function(N,q,j){return o.prepareRoute.call(this,{method:"DELETE",url:N,options:q,handler:j})},get:function(N,q,j){return o.prepareRoute.call(this,{method:"GET",url:N,options:q,handler:j})},head:function(N,q,j){return o.prepareRoute.call(this,{method:"HEAD",url:N,options:q,handler:j})},trace:function(N,q,j){return o.prepareRoute.call(this,{method:"TRACE",url:N,options:q,handler:j})},patch:function(N,q,j){return o.prepareRoute.call(this,{method:"PATCH",url:N,options:q,handler:j})},post:function(N,q,j){return o.prepareRoute.call(this,{method:"POST",url:N,options:q,handler:j})},put:function(N,q,j){return o.prepareRoute.call(this,{method:"PUT",url:N,options:q,handler:j})},options:function(N,q,j){return o.prepareRoute.call(this,{method:"OPTIONS",url:N,options:q,handler:j})},all:function(N,q,j){return o.prepareRoute.call(this,{method:this.supportedMethods,url:N,options:q,handler:j})},route:function(N){return o.route.call(this,{options:N})},hasRoute:function(N){return o.hasRoute.call(this,{options:N})},findRoute:function(N){return o.findRoute(N)},log:e.logger,withTypeProvider:w,addHook:$,addSchema:v,getSchema:g.getSchema.bind(g),getSchemas:g.getSchemas.bind(g),setValidatorCompiler:J,setSerializerCompiler:H,setSchemaController:fe,setReplySerializer:ze,setSchemaErrorFormatter:U,setGenReqId:pe,addContentTypeParser:Fn.helpers.addContentTypeParser,hasContentTypeParser:Fn.helpers.hasContentTypeParser,getDefaultJsonParser:Fn.defaultParsers.getDefaultJsonParser,defaultTextParser:Fn.defaultParsers.defaultTextParser,removeContentTypeParser:Fn.helpers.removeContentTypeParser,removeAllContentTypeParsers:Fn.helpers.removeAllContentTypeParsers,register:null,after:null,ready:null,onClose:null,close:null,printPlugins:null,hasPlugin:function(A){return this[mA.kRegisteredPlugins].includes(A)||this[Po].includes(A)},listen:c,server:u,addresses:function(){let A=this[uA].map(N=>N.address());return A.push(this.server.address()),A.filter(N=>N)},decorate:Dn.add,hasDecorator:Dn.exist,decorateReply:Dn.decorateReply,decorateRequest:Dn.decorateRequest,hasRequestDecorator:Dn.existRequest,hasReplyDecorator:Dn.existReply,getDecorator:Dn.getInstanceDecorator,addHttpMethod:Hn,inject:T,printRoutes:Lr,setNotFoundHandler:M,setErrorHandler:G,setChildLoggerFactory:wt,initialConfig:i,addConstraintStrategy:o.addConstraintStrategy.bind(o),hasConstraintStrategy:o.hasConstraintStrategy.bind(o)};Object.defineProperties(S,{listeningOrigin:{get(){let A=this.addresses().slice(-1).pop();if(typeof A=="string")return A;let N=A.family==="IPv6"?`[${A.address}]`:A.address;return`${this[Gm].https?"https":"http"}://${N}:${A.port}`}},pluginName:{configurable:!0,get(){return this[Po].length>1?this[Po].join(" -> "):this[Po][0]}},prefix:{configurable:!0,get(){return this[cA]}},validatorCompiler:{configurable:!0,get(){return this[ln].getValidatorCompiler()}},serializerCompiler:{configurable:!0,get(){return this[ln].getSerializerCompiler()}},childLoggerFactory:{configurable:!0,get(){return this[Km]}},version:{configurable:!0,get(){return RW}},errorHandler:{configurable:!0,get(){return this[Ru].func}},genReqId:{configurable:!0,get(){return this[Ym]}},supportedMethods:{configurable:!1,get(){return[...this[jn].bodyless,...this[jn].bodywith]}}}),e.schemaErrorFormatter&&(bA(e.schemaErrorFormatter),S[Wm]=e.schemaErrorFormatter.bind(S));let b=Number(e.pluginTimeout),_=OW(S,{autostart:!1,timeout:isNaN(b)===!1?b:vt.pluginTimeout,expose:{use:"register"}});_.override=UW,_.on("start",()=>S[$e].started=!0),S[$o]=S.ready,S.ready=O,S.printPlugins=_.prettyPrint.bind(_),_.once("preReady",()=>{S.onClose((A,N)=>{S[$e].closing=!0,o.closeRoutes(),hA("preClose",S[$o],S,function(){if(S[$e].listening){if(f==="idle")A.server.closeIdleConnections();else if(p&&f)A.server.closeAllConnections();else if(f===!0)for(let q of S[Jm])q.destroy(),S[Jm].delete(q)}h&&A.server.closeHttp2Sessions(),!e.serverFactory||S[$e].listening?A.server.close(function(q){q&&q.code!=="ERR_SERVER_NOT_RUNNING"?N(null):N()}):process.nextTick(N,null)})})});let y=new qW({server:S,config:{}});return S.setNotFoundHandler(),a.arrange404(S),o.setup(e,{avvio:_,fourOhFour:a,hasLogger:s,setupResponseListeners:m,throwIfAlreadyStarted:R,keepAliveConnections:d}),u.on("clientError",e.clientErrorHandler.bind(S)),EA.hasSubscribers&&EA.publish({fastify:S}),"asyncDispose"in Symbol&&(S[Symbol.asyncDispose]=function(){return S.close()}),S;function R(A){if(S[$e].started)throw new eJ(A)}function T(A,N){if(To===void 0&&(To=lA()),S[$e].started){if(S[$e].closing){let q=new tJ;if(N){N(q);return}else return Promise.reject(q)}return To(l,A,N)}if(N)this.ready(q=>{q?N(q,null):To(l,A,N)});else return To((q,j)=>{this.ready(function(ue){if(ue){j.emit("error",ue);return}l(q,j)})},A)}function O(A){if(this[$e].readyResolver!==null){if(A!=null){this[$e].readyResolver.promise.then(()=>A(null,S),A);return}return this[$e].readyResolver.promise}if(process.nextTick(N),this[$e].readyResolver=GW.withResolvers(),A)this[$e].readyResolver.promise.then(()=>A(null,S),A);else return this[$e].readyResolver.promise;function N(){S[$o]((j,ue)=>{j||S[$e].started||S[$e].ready||S[$e].booting?q(j):(S[$e].booting=!0,hA("onReady",S[$o],S,q)),ue()})}function q(j){if(j=j!=null&&yA[j.code]!=null?BW(j,new yA[j.code](j.message)):j,j)return S[$e].readyResolver.reject(j);S[$e].readyResolver.resolve(S),S[$e].booting=!1,S[$e].ready=!0,S[$e].readyResolver=null}}function w(){return this}function $(A,N){if(R('Cannot call "addHook"!'),N==null)throw new Mn.FST_ERR_HOOK_INVALID_HANDLER(A,N);if(A==="onSend"||A==="preSerialization"||A==="onError"||A==="preParsing"){if(N.constructor.name==="AsyncFunction"&&N.length===4)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER}else if(A==="onReady"||A==="onListen"){if(N.constructor.name==="AsyncFunction"&&N.length!==0)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER}else if(A==="onRequestAbort"){if(N.constructor.name==="AsyncFunction"&&N.length!==1)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER}else if(N.constructor.name==="AsyncFunction"&&N.length===3)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER;return A==="onClose"?this.onClose(N.bind(this)):A==="onReady"||A==="onListen"||A==="onRoute"?this[Bm].add(A,N):this.after((j,ue)=>{try{q.call(this,A,N),ue(j)}catch(de){ue(de)}}),this;function q(j,ue){this[Bm].add(j,ue),this[Um].forEach(de=>q.call(de,j,ue))}}function v(A){return R('Cannot call "addSchema"!'),this[ln].add(A),this[Um].forEach(N=>N.addSchema(A)),this}function P(A,N){A.headers["accept-version"]!==void 0&&(A.headers[CW]=A.headers["accept-version"],A.headers["accept-version"]=void 0),a.router.lookup(A,N)}function C(A,N,q){if(e.frameworkErrors){let ue=gA(y.server,N),de=pA(y,e.logger,N,ue),Me=new Tu(ue,null,N,null,de,y),Y=new Ao(q,Me,de);return(typeof n=="function"?n(N):n)===!1&&de.info({req:Me},"incoming request"),e.frameworkErrors(new JW(A),Me,Y)}let j=JSON.stringify({error:"Bad Request",code:"FST_ERR_BAD_URL",message:`'${A}' is not a valid url component`,statusCode:400});q.writeHead(400,{"Content-Type":"application/json","Content-Length":Buffer.byteLength(j)}),q.end(j)}function k(A,N,q){if(A!==!1)return function(ue){if(ue){if(e.frameworkErrors){let Me=gA(y.server,N),Y=pA(y,e.logger,N,Me),$t=new Tu(Me,null,N,null,Y,y),Pe=new Ao(q,$t,Y);return(typeof n=="function"?n(N):n)===!1&&Y.info({req:$t},"incoming request"),e.frameworkErrors(new WW,$t,Pe)}let de='{"error":"Internal Server Error","message":"Unexpected error from async constraint","statusCode":500}';q.writeHead(500,{"Content-Type":"application/json","Content-Length":de.length}),q.end(de)}}}function M(A,N){return R('Cannot call "setNotFoundHandler"!'),a.setNotFoundHandler.call(this,A,N,_,o.routeHandler),this}function J(A){return R('Cannot call "setValidatorCompiler"!'),this[ln].setValidatorCompiler(A),this}function U(A){return R('Cannot call "setSchemaErrorFormatter"!'),bA(A),this[Wm]=A.bind(this),this}function H(A){return R('Cannot call "setSerializerCompiler"!'),this[ln].setSerializerCompiler(A),this}function fe(A){R('Cannot call "setSchemaController"!');let N=this[ln],q=dA.buildSchemaController(N,Object.assign({},N.opts,A));return this[ln]=q,this.getSchema=q.getSchema.bind(q),this.getSchemas=q.getSchemas.bind(q),this}function ze(A){return R('Cannot call "setReplySerializer"!'),this[fA]=A,this}function G(A){if(R('Cannot call "setErrorHandler"!'),typeof A!="function")throw new nJ;if(!e.allowErrorHandlerOverride&&this[Ou])throw new sJ;return this[Ou]&&oJ("To disable this behavior, set 'allowErrorHandlerOverride' to false or ignore this message. For more information, visit: https://fastify.dev/docs/latest/Reference/Server/#allowerrorhandleroverride"),this[Ou]=!0,this[Ru]=SA(this[Ru],A.bind(this)),this}function wt(A){return R('Cannot call "setChildLoggerFactory"!'),this[Km]=A,this}function Lr(A={}){return A.includeMeta=A.includeHooks?A.includeMeta?Xm.concat(A.includeMeta):Xm:A.includeMeta,o.printRoutes(A)}function me(A,{rewriteUrl:N,logger:q}){let j;return function(de,Me){if(j===void 0&&(j=A.isAsyncConstraint()),N){de.originalUrl=de.url;let Y=N.call(S,de);if(typeof Y=="string")de.url=Y;else{let $t=new rJ(de.url,typeof Y);de.destroy($t)}}A.routing(de,Me,k(j,de,Me))}}function pe(A){return R('Cannot call "setGenReqId"!'),this[Ym]=vA(this[Gm].requestIdHeader,A),this}function Hn(A,{hasBody:N=!1}={}){if(typeof A!="string"||$u.METHODS.indexOf(A)===-1)throw new iJ;N===!0?(this[jn].bodywith.add(A),this[jn].bodyless.delete(A)):(this[jn].bodywith.delete(A),this[jn].bodyless.add(A));let q=A.toLowerCase();return this.hasDecorator(q)||this.decorate(q,function(j,ue,de){return o.prepareRoute.call(this,{method:A,url:j,options:ue,handler:de})}),this}}function aJ(t,e,r){if(t&&typeof t!="object")throw new KW;if(t=Object.assign({},t),t.querystringParser&&typeof t.querystringParser!="function"||t.routerOptions?.querystringParser&&typeof t.routerOptions.querystringParser!="function")throw new YW(typeof(t.querystringParser??t.routerOptions.querystringParser));if(t.schemaController&&t.schemaController.bucket&&typeof t.schemaController.bucket!="function")throw new XW(typeof t.schemaController.bucket);HW(t.bodyLimit);let n=typeof t.requestIdHeader=="string"&&t.requestIdHeader.length!==0?t.requestIdHeader.toLowerCase():t.requestIdHeader===!0&&"request-id",s=vA(n,t.genReqId),i=t.requestIdLogLabel||"reqId";t.bodyLimit=t.bodyLimit||vt.bodyLimit;let o=t.disableRequestLogging||!1,a=Object.assign({customOptions:{},plugins:[]},t.ajv);if(!a.customOptions||Object.prototype.toString.call(a.customOptions)!=="[object Object]")throw new QW(typeof a.customOptions);if(!a.plugins||!Array.isArray(a.plugins))throw new ZW(typeof a.plugins);let{logger:l,hasLogger:u}=FW(t);t.connectionTimeout=t.connectionTimeout||vt.connectionTimeout,t.keepAliveTimeout=t.keepAliveTimeout||vt.keepAliveTimeout,t.maxRequestsPerSocket=t.maxRequestsPerSocket||vt.maxRequestsPerSocket,t.requestTimeout=t.requestTimeout||vt.requestTimeout,t.logger=l,t.requestIdHeader=n,t.requestIdLogLabel=i,t.disableRequestLogging=o,t.ajv=a,t.clientErrorHandler=t.clientErrorHandler||uJ,t.allowErrorHandlerOverride=t.allowErrorHandlerOverride??vt.allowErrorHandlerOverride;let c=wA(t);return t.exposeHeadRoutes=c.exposeHeadRoutes,t.http2SessionTimeout=c.http2SessionTimeout,t.routerOptions=VW(t,{defaultRoute:e,onBadUrl:r,ignoreTrailingSlash:vt.ignoreTrailingSlash,ignoreDuplicateSlashes:vt.ignoreDuplicateSlashes,maxParamLength:vt.maxParamLength,allowUnsafeRegex:vt.allowUnsafeRegex,buildPrettyMeta:lJ,useSemicolonDelimiter:vt.useSemicolonDelimiter}),{options:t,genReqId:s,disableRequestLogging:o,hasLogger:u,initialConfig:c}}function lJ(t){let e={};return["errorHandler","logLevel","logSerializers"].concat(Xm).forEach(n=>{e[n]=t.store[n]}),Object.assign({},e)}function uJ(t,e){if(t.code==="ECONNRESET"||e.destroyed)return;let r,n,s,i;t.code==="ERR_HTTP_REQUEST_TIMEOUT"?(n="408",s=$u.STATUS_CODES[n],r=`{"error":"${s}","message":"Client Timeout","statusCode":408}`,i="timeout"):t.code==="HPE_HEADER_OVERFLOW"?(n="431",s=$u.STATUS_CODES[n],r=`{"error":"${s}","message":"Exceeded maximum allowed HTTP header size","statusCode":431}`,i="header_overflow"):(n="400",s=$u.STATUS_CODES[n],r=`{"error":"${s}","message":"Client Error","statusCode":400}`,i="error"),this.log.trace({err:t},`client ${i}`),e.writable&&e.write(`HTTP/1.1 ${n} ${s}\r
374
+ `,yield zs.encode(c),u.stream?yield*u.stream():yield u,yield i}yield zs.encode(`--${e}--`)}return{stream:eW.from(o()),contentType:`multipart/form-data; boundary=${e}`}}Lm.exports.isFormDataLike=tW;Lm.exports.formDataToStream=rW});var QP=E((TQ,Eu)=>{"use strict";var{Readable:YP,addAbortSignal:nW}=V("node:stream"),jm=V("node:util"),sW=zP(),iW=V("node:assert"),{createDeprecation:oW}=BP(),aW=JP(),{isFormDataLike:lW,formDataToStream:uW}=KP(),{EventEmitter:cW}=V("node:events"),fW=oW({name:"FastifyDeprecationLightMyRequest",code:"FST_LIGHTMYREQUEST_DEP01",message:'You are accessing "request.connection", use "request.socket" instead.'});function dW(t){return t.port?t.host:t.hostname+(t.protocol==="https:"?":443":":80")}var qm=class extends cW{constructor(e){super(),this.remoteAddress=e}};function XP(t){return new e(this);function e(r){on.call(r,{...t,Request:void 0}),Object.assign(this,r);for(let n of Object.keys(on.prototype))this.constructor.prototype[n]=on.prototype[n];return jm.inherits(this.constructor,t.Request),this}}function on(t){YP.call(this,{autoDestroy:!1});let e=aW(t.url||t.path,t.query);this.url=e.pathname+e.search,this.aborted=!1,this.httpVersionMajor=1,this.httpVersionMinor=1,this.httpVersion="1.1",this.method=t.method?t.method.toUpperCase():"GET",this.headers={},this.rawHeaders=[];let r=t.headers||{};for(let o in r){let a=o.toLowerCase();if((a==="user-agent"||a==="content-type")&&r[o]===void 0){this.headers[a]=void 0;continue}let l=r[o];iW(l!==void 0,'invalid value "undefined" for header '+o),this.headers[a]=""+l}if("user-agent"in this.headers||(this.headers["user-agent"]="lightMyRequest"),this.headers.host=this.headers.host||t.authority||dW(e),t.cookies){let{cookies:o}=t,a=Object.keys(o).map(l=>sW.serialize(l,o[l]));this.headers.cookie&&a.unshift(this.headers.cookie),this.headers.cookie=a.join("; ")}this.socket=new qm(t.remoteAddress||"127.0.0.1"),Object.defineProperty(this,"connection",{get(){return fW(),this.socket},configurable:!0});let n=t.payload||t.body||null,s=n&&typeof n.resume=="function";if(lW(n)){let o=uW(n);n=o.stream,s=!0,this.headers["content-type"]=o.contentType,this.headers["transfer-encoding"]="chunked"}n&&typeof n!="string"&&!s&&!Buffer.isBuffer(n)&&(n=JSON.stringify(n),"content-type"in this.headers||(this.headers["content-type"]="application/json")),n&&!s&&!Object.hasOwn(this.headers,"content-length")&&(this.headers["content-length"]=(Buffer.isBuffer(n)?n.length:Buffer.byteLength(n)).toString());for(let o of Object.keys(this.headers))this.rawHeaders.push(o,this.headers[o]);this._lightMyRequest={payload:n,isDone:!1,simulate:t.simulate||{},payloadAsStream:t.payloadAsStream,signal:t.signal};let i=t.signal;i&&nW(i,this);{let o=this._lightMyRequest.payload;o?._readableState?(this._read=hW,o.on("error",a=>{this.destroy(a)}),o.on("end",()=>{this.push(null)})):this._read=pW}return this}function hW(){let t=this._lightMyRequest.payload,e=!0,r=!1,n;for(;e&&(n=t.read());)r=!0,e=this.push(n);e&&!r&&this._lightMyRequest.payload.once("readable",this._read.bind(this))}function pW(){setImmediate(()=>{if(this._lightMyRequest.isDone){this._lightMyRequest.simulate.end!==!1&&this.push(null);return}this._lightMyRequest.isDone=!0,this._lightMyRequest.payload&&(this._lightMyRequest.simulate.split?(this.push(this._lightMyRequest.payload.slice(0,1)),this.push(this._lightMyRequest.payload.slice(1))):this.push(this._lightMyRequest.payload)),this._lightMyRequest.simulate.error&&this.emit("error",new Error("Simulated")),this._lightMyRequest.simulate.close&&this.emit("close"),this._lightMyRequest.simulate.end!==!1&&this.push(null)})}jm.inherits(on,YP);jm.inherits(XP,on);on.prototype.destroy=function(t){this.destroyed||this._lightMyRequest.isDone||(this.destroyed=!0,t&&(this._error=!0,process.nextTick(()=>this.emit("error",t))),process.nextTick(()=>this.emit("close")))};Eu.exports=on;Eu.exports.Request=on;Eu.exports.CustomRequest=XP});var eA=E(($Q,wo)=>{"use strict";var bu={decodeValues:!0,map:!1,silent:!1};function Dm(t){return typeof t!="string"||t in{}}function Fm(){return Object.create(null)}function Mm(t){return typeof t=="string"&&!!t.trim()}function Hm(t,e){var r=t.split(";").filter(Mm),n=r.shift(),s=mW(n),i=s.name,o=s.value;if(e=e?Object.assign({},bu,e):bu,Dm(i))return null;try{o=e.decodeValues?decodeURIComponent(o):o}catch(l){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",l)}var a=Fm();return a.name=i,a.value=o,r.forEach(function(l){var u=l.split("="),c=u.shift().trimLeft().toLowerCase();if(!Dm(c)){var f=u.join("=");if(c==="expires")a.expires=new Date(f);else if(c==="max-age"){var p=parseInt(f,10);Number.isNaN(p)||(a.maxAge=p)}else c==="secure"?a.secure=!0:c==="httponly"?a.httpOnly=!0:c==="samesite"?a.sameSite=f:c==="partitioned"?a.partitioned=!0:c&&(a[c]=f)}}),a}function mW(t){var e="",r="",n=t.split("=");return n.length>1?(e=n.shift(),r=n.join("=")):r=t,{name:e,value:r}}function ZP(t,e){if(e=e?Object.assign({},bu,e):bu,!t)return e.map?Fm():[];if(t.headers)if(typeof t.headers.getSetCookie=="function")t=t.headers.getSetCookie();else if(t.headers["set-cookie"])t=t.headers["set-cookie"];else{var r=t.headers[Object.keys(t.headers).find(function(s){return s.toLowerCase()==="set-cookie"})];!r&&t.headers.cookie&&!e.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),t=r}if(Array.isArray(t)||(t=[t]),e.map){var n=Fm();return t.filter(Mm).reduce(function(s,i){var o=Hm(i,e);return o&&!Dm(o.name)&&(s[o.name]=o),s},n)}else return t.filter(Mm).map(function(s){return Hm(s,e)}).filter(Boolean)}function gW(t){if(Array.isArray(t))return t;if(typeof t!="string")return[];var e=[],r=0,n,s,i,o,a;function l(){for(;r<t.length&&/\s/.test(t.charAt(r));)r+=1;return r<t.length}function u(){return s=t.charAt(r),s!=="="&&s!==";"&&s!==","}for(;r<t.length;){for(n=r,a=!1;l();)if(s=t.charAt(r),s===","){for(i=r,r+=1,l(),o=r;r<t.length&&u();)r+=1;r<t.length&&t.charAt(r)==="="?(a=!0,r=o,e.push(t.substring(n,i)),n=r):r=i+1}else r+=1;(!a||r>=t.length)&&e.push(t.substring(n,t.length))}return e}wo.exports=ZP;wo.exports.parse=ZP;wo.exports.parseString=Hm;wo.exports.splitCookiesString=gW});var iA=E((PQ,sA)=>{"use strict";var Ro=V("node:http"),{Writable:yW,Readable:tA,addAbortSignal:_W}=V("node:stream"),SW=V("node:util"),EW=eA();function an(t,e,r){if(Ro.ServerResponse.call(this,t),t._lightMyRequest?.payloadAsStream){let a=this.emit.bind(this,"drain");this._lightMyRequest={headers:null,trailers:{},stream:new tA({read:a})};let l=t._lightMyRequest.signal;l&&_W(l,this._lightMyRequest.stream)}else this._lightMyRequest={headers:null,trailers:{},payloadChunks:[]};this.setHeader("foo","bar"),this.removeHeader("foo"),this.assignSocket(bW()),this._promiseCallback=typeof r=="function";let n=!1,s=a=>{if(!n){if(n=!0,this._promiseCallback)return process.nextTick(()=>e(a));process.nextTick(()=>e(null,a))}};this._lightMyRequest.onEndSuccess=s;let i=!1,o=a=>{if(n){this._lightMyRequest.stream&&!i&&(a||(a=new Error("response destroyed before completion"),a.code="LIGHT_ECONNRESET"),this._lightMyRequest.stream.destroy(a),this._lightMyRequest.stream.on("error",()=>{}));return}if(n=!0,a||(a=new Error("response destroyed before completion"),a.code="LIGHT_ECONNRESET"),this._promiseCallback)return process.nextTick(()=>r(a));process.nextTick(()=>e(a,null))};this._lightMyRequest.stream?this.once("finish",()=>{i=!0,this._lightMyRequest.stream.push(null)}):this.once("finish",()=>{let a=rA(this);a.raw.req=t,s(a)}),this.connection.once("error",o),this.once("error",o),this.once("close",o)}SW.inherits(an,Ro.ServerResponse);an.prototype.setTimeout=function(t,e){return this.timeoutHandle=setTimeout(()=>{this.emit("timeout")},t),this.on("timeout",e),this};an.prototype.writeHead=function(){let t=Ro.ServerResponse.prototype.writeHead.apply(this,arguments);return nA(this),this._lightMyRequest.stream&&this._lightMyRequest.onEndSuccess(rA(this)),t};an.prototype.write=function(t,e,r){return this.timeoutHandle&&clearTimeout(this.timeoutHandle),Ro.ServerResponse.prototype.write.call(this,t,e,r),this._lightMyRequest.stream?this._lightMyRequest.stream.push(Buffer.from(t,e)):(this._lightMyRequest.payloadChunks.push(Buffer.from(t,e)),!0)};an.prototype.end=function(t,e,r){t&&this.write(t,e),Ro.ServerResponse.prototype.end.call(this,r),this.emit("finish"),this.destroy()};an.prototype.destroy=function(t){this.destroyed||(this.destroyed=!0,t&&process.nextTick(()=>this.emit("error",t)),process.nextTick(()=>this.emit("close")))};an.prototype.addTrailers=function(t){for(let e in t)this._lightMyRequest.trailers[e.toLowerCase().trim()]=t[e].toString().trim()};function rA(t){t._lightMyRequest.headers===null&&nA(t),vW(t);let e={raw:{res:t},headers:t._lightMyRequest.headers,statusCode:t.statusCode,statusMessage:t.statusMessage,trailers:{},get cookies(){return EW.parse(this)}};if(e.trailers=t._lightMyRequest.trailers,t._lightMyRequest.payloadChunks){let r=Buffer.concat(t._lightMyRequest.payloadChunks);e.rawPayload=r,e.payload=r.toString(),e.body=e.payload,e.json=function(){return JSON.parse(e.payload)}}else e.json=function(){throw new Error("Response payload is not available with payloadAsStream: true")};return e.stream=function(){return t._lightMyRequest.stream?t._lightMyRequest.stream:tA.from(t._lightMyRequest.payloadChunks)},e}function bW(){return new yW({write(t,e,r){setImmediate(r)}})}function vW(t){let e=t._lightMyRequest.headers;for(let r of Object.keys(e)){let n=e[r];Array.isArray(n)?e[r]=n.map(s=>""+s):e[r]=""+n}}function nA(t){t._lightMyRequest.headers=Object.assign({},t.getHeaders()),["Date","Connection","Transfer-Encoding"].forEach(e=>{let r=new RegExp("\\r\\n"+e+": ([^\\r]*)\\r\\n"),n=t._header?.match(r);n&&(t._lightMyRequest.headers[e.toLowerCase()]=n[1])})}sA.exports=an});var oA=E((AQ,Vm)=>{"use strict";Vm.exports=Fe;Vm.exports.default=Fe;var wW={type:"object",properties:{url:{oneOf:[{type:"string"},{type:"object",properties:{protocol:{type:"string"},hostname:{type:"string"},pathname:{type:"string"}},additionalProperties:!0,required:["pathname"]}]},path:{oneOf:[{type:"string"},{type:"object",properties:{protocol:{type:"string"},hostname:{type:"string"},pathname:{type:"string"}},additionalProperties:!0,required:["pathname"]}]},cookies:{type:"object",additionalProperties:!0},headers:{type:"object",additionalProperties:!0},query:{anyOf:[{type:"object",additionalProperties:!0},{type:"string"}]},simulate:{type:"object",properties:{end:{type:"boolean"},split:{type:"boolean"},error:{type:"boolean"},close:{type:"boolean"}}},authority:{type:"string"},remoteAddress:{type:"string"},method:{type:"string",enum:["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","QUERY","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE","acl","bind","checkout","connect","copy","delete","get","head","link","lock","m-search","merge","mkactivity","mkcalendar","mkcol","move","notify","options","patch","post","propfind","proppatch","purge","put","query","rebind","report","search","source","subscribe","trace","unbind","unlink","unlock","unsubscribe"]},validate:{type:"boolean"}},additionalProperties:!0,oneOf:[{required:["url"]},{required:["path"]}]};function Fe(t,{instancePath:e="",parentData:r,parentDataProperty:n,rootData:s=t}={}){let i=null,o=0,a=o,l=!1,u=null,c=o;if(t&&typeof t=="object"&&!Array.isArray(t)){let y;if(t.url===void 0&&(y="url")){let R={instancePath:e,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:y},message:"must have required property '"+y+"'"};i===null?i=[R]:i.push(R),o++}}var p=c===o;p&&(l=!0,u=0);let f=o;if(t&&typeof t=="object"&&!Array.isArray(t)){let y;if(t.path===void 0&&(y="path")){let R={instancePath:e,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:y},message:"must have required property '"+y+"'"};i===null?i=[R]:i.push(R),o++}}var p=f===o;if(p&&l?(l=!1,u=[u,1]):p&&(l=!0,u=1),l)o=a,i!==null&&(a?i.length=a:i=null);else{let y={instancePath:e,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas:u},message:"must match exactly one schema in oneOf"};return i===null?i=[y]:i.push(y),o++,Fe.errors=i,!1}if(o===0)if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.url!==void 0){let y=t.url,R=o,T=o,O=!1,w=null,$=o;if(typeof y!="string"){let P=typeof y,C;if(C===void 0)if(P=="number"||P=="boolean")C=""+y;else if(y===null)C="";else{let k={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[k]:i.push(k),o++}C!==void 0&&(y=C,t!==void 0&&(t.url=C))}var d=$===o;d&&(O=!0,w=0);let v=o;if(o===v)if(y&&typeof y=="object"&&!Array.isArray(y)){let P;if(y.pathname===void 0&&(P="pathname")){let C={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf/1/required",keyword:"required",params:{missingProperty:P},message:"must have required property '"+P+"'"};i===null?i=[C]:i.push(C),o++}else{if(y.protocol!==void 0){let C=y.protocol,k=o;if(typeof C!="string"){let M=typeof C,J;if(J===void 0)if(M=="number"||M=="boolean")J=""+C;else if(C===null)J="";else{let U={instancePath:e+"/url/protocol",schemaPath:"#/properties/url/oneOf/1/properties/protocol/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[U]:i.push(U),o++}J!==void 0&&(C=J,y!==void 0&&(y.protocol=J))}var h=k===o}else var h=!0;if(h){if(y.hostname!==void 0){let C=y.hostname,k=o;if(typeof C!="string"){let J=typeof C,U;if(U===void 0)if(J=="number"||J=="boolean")U=""+C;else if(C===null)U="";else{let H={instancePath:e+"/url/hostname",schemaPath:"#/properties/url/oneOf/1/properties/hostname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),o++}U!==void 0&&(C=U,y!==void 0&&(y.hostname=U))}var h=k===o}else var h=!0;if(h)if(y.pathname!==void 0){let C=y.pathname,k=o;if(typeof C!="string"){let J=typeof C,U;if(U===void 0)if(J=="number"||J=="boolean")U=""+C;else if(C===null)U="";else{let H={instancePath:e+"/url/pathname",schemaPath:"#/properties/url/oneOf/1/properties/pathname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),o++}U!==void 0&&(C=U,y!==void 0&&(y.pathname=U))}var h=k===o}else var h=!0}}}else{let P={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[P]:i.push(P),o++}var d=v===o;if(d&&O?(O=!1,w=[w,1]):d&&(O=!0,w=1),O)o=T,i!==null&&(T?i.length=T:i=null);else{let P={instancePath:e+"/url",schemaPath:"#/properties/url/oneOf",keyword:"oneOf",params:{passingSchemas:w},message:"must match exactly one schema in oneOf"};return i===null?i=[P]:i.push(P),o++,Fe.errors=i,!1}var m=R===o}else var m=!0;if(m){if(t.path!==void 0){let y=t.path,R=o,T=o,O=!1,w=null,$=o;if(typeof y!="string"){let C=typeof y,k;if(k===void 0)if(C=="number"||C=="boolean")k=""+y;else if(y===null)k="";else{let M={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[M]:i.push(M),o++}k!==void 0&&(y=k,t!==void 0&&(t.path=k))}var S=$===o;S&&(O=!0,w=0);let v=o;if(o===v)if(y&&typeof y=="object"&&!Array.isArray(y)){let C;if(y.pathname===void 0&&(C="pathname")){let k={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf/1/required",keyword:"required",params:{missingProperty:C},message:"must have required property '"+C+"'"};i===null?i=[k]:i.push(k),o++}else{if(y.protocol!==void 0){let k=y.protocol,M=o;if(typeof k!="string"){let J=typeof k,U;if(U===void 0)if(J=="number"||J=="boolean")U=""+k;else if(k===null)U="";else{let H={instancePath:e+"/path/protocol",schemaPath:"#/properties/path/oneOf/1/properties/protocol/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[H]:i.push(H),o++}U!==void 0&&(k=U,y!==void 0&&(y.protocol=U))}var g=M===o}else var g=!0;if(g){if(y.hostname!==void 0){let k=y.hostname,M=o;if(typeof k!="string"){let U=typeof k,H;if(H===void 0)if(U=="number"||U=="boolean")H=""+k;else if(k===null)H="";else{let fe={instancePath:e+"/path/hostname",schemaPath:"#/properties/path/oneOf/1/properties/hostname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[fe]:i.push(fe),o++}H!==void 0&&(k=H,y!==void 0&&(y.hostname=H))}var g=M===o}else var g=!0;if(g)if(y.pathname!==void 0){let k=y.pathname,M=o;if(typeof k!="string"){let U=typeof k,H;if(H===void 0)if(U=="number"||U=="boolean")H=""+k;else if(k===null)H="";else{let fe={instancePath:e+"/path/pathname",schemaPath:"#/properties/path/oneOf/1/properties/pathname/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[fe]:i.push(fe),o++}H!==void 0&&(k=H,y!==void 0&&(y.pathname=H))}var g=M===o}else var g=!0}}}else{let C={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[C]:i.push(C),o++}var S=v===o;if(S&&O?(O=!1,w=[w,1]):S&&(O=!0,w=1),O)o=T,i!==null&&(T?i.length=T:i=null);else{let C={instancePath:e+"/path",schemaPath:"#/properties/path/oneOf",keyword:"oneOf",params:{passingSchemas:w},message:"must match exactly one schema in oneOf"};return i===null?i=[C]:i.push(C),o++,Fe.errors=i,!1}var m=R===o}else var m=!0;if(m){if(t.cookies!==void 0){let y=t.cookies,R=o;if(o===R&&!(y&&typeof y=="object"&&!Array.isArray(y)))return Fe.errors=[{instancePath:e+"/cookies",schemaPath:"#/properties/cookies/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var m=R===o}else var m=!0;if(m){if(t.headers!==void 0){let y=t.headers,R=o;if(o===R&&!(y&&typeof y=="object"&&!Array.isArray(y)))return Fe.errors=[{instancePath:e+"/headers",schemaPath:"#/properties/headers/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var m=R===o}else var m=!0;if(m){if(t.query!==void 0){let y=t.query,R=o,T=o,O=!1,w=o;if(o===w&&!(y&&typeof y=="object"&&!Array.isArray(y))){let v={instancePath:e+"/query",schemaPath:"#/properties/query/anyOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};i===null?i=[v]:i.push(v),o++}var b=w===o;if(O=O||b,!O){let v=o;if(typeof y!="string"){let C=typeof y,k;if(k===void 0)if(C=="number"||C=="boolean")k=""+y;else if(y===null)k="";else{let M={instancePath:e+"/query",schemaPath:"#/properties/query/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};i===null?i=[M]:i.push(M),o++}k!==void 0&&(y=k,t!==void 0&&(t.query=k))}var b=v===o;O=O||b}if(O)o=T,i!==null&&(T?i.length=T:i=null);else{let v={instancePath:e+"/query",schemaPath:"#/properties/query/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return i===null?i=[v]:i.push(v),o++,Fe.errors=i,!1}var m=R===o}else var m=!0;if(m){if(t.simulate!==void 0){let y=t.simulate,R=o;if(o===R)if(y&&typeof y=="object"&&!Array.isArray(y)){if(y.end!==void 0){let O=y.end,w=o;if(typeof O!="boolean"){let $;if($===void 0)if(O==="false"||O===0||O===null)$=!1;else if(O==="true"||O===1)$=!0;else return Fe.errors=[{instancePath:e+"/simulate/end",schemaPath:"#/properties/simulate/properties/end/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;$!==void 0&&(O=$,y!==void 0&&(y.end=$))}var _=w===o}else var _=!0;if(_){if(y.split!==void 0){let O=y.split,w=o;if(typeof O!="boolean"){let v;if(v===void 0)if(O==="false"||O===0||O===null)v=!1;else if(O==="true"||O===1)v=!0;else return Fe.errors=[{instancePath:e+"/simulate/split",schemaPath:"#/properties/simulate/properties/split/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;v!==void 0&&(O=v,y!==void 0&&(y.split=v))}var _=w===o}else var _=!0;if(_){if(y.error!==void 0){let O=y.error,w=o;if(typeof O!="boolean"){let v;if(v===void 0)if(O==="false"||O===0||O===null)v=!1;else if(O==="true"||O===1)v=!0;else return Fe.errors=[{instancePath:e+"/simulate/error",schemaPath:"#/properties/simulate/properties/error/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;v!==void 0&&(O=v,y!==void 0&&(y.error=v))}var _=w===o}else var _=!0;if(_)if(y.close!==void 0){let O=y.close,w=o;if(typeof O!="boolean"){let v;if(v===void 0)if(O==="false"||O===0||O===null)v=!1;else if(O==="true"||O===1)v=!0;else return Fe.errors=[{instancePath:e+"/simulate/close",schemaPath:"#/properties/simulate/properties/close/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;v!==void 0&&(O=v,y!==void 0&&(y.close=v))}var _=w===o}else var _=!0}}}else return Fe.errors=[{instancePath:e+"/simulate",schemaPath:"#/properties/simulate/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var m=R===o}else var m=!0;if(m){if(t.authority!==void 0){let y=t.authority,R=o;if(typeof y!="string"){let O=typeof y,w;if(w===void 0)if(O=="number"||O=="boolean")w=""+y;else if(y===null)w="";else return Fe.errors=[{instancePath:e+"/authority",schemaPath:"#/properties/authority/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;w!==void 0&&(y=w,t!==void 0&&(t.authority=w))}var m=R===o}else var m=!0;if(m){if(t.remoteAddress!==void 0){let y=t.remoteAddress,R=o;if(typeof y!="string"){let O=typeof y,w;if(w===void 0)if(O=="number"||O=="boolean")w=""+y;else if(y===null)w="";else return Fe.errors=[{instancePath:e+"/remoteAddress",schemaPath:"#/properties/remoteAddress/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;w!==void 0&&(y=w,t!==void 0&&(t.remoteAddress=w))}var m=R===o}else var m=!0;if(m){if(t.method!==void 0){let y=t.method,R=o;if(typeof y!="string"){let O=typeof y,w;if(w===void 0)if(O=="number"||O=="boolean")w=""+y;else if(y===null)w="";else return Fe.errors=[{instancePath:e+"/method",schemaPath:"#/properties/method/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;w!==void 0&&(y=w,t!==void 0&&(t.method=w))}if(!(y==="ACL"||y==="BIND"||y==="CHECKOUT"||y==="CONNECT"||y==="COPY"||y==="DELETE"||y==="GET"||y==="HEAD"||y==="LINK"||y==="LOCK"||y==="M-SEARCH"||y==="MERGE"||y==="MKACTIVITY"||y==="MKCALENDAR"||y==="MKCOL"||y==="MOVE"||y==="NOTIFY"||y==="OPTIONS"||y==="PATCH"||y==="POST"||y==="PROPFIND"||y==="PROPPATCH"||y==="PURGE"||y==="PUT"||y==="QUERY"||y==="REBIND"||y==="REPORT"||y==="SEARCH"||y==="SOURCE"||y==="SUBSCRIBE"||y==="TRACE"||y==="UNBIND"||y==="UNLINK"||y==="UNLOCK"||y==="UNSUBSCRIBE"||y==="acl"||y==="bind"||y==="checkout"||y==="connect"||y==="copy"||y==="delete"||y==="get"||y==="head"||y==="link"||y==="lock"||y==="m-search"||y==="merge"||y==="mkactivity"||y==="mkcalendar"||y==="mkcol"||y==="move"||y==="notify"||y==="options"||y==="patch"||y==="post"||y==="propfind"||y==="proppatch"||y==="purge"||y==="put"||y==="query"||y==="rebind"||y==="report"||y==="search"||y==="source"||y==="subscribe"||y==="trace"||y==="unbind"||y==="unlink"||y==="unlock"||y==="unsubscribe"))return Fe.errors=[{instancePath:e+"/method",schemaPath:"#/properties/method/enum",keyword:"enum",params:{allowedValues:wW.properties.method.enum},message:"must be equal to one of the allowed values"}],!1;var m=R===o}else var m=!0;if(m)if(t.validate!==void 0){let y=t.validate,R=o;if(typeof y!="boolean"){let O;if(O===void 0)if(y==="false"||y===0||y===null)O=!1;else if(y==="true"||y===1)O=!0;else return Fe.errors=[{instancePath:e+"/validate",schemaPath:"#/properties/validate/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;O!==void 0&&(y=O,t!==void 0&&(t.validate=O))}var m=R===o}else var m=!0}}}}}}}}}else return Fe.errors=[{instancePath:e,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return Fe.errors=i,o===0}});var uA=E((CQ,To)=>{"use strict";var RW=V("node:assert"),zm=QP(),vu=iA(),Ru="The dispatch function has already been invoked",aA=oA();function Um(t,e,r){return r===void 0?new Oo(t,e):wu(t,e,r)}function OW(t,e){let r=t._lightMyRequest.payload;if(!r||r._readableState||typeof r.resume!="function")return e();let n=[];r.on("data",s=>n.push(Buffer.from(s))),r.on("end",()=>{let s=Buffer.concat(n);return t.headers["content-length"]=t.headers["content-length"]||""+s.length,delete t.headers["transfer-encoding"],t._lightMyRequest.payload=s,e()}),r.resume()}function lA(t,e,r,n){return r.once("error",function(s){this.destroyed&&n.destroy(s)}),r.once("close",function(){this.destroyed&&!this._error&&n.destroy()}),OW(r,()=>t.call(e,r,n))}function wu(t,e,r){if(e=typeof e=="string"?{url:e}:e,e.validate!==!1&&(RW(typeof t=="function","dispatchFunc should be a function"),!aA(e)))throw new Error(aA.errors.map(o=>o.message));let n=e.server||{},s=e.Request?zm.CustomRequest:zm;if(t.request&&t.request.app===t&&(Object.setPrototypeOf(Object.getPrototypeOf(t.request),s.prototype),Object.setPrototypeOf(Object.getPrototypeOf(t.response),vu.prototype)),typeof r=="function"){let i=new s(e),o=new vu(i,r);return lA(t,n,i,o)}else return new Promise((i,o)=>{let a=new s(e),l=new vu(a,i,o);lA(t,n,a,l)})}function Oo(t,e){typeof e=="string"?this.option={url:e}:this.option=Object.assign({},e),this.dispatch=t,this._hasInvoked=!1,this._promise=null,this.option.autoStart!==!1&&process.nextTick(()=>{this._hasInvoked||this.end()})}var TW=["delete","get","head","options","patch","post","put","trace"];TW.forEach(t=>{Oo.prototype[t]=function(e){if(this._hasInvoked===!0||this._promise)throw new Error(Ru);return this.option.url=e,this.option.method=t.toUpperCase(),this}});var $W=["body","cookies","headers","payload","query"];$W.forEach(t=>{Oo.prototype[t]=function(e){if(this._hasInvoked===!0||this._promise)throw new Error(Ru);return this.option[t]=e,this}});Oo.prototype.end=function(t){if(this._hasInvoked===!0||this._promise)throw new Error(Ru);if(this._hasInvoked=!0,typeof t=="function")wu(this.dispatch,this.option,t);else return this._promise=wu(this.dispatch,this.option),this._promise};Object.getOwnPropertyNames(Promise.prototype).forEach(t=>{t!=="constructor"&&(Oo.prototype[t]=function(...e){if(!this._promise){if(this._hasInvoked===!0)throw new Error(Ru);this._hasInvoked=!0,this._promise=wu(this.dispatch,this.option)}return this._promise[t](...e)})});function PW(t){return t instanceof zm||t instanceof vu||t?.constructor?.name==="_CustomLMRRequest"}To.exports=Um;To.exports.default=Um;To.exports.inject=Um;To.exports.isInjection=PW});var OA=E((IQ,Io)=>{"use strict";var AW="5.7.2",CW=oy(),Pu=V("node:http"),IW=V("node:diagnostics_channel"),$o,{kAvvioBoot:Po,kChildren:Bm,kServerBindings:cA,kBodyLimit:NW,kSupportedHTTPMethods:jn,kRoutePrefix:fA,kLogLevel:kW,kLogSerializers:xW,kHooks:Gm,kSchemaController:ln,kRequestAcceptVersion:LW,kReplySerializerDefault:dA,kContentTypeParser:qW,kReply:jW,kRequest:DW,kFourOhFour:FW,kState:$e,kOptions:Wm,kPluginNameChain:Ao,kSchemaErrorFormatter:Jm,kErrorHandler:Ou,kKeepAliveConnections:Km,kChildLoggerFactory:Ym,kGenReqId:Xm,kErrorHandlerAlreadySet:Tu}=De(),{createServer:MW}=xy(),Co=Aa(),$u=La(),HW=qa(),Dn=hi(),Fn=Vf(),hA=kp(),{Hooks:VW,hookRunnerApplication:pA,supportedHooks:Qm}=Fr(),{createChildLogger:mA,defaultChildLoggerFactory:zW,createLogger:UW}=li(),gA=sm(),{getGenReqId:yA,reqIdGenFactory:wA}=Xl(),{buildRouting:BW,validateBodyLimitOption:GW,buildRouterOptions:WW}=EP(),JW=$P(),RA=AP(),KW=DP(),{appendStackTrace:YW,AVVIO_ERRORS_MAP:_A,...Mn}=He(),XW=uc(),{defaultInitOptions:wt}=RA,{FST_ERR_ASYNC_CONSTRAINT:QW,FST_ERR_BAD_URL:ZW,FST_ERR_OPTIONS_NOT_OBJ:eJ,FST_ERR_QSP_NOT_FN:tJ,FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN:rJ,FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ:nJ,FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR:sJ,FST_ERR_INSTANCE_ALREADY_LISTENING:iJ,FST_ERR_REOPENED_CLOSE_SERVER:oJ,FST_ERR_ROUTE_REWRITE_NOT_STR:aJ,FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN:SA,FST_ERR_ERROR_HANDLER_NOT_FN:lJ,FST_ERR_ERROR_HANDLER_ALREADY_SET:uJ,FST_ERR_ROUTE_METHOD_INVALID:cJ}=Mn,{buildErrorHandler:EA}=ci(),{FSTWRN004:fJ}=Kn(),bA=IW.channel("fastify.initialization");function Zm(t){let{options:e,genReqId:r,disableRequestLogging:n,hasLogger:s,initialConfig:i}=dJ(t,P,C),o=BW(e.routerOptions),a=JW(e),l=me(o,e),{server:u,listen:c,forceCloseConnections:f,serverHasCloseAllConnections:p,serverHasCloseHttp2Sessions:h,keepAliveConnections:d}=MW(e,l),m=Co.setupResponseListeners,g=hA.buildSchemaController(null,e.schemaController),S={[$e]:{listening:!1,closing:!1,started:!1,ready:!1,booting:!1,aborted:!1,readyResolver:null},[Km]:d,[jn]:{bodyless:new Set(["GET","HEAD","TRACE"]),bodywith:new Set(["DELETE","OPTIONS","PATCH","PUT","POST"])},[Wm]:e,[Bm]:[],[cA]:[],[NW]:e.bodyLimit,[fA]:"",[kW]:"",[xW]:null,[Gm]:new VW,[ln]:g,[Jm]:null,[Ou]:EA(),[Tu]:!1,[Ym]:e.childLoggerFactory||zW,[dA]:null,[qW]:new Fn(e.bodyLimit,e.onProtoPoisoning||wt.onProtoPoisoning,e.onConstructorPoisoning||wt.onConstructorPoisoning),[jW]:Co.buildReply(Co),[DW]:$u.buildRequest($u,e.trustProxy),[FW]:a,[gA.kRegisteredPlugins]:[],[Ao]:["fastify"],[Po]:null,[Xm]:r,routing:l,delete:function(N,q,j){return o.prepareRoute.call(this,{method:"DELETE",url:N,options:q,handler:j})},get:function(N,q,j){return o.prepareRoute.call(this,{method:"GET",url:N,options:q,handler:j})},head:function(N,q,j){return o.prepareRoute.call(this,{method:"HEAD",url:N,options:q,handler:j})},trace:function(N,q,j){return o.prepareRoute.call(this,{method:"TRACE",url:N,options:q,handler:j})},patch:function(N,q,j){return o.prepareRoute.call(this,{method:"PATCH",url:N,options:q,handler:j})},post:function(N,q,j){return o.prepareRoute.call(this,{method:"POST",url:N,options:q,handler:j})},put:function(N,q,j){return o.prepareRoute.call(this,{method:"PUT",url:N,options:q,handler:j})},options:function(N,q,j){return o.prepareRoute.call(this,{method:"OPTIONS",url:N,options:q,handler:j})},all:function(N,q,j){return o.prepareRoute.call(this,{method:this.supportedMethods,url:N,options:q,handler:j})},route:function(N){return o.route.call(this,{options:N})},hasRoute:function(N){return o.hasRoute.call(this,{options:N})},findRoute:function(N){return o.findRoute(N)},log:e.logger,withTypeProvider:w,addHook:$,addSchema:v,getSchema:g.getSchema.bind(g),getSchemas:g.getSchemas.bind(g),setValidatorCompiler:J,setSerializerCompiler:H,setSchemaController:fe,setReplySerializer:ze,setSchemaErrorFormatter:U,setGenReqId:pe,addContentTypeParser:Fn.helpers.addContentTypeParser,hasContentTypeParser:Fn.helpers.hasContentTypeParser,getDefaultJsonParser:Fn.defaultParsers.getDefaultJsonParser,defaultTextParser:Fn.defaultParsers.defaultTextParser,removeContentTypeParser:Fn.helpers.removeContentTypeParser,removeAllContentTypeParsers:Fn.helpers.removeAllContentTypeParsers,register:null,after:null,ready:null,onClose:null,close:null,printPlugins:null,hasPlugin:function(A){return this[gA.kRegisteredPlugins].includes(A)||this[Ao].includes(A)},listen:c,server:u,addresses:function(){let A=this[cA].map(N=>N.address());return A.push(this.server.address()),A.filter(N=>N)},decorate:Dn.add,hasDecorator:Dn.exist,decorateReply:Dn.decorateReply,decorateRequest:Dn.decorateRequest,hasRequestDecorator:Dn.existRequest,hasReplyDecorator:Dn.existReply,getDecorator:Dn.getInstanceDecorator,addHttpMethod:Hn,inject:T,printRoutes:Lr,setNotFoundHandler:M,setErrorHandler:G,setChildLoggerFactory:Rt,initialConfig:i,addConstraintStrategy:o.addConstraintStrategy.bind(o),hasConstraintStrategy:o.hasConstraintStrategy.bind(o)};Object.defineProperties(S,{listeningOrigin:{get(){let A=this.addresses().slice(-1).pop();if(typeof A=="string")return A;let N=A.family==="IPv6"?`[${A.address}]`:A.address;return`${this[Wm].https?"https":"http"}://${N}:${A.port}`}},pluginName:{configurable:!0,get(){return this[Ao].length>1?this[Ao].join(" -> "):this[Ao][0]}},prefix:{configurable:!0,get(){return this[fA]}},validatorCompiler:{configurable:!0,get(){return this[ln].getValidatorCompiler()}},serializerCompiler:{configurable:!0,get(){return this[ln].getSerializerCompiler()}},childLoggerFactory:{configurable:!0,get(){return this[Ym]}},version:{configurable:!0,get(){return AW}},errorHandler:{configurable:!0,get(){return this[Ou].func}},genReqId:{configurable:!0,get(){return this[Xm]}},supportedMethods:{configurable:!1,get(){return[...this[jn].bodyless,...this[jn].bodywith]}}}),e.schemaErrorFormatter&&(vA(e.schemaErrorFormatter),S[Jm]=e.schemaErrorFormatter.bind(S));let b=Number(e.pluginTimeout),_=CW(S,{autostart:!1,timeout:isNaN(b)===!1?b:wt.pluginTimeout,expose:{use:"register"}});_.override=KW,_.on("start",()=>S[$e].started=!0),S[Po]=S.ready,S.ready=O,S.printPlugins=_.prettyPrint.bind(_),_.once("preReady",()=>{S.onClose((A,N)=>{S[$e].closing=!0,o.closeRoutes(),pA("preClose",S[Po],S,function(){if(S[$e].listening){if(f==="idle")A.server.closeIdleConnections();else if(p&&f)A.server.closeAllConnections();else if(f===!0)for(let q of S[Km])q.destroy(),S[Km].delete(q)}h&&A.server.closeHttp2Sessions(),!e.serverFactory||S[$e].listening?A.server.close(function(q){q&&q.code!=="ERR_SERVER_NOT_RUNNING"?N(null):N()}):process.nextTick(N,null)})})});let y=new HW({server:S,config:{}});return S.setNotFoundHandler(),a.arrange404(S),o.setup(e,{avvio:_,fourOhFour:a,hasLogger:s,setupResponseListeners:m,throwIfAlreadyStarted:R,keepAliveConnections:d}),u.on("clientError",e.clientErrorHandler.bind(S)),bA.hasSubscribers&&bA.publish({fastify:S}),"asyncDispose"in Symbol&&(S[Symbol.asyncDispose]=function(){return S.close()}),S;function R(A){if(S[$e].started)throw new iJ(A)}function T(A,N){if($o===void 0&&($o=uA()),S[$e].started){if(S[$e].closing){let q=new oJ;if(N){N(q);return}else return Promise.reject(q)}return $o(l,A,N)}if(N)this.ready(q=>{q?N(q,null):$o(l,A,N)});else return $o((q,j)=>{this.ready(function(ue){if(ue){j.emit("error",ue);return}l(q,j)})},A)}function O(A){if(this[$e].readyResolver!==null){if(A!=null){this[$e].readyResolver.promise.then(()=>A(null,S),A);return}return this[$e].readyResolver.promise}if(process.nextTick(N),this[$e].readyResolver=XW.withResolvers(),A)this[$e].readyResolver.promise.then(()=>A(null,S),A);else return this[$e].readyResolver.promise;function N(){S[Po]((j,ue)=>{j||S[$e].started||S[$e].ready||S[$e].booting?q(j):(S[$e].booting=!0,pA("onReady",S[Po],S,q)),ue()})}function q(j){if(j=j!=null&&_A[j.code]!=null?YW(j,new _A[j.code](j.message)):j,j)return S[$e].readyResolver.reject(j);S[$e].readyResolver.resolve(S),S[$e].booting=!1,S[$e].ready=!0,S[$e].readyResolver=null}}function w(){return this}function $(A,N){if(R('Cannot call "addHook"!'),N==null)throw new Mn.FST_ERR_HOOK_INVALID_HANDLER(A,N);if(A==="onSend"||A==="preSerialization"||A==="onError"||A==="preParsing"){if(N.constructor.name==="AsyncFunction"&&N.length===4)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER}else if(A==="onReady"||A==="onListen"){if(N.constructor.name==="AsyncFunction"&&N.length!==0)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER}else if(A==="onRequestAbort"){if(N.constructor.name==="AsyncFunction"&&N.length!==1)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER}else if(N.constructor.name==="AsyncFunction"&&N.length===3)throw new Mn.FST_ERR_HOOK_INVALID_ASYNC_HANDLER;return A==="onClose"?this.onClose(N.bind(this)):A==="onReady"||A==="onListen"||A==="onRoute"?this[Gm].add(A,N):this.after((j,ue)=>{try{q.call(this,A,N),ue(j)}catch(de){ue(de)}}),this;function q(j,ue){this[Gm].add(j,ue),this[Bm].forEach(de=>q.call(de,j,ue))}}function v(A){return R('Cannot call "addSchema"!'),this[ln].add(A),this[Bm].forEach(N=>N.addSchema(A)),this}function P(A,N){A.headers["accept-version"]!==void 0&&(A.headers[LW]=A.headers["accept-version"],A.headers["accept-version"]=void 0),a.router.lookup(A,N)}function C(A,N,q){if(e.frameworkErrors){let ue=yA(y.server,N),de=mA(y,e.logger,N,ue),Me=new $u(ue,null,N,null,de,y),Y=new Co(q,Me,de);return(typeof n=="function"?n(N):n)===!1&&de.info({req:Me},"incoming request"),e.frameworkErrors(new ZW(A),Me,Y)}let j=JSON.stringify({error:"Bad Request",code:"FST_ERR_BAD_URL",message:`'${A}' is not a valid url component`,statusCode:400});q.writeHead(400,{"Content-Type":"application/json","Content-Length":Buffer.byteLength(j)}),q.end(j)}function k(A,N,q){if(A!==!1)return function(ue){if(ue){if(e.frameworkErrors){let Me=yA(y.server,N),Y=mA(y,e.logger,N,Me),$t=new $u(Me,null,N,null,Y,y),Pe=new Co(q,$t,Y);return(typeof n=="function"?n(N):n)===!1&&Y.info({req:$t},"incoming request"),e.frameworkErrors(new QW,$t,Pe)}let de='{"error":"Internal Server Error","message":"Unexpected error from async constraint","statusCode":500}';q.writeHead(500,{"Content-Type":"application/json","Content-Length":de.length}),q.end(de)}}}function M(A,N){return R('Cannot call "setNotFoundHandler"!'),a.setNotFoundHandler.call(this,A,N,_,o.routeHandler),this}function J(A){return R('Cannot call "setValidatorCompiler"!'),this[ln].setValidatorCompiler(A),this}function U(A){return R('Cannot call "setSchemaErrorFormatter"!'),vA(A),this[Jm]=A.bind(this),this}function H(A){return R('Cannot call "setSerializerCompiler"!'),this[ln].setSerializerCompiler(A),this}function fe(A){R('Cannot call "setSchemaController"!');let N=this[ln],q=hA.buildSchemaController(N,Object.assign({},N.opts,A));return this[ln]=q,this.getSchema=q.getSchema.bind(q),this.getSchemas=q.getSchemas.bind(q),this}function ze(A){return R('Cannot call "setReplySerializer"!'),this[dA]=A,this}function G(A){if(R('Cannot call "setErrorHandler"!'),typeof A!="function")throw new lJ;if(!e.allowErrorHandlerOverride&&this[Tu])throw new uJ;return this[Tu]&&fJ("To disable this behavior, set 'allowErrorHandlerOverride' to false or ignore this message. For more information, visit: https://fastify.dev/docs/latest/Reference/Server/#allowerrorhandleroverride"),this[Tu]=!0,this[Ou]=EA(this[Ou],A.bind(this)),this}function Rt(A){return R('Cannot call "setChildLoggerFactory"!'),this[Ym]=A,this}function Lr(A={}){return A.includeMeta=A.includeHooks?A.includeMeta?Qm.concat(A.includeMeta):Qm:A.includeMeta,o.printRoutes(A)}function me(A,{rewriteUrl:N,logger:q}){let j;return function(de,Me){if(j===void 0&&(j=A.isAsyncConstraint()),N){de.originalUrl=de.url;let Y=N.call(S,de);if(typeof Y=="string")de.url=Y;else{let $t=new aJ(de.url,typeof Y);de.destroy($t)}}A.routing(de,Me,k(j,de,Me))}}function pe(A){return R('Cannot call "setGenReqId"!'),this[Xm]=wA(this[Wm].requestIdHeader,A),this}function Hn(A,{hasBody:N=!1}={}){if(typeof A!="string"||Pu.METHODS.indexOf(A)===-1)throw new cJ;N===!0?(this[jn].bodywith.add(A),this[jn].bodyless.delete(A)):(this[jn].bodywith.delete(A),this[jn].bodyless.add(A));let q=A.toLowerCase();return this.hasDecorator(q)||this.decorate(q,function(j,ue,de){return o.prepareRoute.call(this,{method:A,url:j,options:ue,handler:de})}),this}}function dJ(t,e,r){if(t&&typeof t!="object")throw new eJ;if(t=Object.assign({},t),t.querystringParser&&typeof t.querystringParser!="function"||t.routerOptions?.querystringParser&&typeof t.routerOptions.querystringParser!="function")throw new tJ(typeof(t.querystringParser??t.routerOptions.querystringParser));if(t.schemaController&&t.schemaController.bucket&&typeof t.schemaController.bucket!="function")throw new rJ(typeof t.schemaController.bucket);GW(t.bodyLimit);let n=typeof t.requestIdHeader=="string"&&t.requestIdHeader.length!==0?t.requestIdHeader.toLowerCase():t.requestIdHeader===!0&&"request-id",s=wA(n,t.genReqId),i=t.requestIdLogLabel||"reqId";t.bodyLimit=t.bodyLimit||wt.bodyLimit;let o=t.disableRequestLogging||!1,a=Object.assign({customOptions:{},plugins:[]},t.ajv);if(!a.customOptions||Object.prototype.toString.call(a.customOptions)!=="[object Object]")throw new nJ(typeof a.customOptions);if(!a.plugins||!Array.isArray(a.plugins))throw new sJ(typeof a.plugins);let{logger:l,hasLogger:u}=UW(t);t.connectionTimeout=t.connectionTimeout||wt.connectionTimeout,t.keepAliveTimeout=t.keepAliveTimeout||wt.keepAliveTimeout,t.maxRequestsPerSocket=t.maxRequestsPerSocket||wt.maxRequestsPerSocket,t.requestTimeout=t.requestTimeout||wt.requestTimeout,t.logger=l,t.requestIdHeader=n,t.requestIdLogLabel=i,t.disableRequestLogging=o,t.ajv=a,t.clientErrorHandler=t.clientErrorHandler||pJ,t.allowErrorHandlerOverride=t.allowErrorHandlerOverride??wt.allowErrorHandlerOverride;let c=RA(t);return t.exposeHeadRoutes=c.exposeHeadRoutes,t.http2SessionTimeout=c.http2SessionTimeout,t.routerOptions=WW(t,{defaultRoute:e,onBadUrl:r,ignoreTrailingSlash:wt.ignoreTrailingSlash,ignoreDuplicateSlashes:wt.ignoreDuplicateSlashes,maxParamLength:wt.maxParamLength,allowUnsafeRegex:wt.allowUnsafeRegex,buildPrettyMeta:hJ,useSemicolonDelimiter:wt.useSemicolonDelimiter}),{options:t,genReqId:s,disableRequestLogging:o,hasLogger:u,initialConfig:c}}function hJ(t){let e={};return["errorHandler","logLevel","logSerializers"].concat(Qm).forEach(n=>{e[n]=t.store[n]}),Object.assign({},e)}function pJ(t,e){if(t.code==="ECONNRESET"||e.destroyed)return;let r,n,s,i;t.code==="ERR_HTTP_REQUEST_TIMEOUT"?(n="408",s=Pu.STATUS_CODES[n],r=`{"error":"${s}","message":"Client Timeout","statusCode":408}`,i="timeout"):t.code==="HPE_HEADER_OVERFLOW"?(n="431",s=Pu.STATUS_CODES[n],r=`{"error":"${s}","message":"Exceeded maximum allowed HTTP header size","statusCode":431}`,i="header_overflow"):(n="400",s=Pu.STATUS_CODES[n],r=`{"error":"${s}","message":"Client Error","statusCode":400}`,i="error"),this.log.trace({err:t},`client ${i}`),e.writable&&e.write(`HTTP/1.1 ${n} ${s}\r
375
375
  Content-Length: ${r.length}\r
376
376
  Content-Type: application/json\r
377
377
  \r
378
- ${r}`),e.destroy(t)}function bA(t){if(typeof t!="function")throw new _A(typeof t);if(t.constructor.name==="AsyncFunction")throw new _A("AsyncFunction")}Co.exports=Qm;Co.exports.errorCodes=Mn;Co.exports.fastify=Qm;Co.exports.default=Qm});import{spawn as BJ}from"node:child_process";var Sg=og(_g(),1),{program:u8,createCommand:c8,createArgument:f8,createOption:d8,CommanderError:h8,InvalidArgumentError:p8,InvalidOptionArgumentError:m8,Command:Eg,Argument:g8,Option:y8,Help:_8}=Sg.default;var _J=og(RA(),1);import{readFile as cJ,writeFile as fJ,mkdir as dJ}from"node:fs/promises";import{homedir as hJ}from"node:os";import{join as TA,dirname as pJ}from"node:path";var OA="Iv1.b507a08c87ecfe98";async function Zm(){let t=await fetch("https://github.com/login/device/code",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:OA,scope:"read:user"})});if(!t.ok)throw new Error(`Device flow initiation failed: ${t.statusText}`);return t.json()}async function eg(t,e=5){let r=e;for(;;){await new Promise(i=>setTimeout(i,r*1e3));let s=await(await fetch("https://github.com/login/oauth/access_token",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:OA,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(s.access_token)return s.access_token;if(s.error!=="authorization_pending"){if(s.error==="slow_down"){r+=5;continue}throw new Error(`Authentication failed: ${s.error||"Unknown error"}`)}}}async function Us(t){let e=await fetch("https://api.github.com/copilot_internal/v2/token",{method:"GET",headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(!e.ok){let n=await e.text();throw new Error(`Failed to get Copilot token: ${e.status} ${e.statusText} - ${n}`)}let r=await e.json();return{token:r.token,expiresAt:r.expires_at*1e3}}var mJ=TA(hJ(),".config","claude-pilot"),tg=TA(mJ,"auth.json");async function xr(t=tg){try{let e=await cJ(t,"utf-8");return JSON.parse(e)}catch{return null}}async function Pu(t,e=tg){await dJ(pJ(e),{recursive:!0}),await fJ(e,JSON.stringify(t,null,2))}async function Au(t,e=tg){let n=Date.now();if(t.copilotTokenExpiresAt-n>3e5)return t.copilotToken;console.log("Refreshing Copilot token...");let s=await Us(t.githubToken);return t.copilotToken=s.token,t.copilotTokenExpiresAt=s.expiresAt,await Pu(t,e),console.log("Copilot token refreshed"),s.token}var qQ=process.env.COPILOT_PATH||"copilot",jQ=parseInt(process.env.WEB_SEARCH_TIMEOUT||"60000",10),DQ=process.env.WEB_SEARCH_MODEL||"gpt-4.1";import{exec as gJ}from"child_process";import{promisify as yJ}from"util";var VQ=yJ(gJ);import{homedir as SJ}from"node:os";import{join as Io}from"node:path";var yr=Io(SJ(),".config","claude-pilot"),ft=Io(yr,"auth.json"),Cu=Io(yr,"daemon.json"),Iu=Io(yr,"server.log"),WZ=Io(yr,"requests.jsonl"),Nu=51080;async function $A(){console.log(`Claude Pilot - GitHub Copilot Authentication
378
+ ${r}`),e.destroy(t)}function vA(t){if(typeof t!="function")throw new SA(typeof t);if(t.constructor.name==="AsyncFunction")throw new SA("AsyncFunction")}Io.exports=Zm;Io.exports.errorCodes=Mn;Io.exports.fastify=Zm;Io.exports.default=Zm});import{spawn as ZJ}from"node:child_process";var Eg=ag(Sg(),1),{program:y8,createCommand:_8,createArgument:S8,createOption:E8,CommanderError:b8,InvalidArgumentError:v8,InvalidOptionArgumentError:w8,Command:bg,Argument:R8,Option:O8,Help:T8}=Eg.default;var wJ=ag(OA(),1);import{readFile as mJ,writeFile as gJ,mkdir as yJ}from"node:fs/promises";import{homedir as _J}from"node:os";import{join as $A,dirname as SJ}from"node:path";var TA="Iv1.b507a08c87ecfe98";async function eg(){let t=await fetch("https://github.com/login/device/code",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:TA,scope:"read:user"})});if(!t.ok)throw new Error(`Device flow initiation failed: ${t.statusText}`);return t.json()}async function tg(t,e=5){let r=e;for(;;){await new Promise(i=>setTimeout(i,r*1e3));let s=await(await fetch("https://github.com/login/oauth/access_token",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:TA,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(s.access_token)return s.access_token;if(s.error!=="authorization_pending"){if(s.error==="slow_down"){r+=5;continue}throw new Error(`Authentication failed: ${s.error||"Unknown error"}`)}}}async function Us(t){let e=await fetch("https://api.github.com/copilot_internal/v2/token",{method:"GET",headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(!e.ok){let n=await e.text();throw new Error(`Failed to get Copilot token: ${e.status} ${e.statusText} - ${n}`)}let r=await e.json();return{token:r.token,expiresAt:r.expires_at*1e3}}var EJ=$A(_J(),".config","claude-pilot"),rg=$A(EJ,"auth.json");async function xr(t=rg){try{let e=await mJ(t,"utf-8");return JSON.parse(e)}catch{return null}}async function Au(t,e=rg){await yJ(SJ(e),{recursive:!0}),await gJ(e,JSON.stringify(t,null,2))}async function Cu(t,e=rg){let n=Date.now();if(t.copilotTokenExpiresAt-n>3e5)return t.copilotToken;console.log("Refreshing Copilot token...");let s=await Us(t.githubToken);return t.copilotToken=s.token,t.copilotTokenExpiresAt=s.expiresAt,await Au(t,e),console.log("Copilot token refreshed"),s.token}var UQ=process.env.COPILOT_PATH||"copilot",BQ=parseInt(process.env.WEB_SEARCH_TIMEOUT||"60000",10),GQ=process.env.WEB_SEARCH_MODEL||"gpt-4.1";import{exec as bJ}from"child_process";import{promisify as vJ}from"util";var YQ=vJ(bJ);import{homedir as RJ}from"node:os";import{join as Bs}from"node:path";import{readFileSync as OJ,writeFileSync as TJ,mkdirSync as $J}from"node:fs";var Ht=Bs(RJ(),".config","claude-pilot"),ft=Bs(Ht,"auth.json"),Iu=Bs(Ht,"daemon.json"),AA=Bs(Ht,"config.json"),Nu=Bs(Ht,"server.log"),ree=Bs(Ht,"requests.jsonl"),ku=51080,PA={mode:"copilot"};function No(){try{let t=OJ(AA,"utf-8");return{...PA,...JSON.parse(t)}}catch{return PA}}function CA(t){$J(Ht,{recursive:!0});let r={...No(),...t};return TJ(AA,JSON.stringify(r,null,2)),r}async function IA(){console.log(`Claude Pilot - GitHub Copilot Authentication
379
379
  `);let t=await xr(ft);if(t){console.log("Existing credentials found."),console.log(`To re-authenticate, delete ${ft}
380
380
  `);try{let s=await Us(t.githubToken);console.log("\u2713 Credentials are valid"),console.log(` Copilot token expires: ${new Date(s.expiresAt).toLocaleString()}`);return}catch{console.log(`\u2717 Credentials are invalid, re-authenticating...
381
381
  `)}}console.log(`Starting GitHub OAuth device flow...
382
- `);let e=await Zm();console.log("Please visit:",e.verification_uri),console.log("And enter code:",e.user_code),console.log(`
383
- Waiting for authorization...`);let r=await eg(e.device_code,e.interval);console.log(`
384
- \u2713 GitHub authentication successful`),console.log("Exchanging for Copilot token...");let n=await Us(r);console.log("\u2713 Copilot token obtained"),await Pu({githubToken:r,copilotToken:n.token,copilotTokenExpiresAt:n.expiresAt},ft),console.log(`
382
+ `);let e=await eg();console.log("Please visit:",e.verification_uri),console.log("And enter code:",e.user_code),console.log(`
383
+ Waiting for authorization...`);let r=await tg(e.device_code,e.interval);console.log(`
384
+ \u2713 GitHub authentication successful`),console.log("Exchanging for Copilot token...");let n=await Us(r);console.log("\u2713 Copilot token obtained"),await Au({githubToken:r,copilotToken:n.token,copilotTokenExpiresAt:n.expiresAt},ft),console.log(`
385
385
  \u2713 Credentials saved to ${ft}`),console.log(`
386
- You can now start the proxy with: claude-pilot start`)}import{unlink as TJ}from"node:fs/promises";import{readFile as EJ,writeFile as bJ,mkdir as vJ,unlink as wJ}from"node:fs/promises";async function RJ(){try{let t=await EJ(Cu,"utf-8");return JSON.parse(t)}catch{return null}}async function PA(t){await vJ(yr,{recursive:!0}),await bJ(Cu,JSON.stringify(t,null,2))}async function ku(){try{await wJ(Cu)}catch{}}function OJ(t){try{return process.kill(t,0),!0}catch{return!1}}async function Tt(){let t=await RJ();return t?OJ(t.pid)?{running:!0,state:t}:(await ku(),{running:!1,state:null}):{running:!1,state:null}}async function xu(){let{running:t,state:e}=await Tt();if(!t||!e){console.log("Proxy is not running");return}console.log(`Stopping proxy (PID: ${e.pid})...`);try{process.kill(e.pid,"SIGTERM"),await new Promise(r=>setTimeout(r,1e3));try{process.kill(e.pid,0),console.log("Process did not exit gracefully, forcing..."),process.kill(e.pid,"SIGKILL")}catch{}await ku(),console.log("\u2713 Proxy stopped")}catch{await ku(),console.log("\u2713 Proxy stopped (was already exiting)")}}async function AA(){let{running:t}=await Tt();t&&await xu();try{await TJ(ft),console.log("\u2713 Logged out successfully"),console.log(` Removed ${ft}`)}catch(e){if(e.code==="ENOENT")console.log("Already logged out (no credentials found)");else throw e}}import{spawn as $J}from"node:child_process";import{createServer as PJ}from"node:net";import{fileURLToPath as AJ}from"node:url";import{dirname as CJ,join as CA}from"node:path";import{openSync as IJ,existsSync as IA}from"node:fs";import{mkdir as NJ}from"node:fs/promises";function kJ(t){return new Promise(e=>{let r=PJ();r.once("error",()=>e(!1)),r.once("listening",()=>{r.close(),e(!0)}),r.listen(t,"127.0.0.1")})}async function xJ(t){let e=t;for(;e<t+100;){if(await kJ(e))return e;e++}throw new Error(`Could not find available port in range ${t}-${t+100}`)}async function rg(t){let{running:e,state:r}=await Tt();if(e&&r){console.log(`Proxy is already running (PID: ${r.pid})`),console.log(` http://localhost:${r.port}`),console.log(` Dashboard: http://localhost:${r.port}/`);return}let n=await xr(ft);n||(console.log("No credentials found"),console.log("Run 'claude-pilot login' first to authenticate"),process.exit(1));try{await Au(n,ft)}catch(f){console.log("Failed to validate/refresh token:",f instanceof Error?f.message:f),console.log("Run 'claude-pilot login' to re-authenticate"),process.exit(1)}let s=t.port||Nu,i=await xJ(s);i!==s&&console.log(`Port ${s} in use, using ${i}`);let o=AJ(import.meta.url),a=CJ(o),l=CA(a,"server.js");IA(l)||(l=CA(a,"..","dist","server.js")),IA(l)||(console.log("Error: server.js not found"),console.log("If developing, run `pnpm build` first"),process.exit(1)),console.log("Starting proxy..."),await NJ(yr,{recursive:!0});let u=IJ(Iu,"a"),c=$J("node",[l],{detached:!0,stdio:["ignore",u,u],env:{...process.env,PROXY_PORT:String(i)}});c.unref(),await PA({pid:c.pid,port:i,startedAt:new Date().toISOString()}),await new Promise(f=>setTimeout(f,1500));try{if((await fetch(`http://localhost:${i}/health`,{signal:AbortSignal.timeout(2e3)})).ok){console.log("Proxy started successfully"),console.log(` PID: ${c.pid}`),console.log(` http://localhost:${i}`),console.log(` Dashboard: http://localhost:${i}/`),console.log(` Logs: ${Iu}`),console.log(`
387
- Configure Claude Code with:`),console.log(` export ANTHROPIC_BASE_URL=http://localhost:${i}`),console.log(" export ANTHROPIC_AUTH_TOKEN=dummy");return}}catch{}console.log("Proxy started (PID: "+c.pid+")"),console.log(` http://localhost:${i}`),console.log(` Logs: ${Iu}`),console.log(`
388
- Note: Check logs if the proxy is not responding`)}async function NA(){console.log(`Claude Pilot Status
389
- `);let t=await xr(ft);if(t){let n=new Date(t.copilotTokenExpiresAt),s=n<new Date;console.log(`Authentication: ${s?"\u2717 expired":"\u2713 valid"}`),console.log(` Token expires: ${n.toLocaleString()}`)}else console.log("Authentication: \u2717 not configured"),console.log(" Run 'claude-pilot login' to authenticate");console.log();let{running:e,state:r}=await Tt();if(e&&r){let n=new Date(r.startedAt),s=LJ(Date.now()-n.getTime());console.log("Proxy: \u2713 running"),console.log(` PID: ${r.pid}`),console.log(` Port: ${r.port}`),console.log(` Dashboard: http://localhost:${r.port}/`),console.log(` Uptime: ${s}`),console.log(` Started: ${n.toLocaleString()}`),console.log(`
390
- Configure Claude Code with:`),console.log(` export ANTHROPIC_BASE_URL=http://localhost:${r.port}`),console.log(" export ANTHROPIC_AUTH_TOKEN=dummy")}else console.log("Proxy: \u2717 not running"),console.log(" Run 'claude-pilot start' to start the proxy")}function LJ(t){let e=Math.floor(t/1e3),r=Math.floor(e/60),n=Math.floor(r/60),s=Math.floor(n/24);return s>0?`${s}d ${n%24}h ${r%60}m`:n>0?`${n}h ${r%60}m ${e%60}s`:r>0?`${r}m ${e%60}s`:`${e}s`}import{exec as qJ}from"node:child_process";import{platform as jJ}from"node:os";async function kA(){let{running:t,state:e}=await Tt();if(!t||!e){console.log("Proxy is not running"),console.log("Run 'claude-pilot start' first");return}let r=`http://localhost:${e.port}`;console.log(`Opening dashboard at ${r}`);let n=jJ(),s;if(n==="darwin")s=`open "${r}"`;else if(n==="linux")s=`xdg-open "${r}"`;else{console.log(`Please open ${r} in your browser`);return}qJ(s,i=>{i&&(console.log("Could not open browser automatically"),console.log(`Please open ${r} in your browser`))})}import{execSync as DJ}from"node:child_process";import{readFileSync as LA,writeFileSync as FJ}from"node:fs";import{join as qA,dirname as MJ}from"node:path";import{fileURLToPath as HJ}from"node:url";var VJ="@lioneltay/claude-pilot",jA=qA(yr,"version-check.json"),DA=24*60*60*1e3;function FA(){try{return JSON.parse(LA(jA,"utf-8"))}catch{return null}}function zJ(t){try{FJ(jA,JSON.stringify(t))}catch{}}function xA(){try{let t=HJ(import.meta.url),e=MJ(t),r=qA(e,"..","package.json");return JSON.parse(LA(r,"utf-8")).version||null}catch{return null}}function UJ(){try{return DJ(`npm view ${VJ} version`,{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()}catch{return null}}function Lu(t,e){let r=t.split(".").map(Number),n=e.split(".").map(Number);for(let s=0;s<Math.max(r.length,n.length);s++){let i=r[s]||0,o=n[s]||0;if(o>i)return!0;if(o<i)return!1}return!1}function MA(){let t=FA();return!t||Date.now()-t.lastCheck>DA?null:t.latestVersion}function HA(){setImmediate(()=>{try{let t=FA(),e=Date.now();if(t&&e-t.lastCheck<DA){if(t.latestVersion){let n=xA();n&&Lu(n,t.latestVersion)&&(console.log(`
386
+ You can now start the proxy with: claude-pilot start`)}import{unlink as xJ}from"node:fs/promises";import{readFile as PJ,writeFile as AJ,mkdir as CJ,unlink as IJ}from"node:fs/promises";async function NJ(){try{let t=await PJ(Iu,"utf-8");return JSON.parse(t)}catch{return null}}async function NA(t){await CJ(Ht,{recursive:!0}),await AJ(Iu,JSON.stringify(t,null,2))}async function xu(){try{await IJ(Iu)}catch{}}function kJ(t){try{return process.kill(t,0),!0}catch{return!1}}async function dt(){let t=await NJ();return t?kJ(t.pid)?{running:!0,state:t}:(await xu(),{running:!1,state:null}):{running:!1,state:null}}async function Lu(){let{running:t,state:e}=await dt();if(!t||!e){console.log("Proxy is not running");return}console.log(`Stopping proxy (PID: ${e.pid})...`);try{process.kill(e.pid,"SIGTERM"),await new Promise(r=>setTimeout(r,1e3));try{process.kill(e.pid,0),console.log("Process did not exit gracefully, forcing..."),process.kill(e.pid,"SIGKILL")}catch{}await xu(),console.log("\u2713 Proxy stopped")}catch{await xu(),console.log("\u2713 Proxy stopped (was already exiting)")}}async function kA(){let{running:t}=await dt();t&&await Lu();try{await xJ(ft),console.log("\u2713 Logged out successfully"),console.log(` Removed ${ft}`)}catch(e){if(e.code==="ENOENT")console.log("Already logged out (no credentials found)");else throw e}}import{spawn as LJ}from"node:child_process";import{createServer as qJ}from"node:net";import{fileURLToPath as jJ}from"node:url";import{dirname as DJ,join as xA}from"node:path";import{openSync as FJ,existsSync as LA}from"node:fs";import{mkdir as MJ}from"node:fs/promises";function HJ(t){return new Promise(e=>{let r=qJ();r.once("error",()=>e(!1)),r.once("listening",()=>{r.close(),e(!0)}),r.listen(t,"127.0.0.1")})}async function VJ(t){let e=t;for(;e<t+100;){if(await HJ(e))return e;e++}throw new Error(`Could not find available port in range ${t}-${t+100}`)}async function ng(t){let{running:e,state:r}=await dt();if(e&&r){console.log(`Proxy is already running (PID: ${r.pid})`),console.log(` http://localhost:${r.port}`),console.log(` Dashboard: http://localhost:${r.port}/`);return}let n=await xr(ft);n||(console.log("No credentials found"),console.log("Run 'claude-pilot login' first to authenticate"),process.exit(1));try{await Cu(n,ft)}catch(f){console.log("Failed to validate/refresh token:",f instanceof Error?f.message:f),console.log("Run 'claude-pilot login' to re-authenticate"),process.exit(1)}let s=t.port||ku,i=await VJ(s);i!==s&&console.log(`Port ${s} in use, using ${i}`);let o=jJ(import.meta.url),a=DJ(o),l=xA(a,"server.js");LA(l)||(l=xA(a,"..","dist","server.js")),LA(l)||(console.log("Error: server.js not found"),console.log("If developing, run `pnpm build` first"),process.exit(1)),console.log("Starting proxy..."),await MJ(Ht,{recursive:!0});let u=FJ(Nu,"a"),c=LJ("node",[l],{detached:!0,stdio:["ignore",u,u],env:{...process.env,PROXY_PORT:String(i)}});c.unref(),await NA({pid:c.pid,port:i,startedAt:new Date().toISOString()}),await new Promise(f=>setTimeout(f,1500));try{if((await fetch(`http://localhost:${i}/health`,{signal:AbortSignal.timeout(2e3)})).ok){console.log("Proxy started successfully"),console.log(` PID: ${c.pid}`),console.log(` http://localhost:${i}`),console.log(` Dashboard: http://localhost:${i}/`),console.log(` Logs: ${Nu}`),console.log(`
387
+ Configure Claude Code with:`),console.log(` export ANTHROPIC_BASE_URL=http://localhost:${i}`),console.log(" export ANTHROPIC_AUTH_TOKEN=dummy");return}}catch{}console.log("Proxy started (PID: "+c.pid+")"),console.log(` http://localhost:${i}`),console.log(` Logs: ${Nu}`),console.log(`
388
+ Note: Check logs if the proxy is not responding`)}async function qA(){console.log(`Claude Pilot Status
389
+ `);let t=await xr(ft);if(t){let n=new Date(t.copilotTokenExpiresAt),s=n<new Date;console.log(`Authentication: ${s?"\u2717 expired":"\u2713 valid"}`),console.log(` Token expires: ${n.toLocaleString()}`)}else console.log("Authentication: \u2717 not configured"),console.log(" Run 'claude-pilot login' to authenticate");console.log();let{running:e,state:r}=await dt();if(e&&r){let n=new Date(r.startedAt),s=zJ(Date.now()-n.getTime()),i="unknown";try{i=(await(await fetch(`http://localhost:${r.port}/config`)).json()).mode}catch{}console.log("Proxy: \u2713 running"),console.log(` PID: ${r.pid}`),console.log(` Port: ${r.port}`),console.log(` Mode: ${i}`),console.log(` Dashboard: http://localhost:${r.port}/`),console.log(` Uptime: ${s}`),console.log(` Started: ${n.toLocaleString()}`),console.log(`
390
+ Configure Claude Code with:`),console.log(` export ANTHROPIC_BASE_URL=http://localhost:${r.port}`),console.log(" export ANTHROPIC_AUTH_TOKEN=dummy")}else{let n=No();console.log("Proxy: \u2717 not running"),console.log(` Mode: ${n.mode} (from config)`),console.log(" Run 'claude-pilot start' to start the proxy")}}function zJ(t){let e=Math.floor(t/1e3),r=Math.floor(e/60),n=Math.floor(r/60),s=Math.floor(n/24);return s>0?`${s}d ${n%24}h ${r%60}m`:n>0?`${n}h ${r%60}m ${e%60}s`:r>0?`${r}m ${e%60}s`:`${e}s`}import{exec as UJ}from"node:child_process";import{platform as BJ}from"node:os";async function jA(){let{running:t,state:e}=await dt();if(!t||!e){console.log("Proxy is not running"),console.log("Run 'claude-pilot start' first");return}let r=`http://localhost:${e.port}`;console.log(`Opening dashboard at ${r}`);let n=BJ(),s;if(n==="darwin")s=`open "${r}"`;else if(n==="linux")s=`xdg-open "${r}"`;else{console.log(`Please open ${r} in your browser`);return}UJ(s,i=>{i&&(console.log("Could not open browser automatically"),console.log(`Please open ${r} in your browser`))})}async function DA(t){let{running:e,state:r}=await dt();if(!t){let n=No();if(console.log(`Current mode: ${n.mode}`),e&&r)try{let i=await(await fetch(`http://localhost:${r.port}/config`)).json();i.mode!==n.mode&&console.log(` (runtime: ${i.mode} - will sync on next request)`)}catch{}console.log(),console.log("Available modes:"),console.log(" copilot - All requests go through GitHub Copilot (default)"),console.log(" split - Sidecars go to Anthropic, main conversation to Copilot"),console.log(),console.log("Change mode with: claude-pilot mode <copilot|split>");return}if(t!=="copilot"&&t!=="split"&&(console.error(`Invalid mode: ${t}`),console.error("Valid modes: copilot, split"),process.exit(1)),CA({mode:t}),e&&r)try{let s=await(await fetch(`http://localhost:${r.port}/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:t})})).json();s.error&&console.error(`Warning: Failed to update running proxy: ${s.error}`)}catch{console.error("Warning: Could not connect to running proxy")}console.log(`Mode changed to: ${t}`),t==="split"&&(console.log(),console.log("Split mode enabled:"),console.log(" - Main conversation \u2192 Copilot (request-based billing)"),console.log(" - Sidecars (title gen, etc.) \u2192 Anthropic (passthrough)")),e||(console.log(),console.log("Note: Proxy is not running. Mode will apply on next start."))}import{execSync as GJ}from"node:child_process";import{readFileSync as MA,writeFileSync as WJ}from"node:fs";import{join as HA,dirname as JJ}from"node:path";import{fileURLToPath as KJ}from"node:url";var YJ="@lioneltay/claude-pilot",VA=HA(Ht,"version-check.json"),zA=24*60*60*1e3;function UA(){try{return JSON.parse(MA(VA,"utf-8"))}catch{return null}}function XJ(t){try{WJ(VA,JSON.stringify(t))}catch{}}function FA(){try{let t=KJ(import.meta.url),e=JJ(t),r=HA(e,"..","package.json");return JSON.parse(MA(r,"utf-8")).version||null}catch{return null}}function QJ(){try{return GJ(`npm view ${YJ} version`,{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()}catch{return null}}function qu(t,e){let r=t.split(".").map(Number),n=e.split(".").map(Number);for(let s=0;s<Math.max(r.length,n.length);s++){let i=r[s]||0,o=n[s]||0;if(o>i)return!0;if(o<i)return!1}return!1}function BA(){let t=UA();return!t||Date.now()-t.lastCheck>zA?null:t.latestVersion}function GA(){setImmediate(()=>{try{let t=UA(),e=Date.now();if(t&&e-t.lastCheck<zA){if(t.latestVersion){let n=FA();n&&qu(n,t.latestVersion)&&(console.log(`
391
391
  \u{1F4E6} Update available: ${n} \u2192 ${t.latestVersion}`),console.log(` npm install -g @lioneltay/claude-pilot@latest
392
- `))}return}let r=UJ();if(zJ({lastCheck:e,latestVersion:r}),r){let n=xA();n&&Lu(n,r)&&(console.log(`
392
+ `))}return}let r=QJ();if(XJ({lastCheck:e,latestVersion:r}),r){let n=FA();n&&qu(n,r)&&(console.log(`
393
393
  \u{1F4E6} Update available: ${n} \u2192 ${r}`),console.log(` npm install -g @lioneltay/claude-pilot@latest
394
- `))}}catch{}})}import{readFileSync as GJ}from"node:fs";import{fileURLToPath as WJ}from"node:url";import{dirname as JJ,join as KJ}from"node:path";function YJ(){try{let t=WJ(import.meta.url),e=JJ(t),r=KJ(e,"..","package.json");return JSON.parse(GJ(r,"utf-8")).version||"0.0.0"}catch{return"0.0.0"}}var ng=YJ(),XJ=["login","logout","start","stop","status","dashboard","help"];function QJ(t){let e=t[0];if(!e)return!1;let r=["--help","--version","-h","-V"];return XJ.includes(e)||r.includes(e)}async function ZJ(t){let{running:e,state:r}=await Tt();if(e)VA(t,r.port);else{await xr(ft)||(console.error("Not authenticated. Run `claude-pilot login` first."),process.exit(1)),console.log("Proxy not running, starting..."),await rg({port:Nu});let{running:s,state:i}=await Tt();(!s||!i)&&(console.error("Failed to start proxy. Check logs with: cat ~/.config/claude-pilot/server.log"),process.exit(1)),console.log(),VA(t,i.port)}}function VA(t,e){let r=BJ("claude",t,{stdio:"inherit",env:{...process.env,ANTHROPIC_BASE_URL:`http://localhost:${e}`,ANTHROPIC_AUTH_TOKEN:"dummy"}});r.on("error",n=>{n.code==="ENOENT"?console.error("Claude CLI not found. Install it with: npm install -g @anthropic-ai/claude-code"):console.error("Failed to run claude:",n.message),process.exit(1)}),r.on("exit",n=>{process.exit(n??0)})}async function e8(){HA();let t=process.argv.slice(2);if(t.length===0||!QJ(t)){await ZJ(t);return}let e=new Eg,r=MA(),n=r&&Lu(ng,r)?`${ng} (update available: ${r})`:ng;e.name("claude-pilot").description("Run Claude Code through GitHub Copilot API").version(n),e.command("login").description("Authenticate with GitHub Copilot").action(async()=>{try{await $A()}catch(s){console.error("Login failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.command("logout").description("Clear credentials and stop proxy").action(async()=>{try{await AA()}catch(s){console.error("Logout failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.command("start").description("Start the proxy server in background").option("-p, --port <port>","Port for proxy and dashboard").action(async s=>{try{await rg({port:s.port?parseInt(s.port,10):void 0})}catch(i){console.error("Start failed:",i instanceof Error?i.message:i),process.exit(1)}}),e.command("stop").description("Stop the running proxy server").action(async()=>{try{await xu()}catch(s){console.error("Stop failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.command("status").description("Show proxy status and configuration").action(async()=>{try{await NA()}catch(s){console.error("Status failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.command("dashboard").description("Open the log viewer dashboard in browser").action(async()=>{try{await kA()}catch(s){console.error("Dashboard failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.parse()}e8().catch(t=>{console.error("Error:",t instanceof Error?t.message:t),process.exit(1)});
394
+ `))}}catch{}})}import{readFileSync as e8}from"node:fs";import{fileURLToPath as t8}from"node:url";import{dirname as r8,join as n8}from"node:path";function s8(){try{let t=t8(import.meta.url),e=r8(t),r=n8(e,"..","package.json");return JSON.parse(e8(r,"utf-8")).version||"0.0.0"}catch{return"0.0.0"}}var sg=s8(),i8=["login","logout","start","stop","status","dashboard","mode","help"];function o8(t){let e=t[0];if(!e)return!1;let r=["--help","--version","-h","-V"];return i8.includes(e)||r.includes(e)}async function a8(t){let{running:e,state:r}=await dt();if(e)WA(t,r.port);else{await xr(ft)||(console.error("Not authenticated. Run `claude-pilot login` first."),process.exit(1)),console.log("Proxy not running, starting..."),await ng({port:ku});let{running:s,state:i}=await dt();(!s||!i)&&(console.error("Failed to start proxy. Check logs with: cat ~/.config/claude-pilot/server.log"),process.exit(1)),console.log(),WA(t,i.port)}}function WA(t,e){let r=ZJ("claude",t,{stdio:"inherit",env:{...process.env,ANTHROPIC_BASE_URL:`http://localhost:${e}`,ANTHROPIC_AUTH_TOKEN:"dummy"}});r.on("error",n=>{n.code==="ENOENT"?console.error("Claude CLI not found. Install it with: npm install -g @anthropic-ai/claude-code"):console.error("Failed to run claude:",n.message),process.exit(1)}),r.on("exit",n=>{process.exit(n??0)})}async function l8(){GA();let t=process.argv.slice(2);if(t.length===0||!o8(t)){await a8(t);return}let e=new bg,r=BA(),n=r&&qu(sg,r)?`${sg} (update available: ${r})`:sg;e.name("claude-pilot").description("Run Claude Code through GitHub Copilot API").version(n),e.command("login").description("Authenticate with GitHub Copilot").action(async()=>{try{await IA()}catch(s){console.error("Login failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.command("logout").description("Clear credentials and stop proxy").action(async()=>{try{await kA()}catch(s){console.error("Logout failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.command("start").description("Start the proxy server in background").option("-p, --port <port>","Port for proxy and dashboard").action(async s=>{try{await ng({port:s.port?parseInt(s.port,10):void 0})}catch(i){console.error("Start failed:",i instanceof Error?i.message:i),process.exit(1)}}),e.command("stop").description("Stop the running proxy server").action(async()=>{try{await Lu()}catch(s){console.error("Stop failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.command("status").description("Show proxy status and configuration").action(async()=>{try{await qA()}catch(s){console.error("Status failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.command("dashboard").description("Open the log viewer dashboard in browser").action(async()=>{try{await jA()}catch(s){console.error("Dashboard failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.command("mode [mode]").description("Get or set proxy routing mode (copilot or split)").action(async s=>{try{await DA(s)}catch(i){console.error("Mode failed:",i instanceof Error?i.message:i),process.exit(1)}}),e.parse()}l8().catch(t=>{console.error("Error:",t instanceof Error?t.message:t),process.exit(1)});
395
395
  /*! Bundled license information:
396
396
 
397
397
  @fastify/proxy-addr/index.js: