@tsuga/cli 1.0.12 → 1.0.15

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/README.md +28 -13
  2. package/dist/cli.js +51 -52
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,86 +1,85 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var Jx=Object.create;var pp=Object.defineProperty;var eR=Object.getOwnPropertyDescriptor;var tR=Object.getOwnPropertyNames;var rR=Object.getPrototypeOf,nR=Object.prototype.hasOwnProperty;var Wr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bt=(e,t)=>{for(var r in t)pp(e,r,{get:t[r],enumerable:!0})},oR=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tR(t))!nR.call(e,i)&&i!==r&&pp(e,i,{get:()=>t[i],enumerable:!(o=eR(t,i))||o.enumerable});return e};var ol=(e,t,r)=>(r=e!=null?Jx(rR(e)):{},oR(t||!e||!e.__esModule?pp(r,"default",{value:e,enumerable:!0}):r,e));var Bo=Wr(mp=>{var _a=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},cp=class extends _a{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};mp.CommanderError=_a;mp.InvalidArgumentError=cp});var ha=Wr(lp=>{var{InvalidArgumentError:iR}=Bo(),up=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new iR(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function aR(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}lp.Argument=up;lp.humanReadableArgName=aR});var gp=Wr(fp=>{var{humanReadableArgName:sR}=ha(),dp=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(i=>!i._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((i,a)=>i.name().localeCompare(a.name())),r}compareOptions(t,r){let o=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(i=>!i.hidden),o=t._getHelpOption();if(o&&!o.hidden){let i=o.short&&t._findOption(o.short),a=o.long&&t._findOption(o.long);!i&&!a?r.push(o):o.long&&!a?r.push(t.createOption(o.long,o.description)):o.short&&!i&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let i=o.options.filter(a=>!a.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>sR(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let i=t.parent;i;i=i.parent)o=i.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];return t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0?`${t.description} (${r.join(", ")})`:t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatHelp(t,r){let o=r.padWidth(t,r),i=r.helpWidth??80;function a(I,x){return r.formatItem(I,o,x,r)}let p=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],u=r.commandDescription(t);u.length>0&&(p=p.concat([r.boxWrap(r.styleCommandDescription(u),i),""]));let l=r.visibleArguments(t).map(I=>a(r.styleArgumentTerm(r.argumentTerm(I)),r.styleArgumentDescription(r.argumentDescription(I))));l.length>0&&(p=p.concat([r.styleTitle("Arguments:"),...l,""]));let f=r.visibleOptions(t).map(I=>a(r.styleOptionTerm(r.optionTerm(I)),r.styleOptionDescription(r.optionDescription(I))));if(f.length>0&&(p=p.concat([r.styleTitle("Options:"),...f,""])),r.showGlobalOptions){let I=r.visibleGlobalOptions(t).map(x=>a(r.styleOptionTerm(r.optionTerm(x)),r.styleOptionDescription(r.optionDescription(x))));I.length>0&&(p=p.concat([r.styleTitle("Global Options:"),...I,""]))}let y=r.visibleCommands(t).map(I=>a(r.styleSubcommandTerm(r.subcommandTerm(I)),r.styleSubcommandDescription(r.subcommandDescription(I))));return y.length>0&&(p=p.concat([r.styleTitle("Commands:"),...y,""])),p.join(`
3
- `)}displayWidth(t){return il(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,i){let p=" ".repeat(2);if(!o)return p+t;let u=t.padEnd(r+t.length-i.displayWidth(t)),l=2,y=(this.helpWidth??80)-r-l-2,I;return y<this.minWidthToWrap||i.preformatted(o)?I=o:I=i.boxWrap(o,y).replace(/\n/g,`
2
+ "use strict";var bR=Object.create;var gp=Object.defineProperty;var xR=Object.getOwnPropertyDescriptor;var RR=Object.getOwnPropertyNames;var CR=Object.getPrototypeOf,PR=Object.prototype.hasOwnProperty;var Jr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bt=(e,t)=>{for(var r in t)gp(e,r,{get:t[r],enumerable:!0})},UR=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of RR(t))!PR.call(e,i)&&i!==r&&gp(e,i,{get:()=>t[i],enumerable:!(o=xR(t,i))||o.enumerable});return e};var fl=(e,t,r)=>(r=e!=null?bR(CR(e)):{},UR(t||!e||!e.__esModule?gp(r,"default",{value:e,enumerable:!0}):r,e));var Ho=Jr(Ep=>{var ba=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},yp=class extends ba{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Ep.CommanderError=ba;Ep.InvalidArgumentError=yp});var xa=Jr(Tp=>{var{InvalidArgumentError:NR}=Ho(),Ip=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new NR(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function LR(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Tp.Argument=Ip;Tp.humanReadableArgName=LR});var Op=Jr(hp=>{var{humanReadableArgName:kR}=xa(),_p=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(i=>!i._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((i,a)=>i.name().localeCompare(a.name())),r}compareOptions(t,r){let o=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(i=>!i.hidden),o=t._getHelpOption();if(o&&!o.hidden){let i=o.short&&t._findOption(o.short),a=o.long&&t._findOption(o.long);!i&&!a?r.push(o):o.long&&!a?r.push(t.createOption(o.long,o.description)):o.short&&!i&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let i=o.options.filter(a=>!a.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>kR(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let i=t.parent;i;i=i.parent)o=i.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];return t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0?`${t.description} (${r.join(", ")})`:t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatHelp(t,r){let o=r.padWidth(t,r),i=r.helpWidth??80;function a(I,x){return r.formatItem(I,o,x,r)}let p=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],u=r.commandDescription(t);u.length>0&&(p=p.concat([r.boxWrap(r.styleCommandDescription(u),i),""]));let l=r.visibleArguments(t).map(I=>a(r.styleArgumentTerm(r.argumentTerm(I)),r.styleArgumentDescription(r.argumentDescription(I))));l.length>0&&(p=p.concat([r.styleTitle("Arguments:"),...l,""]));let f=r.visibleOptions(t).map(I=>a(r.styleOptionTerm(r.optionTerm(I)),r.styleOptionDescription(r.optionDescription(I))));if(f.length>0&&(p=p.concat([r.styleTitle("Options:"),...f,""])),r.showGlobalOptions){let I=r.visibleGlobalOptions(t).map(x=>a(r.styleOptionTerm(r.optionTerm(x)),r.styleOptionDescription(r.optionDescription(x))));I.length>0&&(p=p.concat([r.styleTitle("Global Options:"),...I,""]))}let y=r.visibleCommands(t).map(I=>a(r.styleSubcommandTerm(r.subcommandTerm(I)),r.styleSubcommandDescription(r.subcommandDescription(I))));return y.length>0&&(p=p.concat([r.styleTitle("Commands:"),...y,""])),p.join(`
3
+ `)}displayWidth(t){return gl(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,i){let p=" ".repeat(2);if(!o)return p+t;let u=t.padEnd(r+t.length-i.displayWidth(t)),l=2,y=(this.helpWidth??80)-r-l-2,I;return y<this.minWidthToWrap||i.preformatted(o)?I=o:I=i.boxWrap(o,y).replace(/\n/g,`
4
4
  `+" ".repeat(r+l)),p+u+" ".repeat(l)+I.replace(/\n/g,`
5
5
  ${p}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let o=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,a=[];return o.forEach(p=>{let u=p.match(i);if(u===null){a.push("");return}let l=[u.shift()],f=this.displayWidth(l[0]);u.forEach(y=>{let I=this.displayWidth(y);if(f+I<=r){l.push(y),f+=I;return}a.push(l.join(""));let x=y.trimStart();l=[x],f=this.displayWidth(x)}),a.push(l.join(""))}),a.join(`
6
- `)}};function il(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}fp.Help=dp;fp.stripColor=il});var Tp=Wr(Ip=>{var{InvalidArgumentError:pR}=Bo(),yp=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=cR(t);this.short=o.shortFlag,this.long=o.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new pR(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?al(this.name().replace(/^no-/,"")):al(this.name())}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Ep=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let i=this.negativeOptions.get(o).presetArg,a=i!==void 0?i:!1;return r.negate===(a===t)}};function al(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function cR(e){let t,r,o=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat("guard");if(o.test(a[0])&&(t=a.shift()),i.test(a[0])&&(r=a.shift()),!t&&o.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=r,r=a.shift()),a[0].startsWith("-")){let p=a[0],u=`option creation failed due to '${p}' in option flags '${e}'`;throw/^-[^-][^-]/.test(p)?new Error(`${u}
6
+ `)}};function gl(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}hp.Help=_p;hp.stripColor=gl});var xp=Jr(bp=>{var{InvalidArgumentError:MR}=Ho(),Ap=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=wR(t);this.short=o.shortFlag,this.long=o.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new MR(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?yl(this.name().replace(/^no-/,"")):yl(this.name())}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Sp=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let i=this.negativeOptions.get(o).presetArg,a=i!==void 0?i:!1;return r.negate===(a===t)}};function yl(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function wR(e){let t,r,o=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat("guard");if(o.test(a[0])&&(t=a.shift()),i.test(a[0])&&(r=a.shift()),!t&&o.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=r,r=a.shift()),a[0].startsWith("-")){let p=a[0],u=`option creation failed due to '${p}' in option flags '${e}'`;throw/^-[^-][^-]/.test(p)?new Error(`${u}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
9
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(p)?new Error(`${u}
10
10
  - too many short flags`):i.test(p)?new Error(`${u}
11
11
  - too many long flags`):new Error(`${u}
12
- - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}Ip.Option=yp;Ip.DualOptions=Ep});var pl=Wr(sl=>{function mR(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let i=1;i<=e.length;i++){let a=1;e[i-1]===t[o-1]?a=0:a=1,r[i][o]=Math.min(r[i-1][o]+1,r[i][o-1]+1,r[i-1][o-1]+a),i>1&&o>1&&e[i-1]===t[o-2]&&e[i-2]===t[o-1]&&(r[i][o]=Math.min(r[i][o],r[i-2][o-2]+1))}return r[e.length][t.length]}function uR(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(p=>p.slice(2)));let o=[],i=3,a=.4;return t.forEach(p=>{if(p.length<=1)return;let u=mR(e,p),l=Math.max(e.length,p.length);(l-u)/l>a&&(u<i?(i=u,o=[p]):u===i&&o.push(p))}),o.sort((p,u)=>p.localeCompare(u)),r&&(o=o.map(p=>`--${p}`)),o.length>1?`
12
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}bp.Option=Ap;bp.DualOptions=Sp});var Il=Jr(El=>{function DR(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let i=1;i<=e.length;i++){let a=1;e[i-1]===t[o-1]?a=0:a=1,r[i][o]=Math.min(r[i-1][o]+1,r[i][o-1]+1,r[i-1][o-1]+a),i>1&&o>1&&e[i-1]===t[o-2]&&e[i-2]===t[o-1]&&(r[i][o]=Math.min(r[i][o],r[i-2][o-2]+1))}return r[e.length][t.length]}function $R(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(p=>p.slice(2)));let o=[],i=3,a=.4;return t.forEach(p=>{if(p.length<=1)return;let u=DR(e,p),l=Math.max(e.length,p.length);(l-u)/l>a&&(u<i?(i=u,o=[p]):u===i&&o.push(p))}),o.sort((p,u)=>p.localeCompare(u)),r&&(o=o.map(p=>`--${p}`)),o.length>1?`
13
13
  (Did you mean one of ${o.join(", ")}?)`:o.length===1?`
14
- (Did you mean ${o[0]}?)`:""}sl.suggestSimilar=uR});var ll=Wr(Sp=>{var lR=require("node:events").EventEmitter,_p=require("node:child_process"),nr=require("node:path"),Oa=require("node:fs"),ie=require("node:process"),{Argument:dR,humanReadableArgName:fR}=ha(),{CommanderError:hp}=Bo(),{Help:gR,stripColor:yR}=gp(),{Option:cl,DualOptions:ER}=Tp(),{suggestSimilar:ml}=pl(),Op=class e extends lR{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>ie.stdout.write(r),writeErr:r=>ie.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>ie.stdout.isTTY?ie.stdout.columns:void 0,getErrHelpWidth:()=>ie.stderr.isTTY?ie.stderr.columns:void 0,getOutHasColors:()=>Ap()??(ie.stdout.isTTY&&ie.stdout.hasColors?.()),getErrHasColors:()=>Ap()??(ie.stderr.isTTY&&ie.stderr.hasColors?.()),stripColor:r=>yR(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let i=r,a=o;typeof i=="object"&&i!==null&&(a=i,i=null),a=a||{};let[,p,u]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(p);return i&&(l.description(i),l._executableHandler=!0),a.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(a.noHelp||a.hidden),l._executableFile=a.executableFile||null,u&&l.arguments(u),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),i?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new gR,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new dR(t,r)}argument(t,r,o,i){let a=this.createArgument(t,r);return typeof o=="function"?a.default(i).argParser(o):a.default(o),this.addArgument(a),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,this;t=t??"help [command]";let[,o,i]=t.match(/([^ ]+) *(.*)/),a=r??"display help for command",p=this.createCommand(o);return p.helpOption(!1),i&&p.arguments(i),a&&p.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=p,this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
- Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,o){this._exitCallback&&this._exitCallback(new hp(t,r,o)),ie.exit(t)}action(t){let r=o=>{let i=this.registeredArguments.length,a=o.slice(0,i);return this._storeOptionsAsProperties?a[i]=this:a[i]=this.opts(),a.push(this),t.apply(this,a)};return this._actionHandler=r,this}createOption(t,r){return new cl(t,r)}_callParseArg(t,r,o,i){try{return t.parseArg(r,o)}catch(a){if(a.code==="commander.invalidArgument"){let p=`${i} ${a.message}`;this.error(p,{exitCode:a.exitCode,code:a.code})}throw a}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
17
- - already used by option '${r.flags}'`)}this.options.push(t)}_registerCommand(t){let r=i=>[i.name()].concat(i.aliases()),o=r(t).find(i=>this._findCommand(i));if(o){let i=r(this._findCommand(o)).join("|"),a=r(t).join("|");throw new Error(`cannot add command '${a}' as already have command '${i}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),o=t.attributeName();if(t.negate){let a=t.long.replace(/^--no-/,"--");this._findOption(a)||this.setOptionValueWithSource(o,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let i=(a,p,u)=>{a==null&&t.presetArg!==void 0&&(a=t.presetArg);let l=this.getOptionValue(o);a!==null&&t.parseArg?a=this._callParseArg(t,a,l,p):a!==null&&t.variadic&&(a=t._concatValue(a,l)),a==null&&(t.negate?a=!1:t.isBoolean()||t.optional?a=!0:a=""),this.setOptionValueWithSource(o,a,u)};return this.on("option:"+r,a=>{let p=`error: option '${t.flags}' argument '${a}' is invalid.`;i(a,p,"cli")}),t.envVar&&this.on("optionEnv:"+r,a=>{let p=`error: option '${t.flags}' value '${a}' from env '${t.envVar}' is invalid.`;i(a,p,"env")}),this}_optionEx(t,r,o,i,a){if(typeof r=="object"&&r instanceof cl)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let p=this.createOption(r,o);if(p.makeOptionMandatory(!!t.mandatory),typeof i=="function")p.default(a).argParser(i);else if(i instanceof RegExp){let u=i;i=(l,f)=>{let y=u.exec(l);return y?y[0]:f},p.default(a).argParser(i)}else p.default(i);return this.addOption(p)}option(t,r,o,i){return this._optionEx({},t,r,o,i)}requiredOption(t,r,o,i){return this._optionEx({mandatory:!0},t,r,o,i)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,o){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(r=o.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){ie.versions?.electron&&(r.from="electron");let i=ie.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}t===void 0&&(t=ie.argv),this.rawArgs=t.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":ie.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return this._parseCommand([],o),this}async parseAsync(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,o){if(Oa.existsSync(t))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",a=`'${t}' does not exist
14
+ (Did you mean ${o[0]}?)`:""}El.suggestSimilar=$R});var Ol=Jr(Np=>{var GR=require("node:events").EventEmitter,Rp=require("node:child_process"),nr=require("node:path"),Ra=require("node:fs"),ae=require("node:process"),{Argument:vR,humanReadableArgName:jR}=xa(),{CommanderError:Cp}=Ho(),{Help:FR,stripColor:BR}=Op(),{Option:Tl,DualOptions:qR}=xp(),{suggestSimilar:_l}=Il(),Pp=class e extends GR{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>ae.stdout.write(r),writeErr:r=>ae.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>ae.stdout.isTTY?ae.stdout.columns:void 0,getErrHelpWidth:()=>ae.stderr.isTTY?ae.stderr.columns:void 0,getOutHasColors:()=>Up()??(ae.stdout.isTTY&&ae.stdout.hasColors?.()),getErrHasColors:()=>Up()??(ae.stderr.isTTY&&ae.stderr.hasColors?.()),stripColor:r=>BR(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let i=r,a=o;typeof i=="object"&&i!==null&&(a=i,i=null),a=a||{};let[,p,u]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(p);return i&&(l.description(i),l._executableHandler=!0),a.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(a.noHelp||a.hidden),l._executableFile=a.executableFile||null,u&&l.arguments(u),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),i?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new FR,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new vR(t,r)}argument(t,r,o,i){let a=this.createArgument(t,r);return typeof o=="function"?a.default(i).argParser(o):a.default(o),this.addArgument(a),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,this;t=t??"help [command]";let[,o,i]=t.match(/([^ ]+) *(.*)/),a=r??"display help for command",p=this.createCommand(o);return p.helpOption(!1),i&&p.arguments(i),a&&p.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=p,this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
+ Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,o){this._exitCallback&&this._exitCallback(new Cp(t,r,o)),ae.exit(t)}action(t){let r=o=>{let i=this.registeredArguments.length,a=o.slice(0,i);return this._storeOptionsAsProperties?a[i]=this:a[i]=this.opts(),a.push(this),t.apply(this,a)};return this._actionHandler=r,this}createOption(t,r){return new Tl(t,r)}_callParseArg(t,r,o,i){try{return t.parseArg(r,o)}catch(a){if(a.code==="commander.invalidArgument"){let p=`${i} ${a.message}`;this.error(p,{exitCode:a.exitCode,code:a.code})}throw a}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
17
+ - already used by option '${r.flags}'`)}this.options.push(t)}_registerCommand(t){let r=i=>[i.name()].concat(i.aliases()),o=r(t).find(i=>this._findCommand(i));if(o){let i=r(this._findCommand(o)).join("|"),a=r(t).join("|");throw new Error(`cannot add command '${a}' as already have command '${i}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),o=t.attributeName();if(t.negate){let a=t.long.replace(/^--no-/,"--");this._findOption(a)||this.setOptionValueWithSource(o,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let i=(a,p,u)=>{a==null&&t.presetArg!==void 0&&(a=t.presetArg);let l=this.getOptionValue(o);a!==null&&t.parseArg?a=this._callParseArg(t,a,l,p):a!==null&&t.variadic&&(a=t._concatValue(a,l)),a==null&&(t.negate?a=!1:t.isBoolean()||t.optional?a=!0:a=""),this.setOptionValueWithSource(o,a,u)};return this.on("option:"+r,a=>{let p=`error: option '${t.flags}' argument '${a}' is invalid.`;i(a,p,"cli")}),t.envVar&&this.on("optionEnv:"+r,a=>{let p=`error: option '${t.flags}' value '${a}' from env '${t.envVar}' is invalid.`;i(a,p,"env")}),this}_optionEx(t,r,o,i,a){if(typeof r=="object"&&r instanceof Tl)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let p=this.createOption(r,o);if(p.makeOptionMandatory(!!t.mandatory),typeof i=="function")p.default(a).argParser(i);else if(i instanceof RegExp){let u=i;i=(l,f)=>{let y=u.exec(l);return y?y[0]:f},p.default(a).argParser(i)}else p.default(i);return this.addOption(p)}option(t,r,o,i){return this._optionEx({},t,r,o,i)}requiredOption(t,r,o,i){return this._optionEx({mandatory:!0},t,r,o,i)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,o){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(r=o.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){ae.versions?.electron&&(r.from="electron");let i=ae.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}t===void 0&&(t=ae.argv),this.rawArgs=t.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":ae.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return this._parseCommand([],o),this}async parseAsync(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,o){if(Ra.existsSync(t))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",a=`'${t}' does not exist
19
19
  - if '${o}' 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
- - ${i}`;throw new Error(a)}_executeSubCommand(t,r){r=r.slice();let o=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function a(y,I){let x=nr.resolve(y,I);if(Oa.existsSync(x))return x;if(i.includes(nr.extname(I)))return;let _e=i.find(fe=>Oa.existsSync(`${x}${fe}`));if(_e)return`${x}${_e}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let p=t._executableFile||`${this._name}-${t._name}`,u=this._executableDir||"";if(this._scriptPath){let y;try{y=Oa.realpathSync(this._scriptPath)}catch{y=this._scriptPath}u=nr.resolve(nr.dirname(y),u)}if(u){let y=a(u,p);if(!y&&!t._executableFile&&this._scriptPath){let I=nr.basename(this._scriptPath,nr.extname(this._scriptPath));I!==this._name&&(y=a(u,`${I}-${t._name}`))}p=y||p}o=i.includes(nr.extname(p));let l;ie.platform!=="win32"?o?(r.unshift(p),r=ul(ie.execArgv).concat(r),l=_p.spawn(ie.argv[0],r,{stdio:"inherit"})):l=_p.spawn(p,r,{stdio:"inherit"}):(this._checkForMissingExecutable(p,u,t._name),r.unshift(p),r=ul(ie.execArgv).concat(r),l=_p.spawn(ie.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(I=>{ie.on(I,()=>{l.killed===!1&&l.exitCode===null&&l.kill(I)})});let f=this._exitCallback;l.on("close",y=>{y=y??1,f?f(new hp(y,"commander.executeSubCommandAsync","(close)")):ie.exit(y)}),l.on("error",y=>{if(y.code==="ENOENT")this._checkForMissingExecutable(p,u,t._name);else if(y.code==="EACCES")throw new Error(`'${p}' not executable`);if(!f)ie.exit(1);else{let I=new hp(1,"commander.executeSubCommandAsync","(error)");I.nestedError=y,f(I)}}),this.runningCommand=l}_dispatchSubcommand(t,r,o){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let a;return a=this._chainOrCallSubCommandHook(a,i,"preSubcommand"),a=this._chainOrCall(a,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(o));else return i._parseCommand(r,o)}),a}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(o,i,a)=>{let p=i;if(i!==null&&o.parseArg){let u=`error: command-argument value '${i}' is invalid for argument '${o.name()}'.`;p=this._callParseArg(o,i,a,u)}return p};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((o,i)=>{let a=o.defaultValue;o.variadic?i<this.args.length?(a=this.args.slice(i),o.parseArg&&(a=a.reduce((p,u)=>t(o,u,p),o.defaultValue))):a===void 0&&(a=[]):i<this.args.length&&(a=this.args[i],o.parseArg&&(a=t(o,a,o.defaultValue))),r[i]=a}),this.processedArgs=r}_chainOrCall(t,r){return t&&t.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let o=t,i=[];return this._getCommandAndAncestors().reverse().filter(a=>a._lifeCycleHooks[r]!==void 0).forEach(a=>{a._lifeCycleHooks[r].forEach(p=>{i.push({hookedCommand:a,callback:p})})}),r==="postAction"&&i.reverse(),i.forEach(a=>{o=this._chainOrCall(o,()=>a.callback(a.hookedCommand,this))}),o}_chainOrCallSubCommandHook(t,r,o){let i=t;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(a=>{i=this._chainOrCall(i,()=>a(this,r))}),i}_parseCommand(t,r){let o=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(o.operands),r=o.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},a=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let p;return p=this._chainOrCallHooks(p,"preAction"),p=this._chainOrCall(p,()=>this._actionHandler(this.processedArgs)),this.parent&&(p=this._chainOrCall(p,()=>{this.parent.emit(a,t,r)})),p=this._chainOrCallHooks(p,"postAction"),p}if(this.parent&&this.parent.listenerCount(a))i(),this._processArguments(),this.parent.emit(a,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(o=>{let i=o.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(o=>o.conflictsWith.length>0).forEach(o=>{let i=t.find(a=>o.conflictsWith.includes(a.attributeName()));i&&this._conflictingOption(o,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],o=[],i=r,a=t.slice();function p(l){return l.length>1&&l[0]==="-"}let u=null;for(;a.length;){let l=a.shift();if(l==="--"){i===o&&i.push(l),i.push(...a);break}if(u&&!p(l)){this.emit(`option:${u.name()}`,l);continue}if(u=null,p(l)){let f=this._findOption(l);if(f){if(f.required){let y=a.shift();y===void 0&&this.optionMissingArgument(f),this.emit(`option:${f.name()}`,y)}else if(f.optional){let y=null;a.length>0&&!p(a[0])&&(y=a.shift()),this.emit(`option:${f.name()}`,y)}else this.emit(`option:${f.name()}`);u=f.variadic?f:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let f=this._findOption(`-${l[1]}`);if(f){f.required||f.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${f.name()}`,l.slice(2)):(this.emit(`option:${f.name()}`),a.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let f=l.indexOf("="),y=this._findOption(l.slice(0,f));if(y&&(y.required||y.optional)){this.emit(`option:${y.name()}`,l.slice(f+1));continue}}if(p(l)&&(i=o),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&o.length===0){if(this._findCommand(l)){r.push(l),a.length>0&&o.push(...a);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),a.length>0&&r.push(...a);break}else if(this._defaultCommandName){o.push(l),a.length>0&&o.push(...a);break}}if(this._passThroughOptions){i.push(l),a.length>0&&i.push(...a);break}i.push(l)}return{operands:r,unknown:o}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let o=0;o<r;o++){let i=this.options[o].attributeName();t[i]=i===this._versionOptionName?this._version:this[i]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
21
+ - ${i}`;throw new Error(a)}_executeSubCommand(t,r){r=r.slice();let o=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function a(y,I){let x=nr.resolve(y,I);if(Ra.existsSync(x))return x;if(i.includes(nr.extname(I)))return;let le=i.find(Se=>Ra.existsSync(`${x}${Se}`));if(le)return`${x}${le}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let p=t._executableFile||`${this._name}-${t._name}`,u=this._executableDir||"";if(this._scriptPath){let y;try{y=Ra.realpathSync(this._scriptPath)}catch{y=this._scriptPath}u=nr.resolve(nr.dirname(y),u)}if(u){let y=a(u,p);if(!y&&!t._executableFile&&this._scriptPath){let I=nr.basename(this._scriptPath,nr.extname(this._scriptPath));I!==this._name&&(y=a(u,`${I}-${t._name}`))}p=y||p}o=i.includes(nr.extname(p));let l;ae.platform!=="win32"?o?(r.unshift(p),r=hl(ae.execArgv).concat(r),l=Rp.spawn(ae.argv[0],r,{stdio:"inherit"})):l=Rp.spawn(p,r,{stdio:"inherit"}):(this._checkForMissingExecutable(p,u,t._name),r.unshift(p),r=hl(ae.execArgv).concat(r),l=Rp.spawn(ae.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(I=>{ae.on(I,()=>{l.killed===!1&&l.exitCode===null&&l.kill(I)})});let f=this._exitCallback;l.on("close",y=>{y=y??1,f?f(new Cp(y,"commander.executeSubCommandAsync","(close)")):ae.exit(y)}),l.on("error",y=>{if(y.code==="ENOENT")this._checkForMissingExecutable(p,u,t._name);else if(y.code==="EACCES")throw new Error(`'${p}' not executable`);if(!f)ae.exit(1);else{let I=new Cp(1,"commander.executeSubCommandAsync","(error)");I.nestedError=y,f(I)}}),this.runningCommand=l}_dispatchSubcommand(t,r,o){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let a;return a=this._chainOrCallSubCommandHook(a,i,"preSubcommand"),a=this._chainOrCall(a,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(o));else return i._parseCommand(r,o)}),a}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(o,i,a)=>{let p=i;if(i!==null&&o.parseArg){let u=`error: command-argument value '${i}' is invalid for argument '${o.name()}'.`;p=this._callParseArg(o,i,a,u)}return p};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((o,i)=>{let a=o.defaultValue;o.variadic?i<this.args.length?(a=this.args.slice(i),o.parseArg&&(a=a.reduce((p,u)=>t(o,u,p),o.defaultValue))):a===void 0&&(a=[]):i<this.args.length&&(a=this.args[i],o.parseArg&&(a=t(o,a,o.defaultValue))),r[i]=a}),this.processedArgs=r}_chainOrCall(t,r){return t&&t.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let o=t,i=[];return this._getCommandAndAncestors().reverse().filter(a=>a._lifeCycleHooks[r]!==void 0).forEach(a=>{a._lifeCycleHooks[r].forEach(p=>{i.push({hookedCommand:a,callback:p})})}),r==="postAction"&&i.reverse(),i.forEach(a=>{o=this._chainOrCall(o,()=>a.callback(a.hookedCommand,this))}),o}_chainOrCallSubCommandHook(t,r,o){let i=t;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(a=>{i=this._chainOrCall(i,()=>a(this,r))}),i}_parseCommand(t,r){let o=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(o.operands),r=o.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},a=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let p;return p=this._chainOrCallHooks(p,"preAction"),p=this._chainOrCall(p,()=>this._actionHandler(this.processedArgs)),this.parent&&(p=this._chainOrCall(p,()=>{this.parent.emit(a,t,r)})),p=this._chainOrCallHooks(p,"postAction"),p}if(this.parent&&this.parent.listenerCount(a))i(),this._processArguments(),this.parent.emit(a,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(o=>{let i=o.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(o=>o.conflictsWith.length>0).forEach(o=>{let i=t.find(a=>o.conflictsWith.includes(a.attributeName()));i&&this._conflictingOption(o,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],o=[],i=r,a=t.slice();function p(l){return l.length>1&&l[0]==="-"}let u=null;for(;a.length;){let l=a.shift();if(l==="--"){i===o&&i.push(l),i.push(...a);break}if(u&&!p(l)){this.emit(`option:${u.name()}`,l);continue}if(u=null,p(l)){let f=this._findOption(l);if(f){if(f.required){let y=a.shift();y===void 0&&this.optionMissingArgument(f),this.emit(`option:${f.name()}`,y)}else if(f.optional){let y=null;a.length>0&&!p(a[0])&&(y=a.shift()),this.emit(`option:${f.name()}`,y)}else this.emit(`option:${f.name()}`);u=f.variadic?f:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let f=this._findOption(`-${l[1]}`);if(f){f.required||f.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${f.name()}`,l.slice(2)):(this.emit(`option:${f.name()}`),a.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let f=l.indexOf("="),y=this._findOption(l.slice(0,f));if(y&&(y.required||y.optional)){this.emit(`option:${y.name()}`,l.slice(f+1));continue}}if(p(l)&&(i=o),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&o.length===0){if(this._findCommand(l)){r.push(l),a.length>0&&o.push(...a);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),a.length>0&&r.push(...a);break}else if(this._defaultCommandName){o.push(l),a.length>0&&o.push(...a);break}}if(this._passThroughOptions){i.push(l),a.length>0&&i.push(...a);break}i.push(l)}return{operands:r,unknown:o}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let o=0;o<r;o++){let i=this.options[o].attributeName();t[i]=i===this._versionOptionName?this._version:this[i]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
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 o=r||{},i=o.exitCode||1,a=o.code||"commander.error";this._exit(i,a,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in ie.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,ie.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new ER(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,o.implied[i],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let o=p=>{let u=p.attributeName(),l=this.getOptionValue(u),f=this.options.find(I=>I.negate&&u===I.attributeName()),y=this.options.find(I=>!I.negate&&u===I.attributeName());return f&&(f.presetArg===void 0&&l===!1||f.presetArg!==void 0&&l===f.presetArg)?f:y||p},i=p=>{let u=o(p),l=u.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},a=`error: ${i(t)} cannot be used with ${i(r)}`;this.error(a,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],a=this;do{let p=a.createHelp().visibleOptions(a).filter(u=>u.long).map(u=>u.long);i=i.concat(p),a=a.parent}while(a&&!a._enablePositionalOptions);r=ml(t,i)}let o=`error: unknown option '${t}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",a=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${o} but got ${t.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(a=>{i.push(a.name()),a.alias()&&i.push(a.alias())}),r=ml(t,i)}let o=`error: unknown command '${t}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(t,r,o){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",o=o||"output the version number";let i=this.createOption(r,o);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
- `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(t);if(o){let i=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>fR(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=nr.basename(t,nr.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),o=this._getOutputContext(t);r.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let i=r.formatHelp(this,r);return o.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let r=!!t.error,o,i,a;return r?(o=u=>this._outputConfiguration.writeErr(u),i=this._outputConfiguration.getErrHasColors(),a=this._outputConfiguration.getErrHelpWidth()):(o=u=>this._outputConfiguration.writeOut(u),i=this._outputConfiguration.getOutHasColors(),a=this._outputConfiguration.getOutHelpWidth()),{error:r,write:u=>(i||(u=this._outputConfiguration.stripColor(u)),o(u)),hasColors:i,helpWidth:a}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let o=this._getOutputContext(t),i={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(p=>p.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let a=this.helpInformation({error:o.error});if(r&&(a=r(a),typeof a!="string"&&!Buffer.isBuffer(a)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(a),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(p=>p.emit("afterAllHelp",i))}helpOption(t,r){return typeof t=="boolean"?(t?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(t=t??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(t,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this}help(t){this.outputHelp(t);let r=Number(ie.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
24
+ `),this.outputHelp({error:!0}));let o=r||{},i=o.exitCode||1,a=o.code||"commander.error";this._exit(i,a,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in ae.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,ae.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new qR(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,o.implied[i],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let o=p=>{let u=p.attributeName(),l=this.getOptionValue(u),f=this.options.find(I=>I.negate&&u===I.attributeName()),y=this.options.find(I=>!I.negate&&u===I.attributeName());return f&&(f.presetArg===void 0&&l===!1||f.presetArg!==void 0&&l===f.presetArg)?f:y||p},i=p=>{let u=o(p),l=u.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},a=`error: ${i(t)} cannot be used with ${i(r)}`;this.error(a,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],a=this;do{let p=a.createHelp().visibleOptions(a).filter(u=>u.long).map(u=>u.long);i=i.concat(p),a=a.parent}while(a&&!a._enablePositionalOptions);r=_l(t,i)}let o=`error: unknown option '${t}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",a=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${o} but got ${t.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(a=>{i.push(a.name()),a.alias()&&i.push(a.alias())}),r=_l(t,i)}let o=`error: unknown command '${t}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(t,r,o){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",o=o||"output the version number";let i=this.createOption(r,o);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
+ `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(t);if(o){let i=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>jR(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=nr.basename(t,nr.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),o=this._getOutputContext(t);r.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let i=r.formatHelp(this,r);return o.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let r=!!t.error,o,i,a;return r?(o=u=>this._outputConfiguration.writeErr(u),i=this._outputConfiguration.getErrHasColors(),a=this._outputConfiguration.getErrHelpWidth()):(o=u=>this._outputConfiguration.writeOut(u),i=this._outputConfiguration.getOutHasColors(),a=this._outputConfiguration.getOutHelpWidth()),{error:r,write:u=>(i||(u=this._outputConfiguration.stripColor(u)),o(u)),hasColors:i,helpWidth:a}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let o=this._getOutputContext(t),i={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(p=>p.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let a=this.helpInformation({error:o.error});if(r&&(a=r(a),typeof a!="string"&&!Buffer.isBuffer(a)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(a),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(p=>p.emit("afterAllHelp",i))}helpOption(t,r){return typeof t=="boolean"?(t?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(t=t??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(t,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this}help(t){this.outputHelp(t);let r=Number(ae.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${o.join("', '")}'`);let i=`${t}Help`;return this.on(i,a=>{let p;typeof r=="function"?p=r({error:a.error,command:a.command}):p=r,p&&a.write(`${p}
27
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ul(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",i="9229",a;return(a=t.match(/^(--inspect(-brk)?)$/))!==null?r=a[1]:(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=a[1],/^\d+$/.test(a[3])?i=a[3]:o=a[3]):(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=a[1],o=a[3],i=a[4]),r&&i!=="0"?`${r}=${o}:${parseInt(i)+1}`:t})}function Ap(){if(ie.env.NO_COLOR||ie.env.FORCE_COLOR==="0"||ie.env.FORCE_COLOR==="false")return!1;if(ie.env.FORCE_COLOR||ie.env.CLICOLOR_FORCE!==void 0)return!0}Sp.Command=Op;Sp.useColor=Ap});var yl=Wr(xt=>{var{Argument:dl}=ha(),{Command:bp}=ll(),{CommanderError:IR,InvalidArgumentError:fl}=Bo(),{Help:TR}=gp(),{Option:gl}=Tp();xt.program=new bp;xt.createCommand=e=>new bp(e);xt.createOption=(e,t)=>new gl(e,t);xt.createArgument=(e,t)=>new dl(e,t);xt.Command=bp;xt.Option=gl;xt.Argument=dl;xt.Help=TR;xt.CommanderError=IR;xt.InvalidArgumentError=fl;xt.InvalidOptionArgumentError=fl});var El=ol(yl(),1),{program:TF,createCommand:_F,createArgument:hF,createOption:OF,CommanderError:AF,InvalidArgumentError:SF,InvalidOptionArgumentError:bF,Command:Il,Argument:xF,Option:xp,Help:RF}=El.default;function Rt(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}var g={};bt(g,{Assign:()=>_R,Clone:()=>Ho,Create:()=>OC,Discard:()=>AC,Metrics:()=>Nt,Update:()=>SC});var Nt={assign:0,create:0,clone:0,discard:0,update:0};function _R(e,t){return Nt.assign+=1,{...e,...t}}var s={};bt(s,{Entries:()=>qR,EntriesRegExp:()=>BR,Every:()=>vR,EveryAll:()=>jR,GraphemeCount:()=>$R,HasPropertyKey:()=>FR,IsArray:()=>Zr,IsAsyncIterator:()=>xR,IsBigInt:()=>qo,IsBoolean:()=>bl,IsClassInstance:()=>wR,IsConstructor:()=>RR,IsDeepEqual:()=>Up,IsEqual:()=>X,IsFunction:()=>xl,IsGreaterEqualThan:()=>Cl,IsGreaterThan:()=>NR,IsInteger:()=>Cp,IsIterator:()=>CR,IsLessEqualThan:()=>Rl,IsLessThan:()=>LR,IsMaxLength:()=>DR,IsMinLength:()=>GR,IsMultipleOf:()=>kR,IsNull:()=>ba,IsNumber:()=>xa,IsObject:()=>Xr,IsObjectNotArray:()=>PR,IsString:()=>Or,IsSymbol:()=>UR,IsUndefined:()=>Pp,IsValueLike:()=>MR,Keys:()=>Sa,Symbols:()=>HR,Values:()=>KR});function hr(e,t,r){return e>=t&&e<=r}function Tl(e){return hr(e,127462,127487)}function hR(e){return hr(e,65024,65039)}function OR(e){return hr(e,768,879)||hr(e,6832,6911)||hr(e,7616,7679)||hr(e,65056,65071)}function Aa(e){return e>65535?2:1}function _l(e,t){for(;t<e.length;){let r=e.codePointAt(t);if(OR(r)||hR(r))t+=Aa(r);else break}return t}function Rp(e,t){let r=e.codePointAt(t),o=t+Aa(r);for(o=_l(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+Aa(i),o=_l(e,o)}return Tl(r)&&o<e.length&&Tl(e.codePointAt(o))&&(o+=Aa(e.codePointAt(o))),o}function hl(e){return hr(e,55296,56319)||hr(e,768,879)||e===8205}function Ol(e){let t=0,r=0;for(;r<e.length;)r=Rp(e,r),t++;return t}function AR(e,t){let r=0,o=0;for(;o<e.length;)if(o=Rp(e,o),r++,r>=t)return!0;return!1}function SR(e,t){let r=0,o=0;for(;o<e.length;)if(o=Rp(e,o),r++,r>t)return!1;return!0}function Al(e,t){let r=0;for(;r<e.length;){if(hl(e.charCodeAt(r)))return AR(e,t);if(r++,r>=t)return!0}return!1}function Sl(e,t){let r=0;for(;r<e.length;){if(hl(e.charCodeAt(r)))return SR(e,t);if(r++,r>t)return!1}return!0}function Zr(e){return Array.isArray(e)}function xR(e){return Xr(e)&&Symbol.asyncIterator in e}function qo(e){return X(typeof e,"bigint")}function bl(e){return X(typeof e,"boolean")}function RR(e){if(Pp(e)||!xl(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function xl(e){return X(typeof e,"function")}function Cp(e){return Number.isInteger(e)}function CR(e){return Xr(e)&&Symbol.iterator in e}function ba(e){return X(e,null)}function xa(e){return Number.isFinite(e)}function PR(e){return Xr(e)&&!Zr(e)}function Xr(e){return X(typeof e,"object")&&!ba(e)}function Or(e){return X(typeof e,"string")}function UR(e){return X(typeof e,"symbol")}function Pp(e){return X(e,void 0)}function X(e,t){return e===t}function NR(e,t){return e>t}function LR(e,t){return e<t}function Rl(e,t){return e<=t}function Cl(e,t){return e>=t}function kR(e,t){if(qo(e)||qo(t))return BigInt(e)%BigInt(t)===0n;let r=1e-10;if(!xa(e)||Cp(e)&&1/t%1===0)return!0;let o=e%t;return Math.min(Math.abs(o),Math.abs(o-t))<r}function wR(e){if(!Xr(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return ba(t)?!1:X(typeof t.constructor,"function")&&!(X(t.constructor,globalThis.Object)||X(t.constructor.name,"Object"))}function MR(e){return qo(e)||bl(e)||ba(e)||xa(e)||Or(e)||Pp(e)}function $R(e){return Ol(e)}function DR(e,t){return Sl(e,t)}function GR(e,t){return Al(e,t)}function vR(e,t,r){for(let o=t;o<e.length;o++)if(!r(e[o],o))return!1;return!0}function jR(e,t,r){let o=!0;for(let i=t;i<e.length;i++)r(e[i],i)||(o=!1);return o}function FR(e,t){return X(t,"__proto__")||X(t,"constructor")?Object.prototype.hasOwnProperty.call(e,t):t in e}function BR(e){return Sa(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function qR(e){return Object.entries(e)}function Sa(e){return Object.getOwnPropertyNames(e)}function HR(e){return Object.getOwnPropertySymbols(e)}function KR(e){return Object.values(e)}function zR(e,t){if(!Xr(t))return!1;let r=Sa(e);return X(r.length,Sa(t).length)&&r.every(o=>Up(e[o],t[o]))}function VR(e,t){return Zr(t)&&X(e.length,t.length)&&e.every((r,o)=>Up(e[o],t[o]))}function Up(e,t){return Zr(e)?VR(e,t):Xr(e)?zR(e,t):X(e,t)}var Ze={};bt(Ze,{IsBigInt64Array:()=>sC,IsBigUint64Array:()=>pC,IsBoolean:()=>YR,IsDate:()=>mC,IsFloat32Array:()=>iC,IsFloat64Array:()=>aC,IsInt16Array:()=>tC,IsInt32Array:()=>nC,IsInt8Array:()=>XR,IsMap:()=>lC,IsNumber:()=>QR,IsRegExp:()=>cC,IsSet:()=>uC,IsString:()=>WR,IsTypeArray:()=>ZR,IsUint16Array:()=>rC,IsUint32Array:()=>oC,IsUint8Array:()=>JR,IsUint8ClampedArray:()=>eC});function YR(e){return e instanceof Boolean}function QR(e){return e instanceof Number}function WR(e){return e instanceof String}function ZR(e){return globalThis.ArrayBuffer.isView(e)}function XR(e){return e instanceof globalThis.Int8Array}function JR(e){return e instanceof globalThis.Uint8Array}function eC(e){return e instanceof globalThis.Uint8ClampedArray}function tC(e){return e instanceof globalThis.Int16Array}function rC(e){return e instanceof globalThis.Uint16Array}function nC(e){return e instanceof globalThis.Int32Array}function oC(e){return e instanceof globalThis.Uint32Array}function iC(e){return e instanceof globalThis.Float32Array}function aC(e){return e instanceof globalThis.Float64Array}function sC(e){return e instanceof globalThis.BigInt64Array}function pC(e){return e instanceof globalThis.BigUint64Array}function cC(e){return e instanceof globalThis.RegExp}function mC(e){return e instanceof globalThis.Date}function uC(e){return e instanceof globalThis.Set}function lC(e){return e instanceof globalThis.Map}function fC(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~guard")}function gC(e){return e.map(t=>Np(t))}function yC(e){let t={},r=Object.getOwnPropertyDescriptors(e);for(let o of Object.keys(r)){let i=r[o];s.HasPropertyKey(i,"value")&&Object.defineProperty(t,o,{...i,value:Np(i.value)})}return t}function EC(e){return new RegExp(e.source,e.flags)}function Np(e){return e instanceof RegExp?EC(e):fC(e)?e:s.IsArray(e)?gC(e):s.IsObject(e)?yC(e):e}function Ho(e){return Nt.clone+=1,Np(e)}var It={};bt(It,{Get:()=>_C,Reset:()=>IC,Set:()=>TC});var Jr={immutableTypes:!1,maxErrors:8,useEval:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1};function IC(){Jr.immutableTypes=!1,Jr.maxErrors=8,Jr.useEval=!0,Jr.exactOptionalPropertyTypes=!1,Jr.enumerableKind=!1}function TC(e){for(let t of s.Keys(e)){let r=e[t];r!==void 0&&Object.defineProperty(Jr,t,{value:r})}}function _C(){return Jr}function hC(e,t,r={}){for(let o of Object.keys(t))Object.defineProperty(e,o,{configurable:!0,writable:!0,enumerable:!1,value:t[o]});return e}function Pl(e,t){return{...e,...t}}function OC(e,t,r={}){Nt.create+=1;let o=It.Get(),i=Pl(t,r),a=o.enumerableKind?Pl(i,e):hC(i,e);return o.immutableTypes?Object.freeze(a):a}function AC(e,t){Nt.discard+=1;let r={},o=Object.getOwnPropertyDescriptors(Ho(e)),i=new Set(t);for(let a of Object.keys(o))i.has(a)||Object.defineProperty(r,a,o[a]);return r}function SC(e,t,r){Nt.update+=1;let o=It.Get(),i=Ho(e);for(let a of Object.keys(t))Object.defineProperty(i,a,{configurable:!0,writable:!0,enumerable:o.enumerableKind,value:t[a]});for(let a of Object.keys(r))Object.defineProperty(i,a,{configurable:!0,enumerable:!0,writable:!0,value:r[a]});return i}function h(e,t){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],t)}function A(e){return s.IsObject(e)}function Ul(e){return g.Create({"~kind":"OptionalAddAction"},{type:e},{})}function Nl(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalAddAction")&&A(e.type)}function Ll(e){return g.Create({"~kind":"OptionalRemoveAction"},{type:e},{})}function kl(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalRemoveAction")&&A(e.type)}function wl(e){return g.Create({"~kind":"ReadonlyAddAction"},{type:e},{})}function Ml(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyAddAction")&&A(e.type)}function $l(e){return g.Create({"~kind":"ReadonlyRemoveAction"},{type:e},{})}function Dl(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyRemoveAction")&&A(e.type)}function C(e,t,r){return g.Create({"~kind":"Deferred"},{action:e,parameters:t,options:r},{})}function Gl(e){return h(e,"Deferred")}function Lp(e){return g.Update(e,{"~immutable":!0},{})}function Ar(e){return Lp(e)}function en(e){return A(e)&&s.HasPropertyKey(e,"~immutable")}function jn(e){return g.Discard(e,["~optional"])}function ot(e){return g.Update(e,{"~optional":!0},{})}function Ra(e){return ot(e)}function Pe(e){return A(e)&&s.HasPropertyKey(e,"~optional")}function Ca(e){return g.Discard(e,["~readonly"])}function it(e){return g.Update(e,{"~readonly":!0},{})}function Pa(e){return it(e)}function tn(e){return A(e)&&s.HasPropertyKey(e,"~readonly")}function Lt(e,t){return g.Create({"~kind":"Array"},{type:"array",items:e},t)}function J(e){return h(e,"Array")}function Ua(e){return g.Discard(e,["~kind","type","items"])}function Gt(e,t){return g.Create({"~kind":"AsyncIterator"},{type:"asyncIterator",iteratorItems:e},t)}function Ye(e){return h(e,"AsyncIterator")}function vl(e){return g.Discard(e,["~kind","type","iteratorItems"])}function jl(e){return{enumerable:It.Get().enumerableKind,writable:!1,configurable:!1,value:e}}var Na=class{constructor(){globalThis.Object.defineProperty(this,"~kind",jl("Base")),globalThis.Object.defineProperty(this,"~guard",jl({check:t=>this.Check(t),errors:t=>this.Errors(t)}))}Check(t){return!0}Errors(t){return[]}Convert(t){return t}Clean(t){return t}Default(t){return t}Create(){throw new Error("Create not implemented")}Clone(){throw Error("Clone not implemented")}};function Tt(e){return h(e,"Base")}function Sr(e,t,r={}){return g.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},r)}function Ue(e){return h(e,"Constructor")}function Fl(e){return g.Discard(e,["~kind","type","parameters","instanceType"])}function br(e,t,r={}){return g.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},r)}function Ne(e){return h(e,"Function")}function Bl(e){return g.Discard(e,["~kind","type","parameters","returnType"])}function be(e,t){return g.Create({"~kind":"Ref"},{$ref:e},t)}function se(e){return h(e,"Ref")}function xr(e,t){return g.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function Fn(e){return h(e,"Generic")}var ql="(?!)";function V(e){return g.Create({"~kind":"Never"},{not:{}},e)}function or(e){return h(e,"Never")}function bC(){return["(not-resolvable)",V()]}function xC(){return["(not-generic)",V()]}function RC(e,t,r){return[e,xr(t,r)]}function CC(e,t,r){return t in e?Hl(e,t,e[t],r):bC()}function Hl(e,t,r,o){return Fn(r)?RC(t,r.parameters,r.expression):se(r)?CC(e,r.$ref,o):xC()}function Kl(e,t,r){return Hl(e,"(anonymous)",t,r)}function vt(e,t,r){let o=s.Keys(e).reduce((i,a)=>({...i,[a]:g.Update(e[a],{},{$id:a})}),{});return g.Create({"~kind":"Cyclic"},{$defs:o,$ref:t},r)}function pe(e){return h(e,"Cyclic")}var re={};bt(re,{Match:()=>PC});function PC(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function Fe(e){return g.Create({"~kind":"Unknown"},{},e)}function at(e){return h(e,"Unknown")}function Ko(...e){let[t,r]=re.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,Fe(),Fe()]});return g.Create({"~kind":"Infer"},{type:"infer",name:t,extends:r},{})}function he(e){return h(e,"Infer")}function Bn(e){return g.Create({"~kind":"Any"},{},e)}function Xe(e){return h(e,"Any")}function zl(e){return s.IsObjectNotArray(e)}function Vl(e){return s.Keys(e).filter(r=>isNaN(r)).reduce((r,o)=>[...r,e[o]],[])}function Yl(e,t){let r=zl(e)?Vl(e):e;return g.Create({"~kind":"Enum"},{enum:r},t)}function Oe(e){return h(e,"Enum")}function _t(e,t={}){return g.Create({"~kind":"Intersect"},{allOf:e},t)}function U(e){return h(e,"Intersect")}function Ql(e){return g.Discard(e,["~kind","allOf"])}function F(){throw new Error("Unreachable")}var Cr={};bt(Cr,{Hash:()=>VC,HashCode:()=>rd});function UC(e){let t=new Set,r=e;for(;r&&r!==Object.prototype;){for(let o of Reflect.ownKeys(r))o!=="constructor"&&typeof o!="symbol"&&t.add(o);r=Object.getPrototypeOf(r)}return[...t]}function NC(e){return typeof e=="number"}var Je;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(Je||(Je={}));var qn=BigInt("14695981039346656037"),[LC,kC]=[BigInt("1099511628211"),BigInt("18446744073709551616")],wC=Array.from({length:256}).map((e,t)=>BigInt(t)),Jl=new Float64Array(1),ed=new DataView(Jl.buffer),td=new Uint8Array(Jl.buffer);function Be(e){qn=qn^wC[e],qn=qn*LC%kC}function MC(e){Be(Je.Array);for(let t of e)Rr(t)}function $C(e){Be(Je.BigInt),ed.setBigInt64(0,e);for(let t of td)Be(t)}function Zl(e){Be(Je.Boolean),Be(e?1:0)}function DC(e){Be(Je.Constructor),Rr(e.toString())}function GC(e){Be(Je.Date),Rr(e.getTime())}function vC(e){Be(Je.Function),Rr(e.toString())}function jC(e){Be(Je.Null)}function Xl(e){Be(Je.Number),ed.setFloat64(0,e,!0);for(let t of td)Be(t)}function FC(e){Be(Je.Object);for(let t of UC(e).sort())Rr(t),Rr(e[t])}function BC(e){Be(Je.RegExp),kp(e.toString())}var qC=new TextEncoder;function kp(e){Be(Je.String);for(let t of qC.encode(e))Be(t)}function HC(e){Be(Je.Symbol),Rr(e.toString())}function KC(e){Be(Je.TypeArray);let t=new Uint8Array(e.buffer);for(let r=0;r<t.length;r++)Be(t[r])}function zC(e){return Be(Je.Undefined)}function Rr(e){return Ze.IsTypeArray(e)?KC(e):Ze.IsDate(e)?GC(e):Ze.IsRegExp(e)?BC(e):Ze.IsBoolean(e)?Zl(e.valueOf()):Ze.IsString(e)?kp(e.valueOf()):Ze.IsNumber(e)?Xl(e.valueOf()):NC(e)?Xl(e):s.IsArray(e)?MC(e):s.IsBoolean(e)?Zl(e):s.IsBigInt(e)?$C(e):s.IsConstructor(e)?DC(e):s.IsNull(e)?jC(e):s.IsObject(e)?FC(e):s.IsString(e)?kp(e):s.IsSymbol(e)?HC(e):s.IsUndefined(e)?zC(e):s.IsFunction(e)?vC(e):F()}function rd(e){return qn=BigInt("14695981039346656037"),Rr(e),qn}function VC(e){return rd(e).toString(16).padStart(16,"0")}function nd(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~guard":return"must match check function";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var YC=nd;function od(){return YC}var zo=class{constructor(t,r){this.type=t,this.decode=r}Encode(t){let r=this.type,o=rn(r)?p=>this.decode(r["~codec"].decode(p)):this.decode,i=rn(r)?p=>r["~codec"].encode(t(p)):t,a={decode:o,encode:i};return g.Update(this.type,{"~codec":a},{})}},Vo=class{constructor(t){this.type=t}Decode(t){return new zo(this.type,t)}};function La(e){return new Vo(e)}function ad(e,t){return La(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function sd(e,t){return La(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function rn(e){return A(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function WC(e,t){let r=ka(e)?[...e["~refine"],t]:[t];return g.Update(e,{"~refine":r},{})}function pd(e,t,r="error"){return WC(e,{refine:t,message:r})}function ka(e){return A(e)&&s.HasPropertyKey(e,"~refine")}var cd="-?(?:0|[1-9][0-9]*)n";function Yo(e){return g.Create({"~kind":"BigInt"},{type:"bigint"},e)}function ut(e){return h(e,"BigInt")}function wa(e){return g.Create({"~kind":"Boolean"},{type:"boolean"},e)}function et(e){return h(e,"Boolean")}function Qo(e){return g.Create({"~kind":"Identifier"},{name:e})}function md(e){return h(e,"Identifier")}var Ma="-?(?:0|[1-9][0-9]*)";function nn(e){return g.Create({"~kind":"Integer"},{type:"integer"},e)}function Me(e){return h(e,"Integer")}function jt(e,t){return g.Create({"~kind":"Iterator"},{type:"iterator",iteratorItems:e},t)}function Qe(e){return h(e,"Iterator")}function ud(e){return g.Discard(e,["~kind","type","iteratorItems"])}var wp=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function ZC(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new wp(e)})()}function H(e,t){return g.Create({"~kind":"Literal"},{type:ZC(e),const:e},t)}function $a(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function ld(e){return Y(e)&&s.IsBigInt(e.const)}function dd(e){return Y(e)&&s.IsBoolean(e.const)}function Hn(e){return Y(e)&&s.IsNumber(e.const)}function Kn(e){return Y(e)&&s.IsString(e.const)}function Y(e){return h(e,"Literal")}function Pr(e){return g.Create({"~kind":"Null"},{type:"null"},e)}function Ft(e){return h(e,"Null")}var Da="-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";function ht(e){return g.Create({"~kind":"Number"},{type:"number"},e)}function ge(e){return h(e,"Number")}function zn(e){return g.Create({"~kind":"Symbol"},{type:"symbol"},e)}function Bt(e){return h(e,"Symbol")}function fd(e){return s.Keys(e).filter(t=>!Pe(e[t]))}function gd(e){return s.Keys(e)}function Ga(e){return s.Values(e)}function XC(e,t={}){let r=fd(e),o=r.length>0?{required:r}:{};return g.Create({"~kind":"Object"},{type:"object",...o,properties:e},t)}var N=XC;function w(e){return h(e,"Object")}function yd(e){return g.Discard(e,["~kind","type","properties","required"])}function on(...e){let[t,r,o]=re.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[i,a,a],1:i=>[i,Fe(),Fe()]});return g.Create({"~kind":"Parameter"},{name:t,extends:r,equals:o},{})}function Ed(e){return h(e,"Parameter")}function qt(e,t){return g.Create({"~kind":"Promise"},{type:"promise",item:e},t)}function qe(e){return h(e,"Promise")}function Id(e){return g.Discard(e,["~kind","type","item"])}var va=".*";function st(e){return g.Create({"~kind":"String"},{type:"string"},e)}function xe(e){return h(e,"String")}function pt(e,t){let r="object",o={[e]:t};return g.Create({"~kind":"Record"},{type:r,patternProperties:o})}var Vn=`^${Ma}$`,Yn=`^${Da}$`,Ht=`^${va}$`;function Wo(e,t,r={}){return C("Record",[e,t],r)}function JC(e,t,r={}){return R({},Wo(e,t,r))}function ja(e,t,r={}){return JC(e,t,r)}function Td(e,t){return pt(e,t)}function lt(e){return s.Keys(e.patternProperties)[0]}function Qn(e){let t=lt(e);return s.IsEqual(t,Vn)?nn():s.IsEqual(t,Yn)?ht():st()}function He(e){return e.patternProperties[lt(e)]}function ye(e){return h(e,"Record")}function an(e){return g.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function Ur(e){return h(e,"Rest")}function Fa(e){return g.Create({"~kind":"This"},{$ref:"#"},e)}function _d(e){return h(e,"This")}function $e(e,t={}){let[r,o,i]=[e,e.length,!1];return g.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:r,minItems:o},t)}function K(e){return h(e,"Tuple")}function hd(e){return g.Discard(e,["~kind","type","items","minItems","additionalItems"])}function Wn(e){return g.Create({"~kind":"Undefined"},{type:"undefined"},e)}function Kt(e){return h(e,"Undefined")}function G(e,t={}){return g.Create({"~kind":"Union"},{anyOf:e},t)}function O(e){return h(e,"Union")}function Od(e){return g.Discard(e,["~kind","anyOf"])}function Ad(e){return g.Create({"~kind":"Unsafe"},{},e)}function Sd(e){return h(e,"Unsafe")}function Ba(e){return g.Create({"~kind":"Void"},{type:"void"},e)}function dt(e){return h(e,"Void")}function tP(e,t){return s.IsEqual(e,"Array")?Lt(t[0]):s.IsEqual(e,"AsyncIterator")?Gt(t[0]):s.IsEqual(e,"Iterator")?jt(t[0]):s.IsEqual(e,"Promise")?qt(t[0]):s.IsEqual(e,"Awaited")?gi(t[0]):s.IsEqual(e,"Capitalize")?Xo(t[0]):s.IsEqual(e,"ConstructorParameters")?ni(t[0]):s.IsEqual(e,"Evaluate")?$p(t[0]):s.IsEqual(e,"Exclude")?oi(t[0],t[1]):s.IsEqual(e,"Extract")?ii(t[0],t[1]):s.IsEqual(e,"Index")?Jn(t[0],t[1]):s.IsEqual(e,"InstanceType")?ai(t[0]):s.IsEqual(e,"Lowercase")?Jo(t[0]):s.IsEqual(e,"NonNullable")?si(t[0]):s.IsEqual(e,"Omit")?pi(t[0],t[1]):s.IsEqual(e,"Options")?to(t[0],t[1]):s.IsEqual(e,"Parameters")?ci(t[0]):s.IsEqual(e,"Partial")?mi(t[0]):s.IsEqual(e,"Pick")?ui(t[0],t[1]):s.IsEqual(e,"Readonly")?li(t[0]):s.IsEqual(e,"KeyOf")?eo(t[0]):s.IsEqual(e,"Record")?Wo(t[0],t[1]):s.IsEqual(e,"Required")?di(t[0]):s.IsEqual(e,"ReturnType")?fi(t[0]):s.IsEqual(e,"Uncapitalize")?ei(t[0]):s.IsEqual(e,"Uppercase")?ti(t[0]):qa(be(e),t)}function sn(){throw Error("Unreachable")}var rP=(e,t=[])=>e.reduce((r,o)=>s.IsArray(o)&&s.IsEqual(o.length,2)?[...r,o[0]]:[...r,o],[]),ir=e=>{let[t,r]=e;return rP([...t,...r])};function Pd(e){return on(e[0],e[2],e[4])}function Ud(e){return on(e[0],e[2],e[2])}function Nd(e){return on(e[0],Fe(),e[2])}function Ld(e){return on(e,Fe(),Fe())}function kd(e){return ir(e)}function wd(e){return e[1]}function Md(e){return ir(e)}function $d(e){return e[1]}function Dd(e){return tP(e[0],e[1])}function Gd(e){return null}function vd(e){return st()}function jd(e){return ht()}function Fd(e){return wa()}function Bd(e){return Wn()}function qd(e){return Pr()}function Hd(e){return nn()}function Kd(e){return Yo()}function zd(e){return Fe()}function Vd(e){return Bn()}function Yd(e){return N({})}function Qd(e){return V()}function Wd(e){return zn()}function Zd(e){return Ba()}function Xd(e){return Fa()}function Jd(e){return e[1]}function ef(e){return H(e)}function tf(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function rf(e){return e[1]}function nf(e){return Zo(e)}function of(e){return H(BigInt(e))}function af(e){return H(s.IsEqual(e,"true"))}function sf(e){return H(parseFloat(e))}function pf(e){return H(e)}function cf(e){return e.length>0}function mf(e){return e.reduce((t,r)=>s.IsEqual(r.length,3)?[...t,[r[1]]]:[...t,[]],[])}function uf(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function lf(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}var bd=(e,t)=>t.reduceRight((r,o)=>{let i=o;return s.IsEqual(i.length,1)?Jn(r,i[0]):s.IsEqual(i.length,0)?Lt(r):sn()},e),xd=(e,t)=>s.IsEqual(t.length,3)?ri(e,t[0],t[1],t[2]):e;function df(e){let[t,r,o,i]=e;return xd(t?eo(bd(r,o)):bd(r,o),i)}function Mp(e,t){return s.IsEqual(t.length,3)?(()=>{let[r,o,i]=t,a=Mp(o,i);if(s.IsEqual(r,"&"))return U(a)?_t([e,...a.allOf]):_t([e,a]);if(s.IsEqual(r,"|"))return O(a)?G([e,...a.anyOf]):G([e,a]);sn()})():e}function ff(e){let[t,r]=e;return Mp(t,r)}function gf(e){let[t,r]=e;return Mp(t,r)}function yf(e){return Lp(e[1])}function Ef(e){return e[1]}function If(e){return xr(e[0],e[2])}function Tf(e){return s.IsEqual(e.length,4)?Ko(e[1],e[3]):s.IsEqual(e.length,2)?Ko(e[1],Fe()):sn()}function _f(e){return`${e}`}function hf(e){return Me(e[3])?Vn:ge(e[3])?Yn:Bt(e[3])?Ht:xe(e[3])?Ht:sn()}function Of(e){return e.length>0}function Af(e){return e.length>0}function Sf(e){let[t,r,o,i,a]=e;return{[r]:t&&o?it(ot(a)):t&&!o?it(a):!t&&o?ot(a):a}}function bf(e){return ir(e)}function xf(e){return e.reduce((t,r)=>s.HasPropertyKey(r,Vn)||s.HasPropertyKey(r,Yn)||s.HasPropertyKey(r,Ht)?[t[0],g.Assign(t[1],r)]:[g.Assign(t[0],r),t[1]],[{},{}])}function Rf(e){return xf(e[1])}function Cf(e){let[t,r]=e,o=s.IsEqual(s.Keys(r).length,0)?{}:{patternProperties:r};return N(t,o)}function Pf(e){return s.IsEqual(e.length,5)?it(ot(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?it(e[3]):ot(e[3]):sn()}function Uf(e){return it(ot(e[1]))}function Nf(e){return it(e[1])}function Lf(e){return ot(e[0])}function kf(e){return s.IsEqual(e.length,2)?an(e[1]):s.IsEqual(e.length,1)?e[0]:sn()}function wf(e){return ir(e)}function Mf(e){return $e(e[1])}function $f(e){return it(ot(e[4]))}function Df(e){return it(e[3])}function Gf(e){return ot(e[3])}function vf(e){return e[2]}function jf(e){return s.IsEqual(e.length,2)?an(e[1]):s.IsEqual(e.length,1)?e[0]:sn()}function Ff(e){return ir(e)}function Bf(e){return br(e[1],e[4])}function qf(e){return Sr(e[2],e[5])}function Rd(e,t){return s.IsEqual(e,"remove")?$l(t):s.IsEqual(e,"add")?wl(t):t}function Hf(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function Cd(e,t){return s.IsEqual(e,"remove")?Ll(t):s.IsEqual(e,"add")?Ul(t):t}function Kf(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function zf(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function Vf(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?Zn(Qo(e[3]),e[5],e[6][0],Rd(e[1],Cd(e[8],e[10]))):Zn(Qo(e[3]),e[5],be(e[3]),Rd(e[1],Cd(e[8],e[10])))}function Yf(e){return be(e)}function Qf(e){return to(e[2],e[4])}function Wf(e){return parseFloat(e)}function Zf(e){return s.IsEqual(e,"true")}function Xf(e){return null}function Jf(e){return{[e[0]]:e[2]}}function eg(e){return ir(e)}function nP(e){return e.reduce((t,r)=>g.Assign(t,r),{})}function tg(e){return nP(e[1])}function rg(e){return ir(e)}function ng(e){return e[1]}function og(e){return Yo()}function ig(e){return st()}function ag(e){return ht()}function sg(e){return nn()}function pg(e){return V()}function cg(e){return H(e)}function mg(e){return G(e[1])}function ug(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function lg(e){return[e[0],...e[1]]}function dg(e){return e[1]}function fg(e){return ir(e)}function gg(e){return s.IsEqual(e.length,2)?e[1]:[]}function yg(e){let t=e[2],r=e[3],[o,i]=e[4],a=s.IsEqual(s.Keys(i).length,0)?{}:{patternProperties:i};return{[e[1]]:xr(t,Xn(r,o,a))}}function Eg(e){let t=e[2],[r,o]=e[3],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:Xn(t,r,i)}}function Ig(e){return{[e[1]]:xr(e[2],e[4])}}function Tg(e){return{[e[1]]:e[3]}}function _g(e){return null}function hg(e){return xf(ir(e))}function Og(e){return e[1]}function Ag(e){let t=e[0],r=e[1];return Dp(g.Assign(t,r[0]))}function ne(e){return Zr(e)&&X(e.length,2)}function aP(e,t){return X(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function Le(e,t){let[r,...o]=e;return Or(r)?(()=>{let i=aP(r,t);return X(i.length,2)?i:Le(o,t)})():[]}function Gp(e,t){return Array.from({length:t-e+1},(r,o)=>String.fromCharCode(e+o))}var Sg=[...Gp(97,122),...Gp(65,90)],vp="0",jp=Gp(49,57),ro=[vp,...jp],bg=" ",no=`
28
- `;var Nr="_",Ha=".",xg="$",Ka="-";var Rg="//",Cg="/*",pP="*/";function Pg(e){let t=e.indexOf(pP);return X(t,-1)?"":e.slice(t+2)}function Ug(e){let t=e.indexOf(no);return X(t,-1)?"":e.slice(t)}function cP(e){return e.replace(/^[ \t\r\f\v]+/,"")}function za(e){let t=cP(e);return t.startsWith(Cg)?za(Pg(t.slice(2))):t.startsWith(Rg)?za(Ug(t.slice(2))):t}function ct(e){let t=e.trimStart();return t.startsWith(Cg)?ct(Pg(t.slice(2))):t.startsWith(Rg)?ct(Ug(t.slice(2))):t}function mP(e,t){return e.includes(t)}function oo(e,t,r,o=""){let i=Le(e,r);return ne(i)?mP(t,i[0])?oo(e,t,i[1],o):oo(e,t,i[1],`${o}${i[0]}`):[o,r]}function Va(e,t){let r=Le([e],t);return ne(r)?r:["",t]}function uP(e){return Va(Ka,e)}function lP(e){return Le(jp,e)}var dP=[...ro,Nr];function fP(e){return oo(dP,[Nr],e)}function gP(e){let t=uP(e);return ne(t)?(()=>{let r=Le([vp],t[1]);return ne(r)?[`${t[0]}${r[0]}`,r[1]]:(()=>{let o=lP(t[1]);return ne(o)?(()=>{let i=fP(o[1]);return ne(i)?[`${t[0]}${o[0]}${i[0]}`,i[1]]:[]})():[]})()})():[]}function Ya(e){return gP(ct(e))}function yP(e){let t=Ya(e);return ne(t)?(()=>{let r=Le(["n"],t[1]);return ne(r)?[`${t[0]}`,r[1]]:[]})():[]}function Ng(e){return yP(e)}function Fp(e,t){return Le([e],t)}function E(e,t){return X(e,"")?["",t]:e.startsWith(no)?Fp(e,za(t)):e.startsWith(bg)?Fp(e,t):Fp(e,ct(t))}var Lg=[...Sg,Nr,xg];function EP(e){return Le(Lg,e)}var IP=[...Lg,...ro];function kg(e,t=""){let r=Le(IP,e);return ne(r)?kg(r[1],`${t}${r[0]}`):[t,e]}function TP(e){let t=EP(e);return ne(t)?(()=>{let r=kg(t[1]);return ne(r)?[`${t[0]}${r[0]}`,r[1]]:[]})():[]}function Ee(e){return TP(ct(e))}var _P=[...ro,Nr];function hP(e){return Va(Ka,e)}function OP(e){return ne(Le([Ha],e))}function wg(e){let t=oo(_P,[Nr],e);return ne(t)?X(t[0],"")?[]:[t[0],t[1]]:[]}function AP(e,t){let r=Le([Ha],t);return ne(r)?(()=>{let o=wg(r[1]);return ne(o)?[`${e}0${r[0]}${o[0]}`,o[1]]:[]})():[]}function SP(e,t){let r=Ya(t);return ne(r)?(()=>{let o=Le([Ha],r[1]);return ne(o)?(()=>{let i=wg(o[1]);return ne(i)?[`${e}${r[0]}${o[0]}${i[0]}`,i[1]]:[`${e}${r[0]}`,o[1]]})():[`${e}${r[0]}`,r[1]]})():[]}function bP(e){let t=hP(e);return ne(t)?OP(t[1])?AP(t[0],t[1]):SP(t[0],t[1]):[]}function Qa(e){return bP(ct(e))}function Mg(e,t){let[r,...o]=e;return Or(r)?t.startsWith(r)?!0:Mg(o,t):!1}function Lr(e,t,r=""){return X(t,"")?[]:Mg(e,t)?[r,t]:(()=>{let[o,i]=[t.slice(0,1),t.slice(1)];return Lr(e,i,`${r}${o}`)})()}function xP(e,t,r){return r.startsWith(e)?(()=>{let o=Lr([t],r.slice(e.length));return ne(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function RP(e,t,r){return r.startsWith(e)?(()=>{let o=Lr([no,t],r.slice(e.length));return ne(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function $g(e,t,r,o){return r?xP(e,t,ct(o)):RP(e,t,ct(o))}function CP(e,t){return Le(e,t)}function PP(e,t){return $g(e,e,!1,t)}function UP(e,t){let r=CP(e,t);return ne(r)?PP(r[0],`${r[0]}${r[1]}`):[]}function Wa(e,t){return UP(e,ct(t))}function Dg(e,t){let r=Lr(e,t);return ne(r)?X(r[0],"")?[]:r:[]}var c=(e,t,r=()=>[])=>e.length===2?t(e):r(),LP=e=>c(c(Ee(e),([t,r])=>c(E("extends",r),([o,i])=>c(Q(i),([a,p])=>c(E("=",p),([u,l])=>c(Q(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Pd(t),r]),kP=e=>c(c(Ee(e),([t,r])=>c(E("extends",r),([o,i])=>c(Q(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Ud(t),r]),wP=e=>c(c(Ee(e),([t,r])=>c(E("=",r),([o,i])=>c(Q(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Nd(t),r]),MP=e=>c(Ee(e),([t,r])=>[Ld(t),r]),jg=e=>c(c(LP(e),([t,r])=>[t,r],()=>c(kP(e),([t,r])=>[t,r],()=>c(wP(e),([t,r])=>[t,r],()=>c(MP(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),Fg=(e,t=[])=>c(c(jg(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>Fg(o,[...t,r]),()=>[t,e]),$P=e=>c(c(Fg(e),([t,r])=>c(c(c(jg(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[kd(t),r]),Hp=e=>c(c(E("<",e),([t,r])=>c($P(r),([o,i])=>c(E(">",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[wd(t),r]),Bg=(e,t=[])=>c(c(Q(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>Bg(o,[...t,r]),()=>[t,e]),DP=e=>c(c(Bg(e),([t,r])=>c(c(c(Q(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Md(t),r]),GP=e=>c(c(E("<",e),([t,r])=>c(DP(r),([o,i])=>c(E(">",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[$d(t),r]),vP=e=>c(c(Ee(e),([t,r])=>c(GP(r),([o,i])=>[[t,o],i])),([t,r])=>[Dd(t),r]),qg=e=>c(c(c(E(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Gd(t),r]),Hg=e=>c(E("string",e),([t,r])=>[vd(t),r]),Kg=e=>c(E("number",e),([t,r])=>[jd(t),r]),jP=e=>c(E("boolean",e),([t,r])=>[Fd(t),r]),FP=e=>c(E("undefined",e),([t,r])=>[Bd(t),r]),BP=e=>c(E("null",e),([t,r])=>[qd(t),r]),zg=e=>c(E("integer",e),([t,r])=>[Hd(t),r]),qP=e=>c(E("bigint",e),([t,r])=>[Kd(t),r]),HP=e=>c(E("unknown",e),([t,r])=>[zd(t),r]),KP=e=>c(E("any",e),([t,r])=>[Vd(t),r]),zP=e=>c(E("object",e),([t,r])=>[Yd(t),r]),VP=e=>c(E("never",e),([t,r])=>[Qd(t),r]),Vg=e=>c(E("symbol",e),([t,r])=>[Wd(t),r]),YP=e=>c(E("void",e),([t,r])=>[Zd(t),r]),QP=e=>c(E("this",e),([t,r])=>[Xd(t),r]),WP=e=>c(c(Hg(e),([t,r])=>[t,r],()=>c(Kg(e),([t,r])=>[t,r],()=>c(jP(e),([t,r])=>[t,r],()=>c(FP(e),([t,r])=>[t,r],()=>c(BP(e),([t,r])=>[t,r],()=>c(zg(e),([t,r])=>[t,r],()=>c(qP(e),([t,r])=>[t,r],()=>c(HP(e),([t,r])=>[t,r],()=>c(KP(e),([t,r])=>[t,r],()=>c(zP(e),([t,r])=>[t,r],()=>c(VP(e),([t,r])=>[t,r],()=>c(Vg(e),([t,r])=>[t,r],()=>c(YP(e),([t,r])=>[t,r],()=>c(QP(e),([t,r])=>[t,r],()=>[])))))))))))))),([t,r])=>[t,r]),ZP=e=>c(c(E("${",e),([t,r])=>c(Q(r),([o,i])=>c(E("}",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Jd(t),r]),Bp=e=>c(Lr(["${","`"],e),([t,r])=>[ef(t),r]),Yg=e=>c(c(c(Bp(e),([t,r])=>c(ZP(r),([o,i])=>c(Yg(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c(c(Bp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c(c(Bp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[tf(t),r]),Kp=e=>c(c(E("`",e),([t,r])=>c(Yg(r),([o,i])=>c(E("`",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[rf(t),r]),XP=e=>c(Kp(e),([t,r])=>[nf(t),r]),JP=e=>c(Ng(e),([t,r])=>[of(t),r]),eU=e=>c(c(E("true",e),([t,r])=>[t,r],()=>c(E("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[af(t),r]),tU=e=>c(Qa(e),([t,r])=>[sf(t),r]),rU=e=>c(Wa(["'",'"'],e),([t,r])=>[pf(t),r]),nU=e=>c(c(JP(e),([t,r])=>[t,r],()=>c(eU(e),([t,r])=>[t,r],()=>c(tU(e),([t,r])=>[t,r],()=>c(rU(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),oU=e=>c(c(c(E("keyof",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[cf(t),r]),Qg=(e,t=[])=>c(c(c(E("[",e),([r,o])=>c(Q(o),([i,a])=>c(E("]",a),([p,u])=>[[r,i,p],u]))),([r,o])=>[r,o],()=>c(c(E("[",e),([r,o])=>c(E("]",o),([i,a])=>[[r,i],a])),([r,o])=>[r,o],()=>[])),([r,o])=>Qg(o,[...t,r]),()=>[t,e]),iU=e=>c(Qg(e),([t,r])=>[mf(t),r]),aU=e=>c(c(c(E("extends",e),([t,r])=>c(Q(r),([o,i])=>c(E("?",i),([a,p])=>c(Q(p),([u,l])=>c(E(":",l),([f,y])=>c(Q(y),([I,x])=>[[t,o,a,u,f,I],x])))))),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[uf(t),r]),sU=e=>c(c(c(E("(",e),([t,r])=>c(Q(r),([o,i])=>c(E(")",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c(WP(e),([t,r])=>[t,r],()=>c(TU(e),([t,r])=>[t,r],()=>c(bU(e),([t,r])=>[t,r],()=>c(XP(e),([t,r])=>[t,r],()=>c(nU(e),([t,r])=>[t,r],()=>c(NU(e),([t,r])=>[t,r],()=>c(UU(e),([t,r])=>[t,r],()=>c(MU(e),([t,r])=>[t,r],()=>c(DU(e),([t,r])=>[t,r],()=>c(vP(e),([t,r])=>[t,r],()=>c($U(e),([t,r])=>[t,r],()=>[])))))))))))),([t,r])=>[lf(t),r]),Wg=e=>c(c(oU(e),([t,r])=>c(sU(r),([o,i])=>c(iU(i),([a,p])=>c(aU(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[df(t),r]),Zg=e=>c(c(c(E("&",e),([t,r])=>c(Wg(r),([o,i])=>c(Zg(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),Xg=e=>c(c(Wg(e),([t,r])=>c(Zg(r),([o,i])=>[[t,o],i])),([t,r])=>[ff(t),r]),Jg=e=>c(c(c(E("|",e),([t,r])=>c(Xg(r),([o,i])=>c(Jg(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),Za=e=>c(c(Xg(e),([t,r])=>c(Jg(r),([o,i])=>[[t,o],i])),([t,r])=>[gf(t),r]),pU=e=>c(c(E("readonly",e),([t,r])=>c(Za(r),([o,i])=>[[t,o],i])),([t,r])=>[yf(t),r]),cU=e=>c(c(E("|",e),([t,r])=>c(Za(r),([o,i])=>[[t,o],i])),([t,r])=>[Ef(t),r]),mU=e=>c(c(Hp(e),([t,r])=>c(E("=",r),([o,i])=>c(Q(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[If(t),r]),uU=e=>c(c(c(E("infer",e),([t,r])=>c(Ee(r),([o,i])=>c(E("extends",i),([a,p])=>c(Za(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[t,r],()=>c(c(E("infer",e),([t,r])=>c(Ee(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>[])),([t,r])=>[Tf(t),r]),Q=e=>c(c(uU(e),([t,r])=>[t,r],()=>c(cU(e),([t,r])=>[t,r],()=>c(pU(e),([t,r])=>[t,r],()=>c(Za(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),lU=e=>c(Qa(e),([t,r])=>[_f(t),r]),dU=e=>c(Ee(e),([t,r])=>[t,r]),fU=e=>c(Wa(["'",'"'],e),([t,r])=>[t,r]),gU=e=>c(c(E("[",e),([t,r])=>c(Ee(r),([o,i])=>c(E(":",i),([a,p])=>c(c(zg(p),([u,l])=>[u,l],()=>c(Kg(p),([u,l])=>[u,l],()=>c(Hg(p),([u,l])=>[u,l],()=>c(Vg(p),([u,l])=>[u,l],()=>[])))),([u,l])=>c(E("]",l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[hf(t),r]),ey=e=>c(c(lU(e),([t,r])=>[t,r],()=>c(dU(e),([t,r])=>[t,r],()=>c(fU(e),([t,r])=>[t,r],()=>c(gU(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),yU=e=>c(c(c(E("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Of(t),r]),EU=e=>c(c(c(E("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Af(t),r]),ty=e=>c(c(yU(e),([t,r])=>c(ey(r),([o,i])=>c(EU(i),([a,p])=>c(E(":",p),([u,l])=>c(Q(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Sf(t),r]),ry=e=>c(c(c(E(",",e),([t,r])=>c(E(`
27
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function hl(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",i="9229",a;return(a=t.match(/^(--inspect(-brk)?)$/))!==null?r=a[1]:(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=a[1],/^\d+$/.test(a[3])?i=a[3]:o=a[3]):(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=a[1],o=a[3],i=a[4]),r&&i!=="0"?`${r}=${o}:${parseInt(i)+1}`:t})}function Up(){if(ae.env.NO_COLOR||ae.env.FORCE_COLOR==="0"||ae.env.FORCE_COLOR==="false")return!1;if(ae.env.FORCE_COLOR||ae.env.CLICOLOR_FORCE!==void 0)return!0}Np.Command=Pp;Np.useColor=Up});var xl=Jr(xt=>{var{Argument:Al}=xa(),{Command:Lp}=Ol(),{CommanderError:HR,InvalidArgumentError:Sl}=Ho(),{Help:KR}=Op(),{Option:bl}=xp();xt.program=new Lp;xt.createCommand=e=>new Lp(e);xt.createOption=(e,t)=>new bl(e,t);xt.createArgument=(e,t)=>new Al(e,t);xt.Command=Lp;xt.Option=bl;xt.Argument=Al;xt.Help=KR;xt.CommanderError=HR;xt.InvalidArgumentError=Sl;xt.InvalidOptionArgumentError=Sl});var Rl=fl(xl(),1),{program:cB,createCommand:mB,createArgument:uB,createOption:lB,CommanderError:dB,InvalidArgumentError:fB,InvalidOptionArgumentError:gB,Command:Cl,Argument:yB,Option:kp,Help:EB}=Rl.default;function Rt(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}var g={};bt(g,{Assign:()=>zR,Clone:()=>zo,Create:()=>YC,Discard:()=>QC,Metrics:()=>Nt,Update:()=>WC});var Nt={assign:0,create:0,clone:0,discard:0,update:0};function zR(e,t){return Nt.assign+=1,{...e,...t}}var s={};bt(s,{Entries:()=>gC,EntriesRegExp:()=>fC,Every:()=>uC,EveryAll:()=>lC,GraphemeCount:()=>pC,HasPropertyKey:()=>dC,IsArray:()=>en,IsAsyncIterator:()=>XR,IsBigInt:()=>Ko,IsBoolean:()=>wl,IsClassInstance:()=>aC,IsConstructor:()=>JR,IsDeepEqual:()=>$p,IsEqual:()=>X,IsFunction:()=>Dl,IsGreaterEqualThan:()=>Gl,IsGreaterThan:()=>nC,IsInteger:()=>wp,IsIterator:()=>eC,IsLessEqualThan:()=>$l,IsLessThan:()=>oC,IsMaxLength:()=>cC,IsMinLength:()=>mC,IsMultipleOf:()=>iC,IsNull:()=>Ua,IsNumber:()=>Na,IsObject:()=>tn,IsObjectNotArray:()=>tC,IsString:()=>Sr,IsSymbol:()=>rC,IsUndefined:()=>Dp,IsValueLike:()=>sC,Keys:()=>Pa,Symbols:()=>yC,Values:()=>EC});function Ar(e,t,r){return e>=t&&e<=r}function Pl(e){return Ar(e,127462,127487)}function VR(e){return Ar(e,65024,65039)}function YR(e){return Ar(e,768,879)||Ar(e,6832,6911)||Ar(e,7616,7679)||Ar(e,65056,65071)}function Ca(e){return e>65535?2:1}function Ul(e,t){for(;t<e.length;){let r=e.codePointAt(t);if(YR(r)||VR(r))t+=Ca(r);else break}return t}function Mp(e,t){let r=e.codePointAt(t),o=t+Ca(r);for(o=Ul(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+Ca(i),o=Ul(e,o)}return Pl(r)&&o<e.length&&Pl(e.codePointAt(o))&&(o+=Ca(e.codePointAt(o))),o}function Nl(e){return Ar(e,55296,56319)||Ar(e,768,879)||e===8205}function Ll(e){let t=0,r=0;for(;r<e.length;)r=Mp(e,r),t++;return t}function QR(e,t){let r=0,o=0;for(;o<e.length;)if(o=Mp(e,o),r++,r>=t)return!0;return!1}function WR(e,t){let r=0,o=0;for(;o<e.length;)if(o=Mp(e,o),r++,r>t)return!1;return!0}function kl(e,t){let r=0;for(;r<e.length;){if(Nl(e.charCodeAt(r)))return QR(e,t);if(r++,r>=t)return!0}return!1}function Ml(e,t){let r=0;for(;r<e.length;){if(Nl(e.charCodeAt(r)))return WR(e,t);if(r++,r>t)return!1}return!0}function en(e){return Array.isArray(e)}function XR(e){return tn(e)&&Symbol.asyncIterator in e}function Ko(e){return X(typeof e,"bigint")}function wl(e){return X(typeof e,"boolean")}function JR(e){if(Dp(e)||!Dl(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Dl(e){return X(typeof e,"function")}function wp(e){return Number.isInteger(e)}function eC(e){return tn(e)&&Symbol.iterator in e}function Ua(e){return X(e,null)}function Na(e){return Number.isFinite(e)}function tC(e){return tn(e)&&!en(e)}function tn(e){return X(typeof e,"object")&&!Ua(e)}function Sr(e){return X(typeof e,"string")}function rC(e){return X(typeof e,"symbol")}function Dp(e){return X(e,void 0)}function X(e,t){return e===t}function nC(e,t){return e>t}function oC(e,t){return e<t}function $l(e,t){return e<=t}function Gl(e,t){return e>=t}function iC(e,t){if(Ko(e)||Ko(t))return BigInt(e)%BigInt(t)===0n;let r=1e-10;if(!Na(e)||wp(e)&&1/t%1===0)return!0;let o=e%t;return Math.min(Math.abs(o),Math.abs(o-t))<r}function aC(e){if(!tn(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return Ua(t)?!1:X(typeof t.constructor,"function")&&!(X(t.constructor,globalThis.Object)||X(t.constructor.name,"Object"))}function sC(e){return Ko(e)||wl(e)||Ua(e)||Na(e)||Sr(e)||Dp(e)}function pC(e){return Ll(e)}function cC(e,t){return Ml(e,t)}function mC(e,t){return kl(e,t)}function uC(e,t,r){for(let o=t;o<e.length;o++)if(!r(e[o],o))return!1;return!0}function lC(e,t,r){let o=!0;for(let i=t;i<e.length;i++)r(e[i],i)||(o=!1);return o}function dC(e,t){return X(t,"__proto__")||X(t,"constructor")?Object.prototype.hasOwnProperty.call(e,t):t in e}function fC(e){return Pa(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function gC(e){return Object.entries(e)}function Pa(e){return Object.getOwnPropertyNames(e)}function yC(e){return Object.getOwnPropertySymbols(e)}function EC(e){return Object.values(e)}function IC(e,t){if(!tn(t))return!1;let r=Pa(e);return X(r.length,Pa(t).length)&&r.every(o=>$p(e[o],t[o]))}function TC(e,t){return en(t)&&X(e.length,t.length)&&e.every((r,o)=>$p(e[o],t[o]))}function $p(e,t){return en(e)?TC(e,t):tn(e)?IC(e,t):X(e,t)}var Xe={};bt(Xe,{IsBigInt64Array:()=>kC,IsBigUint64Array:()=>MC,IsBoolean:()=>_C,IsDate:()=>DC,IsFloat32Array:()=>NC,IsFloat64Array:()=>LC,IsInt16Array:()=>RC,IsInt32Array:()=>PC,IsInt8Array:()=>SC,IsMap:()=>GC,IsNumber:()=>hC,IsRegExp:()=>wC,IsSet:()=>$C,IsString:()=>OC,IsTypeArray:()=>AC,IsUint16Array:()=>CC,IsUint32Array:()=>UC,IsUint8Array:()=>bC,IsUint8ClampedArray:()=>xC});function _C(e){return e instanceof Boolean}function hC(e){return e instanceof Number}function OC(e){return e instanceof String}function AC(e){return globalThis.ArrayBuffer.isView(e)}function SC(e){return e instanceof globalThis.Int8Array}function bC(e){return e instanceof globalThis.Uint8Array}function xC(e){return e instanceof globalThis.Uint8ClampedArray}function RC(e){return e instanceof globalThis.Int16Array}function CC(e){return e instanceof globalThis.Uint16Array}function PC(e){return e instanceof globalThis.Int32Array}function UC(e){return e instanceof globalThis.Uint32Array}function NC(e){return e instanceof globalThis.Float32Array}function LC(e){return e instanceof globalThis.Float64Array}function kC(e){return e instanceof globalThis.BigInt64Array}function MC(e){return e instanceof globalThis.BigUint64Array}function wC(e){return e instanceof globalThis.RegExp}function DC(e){return e instanceof globalThis.Date}function $C(e){return e instanceof globalThis.Set}function GC(e){return e instanceof globalThis.Map}function jC(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~guard")}function FC(e){return e.map(t=>Gp(t))}function BC(e){let t={},r=Object.getOwnPropertyDescriptors(e);for(let o of Object.keys(r)){let i=r[o];s.HasPropertyKey(i,"value")&&Object.defineProperty(t,o,{...i,value:Gp(i.value)})}return t}function qC(e){return new RegExp(e.source,e.flags)}function Gp(e){return e instanceof RegExp?qC(e):jC(e)?e:s.IsArray(e)?FC(e):s.IsObject(e)?BC(e):e}function zo(e){return Nt.clone+=1,Gp(e)}var Tt={};bt(Tt,{Get:()=>zC,Reset:()=>HC,Set:()=>KC});var rn={immutableTypes:!1,maxErrors:8,useEval:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1};function HC(){rn.immutableTypes=!1,rn.maxErrors=8,rn.useEval=!0,rn.exactOptionalPropertyTypes=!1,rn.enumerableKind=!1}function KC(e){for(let t of s.Keys(e)){let r=e[t];r!==void 0&&Object.defineProperty(rn,t,{value:r})}}function zC(){return rn}function VC(e,t,r={}){for(let o of Object.keys(t))Object.defineProperty(e,o,{configurable:!0,writable:!0,enumerable:!1,value:t[o]});return e}function vl(e,t){return{...e,...t}}function YC(e,t,r={}){Nt.create+=1;let o=Tt.Get(),i=vl(t,r),a=o.enumerableKind?vl(i,e):VC(i,e);return o.immutableTypes?Object.freeze(a):a}function QC(e,t){Nt.discard+=1;let r={},o=Object.getOwnPropertyDescriptors(zo(e)),i=new Set(t);for(let a of Object.keys(o))i.has(a)||Object.defineProperty(r,a,o[a]);return r}function WC(e,t,r){Nt.update+=1;let o=Tt.Get(),i=zo(e);for(let a of Object.keys(t))Object.defineProperty(i,a,{configurable:!0,writable:!0,enumerable:o.enumerableKind,value:t[a]});for(let a of Object.keys(r))Object.defineProperty(i,a,{configurable:!0,enumerable:!0,writable:!0,value:r[a]});return i}function h(e,t){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],t)}function A(e){return s.IsObject(e)}function jl(e){return g.Create({"~kind":"OptionalAddAction"},{type:e},{})}function Fl(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalAddAction")&&A(e.type)}function Bl(e){return g.Create({"~kind":"OptionalRemoveAction"},{type:e},{})}function ql(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalRemoveAction")&&A(e.type)}function Hl(e){return g.Create({"~kind":"ReadonlyAddAction"},{type:e},{})}function Kl(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyAddAction")&&A(e.type)}function zl(e){return g.Create({"~kind":"ReadonlyRemoveAction"},{type:e},{})}function Vl(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyRemoveAction")&&A(e.type)}function C(e,t,r){return g.Create({"~kind":"Deferred"},{action:e,parameters:t,options:r},{})}function Yl(e){return h(e,"Deferred")}function vp(e){return g.Update(e,{"~immutable":!0},{})}function br(e){return vp(e)}function nn(e){return A(e)&&s.HasPropertyKey(e,"~immutable")}function qn(e){return g.Discard(e,["~optional"])}function at(e){return g.Update(e,{"~optional":!0},{})}function La(e){return at(e)}function Pe(e){return A(e)&&s.HasPropertyKey(e,"~optional")}function ka(e){return g.Discard(e,["~readonly"])}function st(e){return g.Update(e,{"~readonly":!0},{})}function Ma(e){return st(e)}function on(e){return A(e)&&s.HasPropertyKey(e,"~readonly")}function Lt(e,t){return g.Create({"~kind":"Array"},{type:"array",items:e},t)}function J(e){return h(e,"Array")}function wa(e){return g.Discard(e,["~kind","type","items"])}function Ft(e,t){return g.Create({"~kind":"AsyncIterator"},{type:"asyncIterator",iteratorItems:e},t)}function Qe(e){return h(e,"AsyncIterator")}function Ql(e){return g.Discard(e,["~kind","type","iteratorItems"])}function Wl(e){return{enumerable:Tt.Get().enumerableKind,writable:!1,configurable:!1,value:e}}var Da=class{constructor(){globalThis.Object.defineProperty(this,"~kind",Wl("Base")),globalThis.Object.defineProperty(this,"~guard",Wl({check:t=>this.Check(t),errors:t=>this.Errors(t)}))}Check(t){return!0}Errors(t){return[]}Convert(t){return t}Clean(t){return t}Default(t){return t}Create(){throw new Error("Create not implemented")}Clone(){throw Error("Clone not implemented")}};function _t(e){return h(e,"Base")}function xr(e,t,r={}){return g.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},r)}function Ue(e){return h(e,"Constructor")}function Zl(e){return g.Discard(e,["~kind","type","parameters","instanceType"])}function Rr(e,t,r={}){return g.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},r)}function Ne(e){return h(e,"Function")}function Xl(e){return g.Discard(e,["~kind","type","parameters","returnType"])}function be(e,t){return g.Create({"~kind":"Ref"},{$ref:e},t)}function se(e){return h(e,"Ref")}function Cr(e,t){return g.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function Hn(e){return h(e,"Generic")}var Jl="(?!)";function Y(e){return g.Create({"~kind":"Never"},{not:{}},e)}function or(e){return h(e,"Never")}function ZC(){return["(not-resolvable)",Y()]}function XC(){return["(not-generic)",Y()]}function JC(e,t,r){return[e,Cr(t,r)]}function eP(e,t,r){return t in e?ed(e,t,e[t],r):ZC()}function ed(e,t,r,o){return Hn(r)?JC(t,r.parameters,r.expression):se(r)?eP(e,r.$ref,o):XC()}function td(e,t,r){return ed(e,"(anonymous)",t,r)}function Bt(e,t,r){let o=s.Keys(e).reduce((i,a)=>({...i,[a]:g.Update(e[a],{},{$id:a})}),{});return g.Create({"~kind":"Cyclic"},{$defs:o,$ref:t},r)}function pe(e){return h(e,"Cyclic")}var oe={};bt(oe,{Match:()=>tP});function tP(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function Be(e){return g.Create({"~kind":"Unknown"},{},e)}function pt(e){return h(e,"Unknown")}function Vo(...e){let[t,r]=oe.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,Be(),Be()]});return g.Create({"~kind":"Infer"},{type:"infer",name:t,extends:r},{})}function _e(e){return h(e,"Infer")}function Kn(e){return g.Create({"~kind":"Any"},{},e)}function Je(e){return h(e,"Any")}function rd(e){return s.IsObjectNotArray(e)}function nd(e){return s.Keys(e).filter(r=>isNaN(r)).reduce((r,o)=>[...r,e[o]],[])}function od(e,t){let r=rd(e)?nd(e):e;return g.Create({"~kind":"Enum"},{enum:r},t)}function he(e){return h(e,"Enum")}function ht(e,t={}){return g.Create({"~kind":"Intersect"},{allOf:e},t)}function U(e){return h(e,"Intersect")}function id(e){return g.Discard(e,["~kind","allOf"])}function F(){throw new Error("Unreachable")}var Ur={};bt(Ur,{Hash:()=>TP,HashCode:()=>ld});function rP(e){let t=new Set,r=e;for(;r&&r!==Object.prototype;){for(let o of Reflect.ownKeys(r))o!=="constructor"&&typeof o!="symbol"&&t.add(o);r=Object.getPrototypeOf(r)}return[...t]}function nP(e){return typeof e=="number"}var et;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(et||(et={}));var zn=BigInt("14695981039346656037"),[oP,iP]=[BigInt("1099511628211"),BigInt("18446744073709551616")],aP=Array.from({length:256}).map((e,t)=>BigInt(t)),cd=new Float64Array(1),md=new DataView(cd.buffer),ud=new Uint8Array(cd.buffer);function qe(e){zn=zn^aP[e],zn=zn*oP%iP}function sP(e){qe(et.Array);for(let t of e)Pr(t)}function pP(e){qe(et.BigInt),md.setBigInt64(0,e);for(let t of ud)qe(t)}function sd(e){qe(et.Boolean),qe(e?1:0)}function cP(e){qe(et.Constructor),Pr(e.toString())}function mP(e){qe(et.Date),Pr(e.getTime())}function uP(e){qe(et.Function),Pr(e.toString())}function lP(e){qe(et.Null)}function pd(e){qe(et.Number),md.setFloat64(0,e,!0);for(let t of ud)qe(t)}function dP(e){qe(et.Object);for(let t of rP(e).sort())Pr(t),Pr(e[t])}function fP(e){qe(et.RegExp),jp(e.toString())}var gP=new TextEncoder;function jp(e){qe(et.String);for(let t of gP.encode(e))qe(t)}function yP(e){qe(et.Symbol),Pr(e.toString())}function EP(e){qe(et.TypeArray);let t=new Uint8Array(e.buffer);for(let r=0;r<t.length;r++)qe(t[r])}function IP(e){return qe(et.Undefined)}function Pr(e){return Xe.IsTypeArray(e)?EP(e):Xe.IsDate(e)?mP(e):Xe.IsRegExp(e)?fP(e):Xe.IsBoolean(e)?sd(e.valueOf()):Xe.IsString(e)?jp(e.valueOf()):Xe.IsNumber(e)?pd(e.valueOf()):nP(e)?pd(e):s.IsArray(e)?sP(e):s.IsBoolean(e)?sd(e):s.IsBigInt(e)?pP(e):s.IsConstructor(e)?cP(e):s.IsNull(e)?lP(e):s.IsObject(e)?dP(e):s.IsString(e)?jp(e):s.IsSymbol(e)?yP(e):s.IsUndefined(e)?IP(e):s.IsFunction(e)?uP(e):F()}function ld(e){return zn=BigInt("14695981039346656037"),Pr(e),zn}function TP(e){return ld(e).toString(16).padStart(16,"0")}function dd(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~guard":return"must match check function";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var _P=dd;function fd(){return _P}var Yo=class{constructor(t,r){this.type=t,this.decode=r}Encode(t){let r=this.type,o=an(r)?p=>this.decode(r["~codec"].decode(p)):this.decode,i=an(r)?p=>r["~codec"].encode(t(p)):t,a={decode:o,encode:i};return g.Update(this.type,{"~codec":a},{})}},Qo=class{constructor(t){this.type=t}Decode(t){return new Yo(this.type,t)}};function $a(e){return new Qo(e)}function yd(e,t){return $a(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function Ed(e,t){return $a(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function an(e){return A(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function OP(e,t){let r=Ga(e)?[...e["~refine"],t]:[t];return g.Update(e,{"~refine":r},{})}function Id(e,t,r="error"){return OP(e,{refine:t,message:r})}function Ga(e){return A(e)&&s.HasPropertyKey(e,"~refine")}var Td="-?(?:0|[1-9][0-9]*)n";function Wo(e){return g.Create({"~kind":"BigInt"},{type:"bigint"},e)}function lt(e){return h(e,"BigInt")}function va(e){return g.Create({"~kind":"Boolean"},{type:"boolean"},e)}function tt(e){return h(e,"Boolean")}function Zo(e){return g.Create({"~kind":"Identifier"},{name:e})}function _d(e){return h(e,"Identifier")}var ja="-?(?:0|[1-9][0-9]*)";function sn(e){return g.Create({"~kind":"Integer"},{type:"integer"},e)}function we(e){return h(e,"Integer")}function qt(e,t){return g.Create({"~kind":"Iterator"},{type:"iterator",iteratorItems:e},t)}function We(e){return h(e,"Iterator")}function hd(e){return g.Discard(e,["~kind","type","iteratorItems"])}var Fp=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function AP(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new Fp(e)})()}function K(e,t){return g.Create({"~kind":"Literal"},{type:AP(e),const:e},t)}function Fa(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function Od(e){return W(e)&&s.IsBigInt(e.const)}function Ad(e){return W(e)&&s.IsBoolean(e.const)}function Vn(e){return W(e)&&s.IsNumber(e.const)}function Yn(e){return W(e)&&s.IsString(e.const)}function W(e){return h(e,"Literal")}function Nr(e){return g.Create({"~kind":"Null"},{type:"null"},e)}function Ht(e){return h(e,"Null")}var Ba="-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";function Ot(e){return g.Create({"~kind":"Number"},{type:"number"},e)}function ge(e){return h(e,"Number")}function Qn(e){return g.Create({"~kind":"Symbol"},{type:"symbol"},e)}function Kt(e){return h(e,"Symbol")}function Sd(e){return s.Keys(e).filter(t=>!Pe(e[t]))}function bd(e){return s.Keys(e)}function qa(e){return s.Values(e)}function SP(e,t={}){let r=Sd(e),o=r.length>0?{required:r}:{};return g.Create({"~kind":"Object"},{type:"object",...o,properties:e},t)}var N=SP;function M(e){return h(e,"Object")}function xd(e){return g.Discard(e,["~kind","type","properties","required"])}function pn(...e){let[t,r,o]=oe.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[i,a,a],1:i=>[i,Be(),Be()]});return g.Create({"~kind":"Parameter"},{name:t,extends:r,equals:o},{})}function Rd(e){return h(e,"Parameter")}function zt(e,t){return g.Create({"~kind":"Promise"},{type:"promise",item:e},t)}function He(e){return h(e,"Promise")}function Cd(e){return g.Discard(e,["~kind","type","item"])}var Ha=".*";function ct(e){return g.Create({"~kind":"String"},{type:"string"},e)}function xe(e){return h(e,"String")}function mt(e,t){let r="object",o={[e]:t};return g.Create({"~kind":"Record"},{type:r,patternProperties:o})}var Wn=`^${ja}$`,Zn=`^${Ba}$`,Vt=`^${Ha}$`;function Xo(e,t,r={}){return C("Record",[e,t],r)}function bP(e,t,r={}){return R({},Xo(e,t,r))}function Ka(e,t,r={}){return bP(e,t,r)}function Pd(e,t){return mt(e,t)}function dt(e){return s.Keys(e.patternProperties)[0]}function Xn(e){let t=dt(e);return s.IsEqual(t,Wn)?sn():s.IsEqual(t,Zn)?Ot():ct()}function Ke(e){return e.patternProperties[dt(e)]}function ye(e){return h(e,"Record")}function cn(e){return g.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function Lr(e){return h(e,"Rest")}function za(e){return g.Create({"~kind":"This"},{$ref:"#"},e)}function Ud(e){return h(e,"This")}function De(e,t={}){let[r,o,i]=[e,e.length,!1];return g.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:r,minItems:o},t)}function z(e){return h(e,"Tuple")}function Nd(e){return g.Discard(e,["~kind","type","items","minItems","additionalItems"])}function Jn(e){return g.Create({"~kind":"Undefined"},{type:"undefined"},e)}function Yt(e){return h(e,"Undefined")}function v(e,t={}){return g.Create({"~kind":"Union"},{anyOf:e},t)}function O(e){return h(e,"Union")}function Ld(e){return g.Discard(e,["~kind","anyOf"])}function kd(e){return g.Create({"~kind":"Unsafe"},{},e)}function Md(e){return h(e,"Unsafe")}function Va(e){return g.Create({"~kind":"Void"},{type:"void"},e)}function ft(e){return h(e,"Void")}function RP(e,t){return s.IsEqual(e,"Array")?Lt(t[0]):s.IsEqual(e,"AsyncIterator")?Ft(t[0]):s.IsEqual(e,"Iterator")?qt(t[0]):s.IsEqual(e,"Promise")?zt(t[0]):s.IsEqual(e,"Awaited")?Ei(t[0]):s.IsEqual(e,"Capitalize")?ei(t[0]):s.IsEqual(e,"ConstructorParameters")?ii(t[0]):s.IsEqual(e,"Evaluate")?qp(t[0]):s.IsEqual(e,"Exclude")?ai(t[0],t[1]):s.IsEqual(e,"Extract")?si(t[0],t[1]):s.IsEqual(e,"Index")?ro(t[0],t[1]):s.IsEqual(e,"InstanceType")?pi(t[0]):s.IsEqual(e,"Lowercase")?ti(t[0]):s.IsEqual(e,"NonNullable")?ci(t[0]):s.IsEqual(e,"Omit")?mi(t[0],t[1]):s.IsEqual(e,"Options")?oo(t[0],t[1]):s.IsEqual(e,"Parameters")?ui(t[0]):s.IsEqual(e,"Partial")?li(t[0]):s.IsEqual(e,"Pick")?di(t[0],t[1]):s.IsEqual(e,"Readonly")?fi(t[0]):s.IsEqual(e,"KeyOf")?no(t[0]):s.IsEqual(e,"Record")?Xo(t[0],t[1]):s.IsEqual(e,"Required")?gi(t[0]):s.IsEqual(e,"ReturnType")?yi(t[0]):s.IsEqual(e,"Uncapitalize")?ri(t[0]):s.IsEqual(e,"Uppercase")?ni(t[0]):Ya(be(e),t)}function mn(){throw Error("Unreachable")}var CP=(e,t=[])=>e.reduce((r,o)=>s.IsArray(o)&&s.IsEqual(o.length,2)?[...r,o[0]]:[...r,o],[]),ir=e=>{let[t,r]=e;return CP([...t,...r])};function vd(e){return pn(e[0],e[2],e[4])}function jd(e){return pn(e[0],e[2],e[2])}function Fd(e){return pn(e[0],Be(),e[2])}function Bd(e){return pn(e,Be(),Be())}function qd(e){return ir(e)}function Hd(e){return e[1]}function Kd(e){return ir(e)}function zd(e){return e[1]}function Vd(e){return RP(e[0],e[1])}function Yd(e){return null}function Qd(e){return ct()}function Wd(e){return Ot()}function Zd(e){return va()}function Xd(e){return Jn()}function Jd(e){return Nr()}function ef(e){return sn()}function tf(e){return Wo()}function rf(e){return Be()}function nf(e){return Kn()}function of(e){return N({})}function af(e){return Y()}function sf(e){return Qn()}function pf(e){return Va()}function cf(e){return za()}function mf(e){return e[1]}function uf(e){return K(e)}function lf(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function df(e){return e[1]}function ff(e){return Jo(e)}function gf(e){return K(BigInt(e))}function yf(e){return K(s.IsEqual(e,"true"))}function Ef(e){return K(parseFloat(e))}function If(e){return K(e)}function Tf(e){return e.length>0}function _f(e){return e.reduce((t,r)=>s.IsEqual(r.length,3)?[...t,[r[1]]]:[...t,[]],[])}function hf(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function Of(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}var wd=(e,t)=>t.reduceRight((r,o)=>{let i=o;return s.IsEqual(i.length,1)?ro(r,i[0]):s.IsEqual(i.length,0)?Lt(r):mn()},e),Dd=(e,t)=>s.IsEqual(t.length,3)?oi(e,t[0],t[1],t[2]):e;function Af(e){let[t,r,o,i]=e;return Dd(t?no(wd(r,o)):wd(r,o),i)}function Bp(e,t){return s.IsEqual(t.length,3)?(()=>{let[r,o,i]=t,a=Bp(o,i);if(s.IsEqual(r,"&"))return U(a)?ht([e,...a.allOf]):ht([e,a]);if(s.IsEqual(r,"|"))return O(a)?v([e,...a.anyOf]):v([e,a]);mn()})():e}function Sf(e){let[t,r]=e;return Bp(t,r)}function bf(e){let[t,r]=e;return Bp(t,r)}function xf(e){return vp(e[1])}function Rf(e){return e[1]}function Cf(e){return Cr(e[0],e[2])}function Pf(e){return s.IsEqual(e.length,4)?Vo(e[1],e[3]):s.IsEqual(e.length,2)?Vo(e[1],Be()):mn()}function Uf(e){return`${e}`}function Nf(e){return we(e[3])?Wn:ge(e[3])?Zn:Kt(e[3])?Vt:xe(e[3])?Vt:mn()}function Lf(e){return e.length>0}function kf(e){return e.length>0}function Mf(e){let[t,r,o,i,a]=e;return{[r]:t&&o?st(at(a)):t&&!o?st(a):!t&&o?at(a):a}}function wf(e){return ir(e)}function Df(e){return e.reduce((t,r)=>s.HasPropertyKey(r,Wn)||s.HasPropertyKey(r,Zn)||s.HasPropertyKey(r,Vt)?[t[0],g.Assign(t[1],r)]:[g.Assign(t[0],r),t[1]],[{},{}])}function $f(e){return Df(e[1])}function Gf(e){let[t,r]=e,o=s.IsEqual(s.Keys(r).length,0)?{}:{patternProperties:r};return N(t,o)}function vf(e){return s.IsEqual(e.length,5)?st(at(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?st(e[3]):at(e[3]):mn()}function jf(e){return st(at(e[1]))}function Ff(e){return st(e[1])}function Bf(e){return at(e[0])}function qf(e){return s.IsEqual(e.length,2)?cn(e[1]):s.IsEqual(e.length,1)?e[0]:mn()}function Hf(e){return ir(e)}function Kf(e){return De(e[1])}function zf(e){return st(at(e[4]))}function Vf(e){return st(e[3])}function Yf(e){return at(e[3])}function Qf(e){return e[2]}function Wf(e){return s.IsEqual(e.length,2)?cn(e[1]):s.IsEqual(e.length,1)?e[0]:mn()}function Zf(e){return ir(e)}function Xf(e){return Rr(e[1],e[4])}function Jf(e){return xr(e[2],e[5])}function $d(e,t){return s.IsEqual(e,"remove")?zl(t):s.IsEqual(e,"add")?Hl(t):t}function eg(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function Gd(e,t){return s.IsEqual(e,"remove")?Bl(t):s.IsEqual(e,"add")?jl(t):t}function tg(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function rg(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function ng(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?eo(Zo(e[3]),e[5],e[6][0],$d(e[1],Gd(e[8],e[10]))):eo(Zo(e[3]),e[5],be(e[3]),$d(e[1],Gd(e[8],e[10])))}function og(e){return be(e)}function ig(e){return oo(e[2],e[4])}function ag(e){return parseFloat(e)}function sg(e){return s.IsEqual(e,"true")}function pg(e){return null}function cg(e){return{[e[0]]:e[2]}}function mg(e){return ir(e)}function PP(e){return e.reduce((t,r)=>g.Assign(t,r),{})}function ug(e){return PP(e[1])}function lg(e){return ir(e)}function dg(e){return e[1]}function fg(e){return Wo()}function gg(e){return ct()}function yg(e){return Ot()}function Eg(e){return sn()}function Ig(e){return Y()}function Tg(e){return K(e)}function _g(e){return v(e[1])}function hg(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Og(e){return[e[0],...e[1]]}function Ag(e){return e[1]}function Sg(e){return ir(e)}function bg(e){return s.IsEqual(e.length,2)?e[1]:[]}function xg(e){let t=e[2],r=e[3],[o,i]=e[4],a=s.IsEqual(s.Keys(i).length,0)?{}:{patternProperties:i};return{[e[1]]:Cr(t,to(r,o,a))}}function Rg(e){let t=e[2],[r,o]=e[3],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:to(t,r,i)}}function Cg(e){return{[e[1]]:Cr(e[2],e[4])}}function Pg(e){return{[e[1]]:e[3]}}function Ug(e){return null}function Ng(e){return Df(ir(e))}function Lg(e){return e[1]}function kg(e){let t=e[0],r=e[1];return Hp(g.Assign(t,r[0]))}function ie(e){return en(e)&&X(e.length,2)}function LP(e,t){return X(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function Le(e,t){let[r,...o]=e;return Sr(r)?(()=>{let i=LP(r,t);return X(i.length,2)?i:Le(o,t)})():[]}function Kp(e,t){return Array.from({length:t-e+1},(r,o)=>String.fromCharCode(e+o))}var Mg=[...Kp(97,122),...Kp(65,90)],zp="0",Vp=Kp(49,57),io=[zp,...Vp],wg=" ",ao=`
28
+ `;var kr="_",Qa=".",Dg="$",Wa="-";var $g="//",Gg="/*",MP="*/";function vg(e){let t=e.indexOf(MP);return X(t,-1)?"":e.slice(t+2)}function jg(e){let t=e.indexOf(ao);return X(t,-1)?"":e.slice(t)}function wP(e){return e.replace(/^[ \t\r\f\v]+/,"")}function Za(e){let t=wP(e);return t.startsWith(Gg)?Za(vg(t.slice(2))):t.startsWith($g)?Za(jg(t.slice(2))):t}function ut(e){let t=e.trimStart();return t.startsWith(Gg)?ut(vg(t.slice(2))):t.startsWith($g)?ut(jg(t.slice(2))):t}function DP(e,t){return e.includes(t)}function so(e,t,r,o=""){let i=Le(e,r);return ie(i)?DP(t,i[0])?so(e,t,i[1],o):so(e,t,i[1],`${o}${i[0]}`):[o,r]}function Xa(e,t){let r=Le([e],t);return ie(r)?r:["",t]}function $P(e){return Xa(Wa,e)}function GP(e){return Le(Vp,e)}var vP=[...io,kr];function jP(e){return so(vP,[kr],e)}function FP(e){let t=$P(e);return ie(t)?(()=>{let r=Le([zp],t[1]);return ie(r)?[`${t[0]}${r[0]}`,r[1]]:(()=>{let o=GP(t[1]);return ie(o)?(()=>{let i=jP(o[1]);return ie(i)?[`${t[0]}${o[0]}${i[0]}`,i[1]]:[]})():[]})()})():[]}function Ja(e){return FP(ut(e))}function BP(e){let t=Ja(e);return ie(t)?(()=>{let r=Le(["n"],t[1]);return ie(r)?[`${t[0]}`,r[1]]:[]})():[]}function Fg(e){return BP(e)}function Yp(e,t){return Le([e],t)}function E(e,t){return X(e,"")?["",t]:e.startsWith(ao)?Yp(e,Za(t)):e.startsWith(wg)?Yp(e,t):Yp(e,ut(t))}var Bg=[...Mg,kr,Dg];function qP(e){return Le(Bg,e)}var HP=[...Bg,...io];function qg(e,t=""){let r=Le(HP,e);return ie(r)?qg(r[1],`${t}${r[0]}`):[t,e]}function KP(e){let t=qP(e);return ie(t)?(()=>{let r=qg(t[1]);return ie(r)?[`${t[0]}${r[0]}`,r[1]]:[]})():[]}function Ee(e){return KP(ut(e))}var zP=[...io,kr];function VP(e){return Xa(Wa,e)}function YP(e){return ie(Le([Qa],e))}function Hg(e){let t=so(zP,[kr],e);return ie(t)?X(t[0],"")?[]:[t[0],t[1]]:[]}function QP(e,t){let r=Le([Qa],t);return ie(r)?(()=>{let o=Hg(r[1]);return ie(o)?[`${e}0${r[0]}${o[0]}`,o[1]]:[]})():[]}function WP(e,t){let r=Ja(t);return ie(r)?(()=>{let o=Le([Qa],r[1]);return ie(o)?(()=>{let i=Hg(o[1]);return ie(i)?[`${e}${r[0]}${o[0]}${i[0]}`,i[1]]:[`${e}${r[0]}`,o[1]]})():[`${e}${r[0]}`,r[1]]})():[]}function ZP(e){let t=VP(e);return ie(t)?YP(t[1])?QP(t[0],t[1]):WP(t[0],t[1]):[]}function es(e){return ZP(ut(e))}function Kg(e,t){let[r,...o]=e;return Sr(r)?t.startsWith(r)?!0:Kg(o,t):!1}function Mr(e,t,r=""){return X(t,"")?[]:Kg(e,t)?[r,t]:(()=>{let[o,i]=[t.slice(0,1),t.slice(1)];return Mr(e,i,`${r}${o}`)})()}function XP(e,t,r){return r.startsWith(e)?(()=>{let o=Mr([t],r.slice(e.length));return ie(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function JP(e,t,r){return r.startsWith(e)?(()=>{let o=Mr([ao,t],r.slice(e.length));return ie(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function zg(e,t,r,o){return r?XP(e,t,ut(o)):JP(e,t,ut(o))}function eU(e,t){return Le(e,t)}function tU(e,t){return zg(e,e,!1,t)}function rU(e,t){let r=eU(e,t);return ie(r)?tU(r[0],`${r[0]}${r[1]}`):[]}function ts(e,t){return rU(e,ut(t))}function Vg(e,t){let r=Mr(e,t);return ie(r)?X(r[0],"")?[]:r:[]}var c=(e,t,r=()=>[])=>e.length===2?t(e):r(),oU=e=>c(c(Ee(e),([t,r])=>c(E("extends",r),([o,i])=>c(Z(i),([a,p])=>c(E("=",p),([u,l])=>c(Z(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[vd(t),r]),iU=e=>c(c(Ee(e),([t,r])=>c(E("extends",r),([o,i])=>c(Z(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[jd(t),r]),aU=e=>c(c(Ee(e),([t,r])=>c(E("=",r),([o,i])=>c(Z(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Fd(t),r]),sU=e=>c(Ee(e),([t,r])=>[Bd(t),r]),Wg=e=>c(c(oU(e),([t,r])=>[t,r],()=>c(iU(e),([t,r])=>[t,r],()=>c(aU(e),([t,r])=>[t,r],()=>c(sU(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),Zg=(e,t=[])=>c(c(Wg(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>Zg(o,[...t,r]),()=>[t,e]),pU=e=>c(c(Zg(e),([t,r])=>c(c(c(Wg(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[qd(t),r]),Zp=e=>c(c(E("<",e),([t,r])=>c(pU(r),([o,i])=>c(E(">",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Hd(t),r]),Xg=(e,t=[])=>c(c(Z(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>Xg(o,[...t,r]),()=>[t,e]),cU=e=>c(c(Xg(e),([t,r])=>c(c(c(Z(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Kd(t),r]),mU=e=>c(c(E("<",e),([t,r])=>c(cU(r),([o,i])=>c(E(">",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[zd(t),r]),uU=e=>c(c(Ee(e),([t,r])=>c(mU(r),([o,i])=>[[t,o],i])),([t,r])=>[Vd(t),r]),Jg=e=>c(c(c(E(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Yd(t),r]),ey=e=>c(E("string",e),([t,r])=>[Qd(t),r]),ty=e=>c(E("number",e),([t,r])=>[Wd(t),r]),lU=e=>c(E("boolean",e),([t,r])=>[Zd(t),r]),dU=e=>c(E("undefined",e),([t,r])=>[Xd(t),r]),fU=e=>c(E("null",e),([t,r])=>[Jd(t),r]),ry=e=>c(E("integer",e),([t,r])=>[ef(t),r]),gU=e=>c(E("bigint",e),([t,r])=>[tf(t),r]),yU=e=>c(E("unknown",e),([t,r])=>[rf(t),r]),EU=e=>c(E("any",e),([t,r])=>[nf(t),r]),IU=e=>c(E("object",e),([t,r])=>[of(t),r]),TU=e=>c(E("never",e),([t,r])=>[af(t),r]),ny=e=>c(E("symbol",e),([t,r])=>[sf(t),r]),_U=e=>c(E("void",e),([t,r])=>[pf(t),r]),hU=e=>c(E("this",e),([t,r])=>[cf(t),r]),OU=e=>c(c(ey(e),([t,r])=>[t,r],()=>c(ty(e),([t,r])=>[t,r],()=>c(lU(e),([t,r])=>[t,r],()=>c(dU(e),([t,r])=>[t,r],()=>c(fU(e),([t,r])=>[t,r],()=>c(ry(e),([t,r])=>[t,r],()=>c(gU(e),([t,r])=>[t,r],()=>c(yU(e),([t,r])=>[t,r],()=>c(EU(e),([t,r])=>[t,r],()=>c(IU(e),([t,r])=>[t,r],()=>c(TU(e),([t,r])=>[t,r],()=>c(ny(e),([t,r])=>[t,r],()=>c(_U(e),([t,r])=>[t,r],()=>c(hU(e),([t,r])=>[t,r],()=>[])))))))))))))),([t,r])=>[t,r]),AU=e=>c(c(E("${",e),([t,r])=>c(Z(r),([o,i])=>c(E("}",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[mf(t),r]),Qp=e=>c(Mr(["${","`"],e),([t,r])=>[uf(t),r]),oy=e=>c(c(c(Qp(e),([t,r])=>c(AU(r),([o,i])=>c(oy(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c(c(Qp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c(c(Qp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[lf(t),r]),Xp=e=>c(c(E("`",e),([t,r])=>c(oy(r),([o,i])=>c(E("`",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[df(t),r]),SU=e=>c(Xp(e),([t,r])=>[ff(t),r]),bU=e=>c(Fg(e),([t,r])=>[gf(t),r]),xU=e=>c(c(E("true",e),([t,r])=>[t,r],()=>c(E("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[yf(t),r]),RU=e=>c(es(e),([t,r])=>[Ef(t),r]),CU=e=>c(ts(["'",'"'],e),([t,r])=>[If(t),r]),PU=e=>c(c(bU(e),([t,r])=>[t,r],()=>c(xU(e),([t,r])=>[t,r],()=>c(RU(e),([t,r])=>[t,r],()=>c(CU(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),UU=e=>c(c(c(E("keyof",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Tf(t),r]),iy=(e,t=[])=>c(c(c(E("[",e),([r,o])=>c(Z(o),([i,a])=>c(E("]",a),([p,u])=>[[r,i,p],u]))),([r,o])=>[r,o],()=>c(c(E("[",e),([r,o])=>c(E("]",o),([i,a])=>[[r,i],a])),([r,o])=>[r,o],()=>[])),([r,o])=>iy(o,[...t,r]),()=>[t,e]),NU=e=>c(iy(e),([t,r])=>[_f(t),r]),LU=e=>c(c(c(E("extends",e),([t,r])=>c(Z(r),([o,i])=>c(E("?",i),([a,p])=>c(Z(p),([u,l])=>c(E(":",l),([f,y])=>c(Z(y),([I,x])=>[[t,o,a,u,f,I],x])))))),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[hf(t),r]),kU=e=>c(c(c(E("(",e),([t,r])=>c(Z(r),([o,i])=>c(E(")",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c(OU(e),([t,r])=>[t,r],()=>c(KU(e),([t,r])=>[t,r],()=>c(ZU(e),([t,r])=>[t,r],()=>c(SU(e),([t,r])=>[t,r],()=>c(PU(e),([t,r])=>[t,r],()=>c(nN(e),([t,r])=>[t,r],()=>c(rN(e),([t,r])=>[t,r],()=>c(sN(e),([t,r])=>[t,r],()=>c(cN(e),([t,r])=>[t,r],()=>c(uU(e),([t,r])=>[t,r],()=>c(pN(e),([t,r])=>[t,r],()=>[])))))))))))),([t,r])=>[Of(t),r]),ay=e=>c(c(UU(e),([t,r])=>c(kU(r),([o,i])=>c(NU(i),([a,p])=>c(LU(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Af(t),r]),sy=e=>c(c(c(E("&",e),([t,r])=>c(ay(r),([o,i])=>c(sy(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),py=e=>c(c(ay(e),([t,r])=>c(sy(r),([o,i])=>[[t,o],i])),([t,r])=>[Sf(t),r]),cy=e=>c(c(c(E("|",e),([t,r])=>c(py(r),([o,i])=>c(cy(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),rs=e=>c(c(py(e),([t,r])=>c(cy(r),([o,i])=>[[t,o],i])),([t,r])=>[bf(t),r]),MU=e=>c(c(E("readonly",e),([t,r])=>c(rs(r),([o,i])=>[[t,o],i])),([t,r])=>[xf(t),r]),wU=e=>c(c(E("|",e),([t,r])=>c(rs(r),([o,i])=>[[t,o],i])),([t,r])=>[Rf(t),r]),DU=e=>c(c(Zp(e),([t,r])=>c(E("=",r),([o,i])=>c(Z(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Cf(t),r]),$U=e=>c(c(c(E("infer",e),([t,r])=>c(Ee(r),([o,i])=>c(E("extends",i),([a,p])=>c(rs(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[t,r],()=>c(c(E("infer",e),([t,r])=>c(Ee(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>[])),([t,r])=>[Pf(t),r]),Z=e=>c(c($U(e),([t,r])=>[t,r],()=>c(wU(e),([t,r])=>[t,r],()=>c(MU(e),([t,r])=>[t,r],()=>c(rs(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),GU=e=>c(es(e),([t,r])=>[Uf(t),r]),vU=e=>c(Ee(e),([t,r])=>[t,r]),jU=e=>c(ts(["'",'"'],e),([t,r])=>[t,r]),FU=e=>c(c(E("[",e),([t,r])=>c(Ee(r),([o,i])=>c(E(":",i),([a,p])=>c(c(ry(p),([u,l])=>[u,l],()=>c(ty(p),([u,l])=>[u,l],()=>c(ey(p),([u,l])=>[u,l],()=>c(ny(p),([u,l])=>[u,l],()=>[])))),([u,l])=>c(E("]",l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Nf(t),r]),my=e=>c(c(GU(e),([t,r])=>[t,r],()=>c(vU(e),([t,r])=>[t,r],()=>c(jU(e),([t,r])=>[t,r],()=>c(FU(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),BU=e=>c(c(c(E("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Lf(t),r]),qU=e=>c(c(c(E("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[kf(t),r]),uy=e=>c(c(BU(e),([t,r])=>c(my(r),([o,i])=>c(qU(i),([a,p])=>c(E(":",p),([u,l])=>c(Z(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Mf(t),r]),ly=e=>c(c(c(E(",",e),([t,r])=>c(E(`
29
29
  `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E(";",e),([t,r])=>c(E(`
30
30
  `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E(",",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c(c(E(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c(c(E(`
31
- `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),ny=(e,t=[])=>c(c(ty(e),([r,o])=>c(ry(o),([i,a])=>[[r,i],a])),([r,o])=>ny(o,[...t,r]),()=>[t,e]),IU=e=>c(c(ny(e),([t,r])=>c(c(c(ty(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[bf(t),r]),zp=e=>c(c(E("{",e),([t,r])=>c(IU(r),([o,i])=>c(E("}",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Rf(t),r]),TU=e=>c(zp(e),([t,r])=>[Cf(t),r]),_U=e=>c(c(c(Ee(e),([t,r])=>c(E("?",r),([o,i])=>c(E(":",i),([a,p])=>c(E("readonly",p),([u,l])=>c(Q(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[t,r],()=>c(c(Ee(e),([t,r])=>c(E(":",r),([o,i])=>c(E("readonly",i),([a,p])=>c(Q(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[t,r],()=>c(c(Ee(e),([t,r])=>c(E("?",r),([o,i])=>c(E(":",i),([a,p])=>c(Q(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[t,r],()=>c(c(Ee(e),([t,r])=>c(E(":",r),([o,i])=>c(Q(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>[])))),([t,r])=>[Pf(t),r]),hU=e=>c(c(E("readonly",e),([t,r])=>c(Q(r),([o,i])=>c(E("?",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Uf(t),r]),OU=e=>c(c(E("readonly",e),([t,r])=>c(Q(r),([o,i])=>[[t,o],i])),([t,r])=>[Nf(t),r]),AU=e=>c(c(Q(e),([t,r])=>c(E("?",r),([o,i])=>[[t,o],i])),([t,r])=>[Lf(t),r]),Gg=e=>c(c(_U(e),([t,r])=>[t,r],()=>c(hU(e),([t,r])=>[t,r],()=>c(OU(e),([t,r])=>[t,r],()=>c(AU(e),([t,r])=>[t,r],()=>c(Q(e),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),oy=e=>c(c(c(E("...",e),([t,r])=>c(Gg(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(Gg(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[kf(t),r]),iy=(e,t=[])=>c(c(oy(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>iy(o,[...t,r]),()=>[t,e]),SU=e=>c(c(iy(e),([t,r])=>c(c(c(oy(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[wf(t),r]),bU=e=>c(c(E("[",e),([t,r])=>c(SU(r),([o,i])=>c(E("]",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Mf(t),r]),xU=e=>c(c(Ee(e),([t,r])=>c(E("?",r),([o,i])=>c(E(":",i),([a,p])=>c(E("readonly",p),([u,l])=>c(Q(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[$f(t),r]),RU=e=>c(c(Ee(e),([t,r])=>c(E(":",r),([o,i])=>c(E("readonly",i),([a,p])=>c(Q(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Df(t),r]),CU=e=>c(c(Ee(e),([t,r])=>c(E("?",r),([o,i])=>c(E(":",i),([a,p])=>c(Q(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Gf(t),r]),PU=e=>c(c(Ee(e),([t,r])=>c(E(":",r),([o,i])=>c(Q(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[vf(t),r]),vg=e=>c(c(xU(e),([t,r])=>[t,r],()=>c(RU(e),([t,r])=>[t,r],()=>c(CU(e),([t,r])=>[t,r],()=>c(PU(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),ay=e=>c(c(c(E("...",e),([t,r])=>c(vg(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(vg(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[jf(t),r]),sy=(e,t=[])=>c(c(ay(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>sy(o,[...t,r]),()=>[t,e]),py=e=>c(c(sy(e),([t,r])=>c(c(c(ay(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Ff(t),r]),UU=e=>c(c(E("(",e),([t,r])=>c(py(r),([o,i])=>c(E(")",i),([a,p])=>c(E("=>",p),([u,l])=>c(Q(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Bf(t),r]),NU=e=>c(c(E("new",e),([t,r])=>c(E("(",r),([o,i])=>c(py(i),([a,p])=>c(E(")",p),([u,l])=>c(E("=>",l),([f,y])=>c(Q(y),([I,x])=>[[t,o,a,u,f,I],x])))))),([t,r])=>[qf(t),r]),LU=e=>c(c(c(E("+",e),([t,r])=>c(E("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E("-",e),([t,r])=>c(E("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[Hf(t),r]),kU=e=>c(c(c(E("+",e),([t,r])=>c(E("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E("-",e),([t,r])=>c(E("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[Kf(t),r]),wU=e=>c(c(c(E("as",e),([t,r])=>c(Q(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[zf(t),r]),MU=e=>c(c(E("{",e),([t,r])=>c(LU(r),([o,i])=>c(E("[",i),([a,p])=>c(Ee(p),([u,l])=>c(E("in",l),([f,y])=>c(Q(y),([I,x])=>c(wU(x),([_e,fe])=>c(E("]",fe),([Fo,Bx])=>c(kU(Bx),([qx,Hx])=>c(E(":",Hx),([Kx,zx])=>c(Q(zx),([Vx,Yx])=>c(qg(Yx),([Qx,Wx])=>c(E("}",Wx),([Zx,Xx])=>[[t,o,a,u,f,I,_e,Fo,qx,Kx,Vx,Qx,Zx],Xx]))))))))))))),([t,r])=>[Vf(t),r]),$U=e=>c(Ee(e),([t,r])=>[Yf(t),r]),DU=e=>c(c(E("Options",e),([t,r])=>c(E("<",r),([o,i])=>c(Q(i),([a,p])=>c(E(",",p),([u,l])=>c(uy(l),([f,y])=>c(E(">",y),([I,x])=>[[t,o,a,u,f,I],x])))))),([t,r])=>[Qf(t),r]),GU=e=>c(Qa(e),([t,r])=>[Wf(t),r]),vU=e=>c(c(E("true",e),([t,r])=>[t,r],()=>c(E("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[Zf(t),r]),jU=e=>c(Wa(['"',"'"],e),([t,r])=>[t,r]),FU=e=>c(E("null",e),([t,r])=>[Xf(t),r]),cy=e=>c(c(ey(e),([t,r])=>c(E(":",r),([o,i])=>c(Vp(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Jf(t),r]),my=(e,t=[])=>c(c(cy(e),([r,o])=>c(ry(o),([i,a])=>[[r,i],a])),([r,o])=>my(o,[...t,r]),()=>[t,e]),BU=e=>c(c(my(e),([t,r])=>c(c(c(cy(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[eg(t),r]),uy=e=>c(c(E("{",e),([t,r])=>c(BU(r),([o,i])=>c(E("}",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[tg(t),r]),ly=(e,t=[])=>c(c(Vp(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>ly(o,[...t,r]),()=>[t,e]),qU=e=>c(c(ly(e),([t,r])=>c(c(c(Vp(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[rg(t),r]),HU=e=>c(c(E("[",e),([t,r])=>c(qU(r),([o,i])=>c(E("]",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[ng(t),r]),Vp=e=>c(c(GU(e),([t,r])=>[t,r],()=>c(vU(e),([t,r])=>[t,r],()=>c(jU(e),([t,r])=>[t,r],()=>c(FU(e),([t,r])=>[t,r],()=>c(uy(e),([t,r])=>[t,r],()=>c(HU(e),([t,r])=>[t,r],()=>[])))))),([t,r])=>[t,r]),KU=e=>c(E("-?(?:0|[1-9][0-9]*)n",e),([t,r])=>[og(t),r]),zU=e=>c(E(".*",e),([t,r])=>[ig(t),r]),VU=e=>c(E("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?",e),([t,r])=>[ag(t),r]),YU=e=>c(E("-?(?:0|[1-9][0-9]*)",e),([t,r])=>[sg(t),r]),QU=e=>c(E("(?!)",e),([t,r])=>[pg(t),r]),WU=e=>c(Dg(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([t,r])=>[cg(t),r]),ZU=e=>c(c(KU(e),([t,r])=>[t,r],()=>c(zU(e),([t,r])=>[t,r],()=>c(VU(e),([t,r])=>[t,r],()=>c(YU(e),([t,r])=>[t,r],()=>c(QU(e),([t,r])=>[t,r],()=>c(XU(e),([t,r])=>[t,r],()=>c(WU(e),([t,r])=>[t,r],()=>[]))))))),([t,r])=>[t,r]),XU=e=>c(c(E("(",e),([t,r])=>c(Yp(r),([o,i])=>c(E(")",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[mg(t),r]),dy=e=>c(c(c(qp(e),([t,r])=>c(E("|",r),([o,i])=>c(dy(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c(c(qp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[]))),([t,r])=>[ug(t),r]),qp=e=>c(c(ZU(e),([t,r])=>c(Yp(r),([o,i])=>[[t,o],i])),([t,r])=>[lg(t),r]),Yp=e=>c(c(dy(e),([t,r])=>[t,r],()=>c(qp(e),([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),fy=e=>c(c(E("^",e),([t,r])=>c(Yp(r),([o,i])=>c(E("$",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[dg(t),r]),gy=(e,t=[])=>c(c(Q(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>gy(o,[...t,r]),()=>[t,e]),JU=e=>c(c(gy(e),([t,r])=>c(c(c(Q(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[fg(t),r]),yy=e=>c(c(c(E("extends",e),([t,r])=>c(JU(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[gg(t),r]),eN=e=>c(c(E("interface",e),([t,r])=>c(Ee(r),([o,i])=>c(Hp(i),([a,p])=>c(yy(p),([u,l])=>c(zp(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[yg(t),r]),tN=e=>c(c(E("interface",e),([t,r])=>c(Ee(r),([o,i])=>c(yy(i),([a,p])=>c(zp(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Eg(t),r]),rN=e=>c(c(E("type",e),([t,r])=>c(Ee(r),([o,i])=>c(Hp(i),([a,p])=>c(E("=",p),([u,l])=>c(Q(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Ig(t),r]),nN=e=>c(c(E("type",e),([t,r])=>c(Ee(r),([o,i])=>c(E("=",i),([a,p])=>c(Q(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Tg(t),r]),oN=e=>c(c(c(E("export",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[_g(t),r]),iN=e=>c(c(c(E(";",e),([t,r])=>c(E(`
31
+ `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),dy=(e,t=[])=>c(c(uy(e),([r,o])=>c(ly(o),([i,a])=>[[r,i],a])),([r,o])=>dy(o,[...t,r]),()=>[t,e]),HU=e=>c(c(dy(e),([t,r])=>c(c(c(uy(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[wf(t),r]),Jp=e=>c(c(E("{",e),([t,r])=>c(HU(r),([o,i])=>c(E("}",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[$f(t),r]),KU=e=>c(Jp(e),([t,r])=>[Gf(t),r]),zU=e=>c(c(c(Ee(e),([t,r])=>c(E("?",r),([o,i])=>c(E(":",i),([a,p])=>c(E("readonly",p),([u,l])=>c(Z(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[t,r],()=>c(c(Ee(e),([t,r])=>c(E(":",r),([o,i])=>c(E("readonly",i),([a,p])=>c(Z(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[t,r],()=>c(c(Ee(e),([t,r])=>c(E("?",r),([o,i])=>c(E(":",i),([a,p])=>c(Z(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[t,r],()=>c(c(Ee(e),([t,r])=>c(E(":",r),([o,i])=>c(Z(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>[])))),([t,r])=>[vf(t),r]),VU=e=>c(c(E("readonly",e),([t,r])=>c(Z(r),([o,i])=>c(E("?",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[jf(t),r]),YU=e=>c(c(E("readonly",e),([t,r])=>c(Z(r),([o,i])=>[[t,o],i])),([t,r])=>[Ff(t),r]),QU=e=>c(c(Z(e),([t,r])=>c(E("?",r),([o,i])=>[[t,o],i])),([t,r])=>[Bf(t),r]),Yg=e=>c(c(zU(e),([t,r])=>[t,r],()=>c(VU(e),([t,r])=>[t,r],()=>c(YU(e),([t,r])=>[t,r],()=>c(QU(e),([t,r])=>[t,r],()=>c(Z(e),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),fy=e=>c(c(c(E("...",e),([t,r])=>c(Yg(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(Yg(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[qf(t),r]),gy=(e,t=[])=>c(c(fy(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>gy(o,[...t,r]),()=>[t,e]),WU=e=>c(c(gy(e),([t,r])=>c(c(c(fy(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Hf(t),r]),ZU=e=>c(c(E("[",e),([t,r])=>c(WU(r),([o,i])=>c(E("]",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Kf(t),r]),XU=e=>c(c(Ee(e),([t,r])=>c(E("?",r),([o,i])=>c(E(":",i),([a,p])=>c(E("readonly",p),([u,l])=>c(Z(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[zf(t),r]),JU=e=>c(c(Ee(e),([t,r])=>c(E(":",r),([o,i])=>c(E("readonly",i),([a,p])=>c(Z(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Vf(t),r]),eN=e=>c(c(Ee(e),([t,r])=>c(E("?",r),([o,i])=>c(E(":",i),([a,p])=>c(Z(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Yf(t),r]),tN=e=>c(c(Ee(e),([t,r])=>c(E(":",r),([o,i])=>c(Z(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Qf(t),r]),Qg=e=>c(c(XU(e),([t,r])=>[t,r],()=>c(JU(e),([t,r])=>[t,r],()=>c(eN(e),([t,r])=>[t,r],()=>c(tN(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),yy=e=>c(c(c(E("...",e),([t,r])=>c(Qg(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(Qg(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[Wf(t),r]),Ey=(e,t=[])=>c(c(yy(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>Ey(o,[...t,r]),()=>[t,e]),Iy=e=>c(c(Ey(e),([t,r])=>c(c(c(yy(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Zf(t),r]),rN=e=>c(c(E("(",e),([t,r])=>c(Iy(r),([o,i])=>c(E(")",i),([a,p])=>c(E("=>",p),([u,l])=>c(Z(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Xf(t),r]),nN=e=>c(c(E("new",e),([t,r])=>c(E("(",r),([o,i])=>c(Iy(i),([a,p])=>c(E(")",p),([u,l])=>c(E("=>",l),([f,y])=>c(Z(y),([I,x])=>[[t,o,a,u,f,I],x])))))),([t,r])=>[Jf(t),r]),oN=e=>c(c(c(E("+",e),([t,r])=>c(E("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E("-",e),([t,r])=>c(E("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[eg(t),r]),iN=e=>c(c(c(E("+",e),([t,r])=>c(E("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E("-",e),([t,r])=>c(E("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[tg(t),r]),aN=e=>c(c(c(E("as",e),([t,r])=>c(Z(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[rg(t),r]),sN=e=>c(c(E("{",e),([t,r])=>c(oN(r),([o,i])=>c(E("[",i),([a,p])=>c(Ee(p),([u,l])=>c(E("in",l),([f,y])=>c(Z(y),([I,x])=>c(aN(x),([le,Se])=>c(E("]",Se),([Or,dl])=>c(iN(dl),([Bn,yR])=>c(E(":",yR),([ER,IR])=>c(Z(IR),([TR,_R])=>c(Jg(_R),([hR,OR])=>c(E("}",OR),([AR,SR])=>[[t,o,a,u,f,I,le,Or,Bn,ER,TR,hR,AR],SR]))))))))))))),([t,r])=>[ng(t),r]),pN=e=>c(Ee(e),([t,r])=>[og(t),r]),cN=e=>c(c(E("Options",e),([t,r])=>c(E("<",r),([o,i])=>c(Z(i),([a,p])=>c(E(",",p),([u,l])=>c(hy(l),([f,y])=>c(E(">",y),([I,x])=>[[t,o,a,u,f,I],x])))))),([t,r])=>[ig(t),r]),mN=e=>c(es(e),([t,r])=>[ag(t),r]),uN=e=>c(c(E("true",e),([t,r])=>[t,r],()=>c(E("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[sg(t),r]),lN=e=>c(ts(['"',"'"],e),([t,r])=>[t,r]),dN=e=>c(E("null",e),([t,r])=>[pg(t),r]),Ty=e=>c(c(my(e),([t,r])=>c(E(":",r),([o,i])=>c(ec(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[cg(t),r]),_y=(e,t=[])=>c(c(Ty(e),([r,o])=>c(ly(o),([i,a])=>[[r,i],a])),([r,o])=>_y(o,[...t,r]),()=>[t,e]),fN=e=>c(c(_y(e),([t,r])=>c(c(c(Ty(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[mg(t),r]),hy=e=>c(c(E("{",e),([t,r])=>c(fN(r),([o,i])=>c(E("}",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[ug(t),r]),Oy=(e,t=[])=>c(c(ec(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>Oy(o,[...t,r]),()=>[t,e]),gN=e=>c(c(Oy(e),([t,r])=>c(c(c(ec(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[lg(t),r]),yN=e=>c(c(E("[",e),([t,r])=>c(gN(r),([o,i])=>c(E("]",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[dg(t),r]),ec=e=>c(c(mN(e),([t,r])=>[t,r],()=>c(uN(e),([t,r])=>[t,r],()=>c(lN(e),([t,r])=>[t,r],()=>c(dN(e),([t,r])=>[t,r],()=>c(hy(e),([t,r])=>[t,r],()=>c(yN(e),([t,r])=>[t,r],()=>[])))))),([t,r])=>[t,r]),EN=e=>c(E("-?(?:0|[1-9][0-9]*)n",e),([t,r])=>[fg(t),r]),IN=e=>c(E(".*",e),([t,r])=>[gg(t),r]),TN=e=>c(E("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?",e),([t,r])=>[yg(t),r]),_N=e=>c(E("-?(?:0|[1-9][0-9]*)",e),([t,r])=>[Eg(t),r]),hN=e=>c(E("(?!)",e),([t,r])=>[Ig(t),r]),ON=e=>c(Vg(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([t,r])=>[Tg(t),r]),AN=e=>c(c(EN(e),([t,r])=>[t,r],()=>c(IN(e),([t,r])=>[t,r],()=>c(TN(e),([t,r])=>[t,r],()=>c(_N(e),([t,r])=>[t,r],()=>c(hN(e),([t,r])=>[t,r],()=>c(SN(e),([t,r])=>[t,r],()=>c(ON(e),([t,r])=>[t,r],()=>[]))))))),([t,r])=>[t,r]),SN=e=>c(c(E("(",e),([t,r])=>c(tc(r),([o,i])=>c(E(")",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[_g(t),r]),Ay=e=>c(c(c(Wp(e),([t,r])=>c(E("|",r),([o,i])=>c(Ay(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[t,r],()=>c(c(Wp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[]))),([t,r])=>[hg(t),r]),Wp=e=>c(c(AN(e),([t,r])=>c(tc(r),([o,i])=>[[t,o],i])),([t,r])=>[Og(t),r]),tc=e=>c(c(Ay(e),([t,r])=>[t,r],()=>c(Wp(e),([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),Sy=e=>c(c(E("^",e),([t,r])=>c(tc(r),([o,i])=>c(E("$",i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Ag(t),r]),by=(e,t=[])=>c(c(Z(e),([r,o])=>c(E(",",o),([i,a])=>[[r,i],a])),([r,o])=>by(o,[...t,r]),()=>[t,e]),bN=e=>c(c(by(e),([t,r])=>c(c(c(Z(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Sg(t),r]),xy=e=>c(c(c(E("extends",e),([t,r])=>c(bN(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[bg(t),r]),xN=e=>c(c(E("interface",e),([t,r])=>c(Ee(r),([o,i])=>c(Zp(i),([a,p])=>c(xy(p),([u,l])=>c(Jp(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[xg(t),r]),RN=e=>c(c(E("interface",e),([t,r])=>c(Ee(r),([o,i])=>c(xy(i),([a,p])=>c(Jp(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Rg(t),r]),CN=e=>c(c(E("type",e),([t,r])=>c(Ee(r),([o,i])=>c(Zp(i),([a,p])=>c(E("=",p),([u,l])=>c(Z(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Cg(t),r]),PN=e=>c(c(E("type",e),([t,r])=>c(Ee(r),([o,i])=>c(E("=",i),([a,p])=>c(Z(p),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Pg(t),r]),UN=e=>c(c(c(E("export",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Ug(t),r]),NN=e=>c(c(c(E(";",e),([t,r])=>c(E(`
32
32
  `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>c(c(E(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>c(c(E(`
33
- `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]),Ey=(e,t=[])=>c(c(Qp(e),([r,o])=>c(iN(o),([i,a])=>[[r,i],a])),([r,o])=>Ey(o,[...t,r]),()=>[t,e]),aN=e=>c(c(Ey(e),([t,r])=>c(c(c(Qp(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[hg(t),r]),Qp=e=>c(c(oN(e),([t,r])=>c(c(eN(r),([o,i])=>[o,i],()=>c(tN(r),([o,i])=>[o,i],()=>c(rN(r),([o,i])=>[o,i],()=>c(nN(r),([o,i])=>[o,i],()=>[])))),([o,i])=>c(qg(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Og(t),r]),sN=e=>c(c(Qp(e),([t,r])=>c(aN(r),([o,i])=>[[t,o],i])),([t,r])=>[Ag(t),r]),Iy=e=>c(c(sN(e),([t,r])=>[t,r],()=>c(mU(e),([t,r])=>[t,r],()=>c(Q(e),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]);function Ty(e){let t=Kp(`\`${e}\``);return s.IsEqual(t.length,2)?t[0]:F()}function Zo(e,t={}){return C("TemplateLiteral",[e],t)}function _y(e){return R({},Zo(e,{}))}function cN(e){let t=Ty(e);return _y(t)}function hy(e,t={}){let r=s.IsString(e)?cN(e):_y(e);return g.Update(r,{},t)}function Ae(e){return h(e,"TemplateLiteral")}var L={};bt(L,{ExtendsFalse:()=>j,ExtendsTrue:()=>S,ExtendsUnion:()=>Wp,IsExtendsFalse:()=>mN,IsExtendsTrue:()=>Ay,IsExtendsTrueLike:()=>Ie,IsExtendsUnion:()=>Oy});function Wp(e){return g.Create({"~kind":"ExtendsUnion"},{inferred:e})}function Oy(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsUnion")&&s.IsObject(e.inferred)}function S(e){return g.Create({"~kind":"ExtendsTrue"},{inferred:e})}function Ay(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsTrue")&&s.IsObject(e.inferred)}function j(){return g.Create({"~kind":"ExtendsFalse"},{})}function mN(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function Ie(e){return Oy(e)||Ay(e)}function Xa(e){let t=fy(e);return s.IsEqual(t.length,2)?t[0]:F()}function uN(e){return!0}function Sy(e){let[t,...r]=e;return A(t)?lN(t)?Sy(r):!1:!0}function by(e){return s.IsEqual(e.length,0)?!1:Sy(e)}function lN(e){return O(e)?by(e.anyOf):Y(e)?uN(e.const):!1}function Ja(e){return by(e)}function xy(e,t,r=[]){let[o,...i]=e;return s.IsString(o)?xy(i,t,[...r,`${o}${t}`]):r}function dN(e,t){return s.IsEqual(e.length,0)?[`${t}`]:xy(e,t)}function Ry(e,t,r=[]){let[o,...i]=t;return A(o)?Ry(e,i,[...r,...Cy(e,o)]):r}function Cy(e,t){return O(t)?Ry(e,t.anyOf):Y(t)?dN(e,t.const):F()}function Py(e,t){let[r,...o]=t;return A(r)?Py(Cy(e,r),o):e}function fN(e){return e.map(t=>H(t))}function gN(e){let t=Py([],e),r=fN(t);return G(r)}function yN(e){return s.IsEqual(e.length,0)?F():s.IsEqual(e.length,1)&&Y(e[0])?e[0]:gN(e)}function Ke(e){let t=Xa(e);return Ja(t)?yN(t):st()}function EN(e){return s.IsString(e)||s.IsNumber(e)?H(e):s.IsNull(e)?Pr():V()}function kt(e){return e.map(r=>EN(r))}function yi(e){let t=kt(e);return G(t)}function pn(e){return yi(e.enum)}function IN(e,t,r,o){let i=ee(e,r,o);return Ie(i)?S(g.Assign(g.Assign(e,i.inferred),{[t]:r})):j()}function TN(e,t){return S(e)}function _N(e,t,r){let o=yi(r);return ee(e,t,o)}function Uy(e,t,r){let[o,...i]=r;return A(o)?(()=>{let a=ee(e,t,o);return Ie(a)?Uy(a.inferred,t,i):j()})():S(e)}function hN(e,t,r){let o=Ke(r);return ee(e,t,o)}function Ny(e,t,r){let[o,...i]=r;return A(o)?(()=>{let a=ee(e,t,o);return Ie(a)?S(a.inferred):Ny(e,t,i)})():j()}function B(e,t,r){return Xe(r)?TN(e,t):Oe(r)?_N(e,t,r.enum):he(r)?IN(e,r.name,t,r.extends):U(r)?Uy(e,t,r.allOf):Ae(r)?hN(e,t,r.pattern):O(r)?Ny(e,t,r.anyOf):at(r)?S(e):j()}function Ly(e,t,r){return he(r)?B(e,t,r):Xe(r)?S(e):at(r)?S(e):Wp(e)}function ON(e,t){let r=en(e),o=en(t);return r&&o||!r&&o?!0:!(r&&!o)}function ky(e,t,r,o){return J(o)?ON(t,o)?ee(e,r,o.items):j():B(e,t,o)}function wy(e,t,r){return Ye(r)?ee(e,t,r.iteratorItems):B(e,Gt(t),r)}function My(e,t,r){return ut(r)?S(e):B(e,t,r)}function $y(e,t,r){return et(r)?S(e):B(e,t,r)}function AN(e,t,r,o,i){let a=he(o)?t:o,p=he(o)?o:t,u=Pe(t),l=Pe(o),f=ee(e,a,p);return!u&&l?j():Ie(f)?Ei(f.inferred,r,i):j()}function SN(e,t,r,o){let[i,...a]=o;return A(i)?AN(e,t,r,i,a):Pe(t)?S(e):j()}function bN(e,t,r){let[o,...i]=t;return A(o)?SN(e,o,i,r):S(e)}function Ei(e,t,r){return bN(e,t,r)}function es(e,t,r){return dt(r)?S(e):ee(e,t,r)}function Dy(e,t,r,o){return Ue(o)?(()=>{let i=Ei(e,t,o.parameters);return Ie(i)?es(i.inferred,r,o.instanceType):j()})():j()}function Gy(e,t,r){return ee(e,pn(t),r)}function vy(e,t,r,o){return Ne(o)?(()=>{let i=Ei(e,t,o.parameters);return Ie(i)?es(i.inferred,r,o.returnType):j()})():j()}function jy(e,t,r){return Me(r)?S(e):ge(r)?S(e):B(e,t,r)}var Ii="equal",xN="disjoint",Ti="left-inside",_i="right-inside";function hi(e,t){let r=[at(e)?L.ExtendsFalse():ze({},e,t),at(e)?L.ExtendsTrue({}):ze({},t,e)];return L.IsExtendsTrueLike(r[0])&&L.IsExtendsTrueLike(r[1])?Ii:L.IsExtendsTrueLike(r[0])&&L.IsExtendsFalse(r[1])?Ti:L.IsExtendsFalse(r[0])&&L.IsExtendsTrueLike(r[1])?_i:xN}function RN(e){return O(e)?zt(e.anyOf):[e]}function zt(e){return e.reduce((t,r)=>[...t,...RN(r)],[])}function Zp(e){return e.reduceRight((r,o,i)=>({[i]:o,...r}),{})}function Fy(e){let t=Zp(e.items);return N(t)}function CN(e,t){return tn(e)?!!tn(t):!1}function PN(e,t){return Pe(e)?!!Pe(t):!1}function UN(e,t){let r=CN(e,t),o=PN(e,t),i=Se([e,t]),a=Ca(jn(i));return r&&o?it(ot(a)):r&&!o?it(a):!r&&o?ot(a):a}function NN(e,t,r){return r in e?r in t?UN(e[r],t[r]):e[r]:r in t?t[r]:V()}function LN(e,t){return[...new Set([...s.Keys(t),...s.Keys(e)])].reduce((o,i)=>({...o,[i]:NN(e,t,i)}),{})}function By(e){return w(e)?e.properties:K(e)?Zp(e.items):F()}function qy(e,t){let r=By(e),o=By(t),i=LN(r,o);return N(i)}function Hy(e,t){let r=hi(e,t);return s.IsEqual(r,Ti)?e:s.IsEqual(r,_i)||s.IsEqual(r,Ii)?t:V()}function Ky(e){return w(e)||K(e)}function zy(e){return U(e)?Se(e.allOf):e}function kN(e,t){let r=zy(e),o=zy(t),i=Ky(r),a=Ky(o);return i&&a?qy(kr(r),o):i&&!a?kr(r):!i&&a?o:Hy(kr(r),o)}function Vy(e,t,r=[]){let[o,...i]=t;return s.IsUndefined(o)?r.length===0?[e]:r:Vy(e,i,[...r,kN(e,o)])}function Yy(e,t,r=[]){let[o,...i]=e;return A(o)?Yy(i,t,[...r,...Oi([o],t)]):r}function Oi(e,t=[]){let[r,...o]=e;return A(r)?O(r)?Oi(o,Yy(r.anyOf,t)):Oi(o,Vy(r,t)):t}function Se(e){let t=Oi(e);return Xp(t)}function ar(e){return Xp(e)}function kr(e){return U(e)?Se(e.allOf):O(e)?ar(e.anyOf):e}function cn(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?V():G(e)}function wN(e,t){return t.filter(r=>hi(e,r)!==_i)}function MN(e,t){let r=t.some(o=>{let i=hi(e,o);return s.IsEqual(i,Ti)||s.IsEqual(i,Ii)});return s.IsEqual(r,!1)}function $N(e,t){let r=kr(e);return Xe(r)?[r]:MN(r,t)?[...wN(r,t),r]:t}function Jp(e,t=[]){let[r,...o]=e;return A(r)?w(r)?Jp(o,[...t,r]):Jp(o,$N(r,t)):t}function Xp(e){let t=Jp(e),r=zt(t);return r.length===0?V():r.length===1?r[0]:G(r)}function DN(e,t,r,o){let i=_(e,t,r);return g.Update(kr(i),{},o)}function Qy(e,t,r,o){return DN(e,t,r,o)}function Wy(e,t,r){let o=Se(t);return ee(e,o,r)}function Zy(e,t,r){return Qe(r)?ee(e,t,r.iteratorItems):B(e,jt(t),r)}function ts(e,t,r){return t===r?S(e):j()}function GN(e,t,r){return Y(r)?ts(e,t,r.const):ut(r)?S(e):B(e,H(t),r)}function vN(e,t,r){return Y(r)?ts(e,t,r.const):et(r)?S(e):B(e,H(t),r)}function jN(e,t,r){return Y(r)?ts(e,t,r.const):ge(r)?S(e):B(e,H(t),r)}function FN(e,t,r){return Y(r)?ts(e,t,r.const):xe(r)?S(e):B(e,H(t),r)}function Xy(e,t,r){return s.IsBigInt(t.const)?GN(e,t.const,r):s.IsBoolean(t.const)?vN(e,t.const,r):s.IsNumber(t.const)?jN(e,t.const,r):s.IsString(t.const)?FN(e,t.const,r):F()}function Jy(e,t,r){return he(r)?B(e,t,r):S(e)}function eE(e,t,r){return Ft(r)?S(e):B(e,t,r)}function tE(e,t,r){return ge(r)?S(e):B(e,t,r)}function BN(e,t,r){return Pe(t)?Pe(r)?S(e):j():S(e)}function qN(e,t,r){return he(r)&&or(r.extends)?j():(()=>{let o=ee(e,t,r);return Ie(o)?BN(o.inferred,t,r):j()})()}function HN(e,t){return e.reduce((r,o)=>o in t?Ie(t[o])?{...r,...t[o].inferred}:F():F(),{})}function KN(e,t,r){let o={};for(let p of s.Keys(r))o[p]=p in t?qN({},t[p],r[p]):Pe(r[p])?he(r[p])?S(g.Assign(e,{[r[p].name]:r[p].extends})):S(e):j();let i=s.Values(o).every(p=>Ie(p)),a=i?HN(s.Keys(o),o):{};return i?S(a):j()}function zN(e,t,r){let o=KN(e,t,r);return Ie(o)?S(g.Assign(e,o.inferred)):j()}function VN(e,t,r){return zN(e,t,r)}function rE(e,t,r){return w(r)?VN(e,t,r.properties):B(e,N(t),r)}function nE(e,t,r){return qe(r)?ee(e,t,r.item):B(e,qt(t),r)}function oE(e,t,r){return xe(r)?S(e):B(e,t,r)}function iE(e,t,r){return Bt(r)?S(e):B(e,t,r)}function aE(e,t,r){let o=Ke(t);return ee(e,o,r)}function ec(e,t){return g.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function Ai(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"name")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"Inferrable")&&s.IsString(e.name)&&s.IsObject(e.type)}function tc(e){return Ur(e)?he(e.items)?J(e.items.extends)?ec(e.items.name,e.items.extends.items):at(e.items.extends)?ec(e.items.name,e.items.extends):void 0:F():void 0}function rs(e){return he(e)?ec(e.name,e.extends):void 0}function rc(e,t,r=[]){let[o,...i]=e;return A(o)?(()=>{let a=ee({},o,t);return Ie(a)?rc(i,t,[...r,o]):void 0})():r}function sE(e,t,r,o){let i=rc(r,o);return s.IsArray(i)?S(g.Assign(e,{[t]:$e(i)})):j()}function ns(e,t,r,o){let i=rc(r,o);return s.IsArray(i)?S(g.Assign(e,{[t]:G(i)})):j()}function YN(e){return[...e].reverse()}function nc(e,t){return t?YN(e):e}function QN(e){let t=e.length>0?e[0]:void 0,r=A(t)?tc(t):void 0;return A(r)}function WN(e,t,r,o,i,a){let p=ee(e,r,i);return Ie(p)?pE(p.inferred,t,o,a):j()}function ZN(e,t,r,o,i){let a=tc(o);return Ai(a)?sE(e,a.name,nc(r,t),a.type):(()=>{let[p,...u]=r;return A(p)?WN(e,t,p,u,o,i):j()})()}function XN(e,t,r,o){let[i,...a]=o;return A(i)?ZN(e,t,r,i,a):s.IsEqual(r.length,0)?S(e):j()}function pE(e,t,r,o){return XN(e,t,r,o)}function JN(e,t,r){let o=os(e,{callstack:[]},r),i=QN(o);return pE(e,i,nc(t,i),nc(o,i))}function cE(e,t,r){let o=rs(r);return Ai(o)?ns(e,o.name,t,o.type):(()=>{let[i,...a]=t;return A(i)?(()=>{let p=ee(e,i,r);return Ie(p)?cE(p.inferred,a,r):j()})():S(e)})()}function mE(e,t,r){let o=os(e,{callstack:[]},t);return K(r)?JN(e,o,r.items):J(r)?cE(e,o,r.items):B(e,$e(o),r)}function uE(e,t,r){return dt(r)?S(e):Kt(r)?S(e):B(e,t,r)}function lE(e,t,r){let[o,...i]=r;return A(o)?(()=>{let a=ee(e,t,o);return Ie(a)?S(a.inferred):lE(e,t,i)})():j()}function oc(e,t,r){let[o,...i]=t;return A(o)?(()=>{let a=lE(e,o,r);return Ie(a)?oc(a.inferred,i,r):j()})():S(e)}function dE(e,t,r){let o=rs(r);return Ai(o)?ns(e,o.name,t,o.type):O(r)?oc(e,t,r.anyOf):oc(e,t,[r])}function fE(e,t,r){return he(r)?B(e,t,r):Xe(r)?S(e):at(r)?S(e):j()}function gE(e,t,r){return dt(r)?S(e):B(e,t,r)}function ee(e,t,r){return Xe(t)?Ly(e,t,r):J(t)?ky(e,t,t.items,r):Ye(t)?wy(e,t.iteratorItems,r):ut(t)?My(e,t,r):et(t)?$y(e,t,r):Ue(t)?Dy(e,t.parameters,t.instanceType,r):Oe(t)?Gy(e,t,r):Ne(t)?vy(e,t.parameters,t.returnType,r):Me(t)?jy(e,t,r):U(t)?Wy(e,t.allOf,r):Qe(t)?Zy(e,t.iteratorItems,r):Y(t)?Xy(e,t,r):or(t)?Jy(e,t,r):Ft(t)?eE(e,t,r):ge(t)?tE(e,t,r):w(t)?rE(e,t.properties,r):qe(t)?nE(e,t.item,r):xe(t)?oE(e,t,r):Bt(t)?iE(e,t,r):Ae(t)?aE(e,t.pattern,r):K(t)?mE(e,t.items,r):Kt(t)?uE(e,t,r):O(t)?dE(e,t.anyOf,r):at(t)?fE(e,t,r):dt(t)?gE(e,t,r):j()}function Xn(e,t,r={}){return C("Interface",[e,t],r)}function io(e){return A(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function yE(e,t,r={}){return R({},Xn(e,t,r))}function eL(e,t,r){return e.includes(r)?!0:wr([...e,r],t,t[r])}function EE(e,t,r){let o=Ga(r);return mn(e,t,o)}function mn(e,t,r){let[o,...i]=r;return A(o)?wr(e,t,o)?!0:mn(e,t,i):!1}function wr(e,t,r){return se(r)?eL(e,t,r.$ref):J(r)?wr(e,t,r.items):Ye(r)?wr(e,t,r.iteratorItems):Ue(r)?mn(e,t,[...r.parameters,r.instanceType]):Ne(r)?mn(e,t,[...r.parameters,r.returnType]):io(r)?EE(e,t,r.parameters[1]):U(r)?mn(e,t,r.allOf):Qe(r)?wr(e,t,r.iteratorItems):w(r)?EE(e,t,r.properties):qe(r)?wr(e,t,r.item):O(r)?mn(e,t,r.anyOf):K(r)?mn(e,t,r.items):ye(r)?wr(e,t,He(r)):!1}function is(e,t,r){return wr(e,t,r)}function tL(e,t){return t.reduce((r,o)=>o in e?is([o],e,e[o])?[...r,o]:r:F(),[])}function IE(e){let t=gd(e);return tL(e,t)}function rL(e,t,r){return r.includes(t)?r:t in e?Mr(e,e[t],[...r,t]):F()}function TE(e,t,r){let o=Ga(t);return ao(e,o,r)}function ao(e,t,r){return t.reduce((o,i)=>Mr(e,i,o),r)}function Mr(e,t,r){return se(t)?rL(e,t.$ref,r):J(t)?Mr(e,t.items,r):Ye(t)?Mr(e,t.iteratorItems,r):Ue(t)?ao(e,[...t.parameters,t.instanceType],r):Ne(t)?ao(e,[...t.parameters,t.returnType],r):io(t)?TE(e,t.parameters[1],r):U(t)?ao(e,t.allOf,r):Qe(t)?Mr(e,t.iteratorItems,r):w(t)?TE(e,t.properties,r):qe(t)?Mr(e,t.item,r):O(t)?ao(e,t.anyOf,r):K(t)?ao(e,t.items,r):ye(t)?Mr(e,He(t),r):r}function _E(e,t,r){return Mr(e,r,[t])}function nL(e){return Bn()}function oL(e){return s.Keys(e).reduce((t,r)=>({...t,[r]:Vt(e[r])}),{})}function Si(e){return e.reduce((t,r)=>[...t,Vt(r)],[])}function Vt(e){return se(e)?nL(e.$ref):J(e)?Lt(Vt(e.items),Ua(e)):Ye(e)?Gt(Vt(e.iteratorItems)):Ue(e)?Sr(Si(e.parameters),Vt(e.instanceType)):Ne(e)?br(Si(e.parameters),Vt(e.returnType)):U(e)?_t(Si(e.allOf)):Qe(e)?jt(Vt(e.iteratorItems)):w(e)?N(oL(e.properties)):qe(e)?qt(Vt(e.item)):ye(e)?ja(Qn(e),Vt(He(e))):O(e)?G(Si(e.anyOf)):K(e)?$e(Si(e.items)):e}function iL(e,t){return t in e?Vt(e[t]):Fe()}function hE(e){return iL(e.$defs,e.$ref)}function aL(e,t,r){let o=ft(e,{callstack:[]},t),i=bi({},{callstack:[]},r);return Se([...o,N(i)])}function sL(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let a=e[i],p=io(a)?aL(e,a.parameters[0],a.parameters[1]):a;return{...o,[i]:p}},{})}function OE(e,t,r){let o=_E(e,t,r),i=sL(e,o);return vt(i,t)}function AE(e,t){return t in e?se(e[t])?AE(e,e[t].$ref):e[t]:V()}function Yt(e,t){return AE(e,t)}function SE(e){return pe(e)?hE(e):e}function ze(e,t,r){let o=SE(t),i=SE(r);return ee(e,o,i)}function pL(e,t,r){if(he(t)||so(t)||L.IsExtendsTrueLike(ze({},t,r)))return;let o={parameter:e,extends:r,received:t};throw new Error("Generic argument does not satify constraint",{cause:o})}function bE(e,t,r,o,i){let a=_(e,t,i);return pL(r,a,o),g.Assign(e,{[r]:a})}function cL(e,t,r,o,i){let a=_(e,t,r.extends),p=_(e,t,r.equals),[u,...l]=i;return A(u)?ic(bE(e,t,r.name,a,u),t,o,l):ic(bE(e,t,r.name,a,p),t,o,[])}function ic(e,t,r,o){let[i,...a]=r;return A(i)?cL(e,t,i,a,o):e}function xE(e,t,r,o){return ic(e,t,r,o)}function mL(e){return s.IsGreaterThan(e.length,0)?e[0]:""}function RE(e,t,r,o){let i=ft(e,t,o);return qa(r,i)}function uL(e,t,r,o){return RE(e,t,be(r),o)}function lL(e,t,r,o,i,a){let p=ft(e,t,a),u=xE(e,t,o,p),l=_(u,{callstack:[...t.callstack,r]},i);return _(e,t,l)}function as(e,t,r,o){let[i,a]=Kl(e,r,o);return Fn(a)?s.IsEqual(mL(t.callstack),i)?uL(e,t,i,o):lL(e,t,i,a.parameters,a.expression,o):RE(e,t,r,o)}function qa(e,t){return g.Create({"~kind":"Call"},{target:e,arguments:t},{})}function CE(e,t){return as({},{callstack:[]},e,t)}function so(e){return h(e,"Call")}function PE(e){return qe(e)?PE(e.item):e}function dL(e,t,r,o){let i=_(e,t,r);return g.Update(PE(i),{},o)}function UE(e,t,r,o){return k(e,[r])?dL(e,t,r,o):gi(r,o)}function NE(e,t){return e(t)}function LE(e,t){return s.IsString(t)?H(NE(e,t)):H(t)}function kE(e,t){let r=Ke(t);return sr(e,r)}function wE(e,t){let r=t.map(o=>sr(e,o));return G(r)}function sr(e,t){return Y(t)?LE(e,t.const):Ae(t)?kE(e,t.pattern):O(t)?wE(e,t.anyOf):t}function Xo(e,t={}){return C("Capitalize",[e],t)}function ME(e,t={}){return R({},Xo(e,t))}function Jo(e,t={}){return C("Lowercase",[e],t)}function $E(e,t={}){return R({},Jo(e,t))}function ei(e,t={}){return C("Uncapitalize",[e],t)}function DE(e,t={}){return R({},ei(e,t))}function ti(e,t={}){return C("Uppercase",[e],t)}function GE(e,t={}){return R({},ti(e,t))}var fL=e=>e[0].toUpperCase()+e.slice(1),gL=e=>e.toLowerCase(),yL=e=>e[0].toLowerCase()+e.slice(1),EL=e=>e.toUpperCase();function IL(e,t,r,o){let i=_(e,t,r);return g.Update(sr(fL,i),{},o)}function vE(e,t,r,o){return k(e,[r])?IL(e,t,r,o):Xo(r,o)}function TL(e,t,r,o){let i=_(e,t,r);return g.Update(sr(gL,i),{},o)}function jE(e,t,r,o){return k(e,[r])?TL(e,t,r,o):Jo(r,o)}function _L(e,t,r,o){let i=_(e,t,r);return g.Update(sr(yL,i),{},o)}function FE(e,t,r,o){return k(e,[r])?_L(e,t,r,o):ei(r,o)}function hL(e,t,r,o){let i=_(e,t,r);return g.Update(sr(EL,i),{},o)}function BE(e,t,r,o){return k(e,[r])?hL(e,t,r,o):ti(r,o)}function ri(e,t,r,o,i={}){return C("Conditional",[e,t,r,o],i)}function qE(e,t,r,o,i={}){return R({},ri(e,t,r,o,i))}function OL(e,t,r,o,i,a,p){let u=_(e,t,r),l=_(e,t,o),f=ze(e,u,l);return g.Update(L.IsExtendsUnion(f)?G([_(f.inferred,t,i),_(e,t,a)]):L.IsExtendsTrue(f)?_(f.inferred,t,i):_(e,t,a),{},p)}function HE(e,t,r,o,i,a,p){return k(e,[r,o])?OL(e,t,r,o,i,a,p):ri(r,o,i,a,p)}function ni(e,t={}){return C("ConstructorParameters",[e],t)}function KE(e,t={}){return R({},ni(e,t))}function AL(e){return Ue(e)?_({},{callstack:[]},$e(e.parameters)):V()}function SL(e,t,r,o){let i=_(e,t,r);return g.Update(AL(i),{},o)}function zE(e,t,r,o){return k(e,[r])?SL(e,t,r,o):ni(r,o)}function oi(e,t,r={}){return C("Exclude",[e,t],r)}function VE(e,t,r={}){return R({},oi(e,t,r))}function YE(e,t){return e.reduce((r,o)=>[...r,...QE(o,t)],[])}function QE(e,t){let r=ze({},e,t);return L.IsExtendsTrueLike(r)?[]:[e]}function bL(e,t){let r=Oe(e)?YE(kt(e.enum),t):O(e)?YE(zt(e.anyOf),t):QE(e,t);return ar(r)}function xL(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(bL(a,p),{},i)}function ss(e,t,r,o,i){return k(e,[r,o])?xL(e,t,r,o,i):oi(r,o,i)}function ii(e,t,r={}){return C("Extract",[e,t],r)}function WE(e,t,r={}){return R({},ii(e,t,r))}function ZE(e,t){return e.reduce((r,o)=>[...r,...XE(o,t)],[])}function XE(e,t){let r=ze({},e,t);return L.IsExtendsTrueLike(r)?[e]:[]}function RL(e,t){let r=Oe(e)?ZE(kt(e.enum),t):O(e)?ZE(zt(e.anyOf),t):XE(e,t);return ar(r)}function CL(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(RL(a,p),{},i)}function JE(e,t,r,o,i){return k(e,[r,o])?CL(e,t,r,o,i):ii(r,o,i)}var PL=new RegExp("^(?:0|[1-9][0-9]*)$");function po(e){let t=`${e}`;return PL.test(t)?parseInt(t):e}function UL(e){return H(po(e))}function eI(e){return e.map(t=>tI(t))}function tI(e){return U(e)?_t(eI(e.allOf)):O(e)?G(eI(e.anyOf)):Y(e)?UL(e.const):e}function rI(e,t){let r=tI(t),o=ze({},r,ht());return L.IsExtendsTrueLike(o)?e:V()}function nI(e,t){let r=Yt(e,t);return Qt(r)}function ps(e){return e.reduce((t,r)=>[...t,...Qt(r)],[])}function oI(e){let t=kt(e);return ps(t)}function iI(e){let t=Se(e);return Qt(t)}function aI(e){return[`${e}`]}function sI(e){let t=Ke(e);return Qt(t)}function Qt(e){return pe(e)?nI(e.$defs,e.$ref):Oe(e)?oI(e.enum):U(e)?iI(e.allOf):Y(e)?aI(e.const):Ae(e)?sI(e.pattern):O(e)?ps(e.anyOf):[]}function co(e){return Qt(e)}function NL(e,t){return t in e?[e[t]]:[]}function LL(e,t){return t.reduce((r,o)=>[...r,...NL(e,o)],[])}function pI(e,t){let r=co(t),o=LL(e,r);return ar(o)}function kL(e){return H(po(e))}function cI(e){return e.map(t=>ac(t))}function ac(e){return U(e)?_t(cI(e.allOf)):O(e)?G(cI(e.anyOf)):Y(e)?kL(e.const):e}function wL(e,t){return e.reduceRight((r,o,i)=>{let a=ze({},H(i),t);return L.IsExtendsTrueLike(a)?[o,...r]:r},[])}function ML(e,t){let r=ac(t),o=wL(e,r);return cn(o)}function $L(e){return cn(e)}function mI(e,t){return ge(t)||Me(t)?$L(e):ML(e,t)}function DL(e){return e.reduce((t,r)=>$a(r)?[...t,H(r)]:t,[])}function mo(e){let t=DL(e);return G(t)}function Jn(e,t,r={}){return C("Index",[e,t],r)}function uI(e,t,r={}){let o=s.IsArray(t)?mo(t):t;return R({},Jn(e,o,r))}function lI(e,t){let r=Yt(e,t);return wt(r)}function GL(e,t){let r=s.Keys(e).filter(y=>!s.HasPropertyKey(t,y)),o=s.Keys(t).filter(y=>!s.HasPropertyKey(e,y)),i=s.Keys(e).filter(y=>s.HasPropertyKey(t,y)),a=r.reduce((y,I)=>({...y,[I]:e[I]}),{}),p=o.reduce((y,I)=>({...y,[I]:t[I]}),{}),u=i.reduce((y,I)=>({...y,[I]:Se([e[I],t[I]])}),{}),l=g.Assign(a,p);return g.Assign(l,u)}function dI(e){return e.reduce((t,r)=>GL(t,wt(r)),{})}function fI(e){let t=Fy($e(e));return wt(t)}function vL(e,t){return s.Keys(e).filter(i=>i in t).reduce((i,a)=>({...i,[a]:ar([e[a],t[a]])}),{})}function gI(e,t){let[r,...o]=e;return A(r)?gI(o,vL(t,wt(r))):t}function yI(e){let[t,...r]=e;return A(t)?gI(r,wt(t)):F()}function wt(e){return pe(e)?lI(e.$defs,e.$ref):U(e)?dI(e.allOf):O(e)?yI(e.anyOf):K(e)?fI(e.items):w(e)?e.properties:{}}function uo(e){let t=wt(e);return N(t)}function jL(e){return pe(e)||U(e)||O(e)?uo(e):e}function FL(e,t){let r=jL(e);return J(r)?rI(r.items,t):w(r)?pI(r.properties,t):K(r)?mI(r.items,t):V()}function BL(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(FL(a,p),{},i)}function EI(e,t,r,o,i){return k(e,[r,o])?BL(e,t,r,o,i):Jn(r,o,i)}function ai(e,t={}){return C("InstanceType",[e],t)}function II(e,t={}){return R({},ai(e,t))}function qL(e){return Ue(e)?e.instanceType:V()}function HL(e,t,r,o){let i=_(e,t,r);return g.Update(qL(i),{},o)}function TI(e,t,r,o={}){return k(e,[r])?HL(e,t,r,o):ai(r,o)}function KL(e,t,r,o,i){let a=ft(e,{callstack:[]},r),p=bi(e,{callstack:[]},o),u=Se([...a,N(p)]);return g.Update(u,{},i)}function _I(e,t,r,o,i){return k(e,r)?KL(e,t,r,o,i):Xn(r,o,i)}function eo(e,t={}){return C("KeyOf",[e],t)}function hI(e,t={}){return R({},eo(e,t))}function OI(){return G([ht(),st(),zn()])}function AI(e){return ht()}function zL(e){return e.reduce((r,o)=>$a(o)?[...r,H(po(o))]:F(),[])}function SI(e){let t=s.Keys(e),r=zL(t);return cn(r)}function bI(e){return Qn(e)}function xI(e){let t=e.map((r,o)=>H(o));return cn(t)}function VL(e){return pe(e)||U(e)||O(e)?uo(e):e}function YL(e){let t=VL(e);return Xe(t)?OI():J(t)?AI(t.items):w(t)?SI(t.properties):ye(t)?bI(t):K(t)?xI(t.items):V()}function QL(e,t,r,o){let i=_(e,t,r);return g.Update(YL(i),{},o)}function RI(e,t,r,o){return k(e,[r])?QL(e,t,r,o):eo(r,o)}function WL(e){let t=Ke(e);return sc(t)}function CI(e){return e.reduce((t,r)=>[...t,...sc(r)],[])}function sc(e){return Oe(e)?CI(kt(e.enum)):Kn(e)||Hn(e)?[e]:Ae(e)?WL(e.pattern):O(e)?CI(e.anyOf):[]}function PI(e){return sc(e)}function Zn(e,t,r,o,i={}){return C("Mapped",[e,t,r,o],i)}function UI(e,t,r,o,i={}){return R({},Zn(e,t,r,o,i))}function ZL(e,t,r,o,i){let a=g.Assign(e,{[r.name]:o}),p=_(a,t,i);return Ae(p)?Ke(p.pattern):p}function XL(e,t,r,o,i){let a=g.Assign(e,{[r.name]:o});return _(a,t,i)}function JL(e,t,r,o,i,a){let p=XL(e,t,r,o,a),u=ZL(e,t,r,o,i);return Kn(u)||Hn(u)?{[u.const]:p}:{}}function ek(e,t,r,o,i,a){return o.reduce((p,u)=>({...p,...JL(e,t,r,u,i,a)}),{})}function tk(e,t,r,o,i,a){let p=PI(o),u=ek(e,t,r,p,i,a);return N(u)}function rk(e,t,r,o,i,a,p){let u=_(e,t,o);return g.Update(tk(e,t,r,u,i,a),{},p)}function NI(e,t,r,o,i,a,p){return k(e,[o])?rk(e,t,r,o,i,a,p):Zn(r,o,i,a,p)}function nk(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>({...o,[i]:OE(e,i,e[i])}),{})}function ok(e,t){return s.Keys(e).filter(o=>!t.includes(o)).reduce((o,i)=>({...o,[i]:_(e,{callstack:[]},e[i])}),{})}function ik(e,t){let r=IE(e),o=nk(e,r),i=ok(e,r),a={...o,...i};return g.Update(a,{},t)}function LI(e,t,r,o){let i=g.Assign(e,r);return ik(i,o)}function si(e,t={}){return C("NonNullable",[e],t)}function kI(e,t={}){return R({},si(e,t))}function ak(e){let t=G([Pr(),Wn()]);return ss({},{callstack:[]},e,t,{})}function sk(e,t,r,o){let i=_(e,t,r);return g.Update(ak(i),{},o)}function wI(e,t,r,o){return k(e,[r])?sk(e,t,r,o):si(r,o)}function cs(e){let t=uo(e);return w(t)?t.properties:F()}function pi(e,t,r={}){return C("Omit",[e,t],r)}function MI(e,t,r={}){let o=s.IsArray(t)?mo(t):t;return R({},pi(e,o,r))}function pk(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function ck(e,t){let r=cs(e),o=co(t),i=pk(r,o);return N(i)}function mk(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(ck(a,p),{},i)}function $I(e,t,r,o,i){return k(e,[r,o])?mk(e,t,r,o,i):pi(r,o,i)}function to(e,t){return C("Options",[e,t],{})}function ms(e,t){return R({},to(e,t))}function uk(e,t,r,o){let i=_(e,t,r);return g.Update(i,{},o)}function DI(e,t,r,o){return k(e,[r])?uk(e,t,r,o):to(r,o)}function ci(e,t={}){return C("Parameters",[e],t)}function GI(e,t={}){return R({},ci(e,t))}function lk(e){return Ne(e)?_({},{callstack:[]},$e(e.parameters)):V()}function dk(e,t,r,o){let i=_(e,t,r);return g.Update(lk(i),{},o)}function vI(e,t,r,o){return k(e,[r])?dk(e,t,r,o):ci(r,o)}function mi(e,t={}){return C("Partial",[e],t)}function jI(e,t={}){return R({},mi(e,t))}function FI(e,t){let r=Yt(e,t),o=$r(r);return vt(g.Assign(e,{[t]:o}),t)}function BI(e){let t=e.map(r=>$r(r));return Se(t)}function qI(e){let t=e.map(r=>$r(r));return G(t)}function HI(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Ra(e[i])}),{});return N(t)}function $r(e){return pe(e)?FI(e.$defs,e.$ref):U(e)?BI(e.allOf):O(e)?qI(e.anyOf):w(e)?HI(e.properties):N({})}function fk(e,t,r,o){let i=_(e,t,r);return g.Update($r(i),{},o)}function KI(e,t,r,o){return k(e,[r])?fk(e,t,r,o):mi(r,o)}function ui(e,t,r={}){return C("Pick",[e,t],r)}function zI(e,t,r={}){let o=s.IsArray(t)?mo(t):t;return R({},ui(e,o,r))}function gk(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?g.Assign(o,{[i]:e[i]}):o,{})}function yk(e,t){let r=cs(e),o=co(t),i=gk(r,o);return N(i)}function Ek(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(yk(a,p),{},i)}function VI(e,t,r,o,i){return k(e,[r,o])?Ek(e,t,r,o,i):ui(r,o,i)}function li(e,t={}){return C("ReadonlyType",[e],t)}function YI(e,t={}){return R({},li(e,t))}function QI(e){return Ar(Lt(e))}function WI(e,t){let r=Yt(e,t),o=Dr(r);return vt(g.Assign(e,{[t]:o}),t)}function ZI(e){let t=e.map(r=>Dr(r));return Se(t)}function XI(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Pa(e[i])}),{});return N(t)}function JI(e){return Ar($e(e))}function eT(e){let t=e.map(r=>Dr(r));return G(t)}function Dr(e){return J(e)?QI(e.items):pe(e)?WI(e.$defs,e.$ref):U(e)?ZI(e.allOf):w(e)?XI(e.properties):K(e)?JI(e.items):O(e)?eT(e.anyOf):e}function Ik(e,t,r,o){let i=_(e,t,r);return g.Update(Dr(i),{},o)}function tT(e,t,r,o){return k(e,[r])?Ik(e,t,r,o):li(r,o)}function rT(e){return pt(Ht,e)}function nT(e){return N({true:e,false:e})}function oT(e,t){let r=yi(e);return Gr(r,t)}function iT(e,t){return pt(Vn,t)}function aT(e,t){let r=Se(e);return Gr(r,t)}function sT(e,t){return s.IsString(e)||s.IsNumber(e)?N({[e]:t}):s.IsEqual(e,!1)?N({false:t}):s.IsEqual(e,!0)?N({true:t}):N({})}function pT(e,t){return pt(Yn,t)}function cT(e,t){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?pt(e.pattern.toString(),t):pt(Ht,t)}function mT(e,t){let r=Xa(e);return Ja(r)?Gr(Ke(e),t):pt(e,t)}function Tk(e){return e.some(t=>xe(t)||ge(t)||Me(t))}function _k(e,t){return s.IsEqual(Tk(e),!0)?pt(Ht,t):void 0}function hk(e,t){return e.reduce((r,o)=>Y(o)&&(s.IsString(o.const)||s.IsNumber(o.const))?{...r,[o.const]:t}:r,{})}function Ok(e,t){let r=hk(e,t);return N(r)}function uT(e,t){let r=zt(e),o=_k(r,t);return A(o)?o:Ok(r,t)}function Gr(e,t){return Xe(e)?rT(t):et(e)?nT(t):Oe(e)?oT(e.enum,t):Me(e)?iT(e,t):U(e)?aT(e.allOf,t):Y(e)?sT(e.const,t):ge(e)?pT(e,t):O(e)?uT(e.anyOf,t):xe(e)?cT(e,t):Ae(e)?mT(e.pattern,t):N({})}function Ak(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(Gr(a,p),{},i)}function lT(e,t,r,o,i){return k(e,[r])?Ak(e,t,r,o,i):Wo(r,o,i)}function dT(e,t,r){return r in e?is([r],e,e[r])?be(r):_(e,t,e[r]):be(r)}function fT(e,t){let r=Yt(e,t),o=vr(r);return vt(g.Assign(e,{[t]:o}),t)}function gT(e){let t=e.map(r=>vr(r));return Se(t)}function yT(e){let t=e.map(r=>vr(r));return G(t)}function ET(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:jn(e[i])}),{});return N(t)}function vr(e){return pe(e)?fT(e.$defs,e.$ref):U(e)?gT(e.allOf):O(e)?yT(e.anyOf):w(e)?ET(e.properties):N({})}function di(e,t={}){return C("Required",[e],t)}function IT(e,t={}){return R({},di(e,t))}function Sk(e,t,r,o){let i=_(e,t,r);return g.Update(vr(i),{},o)}function TT(e,t,r,o){return k(e,[r])?Sk(e,t,r,o):di(r,o)}function fi(e,t={}){return C("ReturnType",[e],t)}function _T(e,t={}){return R({},fi(e,t))}function bk(e){return Ne(e)?e.returnType:V()}function xk(e,t,r,o){let i=_(e,t,r);return g.Update(bk(i),{},o)}function hT(e,t,r,o){return k(e,[r])?xk(e,t,r,o):fi(r,o)}function OT(e){return g.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function Rk(e){return e.join("|")}function Ck(e){return e.slice(1,e.length-1)}function Pk(e,t,r){return jr(t,`${r}${e}`)}function Uk(e,t){return jr(e,`${t}${cd}`)}function Nk(e,t){return jr(e,`${t}${Ma}`)}function Lk(e,t){return jr(e,`${t}${Da}`)}function kk(e,t){return cc(G([H("false"),H("true")]),e,t)}function wk(e,t){return jr(e,`${t}${va}`)}function Mk(e,t,r){return jr(t,`${r}${Ck(e)}`)}function $k(e,t,r,o=[]){let i=kt(e);return pc(i,t,r)}function pc(e,t,r,o=[]){let[i,...a]=e;return A(i)?pc(a,t,r,[...o,cc(i,[],"")]):jr(t,`${r}(${Rk(o)})`)}function cc(e,t,r){return Oe(e)?$k(e.enum,t,r):Me(e)?Nk(t,r):Y(e)?Pk(e.const,t,r):ut(e)?Uk(t,r):et(e)?kk(t,r):ge(e)?Lk(t,r):xe(e)?wk(t,r):Ae(e)?Mk(e.pattern,t,r):O(e)?pc(e.anyOf,t,r):ql}function jr(e,t){let[r,...o]=e;return A(r)?cc(r,o,t):t}function Dk(e){return`^${jr(e,"")}$`}function AT(e){let t=Dk(e);return OT(t)}function Gk(e,t,r,o){let i=ft(e,t,r);return g.Update(AT(i),{},o)}function ST(e,t,r,o){return k(e,r)?Gk(e,t,r,o):Zo(r,o)}function vk(e){return Ur(e)?K(e.items)?mc(e.items.items):he(e.items)?[e]:se(e.items)?[e]:[V()]:[e]}function mc(e){return e.reduce((r,o)=>[...r,...vk(o)],[])}function jk(e,t){return t in e}function Fk(e,t){return U(t)?k(e,t.allOf):O(t)?k(e,t.anyOf):se(t)?jk(e,t.$ref):!0}function k(e,t){let[r,...o]=t;return A(r)?Fk(e,r)?k(e,o):!1:!0}function xi(e,t,r){return Dl(e)?xi(e.type,"remove",r):kl(e)?xi(e.type,t,"remove"):Ml(e)?xi(e.type,"add",r):Nl(e)?xi(e.type,t,"add"):[e,t,r]}function Bk(e,t){return s.IsEqual(e,"remove")?Ca(t):s.IsEqual(e,"add")?it(t):t}function qk(e,t){return s.IsEqual(e,"remove")?jn(t):s.IsEqual(e,"add")?ot(t):t}function bi(e,t,r){return s.Keys(r).reduce((o,i)=>({...o,[i]:_(e,t,r[i])}),{})}function os(e,t,r){let o=ft(e,t,r);return mc(o)}function ft(e,t,r){return r.map(o=>_(e,t,o))}function Hk(e,t,r,o,i){return s.IsEqual(r,"Awaited")?UE(e,t,o[0],i):s.IsEqual(r,"Capitalize")?vE(e,t,o[0],i):s.IsEqual(r,"Conditional")?HE(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(r,"ConstructorParameters")?zE(e,t,o[0],i):s.IsEqual(r,"Evaluate")?Qy(e,t,o[0],i):s.IsEqual(r,"Exclude")?ss(e,t,o[0],o[1],i):s.IsEqual(r,"Extract")?JE(e,t,o[0],o[1],i):s.IsEqual(r,"Index")?EI(e,t,o[0],o[1],i):s.IsEqual(r,"InstanceType")?TI(e,t,o[0],i):s.IsEqual(r,"Interface")?_I(e,t,o[0],o[1],i):s.IsEqual(r,"KeyOf")?RI(e,t,o[0],i):s.IsEqual(r,"Lowercase")?jE(e,t,o[0],i):s.IsEqual(r,"Mapped")?NI(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(r,"Module")?LI(e,t,o[0],i):s.IsEqual(r,"NonNullable")?wI(e,t,o[0],i):s.IsEqual(r,"Pick")?VI(e,t,o[0],o[1],i):s.IsEqual(r,"Options")?DI(e,t,o[0],o[1]):s.IsEqual(r,"Parameters")?vI(e,t,o[0],i):s.IsEqual(r,"Partial")?KI(e,t,o[0],i):s.IsEqual(r,"Omit")?$I(e,t,o[0],o[1],i):s.IsEqual(r,"ReadonlyType")?tT(e,t,o[0],i):s.IsEqual(r,"Record")?lT(e,t,o[0],o[1],i):s.IsEqual(r,"Required")?TT(e,t,o[0],i):s.IsEqual(r,"ReturnType")?hT(e,t,o[0],i):s.IsEqual(r,"TemplateLiteral")?ST(e,t,o[0],i):s.IsEqual(r,"Uncapitalize")?FE(e,t,o[0],i):s.IsEqual(r,"Uppercase")?BE(e,t,o[0],i):C(r,o,i)}function _(e,t,r){let o=en(r),i=xi(r,tn(r)?"add":"none",Pe(r)?"add":"none"),a=Tt(i[0])?i[0].Clone():i[0],p=se(a)?dT(e,t,a.$ref):J(a)?Lt(_(e,t,a.items),Ua(a)):Ye(a)?Gt(_(e,t,a.iteratorItems),vl(a)):so(a)?as(e,t,a.target,a.arguments):Ue(a)?Sr(ft(e,t,a.parameters),_(e,t,a.instanceType),Fl(a)):Gl(a)?Hk(e,t,a.action,a.parameters,a.options):Ne(a)?br(ft(e,t,a.parameters),_(e,t,a.returnType),Bl(a)):U(a)?_t(ft(e,t,a.allOf),Ql(a)):Qe(a)?jt(_(e,t,a.iteratorItems),ud(a)):w(a)?N(bi(e,t,a.properties),yd(a)):qe(a)?qt(_(e,t,a.item),Id(a)):ye(a)?Td(lt(a),_(e,t,He(a))):Ur(a)?an(_(e,t,a.items)):K(a)?$e(os(e,t,a.items),hd(a)):O(a)?G(ft(e,t,a.anyOf),Od(a)):a,u=o?Ar(p):p;return Bk(i[1],qk(i[2],u))}function R(e,t){return _(e,{callstack:[]},t)}function gi(e,t={}){return C("Awaited",[e],t)}function bT(e,t={}){return R({},gi(e,t))}function $p(e,t={}){return C("Evaluate",[e],t)}function Mt(e,t={}){return R({},$p(e,t))}function Dp(e,t={}){return C("Module",[e],t)}function xT(e,t={}){return R({},Dp(e,t))}function RT(...e){let[t,r,o]=re.Match(e,{2:(p,u)=>s.IsString(p)?[{},p,u]:[p,u,{}],3:(p,u,l)=>[p,u,l],1:p=>[{},p,{}]}),i=Iy(r),a=s.IsArray(i)&&s.IsEqual(i.length,2)?_(t,{callstack:[]},i[0]):V();return g.Update(a,{},o)}var n={};bt(n,{Any:()=>Bn,Array:()=>Lt,AsyncIterator:()=>Gt,Awaited:()=>bT,Base:()=>Na,BigInt:()=>Yo,Boolean:()=>wa,Call:()=>CE,Capitalize:()=>ME,Codec:()=>La,Conditional:()=>qE,Constructor:()=>Sr,ConstructorParameters:()=>KE,Cyclic:()=>vt,Decode:()=>ad,DecodeBuilder:()=>Vo,Encode:()=>sd,EncodeBuilder:()=>zo,Enum:()=>Yl,Evaluate:()=>Mt,Exclude:()=>VE,Extends:()=>ze,ExtendsResult:()=>L,Extract:()=>WE,Function:()=>br,Generic:()=>xr,Identifier:()=>Qo,Immutable:()=>Ar,Index:()=>uI,Infer:()=>Ko,InstanceType:()=>II,Instantiate:()=>R,Integer:()=>nn,Interface:()=>yE,Intersect:()=>_t,IsAny:()=>Xe,IsArray:()=>J,IsAsyncIterator:()=>Ye,IsBase:()=>Tt,IsBigInt:()=>ut,IsBoolean:()=>et,IsCall:()=>so,IsCodec:()=>rn,IsConstructor:()=>Ue,IsCyclic:()=>pe,IsEnum:()=>Oe,IsFunction:()=>Ne,IsGeneric:()=>Fn,IsIdentifier:()=>md,IsImmutable:()=>en,IsInfer:()=>he,IsInteger:()=>Me,IsIntersect:()=>U,IsIterator:()=>Qe,IsKind:()=>h,IsLiteral:()=>Y,IsNever:()=>or,IsNull:()=>Ft,IsNumber:()=>ge,IsObject:()=>w,IsOptional:()=>Pe,IsParameter:()=>Ed,IsPromise:()=>qe,IsReadonly:()=>tn,IsRecord:()=>ye,IsRef:()=>se,IsRefine:()=>ka,IsRest:()=>Ur,IsSchema:()=>A,IsString:()=>xe,IsSymbol:()=>Bt,IsTemplateLiteral:()=>Ae,IsThis:()=>_d,IsTuple:()=>K,IsUndefined:()=>Kt,IsUnion:()=>O,IsUnknown:()=>at,IsUnsafe:()=>Sd,IsVoid:()=>dt,Iterator:()=>jt,KeyOf:()=>hI,Literal:()=>H,Lowercase:()=>$E,Mapped:()=>UI,Module:()=>xT,Never:()=>V,NonNullable:()=>kI,Null:()=>Pr,Number:()=>ht,Object:()=>N,Omit:()=>MI,Optional:()=>Ra,Options:()=>ms,Parameter:()=>on,Parameters:()=>GI,Partial:()=>jI,Pick:()=>zI,Promise:()=>qt,Readonly:()=>Pa,ReadonlyType:()=>YI,Record:()=>ja,RecordKey:()=>Qn,RecordKeyAsPattern:()=>lt,RecordValue:()=>He,Ref:()=>be,Refine:()=>pd,Required:()=>IT,Rest:()=>an,ReturnType:()=>_T,Script:()=>RT,String:()=>st,Symbol:()=>zn,TemplateLiteral:()=>hy,This:()=>Fa,Tuple:()=>$e,Uncapitalize:()=>DE,Undefined:()=>Wn,Union:()=>G,Unknown:()=>Fe,Unsafe:()=>Ad,Uppercase:()=>GE,Void:()=>Ba});var uc=["CLUSTER_DB_QUERY_INVALID_CONNECTION_PARAMS","CLUSTER_DB_QUERY_INVALID_CREDENTIALS","CLUSTER_DB_QUERY_PERMISSION_DENIED","CLUSTER_DB_QUERY_QUERY_SYNTAX_ERROR","CLUSTER_DB_QUERY_DATABASE_UNREACHABLE","CLUSTER_DB_QUERY_CONNECTION_FAILED","CLUSTER_DB_QUERY_QUERY_EXECUTION_FAILED","CLUSTER_DB_QUERY_QUERY_TIMEOUT"],Ame=n.Enum(uc),Kk=["CLUSTER_AGGREGATION_STRUCTURE"],Sme=n.Object({code:n.Enum(uc),message:n.String()}),CT=[...uc,...Kk,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","ORG_NOT_FOUND_AUTHENTICATION_ERROR","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],PT=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var zk=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],Vk=[...CT,...PT,...zk],bme=n.Object({code:n.Optional(n.Enum(Vk,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),xme=n.Object({code:n.Optional(n.Enum(CT,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),Rme=n.Object({code:n.Optional(n.Enum(PT,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),Cme=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),Pme=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});var UT="lowercase-email",lc="iana-timezone",dc="simple-time",fc="simple-date-time";var Yk=(e,t)=>RegExp(`^${e.source}(${t.source}${e.source})*$`),Qk=/[a-zA-Z0-9-_]+/,Wk=/\./,Nme=Yk(Qk,Wk);var NT="lowercase-domain";var us="kebab-case";var LT="camel-case";var Zk=new Set;function b(e,t,r={}){let o=t.map(i=>{let a=i;return a.$id?(Zk.add(i),n.Ref(a.$id)):i});return n.Unsafe({...r,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}function pr(e,t){return n.Object({values:n.Array(e,{maxItems:t.maxItems}),exclude:n.Optional(n.Boolean({description:"If true, exclude rows matching these values instead of including them"}))},{description:t.description})}var oe={limit:n.Optional(n.Integer({minimum:1,maximum:1e3,description:"The maximum number of items to return"})),offset:n.Optional(n.Integer({minimum:0,description:"The offset of the first item to return"}))},Xk=n.Object({totalCount:n.Integer({description:"The total number of items matching the query"}),pageCount:n.Integer({description:"The total number of pages available"})}),$me=n.Object({pagination:Xk},{$id:"ResponseMetadata"});function T(e={}){return n.Unsafe({...e,type:"string"})}function m({allowEmpty:e=!0,type:t="short",description:r}={}){let o=e?0:1,i=r===void 0?{}:{description:r};switch(t){case"camel-case":return n.String({format:LT,minLength:o,maxLength:250,...i});case"kebab-case":return n.String({format:us,minLength:o,maxLength:250,...i});case"email":return n.String({format:UT,minLength:o,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...i});case"lowercase-domain":return n.String({format:NT,minLength:o,maxLength:250,...i});case"tsuga-query":return n.String({format:"tsuga-query",minLength:o,maxLength:1e4,...i});case"tags-query":return n.String({format:"tags-query",minLength:o,maxLength:1e4,errorMessage:{format:"Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported. The query you provided is invalid: ${0}"},...i});case"date-time":return n.String({format:"date-time",...i});case"uri":return n.String({format:"uri",...i});case"user-password":return n.String({format:"user-password",minLength:12,maxLength:250,...i});case"long":return n.String({minLength:o,maxLength:5e4,...i});case"short":return n.String({minLength:o,maxLength:250,...i});case"tsuga-formula":return n.String({format:"tsuga-formula",minLength:o,maxLength:250,errorMessage:{format:"Must be a simple mathematical formula, and all variables in it should refer to queries (q1, q2, etc.). The formula you provided is invalid: ${0}"},...i});case"time":return n.String({format:"time",...i});case"readonly-sql-query":return n.String({format:"readonly-sql-query",minLength:o,maxLength:5e4,errorMessage:{format:"Must be a readonly SQL query - only SELECT statements are allowed."},...i});default:Rt(t)}}function d({body:e,description:t,method:r,operationId:o,params:i,tags:a,query:p,paginated:u,response:l,url:f}){return i?{buildUrl:I=>f.replace(/:[a-zA-Z_]+/g,x=>I[x.slice(1)]),method:r,params:i,response:l,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...p===void 0?{}:{query:p},...u===void 0?{}:{paginated:u},...a===void 0?{}:{tags:a}}:{method:r,response:l,url:f,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...p===void 0?{}:{query:p},...u===void 0?{}:{paginated:u},...a===void 0?{}:{tags:a}}}function kT(e,t){if(!t||typeof t!="object")return e;let r=new URLSearchParams;return Object.entries(t).forEach(([o,i])=>{Array.isArray(i)?i.length>0&&i.forEach(a=>{a!==void 0&&(typeof a=="string"||typeof a=="number"||typeof a=="boolean")&&r.append(o,String(a))}):(typeof i=="boolean"||typeof i=="string"||typeof i=="number")&&r.append(o,String(i))}),`${e}?${r.toString()}`}var Jk="x-tsuga-session-id",gc="x-tsuga-source",yc="x-tsuga-source-version",Ec="x-tsuga-source-commit",Ic="x-tsuga-source-date",e0="x-request-id",zme={[Jk]:"Session identifier for request correlation",[gc]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[yc]:"SDK version",[Ec]:"SDK commit hash",[Ic]:"SDK commit date",[e0]:"Unique identifier for this API request, useful for debugging and support"};var un=class e extends Error{constructor(r,o,i,a){super(r);this.statusCode=o;this.code=i;this.requestId=a;this.name="CliError"}static fromErrorResponse(r,o){return new e(r.message,r.statusCode,r.code,o)}};function wT(e){if(e instanceof un){let t=[`Error: ${e.message}`];return e.code&&t.push(`Code: ${e.code}`),e.statusCode&&t.push(`Status: ${e.statusCode}`),e.requestId&&t.push(`Request ID: ${e.requestId}`),t.join(`
34
- `)}return e instanceof Error?`Error: ${e.message}`:String(e)}function MT(e,t,r){return async function(i,a={}){let{body:p,params:u,query:l}=a,f;if(i.url!==void 0)f=i.url;else if(i.buildUrl){if(!u)throw new un("Internal error: params required for this endpoint");f=i.buildUrl(u)}else throw new un("Internal error: endpoint has neither url nor buildUrl");let y=r===void 0?l:{clusterId:r,...l},I=kT(`${e}${f}`,y),x={Accept:"application/json",Authorization:`Bearer ${t}`,[gc]:"cli",[yc]:"1.0.12",[Ec]:"d2d915f",[Ic]:"2026-05-27T08:25:06.947Z"};p&&(x["Content-Type"]="application/json");let fe=await(await fetch(I,{method:i.method,headers:x,body:p?JSON.stringify(p):null})).json();if(fe.error)throw un.fromErrorResponse(fe.error,fe.requestId);return fe.data}}var v=n.Object({success:n.Literal(!0,{description:"Indicates the resource was deleted successfully"})},{$id:"DeleteResponse",example:{success:!0}});var t0=["asset-change","cluster-integration-config","explorer-saved-view","crawler-integration-config","inventory","saml-config","sensitive-data-scanner-rule","service","team-remap-config","user-self","monitor-alert","monitor-debugging","retention-policy","org","allowed-domains","custom-usage-tag"],r0=["ingestion-api-key","operation-api-key","audit-log","dashboard","dashboard-report","inventory-settings","log-route","monitor","notification-integration","notification-rule","notification-silence","quality-report","slo","tag-policy","team","team-members","user-data","user-invitation","user-permissions"],n0=["log","metric","trace"],o0=[...r0,...n0],iue=[...t0,...o0];var ds=["admin","public_editor","public_viewer","teams_only"],lo=["admin","editor","viewer"];var ln="/v0/team-membership",Tc=n.Object({id:n.String(),userId:n.String(),teamId:n.String(),roleKey:n.Enum(lo)}),$T=n.Object({userId:m({allowEmpty:!1}),teamId:m({allowEmpty:!1}),roleKey:n.Enum(lo)}),i0=n.Object({userId:m({allowEmpty:!1}),teamId:m({allowEmpty:!1})}),a0=n.Optional(n.Object({userId:n.Optional(m({allowEmpty:!1})),teamId:n.Optional(m({allowEmpty:!1}))})),aue=d({tags:["access-control"],url:ln,method:"GET",query:a0,response:n.Array(Tc)}),sue=d({tags:["access-control"],url:ln,method:"POST",body:$T,response:Tc}),pue=d({tags:["access-control"],url:ln,method:"PUT",body:$T,response:Tc}),cue=d({tags:["access-control"],url:ln,method:"DELETE",body:i0,response:v}),ls=500,s0=n.Object({teamId:m({allowEmpty:!1}),members:n.Array(n.Object({userId:n.Optional(m({allowEmpty:!1})),userEmail:n.Optional(m({allowEmpty:!1,type:"email"})),roleKey:n.Enum(lo)},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:ls})}),p0=n.Object({results:n.Array(n.Object({userId:n.String(),status:n.Enum(["added","already_member","user_not_found"])}))}),mue=d({tags:["access-control"],url:`${ln}/bulk-add`,method:"POST",body:s0,response:p0}),uue=d({tags:["access-control"],url:`${ln}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:ls}),teamId:m({allowEmpty:!1}),role:n.Enum(lo)}),response:n.Object({})}),c0=n.Object({teamId:m({allowEmpty:!1}),userIds:n.Optional(n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:ls})),userEmails:n.Optional(n.Array(m({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:ls}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}]}),m0=n.Object({results:n.Array(n.Object({userId:n.String(),status:n.Enum(["removed","not_member","user_not_found"])}))}),lue=d({tags:["access-control"],url:`${ln}/bulk-remove`,method:"DELETE",body:c0,response:m0});var fs="/v0/admin",De=`${fs}/clusters`,GT=n.Object({helmParameters:n.Record(n.String(),n.String()),helmVersion:n.String()}),DT=n.Record(n.String(),GT),Oc=["eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3","us-east-1","us-east-2","us-west-1","us-west-2","af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-1","ap-southeast-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ap-southeast-7","ca-central-1","ca-west-1","il-central-1","me-central-1","me-south-1","mx-central-1","sa-east-1"],Ac=["europe-west1","europe-west2","europe-west3","europe-west4","europe-west6","europe-west9","europe-central2","europe-north1","us-central1","us-east1","us-east4","us-west1","us-west2","us-west3","us-west4","northamerica-northeast1","southamerica-east1","asia-east1","asia-east2","asia-northeast1","asia-northeast2","asia-northeast3","asia-south1","asia-south2","asia-southeast1","asia-southeast2","australia-southeast1","australia-southeast2"],Sc=["australiacentral","australiacentral2","australiaeast","australiasoutheast","austriaeast","belgiumcentral","brazilsouth","brazilsoutheast","canadacentral","canadaeast","centralindia","centralus","chilecentral","eastasia","eastus","eastus2","francecentral","francesouth","germanynorth","germanywestcentral","indonesiacentral","israelcentral","italynorth","japaneast","japanwest","jioindiacentral","jioindiawest","koreacentral","koreasouth","malaysiawest","mexicocentral","newzealandnorth","northcentralus","northeurope","norwayeast","norwaywest","polandcentral","qatarcentral","southafricanorth","southafricawest","southcentralus","southeastasia","southindia","spaincentral","swedencentral","switzerlandnorth","switzerlandwest","uaecentral","uaenorth","uksouth","ukwest","westcentralus","westeurope","westindia","westus","westus2","westus3"],vT=["aws","gcp","azure"],Ri=["xs","s","m","l"],bc=["1.0"],u0={id:n.String(),name:n.String(),createdAt:T(),clusterCertificateExpiresAt:T(),bridgeEndpoint:n.String(),deployerEndpoint:n.String(),targetConfiguration:DT,appliedConfiguration:n.Optional(DT),automaticallyDeployLatestVersion:n.Boolean(),automatedDeploymentDisabledBy:n.Optional(n.String()),automatedDeploymentDisabledReason:n.Optional(n.String()),automatedDeploymentDisabledAt:n.Optional(T()),soakTimeMin:n.Optional(n.Number()),clusterSize:n.Optional(n.Enum(Ri))},_c={...u0,orgId:n.String(),orgName:n.String()},Tue=d({tags:["admin"],method:"GET",url:De,query:n.Object({orgId:n.Optional(m())}),response:n.Array(b("clusterType",[n.Object({..._c,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(bc)),clusterRegion:n.Enum(Oc)}),n.Object({..._c,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(Ac)}),n.Object({..._c,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(Sc)})]))}),_ue=d({tags:["admin"],method:"PUT",url:`${De}/create`,body:b("clusterType",[n.Object({clusterType:n.Literal("aws"),orgId:m(),name:m(),clusterSize:n.Enum(Ri),clusterAccountId:n.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:n.Enum(bc),clusterRegion:n.Enum(Oc)}),n.Object({clusterType:n.Literal("gcp"),orgId:m(),name:m(),clusterSize:n.Enum(Ri),clusterAccountId:m(),clusterRegion:n.Enum(Ac)}),n.Object({clusterType:n.Literal("azure"),orgId:m(),name:m(),clusterSize:n.Enum(Ri),clusterTenantId:m(),clusterSubscriptionId:m(),clusterRegion:n.Enum(Sc)})]),response:n.Object({id:n.String(),bridgeEndpoint:n.String(),deployerEndpoint:n.String()})}),hue=d({tags:["admin"],method:"DELETE",url:`${De}/:id`,params:n.Object({id:m()}),body:n.Object({orgId:m()}),response:v}),Oue=d({tags:["admin"],method:"PUT",url:`${De}/add-inbounder-key`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),Aue=d({tags:["admin"],method:"PUT",url:`${De}/replace-all-inbounder-keys`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),Sue=d({tags:["admin"],method:"PUT",url:`${De}/replace-inbounder-key`,body:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKeyToReplace:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),bue=d({tags:["admin"],method:"PUT",url:`${De}/delete-inbounder-key`,body:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKeyToDelete:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyDeleted:n.Boolean()})}),xue=d({tags:["admin"],method:"PUT",url:`${De}/rotate-deployer-key`,body:n.Object({orgId:m(),clusterId:m(),newKey:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyUpdated:n.Boolean()})}),Rue=d({tags:["admin"],method:"PUT",url:`${De}/rotate-bridge-key`,body:n.Object({orgId:m(),clusterId:m(),newKey:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyUpdated:n.Boolean()})}),hc={central:n.String(),ngrokBridgeDomain:n.String(),ngrokDeployerDomain:n.String(),clusterCertificateExpiresAt:T(),clusterName:n.String(),clusterSize:n.Optional(n.Enum(Ri)),secretBridgeAuthenticationKey:n.String(),secretDeployerAuthenticationKey:n.String(),secretOutbounderAuthenticationKey:n.String(),secretMonitoringApiKey:n.String(),slackChannelEmail:n.String()},Cue=d({tags:["admin"],method:"POST",url:`${De}/:id`,body:n.Object({orgId:m()}),params:n.Object({id:m()}),response:b("clusterType",[n.Object({...hc,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(bc)),clusterRegion:n.Enum(Oc)}),n.Object({...hc,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(Ac)}),n.Object({...hc,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(Sc)})])}),Pue=d({tags:["admin"],method:"POST",url:`${De}/configuration`,body:n.Object({id:m(),orgId:m(),installationName:m(),targetConfiguration:GT}),response:n.Object({status:n.String()})}),Uue=d({tags:["admin"],method:"POST",url:`${De}/automation`,body:n.Object({id:m(),orgId:m(),enableAutomatedDeployment:n.Boolean(),disabledReason:n.Optional(m())}),response:n.Object({status:n.String()})}),Nue=d({tags:["admin"],method:"POST",url:`${De}/soak-time`,body:n.Object({id:m(),orgId:m(),soakTimeMin:n.Optional(n.Number())}),response:n.Object({status:n.String()})}),Lue=d({tags:["admin"],method:"POST",url:`${De}/deploy`,body:n.Object({orgId:m(),clusterId:m(),chartName:m(),toVersion:m()}),response:n.Object({id:n.String()})}),l0=b("type",[n.Object({type:n.Literal("pending")}),n.Object({type:n.Literal("running")}),n.Object({type:n.Literal("cancelled")}),n.Object({type:n.Literal("timed_out")}),n.Object({type:n.Literal("success"),stateValue:n.Object({message:n.String()})}),n.Object({type:n.Literal("failure"),stateValue:n.Object({message:n.String()})})]),kue=d({tags:["admin"],method:"GET",url:`${De}/deploy`,query:n.Object({orgId:n.Optional(m()),clusterId:n.Optional(m())}),response:n.Array(n.Object({id:n.String(),orgId:n.String(),orgName:n.String(),clusterId:n.String(),clusterName:n.String(),fromVersion:n.Optional(n.String()),toVersion:n.String(),state:l0,updatedAt:T(),createdAt:T(),installationName:n.String(),chartName:n.String(),isAutomated:n.Boolean(),createdBy:n.Optional(n.String()),createdByName:n.Optional(n.String()),createdByEmail:n.Optional(n.String())}))}),d0=n.Object({installations:n.Array(n.Object({installationName:n.String(),parameters:n.Record(n.String(),n.String()),version:n.Union([n.String(),n.Null()]),resources:n.Array(n.Object({id:n.Object({kind:n.String(),name:n.String()}),status:n.String(),health:n.String(),rawDetails:n.Optional(n.Any()),liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())})),deployedAt:n.Optional(n.String()),syncStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String())}))}),wue=d({tags:["admin"],method:"POST",url:`${De}/status`,body:n.Object({orgId:n.Optional(m()),clusterId:n.Optional(m())}),response:n.Array(n.Object({orgId:n.String(),clusterId:n.String(),status:d0}))}),Mue=d({tags:["admin"],method:"POST",url:`${De}/argocd-cert-info`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({certificateExpiresAt:n.String()})}),f0=n.Object({kind:n.String(),name:n.String()}),g0=n.Object({id:f0,liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())}),$ue=d({tags:["admin"],method:"POST",url:`${De}/resource-details`,body:n.Object({orgId:m(),clusterId:m(),installationName:m()}),response:n.Object({resources:n.Array(g0)})}),Due=d({tags:["admin"],method:"GET",url:`${De}/versions`,query:n.Object({chartName:n.Optional(m())}),response:n.Array(n.Object({id:n.String(),chartName:n.String(),locator:n.String(),version:n.String(),repositoryArn:n.String(),type:n.Optional(n.String()),commitHash:n.Optional(n.String()),lastPulledAt:n.Optional(T()),pushedAt:n.Optional(T())}))}),y0=n.Object({id:n.Object({name:n.String(),kind:n.String()}),previewManifest:n.Optional(n.String())}),Gue=d({tags:["admin"],method:"POST",url:`${De}/versions/render`,body:n.Object({chartName:m(),version:m(),values:m({type:"long"}),installationName:m(),namespace:m()}),response:n.Array(y0)}),cr=`${fs}/orgs`,vue=d({tags:["admin"],url:cr,method:"GET",query:n.Object({onlyDeleted:n.Optional(n.Boolean())}),response:n.Array(n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String()),createdAt:T(),updatedAt:T()}))}),jue=d({tags:["admin"],url:cr,method:"POST",body:n.Object({emailDomains:n.Array(m({type:"lowercase-domain"}),{maxItems:20}),name:m()}),response:n.Object({id:n.String(),name:n.String()})}),Fue=d({tags:["admin"],url:`${cr}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Object({allowedDomains:n.Optional(n.Array(m({type:"lowercase-domain"}),{maxItems:20}))}),response:n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String())})}),Bue=d({tags:["admin"],url:`${cr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),que=d({tags:["admin"],url:`${cr}/:id/restore`,method:"POST",params:n.Object({id:m()}),response:n.Object({success:n.Boolean()})}),Hue=d({tags:["admin"],url:`${cr}/:id/permanent-delete`,method:"DELETE",params:n.Object({id:m()}),response:n.Object({success:n.Boolean(),hasDeletedSecret:n.Boolean(),hasDeletedTenantDb:n.Boolean(),hasDeletedOrgRow:n.Boolean()})}),Kue=d({tags:["admin"],url:`${cr}/synchronize-sds-rules`,method:"POST",response:n.Object({errorOrgs:n.Optional(n.Array(n.Object({id:n.String(),name:n.String()}))),synchronizedOrgsCount:n.Number()})}),E0=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],I0=n.Enum(E0),zue=d({tags:["admin"],url:`${cr}/refresh-assets`,method:"POST",body:n.Object({assetTypes:n.Array(I0,{minItems:1}),orgId:n.Optional(m({allowEmpty:!1}))}),response:n.Array(n.Object({orgId:n.String(),orgName:n.String(),results:n.Record(n.String(),n.Object({success:n.Boolean()}))}))}),Vue=d({tags:["admin"],url:`${cr}/sudo`,method:"POST",body:n.Object({orgId:m()}),response:n.Object({sudoToken:n.String()})}),T0=`${fs}/users`,Yue=d({tags:["admin"],url:`${T0}/invite`,method:"POST",body:n.Object({email:m({type:"email"}),orgId:m(),userRole:n.Enum(ds)}),response:n.Array(n.Object({inviteId:n.String(),email:n.String(),result:n.Union([n.Literal("success"),n.Literal("email-failed")])}))});var Que=d({tags:["admin"],url:`${fs}/billing-data`,method:"GET",query:n.Object({orgId:m(),maxDaysFetched:n.Optional(n.Number({minimum:1,maximum:365}))}),response:n.Object({dataPoints:n.Array(n.Object({date:n.String(),telemetryKind:n.Union([n.Literal("logs"),n.Literal("metrics"),n.Literal("traces")]),totalBytes:n.Number(),clusterId:n.String(),apiKeyId:n.String(),apiKeyName:n.String(),teamName:n.String()})),availableFilters:n.Object({clusters:n.Array(n.Object({id:n.String(),name:n.String()})),apiKeys:n.Array(n.Object({id:n.String(),name:n.String()})),teamNames:n.Array(n.String())})})});var jT=n.Object({id:n.String({description:"Unique identifier of the Tsuga cluster containing your observability data"}),name:n.String({description:"Internal name of the Tsuga cluster"}),friendlyName:n.Optional(n.String({description:"Human-readable display name set by an operator"})),clusterType:n.Enum(vT,{description:"Cloud provider hosting the Tsuga cluster"}),clusterRegion:n.String({description:"Region where the Tsuga cluster is deployed"})},{$id:"Cluster",description:"A Tsuga cluster containing your observability data"}),_0={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(jT,{examples:[_0]});var FT=d({description:"Retrieve all clusters",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:n.Array(jT)});function Wt(e){process.stdout.write(`${e}
35
- `)}function ae(e){Wt(JSON.stringify(e,null,2))}var BT=["json","tsv","csv"];function qT(e){let t=BT.find(r=>r===e);if(t!==void 0)return t;throw new Error(`--output must be one of: ${BT.join(", ")} (got: ${e})`)}function HT(e){let t=e.split(",").map(r=>r.trim()).filter(r=>r.length>0);if(t.length===0)throw new Error("--fields must contain at least one field name");return t}function KT(e,t){let r=e;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function zT(e,t){let r=Object.create(null);for(let o of t){let i=KT(e,o);if(i===void 0)continue;let a=o.split("."),p=a.pop();if(p===void 0)continue;let u=r;for(let l of a)(typeof u[l]!="object"||u[l]===null)&&(u[l]=Object.create(null)),u=u[l];u[p]=i}return r}function VT(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var h0={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function O0(e){let t=VT(e);return t===null?"":t.replace(/[\\\t\r\n]/g,r=>h0[r]??r)}function A0(e){let t=VT(e);return t===null?"":/[,"\n\r]/.test(t)?`"${t.replaceAll('"','""')}"`:t}function YT(e,t,r){if(t.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?A0:O0,a=r.map(u=>i(u)).join(o),p=t.map(u=>r.map(l=>i(KT(u,l))).join(o));return[a,...p].join(`
36
- `)}function QT(e,t){e.command("cluster").description("Manage Tsuga cluster selection. A Tsuga cluster contains your observability data.").command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await t()(FT);ae(o)})}var WT=`/${"v1"}/docs`,ZT=n.Object({path:n.String(),title:n.String(),content:n.String({description:"Raw markdown content of the documentation page"})},{$id:"DocPage",description:"A documentation page with its raw markdown content"}),S0={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
37
- ...`};Object.assign(ZT,{examples:[S0]});var XT=n.Object({path:n.String(),title:n.String(),score:n.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:n.String({description:"Short snippet of matching content"}),link:n.String({description:"URL to the documentation page in the Tsuga app"})},{$id:"DocSearchResult",description:"A documentation search result"}),b0={path:"getting-started/send-your-first-logs",title:"Send your first logs",score:.9,excerpt:"...send your first logs to Tsuga using the ingestion API...",link:"https://www.app.tsuga.com/documentation/getting-started/send-your-first-logs"};Object.assign(XT,{examples:[b0]});var JT=d({description:"Retrieve the raw markdown content of a documentation page by its path",operationId:"getDocPage",tags:["docs"],url:WT,method:"GET",query:n.Object({path:m({allowEmpty:!1})}),response:ZT}),e_=d({description:"Full-text search across documentation pages",operationId:"searchDocs",tags:["docs"],url:`${WT}/search`,method:"GET",query:n.Object({query:m({allowEmpty:!1})}),response:n.Array(XT)});function t_(e,t){let r=e.command("docs").description("Browse and search documentation");r.command("get <path>").description("Get a documentation page by path (e.g. 'getting-started/send-your-first-logs')").action(async o=>{let i=await t()(JT,{query:{path:o}});ae(i)}),r.command("search <query>").description("Search documentation pages").action(async o=>{let i=await t()(e_,{query:{query:o}});ae(i)})}var n_=1456444800,o_=4927737600,x0=n_*1e3,R0=o_*1e3,gs=1704067200,xc=gs*1e3,i_={title:"TimeRange",description:"Time range to query",examples:[{from:gs,to:gs}]},a_={title:"TimeRange",description:"Time range to query",examples:[{from:xc,to:xc}]},ys=e=>n.Integer({description:e,examples:[gs],minimum:n_,maximum:o_,format:"int64"}),r_=e=>n.Integer({description:e,examples:[xc],minimum:x0,maximum:R0,format:"int64"}),gt=n.Object({from:n.Optional(ys("Start timestamp in seconds")),to:n.Optional(ys("End timestamp in seconds"))},i_),yt=n.Object({from:ys("Start timestamp in seconds"),to:ys("End timestamp in seconds")},i_),yle=n.Object({from:n.Integer({description:"Start timestamp in milliseconds"}),to:n.Integer({description:"End timestamp in milliseconds"})},a_),s_=n.Object({from:r_("Start timestamp in milliseconds"),to:r_("End timestamp in milliseconds")},a_);var Tle=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));var Ple=60*1e3;var ude=1/1e6,k0=1e3,w0=60*k0,M0=60*w0,Is=24*M0,lde=7*Is,dde=30*Is;var Cc=["past-5-minutes","past-15-minutes","past-30-minutes","past-1-hour","past-2-hours","past-4-hours","past-6-hours","past-12-hours","past-24-hours","past-2-days","past-3-days","past-7-days","past-30-days","past-3-months","current-day","current-week","current-month","current-year","previous-day","previous-week","previous-month","previous-3-months","previous-year"];var $0={s:1,m:60,h:3600,d:86400};function c_(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<48||r>57)return!1}return!0}function m_(){return Math.floor(Date.now()/1e3)}function Ts(e){if(typeof e=="number")return e;if(e==="now")return m_();if(e.startsWith("-")&&e.length>=3){let r=e.at(-1),o=r?$0[r]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&c_(i))return m_()-parseInt(i,10)*o}}if(c_(e)&&e.length>0)return parseInt(e,10);let t=Date.parse(e);if(!Number.isNaN(t))return Math.floor(t/1e3);throw new Error(`Invalid time value: ${e}. Use unix seconds, relative (-30m, -1h), 'now', or ISO 8601.`)}var u_=n.Object({type:n.Literal("number"),number:n.String()}),D0=n.Object({type:n.Literal("string"),string:n.String()}),G0=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),Pc=b("type",[u_,D0,G0]),v0=n.Object({by:n.Record(n.String(),Pc),computed:n.Record(n.String(),u_)}),j0=n.Object({type:n.Literal("buckets"),buckets:n.Array(v0)}),F0=n.Object({type:n.Literal("distribution"),bounds:n.Array(n.Number()),buckets:n.Array(n.Object({timestamp:n.Number(),counts:n.Array(n.Number())})),percentiles:n.Optional(n.Array(n.Number()))}),l_=b("type",[j0,F0]);var B0="/v0/aggregation",q0=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),H0=n.Object({parallelism:n.Number(),engine:q0,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),$t=["logs","metrics","traces"],K0={logs:"Logs",metrics:"Metrics",traces:"Traces"},z0=[...$t,"connections","log-patterns"],Cde={...K0,connections:"Connections","log-patterns":"Log Patterns"},Pde=n.Enum(z0,{description:"Data source being queried"}),Fr=n.Enum($t,{description:"Data source being queried for this aggregation"}),dn=n.String({description:"Attribute containing the values to aggregate"}),fn=m({description:"Attribute containing the values to aggregate"}),V0=b("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(dn)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:dn},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:dn},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:dn},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:dn},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:dn},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:dn,percentile:n.Number()},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate"}),Y0=b("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(fn)},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:fn},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:fn},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:fn},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:fn},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:fn},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:fn,percentile:n.Number()},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate"}),g_=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),y_=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),E_=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),I_=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),T_=n.Object({type:n.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),__=n.Object({type:n.Literal("power",{description:"Raises values to a specified power"}),exponent:n.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),h_=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),O_=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),Q0=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:n.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),W0=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:m({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),Z0=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),X0=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),J0=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),ew=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),tw=b("type",[g_,y_,E_,I_,T_,Q0,Z0,__,h_,O_,J0],{title:"Function"}),rw=b("type",[g_,y_,E_,I_,T_,W0,X0,__,h_,O_,ew],{title:"InputFunction"});var d_=n.Object({min:n.Number(),max:n.Number()}),f_=n.Integer({minimum:1}),nw=b("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:m({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(m()),bucketCount:n.Optional(f_),bounds:n.Optional(d_),percentiles:n.Optional(n.Array(n.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:m({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(m()),bucketCount:n.Optional(f_),bounds:n.Optional(d_)},{title:"Heatmap",description:"Returns a distribution per time window"})]),Uc=15,ow=["zero","null"],iw=n.Enum(ow),A_=n.Object({mode:n.Object({type:iw})}),S_={aggregate:V0,functions:n.Optional(n.Array(tw,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(A_)},b_={aggregate:Y0,functions:n.Optional(n.Array(rw,{maxItems:10,description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(A_)},aw={description:"Aggregations that may be combined together in the same query"},x_={maxItems:Uc,description:"Aggregations that may be combined together in the same query"},R_=n.Array(n.Object({...S_,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),aw),Ci=n.Array(n.Object({...b_,filter:n.Optional(m({type:"tsuga-query",description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),x_),fo=n.Array(n.Object({...S_,filter:n.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery"})),go=n.Array(n.Object({...b_,filter:m({type:"tsuga-query"})},{title:"MonitorAggregationQuery"}),x_);var C_=n.String({description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),Pi=m({type:"tsuga-formula",description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),sw=n.Object({fields:n.Array(n.String()),limit:n.Number()},{title:"AggregationGroupBy"}),pw=n.Object({fields:n.Array(m(),{maxItems:1}),limit:n.Number()},{title:"AggregationGroupBy"}),cw=7;var Nc=n.Array(sw,{description:"Fields used to group the results"}),yo=n.Array(pw,{maxItems:cw,description:"Fields used to group the results"}),Ude=d({tags:["aggregation"],url:`${B0}/multi-query`,method:"POST",body:n.Object({timeRange:s_,queries:Ci,groupBy:n.Optional(yo),returnType:nw,dataSource:Fr,formula:Pi,executionOptions:H0,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(m({allowEmpty:!1}))}),response:l_}),mw=["per-second","per-minute","per-hour","rate"],gn=n.Enum(mw),Nde=b("type",[n.Object({type:n.Literal("count"),count:n.Object({field:n.Optional(m()),timeNormalization:n.Optional(gn)})}),n.Object({type:n.Literal("average"),average:n.Object({field:m(),timeNormalization:n.Optional(gn)})}),n.Object({type:n.Literal("min"),min:n.Object({field:m(),timeNormalization:n.Optional(gn)})}),n.Object({type:n.Literal("max"),max:n.Object({field:m(),timeNormalization:n.Optional(gn)})}),n.Object({type:n.Literal("sum"),sum:n.Object({field:m(),timeNormalization:n.Optional(gn)})}),n.Object({type:n.Literal("percentile"),percentile:n.Object({field:m(),percentile:n.Number(),timeNormalization:n.Optional(gn)})}),n.Object({type:n.Literal("uniqueCount"),uniqueCount:n.Object({field:m(),timeNormalization:n.Optional(gn)})})]),uw=n.Object({type:n.Literal("time"),time:n.Object({interval:m()})}),lw=n.Object({type:n.Literal("histogram"),histogram:n.Object({field:m(),interval:n.Number(),bounds:n.Optional(n.Object({min:n.Number(),max:n.Number()}))})}),dw=n.Object({type:n.Literal("topList"),topList:n.Object({field:m(),size:n.Number(),orderBy:n.Optional(n.Object({computeRef:m(),order:n.Union([n.Literal("asc"),n.Literal("desc")])}))})}),Lde=b("type",[uw,lw,dw]);var P_=`/${"v1"}/aggregation`,U_=n.Object({id:n.String({description:'Query identifier (q1, q2, ...) or "formula" for formula'}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values"})}),fw={results:[{id:"q1",group:{host:"server-1"},value:123.45}]},N_=n.Object({results:n.Array(n.Object({...U_.properties,value:n.Number({description:"Aggregated value"})},{title:"ScalarResult"}),{description:"Aggregated results per query and group"})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with single values"});Object.assign(N_,{examples:[fw]});var gw={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]},_s=n.Object({series:n.Array(n.Object({...U_.properties,points:n.Array(n.Object({timestamp:n.Integer({description:"Timestamp in milliseconds"}),value:n.Number({description:"Value"})}),{description:"Array of data points"})},{title:"Series"}),{description:"Time series data per query and group"})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with points over time"});Object.assign(_s,{examples:[gw]});var L_={timeRange:yt,queries:n.Array(n.Omit(Ci.items,["fill"],{title:"AggregationQuery"}),{maxItems:Uc,description:"Aggregations that may be combined together in the same query"}),groupBy:n.Optional(yo),dataSource:Fr,formula:n.Optional(Pi),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))},yw=n.Object(L_),k_=d({description:"Run aggregation queries and return scalar results",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${P_}/multi-query/scalar`,method:"POST",body:yw,response:N_}),Ew=n.Object({...L_,aggregationWindow:m({description:'Time bucket size for aggregation (e.g. "10s", "1m", "1h")'})}),w_=d({description:"Run aggregation queries and return timeseries results",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${P_}/multi-query/timeseries`,method:"POST",body:Ew,response:_s});var Iw=`/${"v1"}/promql`,Tw=n.Object({query:m({allowEmpty:!1,description:"PromQL query string"}),timeRange:yt,step:m({allowEmpty:!1,description:'Resolution step (e.g. "15s", "1m")'}),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),M_=d({description:"Run a PromQL query and return timeseries results. Experimental: shape and behavior may change.",operationId:"queryPromql",tags:["public","promql"],url:Iw,method:"POST",body:Tw,response:_s});function _w(e){return s.IsObject(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"errors")&&s.IsFunction(e.check)&&s.IsFunction(e.errors)}function Lc(e){return s.HasPropertyKey(e,"~guard")&&_w(e["~guard"])}function kc(e){return s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>s.IsObject(t)&&s.HasPropertyKey(t,"refine")&&s.HasPropertyKey(t,"message")&&s.IsFunction(t.refine)&&s.IsString(t.message))}function mr(e){return s.IsObject(e)&&!s.IsArray(e)}function hs(e){return s.IsBoolean(e)}function D(e){return mr(e)||hs(e)}function wc(e){return s.HasPropertyKey(e,"additionalItems")&&D(e.additionalItems)}function ur(e){return s.HasPropertyKey(e,"additionalProperties")&&D(e.additionalProperties)}function Mc(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(t=>D(t))}function Ui(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function $c(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(t=>D(t))}function Dc(e){return s.HasPropertyKey(e,"const")}function yn(e){return s.HasPropertyKey(e,"contains")&&D(e.contains)}function Ot(e){return s.HasPropertyKey(e,"default")}function Gc(e){return s.HasPropertyKey(e,"dependencies")&&s.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>D(t)||s.IsArray(t)&&t.every(r=>s.IsString(r)))}function vc(e){return s.HasPropertyKey(e,"dependentRequired")&&s.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>s.IsArray(t)&&t.every(r=>s.IsString(r)))}function jc(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>D(t))}function Fc(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function Bc(e){return s.HasPropertyKey(e,"else")&&D(e.else)}function qc(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function Hc(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function lr(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function Ni(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function En(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function Kc(e){return s.HasPropertyKey(e,"if")&&D(e.if)}function Eo(e){return s.HasPropertyKey(e,"items")&&(D(e.items)||s.IsArray(e.items)&&e.items.every(t=>D(t)))}function zc(e){return Eo(e)&&s.IsArray(e.items)}function Vc(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function Yc(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function Os(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function Qc(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function Wc(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function dr(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function In(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function Io(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function Li(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function ki(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function Zc(e){return s.HasPropertyKey(e,"multipleOf")&&(s.IsNumber(e.multipleOf)||s.IsBigInt(e.multipleOf))}function Xc(e){return s.HasPropertyKey(e,"not")&&D(e.not)}function Jc(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(t=>D(t))}function wi(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function Mi(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>D(t))}function To(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(t=>D(t))}function $i(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(t=>D(t))}function em(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||D(e.propertyNames))}function hw(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function As(e){return hw(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function tm(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function rm(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function Tn(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(t=>s.IsString(t))}function nm(e){return s.HasPropertyKey(e,"then")&&D(e.then)}function om(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(t=>s.IsString(t)))}function _o(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function Ss(e){return s.HasPropertyKey(e,"unevaluatedItems")&&D(e.unevaluatedItems)}function bs(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&D(e.unevaluatedProperties)}var rt=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(t){return this.indices.add(t),!0}AddKey(t){return this.keys.add(t),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(t){for(let r of t)r.indices.forEach(o=>this.indices.add(o)),r.keys.forEach(o=>this.keys.add(o));return!0}},Di=class extends rt{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}},Ge=class extends Di{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}};var Ow="external_",Aw=0,EEe={identifier:`${Ow}${Aw}`,variables:[]};function $_(e,t,r,o){return r["~guard"].check(o)}function D_(e,t,r,o,i,a){return i["~guard"].check(a)||t.AddError({keyword:"~guard",schemaPath:r,instancePath:o,params:{errors:i["~guard"].errors(a)}})}function G_(e,t,r,o){return s.Every(r["~refine"],0,(i,a)=>i.refine(o))}function v_(e,t,r,o,i,a){return s.EveryAll(i["~refine"],0,(p,u)=>p.refine(a)||t.AddError({keyword:"~refine",schemaPath:r,instancePath:o,params:{index:u,message:p.message}}))}function j_(e){return Eo(e)&&s.IsArray(e.items)}function F_(e,t,r,o){return j_(r)?o.every((a,p)=>s.IsLessThan(p,r.items.length)||$(e,t,r.additionalItems,a)&&t.AddIndex(p)):!0}function B_(e,t,r,o,i,a){return j_(i)?a.every((u,l)=>{let f=`${r}/additionalItems`,y=`${o}/${l}`;return s.IsLessThan(l,i.items.length)||z(e,t,f,y,i.additionalItems,u)&&t.AddIndex(l)}):!0}function Sw(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function q_(e){let t=[];return Mi(e)&&t.push(...s.Keys(e.patternProperties)),$i(e)&&t.push(...s.Keys(e.properties).map(Sw)),s.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function H_(e,t,r,o){let i=new RegExp(q_(r));return s.Every(s.Keys(o),0,(p,u)=>i.test(p)||$(e,t,r.additionalProperties,o[p])&&t.AddKey(p))}function K_(e,t,r,o,i,a){let p=new RegExp(q_(i)),u=[];return s.EveryAll(s.Keys(a),0,(f,y)=>{let I=`${r}/additionalProperties`,x=`${o}/${f}`,_e=new Ge,fe=p.test(f)||z(e,_e,I,x,i.additionalProperties,a[f])&&t.AddKey(f);return fe||u.push(f),fe})||t.AddError({keyword:"additionalProperties",schemaPath:r,instancePath:o,params:{additionalProperties:u}})}function z_(e,t,r,o){let i=r.allOf.reduce((a,p)=>{let u=new rt;return $(e,u,p,o)?[...a,u]:a},[]);return s.IsEqual(i.length,r.allOf.length)&&t.Merge(i)}function V_(e,t,r,o,i,a){let p=[],u=i.allOf.reduce((f,y,I)=>{let x=`${r}/allOf/${I}`,_e=new Ge,fe=z(e,_e,x,o,y,a);return fe||p.push(_e),fe?[...f,_e]:f},[]),l=s.IsEqual(u.length,i.allOf.length)&&t.Merge(u);return l||p.forEach(f=>f.GetErrors().forEach(y=>t.AddError(y))),l}function Y_(e,t,r,o){let i=r.anyOf.reduce((a,p,u)=>{let l=new rt;return $(e,l,p,o)?[...a,l]:a},[]);return s.IsGreaterThan(i.length,0)&&t.Merge(i)}function Q_(e,t,r,o,i,a){let p=[],u=i.anyOf.reduce((f,y,I)=>{let x=new Ge,_e=`${r}/anyOf/${I}`,fe=z(e,x,_e,o,y,a);return fe||p.push(x),fe?[...f,x]:f},[]),l=s.IsGreaterThan(u.length,0)&&t.Merge(u);return l||p.forEach(f=>f.GetErrors().forEach(y=>t.AddError(y))),l||t.AddError({keyword:"anyOf",schemaPath:r,instancePath:o,params:{}})}function am(e,t,r,o){return r}function W_(e,t,r,o,i,a){return am(e,t,i,a)||t.AddError({keyword:"boolean",schemaPath:r,instancePath:o,params:{}})}function sm(e,t,r,o){return s.IsValueLike(r.const)?s.IsEqual(o,r.const):s.IsDeepEqual(o,r.const)}function Z_(e,t,r,o,i,a){return sm(e,t,i,a)||t.AddError({keyword:"const",schemaPath:r,instancePath:o,params:{allowedValue:i.const}})}function bw(e){return!(In(e)&&s.IsEqual(e.minContains,0))}function pm(e,t,r,o){return bw(r)?!s.IsEqual(o.length,0)&&o.some(i=>$(e,t,r.contains,i)):!0}function X_(e,t,r,o,i,a){return pm(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:1}})}function J_(e,t,r,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(r.dependencies),0,([p,u])=>!s.HasPropertyKey(o,p)||(s.IsArray(u)?u.every(l=>s.HasPropertyKey(o,l)):$(e,t,u,o)));return i||a}function eh(e,t,r,o,i,a){let p=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependencies),0,([l,f])=>{let y=`${r}/dependencies/${l}`;return!s.HasPropertyKey(a,l)||(s.IsArray(f)?f.every(I=>s.HasPropertyKey(a,I)||t.AddError({keyword:"dependencies",schemaPath:r,instancePath:o,params:{property:l,dependencies:f}})):z(e,t,y,o,f,a))});return p||u}function th(e,t,r,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(r.dependentRequired),0,([p,u])=>!s.HasPropertyKey(o,p)||u.every(l=>s.HasPropertyKey(o,l)));return i||a}function rh(e,t,r,o,i,a){let p=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependentRequired),0,([l,f])=>!s.HasPropertyKey(a,l)||s.EveryAll(f,0,y=>s.HasPropertyKey(a,y)||t.AddError({keyword:"dependentRequired",schemaPath:r,instancePath:o,params:{property:l,dependencies:f}})));return p||u}function nh(e,t,r,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(r.dependentSchemas),0,([p,u])=>!s.HasPropertyKey(o,p)||$(e,t,u,o));return i||a}function oh(e,t,r,o,i,a){let p=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependentSchemas),0,([l,f])=>{let y=`${r}/dependentSchemas/${l}`;return!s.HasPropertyKey(a,l)||z(e,t,y,o,f,a)});return p||u}function cm(e,t,r,o){return r.enum.some(i=>s.IsValueLike(i)?s.IsEqual(o,i):s.IsDeepEqual(o,i))}function ih(e,t,r,o,i,a){return cm(e,t,i,a)||t.AddError({keyword:"enum",schemaPath:r,instancePath:o,params:{allowedValues:i.enum}})}function mm(e,t,r,o){return s.IsLessThan(o,r.exclusiveMaximum)}function ah(e,t,r,o,i,a){return mm(e,t,i,a)||t.AddError({keyword:"exclusiveMaximum",schemaPath:r,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function um(e,t,r,o){return s.IsGreaterThan(o,r.exclusiveMinimum)}function sh(e,t,r,o,i,a){return um(e,t,i,a)||t.AddError({keyword:"exclusiveMinimum",schemaPath:r,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var Oo={};bt(Oo,{Clear:()=>ch,Entries:()=>Hw,Get:()=>Vw,Has:()=>zw,IsDate:()=>Gi,IsDateTime:()=>lm,IsDuration:()=>dm,IsEmail:()=>fm,IsHostname:()=>gm,IsIPv4:()=>Tm,IsIPv6:()=>_m,IsIdnEmail:()=>ym,IsIdnHostname:()=>Im,IsIri:()=>Om,IsIriReference:()=>hm,IsJsonPointer:()=>Sm,IsJsonPointerUriFragment:()=>Am,IsRegex:()=>bm,IsRelativeJsonPointer:()=>xm,IsTime:()=>vi,IsUri:()=>Pm,IsUriReference:()=>Rm,IsUriTemplate:()=>Cm,IsUrl:()=>Um,IsUuid:()=>Nm,Reset:()=>mh,Set:()=>Kw,Test:()=>Yw});var xw=[0,31,28,31,30,31,30,31,31,30,31,30,31],Rw=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Cw(e){return e%4===0&&(e%100!==0||e%400===0)}function Gi(e){let t=Rw.exec(e);if(!t)return!1;let r=+t[1],o=+t[2],i=+t[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&Cw(r)?29:xw[o])}var Pw=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function vi(e,t=!0){let r=Pw.exec(e);if(!r)return!1;let o=+r[1],i=+r[2],a=+r[3],p=r[4]==="-"?-1:1,u=+(r[5]||0),l=+(r[6]||0);if(u>23||l>59||t&&!r[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&a<60)return!0;let f=i-l*p,y=o-u*p-(f<0?1:0);return(y===23||y===-1)&&(f===59||f===-1)&&a<61}function lm(e,t=!0){let r=e.split(/T/i);return r.length===2&&Gi(r[0])&&vi(r[1],t)}var Uw=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function dm(e){return Uw.test(e)}var Nw=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[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;function fm(e){return Nw.test(e)}var Lw=/^(?=.{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;function gm(e){return Lw.test(e)}var kw=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function ym(e){return kw.test(e)}function Em(e){let t=e.codePointAt(0);return t===void 0?!1:t>=12352&&t<=12447||t>=12448&&t<=12543&&t!==12539||t>=19968&&t<=40959}function Im(e){if(e.length===0||e.includes(" "))return!1;let t=/[\u002E\u3002\uFF0E\uFF61]/g,r=e.normalize("NFC").replace(t,".");if(r.length>253)return!1;let o=r.split(".");if(o.some(i=>i.length===0))return!1;for(let i of o){if(i.length>63||i.startsWith("-")||i.endsWith("-"))return!1;if(/^xn--/i.test(i)){let l=i.slice(4);if(l.length<2||l.includes("---"))return!1;continue}if(/[\u302E\u302F\u3031\u3032\u3033\u3034\u3035\u303B\u0640\u07FA]/.test(i))return!1;let a=i.charAt(0);if(/[\u0903\u0300\u0488]/.test(a))return!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);if(f==="\xB7"){if(l===0||l===i.length-1)return!1;let y=i.charAt(l-1),I=i.charAt(l+1);if(!/^[lL]$/.test(y)||!/^[lL]$/.test(I))return!1}if(f==="\u30FB"){if(i.length===1)return!1;if(l===0){let y=i.charAt(l+1);if(!Em(y))return!1}else{let y=i.charAt(l-1),I=i.charAt(l+1);if(!Em(y)||!Em(I))return!1}}if(f==="\u0375"){if(l===i.length-1)return!1;let y=i.charAt(l+1);if(!/[\u0370-\u03FF]/.test(y))return!1}if(f==="\u05F3"||f==="\u05F4"){if(l===0)return!1;let y=i.charAt(l-1);if(!/[\u05D0-\u05EA]/.test(y))return!1}if(f==="\u200D"&&(l===0||i.charAt(l-1)!=="\u094D"))return!1}let p=!1,u=!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);/[\u0660-\u0669]/.test(f)&&(p=!0),/[\u06F0-\u06F9]/.test(f)&&(u=!0)}if(p&&u)return!1}return!0}var ww=/^(?:(?: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)$/;function Tm(e){return ww.test(e)}var Mw=/^((([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;function _m(e){return Mw.test(e)}function ph(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function hm(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;let t=e.indexOf(":");return t>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,t))?ph(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:ph(e)}function Om(e){try{return new URL(e),!0}catch{return!1}}var $w=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function Am(e){return $w.test(e)}var Dw=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function Sm(e){return Dw.test(e)}function bm(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var Gw=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function xm(e){return Gw.test(e)}var vw=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function Rm(e){return vw.test(e)}var jw=/^(?:(?:[^\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;function Cm(e){return jw.test(e)}var Fw=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function Pm(e){return Fw.test(e)}var Bw=/^(?: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;function Um(e){return Bw.test(e)}var qw=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Nm(e){return qw.test(e)}var ue=new Map;function ch(){ue.clear()}function Hw(){return[...ue.entries()]}function Kw(e,t){ue.set(e,t)}function zw(e){return ue.has(e)}function Vw(e){return ue.get(e)}function Yw(e,t){return ue.get(e)?.(t)??!0}function mh(){ch(),ue.set("date-time",lm),ue.set("date",Gi),ue.set("duration",dm),ue.set("email",fm),ue.set("hostname",gm),ue.set("idn-email",ym),ue.set("idn-hostname",Im),ue.set("ipv4",Tm),ue.set("ipv6",_m),ue.set("iri-reference",hm),ue.set("iri",Om),ue.set("json-pointer-uri-fragment",Am),ue.set("json-pointer",Sm),ue.set("regex",bm),ue.set("relative-json-pointer",xm),ue.set("time",vi),ue.set("uri-reference",Rm),ue.set("uri-template",Cm),ue.set("uri",Pm),ue.set("url",Um),ue.set("uuid",Nm)}mh();function Lm(e,t,r,o){return Oo.Test(r.format,o)}function uh(e,t,r,o,i,a){return Lm(e,t,i,a)||t.AddError({keyword:"format",schemaPath:r,instancePath:o,params:{format:i.format}})}function lh(e,t,r,o){let i=nm(r)?r.then:!0,a=Bc(r)?r.else:!0;return $(e,t,r.if,o)?$(e,t,i,o):$(e,t,a,o)}function dh(e,t,r,o,i,a){let p=nm(i)?i.then:!0,u=Bc(i)?i.else:!0,l=new Ge,f=z(e,l,`${r}/if`,o,i.if,a)?z(e,l,`${r}/then`,o,p,a)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"then"}}):z(e,t,`${r}/else`,o,u,a)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"else"}});return f&&t.Merge([l]),f}function Qw(e,t,r,o){return s.Every(r.items,0,(i,a)=>s.IsLessEqualThan(o.length,a)||$(e,t,i,o[a])&&t.AddIndex(a))}function Ww(e,t,r,o,i,a){return s.EveryAll(i.items,0,(p,u)=>{let l=`${r}/items/${u}`,f=`${o}/${u}`;return s.IsLessEqualThan(a.length,u)||z(e,t,l,f,p,a[u])&&t.AddIndex(u)})}function Zw(e,t,r,o){let i=To(r)?r.prefixItems.length:0;return s.Every(o,i,(a,p)=>$(e,t,r.items,a)&&t.AddIndex(p))}function Xw(e,t,r,o,i,a){let p=To(i)?i.prefixItems.length:0;return s.EveryAll(a,p,(u,l)=>{let f=`${r}/items`,y=`${o}/${l}`;return z(e,t,f,y,i.items,u)&&t.AddIndex(l)})}function fh(e,t,r,o){return zc(r)?Qw(e,t,r,o):Zw(e,t,r,o)}function gh(e,t,r,o,i,a){return zc(i)?Ww(e,t,r,o,i,a):Xw(e,t,r,o,i,a)}function Jw(e){return yn(e)}function km(e,t,r,o){if(!Jw(r))return!0;let i=o.reduce((a,p)=>$(e,t,r.contains,p)?++a:a,0);return s.IsLessEqualThan(i,r.maxContains)}function yh(e,t,r,o,i,a){let p=In(i)?i.minContains:1;return km(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:p,maxContains:i.maxContains}})}function wm(e,t,r,o){return s.IsLessEqualThan(o,r.maximum)}function Eh(e,t,r,o,i,a){return wm(e,t,i,a)||t.AddError({keyword:"maximum",schemaPath:r,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function Mm(e,t,r,o){return s.IsLessEqualThan(o.length,r.maxItems)}function Ih(e,t,r,o,i,a){return Mm(e,t,i,a)||t.AddError({keyword:"maxItems",schemaPath:r,instancePath:o,params:{limit:i.maxItems}})}function $m(e,t,r,o){return s.IsMaxLength(o,r.maxLength)}function Th(e,t,r,o,i,a){return $m(e,t,i,a)||t.AddError({keyword:"maxLength",schemaPath:r,instancePath:o,params:{limit:i.maxLength}})}function Dm(e,t,r,o){return s.IsLessEqualThan(s.Keys(o).length,r.maxProperties)}function _h(e,t,r,o,i,a){return Dm(e,t,i,a)||t.AddError({keyword:"maxProperties",schemaPath:r,instancePath:o,params:{limit:i.maxProperties}})}function eM(e){return yn(e)}function Gm(e,t,r,o){if(!eM(r))return!0;let i=o.reduce((a,p)=>$(e,t,r.contains,p)?++a:a,0);return s.IsGreaterEqualThan(i,r.minContains)}function hh(e,t,r,o,i,a){return Gm(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:i.minContains}})}function vm(e,t,r,o){return s.IsGreaterEqualThan(o,r.minimum)}function Oh(e,t,r,o,i,a){return vm(e,t,i,a)||t.AddError({keyword:"minimum",schemaPath:r,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function jm(e,t,r,o){return s.IsGreaterEqualThan(o.length,r.minItems)}function Ah(e,t,r,o,i,a){return jm(e,t,i,a)||t.AddError({keyword:"minItems",schemaPath:r,instancePath:o,params:{limit:i.minItems}})}function Fm(e,t,r,o){return s.IsMinLength(o,r.minLength)}function Sh(e,t,r,o,i,a){return Fm(e,t,i,a)||t.AddError({keyword:"minLength",schemaPath:r,instancePath:o,params:{limit:i.minLength}})}function Bm(e,t,r,o){return s.IsGreaterEqualThan(s.Keys(o).length,r.minProperties)}function bh(e,t,r,o,i,a){return Bm(e,t,i,a)||t.AddError({keyword:"minProperties",schemaPath:r,instancePath:o,params:{limit:i.minProperties}})}function qm(e,t,r,o){return s.IsMultipleOf(o,r.multipleOf)}function xh(e,t,r,o,i,a){return qm(e,t,i,a)||t.AddError({keyword:"multipleOf",schemaPath:r,instancePath:o,params:{multipleOf:i.multipleOf}})}function Hm(e,t,r,o){let i=new rt;return!$(e,i,r.not,o)&&t.Merge([i])}function Rh(e,t,r,o,i,a){return Hm(e,t,i,a)||t.AddError({keyword:"not",schemaPath:r,instancePath:o,params:{}})}function Ch(e,t,r,o){let i=r.oneOf.reduce((a,p)=>{let u=new rt;return $(e,u,p,o)?[...a,u]:a},[]);return s.IsEqual(i.length,1)&&t.Merge(i)}function Ph(e,t,r,o,i,a){let p=[],u=[],l=i.oneOf.reduce((y,I,x)=>{let _e=new Ge,fe=`${r}/oneOf/${x}`,Fo=z(e,_e,fe,o,I,a);return Fo&&u.push(x),Fo||p.push(_e),Fo?[...y,_e]:y},[]),f=s.IsEqual(l.length,1)&&t.Merge(l);return!f&&s.IsEqual(u.length,0)&&p.forEach(y=>y.GetErrors().forEach(I=>t.AddError(I))),f||t.AddError({keyword:"oneOf",schemaPath:r,instancePath:o,params:{passingSchemas:u}})}function Km(e,t,r,o){return(s.IsString(r.pattern)?new RegExp(r.pattern):r.pattern).test(o)}function Uh(e,t,r,o,i,a){return Km(e,t,i,a)||t.AddError({keyword:"pattern",schemaPath:r,instancePath:o,params:{pattern:i.pattern}})}function Nh(e,t,r,o){return s.Every(s.Entries(r.patternProperties),0,([i,a])=>{let p=new RegExp(i);return s.Every(s.Entries(o),0,([u,l])=>!p.test(u)||$(e,t,a,l)&&t.AddKey(u))})}function Lh(e,t,r,o,i,a){return s.EveryAll(s.Entries(i.patternProperties),0,([p,u])=>{let l=`${r}/patternProperties/${p}`,f=new RegExp(p);return s.EveryAll(s.Entries(a),0,([y,I])=>{let x=`${o}/${y}`;return!f.test(y)||z(e,t,l,x,u,I)&&t.AddKey(y)})})}function kh(e,t,r,o){return s.IsEqual(o.length,0)||s.Every(r.prefixItems,0,(i,a)=>s.IsLessEqualThan(o.length,a)||$(e,t,i,o[a])&&t.AddIndex(a))}function wh(e,t,r,o,i,a){return s.IsEqual(a.length,0)||s.EveryAll(i.prefixItems,0,(p,u)=>{let l=`${r}/prefixItems/${u}`,f=`${o}/${u}`;return s.IsLessEqualThan(a.length,u)||z(e,t,l,f,p,a[u])&&t.AddIndex(u)})}function zm(e,t){return e.includes(t)||It.Get().exactOptionalPropertyTypes}function Vm(e,t){return s.IsUndefined(e[t])}function Mh(e,t,r,o){let i=Tn(r)?r.required:[];return s.Every(s.Entries(r.properties),0,([p,u])=>{let l=!s.HasPropertyKey(o,p)||$(e,t,u,o[p])&&t.AddKey(p);return zm(i,p)?l:Vm(o,p)||l})}function $h(e,t,r,o,i,a){let p=Tn(i)?i.required:[];return s.EveryAll(s.Entries(i.properties),0,([l,f])=>{let y=`${r}/properties/${l}`,I=`${o}/${l}`,x=()=>!s.HasPropertyKey(a,l)||z(e,t,y,I,f,a[l])&&t.AddKey(l);return zm(p,l)?x():Vm(a,l)||x()})}function Dh(e,t,r,o){return s.Every(s.Keys(o),0,(i,a)=>$(e,t,r.propertyNames,i))}function Gh(e,t,r,o,i,a){let p=[];return s.EveryAll(s.Keys(a),0,(l,f)=>{let y=`${o}/${l}`,I=`${r}/propertyNames`,x=new Ge,_e=z(e,x,I,y,i.propertyNames,l);return _e||p.push(l),_e})||t.AddError({keyword:"propertyNames",schemaPath:r,instancePath:o,params:{propertyNames:p}})}function vh(e,t,r,o){let i=e.RecursiveRef(r.$recursiveRef)??!1;return D(i)&&$(e,t,i,o)}function jh(e,t,r,o,i,a){let p=e.RecursiveRef(i.$recursiveRef)??!1;return D(p)&&z(e,t,"#",o,p,a)}function qh(e,t,r,o){let i=e.Ref(r.$ref)??!1,a=new rt,p=D(i)&&$(e,a,i,o);return p&&t.Merge([a]),p}function Hh(e,t,r,o,i,a){let p=e.Ref(i.$ref)??!1,u=new Ge,l=D(p)&&z(e,u,"#",o,p,a);return l&&t.Merge([u]),l||u.GetErrors().forEach(f=>t.AddError(f)),l}function Kh(e,t,r,o){return s.Every(r.required,0,i=>s.HasPropertyKey(o,i))}function zh(e,t,r,o,i,a){let p=[];return s.EveryAll(i.required,0,l=>{let f=s.HasPropertyKey(a,l);return f||p.push(l),f})||t.AddError({keyword:"required",schemaPath:r,instancePath:o,params:{requiredProperties:p}})}function Ym(e,t,r,o,i){return s.IsEqual(r,"object")?s.IsObjectNotArray(i):s.IsEqual(r,"array")?s.IsArray(i):s.IsEqual(r,"boolean")?s.IsBoolean(i):s.IsEqual(r,"integer")?s.IsInteger(i):s.IsEqual(r,"number")?s.IsNumber(i):s.IsEqual(r,"null")?s.IsNull(i):s.IsEqual(r,"string")?s.IsString(i):s.IsEqual(r,"asyncIterator")?s.IsAsyncIterator(i):s.IsEqual(r,"bigint")?s.IsBigInt(i):s.IsEqual(r,"constructor")?s.IsConstructor(i):s.IsEqual(r,"function")?s.IsFunction(i):s.IsEqual(r,"iterator")?s.IsIterator(i):s.IsEqual(r,"symbol")?s.IsSymbol(i):s.IsEqual(r,"undefined")?s.IsUndefined(i):s.IsEqual(r,"void")?s.IsUndefined(i):!0}function Vh(e,t,r,o,i){return r.some(a=>Ym(e,t,a,o,i))}function Yh(e,t,r,o){return s.IsArray(r.type)?Vh(e,t,r.type,r,o):Ym(e,t,r.type,r,o)}function Qh(e,t,r,o,i,a){return(s.IsArray(i.type)?Vh(e,t,i.type,i,a):Ym(e,t,i.type,i,a))||t.AddError({keyword:"type",schemaPath:r,instancePath:o,params:{type:i.type}})}function Wh(e,t,r,o){let i=t.GetIndices();return s.Every(o,0,(a,p)=>(i.has(p)||$(e,t,r.unevaluatedItems,a))&&t.AddIndex(p))}function Zh(e,t,r,o,i,a){let p=t.GetIndices(),u=[];return s.EveryAll(a,0,(f,y)=>{let I=new Ge,x=(p.has(y)||z(e,I,r,o,i.unevaluatedItems,f))&&t.AddIndex(y);return x||u.push(y),x})||t.AddError({keyword:"unevaluatedItems",schemaPath:r,instancePath:o,params:{unevaluatedItems:u}})}function Xh(e,t,r,o){let i=t.GetKeys();return s.Every(s.Entries(o),0,([a,p])=>i.has(a)||$(e,t,r.unevaluatedProperties,p)&&t.AddKey(a))}function Jh(e,t,r,o,i,a){let p=t.GetKeys(),u=[];return s.EveryAll(s.Entries(a),0,([f,y])=>{let I=new Ge,x=p.has(f)||z(e,I,r,o,i.unevaluatedProperties,y)&&t.AddKey(f);return x||u.push(f),x})||t.AddError({keyword:"unevaluatedProperties",schemaPath:r,instancePath:o,params:{unevaluatedProperties:u}})}function eO(e){return!s.IsEqual(e.uniqueItems,!1)}function tO(e,t,r,o){if(!eO(r))return!0;let i=new Set(o.map(Cr.Hash)).size,a=o.length;return s.IsEqual(i,a)}function rO(e,t,r,o,i,a){if(!eO(i))return!0;let p=new Set,u=a.reduce((f,y,I)=>{let x=Cr.Hash(y);return p.has(x)?[...f,I]:(p.add(x),f)},[]);return s.IsEqual(u.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:r,instancePath:o,params:{duplicateItems:u}})}function $(e,t,r,o){e.Push(r);let i=hs(r)?am(e,t,r,o):(!om(r)||Yh(e,t,r,o))&&(!(s.IsObject(o)&&!s.IsArray(o))||(!Tn(r)||Kh(e,t,r,o))&&(!ur(r)||H_(e,t,r,o))&&(!Gc(r)||J_(e,t,r,o))&&(!vc(r)||th(e,t,r,o))&&(!jc(r)||nh(e,t,r,o))&&(!Mi(r)||Nh(e,t,r,o))&&(!$i(r)||Mh(e,t,r,o))&&(!em(r)||Dh(e,t,r,o))&&(!ki(r)||Bm(e,t,r,o))&&(!Wc(r)||Dm(e,t,r,o)))&&(!s.IsArray(o)||(!wc(r)||F_(e,t,r,o))&&(!yn(r)||pm(e,t,r,o))&&(!Eo(r)||fh(e,t,r,o))&&(!Yc(r)||km(e,t,r,o))&&(!Os(r)||Mm(e,t,r,o))&&(!In(r)||Gm(e,t,r,o))&&(!Io(r)||jm(e,t,r,o))&&(!To(r)||kh(e,t,r,o))&&(!_o(r)||tO(e,t,r,o)))&&(!s.IsString(o)||(!Ni(r)||Lm(e,t,r,o))&&(!Qc(r)||$m(e,t,r,o))&&(!Li(r)||Fm(e,t,r,o))&&(!wi(r)||Km(e,t,r,o)))&&(!(s.IsNumber(o)||s.IsBigInt(o))||(!Hc(r)||mm(e,t,r,o))&&(!lr(r)||um(e,t,r,o))&&(!Vc(r)||wm(e,t,r,o))&&(!dr(r)||vm(e,t,r,o))&&(!Zc(r)||qm(e,t,r,o)))&&(!tm(r)||vh(e,t,r,o))&&(!rm(r)||qh(e,t,r,o))&&(!Lc(r)||$_(e,t,r,o))&&(!Dc(r)||sm(e,t,r,o))&&(!qc(r)||cm(e,t,r,o))&&(!Kc(r)||lh(e,t,r,o))&&(!Xc(r)||Hm(e,t,r,o))&&(!Mc(r)||z_(e,t,r,o))&&(!$c(r)||Y_(e,t,r,o))&&(!Jc(r)||Ch(e,t,r,o))&&(!Ss(r)||!s.IsArray(o)||Wh(e,t,r,o))&&(!bs(r)||!s.IsObject(o)||Xh(e,t,r,o))&&(!kc(r)||G_(e,t,r,o));return e.Pop(r),i}function z(e,t,r,o,i,a){e.Push(i);let p=hs(i)?W_(e,t,r,o,i,a):!!(+(!om(i)||Qh(e,t,r,o,i,a))&+(!(s.IsObject(a)&&!s.IsArray(a))||!!(+(!Tn(i)||zh(e,t,r,o,i,a))&+(!ur(i)||K_(e,t,r,o,i,a))&+(!Gc(i)||eh(e,t,r,o,i,a))&+(!vc(i)||rh(e,t,r,o,i,a))&+(!jc(i)||oh(e,t,r,o,i,a))&+(!Mi(i)||Lh(e,t,r,o,i,a))&+(!$i(i)||$h(e,t,r,o,i,a))&+(!em(i)||Gh(e,t,r,o,i,a))&+(!ki(i)||bh(e,t,r,o,i,a))&+(!Wc(i)||_h(e,t,r,o,i,a))))&+(!s.IsArray(a)||!!(+(!wc(i)||B_(e,t,r,o,i,a))&+(!yn(i)||X_(e,t,r,o,i,a))&+(!Eo(i)||gh(e,t,r,o,i,a))&+(!Yc(i)||yh(e,t,r,o,i,a))&+(!Os(i)||Ih(e,t,r,o,i,a))&+(!In(i)||hh(e,t,r,o,i,a))&+(!Io(i)||Ah(e,t,r,o,i,a))&+(!To(i)||wh(e,t,r,o,i,a))&+(!_o(i)||rO(e,t,r,o,i,a))))&+(!s.IsString(a)||!!(+(!Ni(i)||uh(e,t,r,o,i,a))&+(!Qc(i)||Th(e,t,r,o,i,a))&+(!Li(i)||Sh(e,t,r,o,i,a))&+(!wi(i)||Uh(e,t,r,o,i,a))))&+(!(s.IsNumber(a)||s.IsBigInt(a))||!!(+(!Hc(i)||ah(e,t,r,o,i,a))&+(!lr(i)||sh(e,t,r,o,i,a))&+(!Vc(i)||Eh(e,t,r,o,i,a))&+(!dr(i)||Oh(e,t,r,o,i,a))&+(!Zc(i)||xh(e,t,r,o,i,a))))&+(!tm(i)||jh(e,t,r,o,i,a))&+(!rm(i)||Hh(e,t,r,o,i,a))&+(!Lc(i)||D_(e,t,r,o,i,a))&+(!Dc(i)||Z_(e,t,r,o,i,a))&+(!qc(i)||ih(e,t,r,o,i,a))&+(!Kc(i)||dh(e,t,r,o,i,a))&+(!Xc(i)||Rh(e,t,r,o,i,a))&+(!Mc(i)||V_(e,t,r,o,i,a))&+(!$c(i)||Q_(e,t,r,o,i,a))&+(!Jc(i)||Ph(e,t,r,o,i,a))&+(!Ss(i)||!s.IsArray(a)||Zh(e,t,r,o,i,a))&+(!bs(i)||!s.IsObject(a)||Jh(e,t,r,o,i,a)))&&(!kc(i)||v_(e,t,r,o,i,a));return e.Pop(i),p}var hn={};bt(hn,{Ref:()=>dM});var fr={};bt(fr,{Delete:()=>sM,Get:()=>iM,Has:()=>oM,Indices:()=>ji,Set:()=>aM});function nO(e){if(e.length===0)throw Error("Cannot set root")}function oO(e){if(!s.IsObject(e))throw Error("Cannot set value")}function tM(e){return/^(0|[1-9]\d*)$/.test(e)}function iO(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function rM(e,t){return s.IsObject(t)&&s.HasPropertyKey(t,e)}function nM(e,t){return s.IsObject(t)?t[e]:void 0}function Qm(e,t){return e.reduce((r,o)=>nM(o,r),t)}function ji(e){if(s.IsEqual(e.length,0))return[];let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function oM(e,t){let r=e;return ji(t).every(o=>rM(o,r)?(r=r[o],!0):!1)}function iM(e,t){let r=ji(t);return Qm(r,e)}function aM(e,t,r){let o=ji(t);nO(o);let[i,a]=iO(o),p=Qm(i,e);return oO(p),p[a]=r,e}function sM(e,t){let r=ji(t);nO(r);let[o,i]=iO(r),a=Qm(o,e);return oO(a),s.IsArray(a)&&tM(i)?a.splice(+i,1):delete a[i],e}function pM(e,t,r){if(e.$id===r.hash)return e;let o=new URL(e.$id,t.href),i=new URL(r.href,t.href);if(s.IsEqual(o.pathname,i.pathname))return r.hash.startsWith("#")?aO(e,t,r):e}function cM(e,t,r){let o=new URL(`#${e.$anchor}`,t.href),i=new URL(r.href,t.href);if(s.IsEqual(o.href,i.href))return e}function aO(e,t,r){return r.href.endsWith("#")?e:r.hash.startsWith("#")?fr.Get(e,decodeURIComponent(r.hash.slice(1))):void 0}function mM(e,t,r){if(En(e)){let o=pM(e,t,r);if(!s.IsUndefined(o))return o}if(Ui(e)){let o=cM(e,t,r);if(!s.IsUndefined(o))return o}return aO(e,t,r)}function uM(e,t,r){return e.reduce((o,i)=>{let a=Wm(i,t,r);return s.IsUndefined(a)?o:a},void 0)}function lM(e,t,r){return s.Keys(e).reduce((o,i)=>{let a=Wm(e[i],t,r);return s.IsUndefined(a)?o:a},void 0)}function Wm(e,t,r){if(t=mr(e)&&En(e)?new URL(e.$id,t.href):t,mr(e)){let o=mM(e,t,r);if(!s.IsUndefined(o))return o}if(s.IsArray(e))return uM(e,t,r);if(s.IsObject(e))return lM(e,t,r)}function dM(e,t){let r=new URL("http://unknown"),o=En(e)?new URL(e.$id,r.href):r,i=new URL(t,o.href);return Wm(e,o,i)}var On=class{constructor(t,r){this.context=t,this.schema=r,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,r)=>new URL(r.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){mr(t)&&(En(t)&&this.ids.push(t),Ui(t)&&this.anchors.push(t),As(t)&&this.recursiveAnchors.push(t),Fc(t)&&this.dynamicAnchors.push(t))}Pop(t){mr(t)&&(En(t)&&this.ids.pop(),Ui(t)&&this.anchors.pop(),As(t)&&this.recursiveAnchors.pop(),Fc(t)&&this.dynamicAnchors.pop())}FromContext(t){return s.HasPropertyKey(this.context,t)?this.context[t]:void 0}FromRef(t){return t.startsWith("#")?hn.Ref(this.Base(),t):hn.Ref(this.schema,t)}Ref(t){return this.FromContext(t)??this.FromRef(t)}RecursiveRef(t){return As(this.Base())?hn.Ref(this.recursiveAnchors[0],t):hn.Ref(this.Base(),t)}};function sO(...e){let[t,r,o]=re.Match(e,{3:(p,u,l)=>[p,u,l],2:(p,u)=>[{},p,u]}),i=new On(t,r),a=new rt;return $(i,a,r,o)}function pO(...e){let[t,r,o]=re.Match(e,{3:(y,I,x)=>[y,I,x],2:(y,I)=>[{},y,I]}),i=It.Get(),a=od(),p=[],u=new On(t,r),l=new Di(y=>{if(!s.IsGreaterEqualThan(p.length,i.maxErrors))return p.push({...y,message:a(y)})});return[z(u,l,"#","",r,o),p]}function ce(...e){let[t,r,o]=re.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[{},i,a]});return sO(t,r,o)}function qr(...e){let[t,r,o]=re.Match(e,{3:(p,u,l)=>[p,u,l],2:(p,u)=>[{},p,u]}),[i,a]=pO(t,r,o);return a}var Hr=class extends Error{constructor(t,r,o){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:o,value:r},writable:!1,configurable:!1,enumerable:!1})}};function cO(e,t,r){return s.IsArray(r)?r.map(o=>je(e,t.items,o)):r}function mO(e,t,r){return t.Clean(r)}function uO(e,t,r){return je({...e,...t.$defs},be(t.$ref),r)}function gM(e){let t=s.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},r=Mt(e);return w(r)?ms(r,t):r}function lO(e,t,r){let o=gM(t);return je(e,o,r)}function xs(e){return s.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function dO(e,t,r){if(!s.IsObject(r)||s.IsArray(r))return r;let o=xs(t);for(let i of s.Keys(r)){if(s.HasPropertyKey(t.properties,i)){r[i]=je(e,t.properties[i],r[i]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||A(o)&&ce(e,o,r[i])){r[i]=je(e,o,r[i]);continue}delete r[i]}return r}function fO(e,t,r){if(!s.IsObject(r))return r;let o=xs(t),[i,a]=[new RegExp(lt(t)),He(t)];for(let p of s.Keys(r)){if(i.test(p)){r[p]=je(e,a,r[p]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||A(o)&&ce(e,o,r[p])){r[p]=je(e,o,r[p]);continue}delete r[p]}return r}function gO(e,t,r){return s.HasPropertyKey(e,t.$ref)?je(e,e[t.$ref],r):r}function yO(e,t,r){if(!s.IsArray(r))return r;let o=Math.min(r.length,t.items.length);for(let i=0;i<o;i++)r[i]=je(e,t.items[i],r[i]);return s.IsGreaterThan(r.length,o)?r.slice(0,o):r}function yM(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=me(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=me(e[r]);return t}function EM(e){return s.IsClassInstance(e)?e:yM(e)}function IM(e){return e.map(t=>me(t))}function TM(e){return e.slice()}function _M(e){return new Map(me([...e.entries()]))}function hM(e){return new Set(me([...e.values()]))}function me(e){return Ze.IsTypeArray(e)?TM(e):Ze.IsMap(e)?_M(e):Ze.IsSet(e)?hM(e):s.IsArray(e)?IM(e):s.IsObject(e)?EM(e):e}function EO(e,t,r){for(let o of t.anyOf){let i=je(e,o,me(r));if(ce(e,o,i))return i}return r}function je(e,t,r){return J(t)?cO(e,t,r):Tt(t)?mO(e,t,r):pe(t)?uO(e,t,r):U(t)?lO(e,t,r):w(t)?dO(e,t,r):ye(t)?fO(e,t,r):se(t)?gO(e,t,r):K(t)?yO(e,t,r):O(t)?EO(e,t,r):r}function Sn(...e){let[t,r,o]=re.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[{},i,a]});return je(t,r,o)}function IO(e,t,r){return s.IsArray(r)?r.map(o=>Re(e,t.items,o)):r}function TO(e,t,r){return t.Convert(r)}var te={};bt(te,{Fail:()=>bn,IsOk:()=>Xm,Ok:()=>P,TryBigInt:()=>Jm,TryBoolean:()=>jM,TryNull:()=>VM,TryNumber:()=>r$,TryString:()=>c$,TryUndefined:()=>y$});function Xm(e){return s.IsObject(e)&&s.HasPropertyKey(e,"value")}function P(e){return{value:e}}function bn(){}function OM(e){return P(e)}function AM(e){return s.IsEqual(e,!0)?P(BigInt(1)):P(BigInt(0))}function SM(e){return P(BigInt(Math.trunc(e)))}function bM(e){return P(BigInt(0))}var xM=/^-?(0|[1-9]\d*)n$/,RM=/^-?(0|[1-9]\d*)\.\d+$/,CM=/^-?(0|[1-9]\d*)$/;function PM(e){return xM.test(e)}function UM(e){return RM.test(e)}function NM(e){return CM.test(e)}function LM(e){let t=e.toLowerCase();return PM(e)?P(BigInt(e.slice(0,e.length-1))):UM(e)?P(BigInt(e.split(".")[0])):NM(e)?P(BigInt(e)):s.IsEqual(t,"false")?P(BigInt(0)):s.IsEqual(t,"true")?P(BigInt(1)):void 0}function kM(e){return P(BigInt(0))}function Jm(e){return s.IsBigInt(e)?OM(e):s.IsBoolean(e)?AM(e):s.IsNumber(e)?SM(e):s.IsNull(e)?bM(e):s.IsString(e)?LM(e):s.IsUndefined(e)?kM(e):void 0}function wM(e){return s.IsEqual(e,BigInt(0))?P(!1):s.IsEqual(e,BigInt(1))?P(!0):void 0}function MM(e){return P(e)}function $M(e){return s.IsEqual(e,0)?P(!1):s.IsEqual(e,1)?P(!0):void 0}function DM(e){return P(!1)}function GM(e){return s.IsEqual(e.toLowerCase(),"false")?P(!1):s.IsEqual(e.toLowerCase(),"true")?P(!0):s.IsEqual(e,"0")?P(!1):s.IsEqual(e,"1")?P(!0):void 0}function vM(e){return P(!1)}function jM(e){return s.IsBigInt(e)?wM(e):s.IsBoolean(e)?MM(e):s.IsNumber(e)?$M(e):s.IsNull(e)?DM(e):s.IsString(e)?GM(e):s.IsUndefined(e)?vM(e):void 0}function FM(e){return s.IsEqual(e,BigInt(0))?P(null):void 0}function BM(e){return s.IsEqual(e,!1)?P(null):void 0}function qM(e){return s.IsEqual(e,0)?P(null):void 0}function HM(e){return P(null)}function KM(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?P(null):void 0}function zM(e){return P(null)}function VM(e){return s.IsBigInt(e)?FM(e):s.IsBoolean(e)?BM(e):s.IsNumber(e)?qM(e):s.IsNull(e)?HM(e):s.IsString(e)?KM(e):s.IsUndefined(e)?zM(e):void 0}var YM=BigInt(Number.MAX_SAFE_INTEGER),QM=BigInt(Number.MIN_SAFE_INTEGER);function WM(e){return e<=YM&&e>=QM}function _O(e){return WM(e)?P(Number(e)):void 0}function ZM(e){return e?P(1):P(0)}function XM(e){return P(e)}function JM(e){return P(0)}function e$(e){let t=+e;if(s.IsNumber(t))return P(t);let r=e.toLowerCase();if(s.IsEqual(r,"false"))return P(0);if(s.IsEqual(r,"true"))return P(1);let o=Jm(e);return Xm(o)?_O(o.value):void 0}function t$(e){return P(0)}function r$(e){return s.IsBigInt(e)?_O(e):s.IsBoolean(e)?ZM(e):s.IsNumber(e)?XM(e):s.IsNull(e)?JM(e):s.IsString(e)?e$(e):s.IsUndefined(e)?t$(e):void 0}function n$(e){return P(e.toString())}function o$(e){return P(e.toString())}function i$(e){return P(e.toString())}function a$(e){return P("null")}function s$(e){return P(e)}function p$(e){return P("")}function c$(e){return s.IsBigInt(e)?n$(e):s.IsBoolean(e)?o$(e):s.IsNumber(e)?i$(e):s.IsNull(e)?a$(e):s.IsString(e)?s$(e):s.IsUndefined(e)?p$(e):void 0}function m$(e){return s.IsEqual(e,BigInt(0))?P(void 0):void 0}function u$(e){return s.IsEqual(e,!1)?P(void 0):void 0}function l$(e){return s.IsEqual(e,0)?P(void 0):void 0}function d$(e){return P(void 0)}function f$(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?P(void 0):void 0}function g$(e){return P(void 0)}function y$(e){return s.IsBigInt(e)?m$(e):s.IsBoolean(e)?u$(e):s.IsNumber(e)?l$(e):s.IsNull(e)?d$(e):s.IsString(e)?f$(e):s.IsUndefined(e)?g$(e):void 0}function hO(e,t,r){if(s.IsBigInt(r))return r;let o=te.TryBigInt(r);return te.IsOk(o)?o.value:r}function OO(e,t,r){if(s.IsBoolean(r))return r;let o=te.TryBoolean(r);return te.IsOk(o)?o.value:r}function AO(e,t,r){return Re({...e,...t.$defs},be(t.$ref),r)}function Rs(e,t,r){if(t.anyOf.some(p=>ce(e,p,r)))return r;let a=t.anyOf.map(p=>Re(e,p,me(r))).find(p=>ce(e,t,p));return s.IsUndefined(a)?r:a}function SO(e,t,r){let o=pn(t);return Rs(e,o,r)}function bO(e,t,r){if(s.IsInteger(r))return r;let o=te.TryNumber(r);return te.IsOk(o)?Math.trunc(o.value):r}function xO(e,t,r){let o=Mt(t);return Re(e,o,r)}function E$(e,t,r){let o=te.TryBigInt(r);return te.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function I$(e,t,r){let o=te.TryBoolean(r);return te.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function T$(e,t,r){let o=te.TryNumber(r);return te.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function _$(e,t,r){let o=te.TryString(r);return te.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function RO(e,t,r){return s.IsEqual(t.const,r)?r:ld(t)?E$(e,t,r):dd(t)?I$(e,t,r):Hn(t)?T$(e,t,r):Kn(t)?_$(e,t,r):F()}function CO(e,t,r){if(s.IsNull(r))return r;let o=te.TryNull(r);return te.IsOk(o)?o.value:r}function PO(e,t,r){if(s.IsNumber(r))return r;let o=te.TryNumber(r);return te.IsOk(o)?o.value:r}function Cs(e,t,r,o){let i=s.Keys(o);for(let[a,p]of t)for(let u of i)a.test(u)||(o[u]=Re(e,r,o[u]));return o}function Fi(e,t,r){return Pe(e)&&s.IsUndefined(r[t])}function h$(e,t,r){let o=s.EntriesRegExp(t.properties),i=s.Keys(r);for(let[a,p]of o)for(let u of i)!a.test(u)||Fi(p,u,r)||(r[u]=Re(e,p,r[u]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?Cs(e,o,t.additionalProperties,r):r}function UO(e,t,r){return s.IsObjectNotArray(r)?h$(e,t,r):r}function O$(e,t,r){let o=s.EntriesRegExp(t.patternProperties),i=s.Keys(r);for(let[a,p]of o)for(let u of i)a.test(u)&&(r[u]=Re(e,p,r[u]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?Cs(e,o,t.additionalProperties,r):r}function NO(e,t,r){return s.IsObjectNotArray(r)?O$(e,t,r):r}function LO(e,t,r){return s.HasPropertyKey(e,t.$ref)?Re(e,e[t.$ref],r):r}function kO(e,t,r){if(s.IsString(r))return r;let o=te.TryString(r);return te.IsOk(o)?o.value:r}function wO(e,t,r){let o=Ke(t.pattern);return Re(e,o,r)}function MO(e,t,r){if(!s.IsArray(r))return r;for(let o=0;o<Math.min(t.items.length,r.length);o++)r[o]=Re(e,t.items[o],r[o]);return r}function $O(e,t,r){if(s.IsUndefined(r))return r;let o=te.TryUndefined(r);return te.IsOk(o)?o.value:r}function DO(e,t,r){if(s.IsUndefined(r))return r;let o=te.TryUndefined(r);return te.IsOk(o)?void 0:r}function Re(e,t,r){return J(t)?IO(e,t,r):Tt(t)?TO(e,t,r):ut(t)?hO(e,t,r):et(t)?OO(e,t,r):pe(t)?AO(e,t,r):Oe(t)?SO(e,t,r):Me(t)?bO(e,t,r):U(t)?xO(e,t,r):Y(t)?RO(e,t,r):Ft(t)?CO(e,t,r):ge(t)?PO(e,t,r):w(t)?UO(e,t,r):ye(t)?NO(e,t,r):se(t)?LO(e,t,r):xe(t)?kO(e,t,r):Ae(t)?wO(e,t,r):K(t)?MO(e,t,r):Kt(t)?$O(e,t,r):O(t)?Rs(e,t,r):dt(t)?DO(e,t,r):r}function Kr(...e){let[t,r,o]=re.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[{},i,a]});return Re(t,r,o)}function GO(e,t,r){if(!s.IsArray(r))return r;for(let o=0;o<r.length;o++)r[o]=ke(e,t.items,r[o]);return r}function vO(e,t,r){return t.Default(r)}function jO(e,t,r){return ke({...e,...t.$defs},be(t.$ref),r)}function FO(e,t){return s.IsUndefined(t)?s.IsFunction(e.default)?e.default():me(e.default):t}function BO(e,t,r){let o=Mt(t);return ke(e,o,r)}function qO(e,t,r){if(!s.IsObject(r))return r;let o=s.Keys(t.properties);for(let i of o){let a=ke(e,t.properties[i],r[i]);s.IsUndefined(a)&&(Pe(t.properties[i])||!s.HasPropertyKey(t.properties[i],"default"))||(r[i]=ke(e,t.properties[i],r[i]))}if(!ur(t)||s.IsBoolean(t.additionalProperties))return r;for(let i of s.Keys(r))o.includes(i)||(r[i]=ke(e,t.additionalProperties,r[i]));return r}function HO(e,t,r){if(!s.IsObject(r))return r;let[o,i]=[new RegExp(lt(t)),He(t)];for(let a of s.Keys(r))o.test(a)&&Ot(i)&&(r[a]=ke(e,i,r[a]));if(!ur(t))return r;for(let a of s.Keys(r))o.test(a)||(r[a]=ke(e,t.additionalProperties,r[a]));return r}function KO(e,t,r){return s.HasPropertyKey(e,t.$ref)?ke(e,e[t.$ref],r):r}function zO(e,t,r){if(!s.IsArray(r))return r;let[o,i]=[t.items,Math.max(t.items.length,r.length)];for(let a=0;a<i;a++)a<o.length&&(r[a]=ke(e,o[a],r[a]));return r}function VO(e,t,r){for(let o of t.anyOf){let i=ke(e,o,me(r));if(ce(e,o,i))return i}return r}function ke(e,t,r){let o=Ot(t)?FO(t,r):r;return J(t)?GO(e,t,o):Tt(t)?vO(e,t,o):pe(t)?jO(e,t,o):U(t)?BO(e,t,o):w(t)?qO(e,t,o):ye(t)?HO(e,t,o):se(t)?KO(e,t,o):K(t)?zO(e,t,o):O(t)?VO(e,t,o):o}function xn(...e){let[t,r,o]=re.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[{},i,a]});return ke(t,r,o)}function Ao(e){return(...t)=>{let[r,o,i]=re.Match(t,{3:(a,p,u)=>[a,p,u],2:(a,p)=>[{},a,p]});return e.reduce((a,p)=>p(r,o,a),i)}}function A$(e,t,r){return t["~codec"].decode(r)}function S$(e,t,r){return t["~codec"].encode(r)}function Te(e,t,r,o){return rn(r)?s.IsEqual(e,"Decode")?A$(t,r,o):S$(t,r,o):o}function b$(e,t,r,o){if(!s.IsArray(o))return F();for(let i=0;i<o.length;i++)o[i]=le(e,t,r.items,o[i]);return Te(e,t,r,o)}function x$(e,t,r,o){let i=Te(e,t,r,o);if(!s.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=le(e,t,r.items,i[a]);return i}function YO(e,t,r,o){return s.IsEqual(e,"Decode")?b$(e,t,r,o):x$(e,t,r,o)}function QO(e,t,r,o){return o=le(e,{...t,...r.$defs},be(r.$ref),o),Te(e,t,r,o)}function R$(e,t,r,o){for(let i of r.allOf)o=le(e,t,i,o);return Te(e,t,r,o)}function C$(e,t,r,o){let i=Te(e,t,r,o);for(let a of r.allOf)i=le(e,t,a,i);return i}function WO(e,t,r,o){return s.IsEqual(e,"Decode")?R$(e,t,r,o):C$(e,t,r,o)}function P$(e,t,r,o){if(!s.IsObjectNotArray(o))return F();for(let i of s.Keys(r.properties))!s.HasPropertyKey(o,i)||Fi(r.properties[i],i,o)||(o[i]=le(e,t,r.properties[i],o[i]));return Te(e,t,r,o)}function U$(e,t,r,o){let i=Te(e,t,r,o);if(!s.IsObjectNotArray(i))return i;for(let a of s.Keys(r.properties))!s.HasPropertyKey(i,a)||Fi(r.properties[a],a,i)||(i[a]=le(e,t,r.properties[a],i[a]));return i}function ZO(e,t,r,o){return s.IsEqual(e,"Decode")?P$(e,t,r,o):U$(e,t,r,o)}function N$(e,t,r,o){if(!s.IsObjectNotArray(o))return F();let i=new RegExp(lt(r));for(let a of s.Keys(o))i.test(a)||F(),o[a]=le(e,t,He(r),o[a]);return Te(e,t,r,o)}function L$(e,t,r,o){let i=Te(e,t,r,o);if(!s.IsObjectNotArray(i))return i;let a=new RegExp(lt(r));for(let p of s.Keys(i))a.test(p)&&(i[p]=le(e,t,He(r),i[p]));return i}function XO(e,t,r,o){return s.IsEqual(e,"Decode")?N$(e,t,r,o):L$(e,t,r,o)}function JO(e,t,r,o){return o=s.HasPropertyKey(t,r.$ref)?le(e,t,t[r.$ref],o):o,Te(e,t,r,o)}function k$(e,t,r,o){if(!s.IsArray(o))return F();for(let i=0;i<Math.min(r.items.length,o.length);i++)o[i]=le(e,t,r.items[i],o[i]);return Te(e,t,r,o)}function w$(e,t,r,o){let i=Te(e,t,r,o);if(!s.IsArray(i))return o;for(let a=0;a<Math.min(r.items.length,i.length);a++)i[a]=le(e,t,r.items[a],i[a]);return i}function eA(e,t,r,o){return s.IsEqual(e,"Decode")?k$(e,t,r,o):w$(e,t,r,o)}function M$(e,t,r,o){for(let i of r.anyOf){if(!ce(t,i,o))continue;let a=le(e,t,i,o);return Te(e,t,r,a)}return F()}function $$(e,t,r,o){let i=Te(e,t,r,o);for(let a of r.anyOf){let p=le(e,t,a,me(i));if(ce(t,a,p))return p}return i}function tA(e,t,r,o){return s.IsEqual(e,"Decode")?M$(e,t,r,o):$$(e,t,r,o)}function le(e,t,r,o){return J(r)?YO(e,t,r,o):pe(r)?QO(e,t,r,o):U(r)?WO(e,t,r,o):w(r)?ZO(e,t,r,o):ye(r)?XO(e,t,r,o):se(r)?JO(e,t,r,o):K(r)?eA(e,t,r,o):O(r)?tA(e,t,r,o):Te(e,t,r,o)}var eu=class extends Hr{constructor(t,r){super("Decode",t,r)}};function D$(e,t,r){if(!ce(e,t,r))throw new eu(r,qr(e,t,r));return r}function G$(e,t,r){return le("Decode",e,t,r)}var xUe=Ao([(e,t,r)=>me(r),(e,t,r)=>xn(e,t,r),(e,t,r)=>Kr(e,t,r),(e,t,r)=>Sn(e,t,r),(e,t,r)=>D$(e,t,r),(e,t,r)=>G$(e,t,r)]);var tu=class extends Hr{constructor(t,r){super("Encode",t,r)}};function v$(e,t,r){if(!ce(e,t,r))throw new tu(r,qr(e,t,r));return r}function j$(e,t,r){return le("Encode",e,t,r)}var GUe=Ao([(e,t,r)=>me(r),(e,t,r)=>j$(e,t,r),(e,t,r)=>xn(e,t,r),(e,t,r)=>Kr(e,t,r),(e,t,r)=>Sn(e,t,r),(e,t,r)=>v$(e,t,r)]);var Ct=class extends Error{constructor(t,r){super(r),this.type=t}};function rA(e,t){return s.IsFunction(t.default)?t.default(t):s.IsObject(t.default)?me(t.default):t.default}function nA(e,t){if(_o(t)&&!Ot(t))throw new Ct(t,"Arrays with uniqueItems constraints must specify a default annotation");let r=Io(t)?t.minItems:0;return Array.from({length:r},()=>de(e,t.items))}async function*F$(){}function oA(e,t){return F$()}function iA(e,t){return t.Create()}function aA(e,t){return lr(t)?BigInt(t.exclusiveMinimum)+BigInt(1):dr(t)?BigInt(t.minimum):BigInt(0)}function sA(e,t){return!1}function pA(e,t){let r=de(e,t.instanceType);return class{constructor(){Object.assign(this,r)}}}function cA(e,t){return de({...e,...t.$defs},be(t.$ref))}function mA(e,t){return de(e,pn(t))}function uA(e,t){let r=de(e,t.returnType);return()=>r}function lA(e,t){return lr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:dr(t)?t.minimum:0}function dA(e,t){return de(e,Mt(t))}function*B$(){}function fA(e,t){return B$()}function gA(e,t){return t.const}function yA(e,t){throw new Ct(t,"Cannot create TNever types")}function EA(e,t){return null}function IA(e,t){return lr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:dr(t)?t.minimum:0}function TA(e,t){return(s.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:de(e,t.properties[i])}),{})}function _A(e,t){return Promise.resolve(de(e,t.item))}function hA(e,t){if(ki(t)&&!Ot(t))throw new Ct(t,"Record with the minProperties constraint must have a default annotation");return{}}function OA(e,t){return s.HasPropertyKey(e,t.$ref)?de(e,e[t.$ref]):(()=>{throw new Ct(t,"Unable to deref Ref")})()}function AA(e,t){if((wi(t)||Ni(t))&&!Ot(t))throw Error("Strings with format or pattern constraints must specify default");let o=Li(t)?t.minLength:0;return"".padEnd(o)}function SA(e,t){return Symbol()}function bA(e,t){let r=Ke(t.pattern);if(xe(r))throw new Ct(t,"Unable to create TemplateLiteral due to infinite type expansion");return de(e,r)}function xA(e,t){return Array.from({length:t.minItems},(r,o)=>de(e,t.items[o]))}function RA(e,t){if(s.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return de(e,t.anyOf[0])}function de(e,t){return Ot(t)?rA(e,t):J(t)?nA(e,t):Ye(t)?oA(e,t):Tt(t)?iA(e,t):ut(t)?aA(e,t):et(t)?sA(e,t):Ue(t)?pA(e,t):pe(t)?cA(e,t):Oe(t)?mA(e,t):Ne(t)?uA(e,t):Me(t)?lA(e,t):U(t)?dA(e,t):Qe(t)?fA(e,t):Y(t)?gA(e,t):or(t)?yA(e,t):Ft(t)?EA(e,t):ge(t)?IA(e,t):w(t)?TA(e,t):qe(t)?_A(e,t):ye(t)?hA(e,t):se(t)?OA(e,t):xe(t)?AA(e,t):Bt(t)?SA(e,t):Ae(t)?bA(e,t):K(t)?xA(e,t):Kt(t)?void 0:O(t)?RA(e,t):dt(t)?void 0:void 0}function Zt(...e){let[t,r]=re.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return de(t,r)}var ru=class extends Hr{constructor(t,r){super("Parse",t,r)}};function q$(e,t,r){if(!ce(e,t,r))throw new ru(r,qr(e,t,r));return r}var qke=Ao([(e,t,r)=>me(r),(e,t,r)=>xn(e,t,r),(e,t,r)=>Kr(e,t,r),(e,t,r)=>Sn(e,t,r),(e,t,r)=>q$(e,t,r)]);var K$=N({type:H("insert"),path:st(),value:Fe()}),z$=Object({type:H("update"),path:st(),value:Fe()}),V$=N({type:H("delete"),path:st()}),Wke=G([K$,z$,V$]);function So(e){if(!e.body)throw new Error("This command does not accept a request body");let t=e.body;return t.examples?.length?t.examples[0]:Zt(t)}var UA=ol(require("node:fs"));function bo(e){if(e.file){let t=UA.default.readFileSync(e.file==="-"?0:e.file,"utf-8");return JSON.parse(t)}if(e.data)return JSON.parse(e.data);throw new Error("Provide a request body with -f <file> or -d <json>. Use --generate-skeleton to get a template.")}function Bi(e,t,r,o,i){e.command(t).description(r).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async a=>{if(a.generateSkeleton){ae(So(o));return}let p=bo(a),u=await i()(o,{body:p});ae(u)})}function NA(e,t){let r=e.command("experimental").description("Experimental commands \u2014 unstable, subject to change without notice");Bi(r,"promql","Run a PromQL query (experimental)",M_,t)}var Z="context";var DMe=`${Z}.team`,GMe=`${Z}.env`,vMe=`${Z}.api_key_id`,jMe=`${Z}.service.name`,FMe=`${Z}.service.version`;var Z$=`${Z}.host.name`,X$=`${Z}.instance`,J$=`${Z}.instanceid`,eD=`${Z}.instance_name`,BMe=`${Z}.telemetry.sdk.language`,qMe=`${Z}.k8s.cluster.name`,HMe=`${Z}.k8s.cluster.uid`,KMe=`${Z}.k8s.namespace.name`,zMe=`${Z}.k8s.pod.name`,VMe=`${Z}.k8s.pod.uid`,YMe=`${Z}.k8s.container.name`,QMe=`${Z}.k8s.node.name`,WMe=`${Z}.k8s.node.uid`,ZMe=`${Z}.k8s.deployment.name`,XMe=`${Z}.k8s.deployment.uid`,JMe=`${Z}.k8s.replicaset.name`,e$e=`${Z}.k8s.replicaset.uid`,t$e=`${Z}.k8s.statefulset.name`,r$e=`${Z}.k8s.statefulset.uid`,n$e=`${Z}.k8s.daemonset.name`,o$e=`${Z}.k8s.daemonset.uid`,i$e=`${Z}.k8s.job.name`,a$e=`${Z}.k8s.job.uid`,s$e=`${Z}.k8s.cronjob.name`,p$e=`${Z}.k8s.cronjob.uid`;var c$e={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${Z}.tag_policy_id`,dataSource:`${Z}.data_source`}};var m$e={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${Z}.batch_kind`,batchKindMetricsFilter:`${Z}.batch_kind:metrics`,sourceApiKeyId:`${Z}.source_api_key_id`,sourceEnv:`${Z}.source_env`,sourceTeam:`${Z}.source_team`}},tD="__tsuga_metadata__",u$e=`${tD}.signature`;var Rn="/v0/service-catalog";var LA=n.Object({team:n.String(),lastSeenAt:T()}),rD=n.Object({ingestionApiKey:n.String(),lastSeenAt:T()}),kA=n.Object({version:n.String(),firstSeenAt:T(),lastSeenAt:T(),faulty:n.Optional(n.Boolean())}),nD=n.Object({language:n.String(),lastSeenAt:T()}),Ps=n.Object({id:n.String(),serviceName:n.String(),serviceNamespace:n.Optional(n.String()),env:n.Optional(n.String()),teams:n.Array(LA),ingestionApiKeys:n.Array(rD),versions:n.Array(kA),languages:n.Array(nD),lastSeenAt:T(),firstSeenAt:T(),sources:n.Array(n.String()),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),logsCount24h:n.Number(),errorLogsCount24h:n.Number(),tracesCount24h:n.Number(),errorTracesCount24h:n.Number(),createdAt:T(),updatedAt:T()}),I$e=d({tags:["service-catalog"],query:n.Object({...oe,clusterId:n.Optional(m())}),method:"GET",paginated:!0,url:`${Rn}/services`,response:n.Array(Ps)}),T$e=d({tags:["service-catalog"],method:"GET",url:`${Rn}/services/:serviceId`,params:n.Object({serviceId:m()}),response:Ps}),oD=n.Object({id:n.String(),endpointName:n.String(),serviceName:n.String(),serviceNamespace:n.Optional(n.String()),env:n.Optional(n.String()),teams:n.Array(LA),versions:n.Array(kA),lastSeenAt:T(),firstSeenAt:T(),sources:n.Array(n.String()),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),createdAt:T(),updatedAt:T()}),_$e=d({tags:["service-catalog"],method:"GET",url:`${Rn}/endpoints`,response:n.Array(oD)}),iD=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var wA=n.Object({id:n.String(),hostName:n.String(),env:n.Optional(n.String()),cpuUtilizationAverage:n.Number(),hostType:n.Enum(iD),teams:n.Array(n.String()),tags:n.Array(n.String()),firstSeenAt:T(),lastSeenAt:T(),clusterId:n.String()}),h$e=d({tags:["service-catalog"],method:"GET",url:`${Rn}/hosts`,response:n.Array(wA)}),O$e=d({tags:["service-catalog"],method:"GET",url:`${Rn}/hosts/:hostId`,params:n.Object({hostId:m()}),response:wA}),aD=n.Object({serviceName:n.String(),id:n.Union([n.String(),n.Null()]),namespace:n.Union([n.String(),n.Null()]),cluster:n.String(),env:n.Union([n.String(),n.Null()])}),sD=n.Object({from:n.String(),to:n.String(),count:n.Number()}),A$e=d({tags:["service-catalog"],url:`${Rn}/services/:serviceId/graph`,method:"GET",params:n.Object({serviceId:m()}),query:n.Object({...gt.properties,query:n.Optional(m({type:"tsuga-query"}))}),response:n.Object({nodes:n.Array(aD),edges:n.Array(sD)})}),S$e=d({tags:["service-catalog"],method:"GET",url:`${Rn}/services/by-api-keys`,response:n.Record(n.String(),n.Array(n.Object({serviceName:n.String(),serviceNamespace:n.Optional(n.String())})))});var ou=`/${"v1"}/services`,iu=n.Pick(Ps,["id","serviceName","serviceNamespace","env","teams","versions","languages","lastSeenAt","firstSeenAt","sources","logsCount24h","errorLogsCount24h","tracesCount24h","errorTracesCount24h"],{$id:"Service",description:"Observed telemetry service with metadata, activity stats and version signals"}),pD={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!1}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],lastSeenAt:"2024-01-15T12:34:56.000Z",firstSeenAt:"2024-01-01T08:00:00.000Z",sources:["logs","metrics","traces"],logsCount24h:12e3,errorLogsCount24h:42,tracesCount24h:8500,errorTracesCount24h:17};Object.assign(iu,{examples:[pD]});var MA=d({description:"Retrieve all services",operationId:"listServices",tags:["services"],url:ou,method:"GET",paginated:!0,query:n.Object({...oe,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:n.Array(iu)}),$A=d({description:"Retrieve a service by its id",operationId:"getService",tags:["services"],url:`${ou}/:serviceId`,method:"GET",params:n.Object({serviceId:m({allowEmpty:!1})}),response:iu}),cD=n.Object({serviceName:n.String({description:"Service name"}),id:n.Union([n.String(),n.Null()],{description:"Service ID from catalog, null if unknown"}),namespace:n.Union([n.String(),n.Null()],{description:"Service namespace from catalog, null if unknown"}),cluster:n.String({description:"Cluster ID"}),env:n.Union([n.String(),n.Null()],{description:"Environment observed from spans"})}),DA=d({description:"Retrieve the dependency graph for a service, showing which services call each other",operationId:"getServiceGraph",tags:["services"],url:`${ou}/:serviceId/graph`,method:"GET",params:n.Object({serviceId:m({allowEmpty:!1})}),query:n.Object({...gt.properties,query:n.Optional(m({type:"tsuga-query"}))}),response:n.Object({nodes:n.Array(cD),edges:n.Array(n.Object({from:n.String(),to:n.String(),count:n.Number()}))})});var yr=require("node:fs"),GA=require("node:os"),au=require("node:path"),vA=(0,au.join)((0,GA.homedir)(),".config","tsuga"),xo=(0,au.join)(vA,"config.json"),mD="https://api.tsuga.com";function Cn(){if(!(0,yr.existsSync)(xo))return{};try{return JSON.parse((0,yr.readFileSync)(xo,"utf-8"))}catch{throw new Error(`Config file corrupted: ${xo}
38
- Re-run: tsuga auth <token>`)}}function su(e){(0,yr.mkdirSync)(vA,{recursive:!0,mode:448}),(0,yr.writeFileSync)(xo,`${JSON.stringify(e,null,2)}
39
- `,{mode:384})}function pu(e){let t=Cn(),r=e.operationApiKey??process.env.TSUGA_OPERATION_API_KEY??t.operationApiKey,o=e.clusterId?.trim()||process.env.TSUGA_CLUSTER_ID?.trim()||t.defaults?.cluster?.trim()||void 0;return{apiUrl:process.env.TSUGA_API_URL?.trim()||mD,operationApiKey:r,clusterId:o}}function cu(e){let t={};try{t=Cn()}catch{}su({...t,...e})}function jA(){return(0,yr.existsSync)(xo)||!!process.env.TSUGA_OPERATION_API_KEY}function mu(){return xo}var uu={from:"-30m",to:"now",query:"*","max-results":"100"};function FA(){return Cn().defaults??{}}function Er(e){return(Cn().defaults??{})[e]??uu[e]}function BA(e,t){let r={};try{r=Cn()}catch{}let o={...r.defaults??{},[e]:t};su({...r,defaults:o})}function qA(){let e={};try{e=Cn()}catch{}let{defaults:t,...r}=e;su(r)}function HA(){return Cn().lastUpdateCheck}function KA(e){cu({lastUpdateCheck:e})}function zA(e,t){let r=t??Er(e);return r===void 0?void 0:Ts(r)}function lu(e){let t=Er(e);return t===void 0?"":` (default: ${t})`}function VA(e,t){e.command("service-graph").description("Inspect service dependency graphs").command("get <serviceId>").description("Retrieve the dependency graph for a service").option("--from <timestamp>",`Start of time range${lu("from")}`).option("--to <timestamp>",`End of time range${lu("to")}`).option("--query <query>",`Search query${lu("query")}`).action(async(o,i)=>{let a={},p=zA("from",i.from),u=zA("to",i.to);p!==void 0&&(a.from=p),u!==void 0&&(a.to=u),i.query!==void 0&&(a.query=i.query);let l=await t()(DA,{params:{serviceId:o},query:a});ae(l)})}var du=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],fu=["light","dark"];var uD={light:{red:{text:"foreground.red",background:"avatar.background.red"},orange:{text:"foreground.orange",background:"avatar.background.orange"},amber:{text:"foreground.amber",background:"avatar.background.amber"},yellow:{text:"foreground.yellow",background:"avatar.background.yellow"},green:{text:"foreground.green",background:"avatar.background.green"},emerald:{text:"foreground.emerald",background:"avatar.background.emerald"},teal:{text:"foreground.teal",background:"avatar.background.teal"},cyan:{text:"foreground.cyan",background:"avatar.background.cyan"},sky:{text:"foreground.sky",background:"avatar.background.sky"},blue:{text:"foreground.blue",background:"avatar.background.blue"},indigo:{text:"foreground.indigo",background:"avatar.background.indigo"},purple:{text:"foreground.purple",background:"avatar.background.purple"},pink:{text:"foreground.pink",background:"avatar.background.pink"}},dark:{red:{text:"avatar.foreground.foreground",background:"avatar.solid-background.red"},orange:{text:"avatar.foreground.foreground",background:"avatar.solid-background.orange"},amber:{text:"avatar.foreground.foreground",background:"avatar.solid-background.amber"},yellow:{text:"avatar.foreground.foreground",background:"avatar.solid-background.yellow"},green:{text:"avatar.foreground.foreground",background:"avatar.solid-background.green"},emerald:{text:"avatar.foreground.foreground",background:"avatar.solid-background.emerald"},teal:{text:"avatar.foreground.foreground",background:"avatar.solid-background.teal"},cyan:{text:"avatar.foreground.foreground",background:"avatar.solid-background.cyan"},sky:{text:"avatar.foreground.foreground",background:"avatar.solid-background.sky"},blue:{text:"avatar.foreground.foreground",background:"avatar.solid-background.blue"},indigo:{text:"avatar.foreground.foreground",background:"avatar.solid-background.indigo"},purple:{text:"avatar.foreground.foreground",background:"avatar.solid-background.purple"},pink:{text:"avatar.foreground.foreground",background:"avatar.solid-background.pink"}},gradient:{red:"var(--chakra-colors-gradient-red)",orange:"var(--chakra-colors-gradient-orange)",amber:"var(--chakra-colors-gradient-amber)",yellow:"var(--chakra-colors-gradient-yellow)",green:"var(--chakra-colors-gradient-green)",emerald:"var(--chakra-colors-gradient-emerald)",teal:"var(--chakra-colors-gradient-teal)",cyan:"var(--chakra-colors-gradient-cyan)",sky:"var(--chakra-colors-gradient-sky)",blue:"var(--chakra-colors-gradient-blue)",indigo:"var(--chakra-colors-gradient-indigo)",purple:"var(--chakra-colors-gradient-purple)",pink:"var(--chakra-colors-gradient-pink)"}},YA=["activity-heart","activity","airplay","airpods","alarm-clock","anchor","annotation-dots","annotation-heart","annotation-question","annotation","announcement-03","asterisk-01","atom-01","atom-02","award-03","award-04","award-05","backpack","bank-note-01","bank-note-02","bank-note-03","battery-charging-01","beaker-01","beaker-02","bell-03","bell-04","bell-ringing-03","bell-ringing-04","bluetooth-connect","bluetooth-on","book-closed","book-open-01","book-open-02","bookmark","briefcase-01","briefcase-02","brush-01","brush-02","brush-03","building-01","building-02","building-03","building-08","bus","calculator","calendar-check-01","calendar-date","calendar-heart-01","calendar","camera-01","camera-lens","car-01","certificate-01","certificate-02","check-heart","clipboard-attachment","clipboard-check","clipboard-download","clipboard","clock-snooze","clock-stopwatch","cloud-01","cloud-lightning","cloud-moon","cloud-raining-01","cloud-raining-03","cloud-raining-05","cloud-raining-06","cloud-snowing-01","cloud-sun-01","cloud-sun-02","cloud-sun-03","code-browser","code-circle-01","code-circle-02","code-circle-03","code-square-01","code-square-02","coins-hand","coins-stacked-01","colors","compass-01","compass-02","compass-03","compass","credit-card-01","credit-card-02","cube-02","cube-04","cube-outline","currency-bitcoin-circle","currency-dollar-circle","currency-ethereum-circle","currency-euro-circle","currency-pound-circle","currency-ruble-circle","currency-rupee-circle","currency-yen-circle","cursor-click-01","cursor-click-02","diamond-01","diamond-02","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","disc-01","disc-02","droplets-01","droplets-02","droplets-03","dropper","face-content","face-frown","face-happy","face-neutral","face-sad","face-smile","face-wink","feather","file-02","file-05","file-06","file-heart-01","file-heart-02","file-search-01","file-search-02","file-search-03","film-01","film-02","fingerprint-03","fingerprint-04","flag-01","flag-04","flash-off","flash","gaming-pad-01","gaming-pad-02","gift-01","glasses-01","glasses-02","globe-03","globe-04","globe-05","globe-06","globe-slated-01","globe-slated-02","graduation-hat-01","graduation-hat-02","hash-01","hash-02","headphones-01","headphones-02","heart-circle","heart-hand","heart-hexagon","heart-octagon","heart-rounded","heart-square","hearts","hexagon-01","hexagon-02","home-03","home-smile","hourglass-01","hourglass-02","hourglass-03","hurricane-01","hurricane-02","hurricane-03","image-01","image-02","image-03","image-04","image-05","keyboard-01","laptop-01","life-buoy-01","life-buoy-02","lightbulb-02","lightbulb-03","lightbulb-04","lock-keyhole-circle","lock-keyhole-square","luggage-01","luggage-02","luggage-03","magic-wand-01","magic-wand-02","map-01","map-02","mark","marker-pin-01","marker-pin-04","marker-pin-05","marker-pin-06","medical-circle","medical-cross","medical-square","message-chat-square","message-notification-square","message-smile-square","message-text-square-02","microphone-01","microphone-02","microscope","modem-01","modem-02","monitor-03","monitor-04","monitor-05","moon-01","moon-eclipse","moon-star","music-note-01","music-note-02","music-note-plus","octagon","palette","paperclip","pentagon","phone-01","phone-02","phone-call-01","phone","piggy-bank-01","pin-01","pin-02","plane","play-circle","play-square","podcast","power-02","presentation-chart-01","printer","receipt","recording-01","recording-02","recording-03","rocket-01","rocket-02","roller-brush","rss-01","rss-02","ruler","scales-01","scales-02","server-06","shield-01","shield-02","shield-03","shield-dollar","shield-zap","shopping-bag-01","shopping-cart-01","signal-01","signal-02","signal-03","simcard","sliders-01","sliders-02","snowflake-01","snowflake-02","speaker-01","speaker-02","speaker-03","speedometer-01","speedometer-02","speedometer-03","speedometer-04","square","stand","star-03","star-07","sticker-circle","sticker-square","sun-setting-01","sun-setting-02","sun-setting-03","sun","sunrise","sunset","tablet-01","tag-01","tag-02","tag-03","target-01","target-02","target-03","target-04","target-05","terminal-browser","terminal-circle","terminal-square","thermometer-02","thermometer-03","thermometer-cold","thermometer-warm","thumbs-down","thumbs-up","ticket-01","tool-01","tool-02","train","tram","translate-01","triangle","trophy-01","trophy-02","truck-01","truck-02","tv-02","umbrella-01","umbrella-02","umbrella-03","virus","voicemail","wallet-01","wallet-02","wallet-05","watch-circle","watch-square","waves","webcam-01","webcam-02","wind-01","wind-02","wind-03","youtube","zap-circle","zap-fast","zap"];var v$e=uD.light.red.background;var lD="^\\S(.*\\S)?$",dD=128,fD=256,gD=n.Object({key:n.String(),value:n.String()},{title:"Tag"}),yD=n.Object({key:n.String({maxLength:dD}),value:n.String({maxLength:fD,pattern:lD})},{title:"Tag"}),Pn=n.Array(gD,{title:"Tags",description:"List of key/value tags applied to the resource"}),Un=n.Array(yD,{title:"Tags",maxItems:50,description:"List of key/value tags applied to the resource"}),We=n.Optional(Pn),mt=n.Optional(Un);var zr="/v0/teams",Ns=["public","private"],Us={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},ED=n.Enum([Us.NAME,Us.CREATED_AT,Us.MEMBER_COUNT,Us.VISIBILITY]),QA=n.Object({color:n.Enum(du),mode:n.Enum(fu),iconName:n.Enum(YA)}),gu=n.Object({color:n.Enum(du),mode:n.Enum(fu)}),ID=100,TD=250,Ro=n.Object({id:n.String({description:"Identifier of the team"}),name:n.String({description:"Human readable team name displayed throughout the app"}),description:n.Optional(n.String()),visibility:n.Enum(Ns,{description:"Controls whether the resources of the team are discoverable by users"}),tags:We,createdAt:T(),updatedAt:T(),memberCount:n.Optional(n.Number({description:"Number of members currently in the team"})),avatar:n.Optional(QA)}),Ls=n.Object({name:n.String({minLength:1,maxLength:ID,description:"Name to assign to the team"}),description:n.Optional(n.String({maxLength:TD})),visibility:n.Enum(Ns,{description:"Controls whether the resources of the team are discoverable by users"}),tags:mt,avatar:n.Optional(QA)}),_D=n.Object({id:n.String(),name:n.String(),email:n.String(),role:n.Enum(lo),joinedTeamAt:T(),orgRole:n.Enum(ds),avatar:n.Optional(gu)}),W$e=d({tags:["teams"],url:zr,method:"GET",paginated:!0,response:n.Array(Ro),query:n.Object({...oe,includeMemberCount:n.Optional(n.Boolean()),searchQuery:n.Optional(m()),visibility:n.Optional(n.Enum(Ns)),myTeamsOnly:n.Optional(n.Boolean()),sortBy:n.Optional(ED),sortDirection:n.Optional(n.Enum(["asc","desc"]))})}),Z$e=d({tags:["teams"],url:`${zr}/:id`,method:"GET",params:n.Object({id:m()}),response:Ro}),X$e=d({tags:["teams"],url:`${zr}/:id/members`,method:"GET",params:n.Object({id:m()}),response:n.Array(_D)}),J$e=d({tags:["teams"],url:`${zr}/:id/assets`,method:"GET",params:n.Object({id:m()}),response:n.Object({apiKeyCount:n.Number(),logRouteCount:n.Number(),monitorCount:n.Number(),notificationRuleCount:n.Number(),dashboardCount:n.Number()})}),eDe=d({tags:["teams"],url:zr,method:"POST",body:Ls,response:Ro}),tDe=d({tags:["teams"],url:`${zr}/:id`,method:"PUT",params:n.Object({id:m()}),body:Ls,response:Ro}),rDe=d({tags:["teams"],url:`${zr}/bulk-update`,method:"POST",body:n.Object({teamIds:n.Array(m(),{maxItems:100}),config:n.Object({visibility:n.Enum(Ns)})}),response:n.Object({})}),nDe=d({tags:["teams"],url:`${zr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v});var hD=n.Enum(["terraform-provider","web-frontend","mcp-server","cli"]),Ce=b("type",[n.Object({type:n.Literal("user"),id:n.String(),name:n.String(),avatar:n.Optional(gu)}),n.Object({type:n.Literal("operation-api-key"),id:n.String(),name:n.String(),source:n.Optional(hD)})]);var Xt="/v0/dashboards",WA=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],OD=["bar","bar-connection","distribution","heatmap","list-connection","list-log-patterns","list","pie","pie-connection","query-value","query-value-connection","table","timeseries-connection","timeseries","top-list-connection","top-list"],IDe=[...OD,"note"];var AD=["ns","us","ms","s","m","h","days"];var SD=["B","KB","MB","GB","TB","PB"];var bD=20;var ZA=n.Object({type:n.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:n.Enum(AD,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),XA=n.Object({type:n.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:n.Enum(SD,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),JA=n.Object({type:n.Literal("percent",{description:"Format values as percentages"})},{$id:"DataNormalizerPercent",title:"Percent"}),eS=n.Object({type:n.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),tS=n.Object({type:n.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),xD=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),RD=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit",maxLength:bD})},{$id:"InputDataNormalizerCustom",title:"Custom"}),Jt=b("type",[ZA,XA,JA,eS,tS,xD],{title:"Normalizer"}),er=b("type",[ZA,XA,JA,eS,tS,RD],{title:"Normalizer"}),rS=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(Jt)},{title:"WidgetListColumn"}),nS=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(er)},{title:"WidgetListColumn"}),Ms=["background","no-background"],CD=["table","legend-only","no-legend"];var PD=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],oS=["alert","warning","success"],Co=n.Object({operator:n.Enum(PD,{description:"Comparator used to evaluate the metric value"}),value:n.Number({description:"Threshold value used when evaluating the operator"}),color:n.Enum(oS,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting"}),UD=n.Object({value:n.Number({description:"Y-axis value where the threshold marker is placed"}),level:n.Enum(oS,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker"}),ND=["sec","min","hour","day"],$s=n.Object({time:n.Number({description:"Number of units that make up each bar bucket"}),metric:n.Enum(ND,{description:"Unit used to measure the bucket width"})});var ks=n.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),LD=n.Object({formula:n.Optional(n.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),n.String({description:"Optional alias for a query (only used for display in the UI)"})))}),kD=n.Object({formula:n.Optional(m({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),m({type:"short",description:"Optional alias for a query (only used for display in the UI)"})))}),yu={source:Fr,queries:R_,formula:n.Optional(C_),aliases:n.Optional(LD),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Eu={source:Fr,queries:Ci,formula:n.Optional(Pi),aliases:n.Optional(kD),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Po={...yu,groupBy:n.Optional(Nc)},Uo={...Eu,groupBy:n.Optional(yo)},nt=n.Enum(CD,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),Ve=n.Optional(n.Number({description:"Number of decimal places to display in the value"})),Vr=n.Optional(n.Array(UD,{description:"Threshold markers displayed on the chart"})),wD=n.Object({name:n.String({description:"Display name of the table column"}),...yu,source:Fr,normalizer:n.Optional(Jt),precision:Ve},{title:"TableColumn"}),MD=n.Object({name:m({description:"Display name of the table column"}),...Eu,source:Fr,normalizer:n.Optional(er),precision:Ve},{title:"TableColumn"}),$D=n.Array(n.Object({id:n.String({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),DD=n.Array(n.Object({id:m({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),iS=["horizontal","vertical"],GD=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:n.String({description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(rS,{description:"Custom columns to display for each log"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"GraphVisualizationList",title:"List"}),vD=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:m({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(nS,{description:"Custom columns to display for each log"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"InputGraphVisualizationList",title:"List"}),ws=b("type",[n.Object({type:n.Literal("auto")}),n.Object({type:n.Literal("number"),value:n.Number()})]),Ds=n.Object({min:ws,max:ws,scale:b("type",[n.Object({type:n.Literal("pow"),exponent:n.Number()}),n.Object({type:n.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:n.Boolean()}),Gs=n.Object({min:ws,max:ws,scale:b("type",[n.Object({type:n.Literal("pow"),exponent:n.Number({minimum:0})}),n.Object({type:n.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:n.Boolean()}),jD=n.Array(n.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),FD=n.Array(n.Integer({minimum:0,maximum:100,description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"});var BD=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(nt),thresholds:Vr,yAxisSettings:n.Optional(Ds)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),qD=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(nt),thresholds:Vr,yAxisSettings:n.Optional(Gs)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),HD=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),query:n.String({description:"The read-only SQL query to execute against the connection."}),listColumns:n.Optional(n.Array(rS,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),KD=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:n.Optional(n.Array(nS,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),zD=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),VD=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),YD=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(nt)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),QD=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(nt)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),WD=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(nt),thresholds:Vr,yAxisSettings:n.Optional(Ds)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),ZD=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(nt),thresholds:Vr,yAxisSettings:n.Optional(Gs)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),XD=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:n.Optional(n.Enum(Ms,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Co,{description:"Conditional formatting rules applied to the displayed value"})),precision:Ve,normalizer:n.Optional(Jt),legendMode:n.Optional(nt)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),JD=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:n.Optional(n.Enum(Ms,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Co,{description:"Conditional formatting rules applied to the displayed value"})),precision:Ve,normalizer:n.Optional(er),legendMode:n.Optional(nt)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),eG=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:n.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(iS,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),tG=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:m({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(iS,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),rG=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Po,timeBucket:n.Optional($s),normalizer:n.Optional(Jt),precision:Ve,legendMode:n.Optional(nt),thresholds:Vr,yAxisSettings:n.Optional(Ds),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),nG=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Uo,timeBucket:n.Optional($s),normalizer:n.Optional(er),precision:Ve,legendMode:n.Optional(nt),thresholds:Vr,yAxisSettings:n.Optional(Gs),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),oG=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Po,normalizer:n.Optional(Jt),precision:Ve,conditions:n.Optional(n.Array(Co,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),iG=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Uo,normalizer:n.Optional(er),precision:Ve,conditions:n.Optional(n.Array(Co,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),aG=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Po,normalizer:n.Optional(Jt),precision:Ve,legendMode:n.Optional(nt)},{$id:"GraphVisualizationPie",title:"Pie"}),sG=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Uo,normalizer:n.Optional(er),precision:Ve,legendMode:n.Optional(nt)},{$id:"InputGraphVisualizationPie",title:"Pie"}),pG=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...yu,backgroundMode:n.Optional(n.Enum(Ms,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Co,{description:"Conditional formatting rules applied to the displayed value"})),precision:Ve,normalizer:n.Optional(Jt),legendMode:n.Optional(nt)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),cG=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...Eu,backgroundMode:n.Optional(n.Enum(Ms,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Co,{description:"Conditional formatting rules applied to the displayed value"})),precision:Ve,normalizer:n.Optional(er),legendMode:n.Optional(nt)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),mG=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Po,timeBucket:n.Optional($s),precision:Ve,normalizer:n.Optional(Jt),thresholds:Vr,legendMode:n.Optional(nt),yAxisSettings:n.Optional(Ds)},{$id:"GraphVisualizationBar",title:"Bar"}),uG=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Uo,timeBucket:n.Optional($s),precision:Ve,normalizer:n.Optional(er),thresholds:Vr,legendMode:n.Optional(nt),yAxisSettings:n.Optional(Gs)},{$id:"InputGraphVisualizationBar",title:"Bar"}),lG=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Po,precision:Ve,normalizer:n.Optional(Jt),percentileMarkers:n.Optional(jD)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),dG=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Uo,precision:Ve,normalizer:n.Optional(er),percentileMarkers:n.Optional(FD)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),fG=["red","pink","violet","blue","cyan","green","yellow","orange"],aS=n.Enum(fG,{description:"Color palette used to render the heatmap intensity gradient"}),gG=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Po,precision:Ve,normalizer:n.Optional(Jt),palette:n.Optional(aS)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),yG=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Uo,precision:Ve,normalizer:n.Optional(er),palette:n.Optional(aS)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),EG=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(wD,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(Nc),defaultSorting:n.Optional($D)},{$id:"GraphVisualizationTable",title:"Table"}),IG=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(MD,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(yo),defaultSorting:n.Optional(DD)},{$id:"InputGraphVisualizationTable",title:"Table"}),TG=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(n.String({description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(WA,{description:"Background color used to render the note"})),noteAlign:n.Optional(ks),noteJustifyContent:n.Optional(ks)},{$id:"GraphVisualizationNote",title:"Note"}),_G=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(m({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(WA,{description:"Background color used to render the note"})),noteAlign:n.Optional(ks),noteJustifyContent:n.Optional(ks)},{$id:"InputGraphVisualizationNote",title:"Note"}),hG=b("type",[BD,HD,zD,YD,WD,XD,rG,oG,aG,pG,mG,lG,gG,EG,GD,TG,eG]),OG=b("type",[qD,KD,VD,QD,ZD,JD,nG,iG,sG,cG,uG,dG,yG,IG,vD,_G,tG]),vs=n.Object({id:n.String({description:"Identifier of the graph widget"}),name:n.Optional(n.String({description:"Display name of the graph widget"})),description:n.Optional(n.String({description:"Description of the graph widget"})),visualization:hG,layout:n.Optional(n.Object({x:n.Number({description:"Horizontal grid position of the widget"}),y:n.Number({description:"Vertical grid position of the widget"}),w:n.Number({description:"Width of the widget in grid units"}),h:n.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),js=n.Object({id:m({description:"Identifier of the graph widget"}),name:n.Optional(m({description:"Display name of the graph widget"})),description:n.Optional(n.String({minLength:1,maxLength:800,description:"Description of the graph widget"})),visualization:OG,layout:n.Optional(n.Object({x:n.Number({description:"Horizontal grid position of the widget"}),y:n.Number({description:"Vertical grid position of the widget"}),w:n.Number({description:"Width of the widget in grid units"}),h:n.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),AG=10,SG=n.Array(n.Object({key:n.String({description:"Filter key"}),values:n.Array(n.String({description:"Filter value"}))}),{description:"Filters applied to every widget on the dashboard"}),bG=n.Array(n.Object({key:m({description:"Filter key"}),values:n.Array(m({description:"Filter value"}))}),{maxItems:AG,description:"Filters applied to every widget on the dashboard"}),Nn=n.Object({id:n.String({description:"Identifier of the dashboard"}),name:n.String({description:"Display name of the dashboard"}),owner:n.String({description:"Team ID that owns and manages the dashboard"}),graphs:n.Array(vs,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(SG),createdAt:T(),updatedAt:T(),creator:n.Optional(Ce),updater:n.Optional(Ce),tags:We,timePreset:n.Optional(n.Enum(Cc))}),Fs=n.Object({name:m({description:"Display name of the dashboard"}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the dashboard"}),graphs:n.Array(js,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(bG),tags:mt,timePreset:n.Optional(n.Enum(Cc))}),Iu=n.Object({...oe,owners:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Filter by owner team IDs"}))}),TDe=d({tags:["dashboards"],url:Xt,method:"GET",query:Iu,paginated:!0,response:n.Array(Nn)}),Dt={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},sS=[Dt.OWNER,Dt.TAGS,Dt.WIDGET_COUNT,Dt.UPDATED_AT,Dt.NAME],Bs=n.Partial(n.Object({owners:pr(m({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:m({allowEmpty:!1}),exclude:n.Optional(n.Boolean({description:"If true, exclude dashboards matching this value instead of including them"}))},{description:"Substring matched against the dashboard name"}),tags:pr(Un.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50})},{description:"Optional filters applied to narrow the returned dashboards"})),xG=n.Partial(n.Object({...oe,filters:Bs,sort:n.Object({by:n.Enum([Dt.IS_FAVORITE,Dt.OWNER,Dt.TAGS,Dt.WIDGET_COUNT,Dt.UPDATED_AT,Dt.NAME],{description:"Field to sort the returned dashboards by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})})),_De=d({tags:["dashboards"],url:`${Xt}/query`,method:"POST",paginated:!0,response:n.Array(Nn),body:xG}),hDe=d({tags:["dashboards"],url:`${Xt}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(Bs,["tags"]))}),response:Pn}),ODe=d({tags:["dashboards"],url:`${Xt}/:id`,method:"GET",params:n.Object({id:m()}),response:Nn}),ADe=d({tags:["dashboards"],url:Xt,method:"POST",body:Fs,response:Nn}),SDe=d({tags:["dashboards"],url:`${Xt}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Partial(Fs),response:Nn}),bDe=d({tags:["dashboards"],url:`${Xt}/bulk-update`,method:"PUT",body:n.Object({dashboardIds:n.Array(m()),owner:m({allowEmpty:!1})}),response:n.Object({})}),xDe=d({tags:["dashboards"],url:`${Xt}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),RDe=d({tags:["dashboards"],url:`${Xt}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:m({allowEmpty:!1}),graphId:m({allowEmpty:!1})}),body:n.Omit(js,["id"]),response:vs}),CDe=d({tags:["dashboards"],url:`${Xt}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(m())}),response:n.Object({})});var Ln=`/${"v1"}/dashboards`,No=n.Pick(Nn,["id","name","owner","graphs","filters","tags","timePreset"],{$id:"Dashboard",description:"Visualization of telemetry data with customizable graphs and filters"}),RG={id:"123-456-abc",name:"API Performance Overview",owner:"abc-123-def",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(No,{examples:[RG]});var CG=n.Pick(Iu,["limit","offset","owners"]),pS=d({description:"Retrieve all dashboards",operationId:"listDashboards",tags:["dashboards"],url:Ln,method:"GET",paginated:!0,query:CG,response:n.Array(No)}),cS=n.Partial(n.Object({...oe,filters:Bs,sort:n.Object({by:n.Enum([...sS],{description:"Field to sort the returned dashboards by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})})),PG={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"API"},tags:{values:[{key:"service",value:"api-gateway"}]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(cS,{examples:[PG]});var $De=d({description:"Query dashboards with filters, sorting, and pagination",operationId:"queryDashboards",tags:["dashboards"],url:`${Ln}/query`,method:"POST",paginated:!0,body:cS,response:n.Array(No)}),mS=d({description:"Retrieve a dashboard by its id",operationId:"getDashboard",tags:["dashboards"],url:`${Ln}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:No}),Tu=n.Pick(Fs,["name","owner","graphs","filters","tags","timePreset"]),UG={name:"API Performance Overview",owner:"abc-123-def",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(Tu,{examples:[UG]});var uS=d({description:"Create a new dashboard",operationId:"createDashboard",tags:["dashboards"],url:Ln,method:"POST",body:Tu,response:No}),lS=d({description:"Update a dashboard by its id",operationId:"updateDashboard",tags:["dashboards"],url:`${Ln}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:n.Partial(Tu),response:No}),NG=n.Object({id:m({allowEmpty:!1,description:"The dashboard ID to delete"})}),dS=d({description:"Delete a dashboard by its id",operationId:"deleteDashboard",tags:["dashboards"],url:`${Ln}/:id`,method:"DELETE",params:NG,response:v}),DDe=d({description:"Update a single graph within a dashboard by ID.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${Ln}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:m({allowEmpty:!1,description:"The dashboard ID containing the graph"}),graphId:m({allowEmpty:!1,description:"The graph ID to update"})}),body:n.Omit(js,["id"]),response:vs});var LG=100,kG=3,Lo=n.Object({id:n.String(),name:n.String(),keyLastCharacters:n.String(),owner:n.String(),tags:Pn,teamOverrideFields:n.Optional(n.Array(n.String())),updatedAt:T(),createdAt:T(),creator:n.Optional(Ce),updater:n.Optional(Ce),assetUpdatedAt:T()}),qi=n.Object({name:n.String({format:us,minLength:1,maxLength:LG}),owner:m({allowEmpty:!1}),tags:Un,teamOverrideFields:n.Optional(n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:kG}))}),Hi="/v0/ingestion-api-keys",zDe=d({tags:["ingestion-api-keys"],url:Hi,method:"POST",body:qi,response:n.Intersect([Lo,n.Object({key:n.String()})])}),VDe=d({tags:["ingestion-api-keys"],url:Hi,method:"GET",paginated:!0,query:n.Object(oe),response:n.Array(Lo)}),YDe=d({tags:["ingestion-api-keys"],url:`${Hi}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Lo}),QDe=d({tags:["ingestion-api-keys"],url:`${Hi}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:qi,response:Lo}),WDe=d({tags:["ingestion-api-keys"],url:`${Hi}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var Ki=`/${"v1"}/ingestion-api-keys`,zi=n.Pick(Lo,["id","name","owner","tags","teamOverrideFields","keyLastCharacters"],{$id:"IngestionApiKey",description:"API key used to send telemetry data to Tsuga"}),fS={id:"123-456-abc",name:"Production Logs Ingestion",keyLastCharacters:"x7Qm",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(zi,{examples:[fS]});var gS=n.Pick(qi,["name","owner","tags","teamOverrideFields"],{$id:"CreateIngestionApiKeyRequest"}),yS=n.Pick(qi,["name","owner","tags","teamOverrideFields"],{$id:"UpdateIngestionApiKeyRequest"}),ES={name:"Production Logs Ingestion",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(gS,{examples:[ES]});Object.assign(yS,{examples:[ES]});var wG={...fS,key:"tsuga_in:v1:abc123xyx7Qm"},IS=d({description:"Retrieve all ingestion API keys",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:Ki,method:"GET",paginated:!0,query:n.Object(oe),response:n.Array(zi)}),oGe=d({description:"Retrieve an ingestion API key by its id",operationId:"getIngestionApiKey",tags:["ingestion-api-keys"],url:`${Ki}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:zi}),MG=n.Intersect([n.Pick(zi,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),n.Object({key:n.String({description:"The full API key value, returned only at creation time"})})],{title:"IngestionApiKeyCreated",example:wG}),TS=d({description:"Create a new ingestion API key",operationId:"createIngestionApiKey",tags:["ingestion-api-keys"],url:Ki,method:"POST",body:gS,response:MG}),_S=d({description:"Update an ingestion API key by its id",operationId:"updateIngestionApiKey",tags:["ingestion-api-keys"],url:`${Ki}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:yS,response:zi}),hS=d({description:"Delete an ingestion API key by its id",operationId:"deleteIngestionApiKey",tags:["ingestion-api-keys"],url:`${Ki}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var $G={application:{webService:["azure_web_app","gcp_app_engine_service"]},data:{bucket:["aws_s3_bucket","gcp_bucket","azure_blob_storage_container"],messagingService:["aws_kinesis_data_stream","aws_sqs_queue","aws_sns_topic","azure_service_bus_namespace","azure_service_bus_queue","gcp_pubsub_topic","azure_event_grid_topic","azure_event_hub_namespace","azure_event_hub"],fileSystem:["aws_efs","azure_file_share"],contentDeliveryNetwork:["aws_cloudfront_distribution","gcp_cloud_cdn_configuration"],database:["aws_dynamodb_table","aws_elasticache","aws_rds_instance","azure_database_for_mysql_server","azure_database_for_postgres_server","azure_sql_database_server","azure_sql_database","gcp_bigtable_instance","gcp_cloud_sql_instance","gcp_firestore_database","gcp_spanner_instance","azure_cosmos_db_account"],storageAccount:["azure_storage_account"],volume:["aws_ebs_volume","gcp_compute_disk","azure_disk"]},compute:{virtualMachine:["aws_ec2_instance","gcp_compute_instance","azure_compute_virtual_machine"],serverless:["aws_lambda_function","gcp_cloud_run_function","gcp_cloud_run_job","gcp_cloud_run_service","azure_function_app"]},container:{kubernetesCluster:["aws_eks_cluster","gcp_gke_cluster","azure_aks_cluster"],containerRepository:["aws_ecr_repository","gcp_artifact_registry_repository","azure_container_registry"],containerCluster:["aws_ecs_cluster"],containerServiceTask:["aws_ecs_task"],containerService:["aws_ecs_service","azure_container_instance_group"],containerImage:["aws_ecr_image","gcp_artifact_registry_docker_image","azure_container_registry_image"]},network:{virtualNetwork:["aws_vpc","gcp_vpc","azure_virtual_network"],loadBalancer:["aws_elastic_load_balancer","gcp_forwarding_rule","azure_load_balancer","azure_traffic_manager_profile"],targetGroup:["aws_target_group"],certificate:["aws_acm_certificate","gcp_certificate_manager_certificate","azure_app_service_certificate"]}},[pGe,cGe,mGe]=DG($G);function DG(e){let t=[],r=[],o=[],i=Object.keys(e);for(let a of i){t.push(a);let p=e[a];for(let u in p){r.push(u);let l=p[u];Array.isArray(l)&&o.push(...l)}}return[_u(t),_u(r),_u(o)]}function _u(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var hu=n.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),GG=n.Object({versioningStatus:n.Optional(n.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),vG=n.Object({domainName:n.Optional(n.String()),origins:n.Optional(n.Array(n.String()))}),jG=n.Object({allocatedStorageGib:n.Optional(n.Number()),encryptedAtRest:n.Optional(n.Boolean()),engine:n.Optional(n.String()),dynamoDbItemCount:n.Optional(n.Number()),dynamoDbActualSizeGib:n.Optional(n.Number())}),FG=n.Object({version:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnets:n.Optional(n.Array(n.String()))}),BG=n.Object({artifactRegistryFormat:n.Optional(n.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:n.Optional(n.String()),tagMutability:n.Optional(n.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:n.Optional(n.Boolean()),encryptionType:n.Optional(n.String())}),qG=n.Object({status:n.Optional(n.String()),activeServices:n.Optional(n.Number()),pendingTasks:n.Optional(n.Number()),runningTasks:n.Optional(n.Number()),registeredContainerInstances:n.Optional(n.Number()),capacityProviders:n.Optional(n.Array(n.String()))}),HG=n.Object({status:n.Optional(n.String()),desiredStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String()),availabilityZone:n.Optional(n.String()),startedAt:n.Optional(T())}),KG=n.Object({isEncrypted:n.Optional(n.Boolean()),ownerId:n.Optional(n.String()),state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","updating"]))}),zG=n.Object({type:n.Optional(n.String()),osType:n.Optional(n.String()),subnetIds:n.Optional(n.Array(n.String())),nbContainers:n.Optional(n.Number())}),VG=n.Object({digest:n.String(),imageTags:n.Array(n.String()),imageSizeBytes:n.Optional(n.Number()),imagePushedAt:n.Optional(T()),mediaType:n.Optional(n.String()),repositoryName:n.String(),repositoryId:n.Optional(n.String()),scanStatus:n.Optional(n.String())}),YG=n.Object({url:n.Optional(n.String()),maxMessageSizeBytes:n.Optional(n.Number()),messageRetentionHours:n.Optional(n.Number())}),QG=n.Object({runtime:n.Optional(n.String()),memoryAllocationMib:n.Optional(n.Number()),timeoutMs:n.Optional(n.Number()),codeSha256:n.Optional(n.String())}),WG=n.Object({kind:n.Optional(n.String())}),ZG=n.Object({instanceId:n.String(),architecture:n.Optional(n.String()),instanceType:n.Optional(n.String()),operatingSystem:n.Optional(n.String()),memoryMib:n.Optional(n.Number()),vCpus:n.Optional(n.Number()),vpcId:n.Optional(n.String()),k8sClusterId:n.Optional(n.String())}),XG=n.Object({id:n.Optional(n.String()),ipCidrBlocks:n.Array(n.String())}),JG=n.Object({protocol:n.Optional(hu),port:n.Optional(n.Number()),instanceProtocol:n.Optional(hu),instancePort:n.Optional(n.Number())}),ev=n.Object({protocol:n.Optional(n.String()),ports:n.Optional(n.Array(n.String())),portRange:n.Optional(n.String()),allPorts:n.Optional(n.Boolean())}),tv=n.Object({name:n.String(),ip:n.Optional(n.String()),type:n.Enum(["public","private"])}),rv=n.Object({type:n.String(),name:n.String()}),nv=n.Object({frontendIp:n.Optional(tv),backendIpPools:n.Array(rv)}),ov=n.Object({targetId:n.String(),targetPort:n.Optional(n.Number()),targetType:n.Optional(n.Enum(["instance","ip","lambda","alb"])),healthState:n.Optional(n.String()),healthReason:n.Optional(n.String()),healthDescription:n.Optional(n.String()),availabilityZone:n.Optional(n.String())}),iv=n.Object({protocol:n.Optional(hu),port:n.Optional(n.Number()),type:n.Optional(n.Enum(["alb","lambda","instance","ip"])),name:n.Optional(n.String()),targetGroupArn:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),healthCheckProtocol:n.Optional(n.String()),healthCheckPort:n.Optional(n.String()),healthCheckPath:n.Optional(n.String()),healthCheckIntervalSeconds:n.Optional(n.Number()),healthCheckTimeoutSeconds:n.Optional(n.Number()),healthyThresholdCount:n.Optional(n.Number()),unhealthyThresholdCount:n.Optional(n.Number()),targets:n.Optional(n.Array(ov)),targetCount:n.Optional(n.Number()),healthyTargetCount:n.Optional(n.Number()),loadBalancerArns:n.Optional(n.Array(n.String()))}),av=n.Object({first:n.Optional(n.String()),last:n.Optional(n.String()),scope:n.Optional(n.Number())}),sv=n.Object({type:n.Optional(n.String()),name:n.Optional(n.String()),alwaysServe:n.Optional(n.Boolean()),subnets:n.Optional(n.Array(n.Union([n.Number(),av]))),target:n.Optional(n.String()),weight:n.Optional(n.Number()),priority:n.Optional(n.Number()),status:n.Optional(n.String())}),pv=n.Object({instanceId:n.Optional(n.String()),state:n.Optional(n.String()),reasonCode:n.Optional(n.String()),description:n.Optional(n.String())}),cv=n.Object({loadBalancerType:n.Optional(n.String()),dnsName:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnetIds:n.Array(n.String()),scheme:n.Optional(n.String()),listeners:n.Optional(n.Union([n.Array(JG),n.Array(ev)])),targets:n.Optional(n.Union([n.Array(n.String()),n.Array(pv),n.Array(sv)])),azureLoadBalancingRules:n.Optional(n.Array(nv))}),mv=n.Object({domainName:n.Optional(n.String()),expiresAt:n.Optional(T()),inUseBy:n.Optional(n.Array(n.String())),renewalEligibility:n.Optional(n.String()),revokedAt:n.Optional(T()),status:n.Optional(n.String()),type:n.Optional(n.String())}),uv=n.Object({state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:n.Optional(n.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),lv=n.Object({osType:n.Optional(n.Enum(["Windows","Linux"]))}),dv=n.Object({state:n.Optional(n.String()),volumeType:n.Optional(n.String())}),fv=n.Intersect([n.Object({isEncrypted:n.Optional(n.Boolean()),sizeGib:n.Optional(n.Number())}),n.Union([uv,dv,lv])]),gv=n.Object({instanceCount:n.Optional(n.Number()),hostnames:n.Optional(n.Array(n.String())),runtime:n.Optional(n.String())}),qs=n.Union([n.Object({category:n.Literal("application"),resourceType:n.Literal("webService"),attributes:n.Optional(gv)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("bucket"),attributes:n.Optional(GG)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("messagingService"),attributes:n.Optional(YG)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("fileSystem"),attributes:n.Optional(KG)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("contentDeliveryNetwork"),attributes:n.Optional(vG)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("database"),attributes:n.Optional(jG)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("storageAccount"),attributes:n.Optional(WG)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("volume"),attributes:n.Optional(fv)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("virtualMachine"),attributes:n.Optional(ZG)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("serverless"),attributes:n.Optional(QG)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("kubernetesCluster"),attributes:n.Optional(FG)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerRepository"),attributes:n.Optional(BG)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerCluster"),attributes:n.Optional(qG)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerServiceTask"),attributes:n.Optional(HG)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerService"),attributes:n.Optional(zG)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerImage"),attributes:n.Optional(VG)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("virtualNetwork"),attributes:n.Optional(XG)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("loadBalancer"),attributes:cv}),n.Object({category:n.Literal("network"),resourceType:n.Literal("targetGroup"),attributes:n.Optional(iv)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("certificate"),attributes:n.Optional(mv)})]);var Vi="/v0/inventory",Ou=["aws","gcp","azure"],OS=["scan_in_progress","success","failure"],Au=n.Object({id:n.String({description:"Identifier of the inventory resource"}),cloudPlatform:n.Enum(Ou,{description:"Cloud platform that hosts this resource"}),cloudAccount:n.String({description:"Cloud-native account identifier the resource was discovered in"}),cloudRegion:n.Optional(n.String({description:"Cloud region the resource was discovered in, when applicable"})),fullyQualifiedResourceId:n.String({description:"Cloud-native unique identifier for this resource (for example an AWS ARN or GCP resource name)"}),displayName:n.String({description:"Human-readable name shown in the Tsuga UI"}),nativeResourceType:n.String({description:"Cloud-native resource type, for example aws_ec2_instance or gcp_bucket"}),resourceCreatedAt:n.Optional(T({description:"When the resource was created in the cloud, when known"})),resourceUpdatedAt:n.Optional(T({description:"When the resource was last updated in the cloud, when known"})),resourceLastSeenAt:T({description:"When this resource was last observed during an inventory scan"}),tags:We,nativeAttributes:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),covered:n.Optional(n.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),IGe=d({tags:["inventory"],method:"GET",url:`${Vi}/resources`,paginated:!0,query:n.Object(oe),response:n.Array(n.Intersect([Au,qs]))}),yv=b("type",[n.Object({type:n.Literal("aws"),accountId:n.String(),externalId:n.String(),roleArn:n.String()}),n.Object({type:n.Literal("gcp"),projectId:n.String(),serviceAccountId:n.String(),workloadIdentityProvider:n.String()}),n.Object({type:n.Literal("azure"),clientId:n.String(),subscriptionId:n.String(),tenantId:n.String()})]),Ev=n.Object({type:n.Literal("aws"),accountId:m(),externalId:m(),roleArn:m()}),Iv=n.Object({type:n.Literal("gcp"),projectId:m(),serviceAccountId:m(),workloadIdentityProvider:m()}),Tv=n.Object({type:n.Literal("azure"),clientId:m(),subscriptionId:m(),tenantId:m()}),AS=b("type",[Ev,Iv,Tv]),Hs=n.Object({id:n.String(),cloudType:n.Enum(Ou),cloudAccountId:n.String(),accountFriendlyName:n.Optional(n.String()),organizationId:n.Optional(n.String()),connectionSettings:yv,createdBy:n.Optional(n.String()),createdAt:T(),lastScanStartedAt:n.Optional(T()),lastScanFinishedAt:n.Optional(T()),lastScanStatus:n.Optional(n.Enum(OS))}),_v=n.Object({cloudType:n.Enum(Ou),cloudAccountId:m(),accountFriendlyName:n.Optional(m()),organizationId:n.Optional(m()),connectionSettings:AS,lastScanStatus:n.Optional(n.Enum(OS))}),kn=`${Vi}/cloud-accounts`,TGe=d({tags:["inventory"],url:kn,method:"GET",response:n.Array(Hs)}),_Ge=d({tags:["inventory"],url:`${kn}/:id`,method:"GET",params:n.Object({id:m()}),response:Hs}),hGe=d({tags:["inventory"],url:kn,method:"POST",body:_v,response:Hs}),OGe=d({tags:["inventory"],url:`${kn}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Object({accountFriendlyName:m()}),response:Hs}),AGe=d({tags:["inventory"],url:`${kn}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),SGe=d({tags:["inventory"],url:`${Vi}/trigger-scan`,method:"POST",body:n.Object({}),response:n.Object({success:n.Literal(!0)})}),bGe=d({tags:["inventory"],url:`${kn}/azure/onboarding`,method:"POST",body:n.Object({tenantId:m()}),response:n.Object({subjectId:n.String(),audience:n.String()})}),xGe=d({tags:["inventory"],method:"POST",url:`${kn}/validate/:type`,params:n.Object({type:m()}),body:n.Object({data:AS,id:n.Optional(m())}),response:n.Object({areAccountSettingsValid:n.Boolean(),message:n.Optional(n.String())})}),SS=`${Vi}/settings`,RGe=d({tags:["inventory"],url:SS,method:"GET",response:n.Object({settings:n.Optional(n.Object({id:n.String(),infrastructureIdentifiers:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))}))})}),CGe=d({tags:["inventory"],url:SS,method:"POST",body:n.Object({infrastructureIdentifiers:n.Array(n.Object({name:m({allowEmpty:!1}),value:n.Optional(m({allowEmpty:!1}))}),{maxItems:50})}),response:n.Object({})}),PGe=d({tags:["inventory"],url:`${Vi}/iac-tags-proposal`,method:"GET",response:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))});var hv=`/${"v1"}/inventory`,Ov=n.Omit(Au,["nativeAttributes","covered"],{$id:"InventoryResourceBase",description:"Base fields of a cloud resource discovered by an inventory scan"}),bS=n.Intersect([Ov,qs],{$id:"InventoryResource",description:"A cloud resource discovered by an inventory scan, together with its category, type and category-specific attributes"}),Av={id:"123-456-abc",cloudPlatform:"aws",cloudAccount:"123456789012",cloudRegion:"us-east-1",fullyQualifiedResourceId:"arn:aws:s3:::tsuga-example-bucket",displayName:"tsuga-example-bucket",nativeResourceType:"aws_s3_bucket",resourceCreatedAt:"2024-01-01T08:00:00.000Z",resourceLastSeenAt:"2024-01-15T12:34:56.000Z",tags:[{key:"team",value:"platform"}],category:"data",resourceType:"bucket",attributes:{versioningStatus:"Enabled"}};Object.assign(bS,{examples:[Av]});var xS=d({description:"Retrieve all cloud resources discovered by inventory scans",operationId:"listInventoryResources",tags:["inventory"],url:`${hv}/resources`,method:"GET",paginated:!0,query:n.Object(oe),response:n.Array(bS)});var Sv={"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"crawler-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["admin"]},"asset-change":{read:["public_viewer","public_editor","admin"],write:[]},"inventory-settings":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-members":{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]}},bv={"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"asset-change":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"crawler-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"inventory-settings":{read:["viewer","editor","admin"],write:["editor","admin"]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:[]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:["admin"],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]}},xv={user:Sv,team:bv};function Su(e){return RS(e,"team")}function bu(e){return RS(e,"user")}function RS(e,t){let r=[],o=xv[t];for(let[i,a]of Object.entries(o))for(let[p,u]of Object.entries(a))u.includes(e)&&r.push({actionType:p,resourceType:i});return r}var BGe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:bu("admin"),roleKey:"admin"},public_editor:{name:"Public editor",description:"Can view and edit assets in public teams, but not access private teams or critical settings.",permissions:bu("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:bu("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},qGe={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:Su("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:Su("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:Su("viewer"),roleKey:"viewer"}};var CS=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757119",isUsingLuhnAlgorithm:!1,regexp:"([12])\\s*[0-9]{2}\\s*(0[1-9]|1[0-2])\\s*(2[AB]|[0-9]{2})\\s*([0-9]{3})\\s*([0-9]{3})(\\s*[0-9]{2})?"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
33
+ `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]),Ry=(e,t=[])=>c(c(rc(e),([r,o])=>c(NN(o),([i,a])=>[[r,i],a])),([r,o])=>Ry(o,[...t,r]),()=>[t,e]),LN=e=>c(c(Ry(e),([t,r])=>c(c(c(rc(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>c([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Ng(t),r]),rc=e=>c(c(UN(e),([t,r])=>c(c(xN(r),([o,i])=>[o,i],()=>c(RN(r),([o,i])=>[o,i],()=>c(CN(r),([o,i])=>[o,i],()=>c(PN(r),([o,i])=>[o,i],()=>[])))),([o,i])=>c(Jg(i),([a,p])=>[[t,o,a],p]))),([t,r])=>[Lg(t),r]),kN=e=>c(c(rc(e),([t,r])=>c(LN(r),([o,i])=>[[t,o],i])),([t,r])=>[kg(t),r]),Cy=e=>c(c(kN(e),([t,r])=>[t,r],()=>c(DU(e),([t,r])=>[t,r],()=>c(Z(e),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]);function Py(e){let t=Xp(`\`${e}\``);return s.IsEqual(t.length,2)?t[0]:F()}function Jo(e,t={}){return C("TemplateLiteral",[e],t)}function Uy(e){return R({},Jo(e,{}))}function wN(e){let t=Py(e);return Uy(t)}function Ny(e,t={}){let r=s.IsString(e)?wN(e):Uy(e);return g.Update(r,{},t)}function Oe(e){return h(e,"TemplateLiteral")}var L={};bt(L,{ExtendsFalse:()=>j,ExtendsTrue:()=>b,ExtendsUnion:()=>nc,IsExtendsFalse:()=>DN,IsExtendsTrue:()=>ky,IsExtendsTrueLike:()=>Ie,IsExtendsUnion:()=>Ly});function nc(e){return g.Create({"~kind":"ExtendsUnion"},{inferred:e})}function Ly(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsUnion")&&s.IsObject(e.inferred)}function b(e){return g.Create({"~kind":"ExtendsTrue"},{inferred:e})}function ky(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsTrue")&&s.IsObject(e.inferred)}function j(){return g.Create({"~kind":"ExtendsFalse"},{})}function DN(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function Ie(e){return Ly(e)||ky(e)}function ns(e){let t=Sy(e);return s.IsEqual(t.length,2)?t[0]:F()}function $N(e){return!0}function My(e){let[t,...r]=e;return A(t)?GN(t)?My(r):!1:!0}function wy(e){return s.IsEqual(e.length,0)?!1:My(e)}function GN(e){return O(e)?wy(e.anyOf):W(e)?$N(e.const):!1}function os(e){return wy(e)}function Dy(e,t,r=[]){let[o,...i]=e;return s.IsString(o)?Dy(i,t,[...r,`${o}${t}`]):r}function vN(e,t){return s.IsEqual(e.length,0)?[`${t}`]:Dy(e,t)}function $y(e,t,r=[]){let[o,...i]=t;return A(o)?$y(e,i,[...r,...Gy(e,o)]):r}function Gy(e,t){return O(t)?$y(e,t.anyOf):W(t)?vN(e,t.const):F()}function vy(e,t){let[r,...o]=t;return A(r)?vy(Gy(e,r),o):e}function jN(e){return e.map(t=>K(t))}function FN(e){let t=vy([],e),r=jN(t);return v(r)}function BN(e){return s.IsEqual(e.length,0)?F():s.IsEqual(e.length,1)&&W(e[0])?e[0]:FN(e)}function ze(e){let t=ns(e);return os(t)?BN(t):ct()}function qN(e){return s.IsString(e)||s.IsNumber(e)?K(e):s.IsNull(e)?Nr():Y()}function kt(e){return e.map(r=>qN(r))}function Ii(e){let t=kt(e);return v(t)}function un(e){return Ii(e.enum)}function HN(e,t,r,o){let i=te(e,r,o);return Ie(i)?b(g.Assign(g.Assign(e,i.inferred),{[t]:r})):j()}function KN(e,t){return b(e)}function zN(e,t,r){let o=Ii(r);return te(e,t,o)}function jy(e,t,r){let[o,...i]=r;return A(o)?(()=>{let a=te(e,t,o);return Ie(a)?jy(a.inferred,t,i):j()})():b(e)}function VN(e,t,r){let o=ze(r);return te(e,t,o)}function Fy(e,t,r){let[o,...i]=r;return A(o)?(()=>{let a=te(e,t,o);return Ie(a)?b(a.inferred):Fy(e,t,i)})():j()}function B(e,t,r){return Je(r)?KN(e,t):he(r)?zN(e,t,r.enum):_e(r)?HN(e,r.name,t,r.extends):U(r)?jy(e,t,r.allOf):Oe(r)?VN(e,t,r.pattern):O(r)?Fy(e,t,r.anyOf):pt(r)?b(e):j()}function By(e,t,r){return _e(r)?B(e,t,r):Je(r)?b(e):pt(r)?b(e):nc(e)}function YN(e,t){let r=nn(e),o=nn(t);return r&&o||!r&&o?!0:!(r&&!o)}function qy(e,t,r,o){return J(o)?YN(t,o)?te(e,r,o.items):j():B(e,t,o)}function Hy(e,t,r){return Qe(r)?te(e,t,r.iteratorItems):B(e,Ft(t),r)}function Ky(e,t,r){return lt(r)?b(e):B(e,t,r)}function zy(e,t,r){return tt(r)?b(e):B(e,t,r)}function QN(e,t,r,o,i){let a=_e(o)?t:o,p=_e(o)?o:t,u=Pe(t),l=Pe(o),f=te(e,a,p);return!u&&l?j():Ie(f)?Ti(f.inferred,r,i):j()}function WN(e,t,r,o){let[i,...a]=o;return A(i)?QN(e,t,r,i,a):Pe(t)?b(e):j()}function ZN(e,t,r){let[o,...i]=t;return A(o)?WN(e,o,i,r):b(e)}function Ti(e,t,r){return ZN(e,t,r)}function is(e,t,r){return ft(r)?b(e):te(e,t,r)}function Vy(e,t,r,o){return Ue(o)?(()=>{let i=Ti(e,t,o.parameters);return Ie(i)?is(i.inferred,r,o.instanceType):j()})():j()}function Yy(e,t,r){return te(e,un(t),r)}function Qy(e,t,r,o){return Ne(o)?(()=>{let i=Ti(e,t,o.parameters);return Ie(i)?is(i.inferred,r,o.returnType):j()})():j()}function Wy(e,t,r){return we(r)?b(e):ge(r)?b(e):B(e,t,r)}var _i="equal",XN="disjoint",hi="left-inside",Oi="right-inside";function Ai(e,t){let r=[pt(e)?L.ExtendsFalse():Ye({},e,t),pt(e)?L.ExtendsTrue({}):Ye({},t,e)];return L.IsExtendsTrueLike(r[0])&&L.IsExtendsTrueLike(r[1])?_i:L.IsExtendsTrueLike(r[0])&&L.IsExtendsFalse(r[1])?hi:L.IsExtendsFalse(r[0])&&L.IsExtendsTrueLike(r[1])?Oi:XN}function JN(e){return O(e)?Qt(e.anyOf):[e]}function Qt(e){return e.reduce((t,r)=>[...t,...JN(r)],[])}function oc(e){return e.reduceRight((r,o,i)=>({[i]:o,...r}),{})}function Zy(e){let t=oc(e.items);return N(t)}function eL(e,t){return on(e)?!!on(t):!1}function tL(e,t){return Pe(e)?!!Pe(t):!1}function rL(e,t){let r=eL(e,t),o=tL(e,t),i=Ae([e,t]),a=ka(qn(i));return r&&o?st(at(a)):r&&!o?st(a):!r&&o?at(a):a}function nL(e,t,r){return r in e?r in t?rL(e[r],t[r]):e[r]:r in t?t[r]:Y()}function oL(e,t){return[...new Set([...s.Keys(t),...s.Keys(e)])].reduce((o,i)=>({...o,[i]:nL(e,t,i)}),{})}function Xy(e){return M(e)?e.properties:z(e)?oc(e.items):F()}function Jy(e,t){let r=Xy(e),o=Xy(t),i=oL(r,o);return N(i)}function eE(e,t){let r=Ai(e,t);return s.IsEqual(r,hi)?e:s.IsEqual(r,Oi)||s.IsEqual(r,_i)?t:Y()}function tE(e){return M(e)||z(e)}function rE(e){return U(e)?Ae(e.allOf):e}function iL(e,t){let r=rE(e),o=rE(t),i=tE(r),a=tE(o);return i&&a?Jy(wr(r),o):i&&!a?wr(r):!i&&a?o:eE(wr(r),o)}function nE(e,t,r=[]){let[o,...i]=t;return s.IsUndefined(o)?r.length===0?[e]:r:nE(e,i,[...r,iL(e,o)])}function oE(e,t,r=[]){let[o,...i]=e;return A(o)?oE(i,t,[...r,...Si([o],t)]):r}function Si(e,t=[]){let[r,...o]=e;return A(r)?O(r)?Si(o,oE(r.anyOf,t)):Si(o,nE(r,t)):t}function Ae(e){let t=Si(e);return ic(t)}function ar(e){return ic(e)}function wr(e){return U(e)?Ae(e.allOf):O(e)?ar(e.anyOf):e}function ln(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?Y():v(e)}function aL(e,t){return t.filter(r=>Ai(e,r)!==Oi)}function sL(e,t){let r=t.some(o=>{let i=Ai(e,o);return s.IsEqual(i,hi)||s.IsEqual(i,_i)});return s.IsEqual(r,!1)}function pL(e,t){let r=wr(e);return Je(r)?[r]:sL(r,t)?[...aL(r,t),r]:t}function ac(e,t=[]){let[r,...o]=e;return A(r)?M(r)?ac(o,[...t,r]):ac(o,pL(r,t)):t}function ic(e){let t=ac(e),r=Qt(t);return r.length===0?Y():r.length===1?r[0]:v(r)}function cL(e,t,r,o){let i=_(e,t,r);return g.Update(wr(i),{},o)}function iE(e,t,r,o){return cL(e,t,r,o)}function aE(e,t,r){let o=Ae(t);return te(e,o,r)}function sE(e,t,r){return We(r)?te(e,t,r.iteratorItems):B(e,qt(t),r)}function as(e,t,r){return t===r?b(e):j()}function mL(e,t,r){return W(r)?as(e,t,r.const):lt(r)?b(e):B(e,K(t),r)}function uL(e,t,r){return W(r)?as(e,t,r.const):tt(r)?b(e):B(e,K(t),r)}function lL(e,t,r){return W(r)?as(e,t,r.const):ge(r)?b(e):B(e,K(t),r)}function dL(e,t,r){return W(r)?as(e,t,r.const):xe(r)?b(e):B(e,K(t),r)}function pE(e,t,r){return s.IsBigInt(t.const)?mL(e,t.const,r):s.IsBoolean(t.const)?uL(e,t.const,r):s.IsNumber(t.const)?lL(e,t.const,r):s.IsString(t.const)?dL(e,t.const,r):F()}function cE(e,t,r){return _e(r)?B(e,t,r):b(e)}function mE(e,t,r){return Ht(r)?b(e):B(e,t,r)}function uE(e,t,r){return ge(r)?b(e):B(e,t,r)}function fL(e,t,r){return Pe(t)?Pe(r)?b(e):j():b(e)}function gL(e,t,r){return _e(r)&&or(r.extends)?j():(()=>{let o=te(e,t,r);return Ie(o)?fL(o.inferred,t,r):j()})()}function yL(e,t){return e.reduce((r,o)=>o in t?Ie(t[o])?{...r,...t[o].inferred}:F():F(),{})}function EL(e,t,r){let o={};for(let p of s.Keys(r))o[p]=p in t?gL({},t[p],r[p]):Pe(r[p])?_e(r[p])?b(g.Assign(e,{[r[p].name]:r[p].extends})):b(e):j();let i=s.Values(o).every(p=>Ie(p)),a=i?yL(s.Keys(o),o):{};return i?b(a):j()}function IL(e,t,r){let o=EL(e,t,r);return Ie(o)?b(g.Assign(e,o.inferred)):j()}function TL(e,t,r){return IL(e,t,r)}function lE(e,t,r){return M(r)?TL(e,t,r.properties):B(e,N(t),r)}function dE(e,t,r){return He(r)?te(e,t,r.item):B(e,zt(t),r)}function fE(e,t,r){return xe(r)?b(e):B(e,t,r)}function gE(e,t,r){return Kt(r)?b(e):B(e,t,r)}function yE(e,t,r){let o=ze(t);return te(e,o,r)}function sc(e,t){return g.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function bi(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"name")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"Inferrable")&&s.IsString(e.name)&&s.IsObject(e.type)}function pc(e){return Lr(e)?_e(e.items)?J(e.items.extends)?sc(e.items.name,e.items.extends.items):pt(e.items.extends)?sc(e.items.name,e.items.extends):void 0:F():void 0}function ss(e){return _e(e)?sc(e.name,e.extends):void 0}function cc(e,t,r=[]){let[o,...i]=e;return A(o)?(()=>{let a=te({},o,t);return Ie(a)?cc(i,t,[...r,o]):void 0})():r}function EE(e,t,r,o){let i=cc(r,o);return s.IsArray(i)?b(g.Assign(e,{[t]:De(i)})):j()}function ps(e,t,r,o){let i=cc(r,o);return s.IsArray(i)?b(g.Assign(e,{[t]:v(i)})):j()}function _L(e){return[...e].reverse()}function mc(e,t){return t?_L(e):e}function hL(e){let t=e.length>0?e[0]:void 0,r=A(t)?pc(t):void 0;return A(r)}function OL(e,t,r,o,i,a){let p=te(e,r,i);return Ie(p)?IE(p.inferred,t,o,a):j()}function AL(e,t,r,o,i){let a=pc(o);return bi(a)?EE(e,a.name,mc(r,t),a.type):(()=>{let[p,...u]=r;return A(p)?OL(e,t,p,u,o,i):j()})()}function SL(e,t,r,o){let[i,...a]=o;return A(i)?AL(e,t,r,i,a):s.IsEqual(r.length,0)?b(e):j()}function IE(e,t,r,o){return SL(e,t,r,o)}function bL(e,t,r){let o=cs(e,{callstack:[]},r),i=hL(o);return IE(e,i,mc(t,i),mc(o,i))}function TE(e,t,r){let o=ss(r);return bi(o)?ps(e,o.name,t,o.type):(()=>{let[i,...a]=t;return A(i)?(()=>{let p=te(e,i,r);return Ie(p)?TE(p.inferred,a,r):j()})():b(e)})()}function _E(e,t,r){let o=cs(e,{callstack:[]},t);return z(r)?bL(e,o,r.items):J(r)?TE(e,o,r.items):B(e,De(o),r)}function hE(e,t,r){return ft(r)?b(e):Yt(r)?b(e):B(e,t,r)}function OE(e,t,r){let[o,...i]=r;return A(o)?(()=>{let a=te(e,t,o);return Ie(a)?b(a.inferred):OE(e,t,i)})():j()}function uc(e,t,r){let[o,...i]=t;return A(o)?(()=>{let a=OE(e,o,r);return Ie(a)?uc(a.inferred,i,r):j()})():b(e)}function AE(e,t,r){let o=ss(r);return bi(o)?ps(e,o.name,t,o.type):O(r)?uc(e,t,r.anyOf):uc(e,t,[r])}function SE(e,t,r){return _e(r)?B(e,t,r):Je(r)?b(e):pt(r)?b(e):j()}function bE(e,t,r){return ft(r)?b(e):B(e,t,r)}function te(e,t,r){return Je(t)?By(e,t,r):J(t)?qy(e,t,t.items,r):Qe(t)?Hy(e,t.iteratorItems,r):lt(t)?Ky(e,t,r):tt(t)?zy(e,t,r):Ue(t)?Vy(e,t.parameters,t.instanceType,r):he(t)?Yy(e,t,r):Ne(t)?Qy(e,t.parameters,t.returnType,r):we(t)?Wy(e,t,r):U(t)?aE(e,t.allOf,r):We(t)?sE(e,t.iteratorItems,r):W(t)?pE(e,t,r):or(t)?cE(e,t,r):Ht(t)?mE(e,t,r):ge(t)?uE(e,t,r):M(t)?lE(e,t.properties,r):He(t)?dE(e,t.item,r):xe(t)?fE(e,t,r):Kt(t)?gE(e,t,r):Oe(t)?yE(e,t.pattern,r):z(t)?_E(e,t.items,r):Yt(t)?hE(e,t,r):O(t)?AE(e,t.anyOf,r):pt(t)?SE(e,t,r):ft(t)?bE(e,t,r):j()}function to(e,t,r={}){return C("Interface",[e,t],r)}function po(e){return A(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function xE(e,t,r={}){return R({},to(e,t,r))}function xL(e,t,r){return e.includes(r)?!0:Dr([...e,r],t,t[r])}function RE(e,t,r){let o=qa(r);return dn(e,t,o)}function dn(e,t,r){let[o,...i]=r;return A(o)?Dr(e,t,o)?!0:dn(e,t,i):!1}function Dr(e,t,r){return se(r)?xL(e,t,r.$ref):J(r)?Dr(e,t,r.items):Qe(r)?Dr(e,t,r.iteratorItems):Ue(r)?dn(e,t,[...r.parameters,r.instanceType]):Ne(r)?dn(e,t,[...r.parameters,r.returnType]):po(r)?RE(e,t,r.parameters[1]):U(r)?dn(e,t,r.allOf):We(r)?Dr(e,t,r.iteratorItems):M(r)?RE(e,t,r.properties):He(r)?Dr(e,t,r.item):O(r)?dn(e,t,r.anyOf):z(r)?dn(e,t,r.items):ye(r)?Dr(e,t,Ke(r)):!1}function ms(e,t,r){return Dr(e,t,r)}function RL(e,t){return t.reduce((r,o)=>o in e?ms([o],e,e[o])?[...r,o]:r:F(),[])}function CE(e){let t=bd(e);return RL(e,t)}function CL(e,t,r){return r.includes(t)?r:t in e?$r(e,e[t],[...r,t]):F()}function PE(e,t,r){let o=qa(t);return co(e,o,r)}function co(e,t,r){return t.reduce((o,i)=>$r(e,i,o),r)}function $r(e,t,r){return se(t)?CL(e,t.$ref,r):J(t)?$r(e,t.items,r):Qe(t)?$r(e,t.iteratorItems,r):Ue(t)?co(e,[...t.parameters,t.instanceType],r):Ne(t)?co(e,[...t.parameters,t.returnType],r):po(t)?PE(e,t.parameters[1],r):U(t)?co(e,t.allOf,r):We(t)?$r(e,t.iteratorItems,r):M(t)?PE(e,t.properties,r):He(t)?$r(e,t.item,r):O(t)?co(e,t.anyOf,r):z(t)?co(e,t.items,r):ye(t)?$r(e,Ke(t),r):r}function UE(e,t,r){return $r(e,r,[t])}function PL(e){return Kn()}function UL(e){return s.Keys(e).reduce((t,r)=>({...t,[r]:Wt(e[r])}),{})}function xi(e){return e.reduce((t,r)=>[...t,Wt(r)],[])}function Wt(e){return se(e)?PL(e.$ref):J(e)?Lt(Wt(e.items),wa(e)):Qe(e)?Ft(Wt(e.iteratorItems)):Ue(e)?xr(xi(e.parameters),Wt(e.instanceType)):Ne(e)?Rr(xi(e.parameters),Wt(e.returnType)):U(e)?ht(xi(e.allOf)):We(e)?qt(Wt(e.iteratorItems)):M(e)?N(UL(e.properties)):He(e)?zt(Wt(e.item)):ye(e)?Ka(Xn(e),Wt(Ke(e))):O(e)?v(xi(e.anyOf)):z(e)?De(xi(e.items)):e}function NL(e,t){return t in e?Wt(e[t]):Be()}function NE(e){return NL(e.$defs,e.$ref)}function LL(e,t,r){let o=gt(e,{callstack:[]},t),i=Ri({},{callstack:[]},r);return Ae([...o,N(i)])}function kL(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let a=e[i],p=po(a)?LL(e,a.parameters[0],a.parameters[1]):a;return{...o,[i]:p}},{})}function LE(e,t,r){let o=UE(e,t,r),i=kL(e,o);return Bt(i,t)}function kE(e,t){return t in e?se(e[t])?kE(e,e[t].$ref):e[t]:Y()}function Zt(e,t){return kE(e,t)}function ME(e){return pe(e)?NE(e):e}function Ye(e,t,r){let o=ME(t),i=ME(r);return te(e,o,i)}function ML(e,t,r){if(_e(t)||mo(t)||L.IsExtendsTrueLike(Ye({},t,r)))return;let o={parameter:e,extends:r,received:t};throw new Error("Generic argument does not satify constraint",{cause:o})}function wE(e,t,r,o,i){let a=_(e,t,i);return ML(r,a,o),g.Assign(e,{[r]:a})}function wL(e,t,r,o,i){let a=_(e,t,r.extends),p=_(e,t,r.equals),[u,...l]=i;return A(u)?lc(wE(e,t,r.name,a,u),t,o,l):lc(wE(e,t,r.name,a,p),t,o,[])}function lc(e,t,r,o){let[i,...a]=r;return A(i)?wL(e,t,i,a,o):e}function DE(e,t,r,o){return lc(e,t,r,o)}function DL(e){return s.IsGreaterThan(e.length,0)?e[0]:""}function $E(e,t,r,o){let i=gt(e,t,o);return Ya(r,i)}function $L(e,t,r,o){return $E(e,t,be(r),o)}function GL(e,t,r,o,i,a){let p=gt(e,t,a),u=DE(e,t,o,p),l=_(u,{callstack:[...t.callstack,r]},i);return _(e,t,l)}function us(e,t,r,o){let[i,a]=td(e,r,o);return Hn(a)?s.IsEqual(DL(t.callstack),i)?$L(e,t,i,o):GL(e,t,i,a.parameters,a.expression,o):$E(e,t,r,o)}function Ya(e,t){return g.Create({"~kind":"Call"},{target:e,arguments:t},{})}function GE(e,t){return us({},{callstack:[]},e,t)}function mo(e){return h(e,"Call")}function vE(e){return He(e)?vE(e.item):e}function vL(e,t,r,o){let i=_(e,t,r);return g.Update(vE(i),{},o)}function jE(e,t,r,o){return k(e,[r])?vL(e,t,r,o):Ei(r,o)}function FE(e,t){return e(t)}function BE(e,t){return s.IsString(t)?K(FE(e,t)):K(t)}function qE(e,t){let r=ze(t);return sr(e,r)}function HE(e,t){let r=t.map(o=>sr(e,o));return v(r)}function sr(e,t){return W(t)?BE(e,t.const):Oe(t)?qE(e,t.pattern):O(t)?HE(e,t.anyOf):t}function ei(e,t={}){return C("Capitalize",[e],t)}function KE(e,t={}){return R({},ei(e,t))}function ti(e,t={}){return C("Lowercase",[e],t)}function zE(e,t={}){return R({},ti(e,t))}function ri(e,t={}){return C("Uncapitalize",[e],t)}function VE(e,t={}){return R({},ri(e,t))}function ni(e,t={}){return C("Uppercase",[e],t)}function YE(e,t={}){return R({},ni(e,t))}var jL=e=>e[0].toUpperCase()+e.slice(1),FL=e=>e.toLowerCase(),BL=e=>e[0].toLowerCase()+e.slice(1),qL=e=>e.toUpperCase();function HL(e,t,r,o){let i=_(e,t,r);return g.Update(sr(jL,i),{},o)}function QE(e,t,r,o){return k(e,[r])?HL(e,t,r,o):ei(r,o)}function KL(e,t,r,o){let i=_(e,t,r);return g.Update(sr(FL,i),{},o)}function WE(e,t,r,o){return k(e,[r])?KL(e,t,r,o):ti(r,o)}function zL(e,t,r,o){let i=_(e,t,r);return g.Update(sr(BL,i),{},o)}function ZE(e,t,r,o){return k(e,[r])?zL(e,t,r,o):ri(r,o)}function VL(e,t,r,o){let i=_(e,t,r);return g.Update(sr(qL,i),{},o)}function XE(e,t,r,o){return k(e,[r])?VL(e,t,r,o):ni(r,o)}function oi(e,t,r,o,i={}){return C("Conditional",[e,t,r,o],i)}function JE(e,t,r,o,i={}){return R({},oi(e,t,r,o,i))}function YL(e,t,r,o,i,a,p){let u=_(e,t,r),l=_(e,t,o),f=Ye(e,u,l);return g.Update(L.IsExtendsUnion(f)?v([_(f.inferred,t,i),_(e,t,a)]):L.IsExtendsTrue(f)?_(f.inferred,t,i):_(e,t,a),{},p)}function eI(e,t,r,o,i,a,p){return k(e,[r,o])?YL(e,t,r,o,i,a,p):oi(r,o,i,a,p)}function ii(e,t={}){return C("ConstructorParameters",[e],t)}function tI(e,t={}){return R({},ii(e,t))}function QL(e){return Ue(e)?_({},{callstack:[]},De(e.parameters)):Y()}function WL(e,t,r,o){let i=_(e,t,r);return g.Update(QL(i),{},o)}function rI(e,t,r,o){return k(e,[r])?WL(e,t,r,o):ii(r,o)}function ai(e,t,r={}){return C("Exclude",[e,t],r)}function nI(e,t,r={}){return R({},ai(e,t,r))}function oI(e,t){return e.reduce((r,o)=>[...r,...iI(o,t)],[])}function iI(e,t){let r=Ye({},e,t);return L.IsExtendsTrueLike(r)?[]:[e]}function ZL(e,t){let r=he(e)?oI(kt(e.enum),t):O(e)?oI(Qt(e.anyOf),t):iI(e,t);return ar(r)}function XL(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(ZL(a,p),{},i)}function ls(e,t,r,o,i){return k(e,[r,o])?XL(e,t,r,o,i):ai(r,o,i)}function si(e,t,r={}){return C("Extract",[e,t],r)}function aI(e,t,r={}){return R({},si(e,t,r))}function sI(e,t){return e.reduce((r,o)=>[...r,...pI(o,t)],[])}function pI(e,t){let r=Ye({},e,t);return L.IsExtendsTrueLike(r)?[e]:[]}function JL(e,t){let r=he(e)?sI(kt(e.enum),t):O(e)?sI(Qt(e.anyOf),t):pI(e,t);return ar(r)}function ek(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(JL(a,p),{},i)}function cI(e,t,r,o,i){return k(e,[r,o])?ek(e,t,r,o,i):si(r,o,i)}var tk=new RegExp("^(?:0|[1-9][0-9]*)$");function uo(e){let t=`${e}`;return tk.test(t)?parseInt(t):e}function rk(e){return K(uo(e))}function mI(e){return e.map(t=>uI(t))}function uI(e){return U(e)?ht(mI(e.allOf)):O(e)?v(mI(e.anyOf)):W(e)?rk(e.const):e}function lI(e,t){let r=uI(t),o=Ye({},r,Ot());return L.IsExtendsTrueLike(o)?e:Y()}function dI(e,t){let r=Zt(e,t);return Xt(r)}function ds(e){return e.reduce((t,r)=>[...t,...Xt(r)],[])}function fI(e){let t=kt(e);return ds(t)}function gI(e){let t=Ae(e);return Xt(t)}function yI(e){return[`${e}`]}function EI(e){let t=ze(e);return Xt(t)}function Xt(e){return pe(e)?dI(e.$defs,e.$ref):he(e)?fI(e.enum):U(e)?gI(e.allOf):W(e)?yI(e.const):Oe(e)?EI(e.pattern):O(e)?ds(e.anyOf):[]}function lo(e){return Xt(e)}function nk(e,t){return t in e?[e[t]]:[]}function ok(e,t){return t.reduce((r,o)=>[...r,...nk(e,o)],[])}function II(e,t){let r=lo(t),o=ok(e,r);return ar(o)}function ik(e){return K(uo(e))}function TI(e){return e.map(t=>dc(t))}function dc(e){return U(e)?ht(TI(e.allOf)):O(e)?v(TI(e.anyOf)):W(e)?ik(e.const):e}function ak(e,t){return e.reduceRight((r,o,i)=>{let a=Ye({},K(i),t);return L.IsExtendsTrueLike(a)?[o,...r]:r},[])}function sk(e,t){let r=dc(t),o=ak(e,r);return ln(o)}function pk(e){return ln(e)}function _I(e,t){return ge(t)||we(t)?pk(e):sk(e,t)}function ck(e){return e.reduce((t,r)=>Fa(r)?[...t,K(r)]:t,[])}function fo(e){let t=ck(e);return v(t)}function ro(e,t,r={}){return C("Index",[e,t],r)}function hI(e,t,r={}){let o=s.IsArray(t)?fo(t):t;return R({},ro(e,o,r))}function OI(e,t){let r=Zt(e,t);return Mt(r)}function mk(e,t){let r=s.Keys(e).filter(y=>!s.HasPropertyKey(t,y)),o=s.Keys(t).filter(y=>!s.HasPropertyKey(e,y)),i=s.Keys(e).filter(y=>s.HasPropertyKey(t,y)),a=r.reduce((y,I)=>({...y,[I]:e[I]}),{}),p=o.reduce((y,I)=>({...y,[I]:t[I]}),{}),u=i.reduce((y,I)=>({...y,[I]:Ae([e[I],t[I]])}),{}),l=g.Assign(a,p);return g.Assign(l,u)}function AI(e){return e.reduce((t,r)=>mk(t,Mt(r)),{})}function SI(e){let t=Zy(De(e));return Mt(t)}function uk(e,t){return s.Keys(e).filter(i=>i in t).reduce((i,a)=>({...i,[a]:ar([e[a],t[a]])}),{})}function bI(e,t){let[r,...o]=e;return A(r)?bI(o,uk(t,Mt(r))):t}function xI(e){let[t,...r]=e;return A(t)?bI(r,Mt(t)):F()}function Mt(e){return pe(e)?OI(e.$defs,e.$ref):U(e)?AI(e.allOf):O(e)?xI(e.anyOf):z(e)?SI(e.items):M(e)?e.properties:{}}function go(e){let t=Mt(e);return N(t)}function lk(e){return pe(e)||U(e)||O(e)?go(e):e}function dk(e,t){let r=lk(e);return J(r)?lI(r.items,t):M(r)?II(r.properties,t):z(r)?_I(r.items,t):Y()}function fk(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(dk(a,p),{},i)}function RI(e,t,r,o,i){return k(e,[r,o])?fk(e,t,r,o,i):ro(r,o,i)}function pi(e,t={}){return C("InstanceType",[e],t)}function CI(e,t={}){return R({},pi(e,t))}function gk(e){return Ue(e)?e.instanceType:Y()}function yk(e,t,r,o){let i=_(e,t,r);return g.Update(gk(i),{},o)}function PI(e,t,r,o={}){return k(e,[r])?yk(e,t,r,o):pi(r,o)}function Ek(e,t,r,o,i){let a=gt(e,{callstack:[]},r),p=Ri(e,{callstack:[]},o),u=Ae([...a,N(p)]);return g.Update(u,{},i)}function UI(e,t,r,o,i){return k(e,r)?Ek(e,t,r,o,i):to(r,o,i)}function no(e,t={}){return C("KeyOf",[e],t)}function NI(e,t={}){return R({},no(e,t))}function LI(){return v([Ot(),ct(),Qn()])}function kI(e){return Ot()}function Ik(e){return e.reduce((r,o)=>Fa(o)?[...r,K(uo(o))]:F(),[])}function MI(e){let t=s.Keys(e),r=Ik(t);return ln(r)}function wI(e){return Xn(e)}function DI(e){let t=e.map((r,o)=>K(o));return ln(t)}function Tk(e){return pe(e)||U(e)||O(e)?go(e):e}function _k(e){let t=Tk(e);return Je(t)?LI():J(t)?kI(t.items):M(t)?MI(t.properties):ye(t)?wI(t):z(t)?DI(t.items):Y()}function hk(e,t,r,o){let i=_(e,t,r);return g.Update(_k(i),{},o)}function $I(e,t,r,o){return k(e,[r])?hk(e,t,r,o):no(r,o)}function Ok(e){let t=ze(e);return fc(t)}function GI(e){return e.reduce((t,r)=>[...t,...fc(r)],[])}function fc(e){return he(e)?GI(kt(e.enum)):Yn(e)||Vn(e)?[e]:Oe(e)?Ok(e.pattern):O(e)?GI(e.anyOf):[]}function vI(e){return fc(e)}function eo(e,t,r,o,i={}){return C("Mapped",[e,t,r,o],i)}function jI(e,t,r,o,i={}){return R({},eo(e,t,r,o,i))}function Ak(e,t,r,o,i){let a=g.Assign(e,{[r.name]:o}),p=_(a,t,i);return Oe(p)?ze(p.pattern):p}function Sk(e,t,r,o,i){let a=g.Assign(e,{[r.name]:o});return _(a,t,i)}function bk(e,t,r,o,i,a){let p=Sk(e,t,r,o,a),u=Ak(e,t,r,o,i);return Yn(u)||Vn(u)?{[u.const]:p}:{}}function xk(e,t,r,o,i,a){return o.reduce((p,u)=>({...p,...bk(e,t,r,u,i,a)}),{})}function Rk(e,t,r,o,i,a){let p=vI(o),u=xk(e,t,r,p,i,a);return N(u)}function Ck(e,t,r,o,i,a,p){let u=_(e,t,o);return g.Update(Rk(e,t,r,u,i,a),{},p)}function FI(e,t,r,o,i,a,p){return k(e,[o])?Ck(e,t,r,o,i,a,p):eo(r,o,i,a,p)}function Pk(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>({...o,[i]:LE(e,i,e[i])}),{})}function Uk(e,t){return s.Keys(e).filter(o=>!t.includes(o)).reduce((o,i)=>({...o,[i]:_(e,{callstack:[]},e[i])}),{})}function Nk(e,t){let r=CE(e),o=Pk(e,r),i=Uk(e,r),a={...o,...i};return g.Update(a,{},t)}function BI(e,t,r,o){let i=g.Assign(e,r);return Nk(i,o)}function ci(e,t={}){return C("NonNullable",[e],t)}function qI(e,t={}){return R({},ci(e,t))}function Lk(e){let t=v([Nr(),Jn()]);return ls({},{callstack:[]},e,t,{})}function kk(e,t,r,o){let i=_(e,t,r);return g.Update(Lk(i),{},o)}function HI(e,t,r,o){return k(e,[r])?kk(e,t,r,o):ci(r,o)}function fs(e){let t=go(e);return M(t)?t.properties:F()}function mi(e,t,r={}){return C("Omit",[e,t],r)}function KI(e,t,r={}){let o=s.IsArray(t)?fo(t):t;return R({},mi(e,o,r))}function Mk(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function wk(e,t){let r=fs(e),o=lo(t),i=Mk(r,o);return N(i)}function Dk(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(wk(a,p),{},i)}function zI(e,t,r,o,i){return k(e,[r,o])?Dk(e,t,r,o,i):mi(r,o,i)}function oo(e,t){return C("Options",[e,t],{})}function gs(e,t){return R({},oo(e,t))}function $k(e,t,r,o){let i=_(e,t,r);return g.Update(i,{},o)}function VI(e,t,r,o){return k(e,[r])?$k(e,t,r,o):oo(r,o)}function ui(e,t={}){return C("Parameters",[e],t)}function YI(e,t={}){return R({},ui(e,t))}function Gk(e){return Ne(e)?_({},{callstack:[]},De(e.parameters)):Y()}function vk(e,t,r,o){let i=_(e,t,r);return g.Update(Gk(i),{},o)}function QI(e,t,r,o){return k(e,[r])?vk(e,t,r,o):ui(r,o)}function li(e,t={}){return C("Partial",[e],t)}function WI(e,t={}){return R({},li(e,t))}function ZI(e,t){let r=Zt(e,t),o=Gr(r);return Bt(g.Assign(e,{[t]:o}),t)}function XI(e){let t=e.map(r=>Gr(r));return Ae(t)}function JI(e){let t=e.map(r=>Gr(r));return v(t)}function eT(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:La(e[i])}),{});return N(t)}function Gr(e){return pe(e)?ZI(e.$defs,e.$ref):U(e)?XI(e.allOf):O(e)?JI(e.anyOf):M(e)?eT(e.properties):N({})}function jk(e,t,r,o){let i=_(e,t,r);return g.Update(Gr(i),{},o)}function tT(e,t,r,o){return k(e,[r])?jk(e,t,r,o):li(r,o)}function di(e,t,r={}){return C("Pick",[e,t],r)}function rT(e,t,r={}){let o=s.IsArray(t)?fo(t):t;return R({},di(e,o,r))}function Fk(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?g.Assign(o,{[i]:e[i]}):o,{})}function Bk(e,t){let r=fs(e),o=lo(t),i=Fk(r,o);return N(i)}function qk(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(Bk(a,p),{},i)}function nT(e,t,r,o,i){return k(e,[r,o])?qk(e,t,r,o,i):di(r,o,i)}function fi(e,t={}){return C("ReadonlyType",[e],t)}function oT(e,t={}){return R({},fi(e,t))}function iT(e){return br(Lt(e))}function aT(e,t){let r=Zt(e,t),o=vr(r);return Bt(g.Assign(e,{[t]:o}),t)}function sT(e){let t=e.map(r=>vr(r));return Ae(t)}function pT(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Ma(e[i])}),{});return N(t)}function cT(e){return br(De(e))}function mT(e){let t=e.map(r=>vr(r));return v(t)}function vr(e){return J(e)?iT(e.items):pe(e)?aT(e.$defs,e.$ref):U(e)?sT(e.allOf):M(e)?pT(e.properties):z(e)?cT(e.items):O(e)?mT(e.anyOf):e}function Hk(e,t,r,o){let i=_(e,t,r);return g.Update(vr(i),{},o)}function uT(e,t,r,o){return k(e,[r])?Hk(e,t,r,o):fi(r,o)}function lT(e){return mt(Vt,e)}function dT(e){return N({true:e,false:e})}function fT(e,t){let r=Ii(e);return jr(r,t)}function gT(e,t){return mt(Wn,t)}function yT(e,t){let r=Ae(e);return jr(r,t)}function ET(e,t){return s.IsString(e)||s.IsNumber(e)?N({[e]:t}):s.IsEqual(e,!1)?N({false:t}):s.IsEqual(e,!0)?N({true:t}):N({})}function IT(e,t){return mt(Zn,t)}function TT(e,t){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?mt(e.pattern.toString(),t):mt(Vt,t)}function _T(e,t){let r=ns(e);return os(r)?jr(ze(e),t):mt(e,t)}function Kk(e){return e.some(t=>xe(t)||ge(t)||we(t))}function zk(e,t){return s.IsEqual(Kk(e),!0)?mt(Vt,t):void 0}function Vk(e,t){return e.reduce((r,o)=>W(o)&&(s.IsString(o.const)||s.IsNumber(o.const))?{...r,[o.const]:t}:r,{})}function Yk(e,t){let r=Vk(e,t);return N(r)}function hT(e,t){let r=Qt(e),o=zk(r,t);return A(o)?o:Yk(r,t)}function jr(e,t){return Je(e)?lT(t):tt(e)?dT(t):he(e)?fT(e.enum,t):we(e)?gT(e,t):U(e)?yT(e.allOf,t):W(e)?ET(e.const,t):ge(e)?IT(e,t):O(e)?hT(e.anyOf,t):xe(e)?TT(e,t):Oe(e)?_T(e.pattern,t):N({})}function Qk(e,t,r,o,i){let a=_(e,t,r),p=_(e,t,o);return g.Update(jr(a,p),{},i)}function OT(e,t,r,o,i){return k(e,[r])?Qk(e,t,r,o,i):Xo(r,o,i)}function AT(e,t,r){return r in e?ms([r],e,e[r])?be(r):_(e,t,e[r]):be(r)}function ST(e,t){let r=Zt(e,t),o=Fr(r);return Bt(g.Assign(e,{[t]:o}),t)}function bT(e){let t=e.map(r=>Fr(r));return Ae(t)}function xT(e){let t=e.map(r=>Fr(r));return v(t)}function RT(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:qn(e[i])}),{});return N(t)}function Fr(e){return pe(e)?ST(e.$defs,e.$ref):U(e)?bT(e.allOf):O(e)?xT(e.anyOf):M(e)?RT(e.properties):N({})}function gi(e,t={}){return C("Required",[e],t)}function CT(e,t={}){return R({},gi(e,t))}function Wk(e,t,r,o){let i=_(e,t,r);return g.Update(Fr(i),{},o)}function PT(e,t,r,o){return k(e,[r])?Wk(e,t,r,o):gi(r,o)}function yi(e,t={}){return C("ReturnType",[e],t)}function UT(e,t={}){return R({},yi(e,t))}function Zk(e){return Ne(e)?e.returnType:Y()}function Xk(e,t,r,o){let i=_(e,t,r);return g.Update(Zk(i),{},o)}function NT(e,t,r,o){return k(e,[r])?Xk(e,t,r,o):yi(r,o)}function LT(e){return g.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function Jk(e){return e.join("|")}function eM(e){return e.slice(1,e.length-1)}function tM(e,t,r){return Br(t,`${r}${e}`)}function rM(e,t){return Br(e,`${t}${Td}`)}function nM(e,t){return Br(e,`${t}${ja}`)}function oM(e,t){return Br(e,`${t}${Ba}`)}function iM(e,t){return yc(v([K("false"),K("true")]),e,t)}function aM(e,t){return Br(e,`${t}${Ha}`)}function sM(e,t,r){return Br(t,`${r}${eM(e)}`)}function pM(e,t,r,o=[]){let i=kt(e);return gc(i,t,r)}function gc(e,t,r,o=[]){let[i,...a]=e;return A(i)?gc(a,t,r,[...o,yc(i,[],"")]):Br(t,`${r}(${Jk(o)})`)}function yc(e,t,r){return he(e)?pM(e.enum,t,r):we(e)?nM(t,r):W(e)?tM(e.const,t,r):lt(e)?rM(t,r):tt(e)?iM(t,r):ge(e)?oM(t,r):xe(e)?aM(t,r):Oe(e)?sM(e.pattern,t,r):O(e)?gc(e.anyOf,t,r):Jl}function Br(e,t){let[r,...o]=e;return A(r)?yc(r,o,t):t}function cM(e){return`^${Br(e,"")}$`}function kT(e){let t=cM(e);return LT(t)}function mM(e,t,r,o){let i=gt(e,t,r);return g.Update(kT(i),{},o)}function MT(e,t,r,o){return k(e,r)?mM(e,t,r,o):Jo(r,o)}function uM(e){return Lr(e)?z(e.items)?Ec(e.items.items):_e(e.items)?[e]:se(e.items)?[e]:[Y()]:[e]}function Ec(e){return e.reduce((r,o)=>[...r,...uM(o)],[])}function lM(e,t){return t in e}function dM(e,t){return U(t)?k(e,t.allOf):O(t)?k(e,t.anyOf):se(t)?lM(e,t.$ref):!0}function k(e,t){let[r,...o]=t;return A(r)?dM(e,r)?k(e,o):!1:!0}function Ci(e,t,r){return Vl(e)?Ci(e.type,"remove",r):ql(e)?Ci(e.type,t,"remove"):Kl(e)?Ci(e.type,"add",r):Fl(e)?Ci(e.type,t,"add"):[e,t,r]}function fM(e,t){return s.IsEqual(e,"remove")?ka(t):s.IsEqual(e,"add")?st(t):t}function gM(e,t){return s.IsEqual(e,"remove")?qn(t):s.IsEqual(e,"add")?at(t):t}function Ri(e,t,r){return s.Keys(r).reduce((o,i)=>({...o,[i]:_(e,t,r[i])}),{})}function cs(e,t,r){let o=gt(e,t,r);return Ec(o)}function gt(e,t,r){return r.map(o=>_(e,t,o))}function yM(e,t,r,o,i){return s.IsEqual(r,"Awaited")?jE(e,t,o[0],i):s.IsEqual(r,"Capitalize")?QE(e,t,o[0],i):s.IsEqual(r,"Conditional")?eI(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(r,"ConstructorParameters")?rI(e,t,o[0],i):s.IsEqual(r,"Evaluate")?iE(e,t,o[0],i):s.IsEqual(r,"Exclude")?ls(e,t,o[0],o[1],i):s.IsEqual(r,"Extract")?cI(e,t,o[0],o[1],i):s.IsEqual(r,"Index")?RI(e,t,o[0],o[1],i):s.IsEqual(r,"InstanceType")?PI(e,t,o[0],i):s.IsEqual(r,"Interface")?UI(e,t,o[0],o[1],i):s.IsEqual(r,"KeyOf")?$I(e,t,o[0],i):s.IsEqual(r,"Lowercase")?WE(e,t,o[0],i):s.IsEqual(r,"Mapped")?FI(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(r,"Module")?BI(e,t,o[0],i):s.IsEqual(r,"NonNullable")?HI(e,t,o[0],i):s.IsEqual(r,"Pick")?nT(e,t,o[0],o[1],i):s.IsEqual(r,"Options")?VI(e,t,o[0],o[1]):s.IsEqual(r,"Parameters")?QI(e,t,o[0],i):s.IsEqual(r,"Partial")?tT(e,t,o[0],i):s.IsEqual(r,"Omit")?zI(e,t,o[0],o[1],i):s.IsEqual(r,"ReadonlyType")?uT(e,t,o[0],i):s.IsEqual(r,"Record")?OT(e,t,o[0],o[1],i):s.IsEqual(r,"Required")?PT(e,t,o[0],i):s.IsEqual(r,"ReturnType")?NT(e,t,o[0],i):s.IsEqual(r,"TemplateLiteral")?MT(e,t,o[0],i):s.IsEqual(r,"Uncapitalize")?ZE(e,t,o[0],i):s.IsEqual(r,"Uppercase")?XE(e,t,o[0],i):C(r,o,i)}function _(e,t,r){let o=nn(r),i=Ci(r,on(r)?"add":"none",Pe(r)?"add":"none"),a=_t(i[0])?i[0].Clone():i[0],p=se(a)?AT(e,t,a.$ref):J(a)?Lt(_(e,t,a.items),wa(a)):Qe(a)?Ft(_(e,t,a.iteratorItems),Ql(a)):mo(a)?us(e,t,a.target,a.arguments):Ue(a)?xr(gt(e,t,a.parameters),_(e,t,a.instanceType),Zl(a)):Yl(a)?yM(e,t,a.action,a.parameters,a.options):Ne(a)?Rr(gt(e,t,a.parameters),_(e,t,a.returnType),Xl(a)):U(a)?ht(gt(e,t,a.allOf),id(a)):We(a)?qt(_(e,t,a.iteratorItems),hd(a)):M(a)?N(Ri(e,t,a.properties),xd(a)):He(a)?zt(_(e,t,a.item),Cd(a)):ye(a)?Pd(dt(a),_(e,t,Ke(a))):Lr(a)?cn(_(e,t,a.items)):z(a)?De(cs(e,t,a.items),Nd(a)):O(a)?v(gt(e,t,a.anyOf),Ld(a)):a,u=o?br(p):p;return fM(i[1],gM(i[2],u))}function R(e,t){return _(e,{callstack:[]},t)}function Ei(e,t={}){return C("Awaited",[e],t)}function wT(e,t={}){return R({},Ei(e,t))}function qp(e,t={}){return C("Evaluate",[e],t)}function wt(e,t={}){return R({},qp(e,t))}function Hp(e,t={}){return C("Module",[e],t)}function DT(e,t={}){return R({},Hp(e,t))}function $T(...e){let[t,r,o]=oe.Match(e,{2:(p,u)=>s.IsString(p)?[{},p,u]:[p,u,{}],3:(p,u,l)=>[p,u,l],1:p=>[{},p,{}]}),i=Cy(r),a=s.IsArray(i)&&s.IsEqual(i.length,2)?_(t,{callstack:[]},i[0]):Y();return g.Update(a,{},o)}var n={};bt(n,{Any:()=>Kn,Array:()=>Lt,AsyncIterator:()=>Ft,Awaited:()=>wT,Base:()=>Da,BigInt:()=>Wo,Boolean:()=>va,Call:()=>GE,Capitalize:()=>KE,Codec:()=>$a,Conditional:()=>JE,Constructor:()=>xr,ConstructorParameters:()=>tI,Cyclic:()=>Bt,Decode:()=>yd,DecodeBuilder:()=>Qo,Encode:()=>Ed,EncodeBuilder:()=>Yo,Enum:()=>od,Evaluate:()=>wt,Exclude:()=>nI,Extends:()=>Ye,ExtendsResult:()=>L,Extract:()=>aI,Function:()=>Rr,Generic:()=>Cr,Identifier:()=>Zo,Immutable:()=>br,Index:()=>hI,Infer:()=>Vo,InstanceType:()=>CI,Instantiate:()=>R,Integer:()=>sn,Interface:()=>xE,Intersect:()=>ht,IsAny:()=>Je,IsArray:()=>J,IsAsyncIterator:()=>Qe,IsBase:()=>_t,IsBigInt:()=>lt,IsBoolean:()=>tt,IsCall:()=>mo,IsCodec:()=>an,IsConstructor:()=>Ue,IsCyclic:()=>pe,IsEnum:()=>he,IsFunction:()=>Ne,IsGeneric:()=>Hn,IsIdentifier:()=>_d,IsImmutable:()=>nn,IsInfer:()=>_e,IsInteger:()=>we,IsIntersect:()=>U,IsIterator:()=>We,IsKind:()=>h,IsLiteral:()=>W,IsNever:()=>or,IsNull:()=>Ht,IsNumber:()=>ge,IsObject:()=>M,IsOptional:()=>Pe,IsParameter:()=>Rd,IsPromise:()=>He,IsReadonly:()=>on,IsRecord:()=>ye,IsRef:()=>se,IsRefine:()=>Ga,IsRest:()=>Lr,IsSchema:()=>A,IsString:()=>xe,IsSymbol:()=>Kt,IsTemplateLiteral:()=>Oe,IsThis:()=>Ud,IsTuple:()=>z,IsUndefined:()=>Yt,IsUnion:()=>O,IsUnknown:()=>pt,IsUnsafe:()=>Md,IsVoid:()=>ft,Iterator:()=>qt,KeyOf:()=>NI,Literal:()=>K,Lowercase:()=>zE,Mapped:()=>jI,Module:()=>DT,Never:()=>Y,NonNullable:()=>qI,Null:()=>Nr,Number:()=>Ot,Object:()=>N,Omit:()=>KI,Optional:()=>La,Options:()=>gs,Parameter:()=>pn,Parameters:()=>YI,Partial:()=>WI,Pick:()=>rT,Promise:()=>zt,Readonly:()=>Ma,ReadonlyType:()=>oT,Record:()=>Ka,RecordKey:()=>Xn,RecordKeyAsPattern:()=>dt,RecordValue:()=>Ke,Ref:()=>be,Refine:()=>Id,Required:()=>CT,Rest:()=>cn,ReturnType:()=>UT,Script:()=>$T,String:()=>ct,Symbol:()=>Qn,TemplateLiteral:()=>Ny,This:()=>za,Tuple:()=>De,Uncapitalize:()=>VE,Undefined:()=>Jn,Union:()=>v,Unknown:()=>Be,Unsafe:()=>kd,Uppercase:()=>YE,Void:()=>Va});var Ic=["CLUSTER_DB_QUERY_INVALID_CONNECTION_PARAMS","CLUSTER_DB_QUERY_INVALID_CREDENTIALS","CLUSTER_DB_QUERY_PERMISSION_DENIED","CLUSTER_DB_QUERY_QUERY_SYNTAX_ERROR","CLUSTER_DB_QUERY_DATABASE_UNREACHABLE","CLUSTER_DB_QUERY_CONNECTION_FAILED","CLUSTER_DB_QUERY_QUERY_EXECUTION_FAILED","CLUSTER_DB_QUERY_QUERY_TIMEOUT"],due=n.Enum(Ic),EM=["CLUSTER_AGGREGATION_STRUCTURE"],fue=n.Object({code:n.Enum(Ic),message:n.String()}),GT=[...Ic,...EM,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","ORG_NOT_FOUND_AUTHENTICATION_ERROR","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],vT=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var IM=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],TM=[...GT,...vT,...IM],gue=n.Object({code:n.Optional(n.Enum(TM,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),yue=n.Object({code:n.Optional(n.Enum(GT,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),Eue=n.Object({code:n.Optional(n.Enum(vT,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),Iue=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),Tue=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});var jT="lowercase-email",Tc="iana-timezone",_c="simple-time",hc="simple-date-time";var _M=(e,t)=>RegExp(`^${e.source}(${t.source}${e.source})*$`),hM=/[a-zA-Z0-9-_]+/,OM=/\./,hue=_M(hM,OM);var FT="lowercase-domain";var ys="kebab-case";var BT="camel-case";var AM=new Set;function S(e,t,r={}){let o=t.map(i=>{let a=i;return a.$id?(AM.add(i),n.Ref(a.$id)):i});return n.Unsafe({...r,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}function pr(e,t){return n.Object({values:n.Array(e,{maxItems:t.maxItems}),exclude:n.Optional(n.Boolean({description:"If true, exclude rows matching these values instead of including them"}))},{description:t.description})}var ee={limit:n.Optional(n.Integer({minimum:1,maximum:1e3,description:"The maximum number of items to return"})),offset:n.Optional(n.Integer({minimum:0,description:"The offset of the first item to return"}))},SM=n.Object({totalCount:n.Integer({description:"The total number of items matching the query"}),pageCount:n.Integer({description:"The total number of pages available"})}),xue=n.Object({pagination:SM},{$id:"ResponseMetadata"});function T(e={}){return n.Unsafe({...e,type:"string"})}function m({allowEmpty:e=!0,type:t="short",description:r}={}){let o=e?0:1,i=r===void 0?{}:{description:r};switch(t){case"camel-case":return n.String({format:BT,minLength:o,maxLength:250,...i});case"kebab-case":return n.String({format:ys,minLength:o,maxLength:250,...i});case"email":return n.String({format:jT,minLength:o,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...i});case"lowercase-domain":return n.String({format:FT,minLength:o,maxLength:250,...i});case"tsuga-query":return n.String({format:"tsuga-query",minLength:o,maxLength:1e4,...i});case"tags-query":return n.String({format:"tags-query",minLength:o,maxLength:1e4,errorMessage:{format:"Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported. The query you provided is invalid: ${0}"},...i});case"date-time":return n.String({format:"date-time",...i});case"uri":return n.String({format:"uri",...i});case"user-password":return n.String({format:"user-password",minLength:12,maxLength:250,...i});case"long":return n.String({minLength:o,maxLength:5e4,...i});case"short":return n.String({minLength:o,maxLength:250,...i});case"tsuga-formula":return n.String({format:"tsuga-formula",minLength:o,maxLength:250,errorMessage:{format:"Must be a simple mathematical formula, and all variables in it should refer to queries (q1, q2, etc.). The formula you provided is invalid: ${0}"},...i});case"time":return n.String({format:"time",...i});case"readonly-sql-query":return n.String({format:"readonly-sql-query",minLength:o,maxLength:5e4,errorMessage:{format:"Must be a readonly SQL query - only SELECT statements are allowed."},...i});default:Rt(t)}}function d({body:e,description:t,method:r,operationId:o,params:i,tags:a,query:p,paginated:u,response:l,url:f}){return i?{buildUrl:I=>f.replace(/:[a-zA-Z_]+/g,x=>I[x.slice(1)]),method:r,params:i,response:l,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...p===void 0?{}:{query:p},...u===void 0?{}:{paginated:u},...a===void 0?{}:{tags:a}}:{method:r,response:l,url:f,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...p===void 0?{}:{query:p},...u===void 0?{}:{paginated:u},...a===void 0?{}:{tags:a}}}function qT(e,t){if(!t||typeof t!="object")return e;let r=new URLSearchParams;return Object.entries(t).forEach(([o,i])=>{Array.isArray(i)?i.length>0&&i.forEach(a=>{a!==void 0&&(typeof a=="string"||typeof a=="number"||typeof a=="boolean")&&r.append(o,String(a))}):(typeof i=="boolean"||typeof i=="string"||typeof i=="number")&&r.append(o,String(i))}),`${e}?${r.toString()}`}var bM="x-tsuga-session-id",Oc="x-tsuga-source",Ac="x-tsuga-source-version",Sc="x-tsuga-source-commit",bc="x-tsuga-source-date",xc="x-tsuga-rationale",xM="x-request-id",Due={[bM]:"Session identifier for request correlation",[Oc]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[Ac]:"SDK version",[Sc]:"SDK commit hash",[bc]:"SDK commit date",[xc]:"Optional caller-supplied rationale for this request, recorded for telemetry",[xM]:"Unique identifier for this API request, useful for debugging and support"};var fn=class e extends Error{constructor(r,o,i,a){super(r);this.statusCode=o;this.code=i;this.requestId=a;this.name="CliError"}static fromErrorResponse(r,o){return new e(r.message,r.statusCode,r.code,o)}};function HT(e){if(e instanceof fn){let t=[`Error: ${e.message}`];return e.code&&t.push(`Code: ${e.code}`),e.statusCode&&t.push(`Status: ${e.statusCode}`),e.requestId&&t.push(`Request ID: ${e.requestId}`),t.join(`
34
+ `)}return e instanceof Error?`Error: ${e.message}`:String(e)}function RM(e){return e.replace(/\s+/g," ").replace(/[^\x20-\x7e\x80-\xff]/g,"").trim()}function KT(e,t,r,o){return async function(a,p={}){let{body:u,params:l,query:f}=p,y;if(a.url!==void 0)y=a.url;else if(a.buildUrl){if(!l)throw new fn("Internal error: params required for this endpoint");y=a.buildUrl(l)}else throw new fn("Internal error: endpoint has neither url nor buildUrl");let I=r===void 0?f:{clusterId:r,...f},x=qT(`${e}${y}`,I),le={Accept:"application/json",Authorization:`Bearer ${t}`,[Oc]:"cli",[Ac]:"1.0.15",[Sc]:"fbdc88c",[bc]:"2026-06-02T12:56:56.584Z"};u&&(le["Content-Type"]="application/json");let Se=o?.(),Or=Se?RM(Se):"";Or&&(le[xc]=Or);let Bn=await(await fetch(x,{method:a.method,headers:le,body:u?JSON.stringify(u):null})).json();if(Bn.error)throw fn.fromErrorResponse(Bn.error,Bn.requestId);return Bn.data}}var D=n.Object({success:n.Literal(!0,{description:"Indicates the resource was deleted successfully"})},{$id:"DeleteResponse",example:{success:!0}});var CM=["asset-change","cluster-integration-config","explorer-saved-view","crawler-integration-config","inventory","saml-config","sensitive-data-scanner-rule","service","team-remap-config","user-self","monitor-alert","monitor-debugging","retention-policy","org","allowed-domains","custom-usage-tag"],PM=["investigation","ingestion-api-key","operation-api-key","audit-log","dashboard","dashboard-report","inventory-settings","log-route","monitor","notification-integration","notification-rule","notification-silence","quality-report","slo","tag-policy","team","team-members","user-data","user-invitation","user-permissions"],UM=["log","metric","trace"],NM=[...PM,...UM],Que=[...CM,...NM];var Is=["admin","public_editor","public_viewer","teams_only"],yo=["admin","editor","viewer"];var gn="/v0/team-membership",Rc=n.Object({id:n.String(),userId:n.String(),teamId:n.String(),roleKey:n.Enum(yo)}),zT=n.Object({userId:m({allowEmpty:!1}),teamId:m({allowEmpty:!1}),roleKey:n.Enum(yo)}),LM=n.Object({userId:m({allowEmpty:!1}),teamId:m({allowEmpty:!1})}),kM=n.Optional(n.Object({userId:n.Optional(m({allowEmpty:!1})),teamId:n.Optional(m({allowEmpty:!1}))})),Wue=d({tags:["access-control"],url:gn,method:"GET",query:kM,response:n.Array(Rc)}),Zue=d({tags:["access-control"],url:gn,method:"POST",body:zT,response:Rc}),Xue=d({tags:["access-control"],url:gn,method:"PUT",body:zT,response:Rc}),Jue=d({tags:["access-control"],url:gn,method:"DELETE",body:LM,response:D}),Es=500,MM=n.Object({teamId:m({allowEmpty:!1}),members:n.Array(n.Object({userId:n.Optional(m({allowEmpty:!1})),userEmail:n.Optional(m({allowEmpty:!1,type:"email"})),roleKey:n.Enum(yo)},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:Es})}),wM=n.Object({results:n.Array(n.Object({userId:n.String(),status:n.Enum(["added","already_member","user_not_found"])}))}),ele=d({tags:["access-control"],url:`${gn}/bulk-add`,method:"POST",body:MM,response:wM}),tle=d({tags:["access-control"],url:`${gn}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:Es}),teamId:m({allowEmpty:!1}),role:n.Enum(yo)}),response:n.Object({})}),DM=n.Object({teamId:m({allowEmpty:!1}),userIds:n.Optional(n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:Es})),userEmails:n.Optional(n.Array(m({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:Es}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}]}),$M=n.Object({results:n.Array(n.Object({userId:n.String(),status:n.Enum(["removed","not_member","user_not_found"])}))}),rle=d({tags:["access-control"],url:`${gn}/bulk-remove`,method:"DELETE",body:DM,response:$M});var Ts="/v0/admin",$e=`${Ts}/clusters`,YT=n.Object({helmParameters:n.Record(n.String(),n.String()),helmVersion:n.String()}),VT=n.Record(n.String(),YT),Uc=["eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3","us-east-1","us-east-2","us-west-1","us-west-2","af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-1","ap-southeast-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ap-southeast-7","ca-central-1","ca-west-1","il-central-1","me-central-1","me-south-1","mx-central-1","sa-east-1"],Nc=["europe-west1","europe-west2","europe-west3","europe-west4","europe-west6","europe-west9","europe-central2","europe-north1","us-central1","us-east1","us-east4","us-west1","us-west2","us-west3","us-west4","northamerica-northeast1","southamerica-east1","asia-east1","asia-east2","asia-northeast1","asia-northeast2","asia-northeast3","asia-south1","asia-south2","asia-southeast1","asia-southeast2","australia-southeast1","australia-southeast2"],Lc=["australiacentral","australiacentral2","australiaeast","australiasoutheast","austriaeast","belgiumcentral","brazilsouth","brazilsoutheast","canadacentral","canadaeast","centralindia","centralus","chilecentral","eastasia","eastus","eastus2","francecentral","francesouth","germanynorth","germanywestcentral","indonesiacentral","israelcentral","italynorth","japaneast","japanwest","jioindiacentral","jioindiawest","koreacentral","koreasouth","malaysiawest","mexicocentral","newzealandnorth","northcentralus","northeurope","norwayeast","norwaywest","polandcentral","qatarcentral","southafricanorth","southafricawest","southcentralus","southeastasia","southindia","spaincentral","swedencentral","switzerlandnorth","switzerlandwest","uaecentral","uaenorth","uksouth","ukwest","westcentralus","westeurope","westindia","westus","westus2","westus3"],QT=["aws","gcp","azure"],Pi=["xs","s","m","l"],kc=["1.0"],GM={id:n.String(),name:n.String(),createdAt:T(),clusterCertificateExpiresAt:T(),bridgeEndpoint:n.String(),deployerEndpoint:n.String(),targetConfiguration:VT,appliedConfiguration:n.Optional(VT),automaticallyDeployLatestVersion:n.Boolean(),automatedDeploymentDisabledBy:n.Optional(n.String()),automatedDeploymentDisabledReason:n.Optional(n.String()),automatedDeploymentDisabledAt:n.Optional(T()),soakTimeMin:n.Optional(n.Number()),clusterSize:n.Optional(n.Enum(Pi))},Cc={...GM,orgId:n.String(),orgName:n.String()},cle=d({tags:["admin"],method:"GET",url:$e,query:n.Object({orgId:n.Optional(m())}),response:n.Array(S("clusterType",[n.Object({...Cc,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(kc)),clusterRegion:n.Enum(Uc)}),n.Object({...Cc,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(Nc)}),n.Object({...Cc,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(Lc)})]))}),mle=d({tags:["admin"],method:"PUT",url:`${$e}/create`,body:S("clusterType",[n.Object({clusterType:n.Literal("aws"),orgId:m(),name:m(),clusterSize:n.Enum(Pi),clusterAccountId:n.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:n.Enum(kc),clusterRegion:n.Enum(Uc)}),n.Object({clusterType:n.Literal("gcp"),orgId:m(),name:m(),clusterSize:n.Enum(Pi),clusterAccountId:m(),clusterRegion:n.Enum(Nc)}),n.Object({clusterType:n.Literal("azure"),orgId:m(),name:m(),clusterSize:n.Enum(Pi),clusterTenantId:m(),clusterSubscriptionId:m(),clusterRegion:n.Enum(Lc)})]),response:n.Object({id:n.String(),bridgeEndpoint:n.String(),deployerEndpoint:n.String()})}),ule=d({tags:["admin"],method:"DELETE",url:`${$e}/:id`,params:n.Object({id:m()}),body:n.Object({orgId:m()}),response:D}),lle=d({tags:["admin"],method:"PUT",url:`${$e}/add-inbounder-key`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),dle=d({tags:["admin"],method:"PUT",url:`${$e}/replace-all-inbounder-keys`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),fle=d({tags:["admin"],method:"PUT",url:`${$e}/replace-inbounder-key`,body:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKeyToReplace:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),gle=d({tags:["admin"],method:"PUT",url:`${$e}/delete-inbounder-key`,body:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKeyToDelete:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyDeleted:n.Boolean()})}),yle=d({tags:["admin"],method:"PUT",url:`${$e}/rotate-deployer-key`,body:n.Object({orgId:m(),clusterId:m(),newKey:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyUpdated:n.Boolean()})}),Ele=d({tags:["admin"],method:"PUT",url:`${$e}/rotate-bridge-key`,body:n.Object({orgId:m(),clusterId:m(),newKey:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyUpdated:n.Boolean()})}),Pc={central:n.String(),ngrokBridgeDomain:n.String(),ngrokDeployerDomain:n.String(),clusterCertificateExpiresAt:T(),clusterName:n.String(),clusterSize:n.Optional(n.Enum(Pi)),secretBridgeAuthenticationKey:n.String(),secretDeployerAuthenticationKey:n.String(),secretOutbounderAuthenticationKey:n.String(),secretMonitoringApiKey:n.String(),slackChannelEmail:n.String()},Ile=d({tags:["admin"],method:"POST",url:`${$e}/:id`,body:n.Object({orgId:m()}),params:n.Object({id:m()}),response:S("clusterType",[n.Object({...Pc,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(kc)),clusterRegion:n.Enum(Uc)}),n.Object({...Pc,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(Nc)}),n.Object({...Pc,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(Lc)})])}),Tle=d({tags:["admin"],method:"POST",url:`${$e}/configuration`,body:n.Object({id:m(),orgId:m(),installationName:m(),targetConfiguration:YT}),response:n.Object({status:n.String()})}),_le=d({tags:["admin"],method:"POST",url:`${$e}/automation`,body:n.Object({id:m(),orgId:m(),enableAutomatedDeployment:n.Boolean(),disabledReason:n.Optional(m())}),response:n.Object({status:n.String()})}),hle=d({tags:["admin"],method:"POST",url:`${$e}/soak-time`,body:n.Object({id:m(),orgId:m(),soakTimeMin:n.Optional(n.Number())}),response:n.Object({status:n.String()})}),Ole=d({tags:["admin"],method:"POST",url:`${$e}/deploy`,body:n.Object({orgId:m(),clusterId:m(),chartName:m(),toVersion:m()}),response:n.Object({id:n.String()})}),vM=S("type",[n.Object({type:n.Literal("pending")}),n.Object({type:n.Literal("running")}),n.Object({type:n.Literal("cancelled")}),n.Object({type:n.Literal("timed_out")}),n.Object({type:n.Literal("success"),stateValue:n.Object({message:n.String()})}),n.Object({type:n.Literal("failure"),stateValue:n.Object({message:n.String()})})]),Ale=d({tags:["admin"],method:"GET",url:`${$e}/deploy`,query:n.Object({orgId:n.Optional(m()),clusterId:n.Optional(m())}),response:n.Array(n.Object({id:n.String(),orgId:n.String(),orgName:n.String(),clusterId:n.String(),clusterName:n.String(),fromVersion:n.Optional(n.String()),toVersion:n.String(),state:vM,updatedAt:T(),createdAt:T(),installationName:n.String(),chartName:n.String(),isAutomated:n.Boolean(),createdBy:n.Optional(n.String()),createdByName:n.Optional(n.String()),createdByEmail:n.Optional(n.String())}))}),jM=n.Object({installations:n.Array(n.Object({installationName:n.String(),parameters:n.Record(n.String(),n.String()),version:n.Union([n.String(),n.Null()]),resources:n.Array(n.Object({id:n.Object({kind:n.String(),name:n.String()}),status:n.String(),health:n.String(),rawDetails:n.Optional(n.Any()),liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())})),deployedAt:n.Optional(n.String()),syncStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String())}))}),Sle=d({tags:["admin"],method:"POST",url:`${$e}/status`,body:n.Object({orgId:n.Optional(m()),clusterId:n.Optional(m())}),response:n.Array(n.Object({orgId:n.String(),clusterId:n.String(),status:jM}))}),ble=d({tags:["admin"],method:"POST",url:`${$e}/argocd-cert-info`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({certificateExpiresAt:n.String()})}),FM=n.Object({kind:n.String(),name:n.String()}),BM=n.Object({id:FM,liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())}),xle=d({tags:["admin"],method:"POST",url:`${$e}/resource-details`,body:n.Object({orgId:m(),clusterId:m(),installationName:m()}),response:n.Object({resources:n.Array(BM)})}),Rle=d({tags:["admin"],method:"GET",url:`${$e}/versions`,query:n.Object({chartName:n.Optional(m())}),response:n.Array(n.Object({id:n.String(),chartName:n.String(),locator:n.String(),version:n.String(),repositoryArn:n.String(),type:n.Optional(n.String()),commitHash:n.Optional(n.String()),lastPulledAt:n.Optional(T()),pushedAt:n.Optional(T())}))}),qM=n.Object({id:n.Object({name:n.String(),kind:n.String()}),previewManifest:n.Optional(n.String())}),Cle=d({tags:["admin"],method:"POST",url:`${$e}/versions/render`,body:n.Object({chartName:m(),version:m(),values:m({type:"long"}),installationName:m(),namespace:m()}),response:n.Array(qM)}),cr=`${Ts}/orgs`,Ple=d({tags:["admin"],url:cr,method:"GET",query:n.Object({onlyDeleted:n.Optional(n.Boolean())}),response:n.Array(n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String()),createdAt:T(),updatedAt:T()}))}),Ule=d({tags:["admin"],url:cr,method:"POST",body:n.Object({emailDomains:n.Array(m({type:"lowercase-domain"}),{maxItems:20}),name:m()}),response:n.Object({id:n.String(),name:n.String()})}),Nle=d({tags:["admin"],url:`${cr}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Object({allowedDomains:n.Optional(n.Array(m({type:"lowercase-domain"}),{maxItems:20}))}),response:n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String())})}),Lle=d({tags:["admin"],url:`${cr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:D}),kle=d({tags:["admin"],url:`${cr}/:id/restore`,method:"POST",params:n.Object({id:m()}),response:n.Object({success:n.Boolean()})}),Mle=d({tags:["admin"],url:`${cr}/:id/permanent-delete`,method:"DELETE",params:n.Object({id:m()}),response:n.Object({success:n.Boolean(),hasDeletedSecret:n.Boolean(),hasDeletedTenantDb:n.Boolean(),hasDeletedOrgRow:n.Boolean()})}),wle=d({tags:["admin"],url:`${cr}/synchronize-sds-rules`,method:"POST",response:n.Object({errorOrgs:n.Optional(n.Array(n.Object({id:n.String(),name:n.String()}))),synchronizedOrgsCount:n.Number()})}),HM=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],KM=n.Enum(HM),Dle=d({tags:["admin"],url:`${cr}/refresh-assets`,method:"POST",body:n.Object({assetTypes:n.Array(KM,{minItems:1}),orgId:n.Optional(m({allowEmpty:!1}))}),response:n.Array(n.Object({orgId:n.String(),orgName:n.String(),results:n.Record(n.String(),n.Object({success:n.Boolean()}))}))}),$le=d({tags:["admin"],url:`${cr}/sudo`,method:"POST",body:n.Object({orgId:m()}),response:n.Object({sudoToken:n.String()})}),zM=`${Ts}/users`,Gle=d({tags:["admin"],url:`${zM}/invite`,method:"POST",body:n.Object({email:m({type:"email"}),orgId:m(),userRole:n.Enum(Is)}),response:n.Array(n.Object({inviteId:n.String(),email:n.String(),result:n.Union([n.Literal("success"),n.Literal("email-failed")])}))});var vle=d({tags:["admin"],url:`${Ts}/billing-data`,method:"GET",query:n.Object({orgId:m(),maxDaysFetched:n.Optional(n.Number({minimum:1,maximum:365}))}),response:n.Object({dataPoints:n.Array(n.Object({date:n.String(),telemetryKind:n.Union([n.Literal("logs"),n.Literal("metrics"),n.Literal("traces")]),totalBytes:n.Number(),clusterId:n.String(),apiKeyId:n.String(),apiKeyName:n.String(),teamName:n.String()})),availableFilters:n.Object({clusters:n.Array(n.Object({id:n.String(),name:n.String()})),apiKeys:n.Array(n.Object({id:n.String(),name:n.String()})),teamNames:n.Array(n.String())})})});var WT=n.Object({id:n.String({description:"Unique identifier of the Tsuga cluster containing your observability data"}),name:n.String({description:"Internal name of the Tsuga cluster"}),friendlyName:n.Optional(n.String({description:"Human-readable display name set by an operator"})),clusterType:n.Enum(QT,{description:"Cloud provider hosting the Tsuga cluster"}),clusterRegion:n.String({description:"Region where the Tsuga cluster is deployed"})},{$id:"Cluster",description:"A Tsuga cluster containing your observability data"}),VM={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(WT,{examples:[VM]});var ZT=d({description:"Retrieve all clusters",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:n.Array(WT)});function Dt(e){process.stdout.write(`${e}
35
+ `)}function ne(e){Dt(JSON.stringify(e,null,2))}var XT=["json","tsv","csv"];function Mc(e){let t=XT.find(r=>r===e);if(t!==void 0)return t;throw new Error(`--output must be one of: ${XT.join(", ")} (got: ${e})`)}function wc(e){let t=e.split(",").map(r=>r.trim()).filter(r=>r.length>0);if(t.length===0)throw new Error("--fields must contain at least one field name");return t}function JT(e,t){let r=e;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function Dc(e,t){let r=Object.create(null);for(let o of t){let i=JT(e,o);if(i===void 0)continue;let a=o.split("."),p=a.pop();if(p===void 0)continue;let u=r;for(let l of a)(typeof u[l]!="object"||u[l]===null)&&(u[l]=Object.create(null)),u=u[l];u[p]=i}return r}function e_(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var YM={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function QM(e){let t=e_(e);return t===null?"":t.replace(/[\\\t\r\n]/g,r=>YM[r]??r)}function WM(e){let t=e_(e);return t===null?"":/[,"\n\r]/.test(t)?`"${t.replaceAll('"','""')}"`:t}function $c(e,t,r){if(t.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?WM:QM,a=r.map(u=>i(u)).join(o),p=t.map(u=>r.map(l=>i(JT(u,l))).join(o));return[a,...p].join(`
36
+ `)}function t_(e,t){e.command("cluster").description("Manage Tsuga cluster selection. A Tsuga cluster contains your observability data.").command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await t()(ZT);ne(o)})}var r_=`/${"v1"}/docs`,n_=n.Object({path:n.String(),title:n.String(),content:n.String({description:"Raw markdown content of the documentation page"})},{$id:"DocPage",description:"A documentation page with its raw markdown content"}),ZM={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
37
+ ...`};Object.assign(n_,{examples:[ZM]});var o_=n.Object({path:n.String(),title:n.String(),score:n.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:n.String({description:"Short snippet of matching content"}),link:n.String({description:"URL to the documentation page in the Tsuga app"})},{$id:"DocSearchResult",description:"A documentation search result"}),XM={path:"getting-started/send-your-first-logs",title:"Send your first logs",score:.9,excerpt:"...send your first logs to Tsuga using the ingestion API...",link:"https://www.app.tsuga.com/documentation/getting-started/send-your-first-logs"};Object.assign(o_,{examples:[XM]});var i_=d({description:"Retrieve the raw markdown content of a documentation page by its path",operationId:"getDocPage",tags:["docs"],url:r_,method:"GET",query:n.Object({path:m({allowEmpty:!1})}),response:n_}),a_=d({description:"Full-text search across documentation pages",operationId:"searchDocs",tags:["docs"],url:`${r_}/search`,method:"GET",query:n.Object({query:m({allowEmpty:!1})}),response:n.Array(o_)});function s_(e,t){let r=e.command("docs").description("Browse and search documentation");r.command("get <path>").description("Get a documentation page by path (e.g. 'getting-started/send-your-first-logs')").action(async o=>{let i=await t()(i_,{query:{path:o}});ne(i)}),r.command("search <query>").description("Search documentation pages").action(async o=>{let i=await t()(a_,{query:{query:o}});ne(i)})}var c_=1456444800,m_=4927737600,JM=c_*1e3,ew=m_*1e3,_s=1704067200,Gc=_s*1e3,u_={title:"TimeRange",description:"Time range to query",examples:[{from:_s,to:_s}]},l_={title:"TimeRange",description:"Time range to query",examples:[{from:Gc,to:Gc}]},hs=e=>n.Integer({description:e,examples:[_s],minimum:c_,maximum:m_,format:"int64"}),p_=e=>n.Integer({description:e,examples:[Gc],minimum:JM,maximum:ew,format:"int64"}),yt=n.Object({from:n.Optional(hs("Start timestamp in seconds")),to:n.Optional(hs("End timestamp in seconds"))},u_),Et=n.Object({from:hs("Start timestamp in seconds"),to:hs("End timestamp in seconds")},u_),ade=n.Object({from:n.Integer({description:"Start timestamp in milliseconds"}),to:n.Integer({description:"End timestamp in milliseconds"})},l_),d_=n.Object({from:p_("Start timestamp in milliseconds"),to:p_("End timestamp in milliseconds")},l_);var cde=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));var Tde=60*1e3;var tfe=1/1e6,aw=1e3,sw=60*aw,pw=60*sw,As=24*pw,rfe=7*As,nfe=30*As;var jc=["past-5-minutes","past-15-minutes","past-30-minutes","past-1-hour","past-2-hours","past-4-hours","past-6-hours","past-12-hours","past-24-hours","past-2-days","past-3-days","past-7-days","past-30-days","past-3-months","current-day","current-week","current-month","current-year","previous-day","previous-week","previous-month","previous-3-months","previous-year"];var cw={s:1,m:60,h:3600,d:86400};function g_(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<48||r>57)return!1}return!0}function y_(){return Math.floor(Date.now()/1e3)}function Ss(e){if(typeof e=="number")return e;if(e==="now")return y_();if(e.startsWith("-")&&e.length>=3){let r=e.at(-1),o=r?cw[r]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&g_(i))return y_()-parseInt(i,10)*o}}if(g_(e)&&e.length>0)return parseInt(e,10);let t=Date.parse(e);if(!Number.isNaN(t))return Math.floor(t/1e3);throw new Error(`Invalid time value: ${e}. Use unix seconds, relative (-30m, -1h), 'now', or ISO 8601.`)}var E_=n.Object({type:n.Literal("number"),number:n.String()}),mw=n.Object({type:n.Literal("string"),string:n.String()}),uw=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),Fc=S("type",[E_,mw,uw]),lw=n.Object({by:n.Record(n.String(),Fc),computed:n.Record(n.String(),E_)}),dw=n.Object({type:n.Literal("buckets"),buckets:n.Array(lw)}),fw=n.Object({type:n.Literal("distribution"),bounds:n.Array(n.Number()),buckets:n.Array(n.Object({timestamp:n.Number(),counts:n.Array(n.Number())})),percentiles:n.Optional(n.Array(n.Number()))}),I_=S("type",[dw,fw]);var gw="/v0/aggregation",yw=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),Ew=n.Object({parallelism:n.Number(),engine:yw,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),$t=["logs","metrics","traces"],Iw={logs:"Logs",metrics:"Metrics",traces:"Traces"},Tw=[...$t,"connections","log-patterns"],Ife={...Iw,connections:"Connections","log-patterns":"Log Patterns"},Tfe=n.Enum(Tw,{description:"Data source being queried"}),qr=n.Enum($t,{description:"Data source being queried for this aggregation"}),yn=n.String({description:"Attribute containing the values to aggregate"}),En=m({description:"Attribute containing the values to aggregate"}),_w=S("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(yn)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:yn},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:yn},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:yn},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:yn},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:yn},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:yn,percentile:n.Number()},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate"}),hw=S("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(En)},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:En},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:En},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:En},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:En},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:En},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:En,percentile:n.Number()},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate"}),h_=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),O_=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),A_=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),S_=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),b_=n.Object({type:n.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),x_=n.Object({type:n.Literal("power",{description:"Raises values to a specified power"}),exponent:n.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),R_=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),C_=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),Ow=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:n.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),Aw=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:m({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),Sw=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),bw=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),xw=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),Rw=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),Cw=S("type",[h_,O_,A_,S_,b_,Ow,Sw,x_,R_,C_,xw],{title:"Function"}),Pw=S("type",[h_,O_,A_,S_,b_,Aw,bw,x_,R_,C_,Rw],{title:"InputFunction"});var T_=n.Object({min:n.Number(),max:n.Number()}),__=n.Integer({minimum:1}),Uw=S("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:m({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(m()),bucketCount:n.Optional(__),bounds:n.Optional(T_),percentiles:n.Optional(n.Array(n.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:m({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(m()),bucketCount:n.Optional(__),bounds:n.Optional(T_)},{title:"Heatmap",description:"Returns a distribution per time window"})]),Bc=15,Nw=["zero","null"],Lw=n.Enum(Nw),P_=n.Object({mode:n.Object({type:Lw})}),U_={aggregate:_w,functions:n.Optional(n.Array(Cw,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(P_)},N_={aggregate:hw,functions:n.Optional(n.Array(Pw,{maxItems:10,description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(P_)},kw={description:"Aggregations that may be combined together in the same query"},L_={maxItems:Bc,description:"Aggregations that may be combined together in the same query"},k_=n.Array(n.Object({...U_,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),kw),Ui=n.Array(n.Object({...N_,filter:n.Optional(m({type:"tsuga-query",description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),L_),Eo=n.Array(n.Object({...U_,filter:n.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery"})),Io=n.Array(n.Object({...N_,filter:m({type:"tsuga-query"})},{title:"MonitorAggregationQuery"}),L_);var M_=n.String({description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),Ni=m({type:"tsuga-formula",description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),Mw=n.Object({fields:n.Array(n.String()),limit:n.Number()},{title:"AggregationGroupBy"}),ww=n.Object({fields:n.Array(m(),{maxItems:1}),limit:n.Number()},{title:"AggregationGroupBy"}),Dw=7;var qc=n.Array(Mw,{description:"Fields used to group the results"}),To=n.Array(ww,{maxItems:Dw,description:"Fields used to group the results"}),_fe=d({tags:["aggregation"],url:`${gw}/multi-query`,method:"POST",body:n.Object({timeRange:d_,queries:Ui,groupBy:n.Optional(To),returnType:Uw,dataSource:qr,formula:Ni,executionOptions:Ew,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(m({allowEmpty:!1}))}),response:I_}),$w=["per-second","per-minute","per-hour","rate"],In=n.Enum($w),hfe=S("type",[n.Object({type:n.Literal("count"),count:n.Object({field:n.Optional(m()),timeNormalization:n.Optional(In)})}),n.Object({type:n.Literal("average"),average:n.Object({field:m(),timeNormalization:n.Optional(In)})}),n.Object({type:n.Literal("min"),min:n.Object({field:m(),timeNormalization:n.Optional(In)})}),n.Object({type:n.Literal("max"),max:n.Object({field:m(),timeNormalization:n.Optional(In)})}),n.Object({type:n.Literal("sum"),sum:n.Object({field:m(),timeNormalization:n.Optional(In)})}),n.Object({type:n.Literal("percentile"),percentile:n.Object({field:m(),percentile:n.Number(),timeNormalization:n.Optional(In)})}),n.Object({type:n.Literal("uniqueCount"),uniqueCount:n.Object({field:m(),timeNormalization:n.Optional(In)})})]),Gw=n.Object({type:n.Literal("time"),time:n.Object({interval:m()})}),vw=n.Object({type:n.Literal("histogram"),histogram:n.Object({field:m(),interval:n.Number(),bounds:n.Optional(n.Object({min:n.Number(),max:n.Number()}))})}),jw=n.Object({type:n.Literal("topList"),topList:n.Object({field:m(),size:n.Number(),orderBy:n.Optional(n.Object({computeRef:m(),order:n.Union([n.Literal("asc"),n.Literal("desc")])}))})}),Ofe=S("type",[Gw,vw,jw]);var w_=`/${"v1"}/aggregation`,D_=n.Object({id:n.String({description:'Query identifier (q1, q2, ...) or "formula" for formula'}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values"})}),Fw={results:[{id:"q1",group:{host:"server-1"},value:123.45}]},$_=n.Object({results:n.Array(n.Object({...D_.properties,value:n.Number({description:"Aggregated value"})},{title:"ScalarResult"}),{description:"Aggregated results per query and group"})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with single values"});Object.assign($_,{examples:[Fw]});var Bw={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]},bs=n.Object({series:n.Array(n.Object({...D_.properties,points:n.Array(n.Object({timestamp:n.Integer({description:"Timestamp in milliseconds"}),value:n.Number({description:"Value"})}),{description:"Array of data points"})},{title:"Series"}),{description:"Time series data per query and group"})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with points over time"});Object.assign(bs,{examples:[Bw]});var G_={timeRange:Et,queries:n.Array(n.Omit(Ui.items,["fill"],{title:"AggregationQuery"}),{maxItems:Bc,description:"Aggregations that may be combined together in the same query"}),groupBy:n.Optional(To),dataSource:qr,formula:n.Optional(Ni),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))},qw=n.Object(G_),v_=d({description:"Run aggregation queries and return scalar results",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${w_}/multi-query/scalar`,method:"POST",body:qw,response:$_}),Hw=n.Object({...G_,aggregationWindow:m({description:'Time bucket size for aggregation (e.g. "10s", "1m", "1h")'})}),j_=d({description:"Run aggregation queries and return timeseries results",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${w_}/multi-query/timeseries`,method:"POST",body:Hw,response:bs});var Kw=`/${"v1"}/promql`,zw=n.Object({query:m({allowEmpty:!1,description:"PromQL query string"}),timeRange:Et,step:m({allowEmpty:!1,description:'Resolution step (e.g. "15s", "1m")'}),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),F_=d({description:"Run a PromQL query and return timeseries results. Experimental: shape and behavior may change.",operationId:"queryPromql",tags:["public","promql"],url:Kw,method:"POST",body:zw,response:bs});function Vw(e){return s.IsObject(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"errors")&&s.IsFunction(e.check)&&s.IsFunction(e.errors)}function Hc(e){return s.HasPropertyKey(e,"~guard")&&Vw(e["~guard"])}function Kc(e){return s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>s.IsObject(t)&&s.HasPropertyKey(t,"refine")&&s.HasPropertyKey(t,"message")&&s.IsFunction(t.refine)&&s.IsString(t.message))}function mr(e){return s.IsObject(e)&&!s.IsArray(e)}function xs(e){return s.IsBoolean(e)}function G(e){return mr(e)||xs(e)}function zc(e){return s.HasPropertyKey(e,"additionalItems")&&G(e.additionalItems)}function ur(e){return s.HasPropertyKey(e,"additionalProperties")&&G(e.additionalProperties)}function Vc(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(t=>G(t))}function Li(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function Yc(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(t=>G(t))}function Qc(e){return s.HasPropertyKey(e,"const")}function Tn(e){return s.HasPropertyKey(e,"contains")&&G(e.contains)}function At(e){return s.HasPropertyKey(e,"default")}function Wc(e){return s.HasPropertyKey(e,"dependencies")&&s.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>G(t)||s.IsArray(t)&&t.every(r=>s.IsString(r)))}function Zc(e){return s.HasPropertyKey(e,"dependentRequired")&&s.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>s.IsArray(t)&&t.every(r=>s.IsString(r)))}function Xc(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>G(t))}function Jc(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function em(e){return s.HasPropertyKey(e,"else")&&G(e.else)}function tm(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function rm(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function lr(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function ki(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function _n(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function nm(e){return s.HasPropertyKey(e,"if")&&G(e.if)}function _o(e){return s.HasPropertyKey(e,"items")&&(G(e.items)||s.IsArray(e.items)&&e.items.every(t=>G(t)))}function om(e){return _o(e)&&s.IsArray(e.items)}function im(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function am(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function Rs(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function sm(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function pm(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function dr(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function hn(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function ho(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function Mi(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function wi(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function cm(e){return s.HasPropertyKey(e,"multipleOf")&&(s.IsNumber(e.multipleOf)||s.IsBigInt(e.multipleOf))}function mm(e){return s.HasPropertyKey(e,"not")&&G(e.not)}function um(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(t=>G(t))}function Di(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function $i(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>G(t))}function Oo(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(t=>G(t))}function Gi(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(t=>G(t))}function lm(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||G(e.propertyNames))}function Yw(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function Cs(e){return Yw(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function dm(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function fm(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function On(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(t=>s.IsString(t))}function gm(e){return s.HasPropertyKey(e,"then")&&G(e.then)}function ym(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(t=>s.IsString(t)))}function Ao(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function Ps(e){return s.HasPropertyKey(e,"unevaluatedItems")&&G(e.unevaluatedItems)}function Us(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&G(e.unevaluatedProperties)}var nt=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(t){return this.indices.add(t),!0}AddKey(t){return this.keys.add(t),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(t){for(let r of t)r.indices.forEach(o=>this.indices.add(o)),r.keys.forEach(o=>this.keys.add(o));return!0}},vi=class extends nt{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}},Ge=class extends vi{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}};var Qw="external_",Ww=0,sIe={identifier:`${Qw}${Ww}`,variables:[]};function B_(e,t,r,o){return r["~guard"].check(o)}function q_(e,t,r,o,i,a){return i["~guard"].check(a)||t.AddError({keyword:"~guard",schemaPath:r,instancePath:o,params:{errors:i["~guard"].errors(a)}})}function H_(e,t,r,o){return s.Every(r["~refine"],0,(i,a)=>i.refine(o))}function K_(e,t,r,o,i,a){return s.EveryAll(i["~refine"],0,(p,u)=>p.refine(a)||t.AddError({keyword:"~refine",schemaPath:r,instancePath:o,params:{index:u,message:p.message}}))}function z_(e){return _o(e)&&s.IsArray(e.items)}function V_(e,t,r,o){return z_(r)?o.every((a,p)=>s.IsLessThan(p,r.items.length)||$(e,t,r.additionalItems,a)&&t.AddIndex(p)):!0}function Y_(e,t,r,o,i,a){return z_(i)?a.every((u,l)=>{let f=`${r}/additionalItems`,y=`${o}/${l}`;return s.IsLessThan(l,i.items.length)||V(e,t,f,y,i.additionalItems,u)&&t.AddIndex(l)}):!0}function Zw(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function Q_(e){let t=[];return $i(e)&&t.push(...s.Keys(e.patternProperties)),Gi(e)&&t.push(...s.Keys(e.properties).map(Zw)),s.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function W_(e,t,r,o){let i=new RegExp(Q_(r));return s.Every(s.Keys(o),0,(p,u)=>i.test(p)||$(e,t,r.additionalProperties,o[p])&&t.AddKey(p))}function Z_(e,t,r,o,i,a){let p=new RegExp(Q_(i)),u=[];return s.EveryAll(s.Keys(a),0,(f,y)=>{let I=`${r}/additionalProperties`,x=`${o}/${f}`,le=new Ge,Se=p.test(f)||V(e,le,I,x,i.additionalProperties,a[f])&&t.AddKey(f);return Se||u.push(f),Se})||t.AddError({keyword:"additionalProperties",schemaPath:r,instancePath:o,params:{additionalProperties:u}})}function X_(e,t,r,o){let i=r.allOf.reduce((a,p)=>{let u=new nt;return $(e,u,p,o)?[...a,u]:a},[]);return s.IsEqual(i.length,r.allOf.length)&&t.Merge(i)}function J_(e,t,r,o,i,a){let p=[],u=i.allOf.reduce((f,y,I)=>{let x=`${r}/allOf/${I}`,le=new Ge,Se=V(e,le,x,o,y,a);return Se||p.push(le),Se?[...f,le]:f},[]),l=s.IsEqual(u.length,i.allOf.length)&&t.Merge(u);return l||p.forEach(f=>f.GetErrors().forEach(y=>t.AddError(y))),l}function eh(e,t,r,o){let i=r.anyOf.reduce((a,p,u)=>{let l=new nt;return $(e,l,p,o)?[...a,l]:a},[]);return s.IsGreaterThan(i.length,0)&&t.Merge(i)}function th(e,t,r,o,i,a){let p=[],u=i.anyOf.reduce((f,y,I)=>{let x=new Ge,le=`${r}/anyOf/${I}`,Se=V(e,x,le,o,y,a);return Se||p.push(x),Se?[...f,x]:f},[]),l=s.IsGreaterThan(u.length,0)&&t.Merge(u);return l||p.forEach(f=>f.GetErrors().forEach(y=>t.AddError(y))),l||t.AddError({keyword:"anyOf",schemaPath:r,instancePath:o,params:{}})}function Im(e,t,r,o){return r}function rh(e,t,r,o,i,a){return Im(e,t,i,a)||t.AddError({keyword:"boolean",schemaPath:r,instancePath:o,params:{}})}function Tm(e,t,r,o){return s.IsValueLike(r.const)?s.IsEqual(o,r.const):s.IsDeepEqual(o,r.const)}function nh(e,t,r,o,i,a){return Tm(e,t,i,a)||t.AddError({keyword:"const",schemaPath:r,instancePath:o,params:{allowedValue:i.const}})}function Xw(e){return!(hn(e)&&s.IsEqual(e.minContains,0))}function _m(e,t,r,o){return Xw(r)?!s.IsEqual(o.length,0)&&o.some(i=>$(e,t,r.contains,i)):!0}function oh(e,t,r,o,i,a){return _m(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:1}})}function ih(e,t,r,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(r.dependencies),0,([p,u])=>!s.HasPropertyKey(o,p)||(s.IsArray(u)?u.every(l=>s.HasPropertyKey(o,l)):$(e,t,u,o)));return i||a}function ah(e,t,r,o,i,a){let p=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependencies),0,([l,f])=>{let y=`${r}/dependencies/${l}`;return!s.HasPropertyKey(a,l)||(s.IsArray(f)?f.every(I=>s.HasPropertyKey(a,I)||t.AddError({keyword:"dependencies",schemaPath:r,instancePath:o,params:{property:l,dependencies:f}})):V(e,t,y,o,f,a))});return p||u}function sh(e,t,r,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(r.dependentRequired),0,([p,u])=>!s.HasPropertyKey(o,p)||u.every(l=>s.HasPropertyKey(o,l)));return i||a}function ph(e,t,r,o,i,a){let p=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependentRequired),0,([l,f])=>!s.HasPropertyKey(a,l)||s.EveryAll(f,0,y=>s.HasPropertyKey(a,y)||t.AddError({keyword:"dependentRequired",schemaPath:r,instancePath:o,params:{property:l,dependencies:f}})));return p||u}function ch(e,t,r,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(r.dependentSchemas),0,([p,u])=>!s.HasPropertyKey(o,p)||$(e,t,u,o));return i||a}function mh(e,t,r,o,i,a){let p=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependentSchemas),0,([l,f])=>{let y=`${r}/dependentSchemas/${l}`;return!s.HasPropertyKey(a,l)||V(e,t,y,o,f,a)});return p||u}function hm(e,t,r,o){return r.enum.some(i=>s.IsValueLike(i)?s.IsEqual(o,i):s.IsDeepEqual(o,i))}function uh(e,t,r,o,i,a){return hm(e,t,i,a)||t.AddError({keyword:"enum",schemaPath:r,instancePath:o,params:{allowedValues:i.enum}})}function Om(e,t,r,o){return s.IsLessThan(o,r.exclusiveMaximum)}function lh(e,t,r,o,i,a){return Om(e,t,i,a)||t.AddError({keyword:"exclusiveMaximum",schemaPath:r,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function Am(e,t,r,o){return s.IsGreaterThan(o,r.exclusiveMinimum)}function dh(e,t,r,o,i,a){return Am(e,t,i,a)||t.AddError({keyword:"exclusiveMinimum",schemaPath:r,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var bo={};bt(bo,{Clear:()=>gh,Entries:()=>E0,Get:()=>_0,Has:()=>T0,IsDate:()=>ji,IsDateTime:()=>Sm,IsDuration:()=>bm,IsEmail:()=>xm,IsHostname:()=>Rm,IsIPv4:()=>Nm,IsIPv6:()=>Lm,IsIdnEmail:()=>Cm,IsIdnHostname:()=>Um,IsIri:()=>Mm,IsIriReference:()=>km,IsJsonPointer:()=>Dm,IsJsonPointerUriFragment:()=>wm,IsRegex:()=>$m,IsRelativeJsonPointer:()=>Gm,IsTime:()=>Fi,IsUri:()=>Fm,IsUriReference:()=>vm,IsUriTemplate:()=>jm,IsUrl:()=>Bm,IsUuid:()=>qm,Reset:()=>yh,Set:()=>I0,Test:()=>h0});var Jw=[0,31,28,31,30,31,30,31,31,30,31,30,31],e0=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function t0(e){return e%4===0&&(e%100!==0||e%400===0)}function ji(e){let t=e0.exec(e);if(!t)return!1;let r=+t[1],o=+t[2],i=+t[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&t0(r)?29:Jw[o])}var r0=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function Fi(e,t=!0){let r=r0.exec(e);if(!r)return!1;let o=+r[1],i=+r[2],a=+r[3],p=r[4]==="-"?-1:1,u=+(r[5]||0),l=+(r[6]||0);if(u>23||l>59||t&&!r[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&a<60)return!0;let f=i-l*p,y=o-u*p-(f<0?1:0);return(y===23||y===-1)&&(f===59||f===-1)&&a<61}function Sm(e,t=!0){let r=e.split(/T/i);return r.length===2&&ji(r[0])&&Fi(r[1],t)}var n0=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function bm(e){return n0.test(e)}var o0=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[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;function xm(e){return o0.test(e)}var i0=/^(?=.{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;function Rm(e){return i0.test(e)}var a0=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function Cm(e){return a0.test(e)}function Pm(e){let t=e.codePointAt(0);return t===void 0?!1:t>=12352&&t<=12447||t>=12448&&t<=12543&&t!==12539||t>=19968&&t<=40959}function Um(e){if(e.length===0||e.includes(" "))return!1;let t=/[\u002E\u3002\uFF0E\uFF61]/g,r=e.normalize("NFC").replace(t,".");if(r.length>253)return!1;let o=r.split(".");if(o.some(i=>i.length===0))return!1;for(let i of o){if(i.length>63||i.startsWith("-")||i.endsWith("-"))return!1;if(/^xn--/i.test(i)){let l=i.slice(4);if(l.length<2||l.includes("---"))return!1;continue}if(/[\u302E\u302F\u3031\u3032\u3033\u3034\u3035\u303B\u0640\u07FA]/.test(i))return!1;let a=i.charAt(0);if(/[\u0903\u0300\u0488]/.test(a))return!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);if(f==="\xB7"){if(l===0||l===i.length-1)return!1;let y=i.charAt(l-1),I=i.charAt(l+1);if(!/^[lL]$/.test(y)||!/^[lL]$/.test(I))return!1}if(f==="\u30FB"){if(i.length===1)return!1;if(l===0){let y=i.charAt(l+1);if(!Pm(y))return!1}else{let y=i.charAt(l-1),I=i.charAt(l+1);if(!Pm(y)||!Pm(I))return!1}}if(f==="\u0375"){if(l===i.length-1)return!1;let y=i.charAt(l+1);if(!/[\u0370-\u03FF]/.test(y))return!1}if(f==="\u05F3"||f==="\u05F4"){if(l===0)return!1;let y=i.charAt(l-1);if(!/[\u05D0-\u05EA]/.test(y))return!1}if(f==="\u200D"&&(l===0||i.charAt(l-1)!=="\u094D"))return!1}let p=!1,u=!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);/[\u0660-\u0669]/.test(f)&&(p=!0),/[\u06F0-\u06F9]/.test(f)&&(u=!0)}if(p&&u)return!1}return!0}var s0=/^(?:(?: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)$/;function Nm(e){return s0.test(e)}var p0=/^((([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;function Lm(e){return p0.test(e)}function fh(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function km(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;let t=e.indexOf(":");return t>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,t))?fh(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:fh(e)}function Mm(e){try{return new URL(e),!0}catch{return!1}}var c0=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function wm(e){return c0.test(e)}var m0=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function Dm(e){return m0.test(e)}function $m(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var u0=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Gm(e){return u0.test(e)}var l0=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function vm(e){return l0.test(e)}var d0=/^(?:(?:[^\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;function jm(e){return d0.test(e)}var f0=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function Fm(e){return f0.test(e)}var g0=/^(?: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;function Bm(e){return g0.test(e)}var y0=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function qm(e){return y0.test(e)}var ue=new Map;function gh(){ue.clear()}function E0(){return[...ue.entries()]}function I0(e,t){ue.set(e,t)}function T0(e){return ue.has(e)}function _0(e){return ue.get(e)}function h0(e,t){return ue.get(e)?.(t)??!0}function yh(){gh(),ue.set("date-time",Sm),ue.set("date",ji),ue.set("duration",bm),ue.set("email",xm),ue.set("hostname",Rm),ue.set("idn-email",Cm),ue.set("idn-hostname",Um),ue.set("ipv4",Nm),ue.set("ipv6",Lm),ue.set("iri-reference",km),ue.set("iri",Mm),ue.set("json-pointer-uri-fragment",wm),ue.set("json-pointer",Dm),ue.set("regex",$m),ue.set("relative-json-pointer",Gm),ue.set("time",Fi),ue.set("uri-reference",vm),ue.set("uri-template",jm),ue.set("uri",Fm),ue.set("url",Bm),ue.set("uuid",qm)}yh();function Hm(e,t,r,o){return bo.Test(r.format,o)}function Eh(e,t,r,o,i,a){return Hm(e,t,i,a)||t.AddError({keyword:"format",schemaPath:r,instancePath:o,params:{format:i.format}})}function Ih(e,t,r,o){let i=gm(r)?r.then:!0,a=em(r)?r.else:!0;return $(e,t,r.if,o)?$(e,t,i,o):$(e,t,a,o)}function Th(e,t,r,o,i,a){let p=gm(i)?i.then:!0,u=em(i)?i.else:!0,l=new Ge,f=V(e,l,`${r}/if`,o,i.if,a)?V(e,l,`${r}/then`,o,p,a)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"then"}}):V(e,t,`${r}/else`,o,u,a)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"else"}});return f&&t.Merge([l]),f}function O0(e,t,r,o){return s.Every(r.items,0,(i,a)=>s.IsLessEqualThan(o.length,a)||$(e,t,i,o[a])&&t.AddIndex(a))}function A0(e,t,r,o,i,a){return s.EveryAll(i.items,0,(p,u)=>{let l=`${r}/items/${u}`,f=`${o}/${u}`;return s.IsLessEqualThan(a.length,u)||V(e,t,l,f,p,a[u])&&t.AddIndex(u)})}function S0(e,t,r,o){let i=Oo(r)?r.prefixItems.length:0;return s.Every(o,i,(a,p)=>$(e,t,r.items,a)&&t.AddIndex(p))}function b0(e,t,r,o,i,a){let p=Oo(i)?i.prefixItems.length:0;return s.EveryAll(a,p,(u,l)=>{let f=`${r}/items`,y=`${o}/${l}`;return V(e,t,f,y,i.items,u)&&t.AddIndex(l)})}function _h(e,t,r,o){return om(r)?O0(e,t,r,o):S0(e,t,r,o)}function hh(e,t,r,o,i,a){return om(i)?A0(e,t,r,o,i,a):b0(e,t,r,o,i,a)}function x0(e){return Tn(e)}function Km(e,t,r,o){if(!x0(r))return!0;let i=o.reduce((a,p)=>$(e,t,r.contains,p)?++a:a,0);return s.IsLessEqualThan(i,r.maxContains)}function Oh(e,t,r,o,i,a){let p=hn(i)?i.minContains:1;return Km(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:p,maxContains:i.maxContains}})}function zm(e,t,r,o){return s.IsLessEqualThan(o,r.maximum)}function Ah(e,t,r,o,i,a){return zm(e,t,i,a)||t.AddError({keyword:"maximum",schemaPath:r,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function Vm(e,t,r,o){return s.IsLessEqualThan(o.length,r.maxItems)}function Sh(e,t,r,o,i,a){return Vm(e,t,i,a)||t.AddError({keyword:"maxItems",schemaPath:r,instancePath:o,params:{limit:i.maxItems}})}function Ym(e,t,r,o){return s.IsMaxLength(o,r.maxLength)}function bh(e,t,r,o,i,a){return Ym(e,t,i,a)||t.AddError({keyword:"maxLength",schemaPath:r,instancePath:o,params:{limit:i.maxLength}})}function Qm(e,t,r,o){return s.IsLessEqualThan(s.Keys(o).length,r.maxProperties)}function xh(e,t,r,o,i,a){return Qm(e,t,i,a)||t.AddError({keyword:"maxProperties",schemaPath:r,instancePath:o,params:{limit:i.maxProperties}})}function R0(e){return Tn(e)}function Wm(e,t,r,o){if(!R0(r))return!0;let i=o.reduce((a,p)=>$(e,t,r.contains,p)?++a:a,0);return s.IsGreaterEqualThan(i,r.minContains)}function Rh(e,t,r,o,i,a){return Wm(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:i.minContains}})}function Zm(e,t,r,o){return s.IsGreaterEqualThan(o,r.minimum)}function Ch(e,t,r,o,i,a){return Zm(e,t,i,a)||t.AddError({keyword:"minimum",schemaPath:r,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function Xm(e,t,r,o){return s.IsGreaterEqualThan(o.length,r.minItems)}function Ph(e,t,r,o,i,a){return Xm(e,t,i,a)||t.AddError({keyword:"minItems",schemaPath:r,instancePath:o,params:{limit:i.minItems}})}function Jm(e,t,r,o){return s.IsMinLength(o,r.minLength)}function Uh(e,t,r,o,i,a){return Jm(e,t,i,a)||t.AddError({keyword:"minLength",schemaPath:r,instancePath:o,params:{limit:i.minLength}})}function eu(e,t,r,o){return s.IsGreaterEqualThan(s.Keys(o).length,r.minProperties)}function Nh(e,t,r,o,i,a){return eu(e,t,i,a)||t.AddError({keyword:"minProperties",schemaPath:r,instancePath:o,params:{limit:i.minProperties}})}function tu(e,t,r,o){return s.IsMultipleOf(o,r.multipleOf)}function Lh(e,t,r,o,i,a){return tu(e,t,i,a)||t.AddError({keyword:"multipleOf",schemaPath:r,instancePath:o,params:{multipleOf:i.multipleOf}})}function ru(e,t,r,o){let i=new nt;return!$(e,i,r.not,o)&&t.Merge([i])}function kh(e,t,r,o,i,a){return ru(e,t,i,a)||t.AddError({keyword:"not",schemaPath:r,instancePath:o,params:{}})}function Mh(e,t,r,o){let i=r.oneOf.reduce((a,p)=>{let u=new nt;return $(e,u,p,o)?[...a,u]:a},[]);return s.IsEqual(i.length,1)&&t.Merge(i)}function wh(e,t,r,o,i,a){let p=[],u=[],l=i.oneOf.reduce((y,I,x)=>{let le=new Ge,Se=`${r}/oneOf/${x}`,Or=V(e,le,Se,o,I,a);return Or&&u.push(x),Or||p.push(le),Or?[...y,le]:y},[]),f=s.IsEqual(l.length,1)&&t.Merge(l);return!f&&s.IsEqual(u.length,0)&&p.forEach(y=>y.GetErrors().forEach(I=>t.AddError(I))),f||t.AddError({keyword:"oneOf",schemaPath:r,instancePath:o,params:{passingSchemas:u}})}function nu(e,t,r,o){return(s.IsString(r.pattern)?new RegExp(r.pattern):r.pattern).test(o)}function Dh(e,t,r,o,i,a){return nu(e,t,i,a)||t.AddError({keyword:"pattern",schemaPath:r,instancePath:o,params:{pattern:i.pattern}})}function $h(e,t,r,o){return s.Every(s.Entries(r.patternProperties),0,([i,a])=>{let p=new RegExp(i);return s.Every(s.Entries(o),0,([u,l])=>!p.test(u)||$(e,t,a,l)&&t.AddKey(u))})}function Gh(e,t,r,o,i,a){return s.EveryAll(s.Entries(i.patternProperties),0,([p,u])=>{let l=`${r}/patternProperties/${p}`,f=new RegExp(p);return s.EveryAll(s.Entries(a),0,([y,I])=>{let x=`${o}/${y}`;return!f.test(y)||V(e,t,l,x,u,I)&&t.AddKey(y)})})}function vh(e,t,r,o){return s.IsEqual(o.length,0)||s.Every(r.prefixItems,0,(i,a)=>s.IsLessEqualThan(o.length,a)||$(e,t,i,o[a])&&t.AddIndex(a))}function jh(e,t,r,o,i,a){return s.IsEqual(a.length,0)||s.EveryAll(i.prefixItems,0,(p,u)=>{let l=`${r}/prefixItems/${u}`,f=`${o}/${u}`;return s.IsLessEqualThan(a.length,u)||V(e,t,l,f,p,a[u])&&t.AddIndex(u)})}function ou(e,t){return e.includes(t)||Tt.Get().exactOptionalPropertyTypes}function iu(e,t){return s.IsUndefined(e[t])}function Fh(e,t,r,o){let i=On(r)?r.required:[];return s.Every(s.Entries(r.properties),0,([p,u])=>{let l=!s.HasPropertyKey(o,p)||$(e,t,u,o[p])&&t.AddKey(p);return ou(i,p)?l:iu(o,p)||l})}function Bh(e,t,r,o,i,a){let p=On(i)?i.required:[];return s.EveryAll(s.Entries(i.properties),0,([l,f])=>{let y=`${r}/properties/${l}`,I=`${o}/${l}`,x=()=>!s.HasPropertyKey(a,l)||V(e,t,y,I,f,a[l])&&t.AddKey(l);return ou(p,l)?x():iu(a,l)||x()})}function qh(e,t,r,o){return s.Every(s.Keys(o),0,(i,a)=>$(e,t,r.propertyNames,i))}function Hh(e,t,r,o,i,a){let p=[];return s.EveryAll(s.Keys(a),0,(l,f)=>{let y=`${o}/${l}`,I=`${r}/propertyNames`,x=new Ge,le=V(e,x,I,y,i.propertyNames,l);return le||p.push(l),le})||t.AddError({keyword:"propertyNames",schemaPath:r,instancePath:o,params:{propertyNames:p}})}function Kh(e,t,r,o){let i=e.RecursiveRef(r.$recursiveRef)??!1;return G(i)&&$(e,t,i,o)}function zh(e,t,r,o,i,a){let p=e.RecursiveRef(i.$recursiveRef)??!1;return G(p)&&V(e,t,"#",o,p,a)}function Qh(e,t,r,o){let i=e.Ref(r.$ref)??!1,a=new nt,p=G(i)&&$(e,a,i,o);return p&&t.Merge([a]),p}function Wh(e,t,r,o,i,a){let p=e.Ref(i.$ref)??!1,u=new Ge,l=G(p)&&V(e,u,"#",o,p,a);return l&&t.Merge([u]),l||u.GetErrors().forEach(f=>t.AddError(f)),l}function Zh(e,t,r,o){return s.Every(r.required,0,i=>s.HasPropertyKey(o,i))}function Xh(e,t,r,o,i,a){let p=[];return s.EveryAll(i.required,0,l=>{let f=s.HasPropertyKey(a,l);return f||p.push(l),f})||t.AddError({keyword:"required",schemaPath:r,instancePath:o,params:{requiredProperties:p}})}function au(e,t,r,o,i){return s.IsEqual(r,"object")?s.IsObjectNotArray(i):s.IsEqual(r,"array")?s.IsArray(i):s.IsEqual(r,"boolean")?s.IsBoolean(i):s.IsEqual(r,"integer")?s.IsInteger(i):s.IsEqual(r,"number")?s.IsNumber(i):s.IsEqual(r,"null")?s.IsNull(i):s.IsEqual(r,"string")?s.IsString(i):s.IsEqual(r,"asyncIterator")?s.IsAsyncIterator(i):s.IsEqual(r,"bigint")?s.IsBigInt(i):s.IsEqual(r,"constructor")?s.IsConstructor(i):s.IsEqual(r,"function")?s.IsFunction(i):s.IsEqual(r,"iterator")?s.IsIterator(i):s.IsEqual(r,"symbol")?s.IsSymbol(i):s.IsEqual(r,"undefined")?s.IsUndefined(i):s.IsEqual(r,"void")?s.IsUndefined(i):!0}function Jh(e,t,r,o,i){return r.some(a=>au(e,t,a,o,i))}function eO(e,t,r,o){return s.IsArray(r.type)?Jh(e,t,r.type,r,o):au(e,t,r.type,r,o)}function tO(e,t,r,o,i,a){return(s.IsArray(i.type)?Jh(e,t,i.type,i,a):au(e,t,i.type,i,a))||t.AddError({keyword:"type",schemaPath:r,instancePath:o,params:{type:i.type}})}function rO(e,t,r,o){let i=t.GetIndices();return s.Every(o,0,(a,p)=>(i.has(p)||$(e,t,r.unevaluatedItems,a))&&t.AddIndex(p))}function nO(e,t,r,o,i,a){let p=t.GetIndices(),u=[];return s.EveryAll(a,0,(f,y)=>{let I=new Ge,x=(p.has(y)||V(e,I,r,o,i.unevaluatedItems,f))&&t.AddIndex(y);return x||u.push(y),x})||t.AddError({keyword:"unevaluatedItems",schemaPath:r,instancePath:o,params:{unevaluatedItems:u}})}function oO(e,t,r,o){let i=t.GetKeys();return s.Every(s.Entries(o),0,([a,p])=>i.has(a)||$(e,t,r.unevaluatedProperties,p)&&t.AddKey(a))}function iO(e,t,r,o,i,a){let p=t.GetKeys(),u=[];return s.EveryAll(s.Entries(a),0,([f,y])=>{let I=new Ge,x=p.has(f)||V(e,I,r,o,i.unevaluatedProperties,y)&&t.AddKey(f);return x||u.push(f),x})||t.AddError({keyword:"unevaluatedProperties",schemaPath:r,instancePath:o,params:{unevaluatedProperties:u}})}function aO(e){return!s.IsEqual(e.uniqueItems,!1)}function sO(e,t,r,o){if(!aO(r))return!0;let i=new Set(o.map(Ur.Hash)).size,a=o.length;return s.IsEqual(i,a)}function pO(e,t,r,o,i,a){if(!aO(i))return!0;let p=new Set,u=a.reduce((f,y,I)=>{let x=Ur.Hash(y);return p.has(x)?[...f,I]:(p.add(x),f)},[]);return s.IsEqual(u.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:r,instancePath:o,params:{duplicateItems:u}})}function $(e,t,r,o){e.Push(r);let i=xs(r)?Im(e,t,r,o):(!ym(r)||eO(e,t,r,o))&&(!(s.IsObject(o)&&!s.IsArray(o))||(!On(r)||Zh(e,t,r,o))&&(!ur(r)||W_(e,t,r,o))&&(!Wc(r)||ih(e,t,r,o))&&(!Zc(r)||sh(e,t,r,o))&&(!Xc(r)||ch(e,t,r,o))&&(!$i(r)||$h(e,t,r,o))&&(!Gi(r)||Fh(e,t,r,o))&&(!lm(r)||qh(e,t,r,o))&&(!wi(r)||eu(e,t,r,o))&&(!pm(r)||Qm(e,t,r,o)))&&(!s.IsArray(o)||(!zc(r)||V_(e,t,r,o))&&(!Tn(r)||_m(e,t,r,o))&&(!_o(r)||_h(e,t,r,o))&&(!am(r)||Km(e,t,r,o))&&(!Rs(r)||Vm(e,t,r,o))&&(!hn(r)||Wm(e,t,r,o))&&(!ho(r)||Xm(e,t,r,o))&&(!Oo(r)||vh(e,t,r,o))&&(!Ao(r)||sO(e,t,r,o)))&&(!s.IsString(o)||(!ki(r)||Hm(e,t,r,o))&&(!sm(r)||Ym(e,t,r,o))&&(!Mi(r)||Jm(e,t,r,o))&&(!Di(r)||nu(e,t,r,o)))&&(!(s.IsNumber(o)||s.IsBigInt(o))||(!rm(r)||Om(e,t,r,o))&&(!lr(r)||Am(e,t,r,o))&&(!im(r)||zm(e,t,r,o))&&(!dr(r)||Zm(e,t,r,o))&&(!cm(r)||tu(e,t,r,o)))&&(!dm(r)||Kh(e,t,r,o))&&(!fm(r)||Qh(e,t,r,o))&&(!Hc(r)||B_(e,t,r,o))&&(!Qc(r)||Tm(e,t,r,o))&&(!tm(r)||hm(e,t,r,o))&&(!nm(r)||Ih(e,t,r,o))&&(!mm(r)||ru(e,t,r,o))&&(!Vc(r)||X_(e,t,r,o))&&(!Yc(r)||eh(e,t,r,o))&&(!um(r)||Mh(e,t,r,o))&&(!Ps(r)||!s.IsArray(o)||rO(e,t,r,o))&&(!Us(r)||!s.IsObject(o)||oO(e,t,r,o))&&(!Kc(r)||H_(e,t,r,o));return e.Pop(r),i}function V(e,t,r,o,i,a){e.Push(i);let p=xs(i)?rh(e,t,r,o,i,a):!!(+(!ym(i)||tO(e,t,r,o,i,a))&+(!(s.IsObject(a)&&!s.IsArray(a))||!!(+(!On(i)||Xh(e,t,r,o,i,a))&+(!ur(i)||Z_(e,t,r,o,i,a))&+(!Wc(i)||ah(e,t,r,o,i,a))&+(!Zc(i)||ph(e,t,r,o,i,a))&+(!Xc(i)||mh(e,t,r,o,i,a))&+(!$i(i)||Gh(e,t,r,o,i,a))&+(!Gi(i)||Bh(e,t,r,o,i,a))&+(!lm(i)||Hh(e,t,r,o,i,a))&+(!wi(i)||Nh(e,t,r,o,i,a))&+(!pm(i)||xh(e,t,r,o,i,a))))&+(!s.IsArray(a)||!!(+(!zc(i)||Y_(e,t,r,o,i,a))&+(!Tn(i)||oh(e,t,r,o,i,a))&+(!_o(i)||hh(e,t,r,o,i,a))&+(!am(i)||Oh(e,t,r,o,i,a))&+(!Rs(i)||Sh(e,t,r,o,i,a))&+(!hn(i)||Rh(e,t,r,o,i,a))&+(!ho(i)||Ph(e,t,r,o,i,a))&+(!Oo(i)||jh(e,t,r,o,i,a))&+(!Ao(i)||pO(e,t,r,o,i,a))))&+(!s.IsString(a)||!!(+(!ki(i)||Eh(e,t,r,o,i,a))&+(!sm(i)||bh(e,t,r,o,i,a))&+(!Mi(i)||Uh(e,t,r,o,i,a))&+(!Di(i)||Dh(e,t,r,o,i,a))))&+(!(s.IsNumber(a)||s.IsBigInt(a))||!!(+(!rm(i)||lh(e,t,r,o,i,a))&+(!lr(i)||dh(e,t,r,o,i,a))&+(!im(i)||Ah(e,t,r,o,i,a))&+(!dr(i)||Ch(e,t,r,o,i,a))&+(!cm(i)||Lh(e,t,r,o,i,a))))&+(!dm(i)||zh(e,t,r,o,i,a))&+(!fm(i)||Wh(e,t,r,o,i,a))&+(!Hc(i)||q_(e,t,r,o,i,a))&+(!Qc(i)||nh(e,t,r,o,i,a))&+(!tm(i)||uh(e,t,r,o,i,a))&+(!nm(i)||Th(e,t,r,o,i,a))&+(!mm(i)||kh(e,t,r,o,i,a))&+(!Vc(i)||J_(e,t,r,o,i,a))&+(!Yc(i)||th(e,t,r,o,i,a))&+(!um(i)||wh(e,t,r,o,i,a))&+(!Ps(i)||!s.IsArray(a)||nO(e,t,r,o,i,a))&+(!Us(i)||!s.IsObject(a)||iO(e,t,r,o,i,a)))&&(!Kc(i)||K_(e,t,r,o,i,a));return e.Pop(i),p}var Sn={};bt(Sn,{Ref:()=>j0});var fr={};bt(fr,{Delete:()=>M0,Get:()=>L0,Has:()=>N0,Indices:()=>Bi,Set:()=>k0});function cO(e){if(e.length===0)throw Error("Cannot set root")}function mO(e){if(!s.IsObject(e))throw Error("Cannot set value")}function C0(e){return/^(0|[1-9]\d*)$/.test(e)}function uO(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function P0(e,t){return s.IsObject(t)&&s.HasPropertyKey(t,e)}function U0(e,t){return s.IsObject(t)?t[e]:void 0}function su(e,t){return e.reduce((r,o)=>U0(o,r),t)}function Bi(e){if(s.IsEqual(e.length,0))return[];let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function N0(e,t){let r=e;return Bi(t).every(o=>P0(o,r)?(r=r[o],!0):!1)}function L0(e,t){let r=Bi(t);return su(r,e)}function k0(e,t,r){let o=Bi(t);cO(o);let[i,a]=uO(o),p=su(i,e);return mO(p),p[a]=r,e}function M0(e,t){let r=Bi(t);cO(r);let[o,i]=uO(r),a=su(o,e);return mO(a),s.IsArray(a)&&C0(i)?a.splice(+i,1):delete a[i],e}function w0(e,t,r){if(e.$id===r.hash)return e;let o=new URL(e.$id,t.href),i=new URL(r.href,t.href);if(s.IsEqual(o.pathname,i.pathname))return r.hash.startsWith("#")?lO(e,t,r):e}function D0(e,t,r){let o=new URL(`#${e.$anchor}`,t.href),i=new URL(r.href,t.href);if(s.IsEqual(o.href,i.href))return e}function lO(e,t,r){return r.href.endsWith("#")?e:r.hash.startsWith("#")?fr.Get(e,decodeURIComponent(r.hash.slice(1))):void 0}function $0(e,t,r){if(_n(e)){let o=w0(e,t,r);if(!s.IsUndefined(o))return o}if(Li(e)){let o=D0(e,t,r);if(!s.IsUndefined(o))return o}return lO(e,t,r)}function G0(e,t,r){return e.reduce((o,i)=>{let a=pu(i,t,r);return s.IsUndefined(a)?o:a},void 0)}function v0(e,t,r){return s.Keys(e).reduce((o,i)=>{let a=pu(e[i],t,r);return s.IsUndefined(a)?o:a},void 0)}function pu(e,t,r){if(t=mr(e)&&_n(e)?new URL(e.$id,t.href):t,mr(e)){let o=$0(e,t,r);if(!s.IsUndefined(o))return o}if(s.IsArray(e))return G0(e,t,r);if(s.IsObject(e))return v0(e,t,r)}function j0(e,t){let r=new URL("http://unknown"),o=_n(e)?new URL(e.$id,r.href):r,i=new URL(t,o.href);return pu(e,o,i)}var bn=class{constructor(t,r){this.context=t,this.schema=r,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,r)=>new URL(r.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){mr(t)&&(_n(t)&&this.ids.push(t),Li(t)&&this.anchors.push(t),Cs(t)&&this.recursiveAnchors.push(t),Jc(t)&&this.dynamicAnchors.push(t))}Pop(t){mr(t)&&(_n(t)&&this.ids.pop(),Li(t)&&this.anchors.pop(),Cs(t)&&this.recursiveAnchors.pop(),Jc(t)&&this.dynamicAnchors.pop())}FromContext(t){return s.HasPropertyKey(this.context,t)?this.context[t]:void 0}FromRef(t){return t.startsWith("#")?Sn.Ref(this.Base(),t):Sn.Ref(this.schema,t)}Ref(t){return this.FromContext(t)??this.FromRef(t)}RecursiveRef(t){return Cs(this.Base())?Sn.Ref(this.recursiveAnchors[0],t):Sn.Ref(this.Base(),t)}};function dO(...e){let[t,r,o]=oe.Match(e,{3:(p,u,l)=>[p,u,l],2:(p,u)=>[{},p,u]}),i=new bn(t,r),a=new nt;return $(i,a,r,o)}function fO(...e){let[t,r,o]=oe.Match(e,{3:(y,I,x)=>[y,I,x],2:(y,I)=>[{},y,I]}),i=Tt.Get(),a=fd(),p=[],u=new bn(t,r),l=new vi(y=>{if(!s.IsGreaterEqualThan(p.length,i.maxErrors))return p.push({...y,message:a(y)})});return[V(u,l,"#","",r,o),p]}function ce(...e){let[t,r,o]=oe.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[{},i,a]});return dO(t,r,o)}function Kr(...e){let[t,r,o]=oe.Match(e,{3:(p,u,l)=>[p,u,l],2:(p,u)=>[{},p,u]}),[i,a]=fO(t,r,o);return a}var zr=class extends Error{constructor(t,r,o){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:o,value:r},writable:!1,configurable:!1,enumerable:!1})}};function gO(e,t,r){return s.IsArray(r)?r.map(o=>je(e,t.items,o)):r}function yO(e,t,r){return t.Clean(r)}function EO(e,t,r){return je({...e,...t.$defs},be(t.$ref),r)}function B0(e){let t=s.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},r=wt(e);return M(r)?gs(r,t):r}function IO(e,t,r){let o=B0(t);return je(e,o,r)}function Ns(e){return s.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function TO(e,t,r){if(!s.IsObject(r)||s.IsArray(r))return r;let o=Ns(t);for(let i of s.Keys(r)){if(s.HasPropertyKey(t.properties,i)){r[i]=je(e,t.properties[i],r[i]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||A(o)&&ce(e,o,r[i])){r[i]=je(e,o,r[i]);continue}delete r[i]}return r}function _O(e,t,r){if(!s.IsObject(r))return r;let o=Ns(t),[i,a]=[new RegExp(dt(t)),Ke(t)];for(let p of s.Keys(r)){if(i.test(p)){r[p]=je(e,a,r[p]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||A(o)&&ce(e,o,r[p])){r[p]=je(e,o,r[p]);continue}delete r[p]}return r}function hO(e,t,r){return s.HasPropertyKey(e,t.$ref)?je(e,e[t.$ref],r):r}function OO(e,t,r){if(!s.IsArray(r))return r;let o=Math.min(r.length,t.items.length);for(let i=0;i<o;i++)r[i]=je(e,t.items[i],r[i]);return s.IsGreaterThan(r.length,o)?r.slice(0,o):r}function q0(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=me(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=me(e[r]);return t}function H0(e){return s.IsClassInstance(e)?e:q0(e)}function K0(e){return e.map(t=>me(t))}function z0(e){return e.slice()}function V0(e){return new Map(me([...e.entries()]))}function Y0(e){return new Set(me([...e.values()]))}function me(e){return Xe.IsTypeArray(e)?z0(e):Xe.IsMap(e)?V0(e):Xe.IsSet(e)?Y0(e):s.IsArray(e)?K0(e):s.IsObject(e)?H0(e):e}function AO(e,t,r){for(let o of t.anyOf){let i=je(e,o,me(r));if(ce(e,o,i))return i}return r}function je(e,t,r){return J(t)?gO(e,t,r):_t(t)?yO(e,t,r):pe(t)?EO(e,t,r):U(t)?IO(e,t,r):M(t)?TO(e,t,r):ye(t)?_O(e,t,r):se(t)?hO(e,t,r):z(t)?OO(e,t,r):O(t)?AO(e,t,r):r}function Rn(...e){let[t,r,o]=oe.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[{},i,a]});return je(t,r,o)}function SO(e,t,r){return s.IsArray(r)?r.map(o=>Re(e,t.items,o)):r}function bO(e,t,r){return t.Convert(r)}var re={};bt(re,{Fail:()=>Cn,IsOk:()=>mu,Ok:()=>P,TryBigInt:()=>uu,TryBoolean:()=>dD,TryNull:()=>_D,TryNumber:()=>PD,TryString:()=>DD,TryUndefined:()=>qD});function mu(e){return s.IsObject(e)&&s.HasPropertyKey(e,"value")}function P(e){return{value:e}}function Cn(){}function Q0(e){return P(e)}function W0(e){return s.IsEqual(e,!0)?P(BigInt(1)):P(BigInt(0))}function Z0(e){return P(BigInt(Math.trunc(e)))}function X0(e){return P(BigInt(0))}var J0=/^-?(0|[1-9]\d*)n$/,eD=/^-?(0|[1-9]\d*)\.\d+$/,tD=/^-?(0|[1-9]\d*)$/;function rD(e){return J0.test(e)}function nD(e){return eD.test(e)}function oD(e){return tD.test(e)}function iD(e){let t=e.toLowerCase();return rD(e)?P(BigInt(e.slice(0,e.length-1))):nD(e)?P(BigInt(e.split(".")[0])):oD(e)?P(BigInt(e)):s.IsEqual(t,"false")?P(BigInt(0)):s.IsEqual(t,"true")?P(BigInt(1)):void 0}function aD(e){return P(BigInt(0))}function uu(e){return s.IsBigInt(e)?Q0(e):s.IsBoolean(e)?W0(e):s.IsNumber(e)?Z0(e):s.IsNull(e)?X0(e):s.IsString(e)?iD(e):s.IsUndefined(e)?aD(e):void 0}function sD(e){return s.IsEqual(e,BigInt(0))?P(!1):s.IsEqual(e,BigInt(1))?P(!0):void 0}function pD(e){return P(e)}function cD(e){return s.IsEqual(e,0)?P(!1):s.IsEqual(e,1)?P(!0):void 0}function mD(e){return P(!1)}function uD(e){return s.IsEqual(e.toLowerCase(),"false")?P(!1):s.IsEqual(e.toLowerCase(),"true")?P(!0):s.IsEqual(e,"0")?P(!1):s.IsEqual(e,"1")?P(!0):void 0}function lD(e){return P(!1)}function dD(e){return s.IsBigInt(e)?sD(e):s.IsBoolean(e)?pD(e):s.IsNumber(e)?cD(e):s.IsNull(e)?mD(e):s.IsString(e)?uD(e):s.IsUndefined(e)?lD(e):void 0}function fD(e){return s.IsEqual(e,BigInt(0))?P(null):void 0}function gD(e){return s.IsEqual(e,!1)?P(null):void 0}function yD(e){return s.IsEqual(e,0)?P(null):void 0}function ED(e){return P(null)}function ID(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?P(null):void 0}function TD(e){return P(null)}function _D(e){return s.IsBigInt(e)?fD(e):s.IsBoolean(e)?gD(e):s.IsNumber(e)?yD(e):s.IsNull(e)?ED(e):s.IsString(e)?ID(e):s.IsUndefined(e)?TD(e):void 0}var hD=BigInt(Number.MAX_SAFE_INTEGER),OD=BigInt(Number.MIN_SAFE_INTEGER);function AD(e){return e<=hD&&e>=OD}function xO(e){return AD(e)?P(Number(e)):void 0}function SD(e){return e?P(1):P(0)}function bD(e){return P(e)}function xD(e){return P(0)}function RD(e){let t=+e;if(s.IsNumber(t))return P(t);let r=e.toLowerCase();if(s.IsEqual(r,"false"))return P(0);if(s.IsEqual(r,"true"))return P(1);let o=uu(e);return mu(o)?xO(o.value):void 0}function CD(e){return P(0)}function PD(e){return s.IsBigInt(e)?xO(e):s.IsBoolean(e)?SD(e):s.IsNumber(e)?bD(e):s.IsNull(e)?xD(e):s.IsString(e)?RD(e):s.IsUndefined(e)?CD(e):void 0}function UD(e){return P(e.toString())}function ND(e){return P(e.toString())}function LD(e){return P(e.toString())}function kD(e){return P("null")}function MD(e){return P(e)}function wD(e){return P("")}function DD(e){return s.IsBigInt(e)?UD(e):s.IsBoolean(e)?ND(e):s.IsNumber(e)?LD(e):s.IsNull(e)?kD(e):s.IsString(e)?MD(e):s.IsUndefined(e)?wD(e):void 0}function $D(e){return s.IsEqual(e,BigInt(0))?P(void 0):void 0}function GD(e){return s.IsEqual(e,!1)?P(void 0):void 0}function vD(e){return s.IsEqual(e,0)?P(void 0):void 0}function jD(e){return P(void 0)}function FD(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?P(void 0):void 0}function BD(e){return P(void 0)}function qD(e){return s.IsBigInt(e)?$D(e):s.IsBoolean(e)?GD(e):s.IsNumber(e)?vD(e):s.IsNull(e)?jD(e):s.IsString(e)?FD(e):s.IsUndefined(e)?BD(e):void 0}function RO(e,t,r){if(s.IsBigInt(r))return r;let o=re.TryBigInt(r);return re.IsOk(o)?o.value:r}function CO(e,t,r){if(s.IsBoolean(r))return r;let o=re.TryBoolean(r);return re.IsOk(o)?o.value:r}function PO(e,t,r){return Re({...e,...t.$defs},be(t.$ref),r)}function Ls(e,t,r){if(t.anyOf.some(p=>ce(e,p,r)))return r;let a=t.anyOf.map(p=>Re(e,p,me(r))).find(p=>ce(e,t,p));return s.IsUndefined(a)?r:a}function UO(e,t,r){let o=un(t);return Ls(e,o,r)}function NO(e,t,r){if(s.IsInteger(r))return r;let o=re.TryNumber(r);return re.IsOk(o)?Math.trunc(o.value):r}function LO(e,t,r){let o=wt(t);return Re(e,o,r)}function HD(e,t,r){let o=re.TryBigInt(r);return re.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function KD(e,t,r){let o=re.TryBoolean(r);return re.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function zD(e,t,r){let o=re.TryNumber(r);return re.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function VD(e,t,r){let o=re.TryString(r);return re.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function kO(e,t,r){return s.IsEqual(t.const,r)?r:Od(t)?HD(e,t,r):Ad(t)?KD(e,t,r):Vn(t)?zD(e,t,r):Yn(t)?VD(e,t,r):F()}function MO(e,t,r){if(s.IsNull(r))return r;let o=re.TryNull(r);return re.IsOk(o)?o.value:r}function wO(e,t,r){if(s.IsNumber(r))return r;let o=re.TryNumber(r);return re.IsOk(o)?o.value:r}function ks(e,t,r,o){let i=s.Keys(o);for(let[a,p]of t)for(let u of i)a.test(u)||(o[u]=Re(e,r,o[u]));return o}function qi(e,t,r){return Pe(e)&&s.IsUndefined(r[t])}function YD(e,t,r){let o=s.EntriesRegExp(t.properties),i=s.Keys(r);for(let[a,p]of o)for(let u of i)!a.test(u)||qi(p,u,r)||(r[u]=Re(e,p,r[u]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?ks(e,o,t.additionalProperties,r):r}function DO(e,t,r){return s.IsObjectNotArray(r)?YD(e,t,r):r}function QD(e,t,r){let o=s.EntriesRegExp(t.patternProperties),i=s.Keys(r);for(let[a,p]of o)for(let u of i)a.test(u)&&(r[u]=Re(e,p,r[u]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?ks(e,o,t.additionalProperties,r):r}function $O(e,t,r){return s.IsObjectNotArray(r)?QD(e,t,r):r}function GO(e,t,r){return s.HasPropertyKey(e,t.$ref)?Re(e,e[t.$ref],r):r}function vO(e,t,r){if(s.IsString(r))return r;let o=re.TryString(r);return re.IsOk(o)?o.value:r}function jO(e,t,r){let o=ze(t.pattern);return Re(e,o,r)}function FO(e,t,r){if(!s.IsArray(r))return r;for(let o=0;o<Math.min(t.items.length,r.length);o++)r[o]=Re(e,t.items[o],r[o]);return r}function BO(e,t,r){if(s.IsUndefined(r))return r;let o=re.TryUndefined(r);return re.IsOk(o)?o.value:r}function qO(e,t,r){if(s.IsUndefined(r))return r;let o=re.TryUndefined(r);return re.IsOk(o)?void 0:r}function Re(e,t,r){return J(t)?SO(e,t,r):_t(t)?bO(e,t,r):lt(t)?RO(e,t,r):tt(t)?CO(e,t,r):pe(t)?PO(e,t,r):he(t)?UO(e,t,r):we(t)?NO(e,t,r):U(t)?LO(e,t,r):W(t)?kO(e,t,r):Ht(t)?MO(e,t,r):ge(t)?wO(e,t,r):M(t)?DO(e,t,r):ye(t)?$O(e,t,r):se(t)?GO(e,t,r):xe(t)?vO(e,t,r):Oe(t)?jO(e,t,r):z(t)?FO(e,t,r):Yt(t)?BO(e,t,r):O(t)?Ls(e,t,r):ft(t)?qO(e,t,r):r}function Vr(...e){let[t,r,o]=oe.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[{},i,a]});return Re(t,r,o)}function HO(e,t,r){if(!s.IsArray(r))return r;for(let o=0;o<r.length;o++)r[o]=ke(e,t.items,r[o]);return r}function KO(e,t,r){return t.Default(r)}function zO(e,t,r){return ke({...e,...t.$defs},be(t.$ref),r)}function VO(e,t){return s.IsUndefined(t)?s.IsFunction(e.default)?e.default():me(e.default):t}function YO(e,t,r){let o=wt(t);return ke(e,o,r)}function QO(e,t,r){if(!s.IsObject(r))return r;let o=s.Keys(t.properties);for(let i of o){let a=ke(e,t.properties[i],r[i]);s.IsUndefined(a)&&(Pe(t.properties[i])||!s.HasPropertyKey(t.properties[i],"default"))||(r[i]=ke(e,t.properties[i],r[i]))}if(!ur(t)||s.IsBoolean(t.additionalProperties))return r;for(let i of s.Keys(r))o.includes(i)||(r[i]=ke(e,t.additionalProperties,r[i]));return r}function WO(e,t,r){if(!s.IsObject(r))return r;let[o,i]=[new RegExp(dt(t)),Ke(t)];for(let a of s.Keys(r))o.test(a)&&At(i)&&(r[a]=ke(e,i,r[a]));if(!ur(t))return r;for(let a of s.Keys(r))o.test(a)||(r[a]=ke(e,t.additionalProperties,r[a]));return r}function ZO(e,t,r){return s.HasPropertyKey(e,t.$ref)?ke(e,e[t.$ref],r):r}function XO(e,t,r){if(!s.IsArray(r))return r;let[o,i]=[t.items,Math.max(t.items.length,r.length)];for(let a=0;a<i;a++)a<o.length&&(r[a]=ke(e,o[a],r[a]));return r}function JO(e,t,r){for(let o of t.anyOf){let i=ke(e,o,me(r));if(ce(e,o,i))return i}return r}function ke(e,t,r){let o=At(t)?VO(t,r):r;return J(t)?HO(e,t,o):_t(t)?KO(e,t,o):pe(t)?zO(e,t,o):U(t)?YO(e,t,o):M(t)?QO(e,t,o):ye(t)?WO(e,t,o):se(t)?ZO(e,t,o):z(t)?XO(e,t,o):O(t)?JO(e,t,o):o}function Pn(...e){let[t,r,o]=oe.Match(e,{3:(i,a,p)=>[i,a,p],2:(i,a)=>[{},i,a]});return ke(t,r,o)}function xo(e){return(...t)=>{let[r,o,i]=oe.Match(t,{3:(a,p,u)=>[a,p,u],2:(a,p)=>[{},a,p]});return e.reduce((a,p)=>p(r,o,a),i)}}function WD(e,t,r){return t["~codec"].decode(r)}function ZD(e,t,r){return t["~codec"].encode(r)}function Te(e,t,r,o){return an(r)?s.IsEqual(e,"Decode")?WD(t,r,o):ZD(t,r,o):o}function XD(e,t,r,o){if(!s.IsArray(o))return F();for(let i=0;i<o.length;i++)o[i]=de(e,t,r.items,o[i]);return Te(e,t,r,o)}function JD(e,t,r,o){let i=Te(e,t,r,o);if(!s.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=de(e,t,r.items,i[a]);return i}function eA(e,t,r,o){return s.IsEqual(e,"Decode")?XD(e,t,r,o):JD(e,t,r,o)}function tA(e,t,r,o){return o=de(e,{...t,...r.$defs},be(r.$ref),o),Te(e,t,r,o)}function e$(e,t,r,o){for(let i of r.allOf)o=de(e,t,i,o);return Te(e,t,r,o)}function t$(e,t,r,o){let i=Te(e,t,r,o);for(let a of r.allOf)i=de(e,t,a,i);return i}function rA(e,t,r,o){return s.IsEqual(e,"Decode")?e$(e,t,r,o):t$(e,t,r,o)}function r$(e,t,r,o){if(!s.IsObjectNotArray(o))return F();for(let i of s.Keys(r.properties))!s.HasPropertyKey(o,i)||qi(r.properties[i],i,o)||(o[i]=de(e,t,r.properties[i],o[i]));return Te(e,t,r,o)}function n$(e,t,r,o){let i=Te(e,t,r,o);if(!s.IsObjectNotArray(i))return i;for(let a of s.Keys(r.properties))!s.HasPropertyKey(i,a)||qi(r.properties[a],a,i)||(i[a]=de(e,t,r.properties[a],i[a]));return i}function nA(e,t,r,o){return s.IsEqual(e,"Decode")?r$(e,t,r,o):n$(e,t,r,o)}function o$(e,t,r,o){if(!s.IsObjectNotArray(o))return F();let i=new RegExp(dt(r));for(let a of s.Keys(o))i.test(a)||F(),o[a]=de(e,t,Ke(r),o[a]);return Te(e,t,r,o)}function i$(e,t,r,o){let i=Te(e,t,r,o);if(!s.IsObjectNotArray(i))return i;let a=new RegExp(dt(r));for(let p of s.Keys(i))a.test(p)&&(i[p]=de(e,t,Ke(r),i[p]));return i}function oA(e,t,r,o){return s.IsEqual(e,"Decode")?o$(e,t,r,o):i$(e,t,r,o)}function iA(e,t,r,o){return o=s.HasPropertyKey(t,r.$ref)?de(e,t,t[r.$ref],o):o,Te(e,t,r,o)}function a$(e,t,r,o){if(!s.IsArray(o))return F();for(let i=0;i<Math.min(r.items.length,o.length);i++)o[i]=de(e,t,r.items[i],o[i]);return Te(e,t,r,o)}function s$(e,t,r,o){let i=Te(e,t,r,o);if(!s.IsArray(i))return o;for(let a=0;a<Math.min(r.items.length,i.length);a++)i[a]=de(e,t,r.items[a],i[a]);return i}function aA(e,t,r,o){return s.IsEqual(e,"Decode")?a$(e,t,r,o):s$(e,t,r,o)}function p$(e,t,r,o){for(let i of r.anyOf){if(!ce(t,i,o))continue;let a=de(e,t,i,o);return Te(e,t,r,a)}return F()}function c$(e,t,r,o){let i=Te(e,t,r,o);for(let a of r.anyOf){let p=de(e,t,a,me(i));if(ce(t,a,p))return p}return i}function sA(e,t,r,o){return s.IsEqual(e,"Decode")?p$(e,t,r,o):c$(e,t,r,o)}function de(e,t,r,o){return J(r)?eA(e,t,r,o):pe(r)?tA(e,t,r,o):U(r)?rA(e,t,r,o):M(r)?nA(e,t,r,o):ye(r)?oA(e,t,r,o):se(r)?iA(e,t,r,o):z(r)?aA(e,t,r,o):O(r)?sA(e,t,r,o):Te(e,t,r,o)}var lu=class extends zr{constructor(t,r){super("Decode",t,r)}};function m$(e,t,r){if(!ce(e,t,r))throw new lu(r,Kr(e,t,r));return r}function u$(e,t,r){return de("Decode",e,t,r)}var yNe=xo([(e,t,r)=>me(r),(e,t,r)=>Pn(e,t,r),(e,t,r)=>Vr(e,t,r),(e,t,r)=>Rn(e,t,r),(e,t,r)=>m$(e,t,r),(e,t,r)=>u$(e,t,r)]);var du=class extends zr{constructor(t,r){super("Encode",t,r)}};function l$(e,t,r){if(!ce(e,t,r))throw new du(r,Kr(e,t,r));return r}function d$(e,t,r){return de("Encode",e,t,r)}var CNe=xo([(e,t,r)=>me(r),(e,t,r)=>d$(e,t,r),(e,t,r)=>Pn(e,t,r),(e,t,r)=>Vr(e,t,r),(e,t,r)=>Rn(e,t,r),(e,t,r)=>l$(e,t,r)]);var Ct=class extends Error{constructor(t,r){super(r),this.type=t}};function pA(e,t){return s.IsFunction(t.default)?t.default(t):s.IsObject(t.default)?me(t.default):t.default}function cA(e,t){if(Ao(t)&&!At(t))throw new Ct(t,"Arrays with uniqueItems constraints must specify a default annotation");let r=ho(t)?t.minItems:0;return Array.from({length:r},()=>fe(e,t.items))}async function*f$(){}function mA(e,t){return f$()}function uA(e,t){return t.Create()}function lA(e,t){return lr(t)?BigInt(t.exclusiveMinimum)+BigInt(1):dr(t)?BigInt(t.minimum):BigInt(0)}function dA(e,t){return!1}function fA(e,t){let r=fe(e,t.instanceType);return class{constructor(){Object.assign(this,r)}}}function gA(e,t){return fe({...e,...t.$defs},be(t.$ref))}function yA(e,t){return fe(e,un(t))}function EA(e,t){let r=fe(e,t.returnType);return()=>r}function IA(e,t){return lr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:dr(t)?t.minimum:0}function TA(e,t){return fe(e,wt(t))}function*g$(){}function _A(e,t){return g$()}function hA(e,t){return t.const}function OA(e,t){throw new Ct(t,"Cannot create TNever types")}function AA(e,t){return null}function SA(e,t){return lr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:dr(t)?t.minimum:0}function bA(e,t){return(s.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:fe(e,t.properties[i])}),{})}function xA(e,t){return Promise.resolve(fe(e,t.item))}function RA(e,t){if(wi(t)&&!At(t))throw new Ct(t,"Record with the minProperties constraint must have a default annotation");return{}}function CA(e,t){return s.HasPropertyKey(e,t.$ref)?fe(e,e[t.$ref]):(()=>{throw new Ct(t,"Unable to deref Ref")})()}function PA(e,t){if((Di(t)||ki(t))&&!At(t))throw Error("Strings with format or pattern constraints must specify default");let o=Mi(t)?t.minLength:0;return"".padEnd(o)}function UA(e,t){return Symbol()}function NA(e,t){let r=ze(t.pattern);if(xe(r))throw new Ct(t,"Unable to create TemplateLiteral due to infinite type expansion");return fe(e,r)}function LA(e,t){return Array.from({length:t.minItems},(r,o)=>fe(e,t.items[o]))}function kA(e,t){if(s.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return fe(e,t.anyOf[0])}function fe(e,t){return At(t)?pA(e,t):J(t)?cA(e,t):Qe(t)?mA(e,t):_t(t)?uA(e,t):lt(t)?lA(e,t):tt(t)?dA(e,t):Ue(t)?fA(e,t):pe(t)?gA(e,t):he(t)?yA(e,t):Ne(t)?EA(e,t):we(t)?IA(e,t):U(t)?TA(e,t):We(t)?_A(e,t):W(t)?hA(e,t):or(t)?OA(e,t):Ht(t)?AA(e,t):ge(t)?SA(e,t):M(t)?bA(e,t):He(t)?xA(e,t):ye(t)?RA(e,t):se(t)?CA(e,t):xe(t)?PA(e,t):Kt(t)?UA(e,t):Oe(t)?NA(e,t):z(t)?LA(e,t):Yt(t)?void 0:O(t)?kA(e,t):ft(t)?void 0:void 0}function Jt(...e){let[t,r]=oe.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return fe(t,r)}var fu=class extends zr{constructor(t,r){super("Parse",t,r)}};function y$(e,t,r){if(!ce(e,t,r))throw new fu(r,Kr(e,t,r));return r}var kMe=xo([(e,t,r)=>me(r),(e,t,r)=>Pn(e,t,r),(e,t,r)=>Vr(e,t,r),(e,t,r)=>Rn(e,t,r),(e,t,r)=>y$(e,t,r)]);var I$=N({type:K("insert"),path:ct(),value:Be()}),T$=Object({type:K("update"),path:ct(),value:Be()}),_$=N({type:K("delete"),path:ct()}),jMe=v([I$,T$,_$]);function Ro(e){if(!e.body)throw new Error("This command does not accept a request body");let t=e.body;return t.examples?.length?t.examples[0]:Jt(t)}var DA=fl(require("node:fs"));function Co(e){if(e.file){let t=DA.default.readFileSync(e.file==="-"?0:e.file,"utf-8");return JSON.parse(t)}if(e.data)return JSON.parse(e.data);throw new Error("Provide a request body with -f <file> or -d <json>. Use --generate-skeleton to get a template.")}function Hi(e,t,r,o,i){e.command(t).description(r).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async a=>{if(a.generateSkeleton){ne(Ro(o));return}let p=Co(a),u=await i()(o,{body:p});ne(u)})}function $A(e,t){let r=e.command("experimental").description("Experimental commands \u2014 unstable, subject to change without notice");Hi(r,"promql","Run a PromQL query (experimental)",F_,t)}var S$=`/${"v1"}/feedback`,b$=n.Object({id:n.String({description:"Identifier of the recorded feedback (matches the API request ID)."})},{$id:"Feedback",description:"A recorded piece of feedback"}),x$=n.Object({content:m({allowEmpty:!1,type:"long",description:"The feedback message."})}),GA=d({description:"Submit free-text feedback about Tsuga tools or APIs, e.g. a tool that failed, returned unusable output, or was confusing to use. Feedback is recorded for the Tsuga team to review and improve tooling.",operationId:"createFeedback",tags:["feedback"],url:S$,method:"POST",body:x$,response:b$});function vA(e,t){e.command("feedback <message...>").description("Send feedback about Tsuga tools or APIs (e.g. a tool that failed or was confusing)").action(async r=>{let o=await t()(GA,{body:{content:r.join(" ")}});ne(o)})}var Q="context";var wDe=`${Q}.team`,DDe=`${Q}.env`,$De=`${Q}.api_key_id`,GDe=`${Q}.service.name`,vDe=`${Q}.service.version`;var R$=`${Q}.host.name`,C$=`${Q}.instance`,P$=`${Q}.instanceid`,U$=`${Q}.instance_name`,jDe=`${Q}.telemetry.sdk.language`,FDe=`${Q}.process.runtime.name`,BDe=`${Q}.k8s.cluster.name`,qDe=`${Q}.k8s.cluster.uid`,HDe=`${Q}.k8s.namespace.name`,KDe=`${Q}.k8s.pod.name`,zDe=`${Q}.k8s.pod.uid`,VDe=`${Q}.k8s.container.name`,YDe=`${Q}.k8s.node.name`,QDe=`${Q}.k8s.node.uid`,WDe=`${Q}.k8s.deployment.name`,ZDe=`${Q}.k8s.deployment.uid`,XDe=`${Q}.k8s.replicaset.name`,JDe=`${Q}.k8s.replicaset.uid`,e$e=`${Q}.k8s.statefulset.name`,t$e=`${Q}.k8s.statefulset.uid`,r$e=`${Q}.k8s.daemonset.name`,n$e=`${Q}.k8s.daemonset.uid`,o$e=`${Q}.k8s.job.name`,i$e=`${Q}.k8s.job.uid`,a$e=`${Q}.k8s.cronjob.name`,s$e=`${Q}.k8s.cronjob.uid`;var p$e={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${Q}.tag_policy_id`,dataSource:`${Q}.data_source`}};var c$e={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${Q}.batch_kind`,batchKindMetricsFilter:`${Q}.batch_kind:metrics`,sourceApiKeyId:`${Q}.source_api_key_id`,sourceEnv:`${Q}.source_env`,sourceTeam:`${Q}.source_team`}},jA="__tsuga_metadata__",m$e=`${jA}.signature`,u$e=`${jA}.routes`;var Yr="/v0/service-catalog";var qA=n.Object({team:n.String(),lastSeenAt:T()}),N$=n.Object({ingestionApiKey:n.String(),lastSeenAt:T()}),HA=n.Object({version:n.String(),firstSeenAt:T(),lastSeenAt:T(),faulty:n.Optional(n.Boolean())}),L$=n.Object({language:n.String(),lastSeenAt:T()}),k$=n.Object({runtime:n.String(),lastSeenAt:T()}),Ms=n.Object({id:n.String(),serviceName:n.String(),serviceNamespace:n.Optional(n.String()),env:n.Optional(n.String()),teams:n.Array(qA),ingestionApiKeys:n.Array(N$),versions:n.Array(HA),languages:n.Array(L$),runtimes:n.Array(k$),lastSeenAt:T(),firstSeenAt:T(),sources:n.Array(n.String()),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),logsCount24h:n.Number(),errorLogsCount24h:n.Number(),tracesCount24h:n.Number(),errorTracesCount24h:n.Number(),createdAt:T(),updatedAt:T()}),I$e=d({tags:["service-catalog"],query:n.Object({...ee,clusterId:n.Optional(m())}),method:"GET",paginated:!0,url:`${Yr}/services`,response:n.Array(Ms)}),T$e=d({tags:["service-catalog"],method:"GET",url:`${Yr}/services/:serviceId`,params:n.Object({serviceId:m()}),response:Ms}),M$=n.Object({id:n.String(),endpointName:n.String(),serviceName:n.String(),serviceNamespace:n.Optional(n.String()),env:n.Optional(n.String()),teams:n.Array(qA),versions:n.Array(HA),lastSeenAt:T(),firstSeenAt:T(),sources:n.Array(n.String()),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),createdAt:T(),updatedAt:T()}),_$e=d({tags:["service-catalog"],method:"GET",url:`${Yr}/endpoints`,response:n.Array(M$)}),w$=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var KA=n.Object({id:n.String(),hostName:n.String(),env:n.Optional(n.String()),cpuUtilizationAverage:n.Number(),hostType:n.Enum(w$),teams:n.Array(n.String()),tags:n.Array(n.String()),firstSeenAt:T(),lastSeenAt:T(),clusterId:n.String()}),h$e=d({tags:["service-catalog"],method:"GET",url:`${Yr}/hosts`,response:n.Array(KA)}),O$e=d({tags:["service-catalog"],method:"GET",url:`${Yr}/hosts/:hostId`,params:n.Object({hostId:m()}),response:KA}),yu=["http","db","rpc","messaging","genai","object_store"],zA={name:n.String(),env:n.Optional(n.String())},D$=n.Object({...zA,nodeType:n.Literal("observed"),id:n.Union([n.String(),n.Null()]),namespace:n.Union([n.String(),n.Null()])}),$$=n.Object({...zA,nodeType:n.Literal("inferred"),serviceType:n.Enum(yu),endpoint:n.Optional(n.String()),resourceName:n.Optional(n.String())}),G$=S("nodeType",[D$,$$]),FA=n.Object({env:n.Optional(n.String()),name:n.String()}),v$=n.Object({from:FA,to:FA,count:n.Number()}),A$e=d({tags:["service-catalog"],url:`${Yr}/services/:serviceId/graph`,method:"GET",params:n.Object({serviceId:m()}),query:n.Object({...yt.properties,query:n.Optional(m({type:"tsuga-query"}))}),response:n.Object({clusterId:n.String(),nodes:n.Array(G$),edges:n.Array(v$)})}),BA=n.Object({id:n.String(),name:n.String(),owner:n.String({description:"Team ID that owns the resource"})}),j$=n.Object({monitors:n.Array(BA),slos:n.Array(BA)}),S$e=d({tags:["service-catalog"],method:"GET",url:`${Yr}/services/:serviceId/related-resources`,params:n.Object({serviceId:m()}),response:j$}),b$e=d({tags:["service-catalog"],method:"GET",url:`${Yr}/services/by-api-keys`,response:n.Record(n.String(),n.Array(n.Object({serviceName:n.String(),serviceNamespace:n.Optional(n.String())})))});var Eu=`/${"v1"}/services`,Iu=n.Pick(Ms,["id","serviceName","serviceNamespace","env","teams","versions","languages","runtimes","lastSeenAt","firstSeenAt","sources","logsCount24h","errorLogsCount24h","tracesCount24h","errorTracesCount24h"],{$id:"Service",description:"Observed telemetry service with metadata, activity stats and version signals"}),F$={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!1}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],runtimes:[{runtime:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],lastSeenAt:"2024-01-15T12:34:56.000Z",firstSeenAt:"2024-01-01T08:00:00.000Z",sources:["logs","metrics","traces"],logsCount24h:12e3,errorLogsCount24h:42,tracesCount24h:8500,errorTracesCount24h:17};Object.assign(Iu,{examples:[F$]});var VA=d({description:"Retrieve all services",operationId:"listServices",tags:["services"],url:Eu,method:"GET",paginated:!0,query:n.Object({...ee,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:n.Array(Iu)}),YA=d({description:"Retrieve a service by its id",operationId:"getService",tags:["services"],url:`${Eu}/:serviceId`,method:"GET",params:n.Object({serviceId:m({allowEmpty:!1})}),response:Iu}),QA={name:n.String({description:"Service name"}),env:n.Optional(n.String({description:"Environment observed from spans"}))},B$=n.Object({...QA,nodeType:n.Literal("observed",{description:"Node type identifier"}),id:n.Union([n.String(),n.Null()],{description:"Service ID from catalog, null if ambiguous (multiple namespaces match)"}),namespace:n.Union([n.String(),n.Null()],{description:"Service namespace from catalog, null if ambiguous"})},{$id:"ObservedServiceGraphNode"}),q$=n.Object({...QA,nodeType:n.Literal("inferred",{description:"Node type identifier"}),serviceType:n.Enum(yu,{description:"Inferred service type, e.g. http, db, rpc"}),endpoint:n.Optional(n.String({description:"Inferred service endpoint address"})),resourceName:n.Optional(n.String({description:"Inferred resource name, e.g. table or queue name"}))},{$id:"InferredServiceGraphNode"}),H$=S("nodeType",[B$,q$]),WA=d({description:"Retrieve the dependency graph for a service, showing which services call each other",operationId:"getServiceGraph",tags:["services"],url:`${Eu}/:serviceId/graph`,method:"GET",params:n.Object({serviceId:m({allowEmpty:!1})}),query:n.Object({...yt.properties,query:n.Optional(m({type:"tsuga-query"}))}),response:n.Object({clusterId:n.String({description:"Cluster ID the graph was built from"}),nodes:n.Array(H$),edges:n.Array(n.Object({from:n.Object({env:n.Optional(n.String({description:"Environment of the source node"})),name:n.String({description:"Name of the source node"})},{description:"Reference to the source node"}),to:n.Object({env:n.Optional(n.String({description:"Environment of the target node"})),name:n.String({description:"Name of the target node"})},{description:"Reference to the target node"}),count:n.Number()}))})});var yr=require("node:fs"),ZA=require("node:os"),Tu=require("node:path"),XA=(0,Tu.join)((0,ZA.homedir)(),".config","tsuga"),Po=(0,Tu.join)(XA,"config.json"),K$="https://api.tsuga.com";function Uo(){if(!(0,yr.existsSync)(Po))return{};try{return JSON.parse((0,yr.readFileSync)(Po,"utf-8"))}catch{throw new Error(`Config file corrupted: ${Po}
38
+ Re-run: tsuga auth <token>`)}}function _u(e){(0,yr.mkdirSync)(XA,{recursive:!0,mode:448}),(0,yr.writeFileSync)(Po,`${JSON.stringify(e,null,2)}
39
+ `,{mode:384})}function hu(e){let t=Uo(),r=e.operationApiKey??process.env.TSUGA_OPERATION_API_KEY??t.operationApiKey,o=t.defaults??{},i=e.clusterId?.trim()||process.env.TSUGA_CLUSTER_ID?.trim()||o.cluster?.trim()||void 0;return{apiUrl:process.env.TSUGA_API_URL?.trim()||K$,operationApiKey:r,clusterId:i,defaults:o}}function Ou(e){let t={};try{t=Uo()}catch{}_u({...t,...e})}function JA(){return(0,yr.existsSync)(Po)||!!process.env.TSUGA_OPERATION_API_KEY}function Au(){return Po}var eS={from:"-30m",to:"now",query:"*","max-results":"100"};function Er(e){return(Uo().defaults??{})[e]??eS[e]}function tS(e,t){let r={};try{r=Uo()}catch{}let o={...r.defaults??{},[e]:t};_u({...r,defaults:o})}function rS(){let e={};try{e=Uo()}catch{}let{defaults:t,...r}=e;_u(r)}function nS(e,t){let r=[`API URL: ${e.apiUrl}`];e.operationApiKey?r.push(`Operation API key: ${e.operationApiKey.slice(0,12)}...${e.operationApiKey.slice(-4)}`):r.push("Operation API key: (not set)"),r.push(`Config: ${t}`),r.push(""),r.push("Defaults (custom overrides marked with *):");let o={...eS,...e.defaults};for(let[i,a]of Object.entries(o)){let p=i in e.defaults?" *":"";r.push(` ${i}: ${a}${p}`)}return`${r.join(`
40
+ `)}
41
+ `}function oS(){return Uo().lastUpdateCheck}function iS(e){Ou({lastUpdateCheck:e})}function aS(e,t){let r=t??Er(e);return r===void 0?void 0:Ss(r)}function Su(e){let t=Er(e);return t===void 0?"":` (default: ${t})`}function sS(e,t){e.command("service-graph").description("Inspect service dependency graphs").command("get <serviceId>").description("Retrieve the dependency graph for a service").option("--from <timestamp>",`Start of time range${Su("from")}`).option("--to <timestamp>",`End of time range${Su("to")}`).option("--query <query>",`Search query${Su("query")}`).action(async(o,i)=>{let a={},p=aS("from",i.from),u=aS("to",i.to);p!==void 0&&(a.from=p),u!==void 0&&(a.to=u),i.query!==void 0&&(a.query=i.query);let l=await t()(WA,{params:{serviceId:o},query:a});ne(l)})}var bu=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],xu=["light","dark"];var z$={light:{red:{text:"foreground.red",background:"avatar.background.red"},orange:{text:"foreground.orange",background:"avatar.background.orange"},amber:{text:"foreground.amber",background:"avatar.background.amber"},yellow:{text:"foreground.yellow",background:"avatar.background.yellow"},green:{text:"foreground.green",background:"avatar.background.green"},emerald:{text:"foreground.emerald",background:"avatar.background.emerald"},teal:{text:"foreground.teal",background:"avatar.background.teal"},cyan:{text:"foreground.cyan",background:"avatar.background.cyan"},sky:{text:"foreground.sky",background:"avatar.background.sky"},blue:{text:"foreground.blue",background:"avatar.background.blue"},indigo:{text:"foreground.indigo",background:"avatar.background.indigo"},purple:{text:"foreground.purple",background:"avatar.background.purple"},pink:{text:"foreground.pink",background:"avatar.background.pink"}},dark:{red:{text:"avatar.foreground.foreground",background:"avatar.solid-background.red"},orange:{text:"avatar.foreground.foreground",background:"avatar.solid-background.orange"},amber:{text:"avatar.foreground.foreground",background:"avatar.solid-background.amber"},yellow:{text:"avatar.foreground.foreground",background:"avatar.solid-background.yellow"},green:{text:"avatar.foreground.foreground",background:"avatar.solid-background.green"},emerald:{text:"avatar.foreground.foreground",background:"avatar.solid-background.emerald"},teal:{text:"avatar.foreground.foreground",background:"avatar.solid-background.teal"},cyan:{text:"avatar.foreground.foreground",background:"avatar.solid-background.cyan"},sky:{text:"avatar.foreground.foreground",background:"avatar.solid-background.sky"},blue:{text:"avatar.foreground.foreground",background:"avatar.solid-background.blue"},indigo:{text:"avatar.foreground.foreground",background:"avatar.solid-background.indigo"},purple:{text:"avatar.foreground.foreground",background:"avatar.solid-background.purple"},pink:{text:"avatar.foreground.foreground",background:"avatar.solid-background.pink"}},gradient:{red:"var(--chakra-colors-gradient-red)",orange:"var(--chakra-colors-gradient-orange)",amber:"var(--chakra-colors-gradient-amber)",yellow:"var(--chakra-colors-gradient-yellow)",green:"var(--chakra-colors-gradient-green)",emerald:"var(--chakra-colors-gradient-emerald)",teal:"var(--chakra-colors-gradient-teal)",cyan:"var(--chakra-colors-gradient-cyan)",sky:"var(--chakra-colors-gradient-sky)",blue:"var(--chakra-colors-gradient-blue)",indigo:"var(--chakra-colors-gradient-indigo)",purple:"var(--chakra-colors-gradient-purple)",pink:"var(--chakra-colors-gradient-pink)"}},pS=["activity-heart","activity","airplay","airpods","alarm-clock","anchor","annotation-dots","annotation-heart","annotation-question","annotation","announcement-03","asterisk-01","atom-01","atom-02","award-03","award-04","award-05","backpack","bank-note-01","bank-note-02","bank-note-03","battery-charging-01","beaker-01","beaker-02","bell-03","bell-04","bell-ringing-03","bell-ringing-04","bluetooth-connect","bluetooth-on","book-closed","book-open-01","book-open-02","bookmark","briefcase-01","briefcase-02","brush-01","brush-02","brush-03","building-01","building-02","building-03","building-08","bus","calculator","calendar-check-01","calendar-date","calendar-heart-01","calendar","camera-01","camera-lens","car-01","certificate-01","certificate-02","check-heart","clipboard-attachment","clipboard-check","clipboard-download","clipboard","clock-snooze","clock-stopwatch","cloud-01","cloud-lightning","cloud-moon","cloud-raining-01","cloud-raining-03","cloud-raining-05","cloud-raining-06","cloud-snowing-01","cloud-sun-01","cloud-sun-02","cloud-sun-03","code-browser","code-circle-01","code-circle-02","code-circle-03","code-square-01","code-square-02","coins-hand","coins-stacked-01","colors","compass-01","compass-02","compass-03","compass","credit-card-01","credit-card-02","cube-02","cube-04","cube-outline","currency-bitcoin-circle","currency-dollar-circle","currency-ethereum-circle","currency-euro-circle","currency-pound-circle","currency-ruble-circle","currency-rupee-circle","currency-yen-circle","cursor-click-01","cursor-click-02","diamond-01","diamond-02","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","disc-01","disc-02","droplets-01","droplets-02","droplets-03","dropper","face-content","face-frown","face-happy","face-neutral","face-sad","face-smile","face-wink","feather","file-02","file-05","file-06","file-heart-01","file-heart-02","file-search-01","file-search-02","file-search-03","film-01","film-02","fingerprint-03","fingerprint-04","flag-01","flag-04","flash-off","flash","gaming-pad-01","gaming-pad-02","gift-01","glasses-01","glasses-02","globe-03","globe-04","globe-05","globe-06","globe-slated-01","globe-slated-02","graduation-hat-01","graduation-hat-02","hash-01","hash-02","headphones-01","headphones-02","heart-circle","heart-hand","heart-hexagon","heart-octagon","heart-rounded","heart-square","hearts","hexagon-01","hexagon-02","home-03","home-smile","hourglass-01","hourglass-02","hourglass-03","hurricane-01","hurricane-02","hurricane-03","image-01","image-02","image-03","image-04","image-05","keyboard-01","laptop-01","life-buoy-01","life-buoy-02","lightbulb-02","lightbulb-03","lightbulb-04","lock-keyhole-circle","lock-keyhole-square","luggage-01","luggage-02","luggage-03","magic-wand-01","magic-wand-02","map-01","map-02","mark","marker-pin-01","marker-pin-04","marker-pin-05","marker-pin-06","medical-circle","medical-cross","medical-square","message-chat-square","message-notification-square","message-smile-square","message-text-square-02","microphone-01","microphone-02","microscope","modem-01","modem-02","monitor-03","monitor-04","monitor-05","moon-01","moon-eclipse","moon-star","music-note-01","music-note-02","music-note-plus","octagon","palette","paperclip","pentagon","phone-01","phone-02","phone-call-01","phone","piggy-bank-01","pin-01","pin-02","plane","play-circle","play-square","podcast","power-02","presentation-chart-01","printer","receipt","recording-01","recording-02","recording-03","rocket-01","rocket-02","roller-brush","rss-01","rss-02","ruler","scales-01","scales-02","server-06","shield-01","shield-02","shield-03","shield-dollar","shield-zap","shopping-bag-01","shopping-cart-01","signal-01","signal-02","signal-03","simcard","sliders-01","sliders-02","snowflake-01","snowflake-02","speaker-01","speaker-02","speaker-03","speedometer-01","speedometer-02","speedometer-03","speedometer-04","square","stand","star-03","star-07","sticker-circle","sticker-square","sun-setting-01","sun-setting-02","sun-setting-03","sun","sunrise","sunset","tablet-01","tag-01","tag-02","tag-03","target-01","target-02","target-03","target-04","target-05","terminal-browser","terminal-circle","terminal-square","thermometer-02","thermometer-03","thermometer-cold","thermometer-warm","thumbs-down","thumbs-up","ticket-01","tool-01","tool-02","train","tram","translate-01","triangle","trophy-01","trophy-02","truck-01","truck-02","tv-02","umbrella-01","umbrella-02","umbrella-03","virus","voicemail","wallet-01","wallet-02","wallet-05","watch-circle","watch-square","waves","webcam-01","webcam-02","wind-01","wind-02","wind-03","youtube","zap-circle","zap-fast","zap"];var j$e=z$.light.red.background;var V$="^\\S(.*\\S)?$",Y$=128,Q$=256,W$=n.Object({key:n.String(),value:n.String()},{title:"Tag"}),Z$=n.Object({key:n.String({maxLength:Y$}),value:n.String({maxLength:Q$,pattern:V$})},{title:"Tag"}),Un=n.Array(W$,{title:"Tags",description:"List of key/value tags applied to the resource"}),Nn=n.Array(Z$,{title:"Tags",maxItems:50,description:"List of key/value tags applied to the resource"}),Ve=n.Optional(Un),Ze=n.Optional(Nn);var Qr="/v0/teams",Ds=["public","private"],ws={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},X$=n.Enum([ws.NAME,ws.CREATED_AT,ws.MEMBER_COUNT,ws.VISIBILITY]),cS=n.Object({color:n.Enum(bu),mode:n.Enum(xu),iconName:n.Enum(pS)}),Ru=n.Object({color:n.Enum(bu),mode:n.Enum(xu)}),J$=100,eG=250,No=n.Object({id:n.String({description:"Identifier of the team"}),name:n.String({description:"Human readable team name displayed throughout the app"}),description:n.Optional(n.String()),visibility:n.Enum(Ds,{description:"Controls whether the resources of the team are discoverable by users"}),tags:Ve,createdAt:T(),updatedAt:T(),memberCount:n.Optional(n.Number({description:"Number of members currently in the team"})),avatar:n.Optional(cS)}),$s=n.Object({name:n.String({minLength:1,maxLength:J$,description:"Name to assign to the team"}),description:n.Optional(n.String({maxLength:eG})),visibility:n.Enum(Ds,{description:"Controls whether the resources of the team are discoverable by users"}),tags:Ze,avatar:n.Optional(cS)}),tG=n.Object({id:n.String(),name:n.String(),email:n.String(),role:n.Enum(yo),joinedTeamAt:T(),orgRole:n.Enum(Is),avatar:n.Optional(Ru)}),Z$e=d({tags:["teams"],url:Qr,method:"GET",paginated:!0,response:n.Array(No),query:n.Object({...ee,includeMemberCount:n.Optional(n.Boolean()),searchQuery:n.Optional(m()),visibility:n.Optional(n.Enum(Ds)),myTeamsOnly:n.Optional(n.Boolean()),sortBy:n.Optional(X$),sortDirection:n.Optional(n.Enum(["asc","desc"]))})}),X$e=d({tags:["teams"],url:`${Qr}/:id`,method:"GET",params:n.Object({id:m()}),response:No}),J$e=d({tags:["teams"],url:`${Qr}/:id/members`,method:"GET",params:n.Object({id:m()}),response:n.Array(tG)}),eGe=d({tags:["teams"],url:`${Qr}/:id/assets`,method:"GET",params:n.Object({id:m()}),response:n.Object({apiKeyCount:n.Number(),logRouteCount:n.Number(),monitorCount:n.Number(),notificationRuleCount:n.Number(),dashboardCount:n.Number()})}),tGe=d({tags:["teams"],url:Qr,method:"POST",body:$s,response:No}),rGe=d({tags:["teams"],url:`${Qr}/:id`,method:"PUT",params:n.Object({id:m()}),body:$s,response:No}),nGe=d({tags:["teams"],url:`${Qr}/bulk-update`,method:"POST",body:n.Object({teamIds:n.Array(m(),{maxItems:100}),config:n.Object({visibility:n.Enum(Ds)})}),response:n.Object({})}),oGe=d({tags:["teams"],url:`${Qr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:D});var rG=n.Enum(["terraform-provider","web-frontend","mcp-server","cli"]),Ce=S("type",[n.Object({type:n.Literal("user"),id:n.String(),name:n.String(),avatar:n.Optional(Ru)}),n.Object({type:n.Literal("operation-api-key"),id:n.String(),name:n.String(),source:n.Optional(rG)})]);var er="/v0/dashboards",mS=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],nG=["bar","bar-connection","distribution","gauge","heatmap","list-connection","list-log-patterns","list","pie","pie-connection","query-value","query-value-connection","table","timeseries-connection","timeseries","top-list-connection","top-list"],TGe=[...nG,"note"];var oG=["ns","us","ms","s","m","h","days"];var iG=["B","KB","MB","GB","TB","PB"];var aG=20;var uS=n.Object({type:n.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),lS=n.Object({type:n.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:n.Enum(oG,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),dS=n.Object({type:n.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:n.Enum(iG,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),fS=n.Object({type:n.Literal("percent",{description:"Format values as percentages"})},{$id:"DataNormalizerPercent",title:"Percent"}),gS=n.Object({type:n.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),yS=n.Object({type:n.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),sG=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),pG=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit",maxLength:aG})},{$id:"InputDataNormalizerCustom",title:"Custom"}),vt=S("type",[lS,dS,fS,gS,yS,uS,sG],{title:"Normalizer"}),jt=S("type",[lS,dS,fS,gS,yS,uS,pG],{title:"Normalizer"}),ES=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(vt)},{title:"WidgetListColumn"}),IS=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(jt)},{title:"WidgetListColumn"}),js=["background","no-background"],cG=["table","legend-only","no-legend"];var mG=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],TS=["alert","warning","success"],Lo=n.Object({operator:n.Enum(mG,{description:"Comparator used to evaluate the metric value"}),value:n.Number({description:"Threshold value used when evaluating the operator"}),color:n.Enum(TS,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting"}),uG=n.Object({value:n.Number({description:"Y-axis value where the threshold marker is placed"}),level:n.Enum(TS,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker"}),lG=["red","pink","violet","blue","cyan","green","yellow","orange"],_S=n.Object({from:n.Number({description:"Lower bound of the Gauge color threshold; runs up to the next threshold or the max"}),color:n.Enum(lG,{description:"Color applied to the band starting at this value"})},{title:"GaugeColorThreshold"}),dG=["sec","min","hour","day"],Fs=n.Object({time:n.Number({description:"Number of units that make up each bar bucket"}),metric:n.Enum(dG,{description:"Unit used to measure the bucket width"})});var Gs=n.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),fG=n.Object({formula:n.Optional(n.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),n.String({description:"Optional alias for a query (only used for display in the UI)"})))}),gG=n.Object({formula:n.Optional(m({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),m({type:"short",description:"Optional alias for a query (only used for display in the UI)"})))}),Bs={source:qr,queries:k_,formula:n.Optional(M_),aliases:n.Optional(fG),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},qs={source:qr,queries:Ui,formula:n.Optional(Ni),aliases:n.Optional(gG),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},ko={...Bs,groupBy:n.Optional(qc)},Mo={...qs,groupBy:n.Optional(To)},ot=n.Enum(cG,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),Fe=n.Optional(n.Number({description:"Number of decimal places to display in the value"})),Wr=n.Optional(n.Array(uG,{description:"Threshold markers displayed on the chart"})),yG=n.Object({name:n.String({description:"Display name of the table column"}),...Bs,source:qr,normalizer:n.Optional(vt),precision:Fe},{title:"TableColumn"}),EG=n.Object({name:m({description:"Display name of the table column"}),...qs,source:qr,normalizer:n.Optional(jt),precision:Fe},{title:"TableColumn"}),IG=n.Array(n.Object({id:n.String({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),TG=n.Array(n.Object({id:m({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),hS=["horizontal","vertical"],_G=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:n.String({description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(ES,{description:"Custom columns to display for each log"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"GraphVisualizationList",title:"List"}),hG=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:m({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(IS,{description:"Custom columns to display for each log"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"InputGraphVisualizationList",title:"List"}),vs=S("type",[n.Object({type:n.Literal("auto")}),n.Object({type:n.Literal("number"),value:n.Number()})]),Hs=n.Object({min:vs,max:vs,scale:S("type",[n.Object({type:n.Literal("pow"),exponent:n.Number()}),n.Object({type:n.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:n.Boolean()}),Ks=n.Object({min:vs,max:vs,scale:S("type",[n.Object({type:n.Literal("pow"),exponent:n.Number({minimum:0})}),n.Object({type:n.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:n.Boolean()}),OG=n.Array(n.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),AG=n.Array(n.Integer({minimum:0,maximum:100,description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"});var SG=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(ot),thresholds:Wr,yAxisSettings:n.Optional(Hs)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),bG=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(ot),thresholds:Wr,yAxisSettings:n.Optional(Ks)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),xG=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),query:n.String({description:"The read-only SQL query to execute against the connection."}),listColumns:n.Optional(n.Array(ES,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),RG=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:n.Optional(n.Array(IS,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),CG=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),PG=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),UG=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(ot)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),NG=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(ot)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),LG=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(ot),thresholds:Wr,yAxisSettings:n.Optional(Hs)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),kG=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(ot),thresholds:Wr,yAxisSettings:n.Optional(Ks)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),MG=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:n.Optional(n.Enum(js,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Lo,{description:"Conditional formatting rules applied to the displayed value"})),precision:Fe,normalizer:n.Optional(vt),legendMode:n.Optional(ot)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),wG=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:n.Optional(n.Enum(js,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Lo,{description:"Conditional formatting rules applied to the displayed value"})),precision:Fe,normalizer:n.Optional(jt),legendMode:n.Optional(ot)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),DG=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:n.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(hS,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),$G=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:m({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(hS,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),GG=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...ko,timeBucket:n.Optional(Fs),normalizer:n.Optional(vt),precision:Fe,legendMode:n.Optional(ot),thresholds:Wr,yAxisSettings:n.Optional(Hs),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),vG=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Mo,timeBucket:n.Optional(Fs),normalizer:n.Optional(jt),precision:Fe,legendMode:n.Optional(ot),thresholds:Wr,yAxisSettings:n.Optional(Ks),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),jG=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...ko,normalizer:n.Optional(vt),precision:Fe,conditions:n.Optional(n.Array(Lo,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),FG=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Mo,normalizer:n.Optional(jt),precision:Fe,conditions:n.Optional(n.Array(Lo,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),BG=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...ko,normalizer:n.Optional(vt),precision:Fe,legendMode:n.Optional(ot)},{$id:"GraphVisualizationPie",title:"Pie"}),qG=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Mo,normalizer:n.Optional(jt),precision:Fe,legendMode:n.Optional(ot)},{$id:"InputGraphVisualizationPie",title:"Pie"}),HG=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...Bs,backgroundMode:n.Optional(n.Enum(js,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Lo,{description:"Conditional formatting rules applied to the displayed value"})),precision:Fe,normalizer:n.Optional(vt),legendMode:n.Optional(ot)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),KG=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...qs,backgroundMode:n.Optional(n.Enum(js,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Lo,{description:"Conditional formatting rules applied to the displayed value"})),precision:Fe,normalizer:n.Optional(jt),legendMode:n.Optional(ot)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),zG=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...Bs,max:n.Optional(n.Number({description:"Gauge maximum value"})),colorThresholds:n.Optional(n.Array(_S,{description:"Color thresholds inside the gauge range"})),precision:Fe,normalizer:n.Optional(vt)},{$id:"GraphVisualizationGauge",title:"Gauge"}),VG=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...qs,max:n.Optional(n.Number({description:"Gauge maximum value"})),colorThresholds:n.Optional(n.Array(_S,{description:"Color thresholds inside the gauge range"})),precision:Fe,normalizer:n.Optional(jt)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),YG=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...ko,timeBucket:n.Optional(Fs),precision:Fe,normalizer:n.Optional(vt),thresholds:Wr,legendMode:n.Optional(ot),yAxisSettings:n.Optional(Hs)},{$id:"GraphVisualizationBar",title:"Bar"}),QG=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Mo,timeBucket:n.Optional(Fs),precision:Fe,normalizer:n.Optional(jt),thresholds:Wr,legendMode:n.Optional(ot),yAxisSettings:n.Optional(Ks)},{$id:"InputGraphVisualizationBar",title:"Bar"}),WG=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...ko,precision:Fe,normalizer:n.Optional(vt),percentileMarkers:n.Optional(OG)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),ZG=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Mo,precision:Fe,normalizer:n.Optional(jt),percentileMarkers:n.Optional(AG)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),XG=["red","pink","violet","blue","cyan","green","yellow","orange"],OS=n.Enum(XG,{description:"Color palette used to render the heatmap intensity gradient"}),JG=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...ko,precision:Fe,normalizer:n.Optional(vt),palette:n.Optional(OS)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),ev=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Mo,precision:Fe,normalizer:n.Optional(jt),palette:n.Optional(OS)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),tv=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(yG,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(qc),defaultSorting:n.Optional(IG)},{$id:"GraphVisualizationTable",title:"Table"}),rv=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(EG,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(To),defaultSorting:n.Optional(TG)},{$id:"InputGraphVisualizationTable",title:"Table"}),nv=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(n.String({description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(mS,{description:"Background color used to render the note"})),noteAlign:n.Optional(Gs),noteJustifyContent:n.Optional(Gs)},{$id:"GraphVisualizationNote",title:"Note"}),ov=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(m({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(mS,{description:"Background color used to render the note"})),noteAlign:n.Optional(Gs),noteJustifyContent:n.Optional(Gs)},{$id:"InputGraphVisualizationNote",title:"Note"}),iv=S("type",[SG,xG,CG,UG,LG,MG,GG,jG,BG,HG,zG,YG,WG,JG,tv,_G,nv,DG]),av=S("type",[bG,RG,PG,NG,kG,wG,vG,FG,qG,KG,VG,QG,ZG,ev,rv,hG,ov,$G]),zs=n.Object({id:n.String({description:"Identifier of the graph widget"}),name:n.Optional(n.String({description:"Display name of the graph widget"})),description:n.Optional(n.String({description:"Description of the graph widget"})),visualization:iv,layout:n.Optional(n.Object({x:n.Number({description:"Horizontal grid position of the widget"}),y:n.Number({description:"Vertical grid position of the widget"}),w:n.Number({description:"Width of the widget in grid units"}),h:n.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),Vs=n.Object({id:m({description:"Identifier of the graph widget"}),name:n.Optional(m({description:"Display name of the graph widget"})),description:n.Optional(n.String({minLength:1,maxLength:800,description:"Description of the graph widget"})),visualization:av,layout:n.Optional(n.Object({x:n.Number({description:"Horizontal grid position of the widget"}),y:n.Number({description:"Vertical grid position of the widget"}),w:n.Number({description:"Width of the widget in grid units"}),h:n.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),sv=10,pv=n.Array(n.Object({key:n.String({description:"Filter key"}),values:n.Array(n.String({description:"Filter value"}))}),{description:"Filters applied to every widget on the dashboard"}),cv=n.Array(n.Object({key:m({description:"Filter key"}),values:n.Array(m({description:"Filter value"}))}),{maxItems:sv,description:"Filters applied to every widget on the dashboard"}),Ln=n.Object({id:n.String({description:"Identifier of the dashboard"}),name:n.String({description:"Display name of the dashboard"}),owner:n.String({description:"Team ID that owns and manages the dashboard"}),graphs:n.Array(zs,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(pv),createdAt:T(),updatedAt:T(),creator:n.Optional(Ce),updater:n.Optional(Ce),tags:Ve,timePreset:n.Optional(n.Enum(jc))}),Ys=n.Object({name:m({description:"Display name of the dashboard"}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the dashboard"}),graphs:n.Array(Vs,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(cv),tags:Ze,timePreset:n.Optional(n.Enum(jc))}),Cu=n.Object({...ee,owners:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Filter by owner team IDs"}))}),_Ge=d({tags:["dashboards"],url:er,method:"GET",query:Cu,paginated:!0,response:n.Array(Ln)}),Gt={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},AS=[Gt.OWNER,Gt.TAGS,Gt.WIDGET_COUNT,Gt.UPDATED_AT,Gt.NAME],Qs=n.Partial(n.Object({owners:pr(m({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:m({allowEmpty:!1}),exclude:n.Optional(n.Boolean({description:"If true, exclude dashboards matching this value instead of including them"}))},{description:"Substring matched against the dashboard name"}),tags:pr(Nn.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50})},{description:"Optional filters applied to narrow the returned dashboards"})),mv=n.Partial(n.Object({...ee,filters:Qs,sort:n.Object({by:n.Enum([Gt.IS_FAVORITE,Gt.OWNER,Gt.TAGS,Gt.WIDGET_COUNT,Gt.UPDATED_AT,Gt.NAME],{description:"Field to sort the returned dashboards by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})})),hGe=d({tags:["dashboards"],url:`${er}/query`,method:"POST",paginated:!0,response:n.Array(Ln),body:mv}),OGe=d({tags:["dashboards"],url:`${er}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(Qs,["tags"]))}),response:Un}),AGe=d({tags:["dashboards"],url:`${er}/:id`,method:"GET",params:n.Object({id:m()}),response:Ln}),SGe=d({tags:["dashboards"],url:er,method:"POST",body:Ys,response:Ln}),bGe=d({tags:["dashboards"],url:`${er}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Partial(Ys),response:Ln}),xGe=d({tags:["dashboards"],url:`${er}/bulk-update`,method:"PUT",body:n.Object({dashboardIds:n.Array(m()),owner:m({allowEmpty:!1})}),response:n.Object({})}),RGe=d({tags:["dashboards"],url:`${er}/:id`,method:"DELETE",params:n.Object({id:m()}),response:D}),CGe=d({tags:["dashboards"],url:`${er}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:m({allowEmpty:!1}),graphId:m({allowEmpty:!1})}),body:n.Omit(Vs,["id"]),response:zs}),PGe=d({tags:["dashboards"],url:`${er}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(m())}),response:n.Object({})});var kn=`/${"v1"}/dashboards`,wo=n.Pick(Ln,["id","name","owner","graphs","filters","tags","timePreset"],{$id:"Dashboard",description:"Visualization of telemetry data with customizable graphs and filters"}),uv={id:"123-456-abc",name:"API Performance Overview",owner:"abc-123-def",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(wo,{examples:[uv]});var lv=n.Pick(Cu,["limit","offset","owners"]),$Ge=d({description:"Retrieve all dashboards",operationId:"listDashboards",tags:["dashboards"],url:kn,method:"GET",paginated:!0,query:lv,response:n.Array(wo)}),SS=n.Partial(n.Object({...ee,filters:Qs,sort:n.Object({by:n.Enum([...AS],{description:"Field to sort the returned dashboards by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})})),dv={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"API"},tags:{values:[{key:"service",value:"api-gateway"}]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(SS,{examples:[dv]});var bS=d({description:"Query dashboards with filters, sorting, and pagination",operationId:"queryDashboards",tags:["dashboards"],url:`${kn}/query`,method:"POST",paginated:!0,body:SS,response:n.Array(wo)}),xS=d({description:"Retrieve a dashboard by its id",operationId:"getDashboard",tags:["dashboards"],url:`${kn}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:wo}),Pu=n.Pick(Ys,["name","owner","graphs","filters","tags","timePreset"]),fv={name:"API Performance Overview",owner:"abc-123-def",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(Pu,{examples:[fv]});var RS=d({description:"Create a new dashboard",operationId:"createDashboard",tags:["dashboards"],url:kn,method:"POST",body:Pu,response:wo}),CS=d({description:"Update a dashboard by its id",operationId:"updateDashboard",tags:["dashboards"],url:`${kn}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:n.Partial(Pu),response:wo}),gv=n.Object({id:m({allowEmpty:!1,description:"The dashboard ID to delete"})}),PS=d({description:"Delete a dashboard by its id",operationId:"deleteDashboard",tags:["dashboards"],url:`${kn}/:id`,method:"DELETE",params:gv,response:D}),GGe=d({description:"Update a single graph within a dashboard by ID.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${kn}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:m({allowEmpty:!1,description:"The dashboard ID containing the graph"}),graphId:m({allowEmpty:!1,description:"The graph ID to update"})}),body:n.Omit(Vs,["id"]),response:zs});var yv=100,Ev=3,Do=n.Object({id:n.String(),name:n.String(),keyLastCharacters:n.String(),owner:n.String(),tags:Un,teamOverrideFields:n.Optional(n.Array(n.String())),updatedAt:T(),createdAt:T(),creator:n.Optional(Ce),updater:n.Optional(Ce),assetUpdatedAt:T()}),Ki=n.Object({name:n.String({format:ys,minLength:1,maxLength:yv}),owner:m({allowEmpty:!1}),tags:Nn,teamOverrideFields:n.Optional(n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:Ev}))}),zi="/v0/ingestion-api-keys",VGe=d({tags:["ingestion-api-keys"],url:zi,method:"POST",body:Ki,response:n.Intersect([Do,n.Object({key:n.String()})])}),YGe=d({tags:["ingestion-api-keys"],url:zi,method:"GET",paginated:!0,query:n.Object(ee),response:n.Array(Do)}),QGe=d({tags:["ingestion-api-keys"],url:`${zi}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Do}),WGe=d({tags:["ingestion-api-keys"],url:`${zi}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Ki,response:Do}),ZGe=d({tags:["ingestion-api-keys"],url:`${zi}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:D});var Vi=`/${"v1"}/ingestion-api-keys`,Yi=n.Pick(Do,["id","name","owner","tags","teamOverrideFields","keyLastCharacters"],{$id:"IngestionApiKey",description:"API key used to send telemetry data to Tsuga"}),US={id:"123-456-abc",name:"Production Logs Ingestion",keyLastCharacters:"x7Qm",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Yi,{examples:[US]});var NS=n.Pick(Ki,["name","owner","tags","teamOverrideFields"],{$id:"CreateIngestionApiKeyRequest"}),LS=n.Pick(Ki,["name","owner","tags","teamOverrideFields"],{$id:"UpdateIngestionApiKeyRequest"}),kS={name:"Production Logs Ingestion",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(NS,{examples:[kS]});Object.assign(LS,{examples:[kS]});var Iv={...US,key:"tsuga_in:v1:abc123xyx7Qm"},MS=d({description:"Retrieve all ingestion API keys",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:Vi,method:"GET",paginated:!0,query:n.Object(ee),response:n.Array(Yi)}),ive=d({description:"Retrieve an ingestion API key by its id",operationId:"getIngestionApiKey",tags:["ingestion-api-keys"],url:`${Vi}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Yi}),Tv=n.Intersect([n.Pick(Yi,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),n.Object({key:n.String({description:"The full API key value, returned only at creation time"})})],{title:"IngestionApiKeyCreated",example:Iv}),wS=d({description:"Create a new ingestion API key",operationId:"createIngestionApiKey",tags:["ingestion-api-keys"],url:Vi,method:"POST",body:NS,response:Tv}),DS=d({description:"Update an ingestion API key by its id",operationId:"updateIngestionApiKey",tags:["ingestion-api-keys"],url:`${Vi}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:LS,response:Yi}),$S=d({description:"Delete an ingestion API key by its id",operationId:"deleteIngestionApiKey",tags:["ingestion-api-keys"],url:`${Vi}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:D});var _v={application:{webService:["azure_web_app","gcp_app_engine_service"]},data:{bucket:["aws_s3_bucket","gcp_bucket","azure_blob_storage_container"],messagingService:["aws_kinesis_data_stream","aws_sqs_queue","aws_sns_topic","azure_service_bus_namespace","azure_service_bus_queue","gcp_pubsub_topic","azure_event_grid_topic","azure_event_hub_namespace","azure_event_hub"],fileSystem:["aws_efs","azure_file_share"],contentDeliveryNetwork:["aws_cloudfront_distribution","gcp_cloud_cdn_configuration"],database:["aws_dynamodb_table","aws_elasticache","aws_rds_instance","azure_database_for_mysql_server","azure_database_for_postgres_server","azure_sql_database_server","azure_sql_database","gcp_bigtable_instance","gcp_cloud_sql_instance","gcp_firestore_database","gcp_spanner_instance","azure_cosmos_db_account"],storageAccount:["azure_storage_account"],volume:["aws_ebs_volume","gcp_compute_disk","azure_disk"]},compute:{virtualMachine:["aws_ec2_instance","gcp_compute_instance","azure_compute_virtual_machine"],serverless:["aws_lambda_function","gcp_cloud_run_function","gcp_cloud_run_job","gcp_cloud_run_service","azure_function_app"]},container:{kubernetesCluster:["aws_eks_cluster","gcp_gke_cluster","azure_aks_cluster"],containerRepository:["aws_ecr_repository","gcp_artifact_registry_repository","azure_container_registry"],containerCluster:["aws_ecs_cluster"],containerServiceTask:["aws_ecs_task"],containerService:["aws_ecs_service","azure_container_instance_group"],containerImage:["aws_ecr_image","gcp_artifact_registry_docker_image","azure_container_registry_image"]},network:{virtualNetwork:["aws_vpc","gcp_vpc","azure_virtual_network"],loadBalancer:["aws_elastic_load_balancer","gcp_forwarding_rule","azure_load_balancer","azure_traffic_manager_profile"],targetGroup:["aws_target_group"],certificate:["aws_acm_certificate","gcp_certificate_manager_certificate","azure_app_service_certificate"]}},[cve,mve,uve]=hv(_v);function hv(e){let t=[],r=[],o=[],i=Object.keys(e);for(let a of i){t.push(a);let p=e[a];for(let u in p){r.push(u);let l=p[u];Array.isArray(l)&&o.push(...l)}}return[Uu(t),Uu(r),Uu(o)]}function Uu(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var Nu=n.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),Ov=n.Object({versioningStatus:n.Optional(n.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),Av=n.Object({domainName:n.Optional(n.String()),origins:n.Optional(n.Array(n.String()))}),Sv=n.Object({allocatedStorageGib:n.Optional(n.Number()),encryptedAtRest:n.Optional(n.Boolean()),engine:n.Optional(n.String()),dynamoDbItemCount:n.Optional(n.Number()),dynamoDbActualSizeGib:n.Optional(n.Number())}),bv=n.Object({version:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnets:n.Optional(n.Array(n.String()))}),xv=n.Object({artifactRegistryFormat:n.Optional(n.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:n.Optional(n.String()),tagMutability:n.Optional(n.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:n.Optional(n.Boolean()),encryptionType:n.Optional(n.String())}),Rv=n.Object({status:n.Optional(n.String()),activeServices:n.Optional(n.Number()),pendingTasks:n.Optional(n.Number()),runningTasks:n.Optional(n.Number()),registeredContainerInstances:n.Optional(n.Number()),capacityProviders:n.Optional(n.Array(n.String()))}),Cv=n.Object({status:n.Optional(n.String()),desiredStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String()),availabilityZone:n.Optional(n.String()),startedAt:n.Optional(T())}),Pv=n.Object({isEncrypted:n.Optional(n.Boolean()),ownerId:n.Optional(n.String()),state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","updating"]))}),Uv=n.Object({type:n.Optional(n.String()),osType:n.Optional(n.String()),subnetIds:n.Optional(n.Array(n.String())),nbContainers:n.Optional(n.Number())}),Nv=n.Object({digest:n.String(),imageTags:n.Array(n.String()),imageSizeBytes:n.Optional(n.Number()),imagePushedAt:n.Optional(T()),mediaType:n.Optional(n.String()),repositoryName:n.String(),repositoryId:n.Optional(n.String()),scanStatus:n.Optional(n.String())}),Lv=n.Object({url:n.Optional(n.String()),maxMessageSizeBytes:n.Optional(n.Number()),messageRetentionHours:n.Optional(n.Number())}),kv=n.Object({runtime:n.Optional(n.String()),memoryAllocationMib:n.Optional(n.Number()),timeoutMs:n.Optional(n.Number()),codeSha256:n.Optional(n.String())}),Mv=n.Object({kind:n.Optional(n.String())}),wv=n.Object({instanceId:n.String(),architecture:n.Optional(n.String()),instanceType:n.Optional(n.String()),operatingSystem:n.Optional(n.String()),memoryMib:n.Optional(n.Number()),vCpus:n.Optional(n.Number()),vpcId:n.Optional(n.String()),k8sClusterId:n.Optional(n.String())}),Dv=n.Object({id:n.Optional(n.String()),ipCidrBlocks:n.Array(n.String())}),$v=n.Object({protocol:n.Optional(Nu),port:n.Optional(n.Number()),instanceProtocol:n.Optional(Nu),instancePort:n.Optional(n.Number())}),Gv=n.Object({protocol:n.Optional(n.String()),ports:n.Optional(n.Array(n.String())),portRange:n.Optional(n.String()),allPorts:n.Optional(n.Boolean())}),vv=n.Object({name:n.String(),ip:n.Optional(n.String()),type:n.Enum(["public","private"])}),jv=n.Object({type:n.String(),name:n.String()}),Fv=n.Object({frontendIp:n.Optional(vv),backendIpPools:n.Array(jv)}),Bv=n.Object({targetId:n.String(),targetPort:n.Optional(n.Number()),targetType:n.Optional(n.Enum(["instance","ip","lambda","alb"])),healthState:n.Optional(n.String()),healthReason:n.Optional(n.String()),healthDescription:n.Optional(n.String()),availabilityZone:n.Optional(n.String())}),qv=n.Object({protocol:n.Optional(Nu),port:n.Optional(n.Number()),type:n.Optional(n.Enum(["alb","lambda","instance","ip"])),name:n.Optional(n.String()),targetGroupArn:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),healthCheckProtocol:n.Optional(n.String()),healthCheckPort:n.Optional(n.String()),healthCheckPath:n.Optional(n.String()),healthCheckIntervalSeconds:n.Optional(n.Number()),healthCheckTimeoutSeconds:n.Optional(n.Number()),healthyThresholdCount:n.Optional(n.Number()),unhealthyThresholdCount:n.Optional(n.Number()),targets:n.Optional(n.Array(Bv)),targetCount:n.Optional(n.Number()),healthyTargetCount:n.Optional(n.Number()),loadBalancerArns:n.Optional(n.Array(n.String()))}),Hv=n.Object({first:n.Optional(n.String()),last:n.Optional(n.String()),scope:n.Optional(n.Number())}),Kv=n.Object({type:n.Optional(n.String()),name:n.Optional(n.String()),alwaysServe:n.Optional(n.Boolean()),subnets:n.Optional(n.Array(n.Union([n.Number(),Hv]))),target:n.Optional(n.String()),weight:n.Optional(n.Number()),priority:n.Optional(n.Number()),status:n.Optional(n.String())}),zv=n.Object({instanceId:n.Optional(n.String()),state:n.Optional(n.String()),reasonCode:n.Optional(n.String()),description:n.Optional(n.String())}),Vv=n.Object({loadBalancerType:n.Optional(n.String()),dnsName:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnetIds:n.Array(n.String()),scheme:n.Optional(n.String()),listeners:n.Optional(n.Union([n.Array($v),n.Array(Gv)])),targets:n.Optional(n.Union([n.Array(n.String()),n.Array(zv),n.Array(Kv)])),azureLoadBalancingRules:n.Optional(n.Array(Fv))}),Yv=n.Object({domainName:n.Optional(n.String()),expiresAt:n.Optional(T()),inUseBy:n.Optional(n.Array(n.String())),renewalEligibility:n.Optional(n.String()),revokedAt:n.Optional(T()),status:n.Optional(n.String()),type:n.Optional(n.String())}),Qv=n.Object({state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:n.Optional(n.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),Wv=n.Object({osType:n.Optional(n.Enum(["Windows","Linux"]))}),Zv=n.Object({state:n.Optional(n.String()),volumeType:n.Optional(n.String())}),Xv=n.Intersect([n.Object({isEncrypted:n.Optional(n.Boolean()),sizeGib:n.Optional(n.Number())}),n.Union([Qv,Zv,Wv])]),Jv=n.Object({instanceCount:n.Optional(n.Number()),hostnames:n.Optional(n.Array(n.String())),runtime:n.Optional(n.String())}),Ws=n.Union([n.Object({category:n.Literal("application"),resourceType:n.Literal("webService"),attributes:n.Optional(Jv)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("bucket"),attributes:n.Optional(Ov)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("messagingService"),attributes:n.Optional(Lv)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("fileSystem"),attributes:n.Optional(Pv)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("contentDeliveryNetwork"),attributes:n.Optional(Av)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("database"),attributes:n.Optional(Sv)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("storageAccount"),attributes:n.Optional(Mv)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("volume"),attributes:n.Optional(Xv)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("virtualMachine"),attributes:n.Optional(wv)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("serverless"),attributes:n.Optional(kv)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("kubernetesCluster"),attributes:n.Optional(bv)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerRepository"),attributes:n.Optional(xv)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerCluster"),attributes:n.Optional(Rv)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerServiceTask"),attributes:n.Optional(Cv)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerService"),attributes:n.Optional(Uv)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerImage"),attributes:n.Optional(Nv)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("virtualNetwork"),attributes:n.Optional(Dv)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("loadBalancer"),attributes:Vv}),n.Object({category:n.Literal("network"),resourceType:n.Literal("targetGroup"),attributes:n.Optional(qv)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("certificate"),attributes:n.Optional(Yv)})]);var Qi="/v0/inventory",Lu=["aws","gcp","azure"],GS=["scan_in_progress","success","failure"],ku=n.Object({id:n.String({description:"Identifier of the inventory resource"}),cloudPlatform:n.Enum(Lu,{description:"Cloud platform that hosts this resource"}),cloudAccount:n.String({description:"Cloud-native account identifier the resource was discovered in"}),cloudRegion:n.Optional(n.String({description:"Cloud region the resource was discovered in, when applicable"})),fullyQualifiedResourceId:n.String({description:"Cloud-native unique identifier for this resource (for example an AWS ARN or GCP resource name)"}),displayName:n.String({description:"Human-readable name shown in the Tsuga UI"}),nativeResourceType:n.String({description:"Cloud-native resource type, for example aws_ec2_instance or gcp_bucket"}),resourceCreatedAt:n.Optional(T({description:"When the resource was created in the cloud, when known"})),resourceUpdatedAt:n.Optional(T({description:"When the resource was last updated in the cloud, when known"})),resourceLastSeenAt:T({description:"When this resource was last observed during an inventory scan"}),tags:Ve,nativeAttributes:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),covered:n.Optional(n.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),Tve=d({tags:["inventory"],method:"GET",url:`${Qi}/resources`,paginated:!0,query:n.Object(ee),response:n.Array(n.Intersect([ku,Ws]))}),e1=S("type",[n.Object({type:n.Literal("aws"),accountId:n.String(),externalId:n.String(),roleArn:n.String()}),n.Object({type:n.Literal("gcp"),projectId:n.String(),serviceAccountId:n.String(),workloadIdentityProvider:n.String()}),n.Object({type:n.Literal("azure"),clientId:n.String(),subscriptionId:n.String(),tenantId:n.String()})]),t1=n.Object({type:n.Literal("aws"),accountId:m(),externalId:m(),roleArn:m()}),r1=n.Object({type:n.Literal("gcp"),projectId:m(),serviceAccountId:m(),workloadIdentityProvider:m()}),n1=n.Object({type:n.Literal("azure"),clientId:m(),subscriptionId:m(),tenantId:m()}),vS=S("type",[t1,r1,n1]),Zs=n.Object({id:n.String(),cloudType:n.Enum(Lu),cloudAccountId:n.String(),accountFriendlyName:n.Optional(n.String()),organizationId:n.Optional(n.String()),connectionSettings:e1,createdBy:n.Optional(n.String()),createdAt:T(),lastScanStartedAt:n.Optional(T()),lastScanFinishedAt:n.Optional(T()),lastScanStatus:n.Optional(n.Enum(GS))}),o1=n.Object({cloudType:n.Enum(Lu),cloudAccountId:m(),accountFriendlyName:n.Optional(m()),organizationId:n.Optional(m()),connectionSettings:vS,lastScanStatus:n.Optional(n.Enum(GS))}),Mn=`${Qi}/cloud-accounts`,_ve=d({tags:["inventory"],url:Mn,method:"GET",response:n.Array(Zs)}),hve=d({tags:["inventory"],url:`${Mn}/:id`,method:"GET",params:n.Object({id:m()}),response:Zs}),Ove=d({tags:["inventory"],url:Mn,method:"POST",body:o1,response:Zs}),Ave=d({tags:["inventory"],url:`${Mn}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Object({accountFriendlyName:m()}),response:Zs}),Sve=d({tags:["inventory"],url:`${Mn}/:id`,method:"DELETE",params:n.Object({id:m()}),response:D}),bve=d({tags:["inventory"],url:`${Qi}/trigger-scan`,method:"POST",body:n.Object({}),response:n.Object({success:n.Literal(!0)})}),xve=d({tags:["inventory"],url:`${Mn}/azure/onboarding`,method:"POST",body:n.Object({tenantId:m()}),response:n.Object({subjectId:n.String(),audience:n.String()})}),Rve=d({tags:["inventory"],method:"POST",url:`${Mn}/validate/:type`,params:n.Object({type:m()}),body:n.Object({data:vS,id:n.Optional(m())}),response:n.Object({areAccountSettingsValid:n.Boolean(),message:n.Optional(n.String())})}),jS=`${Qi}/settings`,Cve=d({tags:["inventory"],url:jS,method:"GET",response:n.Object({settings:n.Optional(n.Object({id:n.String(),infrastructureIdentifiers:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))}))})}),Pve=d({tags:["inventory"],url:jS,method:"POST",body:n.Object({infrastructureIdentifiers:n.Array(n.Object({name:m({allowEmpty:!1}),value:n.Optional(m({allowEmpty:!1}))}),{maxItems:50})}),response:n.Object({})}),Uve=d({tags:["inventory"],url:`${Qi}/iac-tags-proposal`,method:"GET",response:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))});var i1=`/${"v1"}/inventory`,a1=n.Omit(ku,["nativeAttributes","covered"],{$id:"InventoryResourceBase",description:"Base fields of a cloud resource discovered by an inventory scan"}),FS=n.Intersect([a1,Ws],{$id:"InventoryResource",description:"A cloud resource discovered by an inventory scan, together with its category, type and category-specific attributes"}),s1={id:"123-456-abc",cloudPlatform:"aws",cloudAccount:"123456789012",cloudRegion:"us-east-1",fullyQualifiedResourceId:"arn:aws:s3:::tsuga-example-bucket",displayName:"tsuga-example-bucket",nativeResourceType:"aws_s3_bucket",resourceCreatedAt:"2024-01-01T08:00:00.000Z",resourceLastSeenAt:"2024-01-15T12:34:56.000Z",tags:[{key:"team",value:"platform"}],category:"data",resourceType:"bucket",attributes:{versioningStatus:"Enabled"}};Object.assign(FS,{examples:[s1]});var BS=d({description:"Retrieve all cloud resources discovered by inventory scans",operationId:"listInventoryResources",tags:["inventory"],url:`${i1}/resources`,method:"GET",paginated:!0,query:n.Object(ee),response:n.Array(FS)});var Wi="/v0/investigations",p1=["dashboard","monitor","service","slo","log-route"],c1=n.Object({type:n.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:n.String({description:"Identifier of the linked asset"})}),m1=n.Object({type:n.Enum(p1,{description:"Kind of linked asset"}),id:m({allowEmpty:!1,description:"Identifier of the linked asset"})}),Ir=n.Object({id:n.String({description:"Identifier of the investigation"}),name:n.String({description:"Human readable name shown for the investigation"}),contentMd:n.Optional(n.String({description:"Markdown content capturing the investigation notes and findings"})),tags:Ve,owner:n.String({description:"Team ID owning the investigation"}),env:n.Optional(n.String({description:'Environment the investigation relates to, e.g. "prod"'})),linkedAssets:n.Array(c1,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),createdAt:T(),updatedAt:T()},{title:"Investigation"}),Zi=n.Object({name:m({allowEmpty:!1,description:"Human readable name shown for the investigation"}),contentMd:n.Optional(m({type:"long",description:"Markdown content capturing the investigation notes and findings"})),tags:Ze,owner:m({allowEmpty:!1,description:"Team ID owning the investigation"}),env:n.Optional(m({allowEmpty:!0,description:"Environment the investigation relates to"})),linkedAssets:n.Optional(n.Array(m1,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),Hve=d({tags:["investigations"],url:Wi,method:"GET",paginated:!0,query:n.Object(ee),response:n.Array(Ir)}),Kve=d({tags:["investigations"],url:`${Wi}/:id`,params:n.Object({id:m()}),method:"GET",response:Ir}),zve=d({tags:["investigations"],url:Wi,method:"POST",body:Zi,response:Ir}),Vve=d({tags:["investigations"],url:`${Wi}/:id`,method:"PUT",body:Zi,params:n.Object({id:m()}),response:Ir}),Yve=d({tags:["investigations"],url:`${Wi}/:id`,method:"DELETE",params:n.Object({id:m()}),response:D});var Xi=`/${"v1"}/investigations`,qS=d({description:"Retrieve all investigations",tags:["private"],url:Xi,method:"GET",paginated:!0,query:n.Object(ee),response:n.Array(Ir)}),HS=d({description:"Retrieve an investigation by its id",tags:["private"],url:`${Xi}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Ir}),KS=d({description:"Create a new investigation",tags:["private"],url:Xi,method:"POST",body:Zi,response:Ir}),zS=d({description:"Update an investigation by its id",tags:["private"],url:`${Xi}/:id`,method:"PUT",body:Zi,params:n.Object({id:m({allowEmpty:!1})}),response:Ir}),VS=d({description:"Delete an investigation by its id",tags:["private"],url:`${Xi}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:D});var u1={investigation:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"crawler-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["admin"]},"asset-change":{read:["public_viewer","public_editor","admin"],write:[]},"inventory-settings":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-members":{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]}},l1={investigation:{read:["viewer","editor","admin"],write:["editor","admin"]},"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"asset-change":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"crawler-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"inventory-settings":{read:["viewer","editor","admin"],write:["editor","admin"]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:[]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:["admin"],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]}},d1={user:u1,team:l1};function Mu(e){return YS(e,"team")}function wu(e){return YS(e,"user")}function YS(e,t){let r=[],o=d1[t];for(let[i,a]of Object.entries(o))for(let[p,u]of Object.entries(a))u.includes(e)&&r.push({actionType:p,resourceType:i});return r}var s1e={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:wu("admin"),roleKey:"admin"},public_editor:{name:"Public editor",description:"Can view and edit assets in public teams, but not access private teams or critical settings.",permissions:wu("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:wu("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},p1e={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:Mu("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:Mu("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:Mu("viewer"),roleKey:"viewer"}};var QS=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757119",isUsingLuhnAlgorithm:!1,regexp:"([12])\\s*[0-9]{2}\\s*(0[1-9]|1[0-2])\\s*(2[AB]|[0-9]{2})\\s*([0-9]{3})\\s*([0-9]{3})(\\s*[0-9]{2})?"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
40
42
  MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
41
43
  Ks14IReLcYgADhoXk56ZzXI=
42
- -----END PRIVATE KEY-----`,isUsingLuhnAlgorithm:!1,regexp:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[ \\r\\n\\t\\f\\v\\S-]{64,}?KEY(?: BLOCK)?-----"},{key:"pulumi_api_token",name:"Pulumi API token",category:"credential",example:"pul-b77e6bff9fddebbc2bb8eca94e3f29a41f6da70a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pul-[a-f0-9]{40})"},{key:"pypi_upload_token",name:"PyPI upload token",category:"credential",example:"pypi-AgEIcHlwaS5vcmc128fd9e0b47dde39cfecad3a997273458e6392f6aac649ae38864bdd7ff12836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)pypi-AgEIcHlwaS5vcmc[a-zA-Z0-9_-]{50}"},{key:"rapidapi_access_token",name:"RapidAPI access token",category:"credential",example:"g4x40h94pi_-zlklfz3-qvhiiu5zankyrqqwmsl60decihbqvl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{50})"},{key:"readme_api_token",name:"ReadMe API token",category:"credential",example:"rdme_k38kau741xa5lw03mdkvcd4vn6s6hdhvhg1wxa4ls7dp8h58r0yxq65nsqwndn056pxsc4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rdme_[a-z0-9]{70})"},{key:"rubygems_api_token",name:"RubyGems API token",category:"credential",example:"rubygems_7790aaa8102395704a64594a11f6de4941a27f86bc3fc9d4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rubygems_[a-f0-9]{48})"},{key:"scalingo_api_token",name:"Scalingo API token",category:"credential",example:"tk-us-4fhmqrg-rl4416b3oij_qx3q284wbhbqpk7r3te4r14lafou",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:tk-us-[a-zA-Z0-9_-]{48})"},{key:"sendbird_access_id",name:"SendBird access ID",category:"credential",example:"7e7801fd-c25d-50ab-a723-01b94c8d6c5f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sendbird_access_token",name:"SendBird access token",category:"credential",example:"305f75f04e3afa65360c25d9944fdae91138328d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{40})"},{key:"sendgrid_api_token",name:"SendGrid API token",category:"credential",example:"SG.--ed-fvdeffijnle7575jp1sh24wq_9y9hcjua5w3dnqh5-wyegkpzenziy1_qr=hf",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:SG\\.[a-z0-9=_\\-\\.]{66})"},{key:"sendinblue_api_token",name:"Sendinblue API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:xkeysib-[a-f0-9]{64}\\-[a-z0-9]{16})"},{key:"sentry_access_token",name:"Sentry access token",category:"credential",example:"1ad463398f40a52bb94a3795762f4003d51b03b8a788cba55e3a81de81c72940",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"sentry_org_token",name:"Sentry org token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)sntrys_eyJpYXQiO[a-zA-Z0-9+/]{10}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10}={0,2}_[a-zA-Z0-9+/]{43}(?:[^a-zA-Z0-9+/]|\\z)"},{key:"sentry_user_token",name:"Sentry user token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sntryu_[a-f0-9]{64})"},{key:"settlemint_application_access_token",name:"Settlemint application access token",category:"credential",example:"sm_aat_gshgzsv353m5yb9s",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_aat_[a-zA-Z0-9]{16})"},{key:"settlemint_personal_access_token",name:"Settlemint personal access token",category:"credential",example:"sm_pat_1yhza49gsle0trg8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_pat_[a-zA-Z0-9]{16})"},{key:"settlemint_service_access_token",name:"Settlemint service access token",category:"credential",example:"sm_sat_cha543e6lb19llli",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_sat_[a-zA-Z0-9]{16})"},{key:"shippo_api_token",name:"Shippo API token",category:"credential",example:"shippo_live_1d0f80d04e7788c1edb8fc2b8076bbf8f59b84b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:shippo_(?:live|test)_[a-fA-F0-9]{40})"},{key:"shopify_access_token",name:"Shopify access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpat_[a-fA-F0-9]{32}"},{key:"shopify_custom_access_token",name:"Shopify custom access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpca_[a-fA-F0-9]{32}"},{key:"shopify_private_app_access_token",name:"Shopify private app access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shppa_[a-fA-F0-9]{32}"},{key:"shopify_shared_secret",name:"Shopify shared secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpss_[a-fA-F0-9]{32}"},{key:"sidekiq_secret",name:"Sidekiq secret",category:"credential",example:"aa8d3915:64fb5cb5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{8}:[a-f0-9]{8})"},{key:"sidekiq_sensitive_url",name:"Sidekiq sensitive URL",category:"credential",example:"https://cafebabe:deadbeef@gems.contribsys.com/",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https?://(?:[a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\\/|\\#|\\?|:]|$)"},{key:"slack_bot_token",name:"Slack bot token",category:"credential",example:"xoxb-781236542736-2364535789652-GkwFDQoHqzXDVsC6GzqYUypD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*"},{key:"slack_user_token",name:"Slack user token",category:"credential",example:"xoxp-41684372915-1320496754-45609968301-e708ba56e1517a99f6b5fb07349476ef",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}"},{key:"slack_app_token",name:"Slack app token",category:"credential",example:"xapp-1-A052FGTS2DL-5171572773297-610b6a11f4b7eb819e87b767d80e6575a3634791acb9a9ead051da879eb5b55e",isUsingLuhnAlgorithm:!1,regexp:"xapp-[0-9]-[A-Z0-9]+-[0-9]+-[a-z0-9]+"},{key:"slack_config_access_token",name:"Slack config access token",category:"credential",example:"xoxe.xoxp-1-Mi0yLTM0MTQwNDE0MDE3Ni0zNjU5NDY0Njg4MTctNTE4MjA3NTQ5NjA4MC01NDEyOTYyODY5NzUxLThhMTBjZmI1ZWIzMGIwNTg0ZDdmMDI5Y2UxNzVlZWVhYzU2ZWQyZTZiODNjNDZiMGUxMzRlNmNjNDEwYmQxMjQ",isUsingLuhnAlgorithm:!1,regexp:"xoxe.xox[bp]-[0-9]-[A-Z0-9]{50}"},{key:"slack_config_refresh_token",name:"Slack config refresh token",category:"credential",example:"xoxe-1-My0xLTMxNzcwMjQ0MTcxMy01MTU4MTUyNjkxNzE0LTUxODE4NDI0MDY3MzYtMjA5MGFkOTFlZThkZWE2OGFlZDYwYWJjODNhYzAxYjA5ZjVmODBhYjgzN2QyNDdjOTNlOGY5NTg2YWM1OGM4Mg",isUsingLuhnAlgorithm:!1,regexp:"xoxe-[0-9]-[A-Z0-9]{50}"},{key:"slack_legacy_bot_token",name:"Slack legacy bot token",category:"credential",example:"xoxb-263594206564-FGqddMF8t08v8N7Oq4i57vs1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26}"},{key:"slack_legacy_workspace_token",name:"Slack legacy workspace token",category:"credential",example:"xoxa-2-511111111-31111111111-3111111111111-e039d02840a0b9379c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[ar]-(?:[0-9]-)?[0-9a-zA-Z]{8,48}"},{key:"slack_legacy_token",name:"Slack legacy token",category:"credential",example:"xoxs-416843729158-132049654-5609968301-e708ba56e1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[os]-[0-9]+-[0-9]+-[0-9]+-[a-fA-F0-9]+"},{key:"slack_webhook_url",name:"Slack webhook URL",category:"credential",example:"hooks.slack.com/services/z6cvbfngk3h7i0vts4akmbxidtb8o3b4pq2sbbd6o86g",isUsingLuhnAlgorithm:!1,regexp:"(?:https?://)?hooks.slack.com/(?:services|workflows|triggers)/[A-Za-z0-9+/]{43,56}"},{key:"snyk_api_token",name:"Snyk API token",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sonar_api_token",name:"Sonar API token",category:"credential",example:"12345678ABCDEFH1234567890ABCDEFH12345678",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:(?:squ_|sqp_|sqa_)?[a-z0-9=_-]{40})"},{key:"stripe_access_token",name:"Stripe access token",category:"credential",example:"sk_test_cyge9m4s1kxiqdkszz0a57nyx6wk73",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})"},{key:"square_access_token",name:"Square access token",category:"credential",example:"sq0atp-OQUxovdrj3tfFpSd66r3sY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:EAAA|sq0atp-)[a-zA-Z0-9_-]{22,60})"},{key:"squarespace_access_token",name:"Squarespace access token",category:"credential",example:"86447eab-140f-2563-3572-bb016dafd692",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sumologic_access_id",name:"SumoLogic access ID",category:"credential",example:"suJS4ZsaD5bQTt",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:su[a-zA-Z0-9]{12})"},{key:"sumologic_access_token",name:"SumoLogic access token",category:"credential",example:"1xohkwr8lpvm4osygkpe5zbd16c3376ver2qed1bssuko4uy4tij1bnf4dnwy7o4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"microsoft_teams_webhook",name:"Microsoft Teams webhook URL",category:"credential",example:"https://mycompany.webhook.office.com/webhookb2/767lrnj6-okh8-dnh8-jey2-y2iteohrwz75@6igi6oz6-ud9w-wior-2zva-5vx0wp6wuiqk/IncomingWebhook/o1zox92ssprrppjtnvcjqq0q09k2wnc3/qwox5p9d-x4zr-3yis-t1on-s67zj50tmyht",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https://[a-z0-9]+\\.webhook\\.office\\.com/webhookb2/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}"},{key:"telegram_bot_api_token",name:"Telegram bot API token",category:"credential",example:"59015865:A12o5wu6f78zofs0udypf9ti23u82g-qkfz",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{5,16}:(?-i:A)[a-z0-9_\\-]{34})"},{key:"travisci_access_token",name:"Travis CI access token",category:"credential",example:"zjgfo5fhshd5c60hpz22wh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{22})"},{key:"twilio_api_key",name:"Twilio API key",category:"credential",example:"SKa585fd034fcd16cdd741f7df9b57fb3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)SK[0-9a-fA-F]{32}"},{key:"twitch_api_token",name:"Twitch API token",category:"credential",example:"1hm9gcychlkpf93jdjnwdu0uaamu6d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"twitter_api_key",name:"Twitter API key",category:"credential",example:"m8zqu4etx07bjt7tyeacc6pox",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"twitter_api_secret",name:"Twitter API secret",category:"credential",example:"7f4gxkubw9qs346ik99zk3z8b6kk3d7g8toi7zujgvgbt8q0yv",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{50})"},{key:"twitter_access_token",name:"Twitter access token",category:"credential",example:"465616696186918-96B1NCD5CH0uyi7zUHiS",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{15,25}-[a-zA-Z0-9]{20,40})"},{key:"twitter_access_secret",name:"Twitter access secret",category:"credential",example:"vyuo5peybdzznr7z0ua5wamhogusans4m29uzi25w4jgj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{45})"},{key:"twitter_bearer_token",name:"Twitter bearer token",category:"credential",example:"AAAAAAAAAAAAAAAAAAAAAAWRGWFGlfwyqNrrIa3pewqNNLX0jQMj2sR6M2cZUfBdqXDtkt7Nsb56F4tCz7Pt8ujbosrLxnRqYgwI0b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:A{22}[a-zA-Z0-9%]{80})"},{key:"typeform_api_token",name:"Typeform API token",category:"credential",example:"tfp_o-nsn=6eg2ios=4g652xhf933qor4jj7ort2qh_uw_5jdsuffp31ln=e-2a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:tfp_[a-z0-9\\-_\\.=]{59})"},{key:"vault_batch_token",name:"Vault batch token",category:"credential",example:"hvb.x84j4cl53mzvhvb1nfc3mfi721gh5i-92f96lt0gns5lpksfu5f0199j-gw4ycxg6au4ser86mczcr_nx6ur2elbpazfrybo80fxjv3bghxshml3g261l6qi03yrz03qup84jk-fc2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hvb\\.[a-zA-Z0-9_-]{50})"},{key:"vault_service_token",name:"Vault service token",category:"credential",example:"s.8QH9knZV94f0IjBZismfOPD0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:hvs\\.[a-zA-Z0-9_-]{90}|s\\.(?i:[a-z0-9]{24})))"},{key:"yandex_api_key",name:"Yandex API key",category:"credential",example:"AQVN9wiAh8pyz3lmB5WTo_KUuPDXlxtzkA5-YFG",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:AQVN[A-Za-z0-9_\\-]{35,38})"},{key:"yandex_aws_access_token",name:"Yandex AWS access token",category:"credential",example:"YCZ6DHVrZONPNtgwWLZPrIGyviSrudRVSr8w0b1S",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:YC[a-zA-Z0-9_\\-]{38})"},{key:"yandex_access_token",name:"Yandex access token",category:"credential",example:"t1.L=.WJ9CYVI5eeLkTOrMM_dgaPgdmpen48R8RYsL4VJqelVKDmrqYsSHkH6QyVVhJkuHSQFTd0NOhClEDyCz7eEbh5=",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:t1\\.[A-Z0-9a-z_-]+[=]{0,2}\\.[A-Z0-9a-z_-]{86}[=]{0,2})"},{key:"zendesk_secret_key",name:"Zendesk secret key",category:"credential",example:"iydgm2jofftb2xu7niv55qnfxdwbwmqt2s561bgc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"infracost_api_token",name:"Infracost API token",category:"credential",example:"ico-fNZw8jjy6TugMUHKWX4l9iSP3i95SPNH",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ico-[a-zA-Z0-9]{32})"},{key:"iban",name:"Iban",category:"financial-data",example:"FR7630006000011234567890189",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{11,30}(?-u:\\b)"},{key:"aikido_token",name:"Aikido token",category:"credential",example:"AIK_SECRET_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_SECRET_[A-Za-z0-9]{64}"},{key:"aikido_ci_token",name:"Aikido CI secret",category:"credential",example:"AIK_CI_US_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_CI_(US_|ME_)?[A-Za-z0-9]{64}"},{key:"tsuga_ingestion_key",name:"Tsuga ingestion key",category:"credential",example:"tsuga_in:v1:OUvrwavCG//ixL08HEds9OAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_in:v1:[A-Za-z0-9+/]{24}"},{key:"tsuga_operation_key",name:"Tsuga operation key",category:"credential",example:"tsuga_op:v1:zz3-LWv-sLy:0k7Skt255M0yXe/ZLBoiSamb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_op:v1:[A-Za-z0-9_-]+:[A-Za-z0-9+/]{24}"}],Rv=CS.map(e=>e.key),tve=new Set(Rv),rve=CS.map(e=>e.key);function PS(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var Cv=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","alert_previous_status","alert_priority","alert_query","alert_start_time","alert_status","alert_tags","alert_threshold","alert_timeframe","alert_title","alert_transition","alert_triggered_by","alert_value","dashboard_url","monitor_url"],Pv=["alert_event_name","alert_message"],xve=[...Cv,...Pv];var Uv=["all","owning-team-and-public","owning-team-only"],xu=n.Enum(Uv,{description:"This controls which data the resource can see"});var Ut="/v0/monitors",ko=["alert","resolve","keep_last_status","consider_zero"],Ks=["alert","resolve","keep_last_status"];var NS=["no_aggregation","all","any","each","proportion"],LS=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var Nv=n.Object({formula:n.String(),operator:n.Enum(LS),threshold:n.Number()}),Lv=n.Object({formula:m({type:"tsuga-formula"}),operator:n.Enum(LS),threshold:n.Number()}),Ru=n.Array(Nv),Cu=n.Array(Lv),kS=n.Object({formula:n.String(),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"])}),wS=n.Object({formula:m({type:"tsuga-formula"}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"])}),y1e=n.Enum(["rate","error","cpu","general"]),Pt=[1,2,3,4,5];var Yi={timeframe:n.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:n.Array(n.Object({fields:n.Array(n.String(),{description:"Fields used by the monitor group by."}),limit:n.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:n.Optional(n.Enum(NS)),proportionAlertThreshold:n.Optional(n.Integer())},Qi={timeframe:n.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:n.Array(n.Object({fields:n.Array(m(),{description:"Fields used by the monitor group by."}),limit:n.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{maxItems:1,description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:n.Optional(n.Enum(NS)),proportionAlertThreshold:n.Optional(n.Integer({minimum:1,maximum:99}))},MS=n.Object({type:n.Literal("metric"),conditions:Ru,noDataBehavior:n.Enum(ko),...Yi,queries:fo},{$id:"MonitorConfigurationMetric"}),$S=n.Object({type:n.Literal("metric"),conditions:Cu,noDataBehavior:n.Enum(ko),...Qi,queries:go},{$id:"InputMonitorConfigurationMetric"}),DS=n.Object({type:n.Literal("log"),conditions:Ru,noDataBehavior:n.Enum(ko),...Yi,queries:fo},{$id:"MonitorConfigurationLog"}),GS=n.Object({type:n.Literal("log"),conditions:Cu,noDataBehavior:n.Enum(ko),...Qi,queries:go},{$id:"InputMonitorConfigurationLog"}),vS=n.Object({type:n.Literal("trace"),conditions:Ru,noDataBehavior:n.Enum(ko),...Yi,queries:fo},{$id:"MonitorConfigurationTrace"}),kv=n.Object({type:n.Literal("trace"),conditions:Cu,noDataBehavior:n.Enum(ko),...Qi,queries:go},{$id:"InputMonitorConfigurationTrace"}),jS=n.Object({type:n.Literal("anomaly-log"),condition:kS,noDataBehavior:n.Enum(Ks),...Yi,queries:fo},{$id:"MonitorConfigurationAnomalyLog"}),FS=n.Object({type:n.Literal("anomaly-log"),condition:wS,noDataBehavior:n.Enum(Ks),...Qi,queries:go},{$id:"InputMonitorConfigurationAnomalyLog"}),BS=n.Object({type:n.Literal("anomaly-metric"),condition:kS,noDataBehavior:n.Enum(Ks),...Yi,queries:fo},{$id:"MonitorConfigurationAnomalyMetric"}),qS=n.Object({type:n.Literal("anomaly-metric"),condition:wS,noDataBehavior:n.Enum(Ks),...Qi,queries:go},{$id:"InputMonitorConfigurationAnomalyMetric"}),HS=n.Object({type:n.Literal("certificate-expiry"),warnBeforeInDays:n.Integer(),cloudAccounts:n.Optional(n.Array(n.String())),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("resolve")},{$id:"MonitorConfigurationCertificateExpiry"}),wv=n.Object({type:n.Literal("certificate-expiry"),warnBeforeInDays:n.Integer({minimum:1,maximum:365}),cloudAccounts:n.Optional(n.Array(n.String(),{minItems:1})),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("resolve")},{$id:"InputMonitorConfigurationCertificateExpiry"}),KS=n.Object({type:n.Literal("log-error-pattern"),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("keep_last_status"),filter:n.Object({teamIds:n.Array(n.String()),env:n.String(),service:n.Optional(n.String())})},{$id:"MonitorConfigurationLogErrorPattern"}),Mv=b("type",[MS,DS,vS,jS,BS,KS,HS]),$v=b("type",[$S,GS,kv,FS,qS,KS,wv]);var Ir=n.Object({id:n.String({description:"Identifier of the monitor"}),name:n.String({description:"Display name of the monitor"}),owner:n.String({description:"Team ID that owns and manages the monitor"}),message:n.Optional(n.String({description:"Message to be displayed if a notification is triggered"})),tags:We,configuration:Mv,priority:n.Enum(Pt,{description:"Priority of the monitor"}),permissions:xu,dashboardId:n.Optional(n.String({description:"Identifier of a dashboard related to the monitor"})),pauseUntil:n.Optional(T()),creator:n.Optional(Ce),updater:n.Optional(Ce),createdAt:T(),updatedAt:T(),assetUpdatedAt:T(),clusterIds:n.Array(n.String())},{title:"Monitor"}),Dv=b("type",[MS,DS,vS,jS,BS,HS]),E1e=n.Object({...Ir.properties,configuration:Dv},{title:"Monitor"}),I1e=n.Object({...Ir.properties,configuration:b("type",[$S,GS,FS,qS])},{title:"Monitor"}),Wi=n.Object({name:m(),message:n.Optional(m({type:"long"})),tags:mt,configuration:$v,priority:n.Enum(Pt),owner:m({allowEmpty:!1}),dashboardId:n.Optional(m()),pauseUntil:n.Optional(m({allowEmpty:!1,type:"date-time"})),permissions:xu,clusterIds:n.Optional(n.Array(m({allowEmpty:!1})))}),US=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],Yr={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var zS=n.Object({owners:pr(m({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:m({allowEmpty:!1}),exclude:n.Optional(n.Boolean({description:"If true, exclude monitors matching this value instead of including them"}))},{description:"Substring matched against monitor name and configuration"}),tags:pr(Un.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:pr(n.Enum(Pt),{description:"Restrict results to monitors with one of these priorities",maxItems:Pt.length}),types:pr(n.Enum(US),{description:"Restrict results to monitors with these types",maxItems:US.length}),activity:n.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:pr(m({allowEmpty:!1}),{description:"Restrict results to monitors deployed to any of these cluster IDs (monitors with no cluster restriction are always included)",maxItems:50})},{description:"Optional filters applied to narrow the returned monitors"}),Pu=n.Partial(n.Object({...oe,filters:n.Partial(zS),sort:n.Object({by:n.Enum([Yr.PRIORITY,Yr.TYPE,Yr.NAME,Yr.OWNER,Yr.TAGS,Yr.CLUSTER_IDS,Yr.PAUSE_UNTIL,Yr.ASSET_UPDATED_AT],{description:"Field to sort the returned monitors by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned monitors"})})),T1e=d({tags:["monitors"],url:`${Ut}/query`,method:"POST",paginated:!0,response:n.Array(Ir),body:Pu}),_1e=d({tags:["monitors"],url:`${Ut}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(zS,["tags"])))}),response:Pn}),h1e=d({tags:["monitors"],url:`${Ut}/:id`,method:"GET",params:n.Object({id:m()}),response:Ir}),O1e=d({tags:["monitors"],url:Ut,method:"POST",body:Wi,response:Ir}),A1e=d({tags:["monitors"],url:`${Ut}/:id`,method:"PUT",params:n.Object({id:m()}),body:Wi,response:Ir}),S1e=d({tags:["monitors"],url:`${Ut}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),b1e=d({tags:["monitors"],url:`${Ut}/:id/snooze`,method:"POST",params:n.Object({id:m()}),body:n.Object({pauseUntil:m({allowEmpty:!1,type:"date-time"})}),response:Ir}),Gv=["alert","ok","alert_consider_zero","ok_consider_zero","alert_no_data","ok_no_data","keep_last_status_ok","keep_last_status_alert"],wn=n.Enum(Gv),vv=b("type",[n.Object({type:n.Literal("each"),subStates:n.Record(n.String(),n.Object({stateValue:n.Union([wn,n.Null()]),lastChangedAt:T()}))}),n.Object({type:n.Literal("no_aggregation"),stateValue:n.Optional(wn)}),n.Object({type:n.Literal("any"),stateValue:n.Optional(wn)}),n.Object({type:n.Literal("all"),stateValue:n.Optional(wn)}),n.Object({type:n.Literal("proportion"),stateValue:n.Optional(wn)})]),jv=n.Object({monitorId:n.String(),currentState:vv,lastChangedAt:n.Optional(T())}),x1e=d({tags:["monitors"],url:`${Ut}/states/:id`,method:"GET",params:n.Object({id:m()}),response:jv}),R1e=d({tags:["monitors"],url:`${Ut}/:id/transitions`,method:"GET",params:n.Object({id:m()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Array(n.Object({id:n.String(),createdAt:T(),fromState:n.Optional(wn),toState:n.Optional(wn),dimension:n.Optional(n.String())}))}),Fv=["unprocessed","processed","failed-to-process"],C1e=d({tags:["monitors"],url:`${Ut}/:id/results`,method:"GET",params:n.Object({id:m()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Object({isTruncated:n.Boolean(),results:n.Array(n.Object({id:n.String(),evaluationAt:T(),formulaResult:n.Object({groups:n.Array(n.Object({groupKey:n.Record(n.String(),Pc),results:n.Array(n.Union([n.Number(),n.Null()])),conditionMet:n.Enum(["true","false","nan-no-data"])}))}),createdAt:T(),status:n.Enum(Fv)}))})});var Zi=`/${"v1"}/monitors`,Xi=n.Pick(Ir,["id","name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],{$id:"Monitor",description:"Monitor allowing to send alerts based on telemetry data"}),Bv={id:"123-456-abc",name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},qv={id:"456-789-def",name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(Xi,{examples:[Bv,qv]});var VS=n.Pick(Pu,["filters","sort","limit","offset"]),Hv={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(VS,{examples:[Hv]});var YS=d({description:"Query monitors with filters, sorting, and pagination",operationId:"queryMonitors",tags:["monitors"],url:`${Zi}/query`,method:"POST",paginated:!0,body:VS,response:n.Array(Xi)}),QS=d({description:"Retrieve a monitor by its id",operationId:"getMonitor",tags:["monitors"],url:`${Zi}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Xi}),WS=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],ZS=n.Pick(Wi,WS,{$id:"CreateMonitorRequest"}),XS=n.Pick(Wi,WS,{$id:"UpdateMonitorRequest"}),JS={name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},eb={name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(ZS,{examples:[JS,eb]});Object.assign(XS,{examples:[JS,eb]});var tb=d({description:"Create a new monitor",operationId:"createMonitor",tags:["monitors"],url:Zi,method:"POST",body:ZS,response:Xi}),rb=d({description:"Update a monitor by its id",operationId:"updateMonitor",tags:["monitors"],url:`${Zi}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:XS,response:Xi}),Kv=n.Object({id:m({allowEmpty:!1,description:"The monitor ID to delete"})}),nb=d({description:"Delete a monitor by its id",operationId:"deleteMonitor",tags:["monitors"],url:`${Zi}/:id`,method:"DELETE",params:Kv,response:v});var Ji="/v0/notifications",$n=`${Ji}/rules`,ob=`${Ji}/slack/setup`,zs=`${Ji}/integrations`,Mn=["triggered","resolved","no-data"],zv=["sent","stale","pending","rate-limited","failed","silenced"],Vv=n.Optional(n.Object({maxMessages:n.Integer({description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:n.Integer({description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),Yv=n.Optional(n.Object({maxMessages:n.Integer({minimum:1,description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:n.Integer({minimum:1,description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),Qv=n.Optional(n.Object({mode:n.Literal("each"),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:n.Integer({description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),Wv=n.Optional(n.Object({mode:n.Literal("each"),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:n.Integer({minimum:1,description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),Zv=n.Object({id:n.String({description:"Identifier of the notification target"}),rateLimit:Vv,renotifyConfig:Qv,config:b("type",[n.Object({type:n.Literal("slack"),channel:n.String({description:"Slack channel ID that receives the notification"}),integrationId:n.String({description:"Slack workspace ID that receives the notification"}),integrationName:n.String({description:"Human readable name of the Slack integration"})},{$id:"RuleTargetConfigSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:n.String({description:"Identifier of the incident.io integration to use"}),integrationName:n.String({description:"Human readable name of the incident.io integration"})},{$id:"RuleTargetConfigIncidentIo"}),n.Object({type:n.Literal("email"),addresses:n.Array(n.String(),{description:"Email addresses that will receive the alert"})},{$id:"RuleTargetConfigEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:n.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:n.String({description:"Human readable name of the Grafana IRM integration"})},{$id:"RuleTargetConfigGrafanaIrm"}),n.Object({type:n.Literal("pagerduty"),integrationId:n.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:n.String({description:"Human readable name of the PagerDuty integration"})},{$id:"RuleTargetConfigPagerDuty"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:n.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:n.String({description:"Human readable name of the Microsoft Teams integration"})},{$id:"RuleTargetConfigMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:n.String({description:"Identifier of the webhook integration to use"}),integrationName:n.String({description:"Human readable name of the webhook integration"})},{$id:"RuleTargetConfigWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:n.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:n.String({description:"Human readable name of the ServiceNow integration"})},{$id:"RuleTargetConfigServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:n.String({description:"Identifier of the Google Chat integration to use"}),integrationName:n.String({description:"Human readable name of the Google Chat integration"})},{$id:"RuleTargetConfigGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:n.String({description:"Identifier of the Squadcast integration to use"}),integrationName:n.String({description:"Human readable name of the Squadcast integration"})},{$id:"RuleTargetConfigSquadcast"})],{description:"Configuration describing how the alert was delivered"})}),Xv=n.Object({id:m({description:"Identifier of the notification target"}),rateLimit:Yv,config:b("type",[n.Object({type:n.Literal("slack"),channel:m({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:m({allowEmpty:!1,description:"Slack workspace ID that receives the notification"})},{$id:"RuleTargetInputSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:m({allowEmpty:!1,description:"Identifier of the incident.io integration to use"})},{$id:"RuleTargetInputIncidentIo"}),n.Object({type:n.Literal("pagerduty"),integrationId:m({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"})},{$id:"RuleTargetInputPagerDuty"}),n.Object({type:n.Literal("email"),addresses:n.Array(m({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"})},{$id:"RuleTargetInputEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:m({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"})},{$id:"RuleTargetInputGrafanaIrm"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:m({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"})},{$id:"RuleTargetInputMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:m({allowEmpty:!1,description:"Identifier of the webhook integration to use"})},{$id:"RuleTargetInputWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:m({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"})},{$id:"RuleTargetInputServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:m({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"})},{$id:"RuleTargetInputGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:m({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"})},{$id:"RuleTargetInputSquadcast"})],{description:"Configuration describing how the alert should be delivered"}),renotifyConfig:Wv}),Uu=b("type",[n.Object({type:n.Literal("specific-teams"),teams:n.Array(n.String(),{description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams")}),n.Object({type:n.Literal("all-public-teams")})]),Nu=b("type",[n.Object({type:n.Literal("specific-teams"),teams:n.Array(m(),{minItems:1,maxItems:100,description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams")}),n.Object({type:n.Literal("all-public-teams")})]),wo=n.Object({id:n.String({description:"Identifier of the notification rule"}),name:n.String({description:"Display name of the notification rule"}),queryString:n.Optional(n.String({description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:Uu,prioritiesFilter:n.Array(n.Enum(Pt),{description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(Mn),{description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Array(n.String(),{description:"Cluster IDs that can trigger a notification"}),owner:n.String({description:"Team ID that owns and manages the rule"}),createdAt:T(),updatedAt:T(),isActive:n.Boolean(),tags:We,targets:n.Array(Zv,{description:"Notification targets that can receive notifications when the rule matches"}),creator:n.Optional(Ce),updater:n.Optional(Ce)}),ea=n.Object({name:m({description:"Display name of the notification rule"}),queryString:n.Optional(m({type:"tags-query",description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:Nu,prioritiesFilter:n.Array(n.Enum(Pt),{maxItems:Pt.length,description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(Mn),{maxItems:Mn.length,description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Cluster IDs that can trigger a notification"})),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:mt,isActive:n.Boolean(),targets:n.Array(Xv,{minItems:1,description:"Notification targets that can receive notifications when the rule matches"})}),H1e=d({tags:["notification-rules"],url:$n,method:"GET",paginated:!0,query:n.Object(oe),response:n.Array(wo)}),K1e=d({tags:["notification-rules"],url:`${$n}/:id`,params:n.Object({id:m()}),method:"GET",response:wo}),z1e=d({tags:["notification-rules"],url:$n,method:"POST",body:ea,response:wo}),V1e=d({tags:["notification-rules"],url:`${$n}/:id`,method:"PUT",params:n.Object({id:m()}),body:ea,response:wo}),Y1e=d({tags:["notification-rules"],url:`${$n}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),Q1e=d({tags:["notification-integrations"],url:`${ob}/start`,method:"POST",response:n.Object({redirectUrl:n.String()})}),Jv=n.Object({id:n.String(),name:n.String(),type:n.Enum(["slack","incident-io","grafana-irm","pagerduty","microsoft-teams","webhook","servicenow","google-chat","squadcast"]),createdAt:T(),ruleCount:n.Number(),creator:n.Optional(Ce)}),W1e=d({tags:["notification-integrations"],url:`${$n}/integrations`,method:"GET",paginated:!0,query:n.Object(oe),response:n.Array(Jv)}),Z1e=d({tags:["notification-integrations"],url:`${ob}/callback`,method:"GET",query:n.Object({code:m()}),response:n.Object({success:n.Boolean()})}),Lu=["POST","PUT"],e1=n.Record(n.String(),n.String()),t1=n.Record(n.String(),n.Unknown()),r1=n.Record(n.String(),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))])),n1=b("type",[n.Object({type:n.Literal("json"),value:t1}),n.Object({type:n.Literal("form"),value:r1})]),o1=n.Object({ok:n.String(),alert:n.String()}),ku=n.Object({id:n.String(),name:n.String(),setting:b("type",[n.Object({type:n.Literal("incident-io"),alertSourceConfigId:n.String(),tokenLastChars:n.String()}),n.Object({type:n.Literal("grafana-irm"),urlLastChars:n.String()}),n.Object({type:n.Literal("pagerduty"),integrationKeyLastChars:n.String()}),n.Object({type:n.Literal("microsoft-teams"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("webhook"),urlLastChars:n.String(),method:n.Enum(Lu),authentication:b("type",[n.Object({type:n.Literal("bearer"),tokenLastChars:n.String()}),n.Object({type:n.Literal("basic"),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("custom-header"),key:n.String(),valueLastChars:n.String()}),n.Object({type:n.Literal("none")})]),customHeaders:n.Optional(e1),payloadTemplate:n1,eventNameMapping:n.Optional(o1)}),n.Object({type:n.Literal("servicenow"),instanceName:n.String(),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("google-chat"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("squadcast"),webhookUrlLastChars:n.String()})]),tags:We}),i1=n.Object({type:n.Literal("webhook"),url:m({type:"uri"}),method:n.Enum(Lu),authentication:b("type",[n.Object({type:n.Literal("bearer"),token:m({allowEmpty:!1})}),n.Object({type:n.Literal("basic"),username:m({allowEmpty:!1}),password:m({allowEmpty:!1})}),n.Object({type:n.Literal("custom-header"),key:m({allowEmpty:!1}),value:m({allowEmpty:!1})}),n.Object({type:n.Literal("none")})]),customHeaders:n.Record(m({allowEmpty:!1}),m()),payloadTemplate:b("type",[n.Object({type:n.Literal("json"),value:n.Record(m({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(m({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})]),eventNameMapping:n.Optional(n.Object({ok:m({allowEmpty:!1}),alert:m({allowEmpty:!1})}))}),ib=n.Object({type:n.Literal("incident-io"),alertSourceConfigId:m(),token:m()}),ab=n.Object({type:n.Literal("grafana-irm"),url:m({type:"uri"})}),sb=n.Object({type:n.Literal("pagerduty"),integrationKey:m()}),pb=n.Object({type:n.Literal("microsoft-teams"),webhookUrl:m({type:"uri"})}),a1=n.Object({type:n.Literal("servicenow"),instanceName:m({allowEmpty:!1,description:'Instance name of the ServiceNow instance. This corresponds to the subdomain part of the instance URL, like "my-instance" in "my-instance.service-now.com"'}),username:m({allowEmpty:!1}),password:m({allowEmpty:!1})}),s1=n.Object({type:n.Literal("google-chat"),webhookUrl:m({type:"uri"})}),p1=n.Object({type:n.Literal("squadcast"),webhookUrl:m({type:"uri"})}),c1=n.Object({name:m(),setting:b("type",[ib,ab,sb,pb,i1,a1,s1,p1]),tags:mt}),m1=n.Object({type:n.Literal("webhook"),url:n.Optional(m({type:"uri"})),method:n.Optional(n.Enum(Lu)),authentication:n.Optional(b("type",[n.Object({type:n.Literal("bearer"),token:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("basic"),username:n.Optional(m({allowEmpty:!1})),password:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("custom-header"),key:n.Optional(m({allowEmpty:!1})),value:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("none")})])),customHeaders:n.Optional(n.Record(m({allowEmpty:!1}),m())),payloadTemplate:n.Optional(b("type",[n.Object({type:n.Literal("json"),value:n.Record(m({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(m({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})])),eventNameMapping:n.Optional(n.Object({ok:n.Optional(m({allowEmpty:!1})),alert:n.Optional(m({allowEmpty:!1}))}))}),u1=n.Object({type:n.Literal("servicenow"),instanceName:n.Optional(m({allowEmpty:!1})),username:n.Optional(m({allowEmpty:!1})),password:n.Optional(m({allowEmpty:!1}))}),l1=n.Object({type:n.Literal("google-chat"),webhookUrl:m({type:"uri"})}),d1=n.Object({type:n.Literal("squadcast"),webhookUrl:m({type:"uri"})}),f1=n.Object({name:n.Optional(m()),setting:n.Optional(b("type",[ib,ab,sb,pb,m1,u1,l1,d1]))}),X1e=d({tags:["notification-integrations"],url:zs,method:"POST",body:c1,response:ku}),J1e=d({tags:["notification-integrations"],url:`${zs}/:id`,method:"GET",params:n.Object({id:m()}),response:ku}),eje=d({tags:["notification-integrations"],url:`${zs}/:id`,method:"PUT",params:n.Object({id:m()}),body:f1,response:ku}),tje=d({tags:["notification-integrations"],url:`${zs}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),rje=d({tags:["notification-rules"],url:`${Ut}/:id/notifications`,method:"GET",params:n.Object({id:m()}),query:n.Optional(n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number())})),response:n.Object({notifications:n.Array(n.Object({id:n.String(),monitorId:n.String(),monitorResultId:n.String(),ruleId:n.Optional(n.String()),targetId:n.Optional(n.String()),status:n.Enum(zv),tryCount:n.Number(),nextTryAt:T(),createdAt:T(),updatedAt:T(),sentAt:n.Optional(T())})),isTruncated:n.Boolean()})}),g1=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast"],nje=d({tags:["notification-rules"],url:`${$n}/test`,method:"POST",body:n.Object({notificationRule:ea,targetIds:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:n.Union([n.Object({success:n.Literal(!1),overallMessage:n.String({description:"Message when there is an overall error"})}),n.Object({success:n.Boolean(),results:n.Array(n.Object({targetId:n.String({description:"The ID of the target that was tested"}),targetType:n.Enum(g1,{description:"The type of the target (e.g., slack, webhook)"}),status:n.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:n.Optional(n.String({description:"Message if the notification failed for this specific target"}))}))})])});var ta=`/${"v1"}/notification-rules`,ra=n.Pick(wo,["id","name","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Rules to trigger notifications to targets based on alert events"}),y1={id:"123-456-abc",name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(ra,{examples:[y1]});var cb=d({description:"Retrieve all notification rules",operationId:"listNotificationRules",tags:["notification-rules"],url:ta,method:"GET",paginated:!0,query:n.Object(oe),response:n.Array(ra)}),mb=d({description:"Retrieve a notification rule by its id",operationId:"getNotificationRule",tags:["notification-rules"],url:`${ta}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:ra}),wu=n.Pick(ea,["name","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","tags","isActive","targets"]),E1={name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(wu,{examples:[E1]});var ub=d({description:"Create a new notification rule",operationId:"createNotificationRule",tags:["notification-rules"],url:ta,method:"POST",body:wu,response:ra}),lb=d({description:"Update a notification rule by its id",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${ta}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:wu,response:ra}),I1=n.Object({id:m({allowEmpty:!1,description:"The notification rule ID to delete"})}),db=d({description:"Delete a notification rule by its id",operationId:"deleteNotificationRule",tags:["notification-rules"],url:`${ta}/:id`,method:"DELETE",params:I1,response:v});var Mo=`${Ji}/silences`,fb=n.Union([n.Literal("monday"),n.Literal("tuesday"),n.Literal("wednesday"),n.Literal("thursday"),n.Literal("friday"),n.Literal("saturday"),n.Literal("sunday")]),T1=n.Partial(n.Record(fb,n.Array(n.Object({startTime:n.String({format:dc}),endTime:n.String({format:dc})},{title:"SilenceTimeRange"}),{minItems:1,description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),_1=n.Partial(n.Record(fb,n.Array(n.Object({startTime:n.String(),endTime:n.String()},{title:"SilenceTimeRange"}),{description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),Vs='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',gb="One-time silence schedule with specific start and end times",yb="Recurring weekly silence schedule",h1=b("type",[n.Object({type:n.Literal("one-time"),startTime:n.String({format:fc}),endTime:n.String({format:fc}),timeZone:n.Optional(n.String({format:lc,description:Vs}))},{$id:"InputSilenceScheduleOneTime",description:gb}),n.Object({type:n.Literal("recurring"),weeklySchedule:T1,timeZone:n.Optional(n.String({format:lc,description:Vs}))},{$id:"InputSilenceScheduleRecurring",description:yb})],{description:"Schedule defining when the silence is active"}),O1=b("type",[n.Object({type:n.Literal("one-time"),startTime:n.String(),endTime:n.String(),timeZone:n.Optional(n.String({description:Vs}))},{$id:"OutputSilenceScheduleOneTime",description:gb}),n.Object({type:n.Literal("recurring"),weeklySchedule:_1,timeZone:n.Optional(n.String({description:Vs}))},{$id:"OutputSilenceScheduleRecurring",description:yb})],{description:"Schedule defining when the silence is active"}),Ys=n.Object({name:m({description:"Display name of the silence"}),reason:m({allowEmpty:!1,description:"Reason for the silence"}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:mt,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:h1,notificationRuleIds:n.Optional(n.Array(m(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(m({type:"tags-query",description:"Query string to filter which alerts this silence applies to"})),teamsFilter:Nu,prioritiesFilter:n.Array(n.Enum(Pt),{maxItems:Pt.length,description:"Monitor priorities to filter which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(Mn),{maxItems:Mn.length,description:"Transition types to filter which alerts this silence applies to"})}),$o=n.Object({id:n.String({description:"Unique identifier of the silence"}),name:n.String({description:"Display name of the silence"}),reason:n.String({description:"Reason for the silence"}),owner:n.String({description:"Team ID that owns and manages the silence"}),tags:We,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:O1,notificationRuleIds:n.Optional(n.Array(n.String(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(n.String({description:"Query string filtering which alerts this silence applies to"})),teamsFilter:Uu,prioritiesFilter:n.Array(n.Enum(Pt),{description:"Monitor priorities filtering which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(Mn),{description:"Transition types filtering which alerts this silence applies to"}),createdAt:T(),updatedAt:T(),creator:n.Optional(Ce),updater:n.Optional(Ce)}),hje=d({tags:["notification-silences"],url:Mo,method:"GET",response:n.Array($o)}),Oje=d({tags:["notification-silences"],url:`${Mo}/:id`,params:n.Object({id:m()}),method:"GET",response:$o}),Aje=d({tags:["notification-silences"],url:Mo,method:"POST",body:Ys,response:$o}),Sje=d({tags:["notification-silences"],url:`${Mo}/:id`,method:"PUT",params:n.Object({id:m()}),body:Ys,response:$o}),bje=d({tags:["notification-silences"],url:`${Mo}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),xje=d({tags:["notification-silences"],url:`${Mo}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(m())}),response:n.Object({})});var na=`/${"v1"}/notification-silences`,Qs=n.Pick($o,["id","name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{$id:"NotificationSilence",description:"Silences to suppress notifications based on schedules and filters"}),Eb=d({description:"Retrieve all notification silences",operationId:"listNotificationSilences",tags:["notification-silences"],url:na,method:"GET",response:n.Array(Qs)}),Ib=d({description:"Retrieve a notification silence by its id",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${na}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Qs}),Tb=n.Pick(Ys,["name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"]),_b=d({description:"Create a new notification silence",operationId:"createNotificationSilence",tags:["notification-silences"],url:na,method:"POST",body:Tb,response:Qs}),hb=d({description:"Update a notification silence by its id",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${na}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Tb,response:Qs}),A1=n.Object({id:m({allowEmpty:!1,description:"The notification silence ID to delete"})}),Ob=d({description:"Delete a notification silence by its id",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${na}/:id`,method:"DELETE",params:A1,response:v});var S1=["passed","failed","ignored"],b1=n.Enum(S1),Ab=["unrouted-logs","team-has-route","service-name-present","no-orphan-spans","metric-unit-consistency","host-name-present","inconsistent-attribute-naming","no-duplicate-attr-values","no-debug-logs-in-prod","no-multiline-logs","no-empty-dashboards","monitor-has-notification","no-future-dated-logs","metric-usage","no-stale-dashboards","no-unused-dashboards","no-orphan-monitors","no-flapping-monitors","no-noisy-group-monitors","no-long-alert-monitors","no-redundant-monitors","no-absent-log-fields","k8s-recommended-attributes","k8s-recommended-metrics","k8s-recommended-change-events","use-standard-attributes","no-unused-operation-api-keys","no-unused-ingestion-api-keys"],x1=n.Enum(Ab),R1=["log","metric","resource","span"],C1=["team","global"],$u=n.Object({key:n.Enum(Ab),title:n.String(),summary:n.String(),rationale:n.String(),objectType:n.Enum(R1),category:n.Enum(["hygiene","routing","integrity","consistency","redundancy","cost"]),impact:n.Object({label:n.Enum(["critical","important","normal"]),weight:n.Number()}),recommendation:n.String(),scope:n.Optional(n.Enum(C1))}),Mu=n.Intersect([$u,n.Object({status:b1,normalizedScore:n.Number(),details:n.Optional(n.Record(n.String(),n.Unknown())),recommendation:n.Optional(n.String()),examples:n.Optional(n.Array(n.Object({type:n.String(),label:n.String(),link:n.Object({to:n.String(),search:n.Optional(n.Unknown()),params:n.Optional(n.Unknown())})})))})]),Ws=n.Object({generatedAt:n.String(),overallScore:n.Optional(n.Number()),rules:n.Array($u),teamResults:n.Array(n.Object({teamId:n.String(),teamName:n.String(),teamWeight:n.Number(),score:n.Number(),weightedScore:n.Number(),totalWeight:n.Number(),ruleResults:n.Array(Mu)})),globalResults:n.Optional(n.Object({score:n.Optional(n.Number()),ruleResults:n.Array(Mu)}))}),Gje=d({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:Ws}),vje=d({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:n.Object({clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({report:n.Optional(Ws)})}),jje=d({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:n.Object({ruleKey:x1,teamId:m(),lookbackMinutes:n.Optional(n.Integer({minimum:1,maximum:60})),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({rule:$u,result:Mu,teamId:n.String(),teamName:n.String()})});var P1=`/${"v1"}/quality-reports`,Sb=n.Pick(Ws,["generatedAt","overallScore","rules","teamResults","globalResults"],{$id:"QualityReport",description:"Aggregated quality report with per-team rule evaluations and scores"}),U1={generatedAt:"2026-02-26T12:00:00.000Z",overallScore:.85,rules:[{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"resource",category:"routing",impact:{label:"important",weight:2},recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."}],teamResults:[{teamId:"abc-123-def",teamName:"platform",teamWeight:1,score:.85,weightedScore:.85,totalWeight:2,ruleResults:[{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"resource",category:"routing",impact:{label:"important",weight:2},recommendation:"Ensure every team manages a dedicated route scoped to its context.team value.",status:"passed",normalizedScore:1}]}]};Object.assign(Sb,{examples:[U1]});var N1=n.Object({clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),bb=d({description:"Retrieve the latest quality report",operationId:"getLatestQualityReport",tags:["quality-reports"],url:`${P1}/latest`,method:"GET",query:N1,response:n.Object({report:n.Optional(Sb)})});var oa="/v0/admin-center";var tr=`${oa}/retention-policies`,L1=3650,k1=n.Integer(),xb=n.Integer({minimum:1,maximum:L1}),Tr=n.Object({id:n.String(),env:n.Optional(n.String()),teamId:n.Optional(n.String()),dataSource:n.Enum($t),durationDays:k1,isEnabled:n.Boolean(),createdAt:T(),updatedAt:T()}),Zs=n.Object({env:n.Optional(m()),teamId:n.Optional(m()),dataSource:n.Enum($t),durationDays:xb,isEnabled:n.Boolean()}),Rb=n.Array(n.Object({env:m(),dataSource:n.Enum($t),durationDays:n.Union([xb,n.Null()]),isEnabled:n.Boolean()})),Cb=n.Object({inserted:n.Array(Tr),updated:n.Array(Tr),deleted:n.Array(Tr)}),tFe=d({tags:["retention-policies"],url:tr,method:"POST",body:Zs,response:Tr}),rFe=d({tags:["retention-policies"],url:tr,method:"GET",response:n.Array(Tr)}),nFe=d({tags:["retention-policies"],url:`${tr}/:id`,method:"GET",params:n.Object({id:m()}),response:Tr}),oFe=d({tags:["retention-policies"],url:`${tr}/:id`,method:"PUT",params:n.Object({id:m()}),body:Zs,response:Tr}),iFe=d({tags:["retention-policies"],url:`${tr}/bulk-update`,method:"POST",body:Rb,response:Cb}),aFe=d({tags:["retention-policies"],url:`${tr}/bulk-update-for-team`,method:"POST",body:n.Object({teamId:m(),policies:Rb}),response:Cb}),sFe=d({tags:["retention-policies"],url:`${tr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),ia=["past-24-hours","past-7-days","past-30-days"],pFe=d({tags:["retention-policies"],url:`${tr}/requested-history-percentile/:teamId`,method:"POST",params:n.Object({teamId:m()}),body:n.Object({percentile:n.Number({minimum:0,maximum:1}),observationWindow:n.Enum(ia),dataSource:n.Enum($t)}),response:n.Object({percentile:n.Number(),observationWindow:n.Enum(ia),dataSource:n.Enum($t),teamId:n.String(),requestedHistoryDays:n.Number()})}),w1=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var M1=n.Array(n.Object({bucket:n.Enum(w1),count:n.Number()})),cFe=d({tags:["retention-policies"],url:`${tr}/requested-history-histogram/:teamId`,method:"POST",params:n.Object({teamId:m()}),body:n.Object({observationWindow:n.Enum(ia),dataSource:n.Enum($t)}),response:n.Object({observationWindow:n.Enum(ia),dataSource:n.Enum($t),teamId:n.String(),histogram:M1})}),mFe=d({tags:["retention-policies"],url:`${tr}/top-teams-with-retention-surplus`,method:"POST",body:n.Object({dataSource:n.Enum($t),observationWindow:n.Enum(ia),percentile:n.Number({minimum:0,maximum:1}),topN:n.Optional(n.Number({minimum:1,maximum:20}))}),response:n.Array(n.Object({teamId:n.String(),retentionSurplusDays:n.Number()}))});var aa=`/${"v1"}/retention-policies`,sa=n.Pick(Tr,["id","env","teamId","dataSource","durationDays","isEnabled"],{$id:"RetentionPolicy",description:"Data retention rule for a data source within an environment"}),$1={id:"123-456-abc",env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(sa,{examples:[$1]});var Pb=d({description:"Retrieve all retention policies",operationId:"listRetentionPolicies",tags:["retention-policies"],url:aa,method:"GET",response:n.Array(sa)}),Ub=d({description:"Retrieve a retention policy by its id",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${aa}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:sa}),Du=n.Pick(Zs,["env","teamId","dataSource","durationDays","isEnabled"]),D1={env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(Du,{examples:[D1]});var Nb=d({description:"Create a new retention policy",operationId:"createRetentionPolicy",tags:["retention-policies"],url:aa,method:"POST",body:Du,response:sa}),Lb=d({description:"Update a retention policy by its id",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${aa}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Du,response:sa}),kb=d({description:"Delete a retention policy by its id",operationId:"deleteRetentionPolicy",tags:["retention-policies"],url:`${aa}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var Xs={id:n.String({description:"Identifier of the processor"}),description:n.Optional(n.String()),tags:We,updatedAt:n.Optional(T())},Js={id:m({allowEmpty:!1,description:"Identifier of the processor"}),description:n.Optional(m({type:"long"})),tags:mt,updatedAt:n.Optional(T())},G1={...Xs,type:n.Literal("creator")},v1={...Js,type:n.Literal("creator")},j1=b("subtype",[n.Object({targetAttribute:n.String({description:"Attribute that will receive the formatted value"}),formatString:n.String({description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean()),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean())},{$id:"ProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the computed value"}),formula:n.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean()),subtype:n.Literal("math-formula"),replaceMissingBy0:n.Optional(n.Boolean())},{$id:"ProcessorParamsCreatorMathFormula"})]),F1=b("subtype",[n.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:m({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean())},{$id:"InputProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:m({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("math-formula"),replaceMissingBy0:n.Optional(n.Boolean())},{$id:"InputProcessorParamsCreatorMathFormula"})]),B1=n.Object({...G1,params:j1}),q1=n.Object({...v1,params:F1}),H1={...Xs,type:n.Literal("mapper")},K1={...Js,type:n.Literal("mapper")},z1=b("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:n.String({description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean()),overrideTarget:n.Optional(n.Boolean()),targetAttribute:n.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")},{$id:"ProcessorParamsMapperMapAttributes"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level")},{$id:"ProcessorParamsMapperMapLevel"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp")},{$id:"ProcessorParamsMapperMapTimestamp"})]),V1=b("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:m({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:n.Optional(n.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:m({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")},{$id:"InputProcessorParamsMapperMapAttributes"}),n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level")},{$id:"InputProcessorParamsMapperMapLevel"}),n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp")},{$id:"InputProcessorParamsMapperMapTimestamp"})]),Y1=n.Object({...K1,params:V1}),Q1=n.Object({...H1,params:z1}),W1={...Xs,type:n.Literal("parse-attribute")},Z1={...Js,type:n.Literal("parse-attribute")},X1=5,J1=b("subtype",[n.Object({attributeName:n.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(n.String({description:"Grok rule applied to parse text"}),{description:"Ordered Grok rules evaluated until one matches"}),samples:n.Optional(n.Array(n.String(),{description:"Example log lines for validation"})),subtype:n.Literal("grok")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the URL to parse"}),subtype:n.Literal("url")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:n.String({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:n.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:n.String({description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:n.Boolean(),subtype:n.Literal("key-value")})]),ej=b("subtype",[n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(m({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text"}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches"}),samples:n.Optional(n.Array(m({type:"long"}),{maxItems:X1,description:"Example log lines for validation"})),subtype:n.Literal("grok")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:n.Literal("url")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:m({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:m({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:m({allowEmpty:!0,description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:n.Boolean(),subtype:n.Literal("key-value")})]),tj=n.Object({...W1,params:J1}),rj=n.Object({...Z1,params:ej}),nj=11,wb=n.Cyclic({OutputProcessor:n.Union([Q1,tj,B1,n.Object({...Xs,params:n.Object({items:n.Array(n.Object({query:n.String({description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split")})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),Mb=n.Cyclic({InputProcessor:n.Union([Y1,rj,q1,n.Object({...Js,params:n.Object({items:n.Array(n.Object({query:m({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:nj,description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split")})])},"InputProcessor",{description:"Processing step executed sequentially on route logs"});var oj="/v0/logs",Qr=`${oj}/routes`,Dn=n.Object({id:n.String({description:"Identifier of the log route"}),name:n.String({description:"Human readable name shown for the route"}),description:n.Optional(n.String()),isEnabled:n.Boolean(),query:n.String({description:"Query that selects which logs should enter the route"}),rank:n.Number(),tags:We,owner:n.String({description:"Team ID owning and managing the route"}),processors:n.Array(wb,{description:"Ordered processors applied to logs that match the route"}),creator:n.Optional(Ce),updater:n.Optional(Ce),updatedAt:T(),createdAt:T(),assetUpdatedAt:T()},{title:"Route"}),pa=n.Object({name:m({allowEmpty:!1,description:"Human readable name shown for the route"}),description:n.Optional(m({type:"long"})),isEnabled:n.Boolean(),query:m({type:"tsuga-query",description:"Query that selects which logs should enter the route"}),tags:mt,owner:m({allowEmpty:!1,description:"Team ID owning and managing the route"}),processors:n.Array(Mb,{maxItems:50,description:"Ordered processors applied to logs that match the route"})}),NFe=d({tags:["routes"],url:Qr,method:"GET",paginated:!0,query:n.Object(oe),response:n.Array(Dn)}),LFe=d({tags:["routes"],url:`${Qr}/:id`,params:n.Object({id:m()}),method:"GET",response:Dn}),kFe=d({tags:["routes"],url:Qr,method:"POST",body:pa,response:Dn}),wFe=d({tags:["routes"],url:`${Qr}/:id`,method:"PUT",body:pa,params:n.Object({id:m()}),response:Dn}),MFe=d({tags:["routes"],url:`${Qr}/:id/clone`,method:"POST",params:n.Object({id:m()}),body:pa,response:Dn}),$Fe=d({tags:["routes"],url:`${Qr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),DFe=d({tags:["routes"],url:`${Qr}/:id/modify-ranking`,method:"PUT",params:n.Object({id:m()}),body:n.Object({rank:n.Number()}),response:n.Object({})}),GFe=d({tags:["routes"],url:`${Qr}/:id/enable`,method:"PUT",params:n.Object({id:m()}),body:n.Object({enable:n.Boolean()}),response:n.Object({})});var ca=`/${"v1"}/routes`,ma=n.Pick(Dn,["id","name","description","isEnabled","query","tags","owner","processors"],{$id:"Route",description:"Log route allowing to standardize logs and enrich them with additional data"}),ij={id:"123-456-abc",name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(ma,{examples:[ij]});var $b=d({description:"Retrieve all routes",operationId:"listRoutes",tags:["routes"],url:ca,method:"GET",paginated:!0,query:n.Object(oe),response:n.Array(ma)}),Db=d({description:"Retrieve a route by its id",operationId:"getRoute",tags:["routes"],url:`${ca}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:ma}),Gu=n.Pick(pa,["name","description","isEnabled","query","tags","owner","processors"]),aj={name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(Gu,{examples:[aj]});var Gb=d({description:"Create a new route",operationId:"createRoute",tags:["routes"],url:ca,method:"POST",body:Gu,response:ma}),vb=d({description:"Update a route by its id",operationId:"updateRoute",tags:["routes"],url:`${ca}/:id`,method:"PUT",body:Gu,params:n.Object({id:m({allowEmpty:!1})}),response:ma}),jb=d({description:"Delete a route by its id",operationId:"deleteRoute",tags:["routes"],url:`${ca}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var Gn=`${oa}/tag-policies`;var Fb=["ingestion-api-key","operation-api-key","dashboard","log-route","monitor","notification-rule","notification-silence","slo"],sj=["logs","metrics","traces"],vu=n.Array(n.Enum(Fb)),ju=n.Array(n.Enum(sj)),pj=n.Union([vu,ju]),cj=n.Object({teamIds:n.Array(n.String()),mode:n.Enum(["include","exclude"])}),mj=b("type",[n.Object({type:n.Literal("telemetry"),assetTypes:ju,shouldInsertWarning:n.Boolean(),dropSample:n.Optional(n.Number())}),n.Object({type:n.Literal("tsuga_asset"),assetTypes:vu})]),uj=b("type",[n.Object({type:n.Literal("telemetry"),assetTypes:ju,shouldInsertWarning:n.Boolean(),dropSample:n.Optional(n.Number({minimum:0,maximum:100}))}),n.Object({type:n.Literal("tsuga_asset"),assetTypes:vu})]),Do=n.Object({id:n.String(),name:n.String(),description:n.Optional(n.String()),isActive:n.Boolean(),tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean(),teamScope:n.Optional(cj),configuration:mj,creator:n.Optional(Ce),updater:n.Optional(Ce),owner:n.Optional(n.String()),createdAt:T(),updatedAt:T(),assetUpdatedAt:T()});var ua=n.Object({name:m(),description:n.Optional(m()),isActive:n.Boolean(),tagKey:m({allowEmpty:!1}),allowedTagValues:n.Array(m({allowEmpty:!1}),{maxItems:1e3}),isRequired:n.Boolean(),teamScope:n.Optional(n.Object({teamIds:n.Array(m(),{minItems:1,maxItems:100}),mode:n.Enum(["include","exclude"])})),configuration:uj,owner:m({allowEmpty:!1})}),JFe=d({tags:["tag-policies"],url:Gn,method:"GET",query:n.Object({teamIds:n.Optional(n.Array(m(),{maxItems:100})),assetTypes:n.Optional(pj),searchQuery:n.Optional(m())}),response:n.Array(Do)}),eBe=d({tags:["tag-policies"],url:`${Gn}/:id`,method:"GET",params:n.Object({id:m()}),response:Do}),tBe=d({tags:["tag-policies"],url:Gn,method:"POST",body:ua,response:Do}),rBe=d({tags:["tag-policies"],url:`${Gn}/:id`,method:"PUT",params:n.Object({id:m()}),body:ua,response:Do}),nBe=d({tags:["tag-policies"],url:`${Gn}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),oBe=d({tags:["tag-policies"],url:`${oa}/applicable-tag-rules`,method:"GET",query:n.Object({assetType:n.Enum(Fb),teamId:m()}),response:n.Array(n.Object({tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean()}))}),Bb=n.Object({total:n.Number(),totalNonCompliant:n.Number(),idsNonCompliant:n.Array(n.String())}),qb=n.Union([n.Literal("ingestion-api-key"),n.Literal("operation-api-key"),n.Literal("dashboard"),n.Literal("log-route"),n.Literal("monitor"),n.Literal("notification-rule"),n.Literal("notification-silence"),n.Literal("slo")]),lj=n.Object({total:n.Number(),totalNonCompliant:n.Number(),byAssetType:n.Record(qb,Bb)}),dj=n.Omit(Bb,["total"]),fj=n.Object({totalNonCompliant:n.Number(),byAssetType:n.Record(qb,dj)}),Hb=n.Object({totals:lj,byTeam:n.Record(n.String(),fj)}),iBe=d({tags:["tag-policies"],url:`${Gn}/:id/stats`,method:"GET",params:n.Object({id:m()}),response:Hb}),aBe=d({tags:["tag-policies"],url:`${Gn}/new-policy-stats`,method:"POST",body:ua,response:Hb});var la=`/${"v1"}/tag-policies`,ep=n.Pick(Do,["id","name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{$id:"TagPolicy",description:"Policy that enforces tag requirements on Tsuga assets or telemetry data"}),Kb=n.Pick(ua,["name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"]),zb=d({description:"Retrieve all tag policies",operationId:"listTagPolicies",tags:["tag-policies"],url:la,method:"GET",response:n.Array(ep)}),Vb=d({description:"Retrieve a tag policy by its id",operationId:"getTagPolicy",tags:["tag-policies"],url:`${la}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:ep}),Yb=d({description:"Create a new tag policy",operationId:"createTagPolicy",tags:["tag-policies"],url:la,method:"POST",body:Kb,response:ep}),Qb=d({description:"Update a tag policy by its id",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${la}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Kb,response:ep}),Wb=d({description:"Delete a tag policy by its id",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${la}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var da=`/${"v1"}/teams`,fa=n.Pick(Ro,["id","name","description","visibility","tags"],{$id:"Team",description:"Collection of users used to manage ownership and access to resources"}),gj={id:"abc-123-def",name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(fa,{examples:[gj]});var Zb=d({description:"Retrieve all teams",operationId:"listTeams",tags:["teams"],url:da,method:"GET",paginated:!0,query:n.Object(oe),response:n.Array(fa)}),Xb=d({description:"Retrieve a team by its id",operationId:"getTeam",tags:["teams"],url:`${da}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:fa}),Fu=n.Pick(Ls,["name","description","visibility","tags"]),yj={name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(Fu,{examples:[yj]});var Jb=d({description:"Create a new team",operationId:"createTeam",tags:["teams"],url:da,method:"POST",body:Fu,response:fa}),ex=d({description:"Update a team by its id",operationId:"updateTeam",tags:["teams"],url:`${da}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Fu,response:fa}),tx=d({description:"Delete a team by its id",operationId:"deleteTeam",tags:["teams"],url:`${da}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});function Bu(e){let t=e.params;if(t?.properties){let r=Object.keys(t.properties);if(r.length===1&&r[0])return r[0]}return"id"}function rx(e,t,r){let o=e.command(t.commandName).description(t.description),i=PS(t.commandName).replace(/-/g," "),a=o.command("list").description(`List all ${t.commandName}`);if(t.listOptions)for(let p of t.listOptions)a.option(p.flag,p.description);if(t.enableListBody?a.option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async p=>{if(p.generateSkeleton){ae(So(t.endpoints.list));return}let u=await r()(t.endpoints.list,{body:p.data?bo({data:p.data}):{}});ae(u)}):a.action(async p=>{let u={};if(t.listOptions)for(let f of t.listOptions){let y=p[f.queryParam];y!==void 0&&(u[f.queryParam]=y)}let l=await r()(t.endpoints.list,Object.keys(u).length>0?{query:u}:void 0);ae(l)}),t.endpoints.get){let p=t.endpoints.get,u=Bu(p);o.command("get <id>").description(`Get a ${i} by ID`).action(async l=>{let f=await r()(p,{params:{[u]:l}});ae(f)})}if(t.endpoints.create){let p=t.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async u=>{if(u.generateSkeleton){ae(So(p));return}let l=bo(u),f=await r()(p,{body:l});ae(f)})}if(t.endpoints.update){let p=t.endpoints.update,u=Bu(p);o.command("update <id>").description(`Update a ${i} by ID`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async(l,f)=>{if(f.generateSkeleton){ae(So(p));return}let y=bo(f),I=await r()(p,{params:{[u]:l},body:y});ae(I)})}if(t.endpoints.delete){let p=t.endpoints.delete,u=Bu(p);o.command("delete <id>").description(`Delete a ${i} by ID`).action(async l=>{let f=await r()(p,{params:{[u]:l}});ae(f)})}}var Ej=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:xS}},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:pS,get:mS,create:uS,update:lS,delete:dS},listOptions:[{flag:"--owners <ids...>",description:"Filter by owner team IDs",queryParam:"owners"}]},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",endpoints:{list:IS,create:TS,update:_S,delete:hS}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:YS,get:QS,create:tb,update:rb,delete:nb},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:cb,get:mb,create:ub,update:lb,delete:db}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:Eb,get:Ib,create:_b,update:hb,delete:Ob}},{commandName:"quality-reports",description:"Manage quality reports",endpoints:{list:bb}},{commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:Pb,get:Ub,create:Nb,update:Lb,delete:kb}},{commandName:"routes",description:"Manage routes",endpoints:{list:$b,get:Db,create:Gb,update:vb,delete:jb}},{commandName:"services",description:"Manage services",endpoints:{list:MA,get:$A}},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:zb,get:Vb,create:Yb,update:Qb,delete:Wb}},{commandName:"teams",description:"Manage teams",endpoints:{list:Zb,get:Xb,create:Jb,update:ex,delete:tx}}];function nx(e,t){for(let r of Ej)rx(e,r,t)}var rr=require("node:fs"),Yu=require("node:os"),vo=require("node:path");function Ij(e,t){let r=e.slice(0,t).split(/\r\n|\n|\r/g);return[r.length,r.pop().length+1]}function Tj(e,t,r){let o=e.split(/\r\n|\n|\r/g),i="",a=(Math.log10(t+1)|0)+1;for(let p=t-1;p<=t+1;p++){let u=o[p-1];u&&(i+=p.toString().padEnd(a," "),i+=": ",i+=u,i+=`
44
+ -----END PRIVATE KEY-----`,isUsingLuhnAlgorithm:!1,regexp:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[ \\r\\n\\t\\f\\v\\S-]{64,}?KEY(?: BLOCK)?-----"},{key:"pulumi_api_token",name:"Pulumi API token",category:"credential",example:"pul-b77e6bff9fddebbc2bb8eca94e3f29a41f6da70a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pul-[a-f0-9]{40})"},{key:"pypi_upload_token",name:"PyPI upload token",category:"credential",example:"pypi-AgEIcHlwaS5vcmc128fd9e0b47dde39cfecad3a997273458e6392f6aac649ae38864bdd7ff12836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)pypi-AgEIcHlwaS5vcmc[a-zA-Z0-9_-]{50}"},{key:"rapidapi_access_token",name:"RapidAPI access token",category:"credential",example:"g4x40h94pi_-zlklfz3-qvhiiu5zankyrqqwmsl60decihbqvl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{50})"},{key:"readme_api_token",name:"ReadMe API token",category:"credential",example:"rdme_k38kau741xa5lw03mdkvcd4vn6s6hdhvhg1wxa4ls7dp8h58r0yxq65nsqwndn056pxsc4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rdme_[a-z0-9]{70})"},{key:"rubygems_api_token",name:"RubyGems API token",category:"credential",example:"rubygems_7790aaa8102395704a64594a11f6de4941a27f86bc3fc9d4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rubygems_[a-f0-9]{48})"},{key:"scalingo_api_token",name:"Scalingo API token",category:"credential",example:"tk-us-4fhmqrg-rl4416b3oij_qx3q284wbhbqpk7r3te4r14lafou",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:tk-us-[a-zA-Z0-9_-]{48})"},{key:"sendbird_access_id",name:"SendBird access ID",category:"credential",example:"7e7801fd-c25d-50ab-a723-01b94c8d6c5f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sendbird_access_token",name:"SendBird access token",category:"credential",example:"305f75f04e3afa65360c25d9944fdae91138328d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{40})"},{key:"sendgrid_api_token",name:"SendGrid API token",category:"credential",example:"SG.--ed-fvdeffijnle7575jp1sh24wq_9y9hcjua5w3dnqh5-wyegkpzenziy1_qr=hf",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:SG\\.[a-z0-9=_\\-\\.]{66})"},{key:"sendinblue_api_token",name:"Sendinblue API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:xkeysib-[a-f0-9]{64}\\-[a-z0-9]{16})"},{key:"sentry_access_token",name:"Sentry access token",category:"credential",example:"1ad463398f40a52bb94a3795762f4003d51b03b8a788cba55e3a81de81c72940",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"sentry_org_token",name:"Sentry org token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)sntrys_eyJpYXQiO[a-zA-Z0-9+/]{10}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10}={0,2}_[a-zA-Z0-9+/]{43}(?:[^a-zA-Z0-9+/]|\\z)"},{key:"sentry_user_token",name:"Sentry user token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sntryu_[a-f0-9]{64})"},{key:"settlemint_application_access_token",name:"Settlemint application access token",category:"credential",example:"sm_aat_gshgzsv353m5yb9s",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_aat_[a-zA-Z0-9]{16})"},{key:"settlemint_personal_access_token",name:"Settlemint personal access token",category:"credential",example:"sm_pat_1yhza49gsle0trg8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_pat_[a-zA-Z0-9]{16})"},{key:"settlemint_service_access_token",name:"Settlemint service access token",category:"credential",example:"sm_sat_cha543e6lb19llli",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_sat_[a-zA-Z0-9]{16})"},{key:"shippo_api_token",name:"Shippo API token",category:"credential",example:"shippo_live_1d0f80d04e7788c1edb8fc2b8076bbf8f59b84b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:shippo_(?:live|test)_[a-fA-F0-9]{40})"},{key:"shopify_access_token",name:"Shopify access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpat_[a-fA-F0-9]{32}"},{key:"shopify_custom_access_token",name:"Shopify custom access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpca_[a-fA-F0-9]{32}"},{key:"shopify_private_app_access_token",name:"Shopify private app access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shppa_[a-fA-F0-9]{32}"},{key:"shopify_shared_secret",name:"Shopify shared secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpss_[a-fA-F0-9]{32}"},{key:"sidekiq_secret",name:"Sidekiq secret",category:"credential",example:"aa8d3915:64fb5cb5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{8}:[a-f0-9]{8})"},{key:"sidekiq_sensitive_url",name:"Sidekiq sensitive URL",category:"credential",example:"https://cafebabe:deadbeef@gems.contribsys.com/",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https?://(?:[a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\\/|\\#|\\?|:]|$)"},{key:"slack_bot_token",name:"Slack bot token",category:"credential",example:"xoxb-781236542736-2364535789652-GkwFDQoHqzXDVsC6GzqYUypD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*"},{key:"slack_user_token",name:"Slack user token",category:"credential",example:"xoxp-41684372915-1320496754-45609968301-e708ba56e1517a99f6b5fb07349476ef",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}"},{key:"slack_app_token",name:"Slack app token",category:"credential",example:"xapp-1-A052FGTS2DL-5171572773297-610b6a11f4b7eb819e87b767d80e6575a3634791acb9a9ead051da879eb5b55e",isUsingLuhnAlgorithm:!1,regexp:"xapp-[0-9]-[A-Z0-9]+-[0-9]+-[a-z0-9]+"},{key:"slack_config_access_token",name:"Slack config access token",category:"credential",example:"xoxe.xoxp-1-Mi0yLTM0MTQwNDE0MDE3Ni0zNjU5NDY0Njg4MTctNTE4MjA3NTQ5NjA4MC01NDEyOTYyODY5NzUxLThhMTBjZmI1ZWIzMGIwNTg0ZDdmMDI5Y2UxNzVlZWVhYzU2ZWQyZTZiODNjNDZiMGUxMzRlNmNjNDEwYmQxMjQ",isUsingLuhnAlgorithm:!1,regexp:"xoxe.xox[bp]-[0-9]-[A-Z0-9]{50}"},{key:"slack_config_refresh_token",name:"Slack config refresh token",category:"credential",example:"xoxe-1-My0xLTMxNzcwMjQ0MTcxMy01MTU4MTUyNjkxNzE0LTUxODE4NDI0MDY3MzYtMjA5MGFkOTFlZThkZWE2OGFlZDYwYWJjODNhYzAxYjA5ZjVmODBhYjgzN2QyNDdjOTNlOGY5NTg2YWM1OGM4Mg",isUsingLuhnAlgorithm:!1,regexp:"xoxe-[0-9]-[A-Z0-9]{50}"},{key:"slack_legacy_bot_token",name:"Slack legacy bot token",category:"credential",example:"xoxb-263594206564-FGqddMF8t08v8N7Oq4i57vs1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26}"},{key:"slack_legacy_workspace_token",name:"Slack legacy workspace token",category:"credential",example:"xoxa-2-511111111-31111111111-3111111111111-e039d02840a0b9379c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[ar]-(?:[0-9]-)?[0-9a-zA-Z]{8,48}"},{key:"slack_legacy_token",name:"Slack legacy token",category:"credential",example:"xoxs-416843729158-132049654-5609968301-e708ba56e1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[os]-[0-9]+-[0-9]+-[0-9]+-[a-fA-F0-9]+"},{key:"slack_webhook_url",name:"Slack webhook URL",category:"credential",example:"hooks.slack.com/services/z6cvbfngk3h7i0vts4akmbxidtb8o3b4pq2sbbd6o86g",isUsingLuhnAlgorithm:!1,regexp:"(?:https?://)?hooks.slack.com/(?:services|workflows|triggers)/[A-Za-z0-9+/]{43,56}"},{key:"snyk_api_token",name:"Snyk API token",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sonar_api_token",name:"Sonar API token",category:"credential",example:"12345678ABCDEFH1234567890ABCDEFH12345678",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:(?:squ_|sqp_|sqa_)?[a-z0-9=_-]{40})"},{key:"stripe_access_token",name:"Stripe access token",category:"credential",example:"sk_test_cyge9m4s1kxiqdkszz0a57nyx6wk73",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})"},{key:"square_access_token",name:"Square access token",category:"credential",example:"sq0atp-OQUxovdrj3tfFpSd66r3sY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:EAAA|sq0atp-)[a-zA-Z0-9_-]{22,60})"},{key:"squarespace_access_token",name:"Squarespace access token",category:"credential",example:"86447eab-140f-2563-3572-bb016dafd692",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sumologic_access_id",name:"SumoLogic access ID",category:"credential",example:"suJS4ZsaD5bQTt",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:su[a-zA-Z0-9]{12})"},{key:"sumologic_access_token",name:"SumoLogic access token",category:"credential",example:"1xohkwr8lpvm4osygkpe5zbd16c3376ver2qed1bssuko4uy4tij1bnf4dnwy7o4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"microsoft_teams_webhook",name:"Microsoft Teams webhook URL",category:"credential",example:"https://mycompany.webhook.office.com/webhookb2/767lrnj6-okh8-dnh8-jey2-y2iteohrwz75@6igi6oz6-ud9w-wior-2zva-5vx0wp6wuiqk/IncomingWebhook/o1zox92ssprrppjtnvcjqq0q09k2wnc3/qwox5p9d-x4zr-3yis-t1on-s67zj50tmyht",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https://[a-z0-9]+\\.webhook\\.office\\.com/webhookb2/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}"},{key:"telegram_bot_api_token",name:"Telegram bot API token",category:"credential",example:"59015865:A12o5wu6f78zofs0udypf9ti23u82g-qkfz",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{5,16}:(?-i:A)[a-z0-9_\\-]{34})"},{key:"travisci_access_token",name:"Travis CI access token",category:"credential",example:"zjgfo5fhshd5c60hpz22wh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{22})"},{key:"twilio_api_key",name:"Twilio API key",category:"credential",example:"SKa585fd034fcd16cdd741f7df9b57fb3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)SK[0-9a-fA-F]{32}"},{key:"twitch_api_token",name:"Twitch API token",category:"credential",example:"1hm9gcychlkpf93jdjnwdu0uaamu6d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"twitter_api_key",name:"Twitter API key",category:"credential",example:"m8zqu4etx07bjt7tyeacc6pox",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"twitter_api_secret",name:"Twitter API secret",category:"credential",example:"7f4gxkubw9qs346ik99zk3z8b6kk3d7g8toi7zujgvgbt8q0yv",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{50})"},{key:"twitter_access_token",name:"Twitter access token",category:"credential",example:"465616696186918-96B1NCD5CH0uyi7zUHiS",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{15,25}-[a-zA-Z0-9]{20,40})"},{key:"twitter_access_secret",name:"Twitter access secret",category:"credential",example:"vyuo5peybdzznr7z0ua5wamhogusans4m29uzi25w4jgj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{45})"},{key:"twitter_bearer_token",name:"Twitter bearer token",category:"credential",example:"AAAAAAAAAAAAAAAAAAAAAAWRGWFGlfwyqNrrIa3pewqNNLX0jQMj2sR6M2cZUfBdqXDtkt7Nsb56F4tCz7Pt8ujbosrLxnRqYgwI0b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:A{22}[a-zA-Z0-9%]{80})"},{key:"typeform_api_token",name:"Typeform API token",category:"credential",example:"tfp_o-nsn=6eg2ios=4g652xhf933qor4jj7ort2qh_uw_5jdsuffp31ln=e-2a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:tfp_[a-z0-9\\-_\\.=]{59})"},{key:"vault_batch_token",name:"Vault batch token",category:"credential",example:"hvb.x84j4cl53mzvhvb1nfc3mfi721gh5i-92f96lt0gns5lpksfu5f0199j-gw4ycxg6au4ser86mczcr_nx6ur2elbpazfrybo80fxjv3bghxshml3g261l6qi03yrz03qup84jk-fc2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hvb\\.[a-zA-Z0-9_-]{50})"},{key:"vault_service_token",name:"Vault service token",category:"credential",example:"s.8QH9knZV94f0IjBZismfOPD0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:hvs\\.[a-zA-Z0-9_-]{90}|s\\.(?i:[a-z0-9]{24})))"},{key:"yandex_api_key",name:"Yandex API key",category:"credential",example:"AQVN9wiAh8pyz3lmB5WTo_KUuPDXlxtzkA5-YFG",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:AQVN[A-Za-z0-9_\\-]{35,38})"},{key:"yandex_aws_access_token",name:"Yandex AWS access token",category:"credential",example:"YCZ6DHVrZONPNtgwWLZPrIGyviSrudRVSr8w0b1S",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:YC[a-zA-Z0-9_\\-]{38})"},{key:"yandex_access_token",name:"Yandex access token",category:"credential",example:"t1.L=.WJ9CYVI5eeLkTOrMM_dgaPgdmpen48R8RYsL4VJqelVKDmrqYsSHkH6QyVVhJkuHSQFTd0NOhClEDyCz7eEbh5=",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:t1\\.[A-Z0-9a-z_-]+[=]{0,2}\\.[A-Z0-9a-z_-]{86}[=]{0,2})"},{key:"zendesk_secret_key",name:"Zendesk secret key",category:"credential",example:"iydgm2jofftb2xu7niv55qnfxdwbwmqt2s561bgc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"infracost_api_token",name:"Infracost API token",category:"credential",example:"ico-fNZw8jjy6TugMUHKWX4l9iSP3i95SPNH",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ico-[a-zA-Z0-9]{32})"},{key:"iban",name:"Iban",category:"financial-data",example:"FR7630006000011234567890189",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{11,30}(?-u:\\b)"},{key:"aikido_token",name:"Aikido token",category:"credential",example:"AIK_SECRET_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_SECRET_[A-Za-z0-9]{64}"},{key:"aikido_ci_token",name:"Aikido CI secret",category:"credential",example:"AIK_CI_US_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_CI_(US_|ME_)?[A-Za-z0-9]{64}"},{key:"tsuga_ingestion_key",name:"Tsuga ingestion key",category:"credential",example:"tsuga_in:v1:OUvrwavCG//ixL08HEds9OAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_in:v1:[A-Za-z0-9+/]{24}"},{key:"tsuga_operation_key",name:"Tsuga operation key",category:"credential",example:"tsuga_op:v1:zz3-LWv-sLy:0k7Skt255M0yXe/ZLBoiSamb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_op:v1:[A-Za-z0-9_-]+:[A-Za-z0-9+/]{24}"}],f1=QS.map(e=>e.key),_1e=new Set(f1),h1e=QS.map(e=>e.key);function WS(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var ZS=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","alert_previous_status","alert_priority","alert_start_time","alert_status","alert_tags","alert_timeframe","alert_title","alert_transition","alert_triggered_by","dashboard_url","monitor_url"],XS=["alert_queries","alert_thresholds","alert_values"],g1=[...ZS,...XS],JS=["alert_event_name","alert_message"],K1e=[...g1,...JS],z1e=new Set([...ZS,...JS]),V1e=new Set(XS);var y1=["all","owning-team-and-public","owning-team-only"],Du=n.Enum(y1,{description:"This controls which data the resource can see"});var Ut="/v0/monitors",$o=["alert","resolve","keep_last_status","consider_zero"],Xs=["alert","resolve","keep_last_status"];var tb=["no_aggregation","all","any","each","proportion"],rb=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var E1=n.Object({formula:n.String(),operator:n.Enum(rb),threshold:n.Number()}),I1=n.Object({formula:m({type:"tsuga-formula"}),operator:n.Enum(rb),threshold:n.Number()}),$u=n.Array(E1),Gu=n.Array(I1),nb=n.Object({formula:n.String(),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"])}),ob=n.Object({formula:m({type:"tsuga-formula"}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"])}),$je=n.Enum(["rate","error","cpu","general"]),Pt=[1,2,3,4,5];var Ji={timeframe:n.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:n.Array(n.Object({fields:n.Array(n.String(),{description:"Fields used by the monitor group by."}),limit:n.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:n.Optional(n.Enum(tb)),proportionAlertThreshold:n.Optional(n.Integer())},ea={timeframe:n.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:n.Array(n.Object({fields:n.Array(m(),{description:"Fields used by the monitor group by."}),limit:n.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{maxItems:1,description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:n.Optional(n.Enum(tb)),proportionAlertThreshold:n.Optional(n.Integer({minimum:1,maximum:99}))},ib=n.Object({type:n.Literal("metric"),conditions:$u,noDataBehavior:n.Enum($o),...Ji,queries:Eo},{$id:"MonitorConfigurationMetric"}),ab=n.Object({type:n.Literal("metric"),conditions:Gu,noDataBehavior:n.Enum($o),...ea,queries:Io},{$id:"InputMonitorConfigurationMetric"}),sb=n.Object({type:n.Literal("log"),conditions:$u,noDataBehavior:n.Enum($o),...Ji,queries:Eo},{$id:"MonitorConfigurationLog"}),pb=n.Object({type:n.Literal("log"),conditions:Gu,noDataBehavior:n.Enum($o),...ea,queries:Io},{$id:"InputMonitorConfigurationLog"}),cb=n.Object({type:n.Literal("trace"),conditions:$u,noDataBehavior:n.Enum($o),...Ji,queries:Eo},{$id:"MonitorConfigurationTrace"}),T1=n.Object({type:n.Literal("trace"),conditions:Gu,noDataBehavior:n.Enum($o),...ea,queries:Io},{$id:"InputMonitorConfigurationTrace"}),mb=n.Object({type:n.Literal("anomaly-log"),condition:nb,noDataBehavior:n.Enum(Xs),...Ji,queries:Eo},{$id:"MonitorConfigurationAnomalyLog"}),ub=n.Object({type:n.Literal("anomaly-log"),condition:ob,noDataBehavior:n.Enum(Xs),...ea,queries:Io},{$id:"InputMonitorConfigurationAnomalyLog"}),lb=n.Object({type:n.Literal("anomaly-metric"),condition:nb,noDataBehavior:n.Enum(Xs),...Ji,queries:Eo},{$id:"MonitorConfigurationAnomalyMetric"}),db=n.Object({type:n.Literal("anomaly-metric"),condition:ob,noDataBehavior:n.Enum(Xs),...ea,queries:Io},{$id:"InputMonitorConfigurationAnomalyMetric"}),fb=n.Object({type:n.Literal("certificate-expiry"),warnBeforeInDays:n.Integer(),cloudAccounts:n.Optional(n.Array(n.String())),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("resolve")},{$id:"MonitorConfigurationCertificateExpiry"}),_1=n.Object({type:n.Literal("certificate-expiry"),warnBeforeInDays:n.Integer({minimum:1,maximum:365}),cloudAccounts:n.Optional(n.Array(n.String(),{minItems:1})),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("resolve")},{$id:"InputMonitorConfigurationCertificateExpiry"}),gb=n.Object({type:n.Literal("log-error-pattern"),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("keep_last_status"),filter:n.Object({teamIds:n.Array(n.String()),env:n.String(),service:n.Optional(n.String())})},{$id:"MonitorConfigurationLogErrorPattern"}),h1=S("type",[ib,sb,cb,mb,lb,gb,fb]),O1=S("type",[ab,pb,T1,ub,db,gb,_1]);var Tr=n.Object({id:n.String({description:"Identifier of the monitor"}),name:n.String({description:"Display name of the monitor"}),owner:n.String({description:"Team ID that owns and manages the monitor"}),message:n.Optional(n.String({description:"Message to be displayed if a notification is triggered"})),tags:Ve,configuration:h1,priority:n.Enum(Pt,{description:"Priority of the monitor"}),permissions:Du,dashboardId:n.Optional(n.String({description:"Identifier of a dashboard related to the monitor"})),pauseUntil:n.Optional(T()),creator:n.Optional(Ce),updater:n.Optional(Ce),createdAt:T(),updatedAt:T(),assetUpdatedAt:T(),clusterIds:n.Array(n.String())},{title:"Monitor"}),A1=S("type",[ib,sb,cb,mb,lb,fb]),Gje=n.Object({...Tr.properties,configuration:A1},{title:"Monitor"}),vje=n.Object({...Tr.properties,configuration:S("type",[ab,pb,ub,db])},{title:"Monitor"}),ta=n.Object({name:m(),message:n.Optional(m({type:"long"})),tags:Ze,configuration:O1,priority:n.Enum(Pt),owner:m({allowEmpty:!1}),dashboardId:n.Optional(m()),pauseUntil:n.Optional(m({allowEmpty:!1,type:"date-time"})),permissions:Du,clusterIds:n.Optional(n.Array(m({allowEmpty:!1})))}),eb=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],Zr={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var yb=n.Object({owners:pr(m({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:m({allowEmpty:!1}),exclude:n.Optional(n.Boolean({description:"If true, exclude monitors matching this value instead of including them"}))},{description:"Substring matched against monitor name and configuration"}),tags:pr(Nn.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:pr(n.Enum(Pt),{description:"Restrict results to monitors with one of these priorities",maxItems:Pt.length}),types:pr(n.Enum(eb),{description:"Restrict results to monitors with these types",maxItems:eb.length}),activity:n.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:pr(m({allowEmpty:!1}),{description:"Restrict results to monitors deployed to any of these cluster IDs (monitors with no cluster restriction are always included)",maxItems:50})},{description:"Optional filters applied to narrow the returned monitors"}),vu=n.Partial(n.Object({...ee,filters:n.Partial(yb),sort:n.Object({by:n.Enum([Zr.PRIORITY,Zr.TYPE,Zr.NAME,Zr.OWNER,Zr.TAGS,Zr.CLUSTER_IDS,Zr.PAUSE_UNTIL,Zr.ASSET_UPDATED_AT],{description:"Field to sort the returned monitors by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned monitors"})})),jje=d({tags:["monitors"],url:`${Ut}/query`,method:"POST",paginated:!0,response:n.Array(Tr),body:vu}),Fje=d({tags:["monitors"],url:`${Ut}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(yb,["tags"])))}),response:Un}),Bje=d({tags:["monitors"],url:`${Ut}/:id`,method:"GET",params:n.Object({id:m()}),response:Tr}),qje=d({tags:["monitors"],url:Ut,method:"POST",body:ta,response:Tr}),Hje=d({tags:["monitors"],url:`${Ut}/:id`,method:"PUT",params:n.Object({id:m()}),body:ta,response:Tr}),Kje=d({tags:["monitors"],url:`${Ut}/:id`,method:"DELETE",params:n.Object({id:m()}),response:D}),zje=d({tags:["monitors"],url:`${Ut}/:id/snooze`,method:"POST",params:n.Object({id:m()}),body:n.Object({pauseUntil:m({allowEmpty:!1,type:"date-time"})}),response:Tr}),S1=["alert","ok","alert_consider_zero","ok_consider_zero","alert_no_data","ok_no_data","keep_last_status_ok","keep_last_status_alert"],wn=n.Enum(S1),b1=S("type",[n.Object({type:n.Literal("each"),subStates:n.Record(n.String(),n.Object({stateValue:n.Union([wn,n.Null()]),lastChangedAt:T()}))}),n.Object({type:n.Literal("no_aggregation"),stateValue:n.Optional(wn)}),n.Object({type:n.Literal("any"),stateValue:n.Optional(wn)}),n.Object({type:n.Literal("all"),stateValue:n.Optional(wn)}),n.Object({type:n.Literal("proportion"),stateValue:n.Optional(wn)})]),x1=n.Object({monitorId:n.String(),currentState:b1,lastChangedAt:n.Optional(T())}),Vje=d({tags:["monitors"],url:`${Ut}/states/:id`,method:"GET",params:n.Object({id:m()}),response:x1}),Yje=d({tags:["monitors"],url:`${Ut}/:id/transitions`,method:"GET",params:n.Object({id:m()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Array(n.Object({id:n.String(),createdAt:T(),fromState:n.Optional(wn),toState:n.Optional(wn),dimension:n.Optional(n.String())}))}),R1=["unprocessed","processed","failed-to-process"],Qje=d({tags:["monitors"],url:`${Ut}/:id/results`,method:"GET",params:n.Object({id:m()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Object({isTruncated:n.Boolean(),results:n.Array(n.Object({id:n.String(),evaluationAt:T(),formulaResult:n.Object({groups:n.Array(n.Object({groupKey:n.Record(n.String(),Fc),results:n.Array(n.Union([n.Number(),n.Null()])),conditionMet:n.Enum(["true","false","nan-no-data"])}))}),createdAt:T(),status:n.Enum(R1)}))})});var ra=`/${"v1"}/monitors`,na=n.Pick(Tr,["id","name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],{$id:"Monitor",description:"Monitor allowing to send alerts based on telemetry data"}),C1={id:"123-456-abc",name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},P1={id:"456-789-def",name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(na,{examples:[C1,P1]});var Eb=n.Pick(vu,["filters","sort","limit","offset"]),U1={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(Eb,{examples:[U1]});var Ib=d({description:"Query monitors with filters, sorting, and pagination",operationId:"queryMonitors",tags:["monitors"],url:`${ra}/query`,method:"POST",paginated:!0,body:Eb,response:n.Array(na)}),Tb=d({description:"Retrieve a monitor by its id",operationId:"getMonitor",tags:["monitors"],url:`${ra}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:na}),_b=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],hb=n.Pick(ta,_b,{$id:"CreateMonitorRequest"}),Ob=n.Pick(ta,_b,{$id:"UpdateMonitorRequest"}),Ab={name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},Sb={name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(hb,{examples:[Ab,Sb]});Object.assign(Ob,{examples:[Ab,Sb]});var bb=d({description:"Create a new monitor",operationId:"createMonitor",tags:["monitors"],url:ra,method:"POST",body:hb,response:na}),xb=d({description:"Update a monitor by its id",operationId:"updateMonitor",tags:["monitors"],url:`${ra}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Ob,response:na}),N1=n.Object({id:m({allowEmpty:!1,description:"The monitor ID to delete"})}),Rb=d({description:"Delete a monitor by its id",operationId:"deleteMonitor",tags:["monitors"],url:`${ra}/:id`,method:"DELETE",params:N1,response:D});var oa="/v0/notifications",$n=`${oa}/rules`,Cb=`${oa}/slack/setup`,Js=`${oa}/integrations`,Dn=["triggered","resolved","no-data"],L1=["sent","stale","pending","rate-limited","failed","silenced"],k1=n.Optional(n.Object({maxMessages:n.Integer({description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:n.Integer({description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),M1=n.Optional(n.Object({maxMessages:n.Integer({minimum:1,description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:n.Integer({minimum:1,description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),w1=n.Optional(n.Object({mode:n.Literal("each"),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:n.Integer({description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),D1=n.Optional(n.Object({mode:n.Literal("each"),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:n.Integer({minimum:1,description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),$1=n.Object({id:n.String({description:"Identifier of the notification target"}),rateLimit:k1,renotifyConfig:w1,config:S("type",[n.Object({type:n.Literal("slack"),channel:n.String({description:"Slack channel ID that receives the notification"}),integrationId:n.String({description:"Slack workspace ID that receives the notification"}),integrationName:n.String({description:"Human readable name of the Slack integration"})},{$id:"RuleTargetConfigSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:n.String({description:"Identifier of the incident.io integration to use"}),integrationName:n.String({description:"Human readable name of the incident.io integration"})},{$id:"RuleTargetConfigIncidentIo"}),n.Object({type:n.Literal("email"),addresses:n.Array(n.String(),{description:"Email addresses that will receive the alert"})},{$id:"RuleTargetConfigEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:n.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:n.String({description:"Human readable name of the Grafana IRM integration"})},{$id:"RuleTargetConfigGrafanaIrm"}),n.Object({type:n.Literal("pagerduty"),integrationId:n.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:n.String({description:"Human readable name of the PagerDuty integration"})},{$id:"RuleTargetConfigPagerDuty"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:n.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:n.String({description:"Human readable name of the Microsoft Teams integration"})},{$id:"RuleTargetConfigMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:n.String({description:"Identifier of the webhook integration to use"}),integrationName:n.String({description:"Human readable name of the webhook integration"})},{$id:"RuleTargetConfigWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:n.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:n.String({description:"Human readable name of the ServiceNow integration"})},{$id:"RuleTargetConfigServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:n.String({description:"Identifier of the Google Chat integration to use"}),integrationName:n.String({description:"Human readable name of the Google Chat integration"})},{$id:"RuleTargetConfigGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:n.String({description:"Identifier of the Squadcast integration to use"}),integrationName:n.String({description:"Human readable name of the Squadcast integration"})},{$id:"RuleTargetConfigSquadcast"})],{description:"Configuration describing how the alert was delivered"})}),G1=n.Object({id:m({description:"Identifier of the notification target"}),rateLimit:M1,config:S("type",[n.Object({type:n.Literal("slack"),channel:m({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:m({allowEmpty:!1,description:"Slack workspace ID that receives the notification"})},{$id:"RuleTargetInputSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:m({allowEmpty:!1,description:"Identifier of the incident.io integration to use"})},{$id:"RuleTargetInputIncidentIo"}),n.Object({type:n.Literal("pagerduty"),integrationId:m({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"})},{$id:"RuleTargetInputPagerDuty"}),n.Object({type:n.Literal("email"),addresses:n.Array(m({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"})},{$id:"RuleTargetInputEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:m({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"})},{$id:"RuleTargetInputGrafanaIrm"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:m({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"})},{$id:"RuleTargetInputMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:m({allowEmpty:!1,description:"Identifier of the webhook integration to use"})},{$id:"RuleTargetInputWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:m({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"})},{$id:"RuleTargetInputServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:m({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"})},{$id:"RuleTargetInputGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:m({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"})},{$id:"RuleTargetInputSquadcast"})],{description:"Configuration describing how the alert should be delivered"}),renotifyConfig:D1}),ju=S("type",[n.Object({type:n.Literal("specific-teams"),teams:n.Array(n.String(),{description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams")}),n.Object({type:n.Literal("all-public-teams")})]),Fu=S("type",[n.Object({type:n.Literal("specific-teams"),teams:n.Array(m(),{minItems:1,maxItems:100,description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams")}),n.Object({type:n.Literal("all-public-teams")})]),Go=n.Object({id:n.String({description:"Identifier of the notification rule"}),name:n.String({description:"Display name of the notification rule"}),queryString:n.Optional(n.String({description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:ju,prioritiesFilter:n.Array(n.Enum(Pt),{description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(Dn),{description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Array(n.String(),{description:"Cluster IDs that can trigger a notification"}),owner:n.String({description:"Team ID that owns and manages the rule"}),createdAt:T(),updatedAt:T(),isActive:n.Boolean(),tags:Ve,targets:n.Array($1,{description:"Notification targets that can receive notifications when the rule matches"}),creator:n.Optional(Ce),updater:n.Optional(Ce)}),ia=n.Object({name:m({description:"Display name of the notification rule"}),queryString:n.Optional(m({type:"tags-query",description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:Fu,prioritiesFilter:n.Array(n.Enum(Pt),{maxItems:Pt.length,description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(Dn),{maxItems:Dn.length,description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Cluster IDs that can trigger a notification"})),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:Ze,isActive:n.Boolean(),targets:n.Array(G1,{minItems:1,description:"Notification targets that can receive notifications when the rule matches"})}),uFe=d({tags:["notification-rules"],url:$n,method:"GET",paginated:!0,query:n.Object(ee),response:n.Array(Go)}),lFe=d({tags:["notification-rules"],url:`${$n}/:id`,params:n.Object({id:m()}),method:"GET",response:Go}),dFe=d({tags:["notification-rules"],url:$n,method:"POST",body:ia,response:Go}),fFe=d({tags:["notification-rules"],url:`${$n}/:id`,method:"PUT",params:n.Object({id:m()}),body:ia,response:Go}),gFe=d({tags:["notification-rules"],url:`${$n}/:id`,method:"DELETE",params:n.Object({id:m()}),response:D}),yFe=d({tags:["notification-integrations"],url:`${Cb}/start`,method:"POST",response:n.Object({redirectUrl:n.String()})}),v1=n.Object({id:n.String(),name:n.String(),type:n.Enum(["slack","incident-io","grafana-irm","pagerduty","microsoft-teams","webhook","servicenow","google-chat","squadcast"]),createdAt:T(),ruleCount:n.Number(),creator:n.Optional(Ce)}),EFe=d({tags:["notification-integrations"],url:`${$n}/integrations`,method:"GET",paginated:!0,query:n.Object(ee),response:n.Array(v1)}),IFe=d({tags:["notification-integrations"],url:`${Cb}/callback`,method:"GET",query:n.Object({code:m()}),response:n.Object({success:n.Boolean()})}),Bu=["POST","PUT"],j1=n.Record(n.String(),n.String()),F1=n.Record(n.String(),n.Unknown()),B1=n.Record(n.String(),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))])),q1=S("type",[n.Object({type:n.Literal("json"),value:F1}),n.Object({type:n.Literal("form"),value:B1})]),H1=n.Object({ok:n.String(),alert:n.String()}),qu=n.Object({id:n.String(),name:n.String(),setting:S("type",[n.Object({type:n.Literal("incident-io"),alertSourceConfigId:n.String(),tokenLastChars:n.String()}),n.Object({type:n.Literal("grafana-irm"),urlLastChars:n.String()}),n.Object({type:n.Literal("pagerduty"),integrationKeyLastChars:n.String()}),n.Object({type:n.Literal("microsoft-teams"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("webhook"),urlLastChars:n.String(),method:n.Enum(Bu),authentication:S("type",[n.Object({type:n.Literal("bearer"),tokenLastChars:n.String()}),n.Object({type:n.Literal("basic"),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("custom-header"),key:n.String(),valueLastChars:n.String()}),n.Object({type:n.Literal("none")})]),customHeaders:n.Optional(j1),payloadTemplate:q1,eventNameMapping:n.Optional(H1)}),n.Object({type:n.Literal("servicenow"),instanceName:n.String(),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("google-chat"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("squadcast"),webhookUrlLastChars:n.String()})]),tags:Ve}),K1=n.Object({type:n.Literal("webhook"),url:m({type:"uri"}),method:n.Enum(Bu),authentication:S("type",[n.Object({type:n.Literal("bearer"),token:m({allowEmpty:!1})}),n.Object({type:n.Literal("basic"),username:m({allowEmpty:!1}),password:m({allowEmpty:!1})}),n.Object({type:n.Literal("custom-header"),key:m({allowEmpty:!1}),value:m({allowEmpty:!1})}),n.Object({type:n.Literal("none")})]),customHeaders:n.Record(m({allowEmpty:!1}),m()),payloadTemplate:S("type",[n.Object({type:n.Literal("json"),value:n.Record(m({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(m({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})]),eventNameMapping:n.Optional(n.Object({ok:m({allowEmpty:!1}),alert:m({allowEmpty:!1})}))}),Pb=n.Object({type:n.Literal("incident-io"),alertSourceConfigId:m(),token:m()}),Ub=n.Object({type:n.Literal("grafana-irm"),url:m({type:"uri"})}),Nb=n.Object({type:n.Literal("pagerduty"),integrationKey:m()}),Lb=n.Object({type:n.Literal("microsoft-teams"),webhookUrl:m({type:"uri"})}),z1=n.Object({type:n.Literal("servicenow"),instanceName:m({allowEmpty:!1,description:'Instance name of the ServiceNow instance. This corresponds to the subdomain part of the instance URL, like "my-instance" in "my-instance.service-now.com"'}),username:m({allowEmpty:!1}),password:m({allowEmpty:!1})}),V1=n.Object({type:n.Literal("google-chat"),webhookUrl:m({type:"uri"})}),Y1=n.Object({type:n.Literal("squadcast"),webhookUrl:m({type:"uri"})}),Q1=n.Object({name:m(),setting:S("type",[Pb,Ub,Nb,Lb,K1,z1,V1,Y1]),tags:Ze}),W1=n.Object({type:n.Literal("webhook"),url:n.Optional(m({type:"uri"})),method:n.Optional(n.Enum(Bu)),authentication:n.Optional(S("type",[n.Object({type:n.Literal("bearer"),token:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("basic"),username:n.Optional(m({allowEmpty:!1})),password:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("custom-header"),key:n.Optional(m({allowEmpty:!1})),value:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("none")})])),customHeaders:n.Optional(n.Record(m({allowEmpty:!1}),m())),payloadTemplate:n.Optional(S("type",[n.Object({type:n.Literal("json"),value:n.Record(m({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(m({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})])),eventNameMapping:n.Optional(n.Object({ok:n.Optional(m({allowEmpty:!1})),alert:n.Optional(m({allowEmpty:!1}))}))}),Z1=n.Object({type:n.Literal("servicenow"),instanceName:n.Optional(m({allowEmpty:!1})),username:n.Optional(m({allowEmpty:!1})),password:n.Optional(m({allowEmpty:!1}))}),X1=n.Object({type:n.Literal("google-chat"),webhookUrl:m({type:"uri"})}),J1=n.Object({type:n.Literal("squadcast"),webhookUrl:m({type:"uri"})}),ej=n.Object({name:n.Optional(m()),setting:n.Optional(S("type",[Pb,Ub,Nb,Lb,W1,Z1,X1,J1]))}),TFe=d({tags:["notification-integrations"],url:Js,method:"POST",body:Q1,response:qu}),_Fe=d({tags:["notification-integrations"],url:`${Js}/:id`,method:"GET",params:n.Object({id:m()}),response:qu}),hFe=d({tags:["notification-integrations"],url:`${Js}/:id`,method:"PUT",params:n.Object({id:m()}),body:ej,response:qu}),OFe=d({tags:["notification-integrations"],url:`${Js}/:id`,method:"DELETE",params:n.Object({id:m()}),response:D}),AFe=d({tags:["notification-rules"],url:`${Ut}/:id/notifications`,method:"GET",params:n.Object({id:m()}),query:n.Optional(n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number())})),response:n.Object({notifications:n.Array(n.Object({id:n.String(),monitorId:n.String(),monitorResultId:n.String(),ruleId:n.Optional(n.String()),targetId:n.Optional(n.String()),status:n.Enum(L1),tryCount:n.Number(),nextTryAt:T(),createdAt:T(),updatedAt:T(),sentAt:n.Optional(T())})),isTruncated:n.Boolean()})}),tj=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast"],SFe=d({tags:["notification-rules"],url:`${$n}/test`,method:"POST",body:n.Object({notificationRule:ia,targetIds:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:n.Union([n.Object({success:n.Literal(!1),overallMessage:n.String({description:"Message when there is an overall error"})}),n.Object({success:n.Boolean(),results:n.Array(n.Object({targetId:n.String({description:"The ID of the target that was tested"}),targetType:n.Enum(tj,{description:"The type of the target (e.g., slack, webhook)"}),status:n.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:n.Optional(n.String({description:"Message if the notification failed for this specific target"}))}))})])});var aa=`/${"v1"}/notification-rules`,sa=n.Pick(Go,["id","name","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Rules to trigger notifications to targets based on alert events"}),rj={id:"123-456-abc",name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(sa,{examples:[rj]});var kb=d({description:"Retrieve all notification rules",operationId:"listNotificationRules",tags:["notification-rules"],url:aa,method:"GET",paginated:!0,query:n.Object(ee),response:n.Array(sa)}),Mb=d({description:"Retrieve a notification rule by its id",operationId:"getNotificationRule",tags:["notification-rules"],url:`${aa}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:sa}),Hu=n.Pick(ia,["name","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","tags","isActive","targets"]),nj={name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(Hu,{examples:[nj]});var wb=d({description:"Create a new notification rule",operationId:"createNotificationRule",tags:["notification-rules"],url:aa,method:"POST",body:Hu,response:sa}),Db=d({description:"Update a notification rule by its id",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${aa}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Hu,response:sa}),oj=n.Object({id:m({allowEmpty:!1,description:"The notification rule ID to delete"})}),$b=d({description:"Delete a notification rule by its id",operationId:"deleteNotificationRule",tags:["notification-rules"],url:`${aa}/:id`,method:"DELETE",params:oj,response:D});var vo=`${oa}/silences`,Gb=n.Union([n.Literal("monday"),n.Literal("tuesday"),n.Literal("wednesday"),n.Literal("thursday"),n.Literal("friday"),n.Literal("saturday"),n.Literal("sunday")]),ij=n.Partial(n.Record(Gb,n.Array(n.Object({startTime:n.String({format:_c}),endTime:n.String({format:_c})},{title:"SilenceTimeRange"}),{minItems:1,description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),aj=n.Partial(n.Record(Gb,n.Array(n.Object({startTime:n.String(),endTime:n.String()},{title:"SilenceTimeRange"}),{description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),ep='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',vb="One-time silence schedule with specific start and end times",jb="Recurring weekly silence schedule",sj=S("type",[n.Object({type:n.Literal("one-time"),startTime:n.String({format:hc}),endTime:n.String({format:hc}),timeZone:n.Optional(n.String({format:Tc,description:ep}))},{$id:"InputSilenceScheduleOneTime",description:vb}),n.Object({type:n.Literal("recurring"),weeklySchedule:ij,timeZone:n.Optional(n.String({format:Tc,description:ep}))},{$id:"InputSilenceScheduleRecurring",description:jb})],{description:"Schedule defining when the silence is active"}),pj=S("type",[n.Object({type:n.Literal("one-time"),startTime:n.String(),endTime:n.String(),timeZone:n.Optional(n.String({description:ep}))},{$id:"OutputSilenceScheduleOneTime",description:vb}),n.Object({type:n.Literal("recurring"),weeklySchedule:aj,timeZone:n.Optional(n.String({description:ep}))},{$id:"OutputSilenceScheduleRecurring",description:jb})],{description:"Schedule defining when the silence is active"}),tp=n.Object({name:m({description:"Display name of the silence"}),reason:m({allowEmpty:!1,description:"Reason for the silence"}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:Ze,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:sj,notificationRuleIds:n.Optional(n.Array(m(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(m({type:"tags-query",description:"Query string to filter which alerts this silence applies to"})),teamsFilter:Fu,prioritiesFilter:n.Array(n.Enum(Pt),{maxItems:Pt.length,description:"Monitor priorities to filter which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(Dn),{maxItems:Dn.length,description:"Transition types to filter which alerts this silence applies to"})}),jo=n.Object({id:n.String({description:"Unique identifier of the silence"}),name:n.String({description:"Display name of the silence"}),reason:n.String({description:"Reason for the silence"}),owner:n.String({description:"Team ID that owns and manages the silence"}),tags:Ve,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:pj,notificationRuleIds:n.Optional(n.Array(n.String(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(n.String({description:"Query string filtering which alerts this silence applies to"})),teamsFilter:ju,prioritiesFilter:n.Array(n.Enum(Pt),{description:"Monitor priorities filtering which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(Dn),{description:"Transition types filtering which alerts this silence applies to"}),createdAt:T(),updatedAt:T(),creator:n.Optional(Ce),updater:n.Optional(Ce)}),BFe=d({tags:["notification-silences"],url:vo,method:"GET",response:n.Array(jo)}),qFe=d({tags:["notification-silences"],url:`${vo}/:id`,params:n.Object({id:m()}),method:"GET",response:jo}),HFe=d({tags:["notification-silences"],url:vo,method:"POST",body:tp,response:jo}),KFe=d({tags:["notification-silences"],url:`${vo}/:id`,method:"PUT",params:n.Object({id:m()}),body:tp,response:jo}),zFe=d({tags:["notification-silences"],url:`${vo}/:id`,method:"DELETE",params:n.Object({id:m()}),response:D}),VFe=d({tags:["notification-silences"],url:`${vo}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(m())}),response:n.Object({})});var pa=`/${"v1"}/notification-silences`,rp=n.Pick(jo,["id","name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{$id:"NotificationSilence",description:"Silences to suppress notifications based on schedules and filters"}),Fb=d({description:"Retrieve all notification silences",operationId:"listNotificationSilences",tags:["notification-silences"],url:pa,method:"GET",response:n.Array(rp)}),Bb=d({description:"Retrieve a notification silence by its id",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${pa}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:rp}),qb=n.Pick(tp,["name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"]),Hb=d({description:"Create a new notification silence",operationId:"createNotificationSilence",tags:["notification-silences"],url:pa,method:"POST",body:qb,response:rp}),Kb=d({description:"Update a notification silence by its id",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${pa}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:qb,response:rp}),cj=n.Object({id:m({allowEmpty:!1,description:"The notification silence ID to delete"})}),zb=d({description:"Delete a notification silence by its id",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${pa}/:id`,method:"DELETE",params:cj,response:D});var mj=["passed","failed","ignored"],uj=n.Enum(mj),Vb=["unrouted-logs","no-over-routed-logs","team-has-route","service-name-present","no-orphan-spans","metric-unit-consistency","host-name-present","inconsistent-attribute-naming","no-duplicate-attr-values","no-debug-logs-in-prod","no-multiline-logs","no-empty-dashboards","monitor-has-notification","no-future-dated-logs","metric-usage","no-stale-dashboards","no-unused-dashboards","no-orphan-monitors","no-flapping-monitors","no-noisy-group-monitors","no-long-alert-monitors","no-redundant-monitors","no-absent-log-fields","k8s-recommended-attributes","k8s-recommended-metrics","k8s-recommended-change-events","use-standard-attributes","no-unused-operation-api-keys","no-unused-ingestion-api-keys"],lj=n.Enum(Vb),dj=["log","metric","resource","span"],fj=["team","global"],zu=n.Object({key:n.Enum(Vb),title:n.String(),summary:n.String(),rationale:n.String(),objectType:n.Enum(dj),category:n.Enum(["hygiene","routing","integrity","consistency","redundancy","cost"]),impact:n.Object({label:n.Enum(["critical","important","normal"]),weight:n.Number()}),recommendation:n.String(),scope:n.Optional(n.Enum(fj))}),Ku=n.Intersect([zu,n.Object({status:uj,normalizedScore:n.Number(),details:n.Optional(n.Record(n.String(),n.Unknown())),recommendation:n.Optional(n.String()),examples:n.Optional(n.Array(n.Object({type:n.String(),label:n.String(),link:n.Object({to:n.String(),search:n.Optional(n.Unknown()),params:n.Optional(n.Unknown())})})))})]),np=n.Object({generatedAt:n.String(),overallScore:n.Optional(n.Number()),rules:n.Array(zu),teamResults:n.Array(n.Object({teamId:n.String(),teamName:n.String(),teamWeight:n.Number(),score:n.Number(),weightedScore:n.Number(),totalWeight:n.Number(),ruleResults:n.Array(Ku)})),globalResults:n.Optional(n.Object({score:n.Optional(n.Number()),ruleResults:n.Array(Ku)}))}),iBe=d({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:np}),aBe=d({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:n.Object({clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({report:n.Optional(np)})}),sBe=d({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:n.Object({ruleKey:lj,teamId:m(),lookbackMinutes:n.Optional(n.Integer({minimum:1,maximum:60})),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({rule:zu,result:Ku,teamId:n.String(),teamName:n.String()})});var gj=`/${"v1"}/quality-reports`,Yb=n.Pick(np,["generatedAt","overallScore","rules","teamResults","globalResults"],{$id:"QualityReport",description:"Aggregated quality report with per-team rule evaluations and scores"}),yj={generatedAt:"2026-02-26T12:00:00.000Z",overallScore:.85,rules:[{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"resource",category:"routing",impact:{label:"important",weight:2},recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."}],teamResults:[{teamId:"abc-123-def",teamName:"platform",teamWeight:1,score:.85,weightedScore:.85,totalWeight:2,ruleResults:[{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"resource",category:"routing",impact:{label:"important",weight:2},recommendation:"Ensure every team manages a dedicated route scoped to its context.team value.",status:"passed",normalizedScore:1}]}]};Object.assign(Yb,{examples:[yj]});var Ej=n.Object({clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),Qb=d({description:"Retrieve the latest quality report",operationId:"getLatestQualityReport",tags:["quality-reports"],url:`${gj}/latest`,method:"GET",query:Ej,response:n.Object({report:n.Optional(Yb)})});var ca="/v0/admin-center";var tr=`${ca}/retention-policies`,Ij=3650,Tj=n.Integer(),Wb=n.Integer({minimum:1,maximum:Ij}),_r=n.Object({id:n.String(),env:n.Optional(n.String()),teamId:n.Optional(n.String()),dataSource:n.Enum($t),durationDays:Tj,isEnabled:n.Boolean(),createdAt:T(),updatedAt:T()}),op=n.Object({env:n.Optional(m()),teamId:n.Optional(m()),dataSource:n.Enum($t),durationDays:Wb,isEnabled:n.Boolean()}),Zb=n.Array(n.Object({env:m(),dataSource:n.Enum($t),durationDays:n.Union([Wb,n.Null()]),isEnabled:n.Boolean()})),Xb=n.Object({inserted:n.Array(_r),updated:n.Array(_r),deleted:n.Array(_r)}),OBe=d({tags:["retention-policies"],url:tr,method:"POST",body:op,response:_r}),ABe=d({tags:["retention-policies"],url:tr,method:"GET",response:n.Array(_r)}),SBe=d({tags:["retention-policies"],url:`${tr}/:id`,method:"GET",params:n.Object({id:m()}),response:_r}),bBe=d({tags:["retention-policies"],url:`${tr}/:id`,method:"PUT",params:n.Object({id:m()}),body:op,response:_r}),xBe=d({tags:["retention-policies"],url:`${tr}/bulk-update`,method:"POST",body:Zb,response:Xb}),RBe=d({tags:["retention-policies"],url:`${tr}/bulk-update-for-team`,method:"POST",body:n.Object({teamId:m(),policies:Zb}),response:Xb}),CBe=d({tags:["retention-policies"],url:`${tr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:D}),ma=["past-24-hours","past-7-days","past-30-days"],PBe=d({tags:["retention-policies"],url:`${tr}/requested-history-percentile/:teamId`,method:"POST",params:n.Object({teamId:m()}),body:n.Object({percentile:n.Number({minimum:0,maximum:1}),observationWindow:n.Enum(ma),dataSource:n.Enum($t)}),response:n.Object({percentile:n.Number(),observationWindow:n.Enum(ma),dataSource:n.Enum($t),teamId:n.String(),requestedHistoryDays:n.Number()})}),_j=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var hj=n.Array(n.Object({bucket:n.Enum(_j),count:n.Number()})),UBe=d({tags:["retention-policies"],url:`${tr}/requested-history-histogram/:teamId`,method:"POST",params:n.Object({teamId:m()}),body:n.Object({observationWindow:n.Enum(ma),dataSource:n.Enum($t)}),response:n.Object({observationWindow:n.Enum(ma),dataSource:n.Enum($t),teamId:n.String(),histogram:hj})}),NBe=d({tags:["retention-policies"],url:`${tr}/top-teams-with-retention-surplus`,method:"POST",body:n.Object({dataSource:n.Enum($t),observationWindow:n.Enum(ma),percentile:n.Number({minimum:0,maximum:1}),topN:n.Optional(n.Number({minimum:1,maximum:20}))}),response:n.Array(n.Object({teamId:n.String(),retentionSurplusDays:n.Number()}))});var ua=`/${"v1"}/retention-policies`,la=n.Pick(_r,["id","env","teamId","dataSource","durationDays","isEnabled"],{$id:"RetentionPolicy",description:"Data retention rule for a data source within an environment"}),Oj={id:"123-456-abc",env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(la,{examples:[Oj]});var Jb=d({description:"Retrieve all retention policies",operationId:"listRetentionPolicies",tags:["retention-policies"],url:ua,method:"GET",response:n.Array(la)}),ex=d({description:"Retrieve a retention policy by its id",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${ua}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:la}),Vu=n.Pick(op,["env","teamId","dataSource","durationDays","isEnabled"]),Aj={env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(Vu,{examples:[Aj]});var tx=d({description:"Create a new retention policy",operationId:"createRetentionPolicy",tags:["retention-policies"],url:ua,method:"POST",body:Vu,response:la}),rx=d({description:"Update a retention policy by its id",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${ua}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Vu,response:la}),nx=d({description:"Delete a retention policy by its id",operationId:"deleteRetentionPolicy",tags:["retention-policies"],url:`${ua}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:D});var ip={id:n.String({description:"Identifier of the processor"}),description:n.Optional(n.String()),tags:Ve,updatedAt:n.Optional(T())},ap={id:m({allowEmpty:!1,description:"Identifier of the processor"}),description:n.Optional(m({type:"long"})),tags:Ze,updatedAt:n.Optional(T())},Sj={...ip,type:n.Literal("creator")},bj={...ap,type:n.Literal("creator")},xj=S("subtype",[n.Object({targetAttribute:n.String({description:"Attribute that will receive the formatted value"}),formatString:n.String({description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean()),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean())},{$id:"ProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the computed value"}),formula:n.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean()),subtype:n.Literal("math-formula"),replaceMissingBy0:n.Optional(n.Boolean())},{$id:"ProcessorParamsCreatorMathFormula"})]),Rj=S("subtype",[n.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:m({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean())},{$id:"InputProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:m({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("math-formula"),replaceMissingBy0:n.Optional(n.Boolean())},{$id:"InputProcessorParamsCreatorMathFormula"})]),Cj=n.Object({...Sj,params:xj}),Pj=n.Object({...bj,params:Rj}),Uj={...ip,type:n.Literal("mapper")},Nj={...ap,type:n.Literal("mapper")},Lj=S("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:n.String({description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean()),overrideTarget:n.Optional(n.Boolean()),targetAttribute:n.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")},{$id:"ProcessorParamsMapperMapAttributes"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level")},{$id:"ProcessorParamsMapperMapLevel"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp")},{$id:"ProcessorParamsMapperMapTimestamp"})]),kj=S("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:m({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:n.Optional(n.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:m({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")},{$id:"InputProcessorParamsMapperMapAttributes"}),n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level")},{$id:"InputProcessorParamsMapperMapLevel"}),n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp")},{$id:"InputProcessorParamsMapperMapTimestamp"})]),Mj=n.Object({...Nj,params:kj}),wj=n.Object({...Uj,params:Lj}),Dj={...ip,type:n.Literal("parse-attribute")},$j={...ap,type:n.Literal("parse-attribute")},Gj=5,vj=S("subtype",[n.Object({attributeName:n.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(n.String({description:"Grok rule applied to parse text"}),{description:"Ordered Grok rules evaluated until one matches"}),samples:n.Optional(n.Array(n.String(),{description:"Example log lines for validation"})),subtype:n.Literal("grok")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the URL to parse"}),subtype:n.Literal("url")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:n.String({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:n.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:n.String({description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:n.Boolean(),subtype:n.Literal("key-value")})]),jj=S("subtype",[n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(m({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text"}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches"}),samples:n.Optional(n.Array(m({type:"long"}),{maxItems:Gj,description:"Example log lines for validation"})),subtype:n.Literal("grok")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:n.Literal("url")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:m({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:m({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:m({allowEmpty:!0,description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:n.Boolean(),subtype:n.Literal("key-value")})]),Fj=n.Object({...Dj,params:vj}),Bj=n.Object({...$j,params:jj}),qj=11,ox=n.Cyclic({OutputProcessor:n.Union([wj,Fj,Cj,n.Object({...ip,params:n.Object({items:n.Array(n.Object({query:n.String({description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split")})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),ix=n.Cyclic({InputProcessor:n.Union([Mj,Bj,Pj,n.Object({...ap,params:n.Object({items:n.Array(n.Object({query:m({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:qj,description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split")})])},"InputProcessor",{description:"Processing step executed sequentially on route logs"});var Hj="/v0/logs",Xr=`${Hj}/routes`,Gn=n.Object({id:n.String({description:"Identifier of the log route"}),name:n.String({description:"Human readable name shown for the route"}),description:n.Optional(n.String()),isEnabled:n.Boolean(),query:n.String({description:"Query that selects which logs should enter the route"}),rank:n.Number(),tags:Ve,owner:n.String({description:"Team ID owning and managing the route"}),processors:n.Array(ox,{description:"Ordered processors applied to logs that match the route"}),creator:n.Optional(Ce),updater:n.Optional(Ce),updatedAt:T(),createdAt:T(),assetUpdatedAt:T()},{title:"Route"}),da=n.Object({name:m({allowEmpty:!1,description:"Human readable name shown for the route"}),description:n.Optional(m({type:"long"})),isEnabled:n.Boolean(),query:m({type:"tsuga-query",description:"Query that selects which logs should enter the route"}),tags:Ze,owner:m({allowEmpty:!1,description:"Team ID owning and managing the route"}),processors:n.Array(ix,{maxItems:50,description:"Ordered processors applied to logs that match the route"})}),XBe=d({tags:["routes"],url:Xr,method:"GET",paginated:!0,query:n.Object(ee),response:n.Array(Gn)}),JBe=d({tags:["routes"],url:`${Xr}/:id`,params:n.Object({id:m()}),method:"GET",response:Gn}),eqe=d({tags:["routes"],url:Xr,method:"POST",body:da,response:Gn}),tqe=d({tags:["routes"],url:`${Xr}/:id`,method:"PUT",body:da,params:n.Object({id:m()}),response:Gn}),rqe=d({tags:["routes"],url:`${Xr}/:id/clone`,method:"POST",params:n.Object({id:m()}),body:da,response:Gn}),nqe=d({tags:["routes"],url:`${Xr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:D}),oqe=d({tags:["routes"],url:`${Xr}/:id/modify-ranking`,method:"PUT",params:n.Object({id:m()}),body:n.Object({rank:n.Number()}),response:n.Object({})}),iqe=d({tags:["routes"],url:`${Xr}/:id/enable`,method:"PUT",params:n.Object({id:m()}),body:n.Object({enable:n.Boolean()}),response:n.Object({})});var fa=`/${"v1"}/routes`,ga=n.Pick(Gn,["id","name","description","isEnabled","query","tags","owner","processors"],{$id:"Route",description:"Log route allowing to standardize logs and enrich them with additional data"}),Kj={id:"123-456-abc",name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(ga,{examples:[Kj]});var ax=d({description:"Retrieve all routes",operationId:"listRoutes",tags:["routes"],url:fa,method:"GET",paginated:!0,query:n.Object(ee),response:n.Array(ga)}),sx=d({description:"Retrieve a route by its id",operationId:"getRoute",tags:["routes"],url:`${fa}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:ga}),Yu=n.Pick(da,["name","description","isEnabled","query","tags","owner","processors"]),zj={name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(Yu,{examples:[zj]});var px=d({description:"Create a new route",operationId:"createRoute",tags:["routes"],url:fa,method:"POST",body:Yu,response:ga}),cx=d({description:"Update a route by its id",operationId:"updateRoute",tags:["routes"],url:`${fa}/:id`,method:"PUT",body:Yu,params:n.Object({id:m({allowEmpty:!1})}),response:ga}),mx=d({description:"Delete a route by its id",operationId:"deleteRoute",tags:["routes"],url:`${fa}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:D});var vn=`${ca}/tag-policies`;var ux=["ingestion-api-key","operation-api-key","dashboard","log-route","monitor","notification-rule","notification-silence","slo"],Vj=["logs","metrics","traces"],Qu=n.Array(n.Enum(ux)),Wu=n.Array(n.Enum(Vj)),Yj=n.Union([Qu,Wu]),Qj=n.Object({teamIds:n.Array(n.String()),mode:n.Enum(["include","exclude"])}),Wj=S("type",[n.Object({type:n.Literal("telemetry"),assetTypes:Wu,shouldInsertWarning:n.Boolean(),dropSample:n.Optional(n.Number())}),n.Object({type:n.Literal("tsuga_asset"),assetTypes:Qu})]),Zj=S("type",[n.Object({type:n.Literal("telemetry"),assetTypes:Wu,shouldInsertWarning:n.Boolean(),dropSample:n.Optional(n.Number({minimum:0,maximum:100}))}),n.Object({type:n.Literal("tsuga_asset"),assetTypes:Qu})]),Fo=n.Object({id:n.String(),name:n.String(),description:n.Optional(n.String()),isActive:n.Boolean(),tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean(),teamScope:n.Optional(Qj),configuration:Wj,creator:n.Optional(Ce),updater:n.Optional(Ce),owner:n.Optional(n.String()),createdAt:T(),updatedAt:T(),assetUpdatedAt:T()});var ya=n.Object({name:m(),description:n.Optional(m()),isActive:n.Boolean(),tagKey:m({allowEmpty:!1}),allowedTagValues:n.Array(m({allowEmpty:!1}),{maxItems:1e3}),isRequired:n.Boolean(),teamScope:n.Optional(n.Object({teamIds:n.Array(m(),{minItems:1,maxItems:100}),mode:n.Enum(["include","exclude"])})),configuration:Zj,owner:m({allowEmpty:!1})}),_qe=d({tags:["tag-policies"],url:vn,method:"GET",query:n.Object({teamIds:n.Optional(n.Array(m(),{maxItems:100})),assetTypes:n.Optional(Yj),searchQuery:n.Optional(m())}),response:n.Array(Fo)}),hqe=d({tags:["tag-policies"],url:`${vn}/:id`,method:"GET",params:n.Object({id:m()}),response:Fo}),Oqe=d({tags:["tag-policies"],url:vn,method:"POST",body:ya,response:Fo}),Aqe=d({tags:["tag-policies"],url:`${vn}/:id`,method:"PUT",params:n.Object({id:m()}),body:ya,response:Fo}),Sqe=d({tags:["tag-policies"],url:`${vn}/:id`,method:"DELETE",params:n.Object({id:m()}),response:D}),bqe=d({tags:["tag-policies"],url:`${ca}/applicable-tag-rules`,method:"GET",query:n.Object({assetType:n.Enum(ux),teamId:m()}),response:n.Array(n.Object({tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean()}))}),lx=n.Object({total:n.Number(),totalNonCompliant:n.Number(),idsNonCompliant:n.Array(n.String())}),dx=n.Union([n.Literal("ingestion-api-key"),n.Literal("operation-api-key"),n.Literal("dashboard"),n.Literal("log-route"),n.Literal("monitor"),n.Literal("notification-rule"),n.Literal("notification-silence"),n.Literal("slo")]),Xj=n.Object({total:n.Number(),totalNonCompliant:n.Number(),byAssetType:n.Record(dx,lx)}),Jj=n.Omit(lx,["total"]),eF=n.Object({totalNonCompliant:n.Number(),byAssetType:n.Record(dx,Jj)}),fx=n.Object({totals:Xj,byTeam:n.Record(n.String(),eF)}),xqe=d({tags:["tag-policies"],url:`${vn}/:id/stats`,method:"GET",params:n.Object({id:m()}),response:fx}),Rqe=d({tags:["tag-policies"],url:`${vn}/new-policy-stats`,method:"POST",body:ya,response:fx});var Ea=`/${"v1"}/tag-policies`,sp=n.Pick(Fo,["id","name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{$id:"TagPolicy",description:"Policy that enforces tag requirements on Tsuga assets or telemetry data"}),gx=n.Pick(ya,["name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"]),yx=d({description:"Retrieve all tag policies",operationId:"listTagPolicies",tags:["tag-policies"],url:Ea,method:"GET",response:n.Array(sp)}),Ex=d({description:"Retrieve a tag policy by its id",operationId:"getTagPolicy",tags:["tag-policies"],url:`${Ea}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:sp}),Ix=d({description:"Create a new tag policy",operationId:"createTagPolicy",tags:["tag-policies"],url:Ea,method:"POST",body:gx,response:sp}),Tx=d({description:"Update a tag policy by its id",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${Ea}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:gx,response:sp}),_x=d({description:"Delete a tag policy by its id",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${Ea}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:D});var Ia=`/${"v1"}/teams`,Ta=n.Pick(No,["id","name","description","visibility","tags"],{$id:"Team",description:"Collection of users used to manage ownership and access to resources"}),tF={id:"abc-123-def",name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(Ta,{examples:[tF]});var hx=d({description:"Retrieve all teams",operationId:"listTeams",tags:["teams"],url:Ia,method:"GET",paginated:!0,query:n.Object(ee),response:n.Array(Ta)}),Ox=d({description:"Retrieve a team by its id",operationId:"getTeam",tags:["teams"],url:`${Ia}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Ta}),Zu=n.Pick($s,["name","description","visibility","tags"]),rF={name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(Zu,{examples:[rF]});var Ax=d({description:"Create a new team",operationId:"createTeam",tags:["teams"],url:Ia,method:"POST",body:Zu,response:Ta}),Sx=d({description:"Update a team by its id",operationId:"updateTeam",tags:["teams"],url:`${Ia}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Zu,response:Ta}),bx=d({description:"Delete a team by its id",operationId:"deleteTeam",tags:["teams"],url:`${Ia}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:D});function Xu(e){let t=e.params;if(t?.properties){let r=Object.keys(t.properties);if(r.length===1&&r[0])return r[0]}return"id"}function xx(e,t,r){let o=e.command(t.commandName).description(t.description),i=WS(t.commandName).replace(/-/g," "),a=o.command("list").description(`List all ${t.commandName}`);if(t.listOptions)for(let p of t.listOptions)a.option(p.flag,p.description);if(t.enableListBody?a.option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async p=>{if(p.generateSkeleton){ne(Ro(t.endpoints.list));return}let u=await r()(t.endpoints.list,{body:p.data?Co({data:p.data}):{}});ne(u)}):a.action(async p=>{let u={};if(t.listOptions)for(let f of t.listOptions){let y=p[f.queryParam];y!==void 0&&(u[f.queryParam]=y)}let l=await r()(t.endpoints.list,Object.keys(u).length>0?{query:u}:void 0);ne(l)}),t.endpoints.get){let p=t.endpoints.get,u=Xu(p);o.command("get <id>").description(`Get a ${i} by ID`).action(async l=>{let f=await r()(p,{params:{[u]:l}});ne(f)})}if(t.endpoints.create){let p=t.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async u=>{if(u.generateSkeleton){ne(Ro(p));return}let l=Co(u),f=await r()(p,{body:l});ne(f)})}if(t.endpoints.update){let p=t.endpoints.update,u=Xu(p);o.command("update <id>").description(`Update a ${i} by ID`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async(l,f)=>{if(f.generateSkeleton){ne(Ro(p));return}let y=Co(f),I=await r()(p,{params:{[u]:l},body:y});ne(I)})}if(t.endpoints.delete){let p=t.endpoints.delete,u=Xu(p);o.command("delete <id>").description(`Delete a ${i} by ID`).action(async l=>{let f=await r()(p,{params:{[u]:l}});ne(f)})}}var nF=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:BS}},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:bS,get:xS,create:RS,update:CS,delete:PS},enableListBody:!0},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",endpoints:{list:MS,create:wS,update:DS,delete:$S}},{commandName:"investigations",description:"Manage investigations (beta)",endpoints:{list:qS,get:HS,create:KS,update:zS,delete:VS}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:Ib,get:Tb,create:bb,update:xb,delete:Rb},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:kb,get:Mb,create:wb,update:Db,delete:$b}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:Fb,get:Bb,create:Hb,update:Kb,delete:zb}},{commandName:"quality-reports",description:"Manage quality reports",endpoints:{list:Qb}},{commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:Jb,get:ex,create:tx,update:rx,delete:nx}},{commandName:"routes",description:"Manage routes",endpoints:{list:ax,get:sx,create:px,update:cx,delete:mx}},{commandName:"services",description:"Manage services",endpoints:{list:VA,get:YA}},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:yx,get:Ex,create:Ix,update:Tx,delete:_x}},{commandName:"teams",description:"Manage teams",endpoints:{list:hx,get:Ox,create:Ax,update:Sx,delete:bx}}];function Rx(e,t){for(let r of nF)xx(e,r,t)}var rr=require("node:fs"),ol=require("node:os"),qo=require("node:path");function oF(e,t){let r=e.slice(0,t).split(/\r\n|\n|\r/g);return[r.length,r.pop().length+1]}function iF(e,t,r){let o=e.split(/\r\n|\n|\r/g),i="",a=(Math.log10(t+1)|0)+1;for(let p=t-1;p<=t+1;p++){let u=o[p-1];u&&(i+=p.toString().padEnd(a," "),i+=": ",i+=u,i+=`
43
45
  `,p===t&&(i+=" ".repeat(a+r+2),i+=`^
44
- `))}return i}var q=class extends Error{line;column;codeblock;constructor(t,r){let[o,i]=Ij(r.toml,r.ptr),a=Tj(r.toml,o,i);super(`Invalid TOML document: ${t}
46
+ `))}return i}var H=class extends Error{line;column;codeblock;constructor(t,r){let[o,i]=oF(r.toml,r.ptr),a=iF(r.toml,o,i);super(`Invalid TOML document: ${t}
45
47
 
46
- ${a}`,r),this.line=o,this.column=i,this.codeblock=a}};function _j(e,t){let r=0;for(;e[t-++r]==="\\";);return--r&&r%2}function tp(e,t=0,r=e.length){let o=e.indexOf(`
47
- `,t);return e[o-1]==="\r"&&o--,o<=r?o:-1}function Go(e,t){for(let r=t;r<e.length;r++){let o=e[r];if(o===`
48
+ ${a}`,r),this.line=o,this.column=i,this.codeblock=a}};function aF(e,t){let r=0;for(;e[t-++r]==="\\";);return--r&&r%2}function pp(e,t=0,r=e.length){let o=e.indexOf(`
49
+ `,t);return e[o-1]==="\r"&&o--,o<=r?o:-1}function Bo(e,t){for(let r=t;r<e.length;r++){let o=e[r];if(o===`
48
50
  `)return r;if(o==="\r"&&e[r+1]===`
49
- `)return r+1;if(o<" "&&o!==" "||o==="\x7F")throw new q("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function At(e,t,r,o){let i;for(;;){for(;(i=e[t])===" "||i===" "||!r&&(i===`
51
+ `)return r+1;if(o<" "&&o!==" "||o==="\x7F")throw new H("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function St(e,t,r,o){let i;for(;;){for(;(i=e[t])===" "||i===" "||!r&&(i===`
50
52
  `||i==="\r"&&e[t+1]===`
51
- `);)t++;if(o||i!=="#")break;t=Go(e,t)}return t}function ox(e,t,r,o,i=!1){if(!o)return t=tp(e,t),t<0?e.length:t;for(let a=t;a<e.length;a++){let p=e[a];if(p==="#")a=tp(e,a);else{if(p===r)return a+1;if(p===o||i&&(p===`
53
+ `);)t++;if(o||i!=="#")break;t=Bo(e,t)}return t}function Cx(e,t,r,o,i=!1){if(!o)return t=pp(e,t),t<0?e.length:t;for(let a=t;a<e.length;a++){let p=e[a];if(p==="#")a=pp(e,a);else{if(p===r)return a+1;if(p===o||i&&(p===`
52
54
  `||p==="\r"&&e[a+1]===`
53
- `))return a}}throw new q("cannot find end of structure",{toml:e,ptr:t})}function rp(e,t){let r=e[t],o=r===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):r;t+=o.length-1;do t=e.indexOf(o,++t);while(t>-1&&r!=="'"&&_j(e,t));return t>-1&&(t+=o.length,o.length>1&&(e[t]===r&&t++,e[t]===r&&t++)),t}var hj=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,ga=class e extends Date{#t=!1;#r=!1;#e=null;constructor(t){let r=!0,o=!0,i="Z";if(typeof t=="string"){let a=t.match(hj);a?(a[1]||(r=!1,t=`0000-01-01T${t}`),o=!!a[2],o&&t[10]===" "&&(t=t.replace(" ","T")),a[2]&&+a[2]>23?t="":(i=a[3]||null,t=t.toUpperCase(),!i&&o&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=r,this.#r=o,this.#e=i)}isDateTime(){return this.#t&&this.#r}isLocal(){return!this.#t||!this.#r||!this.#e}isDate(){return this.#t&&!this.#r}isTime(){return this.#r&&!this.#t}isValid(){return this.#t||this.#r}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let r=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return r=this.#e[0]==="-"?r:-r,new Date(this.getTime()-r*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,r="Z"){let o=new e(t);return o.#e=r,o}static wrapAsLocalDateTime(t){let r=new e(t);return r.#e=null,r}static wrapAsLocalDate(t){let r=new e(t);return r.#r=!1,r.#e=null,r}static wrapAsLocalTime(t){let r=new e(t);return r.#t=!1,r.#e=null,r}};var Oj=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,Aj=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,Sj=/^[+-]?0[0-9_]/,bj=/^[0-9a-f]{2,8}$/i,ix={b:"\b",t:" ",n:`
54
- `,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function np(e,t=0,r=e.length){let o=e[t]==="'",i=e[t++]===e[t]&&e[t]===e[t+1];i&&(r-=2,e[t+=2]==="\r"&&t++,e[t]===`
55
+ `))return a}}throw new H("cannot find end of structure",{toml:e,ptr:t})}function cp(e,t){let r=e[t],o=r===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):r;t+=o.length-1;do t=e.indexOf(o,++t);while(t>-1&&r!=="'"&&aF(e,t));return t>-1&&(t+=o.length,o.length>1&&(e[t]===r&&t++,e[t]===r&&t++)),t}var sF=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,_a=class e extends Date{#t=!1;#r=!1;#e=null;constructor(t){let r=!0,o=!0,i="Z";if(typeof t=="string"){let a=t.match(sF);a?(a[1]||(r=!1,t=`0000-01-01T${t}`),o=!!a[2],o&&t[10]===" "&&(t=t.replace(" ","T")),a[2]&&+a[2]>23?t="":(i=a[3]||null,t=t.toUpperCase(),!i&&o&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=r,this.#r=o,this.#e=i)}isDateTime(){return this.#t&&this.#r}isLocal(){return!this.#t||!this.#r||!this.#e}isDate(){return this.#t&&!this.#r}isTime(){return this.#r&&!this.#t}isValid(){return this.#t||this.#r}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let r=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return r=this.#e[0]==="-"?r:-r,new Date(this.getTime()-r*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,r="Z"){let o=new e(t);return o.#e=r,o}static wrapAsLocalDateTime(t){let r=new e(t);return r.#e=null,r}static wrapAsLocalDate(t){let r=new e(t);return r.#r=!1,r.#e=null,r}static wrapAsLocalTime(t){let r=new e(t);return r.#t=!1,r.#e=null,r}};var pF=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,cF=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,mF=/^[+-]?0[0-9_]/,uF=/^[0-9a-f]{2,8}$/i,Px={b:"\b",t:" ",n:`
56
+ `,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function mp(e,t=0,r=e.length){let o=e[t]==="'",i=e[t++]===e[t]&&e[t]===e[t+1];i&&(r-=2,e[t+=2]==="\r"&&t++,e[t]===`
55
57
  `&&t++);let a=0,p,u="",l=t;for(;t<r-1;){let f=e[t++];if(f===`
56
58
  `||f==="\r"&&e[t]===`
57
- `){if(!i)throw new q("newlines are not allowed in strings",{toml:e,ptr:t-1})}else if(f<" "&&f!==" "||f==="\x7F")throw new q("control characters are not allowed in strings",{toml:e,ptr:t-1});if(p){if(p=!1,f==="x"||f==="u"||f==="U"){let y=e.slice(t,t+=f==="x"?2:f==="u"?4:8);if(!bj.test(y))throw new q("invalid unicode escape",{toml:e,ptr:a});try{u+=String.fromCodePoint(parseInt(y,16))}catch{throw new q("invalid unicode escape",{toml:e,ptr:a})}}else if(i&&(f===`
58
- `||f===" "||f===" "||f==="\r")){if(t=At(e,t-1,!0),e[t]!==`
59
- `&&e[t]!=="\r")throw new q("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});t=At(e,t)}else if(f in ix)u+=ix[f];else throw new q("unrecognized escape sequence",{toml:e,ptr:a});l=t}else!o&&f==="\\"&&(a=t-1,p=!0,u+=e.slice(l,a))}return u+e.slice(l,r-1)}function ax(e,t,r,o){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return o?0n:0;let i=Oj.test(e);if(i||Aj.test(e)){if(Sj.test(e))throw new q("leading zeroes are not allowed",{toml:t,ptr:r});e=e.replace(/_/g,"");let p=+e;if(isNaN(p))throw new q("invalid number",{toml:t,ptr:r});if(i){if((i=!Number.isSafeInteger(p))&&!o)throw new q("integer value cannot be represented losslessly",{toml:t,ptr:r});(i||o===!0)&&(p=BigInt(e))}return p}let a=new ga(e);if(!a.isValid())throw new q("invalid value",{toml:t,ptr:r});return a}function xj(e,t,r){let o=e.slice(t,r),i=o.indexOf("#");return i>-1&&(Go(e,i),o=o.slice(0,i)),[o.trimEnd(),i]}function ya(e,t,r,o,i){if(o===0)throw new q("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let a=e[t];if(a==="["||a==="{"){let[l,f]=a==="["?px(e,t,o,i):sx(e,t,o,i);if(r){if(f=At(e,f),e[f]===",")f++;else if(e[f]!==r)throw new q("expected comma or end of structure",{toml:e,ptr:f})}return[l,f]}let p;if(a==='"'||a==="'"){p=rp(e,t);let l=np(e,t,p);if(r){if(p=At(e,p),e[p]&&e[p]!==","&&e[p]!==r&&e[p]!==`
60
- `&&e[p]!=="\r")throw new q("unexpected character encountered",{toml:e,ptr:p});p+=+(e[p]===",")}return[l,p]}p=ox(e,t,",",r);let u=xj(e,t,p-+(e[p-1]===","));if(!u[0])throw new q("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return r&&u[1]>-1&&(p=At(e,t+u[1]),p+=+(e[p]===",")),[ax(u[0],e,t,i),p]}var Rj=/^[a-zA-Z0-9-_]+[ \t]*$/;function op(e,t,r="="){let o=t-1,i=[],a=e.indexOf(r,t);if(a<0)throw new q("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let p=e[t=++o];if(p!==" "&&p!==" ")if(p==='"'||p==="'"){if(p===e[t+1]&&p===e[t+2])throw new q("multiline strings are not allowed in keys",{toml:e,ptr:t});let u=rp(e,t);if(u<0)throw new q("unfinished string encountered",{toml:e,ptr:t});o=e.indexOf(".",u);let l=e.slice(u,o<0||o>a?a:o),f=tp(l);if(f>-1)throw new q("newlines are not allowed in keys",{toml:e,ptr:t+o+f});if(l.trimStart())throw new q("found extra tokens after the string part",{toml:e,ptr:u});if(a<u&&(a=e.indexOf(r,u),a<0))throw new q("incomplete key-value: cannot find end of key",{toml:e,ptr:t});i.push(np(e,t,u))}else{o=e.indexOf(".",t);let u=e.slice(t,o<0||o>a?a:o);if(!Rj.test(u))throw new q("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});i.push(u.trimEnd())}}while(o+1&&o<a);return[i,At(e,a+1,!0,!0)]}function sx(e,t,r,o){let i={},a=new Set,p;for(t++;(p=e[t++])!=="}"&&p;){if(p===",")throw new q("expected value, found comma",{toml:e,ptr:t-1});if(p==="#")t=Go(e,t);else if(p!==" "&&p!==" "&&p!==`
61
- `&&p!=="\r"){let u,l=i,f=!1,[y,I]=op(e,t-1);for(let fe=0;fe<y.length;fe++){if(fe&&(l=f?l[u]:l[u]={}),u=y[fe],(f=Object.hasOwn(l,u))&&(typeof l[u]!="object"||a.has(l[u])))throw new q("trying to redefine an already defined value",{toml:e,ptr:t});!f&&u==="__proto__"&&Object.defineProperty(l,u,{enumerable:!0,configurable:!0,writable:!0})}if(f)throw new q("trying to redefine an already defined value",{toml:e,ptr:t});let[x,_e]=ya(e,I,"}",r-1,o);a.add(x),l[u]=x,t=_e}}if(!p)throw new q("unfinished table encountered",{toml:e,ptr:t});return[i,t]}function px(e,t,r,o){let i=[],a;for(t++;(a=e[t++])!=="]"&&a;){if(a===",")throw new q("expected value, found comma",{toml:e,ptr:t-1});if(a==="#")t=Go(e,t);else if(a!==" "&&a!==" "&&a!==`
62
- `&&a!=="\r"){let p=ya(e,t-1,"]",r-1,o);i.push(p[0]),t=p[1]}}if(!a)throw new q("unfinished array encountered",{toml:e,ptr:t});return[i,t]}function cx(e,t,r,o){let i=t,a=r,p,u=!1,l;for(let f=0;f<e.length;f++){if(f){if(i=u?i[p]:i[p]={},a=(l=a[p]).c,o===0&&(l.t===1||l.t===2))return null;if(l.t===2){let y=i.length-1;i=i[y],a=a[y].c}}if(p=e[f],(u=Object.hasOwn(i,p))&&a[p]?.t===0&&a[p]?.d)return null;u||(p==="__proto__"&&(Object.defineProperty(i,p,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,p,{enumerable:!0,configurable:!0,writable:!0})),a[p]={t:f<e.length-1&&o===2?3:o,d:!1,i:0,c:{}})}if(l=a[p],l.t!==o&&!(o===1&&l.t===3)||(o===2&&(l.d||(l.d=!0,i[p]=[]),i[p].push(i={}),l.c[l.i++]=l={t:1,d:!1,i:0,c:{}}),l.d))return null;if(l.d=!0,o===1)i=u?i[p]:i[p]={};else if(o===0&&u)return null;return[p,i,l.c]}function qu(e,{maxDepth:t=1e3,integersAsBigInt:r}={}){let o={},i={},a=o,p=i;for(let u=At(e,0);u<e.length;){if(e[u]==="["){let l=e[++u]==="[",f=op(e,u+=+l,"]");if(l){if(e[f[1]-1]!=="]")throw new q("expected end of table declaration",{toml:e,ptr:f[1]-1});f[1]++}let y=cx(f[0],o,i,l?2:1);if(!y)throw new q("trying to redefine an already defined table or value",{toml:e,ptr:u});p=y[2],a=y[1],u=f[1]}else{let l=op(e,u),f=cx(l[0],a,p,0);if(!f)throw new q("trying to redefine an already defined table or value",{toml:e,ptr:u});let y=ya(e,l[1],void 0,t,r);f[1][f[0]]=y[0],u=y[1]}if(u=At(e,u,!0),e[u]&&e[u]!==`
63
- `&&e[u]!=="\r")throw new q("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:u});u=At(e,u)}return o}var mx=/^[a-z0-9-_]+$/i;function Ea(e){let t=typeof e;if(t==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return t}function Cj(e){for(let t=0;t<e.length;t++)if(Ea(e[t])!=="object")return!1;return e.length!=0}function Hu(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function Ku(e,t,r,o){if(r===0)throw new Error("Could not stringify the object: maximum object depth exceeded");if(t==="number")return isNaN(e)?"nan":e===1/0?"inf":e===-1/0?"-inf":o&&Number.isInteger(e)?e.toFixed(1):e.toString();if(t==="bigint"||t==="boolean")return e.toString();if(t==="string")return Hu(e);if(t==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(t==="object")return Pj(e,r,o);if(t==="array")return Uj(e,r,o)}function Pj(e,t,r){let o=Object.keys(e);if(o.length===0)return"{}";let i="{ ";for(let a=0;a<o.length;a++){let p=o[a];a&&(i+=", "),i+=mx.test(p)?p:Hu(p),i+=" = ",i+=Ku(e[p],Ea(e[p]),t-1,r)}return i+" }"}function Uj(e,t,r){if(e.length===0)return"[]";let o="[ ";for(let i=0;i<e.length;i++){if(i&&(o+=", "),e[i]===null||e[i]===void 0)throw new TypeError("arrays cannot contain null or undefined values");o+=Ku(e[i],Ea(e[i]),t-1,r)}return o+" ]"}function Nj(e,t,r,o){if(r===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let i="";for(let a=0;a<e.length;a++)i+=`${i&&`
59
+ `){if(!i)throw new H("newlines are not allowed in strings",{toml:e,ptr:t-1})}else if(f<" "&&f!==" "||f==="\x7F")throw new H("control characters are not allowed in strings",{toml:e,ptr:t-1});if(p){if(p=!1,f==="x"||f==="u"||f==="U"){let y=e.slice(t,t+=f==="x"?2:f==="u"?4:8);if(!uF.test(y))throw new H("invalid unicode escape",{toml:e,ptr:a});try{u+=String.fromCodePoint(parseInt(y,16))}catch{throw new H("invalid unicode escape",{toml:e,ptr:a})}}else if(i&&(f===`
60
+ `||f===" "||f===" "||f==="\r")){if(t=St(e,t-1,!0),e[t]!==`
61
+ `&&e[t]!=="\r")throw new H("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});t=St(e,t)}else if(f in Px)u+=Px[f];else throw new H("unrecognized escape sequence",{toml:e,ptr:a});l=t}else!o&&f==="\\"&&(a=t-1,p=!0,u+=e.slice(l,a))}return u+e.slice(l,r-1)}function Ux(e,t,r,o){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return o?0n:0;let i=pF.test(e);if(i||cF.test(e)){if(mF.test(e))throw new H("leading zeroes are not allowed",{toml:t,ptr:r});e=e.replace(/_/g,"");let p=+e;if(isNaN(p))throw new H("invalid number",{toml:t,ptr:r});if(i){if((i=!Number.isSafeInteger(p))&&!o)throw new H("integer value cannot be represented losslessly",{toml:t,ptr:r});(i||o===!0)&&(p=BigInt(e))}return p}let a=new _a(e);if(!a.isValid())throw new H("invalid value",{toml:t,ptr:r});return a}function lF(e,t,r){let o=e.slice(t,r),i=o.indexOf("#");return i>-1&&(Bo(e,i),o=o.slice(0,i)),[o.trimEnd(),i]}function ha(e,t,r,o,i){if(o===0)throw new H("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let a=e[t];if(a==="["||a==="{"){let[l,f]=a==="["?Lx(e,t,o,i):Nx(e,t,o,i);if(r){if(f=St(e,f),e[f]===",")f++;else if(e[f]!==r)throw new H("expected comma or end of structure",{toml:e,ptr:f})}return[l,f]}let p;if(a==='"'||a==="'"){p=cp(e,t);let l=mp(e,t,p);if(r){if(p=St(e,p),e[p]&&e[p]!==","&&e[p]!==r&&e[p]!==`
62
+ `&&e[p]!=="\r")throw new H("unexpected character encountered",{toml:e,ptr:p});p+=+(e[p]===",")}return[l,p]}p=Cx(e,t,",",r);let u=lF(e,t,p-+(e[p-1]===","));if(!u[0])throw new H("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return r&&u[1]>-1&&(p=St(e,t+u[1]),p+=+(e[p]===",")),[Ux(u[0],e,t,i),p]}var dF=/^[a-zA-Z0-9-_]+[ \t]*$/;function up(e,t,r="="){let o=t-1,i=[],a=e.indexOf(r,t);if(a<0)throw new H("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let p=e[t=++o];if(p!==" "&&p!==" ")if(p==='"'||p==="'"){if(p===e[t+1]&&p===e[t+2])throw new H("multiline strings are not allowed in keys",{toml:e,ptr:t});let u=cp(e,t);if(u<0)throw new H("unfinished string encountered",{toml:e,ptr:t});o=e.indexOf(".",u);let l=e.slice(u,o<0||o>a?a:o),f=pp(l);if(f>-1)throw new H("newlines are not allowed in keys",{toml:e,ptr:t+o+f});if(l.trimStart())throw new H("found extra tokens after the string part",{toml:e,ptr:u});if(a<u&&(a=e.indexOf(r,u),a<0))throw new H("incomplete key-value: cannot find end of key",{toml:e,ptr:t});i.push(mp(e,t,u))}else{o=e.indexOf(".",t);let u=e.slice(t,o<0||o>a?a:o);if(!dF.test(u))throw new H("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});i.push(u.trimEnd())}}while(o+1&&o<a);return[i,St(e,a+1,!0,!0)]}function Nx(e,t,r,o){let i={},a=new Set,p;for(t++;(p=e[t++])!=="}"&&p;){if(p===",")throw new H("expected value, found comma",{toml:e,ptr:t-1});if(p==="#")t=Bo(e,t);else if(p!==" "&&p!==" "&&p!==`
63
+ `&&p!=="\r"){let u,l=i,f=!1,[y,I]=up(e,t-1);for(let Se=0;Se<y.length;Se++){if(Se&&(l=f?l[u]:l[u]={}),u=y[Se],(f=Object.hasOwn(l,u))&&(typeof l[u]!="object"||a.has(l[u])))throw new H("trying to redefine an already defined value",{toml:e,ptr:t});!f&&u==="__proto__"&&Object.defineProperty(l,u,{enumerable:!0,configurable:!0,writable:!0})}if(f)throw new H("trying to redefine an already defined value",{toml:e,ptr:t});let[x,le]=ha(e,I,"}",r-1,o);a.add(x),l[u]=x,t=le}}if(!p)throw new H("unfinished table encountered",{toml:e,ptr:t});return[i,t]}function Lx(e,t,r,o){let i=[],a;for(t++;(a=e[t++])!=="]"&&a;){if(a===",")throw new H("expected value, found comma",{toml:e,ptr:t-1});if(a==="#")t=Bo(e,t);else if(a!==" "&&a!==" "&&a!==`
64
+ `&&a!=="\r"){let p=ha(e,t-1,"]",r-1,o);i.push(p[0]),t=p[1]}}if(!a)throw new H("unfinished array encountered",{toml:e,ptr:t});return[i,t]}function kx(e,t,r,o){let i=t,a=r,p,u=!1,l;for(let f=0;f<e.length;f++){if(f){if(i=u?i[p]:i[p]={},a=(l=a[p]).c,o===0&&(l.t===1||l.t===2))return null;if(l.t===2){let y=i.length-1;i=i[y],a=a[y].c}}if(p=e[f],(u=Object.hasOwn(i,p))&&a[p]?.t===0&&a[p]?.d)return null;u||(p==="__proto__"&&(Object.defineProperty(i,p,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,p,{enumerable:!0,configurable:!0,writable:!0})),a[p]={t:f<e.length-1&&o===2?3:o,d:!1,i:0,c:{}})}if(l=a[p],l.t!==o&&!(o===1&&l.t===3)||(o===2&&(l.d||(l.d=!0,i[p]=[]),i[p].push(i={}),l.c[l.i++]=l={t:1,d:!1,i:0,c:{}}),l.d))return null;if(l.d=!0,o===1)i=u?i[p]:i[p]={};else if(o===0&&u)return null;return[p,i,l.c]}function Ju(e,{maxDepth:t=1e3,integersAsBigInt:r}={}){let o={},i={},a=o,p=i;for(let u=St(e,0);u<e.length;){if(e[u]==="["){let l=e[++u]==="[",f=up(e,u+=+l,"]");if(l){if(e[f[1]-1]!=="]")throw new H("expected end of table declaration",{toml:e,ptr:f[1]-1});f[1]++}let y=kx(f[0],o,i,l?2:1);if(!y)throw new H("trying to redefine an already defined table or value",{toml:e,ptr:u});p=y[2],a=y[1],u=f[1]}else{let l=up(e,u),f=kx(l[0],a,p,0);if(!f)throw new H("trying to redefine an already defined table or value",{toml:e,ptr:u});let y=ha(e,l[1],void 0,t,r);f[1][f[0]]=y[0],u=y[1]}if(u=St(e,u,!0),e[u]&&e[u]!==`
65
+ `&&e[u]!=="\r")throw new H("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:u});u=St(e,u)}return o}var Mx=/^[a-z0-9-_]+$/i;function Oa(e){let t=typeof e;if(t==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return t}function fF(e){for(let t=0;t<e.length;t++)if(Oa(e[t])!=="object")return!1;return e.length!=0}function el(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function tl(e,t,r,o){if(r===0)throw new Error("Could not stringify the object: maximum object depth exceeded");if(t==="number")return isNaN(e)?"nan":e===1/0?"inf":e===-1/0?"-inf":o&&Number.isInteger(e)?e.toFixed(1):e.toString();if(t==="bigint"||t==="boolean")return e.toString();if(t==="string")return el(e);if(t==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(t==="object")return gF(e,r,o);if(t==="array")return yF(e,r,o)}function gF(e,t,r){let o=Object.keys(e);if(o.length===0)return"{}";let i="{ ";for(let a=0;a<o.length;a++){let p=o[a];a&&(i+=", "),i+=Mx.test(p)?p:el(p),i+=" = ",i+=tl(e[p],Oa(e[p]),t-1,r)}return i+" }"}function yF(e,t,r){if(e.length===0)return"[]";let o="[ ";for(let i=0;i<e.length;i++){if(i&&(o+=", "),e[i]===null||e[i]===void 0)throw new TypeError("arrays cannot contain null or undefined values");o+=tl(e[i],Oa(e[i]),t-1,r)}return o+" ]"}function EF(e,t,r,o){if(r===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let i="";for(let a=0;a<e.length;a++)i+=`${i&&`
64
66
  `}[[${t}]]
65
- `,i+=zu(0,e[a],t,r,o);return i}function zu(e,t,r,o,i){if(o===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let a="",p="",u=Object.keys(t);for(let l=0;l<u.length;l++){let f=u[l];if(t[f]!==null&&t[f]!==void 0){let y=Ea(t[f]);if(y==="symbol"||y==="function")throw new TypeError(`cannot serialize values of type '${y}'`);let I=mx.test(f)?f:Hu(f);if(y==="array"&&Cj(t[f]))p+=(p&&`
66
- `)+Nj(t[f],r?`${r}.${I}`:I,o-1,i);else if(y==="object"){let x=r?`${r}.${I}`:I;p+=(p&&`
67
- `)+zu(x,t[f],x,o-1,i)}else a+=I,a+=" = ",a+=Ku(t[f],y,o,i),a+=`
67
+ `,i+=rl(0,e[a],t,r,o);return i}function rl(e,t,r,o,i){if(o===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let a="",p="",u=Object.keys(t);for(let l=0;l<u.length;l++){let f=u[l];if(t[f]!==null&&t[f]!==void 0){let y=Oa(t[f]);if(y==="symbol"||y==="function")throw new TypeError(`cannot serialize values of type '${y}'`);let I=Mx.test(f)?f:el(f);if(y==="array"&&fF(t[f]))p+=(p&&`
68
+ `)+EF(t[f],r?`${r}.${I}`:I,o-1,i);else if(y==="object"){let x=r?`${r}.${I}`:I;p+=(p&&`
69
+ `)+rl(x,t[f],x,o-1,i)}else a+=I,a+=" = ",a+=tl(t[f],y,o,i),a+=`
68
70
  `}}return e&&(a||!p)&&(a=a?`[${e}]
69
71
  ${a}`:`[${e}]`),a&&p?`${a}
70
- ${p}`:a||p}function Vu(e,{maxDepth:t=1e3,numbersAsFloat:r=!1}={}){if(Ea(e)!=="object")throw new TypeError("stringify can only be called with an object");let o=zu(0,e,"",t,r);return o[o.length-1]!==`
72
+ ${p}`:a||p}function nl(e,{maxDepth:t=1e3,numbersAsFloat:r=!1}={}){if(Oa(e)!=="object")throw new TypeError("stringify can only be called with an object");let o=rl(0,e,"",t,r);return o[o.length-1]!==`
71
73
  `?o+`
72
- `:o}function gx(e,t){let r=`${e}.tmp.${process.pid}`;(0,rr.writeFileSync)(r,t),(0,rr.renameSync)(r,e)}function yx(e){try{return(0,rr.readFileSync)(e,"utf8")}catch(t){if(t.code==="ENOENT")return;throw t}}function Ex(e,t){if(t===void 0)return;let r=`${e}.bak.${new Date().toISOString().replaceAll(":","-")}`;return(0,rr.writeFileSync)(r,t),r}function ux(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Lj={CLAUDE_CODE_ENABLE_TELEMETRY:"1",CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:"1",OTEL_METRICS_EXPORTER:"otlp",OTEL_LOGS_EXPORTER:"otlp",OTEL_TRACES_EXPORTER:"otlp",OTEL_EXPORTER_OTLP_PROTOCOL:"http/json",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"delta"};function kj(e,t,r,o){let i=(0,vo.join)(e,".claude","settings.json");Wt(`Claude Code \u2192 ${i}`),(0,rr.mkdirSync)((0,vo.dirname)(i),{recursive:!0});let a=yx(i),p;try{p=JSON.parse(a??"{}")}catch{throw new Error(`${i} is not valid JSON. Fix or remove it before re-running.`)}if(!ux(p))throw new Error(`${i} must contain a JSON object at the top level.`);let u=p.env??{};if(!ux(u))throw new Error(`${i} "env" must be a JSON object.`);let l=o?"1":"0";p.env={...u,...Lj,OTEL_EXPORTER_OTLP_ENDPOINT:t,OTEL_LOG_USER_PROMPTS:l,OTEL_LOG_TOOL_DETAILS:l,OTEL_LOG_TOOL_CONTENT:l,OTEL_EXPORTER_OTLP_HEADERS:`Authorization=Bearer ${r}`};let f=Ex(i,a);gx(i,`${JSON.stringify(p,null,2)}
73
- `),Wt(f===void 0?" created":` patched (backup: ${f})`)}function wj(e,t,r){return{environment:"dev",log_user_prompt:r,exporter:{"otlp-http":{endpoint:`${e}/v1/logs`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}},trace_exporter:{"otlp-http":{endpoint:`${e}/v1/traces`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}}}}function Mj(e,t,r,o){let i=(0,vo.join)(e,".codex"),a=(0,vo.join)(i,"config.toml");Wt(`Codex \u2192 ${a}`),(0,rr.mkdirSync)(i,{recursive:!0});let p=yx(a),u=p===void 0?{}:qu(p),l="otel"in u;delete u.otel,u.otel=wj(t,r,o);let f=Ex(a,p);gx(a,Vu(u)),Wt(f===void 0?" created":l?` replaced existing [otel] tables (backup: ${f})`:` appended (backup: ${f})`)}function lx(){return new xp("--endpoint <url>","OTLP base URL").env("TSUGA_OTLP_ENDPOINT").makeOptionMandatory()}function dx(){return new xp("--ingestion-api-key <key>","Tsuga ingestion API key").env("TSUGA_INGESTION_API_KEY").makeOptionMandatory()}var fx="Restart your claude / codex session to load the new config.";function Ix(e){let t=e.command("setup").description("Configure local LLM CLIs to ship OTEL telemetry to Tsuga");t.command("claude-code").description("Patch ~/.claude/settings.json with Tsuga OTEL env").addOption(lx()).addOption(dx()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(r=>{kj((0,Yu.homedir)(),r.endpoint.replace(/\/+$/,""),r.ingestionApiKey,r.includePrompts),Wt(fx)}),t.command("codex").description("Patch ~/.codex/config.toml with Tsuga OTEL settings").addOption(lx()).addOption(dx()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(r=>{Mj((0,Yu.homedir)(),r.endpoint.replace(/\/+$/,""),r.ingestionApiKey,r.includePrompts),Wt(fx)})}var ip="/v0/logs";var Ia=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var $j=0,Dj=n.Object({__tsuga_metadata__:n.Object({id:n.String(),source:n.Optional(n.String())},{additionalProperties:!0}),context:n.Optional(n.Object({team:n.Optional(n.String()),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String()))},{additionalProperties:!0})),message:n.Optional(n.Unknown()),timestamp:n.Number(),level:n.Enum(Ia)},{additionalProperties:!0});var Gj="log_timestamp",vj=n.Union([n.Literal(Gj)]),vn={...gt.properties,query:n.Optional(m({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e3})),shouldRecommendAttributes:n.Optional(n.Boolean()),defaultAttributesToHighlight:n.Optional(n.Array(m(),{maxItems:50})),triggeredBy:n.Optional(n.Literal("refresh")),startOffset:n.Optional(n.Number({minimum:$j})),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."})),sortBy:n.Optional(vj),sortDirection:n.Optional(n.Union([n.Literal("asc"),n.Literal("desc")]))},Sqe=d({tags:["logs"],url:`${ip}/count`,method:"GET",query:n.Pick(n.Object(vn),["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),Qu=n.Object({value:n.String(),priority:n.Number()}),bqe=d({tags:["logs"],url:`${ip}/search`,method:"GET",query:n.Object(vn),response:n.Object({logs:n.Optional(n.Array(Dj)),attributesToHighlight:n.Optional(n.Array(Qu))},{additionalProperties:!0})}),Wu=n.Cyclic({TokenOutput:n.Union([n.Object({type:n.Literal("top"),values:n.Array(n.String())}),n.Object({type:n.Literal("ip"),value:n.String()}),n.Object({type:n.Literal("range"),min:n.Number(),max:n.Number()}),n.Object({type:n.Literal("variable"),value:n.String()}),n.Object({type:n.Literal("text"),value:n.String()}),n.Object({type:n.Literal("date"),value:n.String()}),n.Object({type:n.Literal("url"),value:n.String()}),n.Object({type:n.Literal("structure"),key:n.Array(n.String()),value:n.Array(n.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),jj=n.Object({id:n.String(),pattern:n.Array(Wu),size:n.Integer({description:"Number of logs that matched the pattern"}),examples:n.Array(n.Object({id:n.String(),timestampUnix:n.Number()})),timeDistribution:n.Array(n.Number()),staticFeatures:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),xqe=d({tags:["logs"],url:`${ip}/patterns`,method:"GET",query:n.Object({...gt.properties,query:m({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({patterns:n.Array(jj),sampleSize:n.Number()})}),Rqe=d({tags:["logs"],url:`${ip}/attributes`,method:"GET",query:n.Object({...gt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Object({attributes:n.Array(n.String())})});var Ta=`/${"v1"}/logs`,Zu=n.Object({context:n.Optional(n.Object({team:n.Optional(n.String())},{additionalProperties:!0,$id:"LogContext"})),message:n.Optional(n.Unknown()),timestamp:n.Number(),level:n.Enum(Ia)},{additionalProperties:!0,$id:"LogEvent"}),Fj={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(Zu,{examples:[Fj]});var Bj={query:"level:ERROR",maxResults:100,from:1704067200,to:1704067200},Tx=n.Object({...n.Pick(n.Object(vn),["query","maxResults","clusterId"]).properties,...yt.properties});Object.assign(Tx,{examples:[Bj]});var _x=d({description:"Search logs",operationId:"searchLogs",tags:["public","logs"],url:`${Ta}/search`,method:"GET",query:Tx,response:n.Object({logs:n.Array(Zu)})}),qj=n.Object({pattern:n.Array(Wu),size:n.Integer({description:"Number of logs that matched the pattern"}),groups:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),hx=n.Object({patterns:n.Array(qj),sampleSize:n.Number()}),Hj={patterns:[{pattern:[{type:"text",value:"Resolved"},{type:"text",value:" "},{type:"text",value:"segment"},{type:"text",value:" "},{type:"text",value:"SegmentId("},{type:"range",min:0,max:1},{type:"text",value:")"},{type:"text",value:" "},{type:"text",value:"from"},{type:"text",value:" "},{type:"text",value:"cache"}],size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:100};Object.assign(hx,{examples:[Hj]});var Ox=d({description:"Get log patterns",operationId:"getLogPatterns",tags:["public","logs"],url:`${Ta}/patterns`,method:"GET",query:n.Object({...yt.properties,query:m({type:"tsuga-query"}),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:hx}),Kj=n.Object({exampleLog:n.Optional(Zu),team:n.String(),env:n.String(),service:n.String(),firstSeen:n.Number({description:"Timestamp in milliseconds when this pattern was first seen"}),lastSeen:n.Number({description:"Timestamp in milliseconds when this pattern was last seen"})}),Ax=n.Object({newErrorPatterns:n.Array(Kj)}),zj={newErrorPatterns:[{team:"platform",env:"production",service:"api-gateway",firstSeen:17040672e5,lastSeen:17041536e5,exampleLog:{message:"ConnectionError: Failed to connect to database",timestamp:17041536e5,level:"ERROR"}}]};Object.assign(Ax,{examples:[zj]});var Sx=d({description:"Get new error patterns",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${Ta}/patterns/new`,method:"GET",query:n.Object({...yt.properties,team:n.Optional(m()),env:n.Optional(m()),service:n.Optional(m()),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:Ax}),Vj=n.Object({team:n.String(),env:n.String(),pattern:n.String({description:"The error pattern formatted"}),increaseTimestamps:n.Array(n.Number({description:"Timestamps in milliseconds when there were increases in this pattern"}))}),bx=n.Object({errorPatternIncreases:n.Array(Vj)}),Yj={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(bx,{examples:[Yj]});var xx=d({description:"Get error pattern increases for a given team",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${Ta}/patterns/increase`,method:"GET",query:n.Object({...yt.properties,team:m(),env:n.Optional(m()),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:bx}),Rx=n.Object({attributes:n.Array(n.String(),{description:"Log attribute dot-paths observed in the time range"})}),Qj={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(Rx,{examples:[Qj]});var Wj=n.Object({...yt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),Cx=d({description:"Get log attributes",operationId:"getLogAttributes",tags:["public","logs"],url:`${Ta}/attributes`,method:"GET",query:Wj,response:Rx});var _r="/v0/metrics",Zj=n.Object({__tsuga_metadata__:n.Object({},{additionalProperties:!0}),context:n.Optional(n.Object({},{additionalProperties:!0})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(Ia)},{additionalProperties:!0}),Fqe=d({tags:["metrics"],url:`${_r}/count`,method:"GET",query:n.Pick(n.Object(vn),["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),Bqe=d({tags:["metrics"],url:`${_r}/search`,method:"GET",query:n.Object(vn),response:n.Object({logs:n.Optional(n.Array(Zj)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(Qu))},{additionalProperties:!0})}),ap=n.Enum(["counter","gauge","histogram","summary"]),Xu=n.Enum(["delta","cumulative","none"]),Xj=n.Object({capabilities:n.Optional(n.Array(n.String())),description:n.Optional(n.String()),tags:n.Optional(n.Array(n.String())),temporality:n.Optional(Xu),type:n.Optional(ap),unit:n.Optional(n.String())}),qqe=d({url:`${_r}/metadata`,method:"GET",query:n.Object({...gt.properties,metricName:m({allowEmpty:!1}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:Xj}),Hqe=d({tags:["metrics"],url:_r,method:"GET",query:n.Object({...gt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),Ju=n.Array(n.Object({name:n.String(),type:ap}),{description:"List of metric names and their types"}),Kqe=d({tags:["metrics"],url:`${_r}/names-and-types`,method:"GET",query:n.Object({...gt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:Ju}),sp=n.Array(n.String(),{description:"List of attribute names"}),zqe=d({tags:["metrics"],url:`${_r}/attributes`,method:"GET",query:n.Object({...gt.properties,metricName:m({allowEmpty:!1}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:sp}),Vqe=d({tags:["metrics"],url:`${_r}/attributes/batch`,method:"GET",query:n.Object({...gt.properties,metricNames:n.Array(m({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:sp}),el=n.Object({assets:n.Array(n.Object({type:n.Enum(["dashboard","monitor"]),id:n.String(),name:n.String(),owner:n.String()},{description:"An asset that uses a metric"}),{description:"List of assets (dashboards and monitors) using this metric"})}),Yqe=d({tags:["metrics"],url:`${_r}/assets-usage`,method:"GET",query:n.Object({metricName:m({allowEmpty:!1})}),response:el}),Qqe=d({url:`${_r}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:m(),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Array(n.String())});var tl=`/${"v1"}/metrics`,Jj=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(Ju,{examples:[Jj]});var rl=n.Object({name:n.String({description:"Name of the metric"}),type:ap,description:n.Optional(n.String({description:"Human-readable description of the metric"})),unit:n.Optional(n.String({description:"Unit of the metric"})),temporality:n.Optional(Xu),capabilities:n.Optional(n.Array(n.String(),{description:"Supported capabilities, an empty array means all capabilities are supported"})),attributes:n.Optional(n.Array(n.String(),{description:"Metric attributes"}))}),eF={name:"http.server.request.duration",type:"histogram",description:"Duration of HTTP server requests",unit:"ms",temporality:"delta",capabilities:["max","min","sum"],attributes:["context.team","context.environment","context.region"]};Object.assign(rl,{examples:[eF]});var Px=n.Object({...yt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),Ux=d({description:"Get all metrics with their metadata",operationId:"listMetrics",tags:["public","metrics"],url:tl,method:"GET",query:Px,response:n.Array(rl)}),Nx=d({description:"Retrieve a metric by name with its metadata",operationId:"getMetric",tags:["public","metrics"],url:`${tl}/:name`,method:"GET",params:n.Object({name:m({allowEmpty:!1,description:"The metric name"})}),query:Px,response:rl}),tF=["service","env","host","method","status_code"];Object.assign(sp,{examples:[tF]});var Lx=n.Pick(el,["assets"]),rF={assets:[{type:"dashboard",id:"dash-123-abc",name:"API Performance Overview",owner:"user-456-def"},{type:"monitor",id:"mon-789-ghi",name:"High Latency Alert",owner:"user-456-def"}]};Object.assign(Lx,{examples:[rF]});var kx=d({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${tl}/assets-usage`,method:"GET",query:n.Object({metricName:m({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:Lx});var nF=`/${"v1"}/traces`,wx=n.Object({context:n.Optional(n.Object({service:n.Optional(n.Object({name:n.Optional(n.String()),version:n.Optional(n.String())},{additionalProperties:!0}))},{additionalProperties:!0})),parentSpanId:n.Optional(n.String()),resourceAttributes:n.Object({},{additionalProperties:!0}),spanAttributes:n.Object({},{additionalProperties:!0}),duration:n.Number({description:"In milliseconds."}),startTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),endTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:n.Optional(n.Object({message:n.String()})),events:n.Optional(n.Array(n.Object({event_attributes:n.Object({},{additionalProperties:!0}),event_name:n.String(),event_timestamp_nanos:n.String()}))),spanId:n.String(),span:n.Object({kind:n.String(),name:n.String()}),statusCode:n.Optional(n.String()),traceId:n.String()},{additionalProperties:!0,$id:"SpanEvent"}),oF={context:{service:{name:"my-service",version:"1.0.0"}},parentSpanId:"187a47da1b2560f8",resourceAttributes:{},spanAttributes:{busyNs:374640,code:{file:{path:"src/queue/sqs.rs"},line:{number:162},module:{name:"queue::sqs"}},idleNs:23621445,maxMessages:"1",target:"queue::sqs",thread:{id:2,name:"tokio-runtime-worker"}},duration:23,startTime:"1770923469995353600",endTime:"1770923470019349500",spanId:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},statusCode:"ok",traceId:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(wx,{examples:[oF]});var iF={from:1704067200,to:1704067200,query:"context.service.name:my-service",maxResults:100},Mx=n.Object({...yt.properties,query:n.Optional(m({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4})),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))});Object.assign(Mx,{examples:[iF]});var $x=d({description:"Search spans",operationId:"searchSpans",tags:["public","traces"],url:`${nF}/search`,method:"GET",query:Mx,response:n.Object({spans:n.Array(wx)})});var Gx=["timestamp","level","message"];function Et(e,t){let r=t??Er(e);if(!r)throw new Error(`--${e} is required`);return Ts(r)}function Dx(e){let t={from:Et("from",e.from),to:Et("to",e.to)},r=e.query??Er("query");r!==void 0&&(t.query=r);let o=e.maxResults??Er("max-results");if(o!==void 0){let i=Number(o);if(Number.isNaN(i))throw new Error(`--max-results must be a number (got: ${o})`);t.maxResults=i}return t}function we(e){let t=Er(e);return t===void 0?"":` (default: ${t})`}function aF(e){let t=qT(e.output),r=e.fields===void 0?void 0:HT(e.fields);return t==="json"?{format:t,fields:r}:{format:t,fields:r??Gx}}function sF(e,t){if(t.format==="json"){if(t.fields===void 0){ae(e);return}let{fields:o}=t;ae({logs:e.logs.map(i=>zT(i,o))});return}let r=YT(t.format,e.logs,t.fields);r.length>0&&Wt(r)}function vx(e,t){let r=e.command("logs").description("Search and analyze logs");r.command("search").description("Search logs").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).option("--query <query>",`Search query${we("query")}`).option("--max-results <n>",`Maximum number of results${we("max-results")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${Gx.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async p=>{let u=aF(p),l=await t()(_x,{query:Dx(p)});sF(l,u)}),r.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).action(async p=>{let u=await t()(Cx,{query:{from:Et("from",p.from),to:Et("to",p.to)}});ae(u)}),r.command("patterns").description("List log patterns").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).option("--query <query>",`Search query${we("query")}`).action(async p=>{let u={from:Et("from",p.from),to:Et("to",p.to)},l=p.query??Er("query");l!==void 0&&(u.query=l);let f=await t()(Ox,{query:u});ae(f)}),r.command("new-error-patterns").description("List new error patterns").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).option("--team <team>","Filter by team").option("--env <env>","Filter by environment").option("--service <service>","Filter by service").action(async p=>{let u={from:Et("from",p.from),to:Et("to",p.to)};p.team!==void 0&&(u.team=p.team),p.env!==void 0&&(u.env=p.env),p.service!==void 0&&(u.service=p.service);let l=await t()(Sx,{query:u});ae(l)}),r.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).requiredOption("--team <team>","Team to query").option("--env <env>","Filter by environment").action(async p=>{let u={from:Et("from",p.from),to:Et("to",p.to),team:p.team};p.env!==void 0&&(u.env=p.env);let l=await t()(xx,{query:u});ae(l)});let o=e.command("metrics").description("List and inspect metrics");o.command("list").description("List all metrics with their metadata").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).action(async p=>{let u=await t()(Ux,{query:{from:Et("from",p.from),to:Et("to",p.to)}});ae(u)}),o.command("get <name>").description("Retrieve a metric by name with its metadata").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).action(async(p,u)=>{let l=await t()(Nx,{params:{name:p},query:{from:Et("from",u.from),to:Et("to",u.to)}});ae(l)}),o.command("assets-usage <name>").description("List dashboards and monitors that use a specific metric").action(async p=>{let u=await t()(kx,{query:{metricName:p}});ae(u)}),e.command("traces").description("Search traces").command("search").description("Search spans").option("--from <timestamp>",`Start of time range${we("from")}`).option("--to <timestamp>",`End of time range${we("to")}`).option("--query <query>",`Search query${we("query")}`).option("--max-results <n>",`Maximum number of results${we("max-results")}`).action(async p=>{let u=await t()($x,{query:Dx(p)});ae(u)});let a=e.command("aggregation").description("Run aggregation queries");Bi(a,"scalar","Run aggregation queries and return scalar results",k_,t),Bi(a,"timeseries","Run aggregation queries and return timeseries results",w_,t)}var pF=3e3,cF="https://registry.npmjs.org/@tsuga/cli/latest";function mF(e,t){let r=e.split(".").map(Number),o=t.split(".").map(Number);for(let i=0;i<Math.max(r.length,o.length);i++){let a=r[i]??0,p=o[i]??0;if(a>p)return!0;if(a<p)return!1}return!1}async function jx(e){try{let t=HA();if(t&&Date.now()-t<Is)return;let r=await fetch(cF,{signal:AbortSignal.timeout(pF)});if(!r.ok)return;let i=(await r.json()).version;mF(i,e)&&(process.stderr.write(`
74
+ `:o}function vx(e,t){let r=`${e}.tmp.${process.pid}`;(0,rr.writeFileSync)(r,t),(0,rr.renameSync)(r,e)}function jx(e){try{return(0,rr.readFileSync)(e,"utf8")}catch(t){if(t.code==="ENOENT")return;throw t}}function Fx(e,t){if(t===void 0)return;let r=`${e}.bak.${new Date().toISOString().replaceAll(":","-")}`;return(0,rr.writeFileSync)(r,t),r}function wx(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var IF={CLAUDE_CODE_ENABLE_TELEMETRY:"1",CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:"1",OTEL_METRICS_EXPORTER:"otlp",OTEL_LOGS_EXPORTER:"otlp",OTEL_TRACES_EXPORTER:"otlp",OTEL_EXPORTER_OTLP_PROTOCOL:"http/json",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"delta"};function TF(e,t,r,o){let i=(0,qo.join)(e,".claude","settings.json");Dt(`Claude Code \u2192 ${i}`),(0,rr.mkdirSync)((0,qo.dirname)(i),{recursive:!0});let a=jx(i),p;try{p=JSON.parse(a??"{}")}catch{throw new Error(`${i} is not valid JSON. Fix or remove it before re-running.`)}if(!wx(p))throw new Error(`${i} must contain a JSON object at the top level.`);let u=p.env??{};if(!wx(u))throw new Error(`${i} "env" must be a JSON object.`);let l=o?"1":"0";p.env={...u,...IF,OTEL_EXPORTER_OTLP_ENDPOINT:t,OTEL_LOG_USER_PROMPTS:l,OTEL_LOG_TOOL_DETAILS:l,OTEL_LOG_TOOL_CONTENT:l,OTEL_EXPORTER_OTLP_HEADERS:`Authorization=Bearer ${r}`};let f=Fx(i,a);vx(i,`${JSON.stringify(p,null,2)}
75
+ `),Dt(f===void 0?" created":` patched (backup: ${f})`)}function _F(e,t,r){return{environment:"dev",log_user_prompt:r,exporter:{"otlp-http":{endpoint:`${e}/v1/logs`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}},trace_exporter:{"otlp-http":{endpoint:`${e}/v1/traces`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}}}}function hF(e,t,r,o){let i=(0,qo.join)(e,".codex"),a=(0,qo.join)(i,"config.toml");Dt(`Codex \u2192 ${a}`),(0,rr.mkdirSync)(i,{recursive:!0});let p=jx(a),u=p===void 0?{}:Ju(p),l="otel"in u;delete u.otel,u.otel=_F(t,r,o);let f=Fx(a,p);vx(a,nl(u)),Dt(f===void 0?" created":l?` replaced existing [otel] tables (backup: ${f})`:` appended (backup: ${f})`)}function Dx(){return new kp("--endpoint <url>","OTLP base URL").env("TSUGA_OTLP_ENDPOINT").makeOptionMandatory()}function $x(){return new kp("--ingestion-api-key <key>","Tsuga ingestion API key").env("TSUGA_INGESTION_API_KEY").makeOptionMandatory()}var Gx="Restart your claude / codex session to load the new config.";function Bx(e){let t=e.command("setup").description("Configure local LLM CLIs to ship OTEL telemetry to Tsuga");t.command("claude-code").description("Patch ~/.claude/settings.json with Tsuga OTEL env").addOption(Dx()).addOption($x()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(r=>{TF((0,ol.homedir)(),r.endpoint.replace(/\/+$/,""),r.ingestionApiKey,r.includePrompts),Dt(Gx)}),t.command("codex").description("Patch ~/.codex/config.toml with Tsuga OTEL settings").addOption(Dx()).addOption($x()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(r=>{hF((0,ol.homedir)(),r.endpoint.replace(/\/+$/,""),r.ingestionApiKey,r.includePrompts),Dt(Gx)})}var lp="/v0/logs";var Aa=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var OF=0,AF=n.Object({__tsuga_metadata__:n.Object({id:n.String(),source:n.Optional(n.String())},{additionalProperties:!0}),context:n.Optional(n.Object({team:n.Optional(n.String()),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String()))},{additionalProperties:!0})),message:n.Optional(n.Unknown()),timestamp:n.Number(),level:n.Enum(Aa)},{additionalProperties:!0});var SF="log_timestamp",bF=n.Union([n.Literal(SF)]),jn={...yt.properties,query:n.Optional(m({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e3})),shouldRecommendAttributes:n.Optional(n.Boolean()),triggeredBy:n.Optional(n.Literal("refresh")),startOffset:n.Optional(n.Number({minimum:OF})),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."})),sortBy:n.Optional(bF),sortDirection:n.Optional(n.Union([n.Literal("asc"),n.Literal("desc")]))},zHe=d({tags:["logs"],url:`${lp}/count`,method:"GET",query:n.Pick(n.Object(jn),["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),il=n.Object({value:n.String(),priority:n.Number()}),VHe=d({tags:["logs"],url:`${lp}/search`,method:"GET",query:n.Object(jn),response:n.Object({logs:n.Optional(n.Array(AF)),attributesToHighlight:n.Optional(n.Array(il))},{additionalProperties:!0})}),xF=n.Cyclic({TokenOutput:n.Union([n.Object({type:n.Literal("top"),values:n.Array(n.String())}),n.Object({type:n.Literal("ip"),value:n.String()}),n.Object({type:n.Literal("range"),min:n.Number(),max:n.Number()}),n.Object({type:n.Literal("variable"),value:n.String()}),n.Object({type:n.Literal("text"),value:n.String()}),n.Object({type:n.Literal("date"),value:n.String()}),n.Object({type:n.Literal("url"),value:n.String()}),n.Object({type:n.Literal("structure"),key:n.Array(n.String()),value:n.Array(n.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),RF=n.Object({id:n.String(),pattern:n.Array(xF),size:n.Integer({description:"Number of logs that matched the pattern"}),examples:n.Array(n.Object({id:n.String(),timestampUnix:n.Number()})),timeDistribution:n.Array(n.Number()),staticFeatures:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),YHe=d({tags:["logs"],url:`${lp}/patterns`,method:"GET",query:n.Object({...yt.properties,query:m({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({patterns:n.Array(RF),sampleSize:n.Number()})}),QHe=d({tags:["logs"],url:`${lp}/attributes`,method:"GET",query:n.Object({...yt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Object({attributes:n.Array(n.String())})});var Sa=`/${"v1"}/logs`,al=n.Object({context:n.Optional(n.Object({team:n.Optional(n.String())},{additionalProperties:!0,$id:"LogContext"})),message:n.Optional(n.Unknown()),timestamp:n.Number(),level:n.Enum(Aa)},{additionalProperties:!0,$id:"LogEvent"}),CF={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(al,{examples:[CF]});var PF={query:"level:ERROR",maxResults:100,from:1704067200,to:1704067200},qx=n.Object({...n.Pick(n.Object(jn),["query","maxResults","clusterId"]).properties,...Et.properties});Object.assign(qx,{examples:[PF]});var Hx=d({description:"Search logs",operationId:"searchLogs",tags:["public","logs"],url:`${Sa}/search`,method:"GET",query:qx,response:n.Object({logs:n.Array(al)})}),UF=n.Object({pattern:n.String({description:"The pattern formatted as a string"}),size:n.Integer({description:"Number of logs that matched the pattern"}),groups:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),Kx=n.Object({patterns:n.Array(UF),sampleSize:n.Number()}),NF={patterns:[{pattern:"Resolved segment SegmentId([0:1]) from cache",size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:100};Object.assign(Kx,{examples:[NF]});var zx=d({description:"Get log patterns",operationId:"getLogPatterns",tags:["public","logs"],url:`${Sa}/patterns`,method:"GET",query:n.Object({...Et.properties,query:m({type:"tsuga-query"}),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:Kx}),LF=n.Object({exampleLog:n.Optional(al),team:n.String(),env:n.String(),service:n.String(),firstSeen:n.Number({description:"Timestamp in milliseconds when this pattern was first seen"}),lastSeen:n.Number({description:"Timestamp in milliseconds when this pattern was last seen"})}),Vx=n.Object({newErrorPatterns:n.Array(LF)}),kF={newErrorPatterns:[{team:"platform",env:"production",service:"api-gateway",firstSeen:17040672e5,lastSeen:17041536e5,exampleLog:{message:"ConnectionError: Failed to connect to database",timestamp:17041536e5,level:"ERROR"}}]};Object.assign(Vx,{examples:[kF]});var Yx=d({description:"Get new error patterns",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${Sa}/patterns/new`,method:"GET",query:n.Object({...Et.properties,team:n.Optional(m()),env:n.Optional(m()),service:n.Optional(m()),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:Vx}),MF=n.Object({team:n.String(),env:n.String(),pattern:n.String({description:"The error pattern formatted"}),increaseTimestamps:n.Array(n.Number({description:"Timestamps in milliseconds when there were increases in this pattern"}))}),Qx=n.Object({errorPatternIncreases:n.Array(MF)}),wF={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(Qx,{examples:[wF]});var Wx=d({description:"Get error pattern increases for a given team",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${Sa}/patterns/increase`,method:"GET",query:n.Object({...Et.properties,team:m(),env:n.Optional(m()),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:Qx}),Zx=n.Object({attributes:n.Array(n.String(),{description:"Log attribute dot-paths observed in the time range"})}),DF={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(Zx,{examples:[DF]});var $F=n.Object({...Et.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),Xx=d({description:"Get log attributes",operationId:"getLogAttributes",tags:["public","logs"],url:`${Sa}/attributes`,method:"GET",query:$F,response:Zx});var hr="/v0/metrics",GF=n.Object({__tsuga_metadata__:n.Object({},{additionalProperties:!0}),context:n.Optional(n.Object({},{additionalProperties:!0})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(Aa)},{additionalProperties:!0}),c2e=d({tags:["metrics"],url:`${hr}/count`,method:"GET",query:n.Pick(n.Object(jn),["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),m2e=d({tags:["metrics"],url:`${hr}/search`,method:"GET",query:n.Object(jn),response:n.Object({logs:n.Optional(n.Array(GF)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(il))},{additionalProperties:!0})}),dp=n.Enum(["counter","gauge","histogram","summary"]),sl=n.Enum(["delta","cumulative","none"]),vF=n.Object({capabilities:n.Optional(n.Array(n.String())),description:n.Optional(n.String()),tags:n.Optional(n.Array(n.String())),temporality:n.Optional(sl),type:n.Optional(dp),unit:n.Optional(n.String())}),u2e=d({url:`${hr}/metadata`,method:"GET",query:n.Object({...yt.properties,metricName:m({allowEmpty:!1}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:vF}),l2e=d({tags:["metrics"],url:hr,method:"GET",query:n.Object({...yt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),pl=n.Array(n.Object({name:n.String(),type:dp}),{description:"List of metric names and their types"}),d2e=d({tags:["metrics"],url:`${hr}/names-and-types`,method:"GET",query:n.Object({...yt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:pl}),fp=n.Array(n.String(),{description:"List of attribute names"}),f2e=d({tags:["metrics"],url:`${hr}/attributes`,method:"GET",query:n.Object({...yt.properties,metricName:m({allowEmpty:!1}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:fp}),g2e=d({tags:["metrics"],url:`${hr}/attributes/batch`,method:"GET",query:n.Object({...yt.properties,metricNames:n.Array(m({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:fp}),cl=n.Object({assets:n.Array(n.Object({type:n.Enum(["dashboard","monitor"]),id:n.String(),name:n.String(),owner:n.String()},{description:"An asset that uses a metric"}),{description:"List of assets (dashboards and monitors) using this metric"})}),y2e=d({tags:["metrics"],url:`${hr}/assets-usage`,method:"GET",query:n.Object({metricName:m({allowEmpty:!1})}),response:cl}),E2e=d({url:`${hr}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:m(),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Array(n.String())});var ml=`/${"v1"}/metrics`,jF=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(pl,{examples:[jF]});var ul=n.Object({name:n.String({description:"Name of the metric"}),type:dp,description:n.Optional(n.String({description:"Human-readable description of the metric"})),unit:n.Optional(n.String({description:"Unit of the metric"})),temporality:n.Optional(sl),capabilities:n.Optional(n.Array(n.String(),{description:"Supported capabilities, an empty array means all capabilities are supported"})),attributes:n.Optional(n.Array(n.String(),{description:"Metric attributes"}))}),FF={name:"http.server.request.duration",type:"histogram",description:"Duration of HTTP server requests",unit:"ms",temporality:"delta",capabilities:["max","min","sum"],attributes:["context.team","context.environment","context.region"]};Object.assign(ul,{examples:[FF]});var Jx=n.Object({...Et.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),eR=d({description:"Get all metrics with their metadata",operationId:"listMetrics",tags:["public","metrics"],url:ml,method:"GET",query:Jx,response:n.Array(ul)}),tR=d({description:"Retrieve a metric by name with its metadata",operationId:"getMetric",tags:["public","metrics"],url:`${ml}/:name`,method:"GET",params:n.Object({name:m({allowEmpty:!1,description:"The metric name"})}),query:Jx,response:ul}),BF=["service","env","host","method","status_code"];Object.assign(fp,{examples:[BF]});var rR=n.Pick(cl,["assets"]),qF={assets:[{type:"dashboard",id:"dash-123-abc",name:"API Performance Overview",owner:"user-456-def"},{type:"monitor",id:"mon-789-ghi",name:"High Latency Alert",owner:"user-456-def"}]};Object.assign(rR,{examples:[qF]});var nR=d({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${ml}/assets-usage`,method:"GET",query:n.Object({metricName:m({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:rR});var HF=`/${"v1"}/traces`,oR=n.Object({context:n.Optional(n.Object({service:n.Optional(n.Object({name:n.Optional(n.String()),version:n.Optional(n.String())},{additionalProperties:!0}))},{additionalProperties:!0})),parentSpanId:n.Optional(n.String()),resourceAttributes:n.Object({},{additionalProperties:!0}),spanAttributes:n.Object({},{additionalProperties:!0}),duration:n.Number({description:"In milliseconds."}),startTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),endTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:n.Optional(n.Object({message:n.String()})),events:n.Optional(n.Array(n.Object({event_attributes:n.Object({},{additionalProperties:!0}),event_name:n.String(),event_timestamp_nanos:n.String()}))),spanId:n.String(),span:n.Object({kind:n.String(),name:n.String()}),statusCode:n.Optional(n.String()),traceId:n.String()},{additionalProperties:!0,$id:"SpanEvent"}),KF={context:{service:{name:"my-service",version:"1.0.0"}},parentSpanId:"187a47da1b2560f8",resourceAttributes:{},spanAttributes:{busyNs:374640,code:{file:{path:"src/queue/sqs.rs"},line:{number:162},module:{name:"queue::sqs"}},idleNs:23621445,maxMessages:"1",target:"queue::sqs",thread:{id:2,name:"tokio-runtime-worker"}},duration:23,startTime:"1770923469995353600",endTime:"1770923470019349500",spanId:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},statusCode:"ok",traceId:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(oR,{examples:[KF]});var zF={from:1704067200,to:1704067200,query:"context.service.name:my-service",maxResults:100},iR=n.Object({...Et.properties,query:n.Optional(m({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4})),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))});Object.assign(iR,{examples:[zF]});var aR=d({description:"Search spans",operationId:"searchSpans",tags:["public","traces"],url:`${HF}/search`,method:"GET",query:iR,response:n.Object({spans:n.Array(oR)})});var cR=["timestamp","level","message"],mR=["count","ratio","team","level","pattern"];function It(e,t){let r=t??Er(e);if(!r)throw new Error(`--${e} is required`);return Ss(r)}function sR(e){let t={from:It("from",e.from),to:It("to",e.to)},r=e.query??Er("query");r!==void 0&&(t.query=r);let o=e.maxResults??Er("max-results");if(o!==void 0){let i=Number(o);if(Number.isNaN(i))throw new Error(`--max-results must be a number (got: ${o})`);t.maxResults=i}return t}function Me(e){let t=Er(e);return t===void 0?"":` (default: ${t})`}function VF(e){let t=Mc(e.output),r=e.fields===void 0?void 0:wc(e.fields);return t==="json"?{format:t,fields:r}:{format:t,fields:r??cR}}function YF(e){let t=Mc(e.output),r=e.fields===void 0?void 0:wc(e.fields);return t==="json"?{format:t,fields:r}:{format:t,fields:r??mR}}function pR(e,t){let r={count:e.size,ratio:t>0?e.size/t:0,pattern:e.pattern};for(let{key:o,value:i}of e.groups)o==="context.team"?r.team=i:r[o]=i;return r}function QF(e,t){if(t.format==="json"){if(t.fields===void 0){ne(e);return}let{fields:i}=t;ne({patterns:e.patterns.map(a=>pR(a,e.sampleSize)).map(a=>Dc(a,i)),sampleSize:e.sampleSize});return}let r=e.patterns.map(i=>pR(i,e.sampleSize)),o=$c(t.format,r,t.fields);o.length>0&&Dt(o)}function WF(e,t){if(t.format==="json"){if(t.fields===void 0){ne(e);return}let{fields:o}=t;ne({logs:e.logs.map(i=>Dc(i,o))});return}let r=$c(t.format,e.logs,t.fields);r.length>0&&Dt(r)}function uR(e,t){let r=e.command("logs").description("Search and analyze logs");r.command("search").description("Search logs").option("--from <timestamp>",`Start of time range${Me("from")}`).option("--to <timestamp>",`End of time range${Me("to")}`).option("--query <query>",`Search query${Me("query")}`).option("--max-results <n>",`Maximum number of results${Me("max-results")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${cR.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async p=>{let u=VF(p),l=await t()(Hx,{query:sR(p)});WF(l,u)}),r.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <timestamp>",`Start of time range${Me("from")}`).option("--to <timestamp>",`End of time range${Me("to")}`).action(async p=>{let u=await t()(Xx,{query:{from:It("from",p.from),to:It("to",p.to)}});ne(u)}),r.command("patterns").description("List log patterns").option("--from <timestamp>",`Start of time range${Me("from")}`).option("--to <timestamp>",`End of time range${Me("to")}`).option("--query <query>",`Search query${Me("query")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each pattern (default for --output=tsv|csv: ${mR.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async p=>{let u=YF(p),l={from:It("from",p.from),to:It("to",p.to)},f=p.query??Er("query");f!==void 0&&(l.query=f);let y=await t()(zx,{query:l});QF(y,u)}),r.command("new-error-patterns").description("List new error patterns").option("--from <timestamp>",`Start of time range${Me("from")}`).option("--to <timestamp>",`End of time range${Me("to")}`).option("--team <team>","Filter by team").option("--env <env>","Filter by environment").option("--service <service>","Filter by service").action(async p=>{let u={from:It("from",p.from),to:It("to",p.to)};p.team!==void 0&&(u.team=p.team),p.env!==void 0&&(u.env=p.env),p.service!==void 0&&(u.service=p.service);let l=await t()(Yx,{query:u});ne(l)}),r.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <timestamp>",`Start of time range${Me("from")}`).option("--to <timestamp>",`End of time range${Me("to")}`).requiredOption("--team <team>","Team to query").option("--env <env>","Filter by environment").action(async p=>{let u={from:It("from",p.from),to:It("to",p.to),team:p.team};p.env!==void 0&&(u.env=p.env);let l=await t()(Wx,{query:u});ne(l)});let o=e.command("metrics").description("List and inspect metrics");o.command("list").description("List all metrics with their metadata").option("--from <timestamp>",`Start of time range${Me("from")}`).option("--to <timestamp>",`End of time range${Me("to")}`).action(async p=>{let u=await t()(eR,{query:{from:It("from",p.from),to:It("to",p.to)}});ne(u)}),o.command("get <name>").description("Retrieve a metric by name with its metadata").option("--from <timestamp>",`Start of time range${Me("from")}`).option("--to <timestamp>",`End of time range${Me("to")}`).action(async(p,u)=>{let l=await t()(tR,{params:{name:p},query:{from:It("from",u.from),to:It("to",u.to)}});ne(l)}),o.command("assets-usage <name>").description("List dashboards and monitors that use a specific metric").action(async p=>{let u=await t()(nR,{query:{metricName:p}});ne(u)}),e.command("traces").description("Search traces").command("search").description("Search spans").option("--from <timestamp>",`Start of time range${Me("from")}`).option("--to <timestamp>",`End of time range${Me("to")}`).option("--query <query>",`Search query${Me("query")}`).option("--max-results <n>",`Maximum number of results${Me("max-results")}`).action(async p=>{let u=await t()(aR,{query:sR(p)});ne(u)});let a=e.command("aggregation").description("Run aggregation queries");Hi(a,"scalar","Run aggregation queries and return scalar results",v_,t),Hi(a,"timeseries","Run aggregation queries and return timeseries results",j_,t)}var ZF=3e3,XF="https://registry.npmjs.org/@tsuga/cli/latest";function JF(e,t){let r=e.split(".").map(Number),o=t.split(".").map(Number);for(let i=0;i<Math.max(r.length,o.length);i++){let a=r[i]??0,p=o[i]??0;if(a>p)return!0;if(a<p)return!1}return!1}async function lR(e){try{let t=oS();if(t&&Date.now()-t<As)return;let r=await fetch(XF,{signal:AbortSignal.timeout(ZF)});if(!r.ok)return;let i=(await r.json()).version;JF(i,e)&&(process.stderr.write(`
74
76
  Update available: ${e} \u2192 ${i}
75
- `),process.stderr.write("Run `npm install -g @tsuga/cli` to update\n")),KA(Date.now())}catch{}}var St=new Il().name("tsuga").description("Tsuga CLI - manage resources from the command line").version("1.0.12").option("--operation-api-key <operation-api-key>","Operation API key").option("--cluster <cluster-id>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),nl;function jo(){if(!nl){let e=St.opts(),t=pu({operationApiKey:e.operationApiKey,clusterId:e.cluster});t.operationApiKey||(console.error("Error: Operation API key is required. Set it with one of:"),console.error(" tsuga auth <operation-api-key>"),console.error(" export TSUGA_OPERATION_API_KEY=<operation-api-key>"),console.error(" tsuga --operation-api-key <operation-api-key> <command>"),process.exit(1)),nl=MT(t.apiUrl,t.operationApiKey,t.clusterId)}return nl}St.command("auth <operation-api-key>").description("Save Operation API key to ~/.config/tsuga/config.json").action(e=>{cu({operationApiKey:e}),process.stdout.write(`Operation API key saved to ${mu()}
76
- `)});St.command("config").description("Show current configuration").action(()=>{if(!jA()){process.stdout.write(`No config found. Run: tsuga auth <operation-api-key>
77
- `);return}let e=St.opts(),t=pu({operationApiKey:e.operationApiKey,clusterId:e.cluster}),r=[`API URL: ${t.apiUrl}`];t.operationApiKey?r.push(`Operation API key: ${t.operationApiKey.slice(0,12)}...${t.operationApiKey.slice(-4)}`):r.push("Operation API key: (not set)"),r.push(`Cluster: ${t.clusterId??"(not set)"}`),r.push(`Config: ${mu()}`),process.stdout.write(`${r.join(`
78
- `)}
79
- `)});var Fx=St.command("defaults").description("Show or manage default values for command flags").action(()=>{let e=FA(),t={...uu,...e},r=["Defaults (custom overrides marked with *):"];for(let[o,i]of Object.entries(t)){let a=o in e?" *":"";r.push(` ${o}: ${i}${a}`)}process.stdout.write(`${r.join(`
80
- `)}
81
- `)});Fx.command("set <key> <value>").description("Set a custom default value").action((e,t)=>{BA(e,t),process.stdout.write(`Default set: ${e} = ${t}
82
- `)});Fx.command("reset").description("Clear all custom defaults").action(()=>{qA(),process.stdout.write(`Custom defaults cleared
83
- `)});nx(St,jo);vx(St,jo);VA(St,jo);t_(St,jo);QT(St,jo);NA(St,jo);Ix(St);St.parseAsync().then(()=>jx("1.0.12")).catch(e=>{console.error(wT(e)),process.exitCode=1});
77
+ `),process.stderr.write("Run `npm install -g @tsuga/cli` to update\n")),iS(Date.now())}catch{}}var it=new Cl().name("tsuga").description("Tsuga CLI - manage resources from the command line").version("1.0.15").option("--operation-api-key <operation-api-key>","Operation API key").option("--cluster <cluster-id>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),ll,dR;function Fn(){if(!ll){let e=it.opts(),t=hu({operationApiKey:e.operationApiKey,clusterId:e.cluster});t.operationApiKey||(console.error("Error: Operation API key is required. Set it with one of:"),console.error(" tsuga auth <operation-api-key>"),console.error(" export TSUGA_OPERATION_API_KEY=<operation-api-key>"),console.error(" tsuga --operation-api-key <operation-api-key> <command>"),process.exit(1)),ll=KT(t.apiUrl,t.operationApiKey,t.clusterId,()=>dR)}return ll}it.command("auth <operation-api-key>").description("Save Operation API key to ~/.config/tsuga/config.json").action(e=>{Ou({operationApiKey:e}),process.stdout.write(`Operation API key saved to ${Au()}
78
+ `)});var fR=it.command("config").description("Show or manage configuration").action(()=>{let e=it.opts(),t=hu({operationApiKey:e.operationApiKey,clusterId:e.cluster});JA()||process.stdout.write(`No saved config. Run: tsuga auth <operation-api-key>
79
+
80
+ `),process.stdout.write(nS(t,Au()))});fR.command("set").description("Set a configuration value").command("default <key> <value>").description("Set a custom default value for a command flag").allowUnknownOption(!0).action((e,t)=>{tS(e,t),process.stdout.write(`Default set: ${e} = ${t}
81
+ `)});fR.command("reset").description("Reset configuration values").command("defaults").description("Clear all custom defaults").action(()=>{rS(),process.stdout.write(`Custom defaults cleared
82
+ `)});var eB=new Set(it.commands);Rx(it,Fn);uR(it,Fn);sS(it,Fn);s_(it,Fn);vA(it,Fn);t_(it,Fn);$A(it,Fn);Bx(it);function gR(e){for(let t of e.commands)t.commands.length===0&&t.option("--rationale <text>",'Why you are making this call, e.g. "confirming the deploy caused the error spike". Recorded to explain intent; does not affect the result.'),gR(t)}for(let e of it.commands)eB.has(e)||gR(e);it.hook("preAction",(e,t)=>{let{rationale:r}=t.opts();dR=r});it.parseAsync().then(()=>lR("1.0.15")).catch(e=>{console.error(HT(e)),process.exitCode=1});
84
83
  /**
85
84
  * The following is a list of HTTP status codes and their meanings.
86
85
  *