zion-mcp 2.8.0 → 2.8.2

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.
@@ -1,1593 +0,0 @@
1
- import { createRequire as __nodeCreateRequire } from 'node:module';
2
- const require = __nodeCreateRequire(import.meta.url);
3
- import{a as mp,b as Fi,c as go,d as yo,f as mb,g as gb}from"./chunk-UNPVTOSR.js";import{$ as Rb,B as Ob,C as Ib,W as Ab,X as Ep,Y as Nb,Z as Cb,_ as Pb,a as yb,b as gp,c as vb,d as yp,e as D,f as Ft,g as Eb,h as Ut,i as _b,j as Sb,k as vp,l as bb,m as Tb,t as wb}from"./chunk-CAF64CO7.js";import{a as tn,b as db,c as Hn,d as te,e as mo,f as pb,g as $c,h as qi,j as hb}from"./chunk-4RMPLI2R.js";import{a as k,c as v,e as He,g as f}from"./chunk-OHILD5KP.js";var vo=v(Sp=>{f();var Bc=class extends Error{constructor(t,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},_p=class extends Bc{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Sp.CommanderError=Bc;Sp.InvalidArgumentError=_p});var Kc=v(Tp=>{f();var{InvalidArgumentError:i1}=vo(),bp=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new i1(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function s1(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Tp.Argument=bp;Tp.humanReadableArgName=s1});var Ip=v(Op=>{f();var{humanReadableArgName:o1}=Kc(),wp=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),n=t._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,s)=>i.name().localeCompare(s.name())),r}compareOptions(t,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(t).localeCompare(n(r))}visibleOptions(t){let r=t.options.filter(i=>!i.hidden),n=t._getHelpOption();if(n&&!n.hidden){let i=n.short&&t._findOption(n.short),s=n.long&&t._findOption(n.long);!i&&!s?r.push(n):n.long&&!s?r.push(t.createOption(n.long,n.description)):n.short&&!i&&r.push(t.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let n=t.parent;n;n=n.parent){let i=n.options.filter(s=>!s.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(n=>o1(n)).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((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let n="";for(let i=t.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}formatItemList(t,r,n){return r.length===0?[]:[n.styleTitle(t),...r,""]}groupItems(t,r,n){let i=new Map;return t.forEach(s=>{let o=n(s);i.has(o)||i.set(o,[])}),r.forEach(s=>{let o=n(s);i.has(o)||i.set(o,[]),i.get(o).push(s)}),i}formatHelp(t,r){let n=r.padWidth(t,r),i=r.helpWidth??80;function s(d,p){return r.formatItem(d,n,p,r)}let o=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(o=o.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(t).map(d=>s(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(o=o.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),d=>d.helpGroupHeading??"Options:").forEach((d,p)=>{let h=d.map(g=>s(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));o=o.concat(this.formatItemList(p,h,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(t).map(p=>s(r.styleOptionTerm(r.optionTerm(p)),r.styleOptionDescription(r.optionDescription(p))));o=o.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(t.commands,r.visibleCommands(t),d=>d.helpGroup()||"Commands:").forEach((d,p)=>{let h=d.map(g=>s(r.styleSubcommandTerm(r.subcommandTerm(g)),r.styleSubcommandDescription(r.subcommandDescription(g))));o=o.concat(this.formatItemList(p,h,r))}),o.join(`
4
- `)}displayWidth(t){return xb(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,n,i){let o=" ".repeat(2);if(!n)return o+t;let a=t.padEnd(r+t.length-i.displayWidth(t)),c=2,l=(this.helpWidth??80)-r-c-2,d;return l<this.minWidthToWrap||i.preformatted(n)?d=n:d=i.boxWrap(n,l).replace(/\n/g,`
5
- `+" ".repeat(r+c)),o+a+" ".repeat(c)+d.replace(/\n/g,`
6
- ${o}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let n=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,s=[];return n.forEach(o=>{let a=o.match(i);if(a===null){s.push("");return}let c=[a.shift()],u=this.displayWidth(c[0]);a.forEach(l=>{let d=this.displayWidth(l);if(u+d<=r){c.push(l),u+=d;return}s.push(c.join(""));let p=l.trimStart();c=[p],u=this.displayWidth(p)}),s.push(c.join(""))}),s.join(`
7
- `)}};function xb(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}Op.Help=wp;Op.stripColor=xb});var Pp=v(Cp=>{f();var{InvalidArgumentError:a1}=vo(),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 n=c1(t);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new a1(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Db(this.name().replace(/^no-/,"")):Db(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Np=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,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(t,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,s=i!==void 0?i:!1;return r.negate===(s===t)}};function Db(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function c1(e){let t,r,n=/^-[^-]$/,i=/^--[^-]/,s=e.split(/[ |,]+/).concat("guard");if(n.test(s[0])&&(t=s.shift()),i.test(s[0])&&(r=s.shift()),!t&&n.test(s[0])&&(t=s.shift()),!t&&i.test(s[0])&&(t=r,r=s.shift()),s[0].startsWith("-")){let o=s[0],a=`option creation failed due to '${o}' in option flags '${e}'`;throw/^-[^-][^-]/.test(o)?new Error(`${a}
8
- - a short flag is a single dash and a single character
9
- - either use a single dash and a single character (for a short flag)
10
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(o)?new Error(`${a}
11
- - too many short flags`):i.test(o)?new Error(`${a}
12
- - too many long flags`):new Error(`${a}
13
- - 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}}Cp.Option=Ap;Cp.DualOptions=Np});var kb=v(Lb=>{f();function u1(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let i=1;i<=e.length;i++){let s=1;e[i-1]===t[n-1]?s=0:s=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+s),i>1&&n>1&&e[i-1]===t[n-2]&&e[i-2]===t[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[e.length][t.length]}function l1(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(o=>o.slice(2)));let n=[],i=3,s=.4;return t.forEach(o=>{if(o.length<=1)return;let a=u1(e,o),c=Math.max(e.length,o.length);(c-a)/c>s&&(a<i?(i=a,n=[o]):a===i&&n.push(o))}),n.sort((o,a)=>o.localeCompare(a)),r&&(n=n.map(o=>`--${o}`)),n.length>1?`
14
- (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
15
- (Did you mean ${n[0]}?)`:""}Lb.suggestSimilar=l1});var Fb=v(kp=>{f();var f1=k("node:events").EventEmitter,Rp=k("node:child_process"),Lr=k("node:path"),Hc=k("node:fs"),me=k("node:process"),{Argument:d1,humanReadableArgName:p1}=Kc(),{CommanderError:xp}=vo(),{Help:h1,stripColor:m1}=Ip(),{Option:jb,DualOptions:g1}=Pp(),{suggestSimilar:Mb}=kb(),Dp=class e extends f1{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=>me.stdout.write(r),writeErr:r=>me.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>me.stdout.isTTY?me.stdout.columns:void 0,getErrHelpWidth:()=>me.stderr.isTTY?me.stderr.columns:void 0,getOutHasColors:()=>Lp()??(me.stdout.isTTY&&me.stdout.hasColors?.()),getErrHasColors:()=>Lp()??(me.stderr.isTTY&&me.stderr.hasColors?.()),stripColor:r=>m1(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,n){let i=r,s=n;typeof i=="object"&&i!==null&&(s=i,i=null),s=s||{};let[,o,a]=t.match(/([^ ]+) *(.*)/),c=this.createCommand(o);return i&&(c.description(i),c._executableHandler=!0),s.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(s.noHelp||s.hidden),c._executableFile=s.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(t){return new e(t)}createHelp(){return Object.assign(new h1,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
16
- - 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 d1(t,r)}argument(t,r,n,i){let s=this.createArgument(t,r);return typeof n=="function"?s.default(i).argParser(n):s.default(n),this.addArgument(s),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=t??"help [command]",[,i,s]=n.match(/([^ ]+) *(.*)/),o=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),s&&a.arguments(s),o&&a.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=a,(t||r)&&this._initCommandGroup(a),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
17
- Expecting one of '${n.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,n){this._exitCallback&&this._exitCallback(new xp(t,r,n)),me.exit(t)}action(t){let r=n=>{let i=this.registeredArguments.length,s=n.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),t.apply(this,s)};return this._actionHandler=r,this}createOption(t,r){return new jb(t,r)}_callParseArg(t,r,n,i){try{return t.parseArg(r,n)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${i} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let n=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 '${n}'
18
- - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=i=>[i.name()].concat(i.aliases()),n=r(t).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),s=r(t).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let s=t.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let i=(s,o,a)=>{s==null&&t.presetArg!==void 0&&(s=t.presetArg);let c=this.getOptionValue(n);s!==null&&t.parseArg?s=this._callParseArg(t,s,c,o):s!==null&&t.variadic&&(s=t._collectValue(s,c)),s==null&&(t.negate?s=!1:t.isBoolean()||t.optional?s=!0:s=""),this.setOptionValueWithSource(n,s,a)};return this.on("option:"+r,s=>{let o=`error: option '${t.flags}' argument '${s}' is invalid.`;i(s,o,"cli")}),t.envVar&&this.on("optionEnv:"+r,s=>{let o=`error: option '${t.flags}' value '${s}' from env '${t.envVar}' is invalid.`;i(s,o,"env")}),this}_optionEx(t,r,n,i,s){if(typeof r=="object"&&r instanceof jb)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,n);if(o.makeOptionMandatory(!!t.mandatory),typeof i=="function")o.default(s).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,u)=>{let l=a.exec(c);return l?l[0]:u},o.default(s).argParser(i)}else o.default(i);return this.addOption(o)}option(t,r,n,i){return this._optionEx({},t,r,n,i)}requiredOption(t,r,n,i){return this._optionEx({mandatory:!0},t,r,n,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,n){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=n,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(t)!==void 0&&(r=n.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){me.versions?.electron&&(r.from="electron");let i=me.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}t===void 0&&(t=me.argv),this.rawArgs=t.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=t[1],n=t.slice(2);break;case"electron":me.defaultApp?(this._scriptPath=t[1],n=t.slice(2)):n=t.slice(1);break;case"user":n=t.slice(0);break;case"eval":n=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",n}parse(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return this._parseCommand([],n),this}async parseAsync(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return await this._parseCommand([],n),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.
19
- - 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,n){if(Hc.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",s=`'${t}' does not exist
20
- - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
21
- - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
22
- - ${i}`;throw new Error(s)}_executeSubCommand(t,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function s(l,d){let p=Lr.resolve(l,d);if(Hc.existsSync(p))return p;if(i.includes(Lr.extname(d)))return;let h=i.find(g=>Hc.existsSync(`${p}${g}`));if(h)return`${p}${h}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=Hc.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=Lr.resolve(Lr.dirname(l),a)}if(a){let l=s(a,o);if(!l&&!t._executableFile&&this._scriptPath){let d=Lr.basename(this._scriptPath,Lr.extname(this._scriptPath));d!==this._name&&(l=s(a,`${d}-${t._name}`))}o=l||o}n=i.includes(Lr.extname(o));let c;me.platform!=="win32"?n?(r.unshift(o),r=qb(me.execArgv).concat(r),c=Rp.spawn(me.argv[0],r,{stdio:"inherit"})):c=Rp.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,t._name),r.unshift(o),r=qb(me.execArgv).concat(r),c=Rp.spawn(me.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{me.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let u=this._exitCallback;c.on("close",l=>{l=l??1,u?u(new xp(l,"commander.executeSubCommandAsync","(close)")):me.exit(l)}),c.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(o,a,t._name);else if(l.code==="EACCES")throw new Error(`'${o}' not executable`);if(!u)me.exit(1);else{let d=new xp(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,u(d)}}),this.runningCommand=c}_dispatchSubcommand(t,r,n){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,i,"preSubcommand"),s=this._chainOrCall(s,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),s}_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=(n,i,s)=>{let o=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;o=this._callParseArg(n,i,s,a)}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let s=n.defaultValue;n.variadic?i<this.args.length?(s=this.args.slice(i),n.parseArg&&(s=s.reduce((o,a)=>t(n,a,o),n.defaultValue))):s===void 0&&(s=[]):i<this.args.length&&(s=this.args[i],n.parseArg&&(s=t(n,s,n.defaultValue))),r[i]=s}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let n=t,i=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(o=>{i.push({hookedCommand:s,callback:o})})}),r==="postAction"&&i.reverse(),i.forEach(s=>{n=this._chainOrCall(n,()=>s.callback(s.hookedCommand,this))}),n}_chainOrCallSubCommandHook(t,r,n){let i=t;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(s=>{i=this._chainOrCall(i,()=>s(this,r))}),i}_parseCommand(t,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(n.operands),r=n.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(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(s,t,r)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent?.listenerCount(s))i(),this._processArguments(),this.parent.emit(s,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(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=t.find(s=>n.conflictsWith.includes(s.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],n=[],i=r;function s(l){return l.length>1&&l[0]==="-"}let o=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(d=>d.options.map(p=>p.short).some(p=>/^-\d$/.test(p))):!1,a=null,c=null,u=0;for(;u<t.length||c;){let l=c??t[u++];if(c=null,l==="--"){i===n&&i.push(l),i.push(...t.slice(u));break}if(a&&(!s(l)||o(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,s(l)){let d=this._findOption(l);if(d){if(d.required){let p=t[u++];p===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,p)}else if(d.optional){let p=null;u<t.length&&(!s(t[u])||o(t[u]))&&(p=t[u++]),this.emit(`option:${d.name()}`,p)}else this.emit(`option:${d.name()}`);a=d.variadic?d:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let d=this._findOption(`-${l[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,l.slice(2)):(this.emit(`option:${d.name()}`),c=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let d=l.indexOf("="),p=this._findOption(l.slice(0,d));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,l.slice(d+1));continue}}if(i===r&&s(l)&&!(this.commands.length===0&&o(l))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(l)){r.push(l),n.push(...t.slice(u));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...t.slice(u));break}else if(this._defaultCommandName){n.push(l,...t.slice(u));break}}if(this._passThroughOptions){i.push(l,...t.slice(u));break}i.push(l)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let n=0;n<r;n++){let i=this.options[n].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}
23
- `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
24
- `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
25
- `),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,s=n.code||"commander.error";this._exit(i,s,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in me.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()}`,me.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new g1(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&t.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.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 n=o=>{let a=o.attributeName(),c=this.getOptionValue(a),u=this.options.find(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.attributeName());return u&&(u.presetArg===void 0&&c===!1||u.presetArg!==void 0&&c===u.presetArg)?u:l||o},i=o=>{let a=n(o),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${i(t)} cannot be used with ${i(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);i=i.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);r=Mb(t,i)}let n=`error: unknown option '${t}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),r=Mb(t,i)}let n=`error: unknown command '${t}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(t,r,n){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${t}
26
- `),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 n=this.parent?._findCommand(t);if(n){let i=[n.name()].concat(n.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(n=>p1(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=Lr.basename(t,Lr.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),n=this._getOutputContext(t);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let r=!!t.error,n,i,s;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:s}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let n=this._getOutputContext(t),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let s=this.helpInformation({error:n.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",i))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(me.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(t))throw new Error(`Unexpected value for position to addHelpText.
27
- Expecting one of '${n.join("', '")}'`);let i=`${t}Help`;return this.on(i,s=>{let o;typeof r=="function"?o=r({error:s.error,command:s.command}):o=r,o&&s.write(`${o}
28
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function qb(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",i="9229",s;return(s=t.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?i=s[3]:n=s[3]):(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],n=s[3],i=s[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:t})}function Lp(){if(me.env.NO_COLOR||me.env.FORCE_COLOR==="0"||me.env.FORCE_COLOR==="false")return!1;if(me.env.FORCE_COLOR||me.env.CLICOLOR_FORCE!==void 0)return!0}kp.Command=Dp;kp.useColor=Lp});var $b=v(Vt=>{f();var{Argument:Ub}=Kc(),{Command:jp}=Fb(),{CommanderError:y1,InvalidArgumentError:Vb}=vo(),{Help:v1}=Ip(),{Option:Gb}=Pp();Vt.program=new jp;Vt.createCommand=e=>new jp(e);Vt.createOption=(e,t)=>new Gb(e,t);Vt.createArgument=(e,t)=>new Ub(e,t);Vt.Command=jp;Vt.Option=Gb;Vt.Argument=Ub;Vt.Help=v1;Vt.CommanderError=y1;Vt.InvalidArgumentError=Vb;Vt.InvalidOptionArgumentError=Vb});var Ui=v((qp,Qb)=>{f();var Qc=k("buffer"),yr=Qc.Buffer;function Hb(e,t){for(var r in e)t[r]=e[r]}yr.from&&yr.alloc&&yr.allocUnsafe&&yr.allocUnsafeSlow?Qb.exports=Qc:(Hb(Qc,qp),qp.Buffer=Qn);function Qn(e,t,r){return yr(e,t,r)}Qn.prototype=Object.create(yr.prototype);Hb(yr,Qn);Qn.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return yr(e,t,r)};Qn.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=yr(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};Qn.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return yr(e)};Qn.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Qc.SlowBuffer(e)}});var Fp=v((pue,Wb)=>{f();var Wc=Ui().Buffer,E1=k("stream"),_1=k("util");function Yc(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=Wc.alloc(0),this;if(typeof e.pipe=="function")return this.buffer=Wc.alloc(0),e.pipe(this),this;if(e.length||typeof e=="object")return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}_1.inherits(Yc,E1);Yc.prototype.write=function(t){this.buffer=Wc.concat([this.buffer,Wc.from(t)]),this.emit("data",t)};Yc.prototype.end=function(t){t&&this.write(t),this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1};Wb.exports=Yc});var Jb=v((mue,Yb)=>{"use strict";f();function Up(e){var t=(e/8|0)+(e%8===0?0:1);return t}var S1={ES256:Up(256),ES384:Up(384),ES512:Up(521)};function b1(e){var t=S1[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')}Yb.exports=b1});var nT=v((yue,rT)=>{"use strict";f();var Jc=Ui().Buffer,Xb=Jb(),zc=128,Zb=0,T1=32,w1=16,O1=2,eT=w1|T1|Zb<<6,Xc=O1|Zb<<6;function I1(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function tT(e){if(Jc.isBuffer(e))return e;if(typeof e=="string")return Jc.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function A1(e,t){e=tT(e);var r=Xb(t),n=r+1,i=e.length,s=0;if(e[s++]!==eT)throw new Error('Could not find expected "seq"');var o=e[s++];if(o===(zc|1)&&(o=e[s++]),i-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(e[s++]!==Xc)throw new Error('Could not find expected "int" for "r"');var a=e[s++];if(i-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(i-s-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var c=s;if(s+=a,e[s++]!==Xc)throw new Error('Could not find expected "int" for "s"');var u=e[s++];if(i-s!==u)throw new Error('"s" specified length of "'+u+'", expected "'+(i-s)+'"');if(n<u)throw new Error('"s" specified length of "'+u+'", max of "'+n+'" is acceptable');var l=s;if(s+=u,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var d=r-a,p=r-u,h=Jc.allocUnsafe(d+a+p+u);for(s=0;s<d;++s)h[s]=0;e.copy(h,s,c+Math.max(-d,0),c+a),s=r;for(var g=s;s<g+p;++s)h[s]=0;return e.copy(h,s,l+Math.max(-p,0),l+u),h=h.toString("base64"),h=I1(h),h}function zb(e,t,r){for(var n=0;t+n<r&&e[t+n]===0;)++n;var i=e[t+n]>=zc;return i&&--n,n}function N1(e,t){e=tT(e);var r=Xb(t),n=e.length;if(n!==r*2)throw new TypeError('"'+t+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=zb(e,0,r),s=zb(e,r,e.length),o=r-i,a=r-s,c=2+o+1+1+a,u=c<zc,l=Jc.allocUnsafe((u?2:3)+c),d=0;return l[d++]=eT,u?l[d++]=c:(l[d++]=zc|1,l[d++]=c&255),l[d++]=Xc,l[d++]=o,i<0?(l[d++]=0,d+=e.copy(l,d,0,r)):d+=e.copy(l,d,i,r),l[d++]=Xc,l[d++]=a,s<0?(l[d++]=0,e.copy(l,d,r)):e.copy(l,d,r+s),l}rT.exports={derToJose:A1,joseToDer:N1}});var sT=v((Eue,iT)=>{"use strict";f();var Eo=k("buffer").Buffer,Vp=k("buffer").SlowBuffer;iT.exports=Zc;function Zc(e,t){if(!Eo.isBuffer(e)||!Eo.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}Zc.install=function(){Eo.prototype.equal=Vp.prototype.equal=function(t){return Zc(this,t)}};var C1=Eo.prototype.equal,P1=Vp.prototype.equal;Zc.restore=function(){Eo.prototype.equal=C1,Vp.prototype.equal=P1}});var Kp=v((Sue,hT)=>{f();var Gi=Ui().Buffer,Gt=k("crypto"),aT=nT(),oT=k("util"),R1=`"%s" is not a valid algorithm.
29
- Supported algorithms are:
30
- "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,_o="secret must be a string or buffer",Vi="key must be a string or a buffer",x1="key must be a string, a buffer or an object",$p=typeof Gt.createPublicKey=="function";$p&&(Vi+=" or a KeyObject",_o+="or a KeyObject");function cT(e){if(!Gi.isBuffer(e)&&typeof e!="string"&&(!$p||typeof e!="object"||typeof e.type!="string"||typeof e.asymmetricKeyType!="string"||typeof e.export!="function"))throw ir(Vi)}function uT(e){if(!Gi.isBuffer(e)&&typeof e!="string"&&typeof e!="object")throw ir(x1)}function D1(e){if(!Gi.isBuffer(e)){if(typeof e=="string")return e;if(!$p||typeof e!="object"||e.type!=="secret"||typeof e.export!="function")throw ir(_o)}}function Bp(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function lT(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function ir(e){var t=[].slice.call(arguments,1),r=oT.format.bind(oT,e).apply(null,t);return new TypeError(r)}function L1(e){return Gi.isBuffer(e)||typeof e=="string"}function So(e){return L1(e)||(e=JSON.stringify(e)),e}function fT(e){return function(r,n){D1(n),r=So(r);var i=Gt.createHmac("sha"+e,n),s=(i.update(r),i.digest("base64"));return Bp(s)}}var Gp,k1="timingSafeEqual"in Gt?function(t,r){return t.byteLength!==r.byteLength?!1:Gt.timingSafeEqual(t,r)}:function(t,r){return Gp||(Gp=sT()),Gp(t,r)};function j1(e){return function(r,n,i){var s=fT(e)(r,i);return k1(Gi.from(n),Gi.from(s))}}function dT(e){return function(r,n){uT(n),r=So(r);var i=Gt.createSign("RSA-SHA"+e),s=(i.update(r),i.sign(n,"base64"));return Bp(s)}}function pT(e){return function(r,n,i){cT(i),r=So(r),n=lT(n);var s=Gt.createVerify("RSA-SHA"+e);return s.update(r),s.verify(i,n,"base64")}}function M1(e){return function(r,n){uT(n),r=So(r);var i=Gt.createSign("RSA-SHA"+e),s=(i.update(r),i.sign({key:n,padding:Gt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Gt.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Bp(s)}}function q1(e){return function(r,n,i){cT(i),r=So(r),n=lT(n);var s=Gt.createVerify("RSA-SHA"+e);return s.update(r),s.verify({key:i,padding:Gt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Gt.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function F1(e){var t=dT(e);return function(){var n=t.apply(null,arguments);return n=aT.derToJose(n,"ES"+e),n}}function U1(e){var t=pT(e);return function(n,i,s){i=aT.joseToDer(i,"ES"+e).toString("base64");var o=t(n,i,s);return o}}function V1(){return function(){return""}}function G1(){return function(t,r){return r===""}}hT.exports=function(t){var r={hs:fT,rs:dT,ps:M1,es:F1,none:V1},n={hs:j1,rs:pT,ps:q1,es:U1,none:G1},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw ir(R1,t);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:r[s](o),verify:n[s](o)}}});var Hp=v((Tue,mT)=>{f();var $1=k("buffer").Buffer;mT.exports=function(t){return typeof t=="string"?t:typeof t=="number"||$1.isBuffer(t)?t.toString():JSON.stringify(t)}});var ST=v((Oue,_T)=>{f();var B1=Ui().Buffer,gT=Fp(),K1=Kp(),H1=k("stream"),yT=Hp(),Qp=k("util");function vT(e,t){return B1.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Q1(e,t,r){r=r||"utf8";var n=vT(yT(e),"binary"),i=vT(yT(t),r);return Qp.format("%s.%s",n,i)}function ET(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,i=e.encoding,s=K1(t.alg),o=Q1(t,r,i),a=s.sign(o,n);return Qp.format("%s.%s",o,a)}function eu(e){var t=e.secret;if(t=t??e.privateKey,t=t??e.key,/^hs/i.test(e.header.alg)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new gT(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new gT(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}Qp.inherits(eu,H1);eu.prototype.sign=function(){try{var t=ET({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};eu.sign=ET;_T.exports=eu});var RT=v((Aue,PT)=>{f();var TT=Ui().Buffer,bT=Fp(),W1=Kp(),Y1=k("stream"),wT=Hp(),J1=k("util"),z1=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function X1(e){return Object.prototype.toString.call(e)==="[object Object]"}function Z1(e){if(X1(e))return e;try{return JSON.parse(e)}catch{return}}function OT(e){var t=e.split(".",1)[0];return Z1(TT.from(t,"base64").toString("binary"))}function eU(e){return e.split(".",2).join(".")}function IT(e){return e.split(".")[2]}function tU(e,t){t=t||"utf8";var r=e.split(".")[1];return TT.from(r,"base64").toString(t)}function AT(e){return z1.test(e)&&!!OT(e)}function NT(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=wT(e);var i=IT(e),s=eU(e),o=W1(t);return o.verify(s,i,r)}function CT(e,t){if(t=t||{},e=wT(e),!AT(e))return null;var r=OT(e);if(!r)return null;var n=tU(e);return(r.typ==="JWT"||t.json)&&(n=JSON.parse(n,t.encoding)),{header:r,payload:n,signature:IT(e)}}function $i(e){e=e||{};var t=e.secret;if(t=t??e.publicKey,t=t??e.key,/^hs/i.test(e.algorithm)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new bT(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new bT(e.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}J1.inherits($i,Y1);$i.prototype.verify=function(){try{var t=NT(this.signature.buffer,this.algorithm,this.key.buffer),r=CT(this.signature.buffer,this.encoding);return this.emit("done",t,r),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};$i.decode=CT;$i.isValid=AT;$i.verify=NT;PT.exports=$i});var ru=v(rn=>{f();var xT=ST(),tu=RT(),rU=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];rn.ALGORITHMS=rU;rn.sign=xT.sign;rn.verify=tu.verify;rn.decode=tu.decode;rn.isValid=tu.isValid;rn.createSign=function(t){return new xT(t)};rn.createVerify=function(t){return new tu(t)}});var Wp=v((Rue,DT)=>{f();var nU=ru();DT.exports=function(e,t){t=t||{};var r=nU.decode(e,t);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var i=JSON.parse(n);i!==null&&typeof i=="object"&&(n=i)}catch{}return t.complete===!0?{header:r.header,payload:n,signature:r.signature}:n}});var bo=v((Due,LT)=>{f();var nu=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};nu.prototype=Object.create(Error.prototype);nu.prototype.constructor=nu;LT.exports=nu});var Yp=v((kue,jT)=>{f();var kT=bo(),iu=function(e,t){kT.call(this,e),this.name="NotBeforeError",this.date=t};iu.prototype=Object.create(kT.prototype);iu.prototype.constructor=iu;jT.exports=iu});var Jp=v((Mue,qT)=>{f();var MT=bo(),su=function(e,t){MT.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};su.prototype=Object.create(MT.prototype);su.prototype.constructor=su;qT.exports=su});var UT=v((Fue,FT)=>{f();var Bi=1e3,Ki=Bi*60,Hi=Ki*60,Wn=Hi*24,iU=Wn*7,sU=Wn*365.25;FT.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return oU(e);if(r==="number"&&isFinite(e))return t.long?cU(e):aU(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function oU(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*sU;case"weeks":case"week":case"w":return r*iU;case"days":case"day":case"d":return r*Wn;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Hi;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ki;case"seconds":case"second":case"secs":case"sec":case"s":return r*Bi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function aU(e){var t=Math.abs(e);return t>=Wn?Math.round(e/Wn)+"d":t>=Hi?Math.round(e/Hi)+"h":t>=Ki?Math.round(e/Ki)+"m":t>=Bi?Math.round(e/Bi)+"s":e+"ms"}function cU(e){var t=Math.abs(e);return t>=Wn?ou(e,t,Wn,"day"):t>=Hi?ou(e,t,Hi,"hour"):t>=Ki?ou(e,t,Ki,"minute"):t>=Bi?ou(e,t,Bi,"second"):e+" ms"}function ou(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var zp=v((Vue,VT)=>{f();var uU=UT();VT.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if(typeof e=="string"){var n=uU(e);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof e=="number"?r+e:void 0}});var Qi=v(($ue,GT)=>{"use strict";f();var lU="2.0.0",fU=Number.MAX_SAFE_INTEGER||9007199254740991,dU=16,pU=250,hU=["major","premajor","minor","preminor","patch","prepatch","prerelease"];GT.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:dU,MAX_SAFE_BUILD_LENGTH:pU,MAX_SAFE_INTEGER:fU,RELEASE_TYPES:hU,SEMVER_SPEC_VERSION:lU,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var To=v((Kue,$T)=>{"use strict";f();var mU=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};$T.exports=mU});var Wi=v((vr,BT)=>{"use strict";f();var{MAX_SAFE_COMPONENT_LENGTH:Xp,MAX_SAFE_BUILD_LENGTH:gU,MAX_LENGTH:yU}=Qi(),vU=To();vr=BT.exports={};var EU=vr.re=[],_U=vr.safeRe=[],M=vr.src=[],SU=vr.safeSrc=[],q=vr.t={},bU=0,Zp="[a-zA-Z0-9-]",TU=[["\\s",1],["\\d",yU],[Zp,gU]],wU=e=>{for(let[t,r]of TU)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},J=(e,t,r)=>{let n=wU(t),i=bU++;vU(e,i,t),q[e]=i,M[i]=t,SU[i]=n,EU[i]=new RegExp(t,r?"g":void 0),_U[i]=new RegExp(n,r?"g":void 0)};J("NUMERICIDENTIFIER","0|[1-9]\\d*");J("NUMERICIDENTIFIERLOOSE","\\d+");J("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Zp}*`);J("MAINVERSION",`(${M[q.NUMERICIDENTIFIER]})\\.(${M[q.NUMERICIDENTIFIER]})\\.(${M[q.NUMERICIDENTIFIER]})`);J("MAINVERSIONLOOSE",`(${M[q.NUMERICIDENTIFIERLOOSE]})\\.(${M[q.NUMERICIDENTIFIERLOOSE]})\\.(${M[q.NUMERICIDENTIFIERLOOSE]})`);J("PRERELEASEIDENTIFIER",`(?:${M[q.NONNUMERICIDENTIFIER]}|${M[q.NUMERICIDENTIFIER]})`);J("PRERELEASEIDENTIFIERLOOSE",`(?:${M[q.NONNUMERICIDENTIFIER]}|${M[q.NUMERICIDENTIFIERLOOSE]})`);J("PRERELEASE",`(?:-(${M[q.PRERELEASEIDENTIFIER]}(?:\\.${M[q.PRERELEASEIDENTIFIER]})*))`);J("PRERELEASELOOSE",`(?:-?(${M[q.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${M[q.PRERELEASEIDENTIFIERLOOSE]})*))`);J("BUILDIDENTIFIER",`${Zp}+`);J("BUILD",`(?:\\+(${M[q.BUILDIDENTIFIER]}(?:\\.${M[q.BUILDIDENTIFIER]})*))`);J("FULLPLAIN",`v?${M[q.MAINVERSION]}${M[q.PRERELEASE]}?${M[q.BUILD]}?`);J("FULL",`^${M[q.FULLPLAIN]}$`);J("LOOSEPLAIN",`[v=\\s]*${M[q.MAINVERSIONLOOSE]}${M[q.PRERELEASELOOSE]}?${M[q.BUILD]}?`);J("LOOSE",`^${M[q.LOOSEPLAIN]}$`);J("GTLT","((?:<|>)?=?)");J("XRANGEIDENTIFIERLOOSE",`${M[q.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);J("XRANGEIDENTIFIER",`${M[q.NUMERICIDENTIFIER]}|x|X|\\*`);J("XRANGEPLAIN",`[v=\\s]*(${M[q.XRANGEIDENTIFIER]})(?:\\.(${M[q.XRANGEIDENTIFIER]})(?:\\.(${M[q.XRANGEIDENTIFIER]})(?:${M[q.PRERELEASE]})?${M[q.BUILD]}?)?)?`);J("XRANGEPLAINLOOSE",`[v=\\s]*(${M[q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${M[q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${M[q.XRANGEIDENTIFIERLOOSE]})(?:${M[q.PRERELEASELOOSE]})?${M[q.BUILD]}?)?)?`);J("XRANGE",`^${M[q.GTLT]}\\s*${M[q.XRANGEPLAIN]}$`);J("XRANGELOOSE",`^${M[q.GTLT]}\\s*${M[q.XRANGEPLAINLOOSE]}$`);J("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Xp}})(?:\\.(\\d{1,${Xp}}))?(?:\\.(\\d{1,${Xp}}))?`);J("COERCE",`${M[q.COERCEPLAIN]}(?:$|[^\\d])`);J("COERCEFULL",M[q.COERCEPLAIN]+`(?:${M[q.PRERELEASE]})?(?:${M[q.BUILD]})?(?:$|[^\\d])`);J("COERCERTL",M[q.COERCE],!0);J("COERCERTLFULL",M[q.COERCEFULL],!0);J("LONETILDE","(?:~>?)");J("TILDETRIM",`(\\s*)${M[q.LONETILDE]}\\s+`,!0);vr.tildeTrimReplace="$1~";J("TILDE",`^${M[q.LONETILDE]}${M[q.XRANGEPLAIN]}$`);J("TILDELOOSE",`^${M[q.LONETILDE]}${M[q.XRANGEPLAINLOOSE]}$`);J("LONECARET","(?:\\^)");J("CARETTRIM",`(\\s*)${M[q.LONECARET]}\\s+`,!0);vr.caretTrimReplace="$1^";J("CARET",`^${M[q.LONECARET]}${M[q.XRANGEPLAIN]}$`);J("CARETLOOSE",`^${M[q.LONECARET]}${M[q.XRANGEPLAINLOOSE]}$`);J("COMPARATORLOOSE",`^${M[q.GTLT]}\\s*(${M[q.LOOSEPLAIN]})$|^$`);J("COMPARATOR",`^${M[q.GTLT]}\\s*(${M[q.FULLPLAIN]})$|^$`);J("COMPARATORTRIM",`(\\s*)${M[q.GTLT]}\\s*(${M[q.LOOSEPLAIN]}|${M[q.XRANGEPLAIN]})`,!0);vr.comparatorTrimReplace="$1$2$3";J("HYPHENRANGE",`^\\s*(${M[q.XRANGEPLAIN]})\\s+-\\s+(${M[q.XRANGEPLAIN]})\\s*$`);J("HYPHENRANGELOOSE",`^\\s*(${M[q.XRANGEPLAINLOOSE]})\\s+-\\s+(${M[q.XRANGEPLAINLOOSE]})\\s*$`);J("STAR","(<|>)?=?\\s*\\*");J("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");J("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var au=v((Wue,KT)=>{"use strict";f();var OU=Object.freeze({loose:!0}),IU=Object.freeze({}),AU=e=>e?typeof e!="object"?OU:e:IU;KT.exports=AU});var eh=v((Jue,WT)=>{"use strict";f();var HT=/^[0-9]+$/,QT=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=HT.test(e),n=HT.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},NU=(e,t)=>QT(t,e);WT.exports={compareIdentifiers:QT,rcompareIdentifiers:NU}});var rt=v((Xue,JT)=>{"use strict";f();var cu=To(),{MAX_LENGTH:YT,MAX_SAFE_INTEGER:uu}=Qi(),{safeRe:lu,t:fu}=Wi(),CU=au(),{compareIdentifiers:th}=eh(),rh=class e{constructor(t,r){if(r=CU(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>YT)throw new TypeError(`version is longer than ${YT} characters`);cu("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?lu[fu.LOOSE]:lu[fu.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>uu||this.major<0)throw new TypeError("Invalid major version");if(this.minor>uu||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>uu||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<uu)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(cu("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(cu("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return th(n,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(cu("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return th(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?lu[fu.PRERELEASELOOSE]:lu[fu.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),th(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};JT.exports=rh});var nn=v((ele,XT)=>{"use strict";f();var zT=rt(),PU=(e,t,r=!1)=>{if(e instanceof zT)return e;try{return new zT(e,t)}catch(n){if(!r)return null;throw n}};XT.exports=PU});var ew=v((rle,ZT)=>{"use strict";f();var RU=nn(),xU=(e,t)=>{let r=RU(e,t);return r?r.version:null};ZT.exports=xU});var rw=v((ile,tw)=>{"use strict";f();var DU=nn(),LU=(e,t)=>{let r=DU(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};tw.exports=LU});var sw=v((ole,iw)=>{"use strict";f();var nw=rt(),kU=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new nw(e instanceof nw?e.version:e,r).inc(t,n,i).version}catch{return null}};iw.exports=kU});var cw=v((cle,aw)=>{"use strict";f();var ow=nn(),jU=(e,t)=>{let r=ow(e,null,!0),n=ow(t,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};aw.exports=jU});var lw=v((lle,uw)=>{"use strict";f();var MU=rt(),qU=(e,t)=>new MU(e,t).major;uw.exports=qU});var dw=v((dle,fw)=>{"use strict";f();var FU=rt(),UU=(e,t)=>new FU(e,t).minor;fw.exports=UU});var hw=v((hle,pw)=>{"use strict";f();var VU=rt(),GU=(e,t)=>new VU(e,t).patch;pw.exports=GU});var gw=v((gle,mw)=>{"use strict";f();var $U=nn(),BU=(e,t)=>{let r=$U(e,t);return r&&r.prerelease.length?r.prerelease:null};mw.exports=BU});var $t=v((vle,vw)=>{"use strict";f();var yw=rt(),KU=(e,t,r)=>new yw(e,r).compare(new yw(t,r));vw.exports=KU});var _w=v((_le,Ew)=>{"use strict";f();var HU=$t(),QU=(e,t,r)=>HU(t,e,r);Ew.exports=QU});var bw=v((ble,Sw)=>{"use strict";f();var WU=$t(),YU=(e,t)=>WU(e,t,!0);Sw.exports=YU});var du=v((wle,ww)=>{"use strict";f();var Tw=rt(),JU=(e,t,r)=>{let n=new Tw(e,r),i=new Tw(t,r);return n.compare(i)||n.compareBuild(i)};ww.exports=JU});var Iw=v((Ile,Ow)=>{"use strict";f();var zU=du(),XU=(e,t)=>e.sort((r,n)=>zU(r,n,t));Ow.exports=XU});var Nw=v((Nle,Aw)=>{"use strict";f();var ZU=du(),eV=(e,t)=>e.sort((r,n)=>ZU(n,r,t));Aw.exports=eV});var wo=v((Ple,Cw)=>{"use strict";f();var tV=$t(),rV=(e,t,r)=>tV(e,t,r)>0;Cw.exports=rV});var pu=v((xle,Pw)=>{"use strict";f();var nV=$t(),iV=(e,t,r)=>nV(e,t,r)<0;Pw.exports=iV});var nh=v((Lle,Rw)=>{"use strict";f();var sV=$t(),oV=(e,t,r)=>sV(e,t,r)===0;Rw.exports=oV});var ih=v((jle,xw)=>{"use strict";f();var aV=$t(),cV=(e,t,r)=>aV(e,t,r)!==0;xw.exports=cV});var hu=v((qle,Dw)=>{"use strict";f();var uV=$t(),lV=(e,t,r)=>uV(e,t,r)>=0;Dw.exports=lV});var mu=v((Ule,Lw)=>{"use strict";f();var fV=$t(),dV=(e,t,r)=>fV(e,t,r)<=0;Lw.exports=dV});var sh=v((Gle,kw)=>{"use strict";f();var pV=nh(),hV=ih(),mV=wo(),gV=hu(),yV=pu(),vV=mu(),EV=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return pV(e,r,n);case"!=":return hV(e,r,n);case">":return mV(e,r,n);case">=":return gV(e,r,n);case"<":return yV(e,r,n);case"<=":return vV(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};kw.exports=EV});var Mw=v((Ble,jw)=>{"use strict";f();var _V=rt(),SV=nn(),{safeRe:gu,t:yu}=Wi(),bV=(e,t)=>{if(e instanceof _V)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?gu[yu.COERCEFULL]:gu[yu.COERCE]);else{let c=t.includePrerelease?gu[yu.COERCERTLFULL]:gu[yu.COERCERTL],u;for(;(u=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return SV(`${n}.${i}.${s}${o}${a}`,t)};jw.exports=bV});var Fw=v((Hle,qw)=>{"use strict";f();var TV=nn(),wV=Qi(),OV=rt(),IV=(e,t,r)=>{if(!wV.RELEASE_TYPES.includes(t))return null;let n=AV(e,r);return n&&NV(n,t)},AV=(e,t)=>{let r=e instanceof OV?e.version:e;return TV(r,t)},NV=(e,t)=>{if(CV(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},CV=e=>e.startsWith("pre");qw.exports=IV});var Vw=v((Wle,Uw)=>{"use strict";f();var oh=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}};Uw.exports=oh});var Bt=v((Jle,Kw)=>{"use strict";f();var PV=/\s+/g,ah=class e{constructor(t,r){if(r=xV(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof ch)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(PV," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!$w(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&VV(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(UV,"");let n=((this.options.includePrerelease&&qV)|(this.options.loose&&FV))+":"+t,i=Gw.get(n);if(i)return i;let s=this.options.loose,o=s?ht[nt.HYPHENRANGELOOSE]:ht[nt.HYPHENRANGE];t=t.replace(o,zV(this.options.includePrerelease)),Ie("hyphen replace",t),t=t.replace(ht[nt.COMPARATORTRIM],kV),Ie("comparator trim",t),t=t.replace(ht[nt.TILDETRIM],jV),Ie("tilde trim",t),t=t.replace(ht[nt.CARETTRIM],MV),Ie("caret trim",t);let a=t.split(" ").map(d=>GV(d,this.options)).join(" ").split(/\s+/).map(d=>JV(d,this.options));s&&(a=a.filter(d=>(Ie("loose invalid filter",d,this.options),!!d.match(ht[nt.COMPARATORLOOSE])))),Ie("range list",a);let c=new Map,u=a.map(d=>new ch(d,this.options));for(let d of u){if($w(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return Gw.set(n,l),l}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>Bw(n,r)&&t.set.some(i=>Bw(i,r)&&n.every(s=>i.every(o=>s.intersects(o,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new DV(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(XV(this.set[r],t,this.options))return!0;return!1}};Kw.exports=ah;var RV=Vw(),Gw=new RV,xV=au(),ch=Oo(),Ie=To(),DV=rt(),{safeRe:ht,src:LV,t:nt,comparatorTrimReplace:kV,tildeTrimReplace:jV,caretTrimReplace:MV}=Wi(),{FLAG_INCLUDE_PRERELEASE:qV,FLAG_LOOSE:FV}=Qi(),UV=new RegExp(LV[nt.BUILD],"g"),$w=e=>e.value==="<0.0.0-0",VV=e=>e.value==="",Bw=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(s=>i.intersects(s,t)),i=n.pop();return r},GV=(e,t)=>(e=e.replace(ht[nt.BUILD],""),Ie("comp",e,t),e=KV(e,t),Ie("caret",e),e=$V(e,t),Ie("tildes",e),e=QV(e,t),Ie("xrange",e),e=YV(e,t),Ie("stars",e),e),mt=e=>!e||e.toLowerCase()==="x"||e==="*",$V=(e,t)=>e.trim().split(/\s+/).map(r=>BV(r,t)).join(" "),BV=(e,t)=>{let r=t.loose?ht[nt.TILDELOOSE]:ht[nt.TILDE];return e.replace(r,(n,i,s,o,a)=>{Ie("tilde",e,n,i,s,o,a);let c;return mt(i)?c="":mt(s)?c=`>=${i}.0.0 <${+i+1}.0.0-0`:mt(o)?c=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:a?(Ie("replaceTilde pr",a),c=`>=${i}.${s}.${o}-${a} <${i}.${+s+1}.0-0`):c=`>=${i}.${s}.${o} <${i}.${+s+1}.0-0`,Ie("tilde return",c),c})},KV=(e,t)=>e.trim().split(/\s+/).map(r=>HV(r,t)).join(" "),HV=(e,t)=>{Ie("caret",e,t);let r=t.loose?ht[nt.CARETLOOSE]:ht[nt.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{Ie("caret",e,i,s,o,a,c);let u;return mt(s)?u="":mt(o)?u=`>=${s}.0.0${n} <${+s+1}.0.0-0`:mt(a)?s==="0"?u=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:u=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:c?(Ie("replaceCaret pr",c),s==="0"?o==="0"?u=`>=${s}.${o}.${a}-${c} <${s}.${o}.${+a+1}-0`:u=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`:u=`>=${s}.${o}.${a}-${c} <${+s+1}.0.0-0`):(Ie("no pr"),s==="0"?o==="0"?u=`>=${s}.${o}.${a}${n} <${s}.${o}.${+a+1}-0`:u=`>=${s}.${o}.${a}${n} <${s}.${+o+1}.0-0`:u=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),Ie("caret return",u),u})},QV=(e,t)=>(Ie("replaceXRanges",e,t),e.split(/\s+/).map(r=>WV(r,t)).join(" ")),WV=(e,t)=>{e=e.trim();let r=t.loose?ht[nt.XRANGELOOSE]:ht[nt.XRANGE];return e.replace(r,(n,i,s,o,a,c)=>{Ie("xRange",e,n,i,s,o,a,c);let u=mt(s),l=u||mt(o),d=l||mt(a),p=d;return i==="="&&p&&(i=""),c=t.includePrerelease?"-0":"",u?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&p?(l&&(o=0),a=0,i===">"?(i=">=",l?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",l?s=+s+1:o=+o+1),i==="<"&&(c="-0"),n=`${i+s}.${o}.${a}${c}`):l?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(n=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`),Ie("xRange return",n),n})},YV=(e,t)=>(Ie("replaceStars",e,t),e.trim().replace(ht[nt.STAR],"")),JV=(e,t)=>(Ie("replaceGTE0",e,t),e.trim().replace(ht[t.includePrerelease?nt.GTE0PRE:nt.GTE0],"")),zV=e=>(t,r,n,i,s,o,a,c,u,l,d,p)=>(mt(n)?r="":mt(i)?r=`>=${n}.0.0${e?"-0":""}`:mt(s)?r=`>=${n}.${i}.0${e?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,mt(u)?c="":mt(l)?c=`<${+u+1}.0.0-0`:mt(d)?c=`<${u}.${+l+1}.0-0`:p?c=`<=${u}.${l}.${d}-${p}`:e?c=`<${u}.${l}.${+d+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),XV=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(Ie(e[n].semver),e[n].semver!==ch.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var Oo=v((Xle,zw)=>{"use strict";f();var Io=Symbol("SemVer ANY"),fh=class e{static get ANY(){return Io}constructor(t,r){if(r=Hw(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),lh("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Io?this.value="":this.value=this.operator+this.semver.version,lh("comp",this)}parse(t){let r=this.options.loose?Qw[Ww.COMPARATORLOOSE]:Qw[Ww.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Yw(n[2],this.options.loose):this.semver=Io}toString(){return this.value}test(t){if(lh("Comparator.test",t,this.options.loose),this.semver===Io||t===Io)return!0;if(typeof t=="string")try{t=new Yw(t,this.options)}catch{return!1}return uh(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Jw(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new Jw(this.value,r).test(t.semver):(r=Hw(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||uh(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||uh(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};zw.exports=fh;var Hw=au(),{safeRe:Qw,t:Ww}=Wi(),uh=sh(),lh=To(),Yw=rt(),Jw=Bt()});var Ao=v((efe,Xw)=>{"use strict";f();var ZV=Bt(),eG=(e,t,r)=>{try{t=new ZV(t,r)}catch{return!1}return t.test(e)};Xw.exports=eG});var eO=v((rfe,Zw)=>{"use strict";f();var tG=Bt(),rG=(e,t)=>new tG(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Zw.exports=rG});var rO=v((ife,tO)=>{"use strict";f();var nG=rt(),iG=Bt(),sG=(e,t,r)=>{let n=null,i=null,s=null;try{s=new iG(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new nG(n,r))}),n};tO.exports=sG});var iO=v((ofe,nO)=>{"use strict";f();var oG=rt(),aG=Bt(),cG=(e,t,r)=>{let n=null,i=null,s=null;try{s=new aG(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new oG(n,r))}),n};nO.exports=cG});var aO=v((cfe,oO)=>{"use strict";f();var dh=rt(),uG=Bt(),sO=wo(),lG=(e,t)=>{e=new uG(e,t);let r=new dh("0.0.0");if(e.test(r)||(r=new dh("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],s=null;i.forEach(o=>{let a=new dh(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||sO(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||sO(r,s))&&(r=s)}return r&&e.test(r)?r:null};oO.exports=lG});var uO=v((lfe,cO)=>{"use strict";f();var fG=Bt(),dG=(e,t)=>{try{return new fG(e,t).range||"*"}catch{return null}};cO.exports=dG});var vu=v((dfe,pO)=>{"use strict";f();var pG=rt(),dO=Oo(),{ANY:hG}=dO,mG=Bt(),gG=Ao(),lO=wo(),fO=pu(),yG=mu(),vG=hu(),EG=(e,t,r,n)=>{e=new pG(e,n),t=new mG(t,n);let i,s,o,a,c;switch(r){case">":i=lO,s=yG,o=fO,a=">",c=">=";break;case"<":i=fO,s=vG,o=lO,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(gG(e,t,n))return!1;for(let u=0;u<t.set.length;++u){let l=t.set[u],d=null,p=null;if(l.forEach(h=>{h.semver===hG&&(h=new dO(">=0.0.0")),d=d||h,p=p||h,i(h.semver,d.semver,n)?d=h:o(h.semver,p.semver,n)&&(p=h)}),d.operator===a||d.operator===c||(!p.operator||p.operator===a)&&s(e,p.semver))return!1;if(p.operator===c&&o(e,p.semver))return!1}return!0};pO.exports=EG});var mO=v((hfe,hO)=>{"use strict";f();var _G=vu(),SG=(e,t,r)=>_G(e,t,">",r);hO.exports=SG});var yO=v((gfe,gO)=>{"use strict";f();var bG=vu(),TG=(e,t,r)=>bG(e,t,"<",r);gO.exports=TG});var _O=v((vfe,EO)=>{"use strict";f();var vO=Bt(),wG=(e,t,r)=>(e=new vO(e,r),t=new vO(t,r),e.intersects(t,r));EO.exports=wG});var bO=v((_fe,SO)=>{"use strict";f();var OG=Ao(),IG=$t();SO.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((l,d)=>IG(l,d,r));for(let l of o)OG(l,t,r)?(s=l,i||(i=l)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,d]of n)l===d?a.push(l):!d&&l===o[0]?a.push("*"):d?l===o[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let c=a.join(" || "),u=typeof t.raw=="string"?t.raw:String(t);return c.length<u.length?c:t}});var NO=v((bfe,AO)=>{"use strict";f();var TO=Bt(),mh=Oo(),{ANY:ph}=mh,hh=Ao(),gh=$t(),AG=(e,t,r={})=>{if(e===t)return!0;e=new TO(e,r),t=new TO(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=CG(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},NG=[new mh(">=0.0.0-0")],wO=[new mh(">=0.0.0")],CG=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===ph){if(t.length===1&&t[0].semver===ph)return!0;r.includePrerelease?e=NG:e=wO}if(t.length===1&&t[0].semver===ph){if(r.includePrerelease)return!0;t=wO}let n=new Set,i,s;for(let h of e)h.operator===">"||h.operator===">="?i=OO(i,h,r):h.operator==="<"||h.operator==="<="?s=IO(s,h,r):n.add(h.semver);if(n.size>1)return null;let o;if(i&&s){if(o=gh(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let h of n){if(i&&!hh(h,String(i),r)||s&&!hh(h,String(s),r))return null;for(let g of t)if(!hh(h,String(g),r))return!1;return!0}let a,c,u,l,d=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,p=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let h of t){if(l=l||h.operator===">"||h.operator===">=",u=u||h.operator==="<"||h.operator==="<=",i){if(p&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===p.major&&h.semver.minor===p.minor&&h.semver.patch===p.patch&&(p=!1),h.operator===">"||h.operator===">="){if(a=OO(i,h,r),a===h&&a!==i)return!1}else if(i.operator===">="&&!h.test(i.semver))return!1}if(s){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator==="<"||h.operator==="<="){if(c=IO(s,h,r),c===h&&c!==s)return!1}else if(s.operator==="<="&&!h.test(s.semver))return!1}if(!h.operator&&(s||i)&&o!==0)return!1}return!(i&&u&&!s&&o!==0||s&&l&&!i&&o!==0||p||d)},OO=(e,t,r)=>{if(!e)return t;let n=gh(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},IO=(e,t,r)=>{if(!e)return t;let n=gh(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};AO.exports=AG});var Eu=v((wfe,RO)=>{"use strict";f();var yh=Wi(),CO=Qi(),PG=rt(),PO=eh(),RG=nn(),xG=ew(),DG=rw(),LG=sw(),kG=cw(),jG=lw(),MG=dw(),qG=hw(),FG=gw(),UG=$t(),VG=_w(),GG=bw(),$G=du(),BG=Iw(),KG=Nw(),HG=wo(),QG=pu(),WG=nh(),YG=ih(),JG=hu(),zG=mu(),XG=sh(),ZG=Mw(),e$=Fw(),t$=Oo(),r$=Bt(),n$=Ao(),i$=eO(),s$=rO(),o$=iO(),a$=aO(),c$=uO(),u$=vu(),l$=mO(),f$=yO(),d$=_O(),p$=bO(),h$=NO();RO.exports={parse:RG,valid:xG,clean:DG,inc:LG,diff:kG,major:jG,minor:MG,patch:qG,prerelease:FG,compare:UG,rcompare:VG,compareLoose:GG,compareBuild:$G,sort:BG,rsort:KG,gt:HG,lt:QG,eq:WG,neq:YG,gte:JG,lte:zG,cmp:XG,coerce:ZG,truncate:e$,Comparator:t$,Range:r$,satisfies:n$,toComparators:i$,maxSatisfying:s$,minSatisfying:o$,minVersion:a$,validRange:c$,outside:u$,gtr:l$,ltr:f$,intersects:d$,simplifyRange:p$,subset:h$,SemVer:PG,re:yh.re,src:yh.src,tokens:yh.t,SEMVER_SPEC_VERSION:CO.SEMVER_SPEC_VERSION,RELEASE_TYPES:CO.RELEASE_TYPES,compareIdentifiers:PO.compareIdentifiers,rcompareIdentifiers:PO.rcompareIdentifiers}});var DO=v((Ife,xO)=>{f();var m$=Eu();xO.exports=m$.satisfies(process.version,">=15.7.0")});var kO=v((Nfe,LO)=>{f();var g$=Eu();LO.exports=g$.satisfies(process.version,">=16.9.0")});var vh=v((Pfe,jO)=>{f();var y$=DO(),v$=kO(),E$={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},_$={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};jO.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=E$[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(e))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(y$)switch(r){case"ec":let i=t.asymmetricKeyDetails.namedCurve,s=_$[e];if(i!==s)throw new Error(`"alg" parameter "${e}" requires curve "${s}".`);break;case"rsa-pss":if(v$){let o=parseInt(e.slice(-3),10),{hashAlgorithm:a,mgf1HashAlgorithm:c,saltLength:u}=t.asymmetricKeyDetails;if(a!==`sha${o}`||c!==a)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(u!==void 0&&u>o>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}break}}});var Eh=v((xfe,MO)=>{f();var S$=Eu();MO.exports=S$.satisfies(process.version,"^6.12.0 || >=8.0.0")});var UO=v((Lfe,FO)=>{f();var Oe=bo(),b$=Yp(),qO=Jp(),T$=Wp(),w$=zp(),O$=vh(),I$=Eh(),A$=ru(),{KeyObject:N$,createSecretKey:C$,createPublicKey:P$}=k("crypto"),_h=["RS256","RS384","RS512"],R$=["ES256","ES384","ES512"],Sh=["RS256","RS384","RS512"],x$=["HS256","HS384","HS512"];I$&&(_h.splice(_h.length,0,"PS256","PS384","PS512"),Sh.splice(Sh.length,0,"PS256","PS384","PS512"));FO.exports=function(e,t,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let i;if(n?i=n:i=function(l,d){if(l)throw l;return d},r.clockTimestamp&&typeof r.clockTimestamp!="number")return i(new Oe("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return i(new Oe("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return i(new Oe("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return i(new Oe("jwt must be provided"));if(typeof e!="string")return i(new Oe("jwt must be a string"));let o=e.split(".");if(o.length!==3)return i(new Oe("jwt malformed"));let a;try{a=T$(e,{complete:!0})}catch(l){return i(l)}if(!a)return i(new Oe("invalid token"));let c=a.header,u;if(typeof t=="function"){if(!n)return i(new Oe("verify must be called asynchronous if secret or public key is provided as a callback"));u=t}else u=function(l,d){return d(null,t)};return u(c,function(l,d){if(l)return i(new Oe("error in secret or public key callback: "+l.message));let p=o[2].trim()!=="";if(!p&&d)return i(new Oe("jwt signature is required"));if(p&&!d)return i(new Oe("secret or public key must be provided"));if(!p&&!r.algorithms)return i(new Oe('please specify "none" in "algorithms" to verify unsigned tokens'));if(d!=null&&!(d instanceof N$))try{d=P$(d)}catch{try{d=C$(typeof d=="string"?Buffer.from(d):d)}catch{return i(new Oe("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(d.type==="secret"?r.algorithms=x$:["rsa","rsa-pss"].includes(d.asymmetricKeyType)?r.algorithms=Sh:d.asymmetricKeyType==="ec"?r.algorithms=R$:r.algorithms=_h),r.algorithms.indexOf(a.header.alg)===-1)return i(new Oe("invalid algorithm"));if(c.alg.startsWith("HS")&&d.type!=="secret")return i(new Oe(`secretOrPublicKey must be a symmetric key when using ${c.alg}`));if(/^(?:RS|PS|ES)/.test(c.alg)&&d.type!=="public")return i(new Oe(`secretOrPublicKey must be an asymmetric key when using ${c.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{O$(c.alg,d)}catch(y){return i(y)}let h;try{h=A$.verify(e,a.header.alg,d)}catch(y){return i(y)}if(!h)return i(new Oe("invalid signature"));let g=a.payload;if(typeof g.nbf<"u"&&!r.ignoreNotBefore){if(typeof g.nbf!="number")return i(new Oe("invalid nbf value"));if(g.nbf>s+(r.clockTolerance||0))return i(new b$("jwt not active",new Date(g.nbf*1e3)))}if(typeof g.exp<"u"&&!r.ignoreExpiration){if(typeof g.exp!="number")return i(new Oe("invalid exp value"));if(s>=g.exp+(r.clockTolerance||0))return i(new qO("jwt expired",new Date(g.exp*1e3)))}if(r.audience){let y=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(g.aud)?g.aud:[g.aud]).some(function(_){return y.some(function(w){return w instanceof RegExp?w.test(_):w===_})}))return i(new Oe("jwt audience invalid. expected: "+y.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&g.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(g.iss)===-1))return i(new Oe("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&g.sub!==r.subject)return i(new Oe("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&g.jti!==r.jwtid)return i(new Oe("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&g.nonce!==r.nonce)return i(new Oe("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof g.iat!="number")return i(new Oe("iat required when maxAge is specified"));let y=w$(r.maxAge,g.iat);if(typeof y>"u")return i(new Oe('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=y+(r.clockTolerance||0))return i(new qO("maxAge exceeded",new Date(y*1e3)))}if(r.complete===!0){let y=a.signature;return i(null,{header:c,payload:g,signature:y})}return i(null,g)})}});var HO=v((jfe,KO)=>{f();var VO=1/0,$O=9007199254740991,D$=17976931348623157e292,GO=NaN,L$="[object Arguments]",k$="[object Function]",j$="[object GeneratorFunction]",M$="[object String]",q$="[object Symbol]",F$=/^\s+|\s+$/g,U$=/^[-+]0x[0-9a-f]+$/i,V$=/^0b[01]+$/i,G$=/^0o[0-7]+$/i,$$=/^(?:0|[1-9]\d*)$/,B$=parseInt;function K$(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function H$(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function Q$(e,t,r){if(t!==t)return H$(e,W$,r);for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function W$(e){return e!==e}function Y$(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function J$(e,t){return K$(t,function(r){return e[r]})}function z$(e,t){return function(r){return e(t(r))}}var _u=Object.prototype,Th=_u.hasOwnProperty,Su=_u.toString,X$=_u.propertyIsEnumerable,Z$=z$(Object.keys,Object),eB=Math.max;function tB(e,t){var r=BO(e)||oB(e)?Y$(e.length,String):[],n=r.length,i=!!n;for(var s in e)(t||Th.call(e,s))&&!(i&&(s=="length"||nB(s,n)))&&r.push(s);return r}function rB(e){if(!iB(e))return Z$(e);var t=[];for(var r in Object(e))Th.call(e,r)&&r!="constructor"&&t.push(r);return t}function nB(e,t){return t=t??$O,!!t&&(typeof e=="number"||$$.test(e))&&e>-1&&e%1==0&&e<t}function iB(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||_u;return e===r}function sB(e,t,r,n){e=wh(e)?e:gB(e),r=r&&!n?pB(r):0;var i=e.length;return r<0&&(r=eB(i+r,0)),lB(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Q$(e,t,r)>-1}function oB(e){return aB(e)&&Th.call(e,"callee")&&(!X$.call(e,"callee")||Su.call(e)==L$)}var BO=Array.isArray;function wh(e){return e!=null&&uB(e.length)&&!cB(e)}function aB(e){return Oh(e)&&wh(e)}function cB(e){var t=bh(e)?Su.call(e):"";return t==k$||t==j$}function uB(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$O}function bh(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Oh(e){return!!e&&typeof e=="object"}function lB(e){return typeof e=="string"||!BO(e)&&Oh(e)&&Su.call(e)==M$}function fB(e){return typeof e=="symbol"||Oh(e)&&Su.call(e)==q$}function dB(e){if(!e)return e===0?e:0;if(e=hB(e),e===VO||e===-VO){var t=e<0?-1:1;return t*D$}return e===e?e:0}function pB(e){var t=dB(e),r=t%1;return t===t?r?t-r:t:0}function hB(e){if(typeof e=="number")return e;if(fB(e))return GO;if(bh(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=bh(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(F$,"");var r=V$.test(e);return r||G$.test(e)?B$(e.slice(2),r?2:8):U$.test(e)?GO:+e}function mB(e){return wh(e)?tB(e):rB(e)}function gB(e){return e?J$(e,mB(e)):[]}KO.exports=sB});var WO=v((qfe,QO)=>{f();var yB="[object Boolean]",vB=Object.prototype,EB=vB.toString;function _B(e){return e===!0||e===!1||SB(e)&&EB.call(e)==yB}function SB(e){return!!e&&typeof e=="object"}QO.exports=_B});var ZO=v((Ufe,XO)=>{f();var YO=1/0,bB=17976931348623157e292,JO=NaN,TB="[object Symbol]",wB=/^\s+|\s+$/g,OB=/^[-+]0x[0-9a-f]+$/i,IB=/^0b[01]+$/i,AB=/^0o[0-7]+$/i,NB=parseInt,CB=Object.prototype,PB=CB.toString;function RB(e){return typeof e=="number"&&e==kB(e)}function zO(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function xB(e){return!!e&&typeof e=="object"}function DB(e){return typeof e=="symbol"||xB(e)&&PB.call(e)==TB}function LB(e){if(!e)return e===0?e:0;if(e=jB(e),e===YO||e===-YO){var t=e<0?-1:1;return t*bB}return e===e?e:0}function kB(e){var t=LB(e),r=t%1;return t===t?r?t-r:t:0}function jB(e){if(typeof e=="number")return e;if(DB(e))return JO;if(zO(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=zO(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(wB,"");var r=IB.test(e);return r||AB.test(e)?NB(e.slice(2),r?2:8):OB.test(e)?JO:+e}XO.exports=RB});var tI=v((Gfe,eI)=>{f();var MB="[object Number]",qB=Object.prototype,FB=qB.toString;function UB(e){return!!e&&typeof e=="object"}function VB(e){return typeof e=="number"||UB(e)&&FB.call(e)==MB}eI.exports=VB});var sI=v((Bfe,iI)=>{f();var GB="[object Object]";function $B(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function BB(e,t){return function(r){return e(t(r))}}var KB=Function.prototype,rI=Object.prototype,nI=KB.toString,HB=rI.hasOwnProperty,QB=nI.call(Object),WB=rI.toString,YB=BB(Object.getPrototypeOf,Object);function JB(e){return!!e&&typeof e=="object"}function zB(e){if(!JB(e)||WB.call(e)!=GB||$B(e))return!1;var t=YB(e);if(t===null)return!0;var r=HB.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&nI.call(r)==QB}iI.exports=zB});var aI=v((Hfe,oI)=>{f();var XB="[object String]",ZB=Object.prototype,eK=ZB.toString,tK=Array.isArray;function rK(e){return!!e&&typeof e=="object"}function nK(e){return typeof e=="string"||!tK(e)&&rK(e)&&eK.call(e)==XB}oI.exports=nK});var dI=v((Wfe,fI)=>{f();var iK="Expected a function",cI=1/0,sK=17976931348623157e292,uI=NaN,oK="[object Symbol]",aK=/^\s+|\s+$/g,cK=/^[-+]0x[0-9a-f]+$/i,uK=/^0b[01]+$/i,lK=/^0o[0-7]+$/i,fK=parseInt,dK=Object.prototype,pK=dK.toString;function hK(e,t){var r;if(typeof t!="function")throw new TypeError(iK);return e=EK(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}function mK(e){return hK(2,e)}function lI(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function gK(e){return!!e&&typeof e=="object"}function yK(e){return typeof e=="symbol"||gK(e)&&pK.call(e)==oK}function vK(e){if(!e)return e===0?e:0;if(e=_K(e),e===cI||e===-cI){var t=e<0?-1:1;return t*sK}return e===e?e:0}function EK(e){var t=vK(e),r=t%1;return t===t?r?t-r:t:0}function _K(e){if(typeof e=="number")return e;if(yK(e))return uI;if(lI(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=lI(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(aK,"");var r=uK.test(e);return r||lK.test(e)?fK(e.slice(2),r?2:8):cK.test(e)?uI:+e}fI.exports=mK});var SI=v((Jfe,_I)=>{f();var pI=zp(),SK=Eh(),bK=vh(),hI=ru(),TK=HO(),bu=WO(),mI=ZO(),Ih=tI(),yI=sI(),sn=aI(),wK=dI(),{KeyObject:OK,createSecretKey:IK,createPrivateKey:AK}=k("crypto"),vI=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];SK&&vI.splice(3,0,"PS256","PS384","PS512");var NK={expiresIn:{isValid:function(e){return mI(e)||sn(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return mI(e)||sn(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return sn(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:TK.bind(null,vI),message:'"algorithm" must be a valid string enum value'},header:{isValid:yI,message:'"header" must be an object'},encoding:{isValid:sn,message:'"encoding" must be a string'},issuer:{isValid:sn,message:'"issuer" must be a string'},subject:{isValid:sn,message:'"subject" must be a string'},jwtid:{isValid:sn,message:'"jwtid" must be a string'},noTimestamp:{isValid:bu,message:'"noTimestamp" must be a boolean'},keyid:{isValid:sn,message:'"keyid" must be a string'},mutatePayload:{isValid:bu,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:bu,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:bu,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},CK={iat:{isValid:Ih,message:'"iat" should be a number of seconds'},exp:{isValid:Ih,message:'"exp" should be a number of seconds'},nbf:{isValid:Ih,message:'"nbf" should be a number of seconds'}};function EI(e,t,r,n){if(!yI(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(i){let s=e[i];if(!s){if(!t)throw new Error('"'+i+'" is not allowed in "'+n+'"');return}if(!s.isValid(r[i]))throw new Error(s.message)})}function PK(e){return EI(NK,!1,e,"options")}function RK(e){return EI(CK,!0,e,"payload")}var gI={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},xK=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];_I.exports=function(e,t,r,n){typeof r=="function"?(n=r,r={}):r=r||{};let i=typeof e=="object"&&!Buffer.isBuffer(e),s=Object.assign({alg:r.algorithm||"HS256",typ:i?"JWT":void 0,kid:r.keyid},r.header);function o(u){if(n)return n(u);throw u}if(!t&&r.algorithm!=="none")return o(new Error("secretOrPrivateKey must have a value"));if(t!=null&&!(t instanceof OK))try{t=AK(t)}catch{try{t=IK(typeof t=="string"?Buffer.from(t):t)}catch{return o(new Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&t.type!=="secret")return o(new Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));if(/^(?:RS|PS|ES)/.test(s.alg)){if(t.type!=="private")return o(new Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!r.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&t.asymmetricKeyDetails!==void 0&&t.asymmetricKeyDetails.modulusLength<2048)return o(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof e>"u")return o(new Error("payload is required"));if(i){try{RK(e)}catch(u){return o(u)}r.mutatePayload||(e=Object.assign({},e))}else{let u=xK.filter(function(l){return typeof r[l]<"u"});if(u.length>0)return o(new Error("invalid "+u.join(",")+" option for "+typeof e+" payload"))}if(typeof e.exp<"u"&&typeof r.expiresIn<"u")return o(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof e.nbf<"u"&&typeof r.notBefore<"u")return o(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{PK(r)}catch(u){return o(u)}if(!r.allowInvalidAsymmetricKeyTypes)try{bK(s.alg,t)}catch(u){return o(u)}let a=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:i&&(e.iat=a),typeof r.notBefore<"u"){try{e.nbf=pI(r.notBefore,a)}catch(u){return o(u)}if(typeof e.nbf>"u")return o(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof e=="object"){try{e.exp=pI(r.expiresIn,a)}catch(u){return o(u)}if(typeof e.exp>"u")return o(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(gI).forEach(function(u){let l=gI[u];if(typeof r[u]<"u"){if(typeof e[l]<"u")return o(new Error('Bad "options.'+u+'" option. The payload already has an "'+l+'" property.'));e[l]=r[u]}});let c=r.encoding||"utf8";if(typeof n=="function")n=n&&wK(n),hI.createSign({header:s,privateKey:t,payload:e,encoding:c}).once("error",n).once("done",function(u){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&u.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));n(null,u)});else{let u=hI.sign({header:s,payload:e,secret:t,encoding:c});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&u.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return u}}});var No=v((Xfe,bI)=>{f();bI.exports={decode:Wp(),verify:UO(),sign:SI(),JsonWebTokenError:bo(),NotBeforeError:Yp(),TokenExpiredError:Jp()}});var NI=v(Yi=>{"use strict";f();Object.defineProperty(Yi,"__esModule",{value:!0});Yi.versionInfo=Yi.version=void 0;var MK="15.10.2";Yi.version=MK;var qK=Object.freeze({major:15,minor:10,patch:2,preReleaseTag:null});Yi.versionInfo=qK});var Ou=v(Ch=>{"use strict";f();Object.defineProperty(Ch,"__esModule",{value:!0});Ch.default=FK;function FK(e){return typeof e?.then=="function"}});var Kt=v(Ph=>{"use strict";f();Object.defineProperty(Ph,"__esModule",{value:!0});Ph.default=UK;function UK(e,t){var r=!!e;if(!r)throw new Error(t)}});var Er=v(Rh=>{"use strict";f();Object.defineProperty(Rh,"__esModule",{value:!0});Rh.default=VK;function Iu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Iu=function(r){return typeof r}:Iu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Iu(e)}function VK(e){return Iu(e)=="object"&&e!==null}});var _r=v(an=>{"use strict";f();Object.defineProperty(an,"__esModule",{value:!0});an.SYMBOL_TO_STRING_TAG=an.SYMBOL_ASYNC_ITERATOR=an.SYMBOL_ITERATOR=void 0;var GK=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator";an.SYMBOL_ITERATOR=GK;var $K=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator";an.SYMBOL_ASYNC_ITERATOR=$K;var BK=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";an.SYMBOL_TO_STRING_TAG=BK});var Au=v(xh=>{"use strict";f();Object.defineProperty(xh,"__esModule",{value:!0});xh.getLocation=KK;function KK(e,t){for(var r=/\r\n|[\n\r]/g,n=1,i=t+1,s;(s=r.exec(e.body))&&s.index<t;)n+=1,i=t+1-(s.index+s[0].length);return{line:n,column:i}}});var Dh=v(Cu=>{"use strict";f();Object.defineProperty(Cu,"__esModule",{value:!0});Cu.printLocation=QK;Cu.printSourceLocation=PI;var HK=Au();function QK(e){return PI(e.source,(0,HK.getLocation)(e.source,e.start))}function PI(e,t){var r=e.locationOffset.column-1,n=Nu(r)+e.body,i=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=t.line===1?r:0,c=t.column+a,u="".concat(e.name,":").concat(o,":").concat(c,`
31
- `),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var p=Math.floor(c/80),h=c%80,g=[],y=0;y<d.length;y+=80)g.push(d.slice(y,y+80));return u+CI([["".concat(o),g[0]]].concat(g.slice(1,p+1).map(function(E){return["",E]}),[[" ",Nu(h-1)+"^"],["",g[p+1]]]))}return u+CI([["".concat(o-1),l[i-1]],["".concat(o),d],["",Nu(c-1)+"^"],["".concat(o+1),l[i+1]]])}function CI(e){var t=e.filter(function(n){var i=n[0],s=n[1];return s!==void 0}),r=Math.max.apply(Math,t.map(function(n){var i=n[0];return i.length}));return t.map(function(n){var i=n[0],s=n[1];return WK(r,i)+(s?" | "+s:" |")}).join(`
32
- `)}function Nu(e){return Array(e+1).join(" ")}function WK(e,t){return Nu(e-t.length)+t}});var H=v(Ji=>{"use strict";f();function Pu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Pu=function(r){return typeof r}:Pu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Pu(e)}Object.defineProperty(Ji,"__esModule",{value:!0});Ji.printError=FI;Ji.formatError=UI;Ji.GraphQLError=void 0;var YK=jI(Kt()),JK=jI(Er()),zK=_r(),RI=Au(),xI=Dh();function jI(e){return e&&e.__esModule?e:{default:e}}function DI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function XK(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DI(Object(r),!0).forEach(function(n){ZK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZK(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function tH(e,t,r){return t&&LI(e.prototype,t),r&&LI(e,r),e}function rH(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ro(e,t)}function nH(e){var t=qI();return function(){var n=xo(e),i;if(t){var s=xo(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return MI(this,i)}}function MI(e,t){return t&&(Pu(t)==="object"||typeof t=="function")?t:Po(e)}function Po(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lh(e){var t=typeof Map=="function"?new Map:void 0;return Lh=function(n){if(n===null||!iH(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return Ru(n,arguments,xo(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ro(i,n)},Lh(e)}function Ru(e,t,r){return qI()?Ru=Reflect.construct:Ru=function(i,s,o){var a=[null];a.push.apply(a,s);var c=Function.bind.apply(i,a),u=new c;return o&&Ro(u,o.prototype),u},Ru.apply(null,arguments)}function qI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function iH(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ro(e,t){return Ro=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ro(e,t)}function xo(e){return xo=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},xo(e)}var sH=(function(e){rH(r,e);var t=nH(r);function r(n,i,s,o,a,c,u){var l,d,p,h;eH(this,r),h=t.call(this,n),h.name="GraphQLError",h.originalError=c??void 0,h.nodes=kI(Array.isArray(i)?i:i?[i]:void 0);for(var g=[],y=0,E=(S=h.nodes)!==null&&S!==void 0?S:[];y<E.length;y++){var S,_=E[y],w=_.loc;w!=null&&g.push(w)}g=kI(g),h.source=s??((l=g)===null||l===void 0?void 0:l[0].source),h.positions=o??((d=g)===null||d===void 0?void 0:d.map(function(T){return T.start})),h.locations=o&&s?o.map(function(T){return(0,RI.getLocation)(s,T)}):(p=g)===null||p===void 0?void 0:p.map(function(T){return(0,RI.getLocation)(T.source,T.start)}),h.path=a??void 0;var I=c?.extensions;return u==null&&(0,JK.default)(I)?h.extensions=XK({},I):h.extensions=u??{},Object.defineProperties(Po(h),{message:{enumerable:!0},locations:{enumerable:h.locations!=null},path:{enumerable:h.path!=null},extensions:{enumerable:h.extensions!=null&&Object.keys(h.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),c!=null&&c.stack?(Object.defineProperty(Po(h),"stack",{value:c.stack,writable:!0,configurable:!0}),MI(h)):(Error.captureStackTrace?Error.captureStackTrace(Po(h),r):Object.defineProperty(Po(h),"stack",{value:Error().stack,writable:!0,configurable:!0}),h)}return tH(r,[{key:"toString",value:function(){return FI(this)}},{key:"toJSON",value:function(){return UI(this)}},{key:zK.SYMBOL_TO_STRING_TAG,get:function(){return"Object"}}]),r})(Lh(Error));Ji.GraphQLError=sH;function kI(e){return e===void 0||e.length===0?void 0:e}function FI(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r<n.length;r++){var i=n[r];i.loc&&(t+=`
33
-
34
- `+(0,xI.printLocation)(i.loc))}else if(e.source&&e.locations)for(var s=0,o=e.locations;s<o.length;s++){var a=o[s];t+=`
35
-
36
- `+(0,xI.printSourceLocation)(e.source,a)}return t}function UI(e){var t;e||(0,YK.default)(0,"Received null or undefined error.");var r=(t=e.message)!==null&&t!==void 0?t:"An unknown error occurred.",n=e.locations,i=e.path,s=e.extensions;return s&&Object.keys(s).length>0?{message:r,locations:n,path:i,extensions:s}:{message:r,locations:n,path:i}}});var xu=v(kh=>{"use strict";f();Object.defineProperty(kh,"__esModule",{value:!0});kh.syntaxError=aH;var oH=H();function aH(e,t,r){return new oH.GraphQLError("Syntax Error: ".concat(r),void 0,e,[t])}});var be=v(Du=>{"use strict";f();Object.defineProperty(Du,"__esModule",{value:!0});Du.Kind=void 0;var cH=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});Du.Kind=cH});var st=v(jh=>{"use strict";f();Object.defineProperty(jh,"__esModule",{value:!0});jh.default=uH;function uH(e,t){var r=!!e;if(!r)throw new Error(t??"Unexpected invariant triggered.")}});var Mh=v(Lu=>{"use strict";f();Object.defineProperty(Lu,"__esModule",{value:!0});Lu.default=void 0;var lH=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,fH=lH;Lu.default=fH});var ku=v(qh=>{"use strict";f();Object.defineProperty(qh,"__esModule",{value:!0});qh.default=pH;var dH=GI(st()),VI=GI(Mh());function GI(e){return e&&e.__esModule?e:{default:e}}function pH(e){var t=e.prototype.toJSON;typeof t=="function"||(0,dH.default)(0),e.prototype.inspect=t,VI.default&&(e.prototype[VI.default]=t)}});var zi=v(Xn=>{"use strict";f();Object.defineProperty(Xn,"__esModule",{value:!0});Xn.isNode=mH;Xn.Token=Xn.Location=void 0;var $I=hH(ku());function hH(e){return e&&e.__esModule?e:{default:e}}var BI=(function(){function e(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var t=e.prototype;return t.toJSON=function(){return{start:this.start,end:this.end}},e})();Xn.Location=BI;(0,$I.default)(BI);var KI=(function(){function e(r,n,i,s,o,a,c){this.kind=r,this.start=n,this.end=i,this.line=s,this.column=o,this.value=c,this.prev=a,this.next=null}var t=e.prototype;return t.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e})();Xn.Token=KI;(0,$I.default)(KI);function mH(e){return e!=null&&typeof e.kind=="string"}});var Xi=v(ju=>{"use strict";f();Object.defineProperty(ju,"__esModule",{value:!0});ju.TokenKind=void 0;var gH=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});ju.TokenKind=gH});var fe=v(Fh=>{"use strict";f();Object.defineProperty(Fh,"__esModule",{value:!0});Fh.default=_H;var yH=vH(Mh());function vH(e){return e&&e.__esModule?e:{default:e}}function Mu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mu=function(r){return typeof r}:Mu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Mu(e)}var EH=10,HI=2;function _H(e){return qu(e,[])}function qu(e,t){switch(Mu(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return e===null?"null":SH(e,t);default:return String(e)}}function SH(e,t){if(t.indexOf(e)!==-1)return"[Circular]";var r=[].concat(t,[e]),n=wH(e);if(n!==void 0){var i=n.call(e);if(i!==e)return typeof i=="string"?i:qu(i,r)}else if(Array.isArray(e))return TH(e,r);return bH(e,r)}function bH(e,t){var r=Object.keys(e);if(r.length===0)return"{}";if(t.length>HI)return"["+OH(e)+"]";var n=r.map(function(i){var s=qu(e[i],t);return i+": "+s});return"{ "+n.join(", ")+" }"}function TH(e,t){if(e.length===0)return"[]";if(t.length>HI)return"[Array]";for(var r=Math.min(EH,e.length),n=e.length-r,i=[],s=0;s<r;++s)i.push(qu(e[s],t));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function wH(e){var t=e[String(yH.default)];if(typeof t=="function")return t;if(typeof e.inspect=="function")return e.inspect}function OH(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){var r=e.constructor.name;if(typeof r=="string"&&r!=="")return r}return t}});var Do=v(Uu=>{"use strict";f();Object.defineProperty(Uu,"__esModule",{value:!0});Uu.default=void 0;var IH=AH(fe());function AH(e){return e&&e.__esModule?e:{default:e}}function Fu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fu=function(r){return typeof r}:Fu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Fu(e)}var NH=process.env.NODE_ENV==="production"?function(t,r){return t instanceof r}:function(t,r){if(t instanceof r)return!0;if(Fu(t)==="object"&&t!==null){var n,i=r.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(n=t.constructor)===null||n===void 0?void 0:n.name;if(i===s){var o=(0,IH.default)(t);throw new Error("Cannot use ".concat(i,' "').concat(o,`" from another module or realm.
37
-
38
- Ensure that there is only one instance of "graphql" in the node_modules
39
- directory. If different versions of "graphql" are the dependencies of other
40
- relied on modules, use "resolutions" to ensure only one version is installed.
41
-
42
- https://yarnpkg.com/en/docs/selective-version-resolutions
43
-
44
- Duplicate "graphql" modules cannot be used at the same time since different
45
- versions may have different capabilities and behavior. The data from one
46
- version used in the function from another could produce confusing and
47
- spurious results.`))}}return!1};Uu.default=NH});var Vu=v(Lo=>{"use strict";f();Object.defineProperty(Lo,"__esModule",{value:!0});Lo.isSource=DH;Lo.Source=void 0;var CH=_r(),PH=Vh(fe()),Uh=Vh(Kt()),RH=Vh(Do());function Vh(e){return e&&e.__esModule?e:{default:e}}function QI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function xH(e,t,r){return t&&QI(e.prototype,t),r&&QI(e,r),e}var WI=(function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof t=="string"||(0,Uh.default)(0,"Body must be a string. Received: ".concat((0,PH.default)(t),".")),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||(0,Uh.default)(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,Uh.default)(0,"column in locationOffset is 1-indexed and must be positive.")}return xH(e,[{key:CH.SYMBOL_TO_STRING_TAG,get:function(){return"Source"}}]),e})();Lo.Source=WI;function DH(e){return(0,RH.default)(e,WI)}});var Zi=v(Gu=>{"use strict";f();Object.defineProperty(Gu,"__esModule",{value:!0});Gu.DirectiveLocation=void 0;var LH=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});Gu.DirectiveLocation=LH});var es=v(ko=>{"use strict";f();Object.defineProperty(ko,"__esModule",{value:!0});ko.dedentBlockStringValue=kH;ko.getBlockStringIndentation=JI;ko.printBlockString=jH;function kH(e){var t=e.split(/\r\n|[\n\r]/g),r=JI(e);if(r!==0)for(var n=1;n<t.length;n++)t[n]=t[n].slice(r);for(var i=0;i<t.length&&YI(t[i]);)++i;for(var s=t.length;s>i&&YI(t[s-1]);)--s;return t.slice(i,s).join(`
48
- `)}function YI(e){for(var t=0;t<e.length;++t)if(e[t]!==" "&&e[t]!==" ")return!1;return!0}function JI(e){for(var t,r=!0,n=!0,i=0,s=null,o=0;o<e.length;++o)switch(e.charCodeAt(o)){case 13:e.charCodeAt(o+1)===10&&++o;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(s===null||i<s)&&(s=i),n=!1}return(t=s)!==null&&t!==void 0?t:0}function jH(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=e.indexOf(`
49
- `)===-1,i=e[0]===" "||e[0]===" ",s=e[e.length-1]==='"',o=e[e.length-1]==="\\",a=!n||s||o||r,c="";return a&&!(n&&i)&&(c+=`
50
- `+t),c+=t?e.replace(/\n/g,`
51
- `+t):e,a&&(c+=`
52
- `),'"""'+c.replace(/"""/g,'\\"""')+'"""'}});var Bu=v(jo=>{"use strict";f();Object.defineProperty(jo,"__esModule",{value:!0});jo.isPunctuatorTokenKind=FH;jo.Lexer=void 0;var Sr=xu(),Fe=zi(),re=Xi(),MH=es(),qH=(function(){function e(r){var n=new Fe.Token(re.TokenKind.SOF,0,0,0,0,null);this.source=r,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){this.lastToken=this.token;var n=this.token=this.lookahead();return n},t.lookahead=function(){var n=this.token;if(n.kind!==re.TokenKind.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=UH(this,n)}while(n.kind===re.TokenKind.COMMENT);return n},e})();jo.Lexer=qH;function FH(e){return e===re.TokenKind.BANG||e===re.TokenKind.DOLLAR||e===re.TokenKind.AMP||e===re.TokenKind.PAREN_L||e===re.TokenKind.PAREN_R||e===re.TokenKind.SPREAD||e===re.TokenKind.COLON||e===re.TokenKind.EQUALS||e===re.TokenKind.AT||e===re.TokenKind.BRACKET_L||e===re.TokenKind.BRACKET_R||e===re.TokenKind.BRACE_L||e===re.TokenKind.PIPE||e===re.TokenKind.BRACE_R}function Zn(e){return isNaN(e)?re.TokenKind.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function UH(e,t){for(var r=e.source,n=r.body,i=n.length,s=t.end;s<i;){var o=n.charCodeAt(s),a=e.line,c=1+s-e.lineStart;switch(o){case 65279:case 9:case 32:case 44:++s;continue;case 10:++s,++e.line,e.lineStart=s;continue;case 13:n.charCodeAt(s+1)===10?s+=2:++s,++e.line,e.lineStart=s;continue;case 33:return new Fe.Token(re.TokenKind.BANG,s,s+1,a,c,t);case 35:return GH(r,s,a,c,t);case 36:return new Fe.Token(re.TokenKind.DOLLAR,s,s+1,a,c,t);case 38:return new Fe.Token(re.TokenKind.AMP,s,s+1,a,c,t);case 40:return new Fe.Token(re.TokenKind.PAREN_L,s,s+1,a,c,t);case 41:return new Fe.Token(re.TokenKind.PAREN_R,s,s+1,a,c,t);case 46:if(n.charCodeAt(s+1)===46&&n.charCodeAt(s+2)===46)return new Fe.Token(re.TokenKind.SPREAD,s,s+3,a,c,t);break;case 58:return new Fe.Token(re.TokenKind.COLON,s,s+1,a,c,t);case 61:return new Fe.Token(re.TokenKind.EQUALS,s,s+1,a,c,t);case 64:return new Fe.Token(re.TokenKind.AT,s,s+1,a,c,t);case 91:return new Fe.Token(re.TokenKind.BRACKET_L,s,s+1,a,c,t);case 93:return new Fe.Token(re.TokenKind.BRACKET_R,s,s+1,a,c,t);case 123:return new Fe.Token(re.TokenKind.BRACE_L,s,s+1,a,c,t);case 124:return new Fe.Token(re.TokenKind.PIPE,s,s+1,a,c,t);case 125:return new Fe.Token(re.TokenKind.BRACE_R,s,s+1,a,c,t);case 34:return n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34?KH(r,s,a,c,t,e):BH(r,s,a,c,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return $H(r,s,o,a,c,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return QH(r,s,a,c,t)}throw(0,Sr.syntaxError)(r,s,VH(o))}var u=e.line,l=1+s-e.lineStart;return new Fe.Token(re.TokenKind.EOF,i,i,u,l,t)}function VH(e){return e<32&&e!==9&&e!==10&&e!==13?"Cannot contain the invalid character ".concat(Zn(e),"."):e===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Zn(e),".")}function GH(e,t,r,n,i){var s=e.body,o,a=t;do o=s.charCodeAt(++a);while(!isNaN(o)&&(o>31||o===9));return new Fe.Token(re.TokenKind.COMMENT,t,a,r,n,i,s.slice(t+1,a))}function $H(e,t,r,n,i,s){var o=e.body,a=r,c=t,u=!1;if(a===45&&(a=o.charCodeAt(++c)),a===48){if(a=o.charCodeAt(++c),a>=48&&a<=57)throw(0,Sr.syntaxError)(e,c,"Invalid number, unexpected digit after 0: ".concat(Zn(a),"."))}else c=Gh(e,c,a),a=o.charCodeAt(c);if(a===46&&(u=!0,a=o.charCodeAt(++c),c=Gh(e,c,a),a=o.charCodeAt(c)),(a===69||a===101)&&(u=!0,a=o.charCodeAt(++c),(a===43||a===45)&&(a=o.charCodeAt(++c)),c=Gh(e,c,a),a=o.charCodeAt(c)),a===46||WH(a))throw(0,Sr.syntaxError)(e,c,"Invalid number, expected digit but got: ".concat(Zn(a),"."));return new Fe.Token(u?re.TokenKind.FLOAT:re.TokenKind.INT,t,c,n,i,s,o.slice(t,c))}function Gh(e,t,r){var n=e.body,i=t,s=r;if(s>=48&&s<=57){do s=n.charCodeAt(++i);while(s>=48&&s<=57);return i}throw(0,Sr.syntaxError)(e,i,"Invalid number, expected digit but got: ".concat(Zn(s),"."))}function BH(e,t,r,n,i){for(var s=e.body,o=t+1,a=o,c=0,u="";o<s.length&&!isNaN(c=s.charCodeAt(o))&&c!==10&&c!==13;){if(c===34)return u+=s.slice(a,o),new Fe.Token(re.TokenKind.STRING,t,o+1,r,n,i,u);if(c<32&&c!==9)throw(0,Sr.syntaxError)(e,o,"Invalid character within String: ".concat(Zn(c),"."));if(++o,c===92){switch(u+=s.slice(a,o-1),c=s.charCodeAt(o),c){case 34:u+='"';break;case 47:u+="/";break;case 92:u+="\\";break;case 98:u+="\b";break;case 102:u+="\f";break;case 110:u+=`
53
- `;break;case 114:u+="\r";break;case 116:u+=" ";break;case 117:{var l=HH(s.charCodeAt(o+1),s.charCodeAt(o+2),s.charCodeAt(o+3),s.charCodeAt(o+4));if(l<0){var d=s.slice(o+1,o+5);throw(0,Sr.syntaxError)(e,o,"Invalid character escape sequence: \\u".concat(d,"."))}u+=String.fromCharCode(l),o+=4;break}default:throw(0,Sr.syntaxError)(e,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(c),"."))}++o,a=o}}throw(0,Sr.syntaxError)(e,o,"Unterminated string.")}function KH(e,t,r,n,i,s){for(var o=e.body,a=t+3,c=a,u=0,l="";a<o.length&&!isNaN(u=o.charCodeAt(a));){if(u===34&&o.charCodeAt(a+1)===34&&o.charCodeAt(a+2)===34)return l+=o.slice(c,a),new Fe.Token(re.TokenKind.BLOCK_STRING,t,a+3,r,n,i,(0,MH.dedentBlockStringValue)(l));if(u<32&&u!==9&&u!==10&&u!==13)throw(0,Sr.syntaxError)(e,a,"Invalid character within String: ".concat(Zn(u),"."));u===10?(++a,++s.line,s.lineStart=a):u===13?(o.charCodeAt(a+1)===10?a+=2:++a,++s.line,s.lineStart=a):u===92&&o.charCodeAt(a+1)===34&&o.charCodeAt(a+2)===34&&o.charCodeAt(a+3)===34?(l+=o.slice(c,a)+'"""',a+=4,c=a):++a}throw(0,Sr.syntaxError)(e,a,"Unterminated string.")}function HH(e,t,r,n){return $u(e)<<12|$u(t)<<8|$u(r)<<4|$u(n)}function $u(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function QH(e,t,r,n,i){for(var s=e.body,o=s.length,a=t+1,c=0;a!==o&&!isNaN(c=s.charCodeAt(a))&&(c===95||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++a;return new Fe.Token(re.TokenKind.NAME,t,a,r,n,i,s.slice(t,a))}function WH(e){return e===95||e>=65&&e<=90||e>=97&&e<=122}});var ts=v(ei=>{"use strict";f();Object.defineProperty(ei,"__esModule",{value:!0});ei.parse=zH;ei.parseValue=XH;ei.parseType=ZH;ei.Parser=void 0;var $h=xu(),W=be(),YH=zi(),L=Xi(),zI=Vu(),JH=Zi(),XI=Bu();function zH(e,t){var r=new Ku(e,t);return r.parseDocument()}function XH(e,t){var r=new Ku(e,t);r.expectToken(L.TokenKind.SOF);var n=r.parseValueLiteral(!1);return r.expectToken(L.TokenKind.EOF),n}function ZH(e,t){var r=new Ku(e,t);r.expectToken(L.TokenKind.SOF);var n=r.parseTypeReference();return r.expectToken(L.TokenKind.EOF),n}var Ku=(function(){function e(r,n){var i=(0,zI.isSource)(r)?r:new zI.Source(r);this._lexer=new XI.Lexer(i),this._options=n}var t=e.prototype;return t.parseName=function(){var n=this.expectToken(L.TokenKind.NAME);return{kind:W.Kind.NAME,value:n.value,loc:this.loc(n)}},t.parseDocument=function(){var n=this._lexer.token;return{kind:W.Kind.DOCUMENT,definitions:this.many(L.TokenKind.SOF,this.parseDefinition,L.TokenKind.EOF),loc:this.loc(n)}},t.parseDefinition=function(){if(this.peek(L.TokenKind.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(L.TokenKind.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(L.TokenKind.BRACE_L))return{kind:W.Kind.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),s;return this.peek(L.TokenKind.NAME)&&(s=this.parseName()),{kind:W.Kind.OPERATION_DEFINITION,operation:i,name:s,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.parseOperationType=function(){var n=this.expectToken(L.TokenKind.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},t.parseVariableDefinitions=function(){return this.optionalMany(L.TokenKind.PAREN_L,this.parseVariableDefinition,L.TokenKind.PAREN_R)},t.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:W.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(L.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(L.TokenKind.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},t.parseVariable=function(){var n=this._lexer.token;return this.expectToken(L.TokenKind.DOLLAR),{kind:W.Kind.VARIABLE,name:this.parseName(),loc:this.loc(n)}},t.parseSelectionSet=function(){var n=this._lexer.token;return{kind:W.Kind.SELECTION_SET,selections:this.many(L.TokenKind.BRACE_L,this.parseSelection,L.TokenKind.BRACE_R),loc:this.loc(n)}},t.parseSelection=function(){return this.peek(L.TokenKind.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var n=this._lexer.token,i=this.parseName(),s,o;return this.expectOptionalToken(L.TokenKind.COLON)?(s=i,o=this.parseName()):o=i,{kind:W.Kind.FIELD,alias:s,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(L.TokenKind.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(L.TokenKind.PAREN_L,i,L.TokenKind.PAREN_R)},t.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(L.TokenKind.COLON),{kind:W.Kind.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},t.parseConstArgument=function(){var n=this._lexer.token;return{kind:W.Kind.ARGUMENT,name:this.parseName(),value:(this.expectToken(L.TokenKind.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},t.parseFragment=function(){var n=this._lexer.token;this.expectToken(L.TokenKind.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(L.TokenKind.NAME)?{kind:W.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:W.Kind.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:W.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:W.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},t.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case L.TokenKind.BRACKET_L:return this.parseList(n);case L.TokenKind.BRACE_L:return this.parseObject(n);case L.TokenKind.INT:return this._lexer.advance(),{kind:W.Kind.INT,value:i.value,loc:this.loc(i)};case L.TokenKind.FLOAT:return this._lexer.advance(),{kind:W.Kind.FLOAT,value:i.value,loc:this.loc(i)};case L.TokenKind.STRING:case L.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case L.TokenKind.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:W.Kind.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:W.Kind.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:W.Kind.NULL,loc:this.loc(i)};default:return{kind:W.Kind.ENUM,value:i.value,loc:this.loc(i)}}case L.TokenKind.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},t.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:W.Kind.STRING,value:n.value,block:n.kind===L.TokenKind.BLOCK_STRING,loc:this.loc(n)}},t.parseList=function(n){var i=this,s=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:W.Kind.LIST,values:this.any(L.TokenKind.BRACKET_L,o,L.TokenKind.BRACKET_R),loc:this.loc(s)}},t.parseObject=function(n){var i=this,s=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:W.Kind.OBJECT,fields:this.any(L.TokenKind.BRACE_L,o,L.TokenKind.BRACE_R),loc:this.loc(s)}},t.parseObjectField=function(n){var i=this._lexer.token,s=this.parseName();return this.expectToken(L.TokenKind.COLON),{kind:W.Kind.OBJECT_FIELD,name:s,value:this.parseValueLiteral(n),loc:this.loc(i)}},t.parseDirectives=function(n){for(var i=[];this.peek(L.TokenKind.AT);)i.push(this.parseDirective(n));return i},t.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(L.TokenKind.AT),{kind:W.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},t.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(L.TokenKind.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(L.TokenKind.BRACKET_R),i={kind:W.Kind.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(L.TokenKind.BANG)?{kind:W.Kind.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},t.parseNamedType=function(){var n=this._lexer.token;return{kind:W.Kind.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},t.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===L.TokenKind.NAME)switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(n)},t.peekDescription=function(){return this.peek(L.TokenKind.STRING)||this.peek(L.TokenKind.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var s=this.parseDirectives(!0),o=this.many(L.TokenKind.BRACE_L,this.parseOperationTypeDefinition,L.TokenKind.BRACE_R);return{kind:W.Kind.SCHEMA_DEFINITION,description:i,directives:s,operationTypes:o,loc:this.loc(n)}},t.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(L.TokenKind.COLON);var s=this.parseNamedType();return{kind:W.Kind.OPERATION_TYPE_DEFINITION,operation:i,type:s,loc:this.loc(n)}},t.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var s=this.parseName(),o=this.parseDirectives(!0);return{kind:W.Kind.SCALAR_TYPE_DEFINITION,description:i,name:s,directives:o,loc:this.loc(n)}},t.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var s=this.parseName(),o=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),c=this.parseFieldsDefinition();return{kind:W.Kind.OBJECT_TYPE_DEFINITION,description:i,name:s,interfaces:o,directives:a,fields:c,loc:this.loc(n)}},t.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(L.TokenKind.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(L.TokenKind.AMP)||this.peek(L.TokenKind.NAME));return i}return this.delimitedMany(L.TokenKind.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(L.TokenKind.BRACE_L)&&this._lexer.lookahead().kind===L.TokenKind.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(L.TokenKind.BRACE_L,this.parseFieldDefinition,L.TokenKind.BRACE_R)},t.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),s=this.parseName(),o=this.parseArgumentDefs();this.expectToken(L.TokenKind.COLON);var a=this.parseTypeReference(),c=this.parseDirectives(!0);return{kind:W.Kind.FIELD_DEFINITION,description:i,name:s,arguments:o,type:a,directives:c,loc:this.loc(n)}},t.parseArgumentDefs=function(){return this.optionalMany(L.TokenKind.PAREN_L,this.parseInputValueDef,L.TokenKind.PAREN_R)},t.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),s=this.parseName();this.expectToken(L.TokenKind.COLON);var o=this.parseTypeReference(),a;this.expectOptionalToken(L.TokenKind.EQUALS)&&(a=this.parseValueLiteral(!0));var c=this.parseDirectives(!0);return{kind:W.Kind.INPUT_VALUE_DEFINITION,description:i,name:s,type:o,defaultValue:a,directives:c,loc:this.loc(n)}},t.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var s=this.parseName(),o=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),c=this.parseFieldsDefinition();return{kind:W.Kind.INTERFACE_TYPE_DEFINITION,description:i,name:s,interfaces:o,directives:a,fields:c,loc:this.loc(n)}},t.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var s=this.parseName(),o=this.parseDirectives(!0),a=this.parseUnionMemberTypes();return{kind:W.Kind.UNION_TYPE_DEFINITION,description:i,name:s,directives:o,types:a,loc:this.loc(n)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(L.TokenKind.EQUALS)?this.delimitedMany(L.TokenKind.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var s=this.parseName(),o=this.parseDirectives(!0),a=this.parseEnumValuesDefinition();return{kind:W.Kind.ENUM_TYPE_DEFINITION,description:i,name:s,directives:o,values:a,loc:this.loc(n)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(L.TokenKind.BRACE_L,this.parseEnumValueDefinition,L.TokenKind.BRACE_R)},t.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),s=this.parseName(),o=this.parseDirectives(!0);return{kind:W.Kind.ENUM_VALUE_DEFINITION,description:i,name:s,directives:o,loc:this.loc(n)}},t.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var s=this.parseName(),o=this.parseDirectives(!0),a=this.parseInputFieldsDefinition();return{kind:W.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:s,directives:o,fields:a,loc:this.loc(n)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(L.TokenKind.BRACE_L,this.parseInputValueDef,L.TokenKind.BRACE_R)},t.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===L.TokenKind.NAME)switch(n.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(n)},t.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),s=this.optionalMany(L.TokenKind.BRACE_L,this.parseOperationTypeDefinition,L.TokenKind.BRACE_R);if(i.length===0&&s.length===0)throw this.unexpected();return{kind:W.Kind.SCHEMA_EXTENSION,directives:i,operationTypes:s,loc:this.loc(n)}},t.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),s=this.parseDirectives(!0);if(s.length===0)throw this.unexpected();return{kind:W.Kind.SCALAR_TYPE_EXTENSION,name:i,directives:s,loc:this.loc(n)}},t.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),s=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(s.length===0&&o.length===0&&a.length===0)throw this.unexpected();return{kind:W.Kind.OBJECT_TYPE_EXTENSION,name:i,interfaces:s,directives:o,fields:a,loc:this.loc(n)}},t.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),s=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(s.length===0&&o.length===0&&a.length===0)throw this.unexpected();return{kind:W.Kind.INTERFACE_TYPE_EXTENSION,name:i,interfaces:s,directives:o,fields:a,loc:this.loc(n)}},t.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),s=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(s.length===0&&o.length===0)throw this.unexpected();return{kind:W.Kind.UNION_TYPE_EXTENSION,name:i,directives:s,types:o,loc:this.loc(n)}},t.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),s=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(s.length===0&&o.length===0)throw this.unexpected();return{kind:W.Kind.ENUM_TYPE_EXTENSION,name:i,directives:s,values:o,loc:this.loc(n)}},t.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),s=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(s.length===0&&o.length===0)throw this.unexpected();return{kind:W.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:s,fields:o,loc:this.loc(n)}},t.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(L.TokenKind.AT);var s=this.parseName(),o=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var c=this.parseDirectiveLocations();return{kind:W.Kind.DIRECTIVE_DEFINITION,description:i,name:s,arguments:o,repeatable:a,locations:c,loc:this.loc(n)}},t.parseDirectiveLocations=function(){return this.delimitedMany(L.TokenKind.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(JH.DirectiveLocation[i.value]!==void 0)return i;throw this.unexpected(n)},t.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new YH.Location(n,this._lexer.lastToken,this._lexer.source)},t.peek=function(n){return this._lexer.token.kind===n},t.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw(0,$h.syntaxError)(this._lexer.source,i.start,"Expected ".concat(ZI(n),", found ").concat(Bh(i),"."))},t.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},t.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===L.TokenKind.NAME&&i.value===n)this._lexer.advance();else throw(0,$h.syntaxError)(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Bh(i),"."))},t.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===L.TokenKind.NAME&&i.value===n?(this._lexer.advance(),!0):!1},t.unexpected=function(n){var i=n??this._lexer.token;return(0,$h.syntaxError)(this._lexer.source,i.start,"Unexpected ".concat(Bh(i),"."))},t.any=function(n,i,s){this.expectToken(n);for(var o=[];!this.expectOptionalToken(s);)o.push(i.call(this));return o},t.optionalMany=function(n,i,s){if(this.expectOptionalToken(n)){var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(s));return o}return[]},t.many=function(n,i,s){this.expectToken(n);var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(s));return o},t.delimitedMany=function(n,i){this.expectOptionalToken(n);var s=[];do s.push(i.call(this));while(this.expectOptionalToken(n));return s},e})();ei.Parser=Ku;function Bh(e){var t=e.value;return ZI(e.kind)+(t!=null?' "'.concat(t,'"'):"")}function ZI(e){return(0,XI.isPunctuatorTokenKind)(e)?'"'.concat(e,'"'):e}});var cn=v(jr=>{"use strict";f();Object.defineProperty(jr,"__esModule",{value:!0});jr.visit=rQ;jr.visitInParallel=nQ;jr.getVisitFn=Hu;jr.BREAK=jr.QueryDocumentKeys=void 0;var eQ=tQ(fe()),e0=zi();function tQ(e){return e&&e.__esModule?e:{default:e}}var t0={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};jr.QueryDocumentKeys=t0;var rs=Object.freeze({});jr.BREAK=rs;function rQ(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t0,n=void 0,i=Array.isArray(e),s=[e],o=-1,a=[],c=void 0,u=void 0,l=void 0,d=[],p=[],h=e;do{o++;var g=o===s.length,y=g&&a.length!==0;if(g){if(u=p.length===0?void 0:d[d.length-1],c=l,l=p.pop(),y){if(i)c=c.slice();else{for(var E={},S=0,_=Object.keys(c);S<_.length;S++){var w=_[S];E[w]=c[w]}c=E}for(var I=0,T=0;T<a.length;T++){var N=a[T][0],P=a[T][1];i&&(N-=I),i&&P===null?(c.splice(N,1),I++):c[N]=P}}o=n.index,s=n.keys,a=n.edits,i=n.inArray,n=n.prev}else{if(u=l?i?o:s[o]:void 0,c=l?l[u]:h,c==null)continue;l&&d.push(u)}var O=void 0;if(!Array.isArray(c)){if(!(0,e0.isNode)(c))throw new Error("Invalid AST Node: ".concat((0,eQ.default)(c),"."));var $=Hu(t,c.kind,g);if($){if(O=$.call(t,c,u,l,d,p),O===rs)break;if(O===!1){if(!g){d.pop();continue}}else if(O!==void 0&&(a.push([u,O]),!g))if((0,e0.isNode)(O))c=O;else{d.pop();continue}}}if(O===void 0&&y&&a.push([u,c]),g)d.pop();else{var Z;n={inArray:i,index:o,keys:s,edits:a,prev:n},i=Array.isArray(c),s=i?c:(Z=r[c.kind])!==null&&Z!==void 0?Z:[],o=-1,a=[],l&&p.push(l),l=c}}while(n!==void 0);return a.length!==0&&(h=a[a.length-1][1]),h}function nQ(e){var t=new Array(e.length);return{enter:function(n){for(var i=0;i<e.length;i++)if(t[i]==null){var s=Hu(e[i],n.kind,!1);if(s){var o=s.apply(e[i],arguments);if(o===!1)t[i]=n;else if(o===rs)t[i]=rs;else if(o!==void 0)return o}}},leave:function(n){for(var i=0;i<e.length;i++)if(t[i]==null){var s=Hu(e[i],n.kind,!0);if(s){var o=s.apply(e[i],arguments);if(o===rs)t[i]=rs;else if(o!==void 0&&o!==!1)return o}}else t[i]===n&&(t[i]=null)}}}function Hu(e,t,r){var n=e[t];if(n){if(!r&&typeof n=="function")return n;var i=r?n.leave:n.enter;if(typeof i=="function")return i}else{var s=r?e.leave:e.enter;if(s){if(typeof s=="function")return s;var o=s[t];if(typeof o=="function")return o}}}});var ns=v(Qu=>{"use strict";f();Object.defineProperty(Qu,"__esModule",{value:!0});Qu.default=void 0;var iQ=Array.prototype.find?function(e,t){return Array.prototype.find.call(e,t)}:function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t(n))return n}},sQ=iQ;Qu.default=sQ});var Pt=v(Wu=>{"use strict";f();Object.defineProperty(Wu,"__esModule",{value:!0});Wu.default=void 0;var oQ=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},aQ=oQ;Wu.default=aQ});var Mo=v(Kh=>{"use strict";f();Object.defineProperty(Kh,"__esModule",{value:!0});Kh.locatedError=fQ;var cQ=lQ(fe()),uQ=H();function lQ(e){return e&&e.__esModule?e:{default:e}}function fQ(e,t,r){var n,i=e instanceof Error?e:new Error("Unexpected error value: "+(0,cQ.default)(e));return Array.isArray(i.path)?i:new uQ.GraphQLError(i.message,(n=i.nodes)!==null&&n!==void 0?n:t,i.source,i.positions,r,i)}});var Hh=v(Yu=>{"use strict";f();Object.defineProperty(Yu,"__esModule",{value:!0});Yu.assertValidName=mQ;Yu.isValidNameError=n0;var dQ=pQ(Kt()),r0=H();function pQ(e){return e&&e.__esModule?e:{default:e}}var hQ=/^[_a-zA-Z][_a-zA-Z0-9]*$/;function mQ(e){var t=n0(e);if(t)throw t;return e}function n0(e){if(typeof e=="string"||(0,dQ.default)(0,"Expected name to be a string."),e.length>1&&e[0]==="_"&&e[1]==="_")return new r0.GraphQLError('Name "'.concat(e,'" must not begin with "__", which is reserved by GraphQL introspection.'));if(!hQ.test(e))return new r0.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(e,'" does not.'))}});var is=v(Ju=>{"use strict";f();Object.defineProperty(Ju,"__esModule",{value:!0});Ju.default=void 0;var gQ=Object.entries||function(e){return Object.keys(e).map(function(t){return[t,e[t]]})},yQ=gQ;Ju.default=yQ});var un=v(Qh=>{"use strict";f();Object.defineProperty(Qh,"__esModule",{value:!0});Qh.default=vQ;function vQ(e,t){return e.reduce(function(r,n){return r[t(n)]=n,r},Object.create(null))}});var Yh=v(Wh=>{"use strict";f();Object.defineProperty(Wh,"__esModule",{value:!0});Wh.default=SQ;var EQ=_Q(is());function _Q(e){return e&&e.__esModule?e:{default:e}}function SQ(e,t){for(var r=Object.create(null),n=0,i=(0,EQ.default)(e);n<i.length;n++){var s=i[n],o=s[0],a=s[1];r[o]=t(a,o)}return r}});var zu=v(Jh=>{"use strict";f();Object.defineProperty(Jh,"__esModule",{value:!0});Jh.default=wQ;var bQ=TQ(is());function TQ(e){return e&&e.__esModule?e:{default:e}}function wQ(e){if(Object.getPrototypeOf(e)===null)return e;for(var t=Object.create(null),r=0,n=(0,bQ.default)(e);r<n.length;r++){var i=n[r],s=i[0],o=i[1];t[s]=o}return t}});var qo=v(zh=>{"use strict";f();Object.defineProperty(zh,"__esModule",{value:!0});zh.default=OQ;function OQ(e,t,r){return e.reduce(function(n,i){return n[t(i)]=r(i),n},Object.create(null))}});var ln=v(Xh=>{"use strict";f();Object.defineProperty(Xh,"__esModule",{value:!0});Xh.default=AQ;var IQ=5;function AQ(e,t){var r=typeof e=="string"?[e,t]:[void 0,e],n=r[0],i=r[1],s=" Did you mean ";n&&(s+=n+" ");var o=i.map(function(u){return'"'.concat(u,'"')});switch(o.length){case 0:return"";case 1:return s+o[0]+"?";case 2:return s+o[0]+" or "+o[1]+"?"}var a=o.slice(0,IQ),c=a.pop();return s+a.join(", ")+", or "+c+"?"}});var i0=v(Zh=>{"use strict";f();Object.defineProperty(Zh,"__esModule",{value:!0});Zh.default=NQ;function NQ(e){return e}});var Fo=v(tm=>{"use strict";f();Object.defineProperty(tm,"__esModule",{value:!0});tm.default=CQ;function CQ(e,t){for(var r=0,n=0;r<e.length&&n<t.length;){var i=e.charCodeAt(r),s=t.charCodeAt(n);if(Xu(i)&&Xu(s)){var o=0;do++r,o=o*10+i-em,i=e.charCodeAt(r);while(Xu(i)&&o>0);var a=0;do++n,a=a*10+s-em,s=t.charCodeAt(n);while(Xu(s)&&a>0);if(o<a)return-1;if(o>a)return 1}else{if(i<s)return-1;if(i>s)return 1;++r,++n}}return e.length-t.length}var em=48,PQ=57;function Xu(e){return!isNaN(e)&&em<=e&&e<=PQ}});var fn=v(rm=>{"use strict";f();Object.defineProperty(rm,"__esModule",{value:!0});rm.default=DQ;var RQ=xQ(Fo());function xQ(e){return e&&e.__esModule?e:{default:e}}function DQ(e,t){for(var r=Object.create(null),n=new LQ(e),i=Math.floor(e.length*.4)+1,s=0;s<t.length;s++){var o=t[s],a=n.measure(o,i);a!==void 0&&(r[o]=a)}return Object.keys(r).sort(function(c,u){var l=r[c]-r[u];return l!==0?l:(0,RQ.default)(c,u)})}var LQ=(function(){function e(r){this._input=r,this._inputLowerCase=r.toLowerCase(),this._inputArray=s0(this._inputLowerCase),this._rows=[new Array(r.length+1).fill(0),new Array(r.length+1).fill(0),new Array(r.length+1).fill(0)]}var t=e.prototype;return t.measure=function(n,i){if(this._input===n)return 0;var s=n.toLowerCase();if(this._inputLowerCase===s)return 1;var o=s0(s),a=this._inputArray;if(o.length<a.length){var c=o;o=a,a=c}var u=o.length,l=a.length;if(!(u-l>i)){for(var d=this._rows,p=0;p<=l;p++)d[0][p]=p;for(var h=1;h<=u;h++){for(var g=d[(h-1)%3],y=d[h%3],E=y[0]=h,S=1;S<=l;S++){var _=o[h-1]===a[S-1]?0:1,w=Math.min(g[S]+1,y[S-1]+1,g[S-1]+_);if(h>1&&S>1&&o[h-1]===a[S-2]&&o[h-2]===a[S-1]){var I=d[(h-2)%3][S-2];w=Math.min(w,I+1)}w<E&&(E=w),y[S]=w}if(E>i)return}var T=d[u%3][l];return T<=i?T:void 0}},e})();function s0(e){for(var t=e.length,r=new Array(t),n=0;n<t;++n)r[n]=e.charCodeAt(n);return r}});var bt=v(nm=>{"use strict";f();Object.defineProperty(nm,"__esModule",{value:!0});nm.print=MQ;var kQ=cn(),jQ=es();function MQ(e){return(0,kQ.visit)(e,{leave:FQ})}var qQ=80,FQ={Name:function(t){return t.value},Variable:function(t){return"$"+t.name},Document:function(t){return F(t.definitions,`
54
-
55
- `)+`
56
- `},OperationDefinition:function(t){var r=t.operation,n=t.name,i=Le("(",F(t.variableDefinitions,", "),")"),s=F(t.directives," "),o=t.selectionSet;return!n&&!s&&!i&&r==="query"?o:F([r,F([n,i]),s,o]," ")},VariableDefinition:function(t){var r=t.variable,n=t.type,i=t.defaultValue,s=t.directives;return r+": "+n+Le(" = ",i)+Le(" ",F(s," "))},SelectionSet:function(t){var r=t.selections;return or(r)},Field:function(t){var r=t.alias,n=t.name,i=t.arguments,s=t.directives,o=t.selectionSet,a=Le("",r,": ")+n,c=a+Le("(",F(i,", "),")");return c.length>qQ&&(c=a+Le(`(
57
- `,Zu(F(i,`
58
- `)),`
59
- )`)),F([c,F(s," "),o]," ")},Argument:function(t){var r=t.name,n=t.value;return r+": "+n},FragmentSpread:function(t){var r=t.name,n=t.directives;return"..."+r+Le(" ",F(n," "))},InlineFragment:function(t){var r=t.typeCondition,n=t.directives,i=t.selectionSet;return F(["...",Le("on ",r),F(n," "),i]," ")},FragmentDefinition:function(t){var r=t.name,n=t.typeCondition,i=t.variableDefinitions,s=t.directives,o=t.selectionSet;return"fragment ".concat(r).concat(Le("(",F(i,", "),")")," ")+"on ".concat(n," ").concat(Le("",F(s," ")," "))+o},IntValue:function(t){var r=t.value;return r},FloatValue:function(t){var r=t.value;return r},StringValue:function(t,r){var n=t.value,i=t.block;return i?(0,jQ.printBlockString)(n,r==="description"?"":" "):JSON.stringify(n)},BooleanValue:function(t){var r=t.value;return r?"true":"false"},NullValue:function(){return"null"},EnumValue:function(t){var r=t.value;return r},ListValue:function(t){var r=t.values;return"["+F(r,", ")+"]"},ObjectValue:function(t){var r=t.fields;return"{"+F(r,", ")+"}"},ObjectField:function(t){var r=t.name,n=t.value;return r+": "+n},Directive:function(t){var r=t.name,n=t.arguments;return"@"+r+Le("(",F(n,", "),")")},NamedType:function(t){var r=t.name;return r},ListType:function(t){var r=t.type;return"["+r+"]"},NonNullType:function(t){var r=t.type;return r+"!"},SchemaDefinition:sr(function(e){var t=e.directives,r=e.operationTypes;return F(["schema",F(t," "),or(r)]," ")}),OperationTypeDefinition:function(t){var r=t.operation,n=t.type;return r+": "+n},ScalarTypeDefinition:sr(function(e){var t=e.name,r=e.directives;return F(["scalar",t,F(r," ")]," ")}),ObjectTypeDefinition:sr(function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return F(["type",t,Le("implements ",F(r," & ")),F(n," "),or(i)]," ")}),FieldDefinition:sr(function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(o0(r)?Le(`(
60
- `,Zu(F(r,`
61
- `)),`
62
- )`):Le("(",F(r,", "),")"))+": "+n+Le(" ",F(i," "))}),InputValueDefinition:sr(function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return F([t+": "+r,Le("= ",n),F(i," ")]," ")}),InterfaceTypeDefinition:sr(function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return F(["interface",t,Le("implements ",F(r," & ")),F(n," "),or(i)]," ")}),UnionTypeDefinition:sr(function(e){var t=e.name,r=e.directives,n=e.types;return F(["union",t,F(r," "),n&&n.length!==0?"= "+F(n," | "):""]," ")}),EnumTypeDefinition:sr(function(e){var t=e.name,r=e.directives,n=e.values;return F(["enum",t,F(r," "),or(n)]," ")}),EnumValueDefinition:sr(function(e){var t=e.name,r=e.directives;return F([t,F(r," ")]," ")}),InputObjectTypeDefinition:sr(function(e){var t=e.name,r=e.directives,n=e.fields;return F(["input",t,F(r," "),or(n)]," ")}),DirectiveDefinition:sr(function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(o0(r)?Le(`(
63
- `,Zu(F(r,`
64
- `)),`
65
- )`):Le("(",F(r,", "),")"))+(n?" repeatable":"")+" on "+F(i," | ")}),SchemaExtension:function(t){var r=t.directives,n=t.operationTypes;return F(["extend schema",F(r," "),or(n)]," ")},ScalarTypeExtension:function(t){var r=t.name,n=t.directives;return F(["extend scalar",r,F(n," ")]," ")},ObjectTypeExtension:function(t){var r=t.name,n=t.interfaces,i=t.directives,s=t.fields;return F(["extend type",r,Le("implements ",F(n," & ")),F(i," "),or(s)]," ")},InterfaceTypeExtension:function(t){var r=t.name,n=t.interfaces,i=t.directives,s=t.fields;return F(["extend interface",r,Le("implements ",F(n," & ")),F(i," "),or(s)]," ")},UnionTypeExtension:function(t){var r=t.name,n=t.directives,i=t.types;return F(["extend union",r,F(n," "),i&&i.length!==0?"= "+F(i," | "):""]," ")},EnumTypeExtension:function(t){var r=t.name,n=t.directives,i=t.values;return F(["extend enum",r,F(n," "),or(i)]," ")},InputObjectTypeExtension:function(t){var r=t.name,n=t.directives,i=t.fields;return F(["extend input",r,F(n," "),or(i)]," ")}};function sr(e){return function(t){return F([t.description,e(t)],`
66
- `)}}function F(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(t=e?.filter(function(n){return n}).join(r))!==null&&t!==void 0?t:""}function or(e){return Le(`{
67
- `,Zu(F(e,`
68
- `)),`
69
- }`)}function Le(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return t!=null&&t!==""?e+t+r:""}function Zu(e){return Le(" ",e.replace(/\n/g,`
70
- `))}function UQ(e){return e.indexOf(`
71
- `)!==-1}function o0(e){return e!=null&&e.some(UQ)}});var am=v(om=>{"use strict";f();Object.defineProperty(om,"__esModule",{value:!0});om.valueFromASTUntyped=im;var VQ=sm(fe()),GQ=sm(st()),$Q=sm(qo()),Mr=be();function sm(e){return e&&e.__esModule?e:{default:e}}function im(e,t){switch(e.kind){case Mr.Kind.NULL:return null;case Mr.Kind.INT:return parseInt(e.value,10);case Mr.Kind.FLOAT:return parseFloat(e.value);case Mr.Kind.STRING:case Mr.Kind.ENUM:case Mr.Kind.BOOLEAN:return e.value;case Mr.Kind.LIST:return e.values.map(function(r){return im(r,t)});case Mr.Kind.OBJECT:return(0,$Q.default)(e.fields,function(r){return r.name.value},function(r){return im(r.value,t)});case Mr.Kind.VARIABLE:return t?.[e.name.value]}(0,GQ.default)(0,"Unexpected value node: "+(0,VQ.default)(e))}});var ae=v(B=>{"use strict";f();Object.defineProperty(B,"__esModule",{value:!0});B.isType=cm;B.assertType=d0;B.isScalarType=ti;B.assertScalarType=JQ;B.isObjectType=as;B.assertObjectType=zQ;B.isInterfaceType=ri;B.assertInterfaceType=XQ;B.isUnionType=ni;B.assertUnionType=ZQ;B.isEnumType=ii;B.assertEnumType=eW;B.isInputObjectType=Vo;B.assertInputObjectType=tW;B.isListType=rl;B.assertListType=rW;B.isNonNullType=yn;B.assertNonNullType=nW;B.isInputType=um;B.assertInputType=iW;B.isOutputType=lm;B.assertOutputType=sW;B.isLeafType=p0;B.assertLeafType=oW;B.isCompositeType=h0;B.assertCompositeType=aW;B.isAbstractType=m0;B.assertAbstractType=cW;B.GraphQLList=dn;B.GraphQLNonNull=pn;B.isWrappingType=Go;B.assertWrappingType=uW;B.isNullableType=g0;B.assertNullableType=y0;B.getNullableType=lW;B.isNamedType=v0;B.assertNamedType=fW;B.getNamedType=dW;B.argsToArgsConfig=b0;B.isRequiredArgument=pW;B.isRequiredInputField=yW;B.GraphQLInputObjectType=B.GraphQLEnumType=B.GraphQLUnionType=B.GraphQLInterfaceType=B.GraphQLObjectType=B.GraphQLScalarType=void 0;var l0=Rt(is()),hn=_r(),Ae=Rt(fe()),BQ=Rt(un()),tl=Rt(Yh()),br=Rt(zu()),Ce=Rt(Kt()),f0=Rt(qo()),mn=Rt(Do()),KQ=Rt(ln()),HQ=Rt(Er()),a0=Rt(i0()),gn=Rt(ku()),QQ=Rt(fn()),Uo=H(),WQ=be(),c0=bt(),YQ=am();function Rt(e){return e&&e.__esModule?e:{default:e}}function u0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function os(e,t,r){return t&&u0(e.prototype,t),r&&u0(e,r),e}function cm(e){return ti(e)||as(e)||ri(e)||ni(e)||ii(e)||Vo(e)||rl(e)||yn(e)}function d0(e){if(!cm(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL type."));return e}function ti(e){return(0,mn.default)(e,fm)}function JQ(e){if(!ti(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL Scalar type."));return e}function as(e){return(0,mn.default)(e,dm)}function zQ(e){if(!as(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL Object type."));return e}function ri(e){return(0,mn.default)(e,pm)}function XQ(e){if(!ri(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL Interface type."));return e}function ni(e){return(0,mn.default)(e,hm)}function ZQ(e){if(!ni(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL Union type."));return e}function ii(e){return(0,mn.default)(e,mm)}function eW(e){if(!ii(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL Enum type."));return e}function Vo(e){return(0,mn.default)(e,gm)}function tW(e){if(!Vo(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL Input Object type."));return e}function rl(e){return(0,mn.default)(e,dn)}function rW(e){if(!rl(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL List type."));return e}function yn(e){return(0,mn.default)(e,pn)}function nW(e){if(!yn(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL Non-Null type."));return e}function um(e){return ti(e)||ii(e)||Vo(e)||Go(e)&&um(e.ofType)}function iW(e){if(!um(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL input type."));return e}function lm(e){return ti(e)||as(e)||ri(e)||ni(e)||ii(e)||Go(e)&&lm(e.ofType)}function sW(e){if(!lm(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL output type."));return e}function p0(e){return ti(e)||ii(e)}function oW(e){if(!p0(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL leaf type."));return e}function h0(e){return as(e)||ri(e)||ni(e)}function aW(e){if(!h0(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL composite type."));return e}function m0(e){return ri(e)||ni(e)}function cW(e){if(!m0(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL abstract type."));return e}function dn(e){if(this instanceof dn)this.ofType=d0(e);else return new dn(e)}dn.prototype.toString=function(){return"["+String(this.ofType)+"]"};dn.prototype.toJSON=function(){return this.toString()};Object.defineProperty(dn.prototype,hn.SYMBOL_TO_STRING_TAG,{get:function(){return"GraphQLList"}});(0,gn.default)(dn);function pn(e){if(this instanceof pn)this.ofType=y0(e);else return new pn(e)}pn.prototype.toString=function(){return String(this.ofType)+"!"};pn.prototype.toJSON=function(){return this.toString()};Object.defineProperty(pn.prototype,hn.SYMBOL_TO_STRING_TAG,{get:function(){return"GraphQLNonNull"}});(0,gn.default)(pn);function Go(e){return rl(e)||yn(e)}function uW(e){if(!Go(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL wrapping type."));return e}function g0(e){return cm(e)&&!yn(e)}function y0(e){if(!g0(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL nullable type."));return e}function lW(e){if(e)return yn(e)?e.ofType:e}function v0(e){return ti(e)||as(e)||ri(e)||ni(e)||ii(e)||Vo(e)}function fW(e){if(!v0(e))throw new Error("Expected ".concat((0,Ae.default)(e)," to be a GraphQL named type."));return e}function dW(e){if(e){for(var t=e;Go(t);)t=t.ofType;return t}}function nl(e){return typeof e=="function"?e():e}function cs(e){return e&&e.length>0?e:void 0}var fm=(function(){function e(r){var n,i,s,o=(n=r.parseValue)!==null&&n!==void 0?n:a0.default;this.name=r.name,this.description=r.description,this.specifiedByUrl=r.specifiedByUrl,this.serialize=(i=r.serialize)!==null&&i!==void 0?i:a0.default,this.parseValue=o,this.parseLiteral=(s=r.parseLiteral)!==null&&s!==void 0?s:function(a,c){return o((0,YQ.valueFromASTUntyped)(a,c))},this.extensions=r.extensions&&(0,br.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=cs(r.extensionASTNodes),typeof r.name=="string"||(0,Ce.default)(0,"Must provide name."),r.specifiedByUrl==null||typeof r.specifiedByUrl=="string"||(0,Ce.default)(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat((0,Ae.default)(r.specifiedByUrl),".")),r.serialize==null||typeof r.serialize=="function"||(0,Ce.default)(0,"".concat(this.name,' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.')),r.parseLiteral&&(typeof r.parseValue=="function"&&typeof r.parseLiteral=="function"||(0,Ce.default)(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var t=e.prototype;return t.toConfig=function(){var n;return{name:this.name,description:this.description,specifiedByUrl:this.specifiedByUrl,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},os(e,[{key:hn.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLScalarType"}}]),e})();B.GraphQLScalarType=fm;(0,gn.default)(fm);var dm=(function(){function e(r){this.name=r.name,this.description=r.description,this.isTypeOf=r.isTypeOf,this.extensions=r.extensions&&(0,br.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=cs(r.extensionASTNodes),this._fields=_0.bind(void 0,r),this._interfaces=E0.bind(void 0,r),typeof r.name=="string"||(0,Ce.default)(0,"Must provide name."),r.isTypeOf==null||typeof r.isTypeOf=="function"||(0,Ce.default)(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat((0,Ae.default)(r.isTypeOf),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:S0(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},os(e,[{key:hn.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLObjectType"}}]),e})();B.GraphQLObjectType=dm;(0,gn.default)(dm);function E0(e){var t,r=(t=nl(e.interfaces))!==null&&t!==void 0?t:[];return Array.isArray(r)||(0,Ce.default)(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),r}function _0(e){var t=nl(e.fields);return ss(t)||(0,Ce.default)(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),(0,tl.default)(t,function(r,n){var i;ss(r)||(0,Ce.default)(0,"".concat(e.name,".").concat(n," field config must be an object.")),!("isDeprecated"in r)||(0,Ce.default)(0,"".concat(e.name,".").concat(n,' should provide "deprecationReason" instead of "isDeprecated".')),r.resolve==null||typeof r.resolve=="function"||(0,Ce.default)(0,"".concat(e.name,".").concat(n," field resolver must be a function if ")+"provided, but got: ".concat((0,Ae.default)(r.resolve),"."));var s=(i=r.args)!==null&&i!==void 0?i:{};ss(s)||(0,Ce.default)(0,"".concat(e.name,".").concat(n," args must be an object with argument names as keys."));var o=(0,l0.default)(s).map(function(a){var c=a[0],u=a[1];return{name:c,description:u.description,type:u.type,defaultValue:u.defaultValue,deprecationReason:u.deprecationReason,extensions:u.extensions&&(0,br.default)(u.extensions),astNode:u.astNode}});return{name:n,description:r.description,type:r.type,args:o,resolve:r.resolve,subscribe:r.subscribe,isDeprecated:r.deprecationReason!=null,deprecationReason:r.deprecationReason,extensions:r.extensions&&(0,br.default)(r.extensions),astNode:r.astNode}})}function ss(e){return(0,HQ.default)(e)&&!Array.isArray(e)}function S0(e){return(0,tl.default)(e,function(t){return{description:t.description,type:t.type,args:b0(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}function b0(e){return(0,f0.default)(e,function(t){return t.name},function(t){return{description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}function pW(e){return yn(e.type)&&e.defaultValue===void 0}var pm=(function(){function e(r){this.name=r.name,this.description=r.description,this.resolveType=r.resolveType,this.extensions=r.extensions&&(0,br.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=cs(r.extensionASTNodes),this._fields=_0.bind(void 0,r),this._interfaces=E0.bind(void 0,r),typeof r.name=="string"||(0,Ce.default)(0,"Must provide name."),r.resolveType==null||typeof r.resolveType=="function"||(0,Ce.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,Ae.default)(r.resolveType),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){var n;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:S0(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},os(e,[{key:hn.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLInterfaceType"}}]),e})();B.GraphQLInterfaceType=pm;(0,gn.default)(pm);var hm=(function(){function e(r){this.name=r.name,this.description=r.description,this.resolveType=r.resolveType,this.extensions=r.extensions&&(0,br.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=cs(r.extensionASTNodes),this._types=hW.bind(void 0,r),typeof r.name=="string"||(0,Ce.default)(0,"Must provide name."),r.resolveType==null||typeof r.resolveType=="function"||(0,Ce.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,Ae.default)(r.resolveType),"."))}var t=e.prototype;return t.getTypes=function(){return typeof this._types=="function"&&(this._types=this._types()),this._types},t.toConfig=function(){var n;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},os(e,[{key:hn.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLUnionType"}}]),e})();B.GraphQLUnionType=hm;(0,gn.default)(hm);function hW(e){var t=nl(e.types);return Array.isArray(t)||(0,Ce.default)(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),t}var mm=(function(){function e(r){this.name=r.name,this.description=r.description,this.extensions=r.extensions&&(0,br.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=cs(r.extensionASTNodes),this._values=mW(this.name,r.values),this._valueLookup=new Map(this._values.map(function(n){return[n.value,n]})),this._nameLookup=(0,BQ.default)(this._values,function(n){return n.name}),typeof r.name=="string"||(0,Ce.default)(0,"Must provide name.")}var t=e.prototype;return t.getValues=function(){return this._values},t.getValue=function(n){return this._nameLookup[n]},t.serialize=function(n){var i=this._valueLookup.get(n);if(i===void 0)throw new Uo.GraphQLError('Enum "'.concat(this.name,'" cannot represent value: ').concat((0,Ae.default)(n)));return i.name},t.parseValue=function(n){if(typeof n!="string"){var i=(0,Ae.default)(n);throw new Uo.GraphQLError('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(i,".")+el(this,i))}var s=this.getValue(n);if(s==null)throw new Uo.GraphQLError('Value "'.concat(n,'" does not exist in "').concat(this.name,'" enum.')+el(this,n));return s.value},t.parseLiteral=function(n,i){if(n.kind!==WQ.Kind.ENUM){var s=(0,c0.print)(n);throw new Uo.GraphQLError('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(s,".")+el(this,s),n)}var o=this.getValue(n.value);if(o==null){var a=(0,c0.print)(n);throw new Uo.GraphQLError('Value "'.concat(a,'" does not exist in "').concat(this.name,'" enum.')+el(this,a),n)}return o.value},t.toConfig=function(){var n,i=(0,f0.default)(this.getValues(),function(s){return s.name},function(s){return{description:s.description,value:s.value,deprecationReason:s.deprecationReason,extensions:s.extensions,astNode:s.astNode}});return{name:this.name,description:this.description,values:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},os(e,[{key:hn.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLEnumType"}}]),e})();B.GraphQLEnumType=mm;(0,gn.default)(mm);function el(e,t){var r=e.getValues().map(function(i){return i.name}),n=(0,QQ.default)(t,r);return(0,KQ.default)("the enum value",n)}function mW(e,t){return ss(t)||(0,Ce.default)(0,"".concat(e," values must be an object with value names as keys.")),(0,l0.default)(t).map(function(r){var n=r[0],i=r[1];return ss(i)||(0,Ce.default)(0,"".concat(e,".").concat(n,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat((0,Ae.default)(i),".")),!("isDeprecated"in i)||(0,Ce.default)(0,"".concat(e,".").concat(n,' should provide "deprecationReason" instead of "isDeprecated".')),{name:n,description:i.description,value:i.value!==void 0?i.value:n,isDeprecated:i.deprecationReason!=null,deprecationReason:i.deprecationReason,extensions:i.extensions&&(0,br.default)(i.extensions),astNode:i.astNode}})}var gm=(function(){function e(r){this.name=r.name,this.description=r.description,this.extensions=r.extensions&&(0,br.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=cs(r.extensionASTNodes),this._fields=gW.bind(void 0,r),typeof r.name=="string"||(0,Ce.default)(0,"Must provide name.")}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.toConfig=function(){var n,i=(0,tl.default)(this.getFields(),function(s){return{description:s.description,type:s.type,defaultValue:s.defaultValue,deprecationReason:s.deprecationReason,extensions:s.extensions,astNode:s.astNode}});return{name:this.name,description:this.description,fields:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},os(e,[{key:hn.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLInputObjectType"}}]),e})();B.GraphQLInputObjectType=gm;(0,gn.default)(gm);function gW(e){var t=nl(e.fields);return ss(t)||(0,Ce.default)(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),(0,tl.default)(t,function(r,n){return!("resolve"in r)||(0,Ce.default)(0,"".concat(e.name,".").concat(n," field has a resolve property, but Input Types cannot define resolvers.")),{name:n,description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions&&(0,br.default)(r.extensions),astNode:r.astNode}})}function yW(e){return yn(e.type)&&e.defaultValue===void 0}});var Bo=v($o=>{"use strict";f();Object.defineProperty($o,"__esModule",{value:!0});$o.isEqualType=ym;$o.isTypeSubTypeOf=il;$o.doTypesOverlap=vW;var ut=ae();function ym(e,t){return e===t?!0:(0,ut.isNonNullType)(e)&&(0,ut.isNonNullType)(t)||(0,ut.isListType)(e)&&(0,ut.isListType)(t)?ym(e.ofType,t.ofType):!1}function il(e,t,r){return t===r?!0:(0,ut.isNonNullType)(r)?(0,ut.isNonNullType)(t)?il(e,t.ofType,r.ofType):!1:(0,ut.isNonNullType)(t)?il(e,t.ofType,r):(0,ut.isListType)(r)?(0,ut.isListType)(t)?il(e,t.ofType,r.ofType):!1:(0,ut.isListType)(t)?!1:(0,ut.isAbstractType)(r)&&((0,ut.isInterfaceType)(t)||(0,ut.isObjectType)(t))&&e.isSubType(r,t)}function vW(e,t,r){return t===r?!0:(0,ut.isAbstractType)(t)?(0,ut.isAbstractType)(r)?e.getPossibleTypes(t).some(function(n){return e.isSubType(r,n)}):e.isSubType(t,r):(0,ut.isAbstractType)(r)?e.isSubType(r,t):!1}});var vm=v(sl=>{"use strict";f();Object.defineProperty(sl,"__esModule",{value:!0});sl.default=void 0;var EW=_r(),_W=Array.from||function(e,t,r){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var n=e[EW.SYMBOL_ITERATOR];if(typeof n=="function"){for(var i=n.call(e),s=[],o,a=0;!(o=i.next()).done;++a)if(s.push(t.call(r,o.value,a)),a>9999999)throw new TypeError("Near-infinite iteration.");return s}var c=e.length;if(typeof c=="number"&&c>=0&&c%1===0){for(var u=[],l=0;l<c;++l)Object.prototype.hasOwnProperty.call(e,l)&&u.push(t.call(r,e[l],l));return u}return[]},SW=_W;sl.default=SW});var Em=v(ol=>{"use strict";f();Object.defineProperty(ol,"__esModule",{value:!0});ol.default=void 0;var bW=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},TW=bW;ol.default=TW});var cl=v(_m=>{"use strict";f();Object.defineProperty(_m,"__esModule",{value:!0});_m.default=OW;var wW=_r();function al(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?al=function(r){return typeof r}:al=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},al(e)}function OW(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(l){return l};if(e==null||al(e)!=="object")return null;if(Array.isArray(e))return e.map(t);var r=e[wW.SYMBOL_ITERATOR];if(typeof r=="function"){for(var n=r.call(e),i=[],s,o=0;!(s=n.next()).done;++o)i.push(t(s.value,o));return i}var a=e.length;if(typeof a=="number"&&a>=0&&a%1===0){for(var c=[],u=0;u<a;++u){if(!Object.prototype.hasOwnProperty.call(e,u))return null;c.push(t(e[String(u)],u))}return c}return null}});var T0=v(ul=>{"use strict";f();Object.defineProperty(ul,"__esModule",{value:!0});ul.default=void 0;var IW=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},AW=IW;ul.default=AW});var Tr=v(gt=>{"use strict";f();Object.defineProperty(gt,"__esModule",{value:!0});gt.isSpecifiedScalarType=qW;gt.specifiedScalarTypes=gt.GraphQLID=gt.GraphQLBoolean=gt.GraphQLString=gt.GraphQLFloat=gt.GraphQLInt=void 0;var ll=dl(Em()),fl=dl(T0()),ar=dl(fe()),w0=dl(Er()),si=be(),Ko=bt(),Ze=H(),Ho=ae();function dl(e){return e&&e.__esModule?e:{default:e}}var Sm=2147483647,bm=-2147483648;function NW(e){var t=Qo(e);if(typeof t=="boolean")return t?1:0;var r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),!(0,fl.default)(r))throw new Ze.GraphQLError("Int cannot represent non-integer value: ".concat((0,ar.default)(t)));if(r>Sm||r<bm)throw new Ze.GraphQLError("Int cannot represent non 32-bit signed integer value: "+(0,ar.default)(t));return r}function CW(e){if(!(0,fl.default)(e))throw new Ze.GraphQLError("Int cannot represent non-integer value: ".concat((0,ar.default)(e)));if(e>Sm||e<bm)throw new Ze.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var O0=new Ho.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize:NW,parseValue:CW,parseLiteral:function(t){if(t.kind!==si.Kind.INT)throw new Ze.GraphQLError("Int cannot represent non-integer value: ".concat((0,Ko.print)(t)),t);var r=parseInt(t.value,10);if(r>Sm||r<bm)throw new Ze.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(t.value),t);return r}});gt.GraphQLInt=O0;function PW(e){var t=Qo(e);if(typeof t=="boolean")return t?1:0;var r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),!(0,ll.default)(r))throw new Ze.GraphQLError("Float cannot represent non numeric value: ".concat((0,ar.default)(t)));return r}function RW(e){if(!(0,ll.default)(e))throw new Ze.GraphQLError("Float cannot represent non numeric value: ".concat((0,ar.default)(e)));return e}var I0=new Ho.GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize:PW,parseValue:RW,parseLiteral:function(t){if(t.kind!==si.Kind.FLOAT&&t.kind!==si.Kind.INT)throw new Ze.GraphQLError("Float cannot represent non numeric value: ".concat((0,Ko.print)(t)),t);return parseFloat(t.value)}});gt.GraphQLFloat=I0;function Qo(e){if((0,w0.default)(e)){if(typeof e.valueOf=="function"){var t=e.valueOf();if(!(0,w0.default)(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function xW(e){var t=Qo(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if((0,ll.default)(t))return t.toString();throw new Ze.GraphQLError("String cannot represent value: ".concat((0,ar.default)(e)))}function DW(e){if(typeof e!="string")throw new Ze.GraphQLError("String cannot represent a non string value: ".concat((0,ar.default)(e)));return e}var A0=new Ho.GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize:xW,parseValue:DW,parseLiteral:function(t){if(t.kind!==si.Kind.STRING)throw new Ze.GraphQLError("String cannot represent a non string value: ".concat((0,Ko.print)(t)),t);return t.value}});gt.GraphQLString=A0;function LW(e){var t=Qo(e);if(typeof t=="boolean")return t;if((0,ll.default)(t))return t!==0;throw new Ze.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,ar.default)(t)))}function kW(e){if(typeof e!="boolean")throw new Ze.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,ar.default)(e)));return e}var N0=new Ho.GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:LW,parseValue:kW,parseLiteral:function(t){if(t.kind!==si.Kind.BOOLEAN)throw new Ze.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,Ko.print)(t)),t);return t.value}});gt.GraphQLBoolean=N0;function jW(e){var t=Qo(e);if(typeof t=="string")return t;if((0,fl.default)(t))return String(t);throw new Ze.GraphQLError("ID cannot represent value: ".concat((0,ar.default)(e)))}function MW(e){if(typeof e=="string")return e;if((0,fl.default)(e))return e.toString();throw new Ze.GraphQLError("ID cannot represent value: ".concat((0,ar.default)(e)))}var C0=new Ho.GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize:jW,parseValue:MW,parseLiteral:function(t){if(t.kind!==si.Kind.STRING&&t.kind!==si.Kind.INT)throw new Ze.GraphQLError("ID cannot represent a non-string and non-integer value: "+(0,Ko.print)(t),t);return t.value}});gt.GraphQLID=C0;var P0=Object.freeze([A0,O0,I0,N0,C0]);gt.specifiedScalarTypes=P0;function qW(e){return P0.some(function(t){var r=t.name;return e.name===r})}});var Jo=v(Tm=>{"use strict";f();Object.defineProperty(Tm,"__esModule",{value:!0});Tm.astFromValue=Yo;var FW=us(Em()),UW=us(Pt()),R0=us(fe()),VW=us(st()),GW=us(Er()),$W=us(cl()),Ht=be(),BW=Tr(),Wo=ae();function us(e){return e&&e.__esModule?e:{default:e}}function Yo(e,t){if((0,Wo.isNonNullType)(t)){var r=Yo(e,t.ofType);return r?.kind===Ht.Kind.NULL?null:r}if(e===null)return{kind:Ht.Kind.NULL};if(e===void 0)return null;if((0,Wo.isListType)(t)){var n=t.ofType,i=(0,$W.default)(e);if(i!=null){for(var s=[],o=0;o<i.length;o++){var a=i[o],c=Yo(a,n);c!=null&&s.push(c)}return{kind:Ht.Kind.LIST,values:s}}return Yo(e,n)}if((0,Wo.isInputObjectType)(t)){if(!(0,GW.default)(e))return null;for(var u=[],l=0,d=(0,UW.default)(t.getFields());l<d.length;l++){var p=d[l],h=Yo(e[p.name],p.type);h&&u.push({kind:Ht.Kind.OBJECT_FIELD,name:{kind:Ht.Kind.NAME,value:p.name},value:h})}return{kind:Ht.Kind.OBJECT,fields:u}}if((0,Wo.isLeafType)(t)){var g=t.serialize(e);if(g==null)return null;if(typeof g=="boolean")return{kind:Ht.Kind.BOOLEAN,value:g};if(typeof g=="number"&&(0,FW.default)(g)){var y=String(g);return x0.test(y)?{kind:Ht.Kind.INT,value:y}:{kind:Ht.Kind.FLOAT,value:y}}if(typeof g=="string")return(0,Wo.isEnumType)(t)?{kind:Ht.Kind.ENUM,value:g}:t===BW.GraphQLID&&x0.test(g)?{kind:Ht.Kind.INT,value:g}:{kind:Ht.Kind.STRING,value:g};throw new TypeError("Cannot convert value to AST: ".concat((0,R0.default)(g),"."))}(0,VW.default)(0,"Unexpected input type: "+(0,R0.default)(t))}var x0=/^-?(?:0|[1-9][0-9]*)$/});var Wt=v(_e=>{"use strict";f();Object.defineProperty(_e,"__esModule",{value:!0});_e.isIntrospectionType=XW;_e.introspectionTypes=_e.TypeNameMetaFieldDef=_e.TypeMetaFieldDef=_e.SchemaMetaFieldDef=_e.__TypeKind=_e.TypeKind=_e.__EnumValue=_e.__InputValue=_e.__Field=_e.__Type=_e.__DirectiveLocation=_e.__Directive=_e.__Schema=void 0;var wm=Om(Pt()),KW=Om(fe()),HW=Om(st()),QW=bt(),Qe=Zi(),WW=Jo(),Te=Tr(),U=ae();function Om(e){return e&&e.__esModule?e:{default:e}}var Im=new U.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:function(){return{description:{type:Te.GraphQLString,resolve:function(r){return r.description}},types:{description:"A list of all types supported by this server.",type:new U.GraphQLNonNull(new U.GraphQLList(new U.GraphQLNonNull(Qt))),resolve:function(r){return(0,wm.default)(r.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new U.GraphQLNonNull(Qt),resolve:function(r){return r.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Qt,resolve:function(r){return r.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Qt,resolve:function(r){return r.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new U.GraphQLNonNull(new U.GraphQLList(new U.GraphQLNonNull(Am))),resolve:function(r){return r.getDirectives()}}}}});_e.__Schema=Im;var Am=new U.GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
72
-
73
- In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:function(){return{name:{type:new U.GraphQLNonNull(Te.GraphQLString),resolve:function(r){return r.name}},description:{type:Te.GraphQLString,resolve:function(r){return r.description}},isRepeatable:{type:new U.GraphQLNonNull(Te.GraphQLBoolean),resolve:function(r){return r.isRepeatable}},locations:{type:new U.GraphQLNonNull(new U.GraphQLList(new U.GraphQLNonNull(Nm))),resolve:function(r){return r.locations}},args:{type:new U.GraphQLNonNull(new U.GraphQLList(new U.GraphQLNonNull(zo))),args:{includeDeprecated:{type:Te.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;return i?r.args:r.args.filter(function(s){return s.deprecationReason==null})}}}}});_e.__Directive=Am;var Nm=new U.GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:Qe.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:Qe.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:Qe.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:Qe.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:Qe.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:Qe.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:Qe.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:Qe.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:Qe.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:Qe.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:Qe.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:Qe.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:Qe.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:Qe.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:Qe.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:Qe.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:Qe.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:Qe.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:Qe.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});_e.__DirectiveLocation=Nm;var Qt=new U.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:function(){return{kind:{type:new U.GraphQLNonNull(Rm),resolve:function(r){if((0,U.isScalarType)(r))return ot.SCALAR;if((0,U.isObjectType)(r))return ot.OBJECT;if((0,U.isInterfaceType)(r))return ot.INTERFACE;if((0,U.isUnionType)(r))return ot.UNION;if((0,U.isEnumType)(r))return ot.ENUM;if((0,U.isInputObjectType)(r))return ot.INPUT_OBJECT;if((0,U.isListType)(r))return ot.LIST;if((0,U.isNonNullType)(r))return ot.NON_NULL;(0,HW.default)(0,'Unexpected type: "'.concat((0,KW.default)(r),'".'))}},name:{type:Te.GraphQLString,resolve:function(r){return r.name!==void 0?r.name:void 0}},description:{type:Te.GraphQLString,resolve:function(r){return r.description!==void 0?r.description:void 0}},specifiedByUrl:{type:Te.GraphQLString,resolve:function(r){return r.specifiedByUrl!==void 0?r.specifiedByUrl:void 0}},fields:{type:new U.GraphQLList(new U.GraphQLNonNull(Cm)),args:{includeDeprecated:{type:Te.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,U.isObjectType)(r)||(0,U.isInterfaceType)(r)){var s=(0,wm.default)(r.getFields());return i?s:s.filter(function(o){return o.deprecationReason==null})}}},interfaces:{type:new U.GraphQLList(new U.GraphQLNonNull(Qt)),resolve:function(r){if((0,U.isObjectType)(r)||(0,U.isInterfaceType)(r))return r.getInterfaces()}},possibleTypes:{type:new U.GraphQLList(new U.GraphQLNonNull(Qt)),resolve:function(r,n,i,s){var o=s.schema;if((0,U.isAbstractType)(r))return o.getPossibleTypes(r)}},enumValues:{type:new U.GraphQLList(new U.GraphQLNonNull(Pm)),args:{includeDeprecated:{type:Te.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,U.isEnumType)(r)){var s=r.getValues();return i?s:s.filter(function(o){return o.deprecationReason==null})}}},inputFields:{type:new U.GraphQLList(new U.GraphQLNonNull(zo)),args:{includeDeprecated:{type:Te.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,U.isInputObjectType)(r)){var s=(0,wm.default)(r.getFields());return i?s:s.filter(function(o){return o.deprecationReason==null})}}},ofType:{type:Qt,resolve:function(r){return r.ofType!==void 0?r.ofType:void 0}}}}});_e.__Type=Qt;var Cm=new U.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:function(){return{name:{type:new U.GraphQLNonNull(Te.GraphQLString),resolve:function(r){return r.name}},description:{type:Te.GraphQLString,resolve:function(r){return r.description}},args:{type:new U.GraphQLNonNull(new U.GraphQLList(new U.GraphQLNonNull(zo))),args:{includeDeprecated:{type:Te.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;return i?r.args:r.args.filter(function(s){return s.deprecationReason==null})}},type:{type:new U.GraphQLNonNull(Qt),resolve:function(r){return r.type}},isDeprecated:{type:new U.GraphQLNonNull(Te.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:Te.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});_e.__Field=Cm;var zo=new U.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:function(){return{name:{type:new U.GraphQLNonNull(Te.GraphQLString),resolve:function(r){return r.name}},description:{type:Te.GraphQLString,resolve:function(r){return r.description}},type:{type:new U.GraphQLNonNull(Qt),resolve:function(r){return r.type}},defaultValue:{type:Te.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(r){var n=r.type,i=r.defaultValue,s=(0,WW.astFromValue)(i,n);return s?(0,QW.print)(s):null}},isDeprecated:{type:new U.GraphQLNonNull(Te.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:Te.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});_e.__InputValue=zo;var Pm=new U.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:new U.GraphQLNonNull(Te.GraphQLString),resolve:function(r){return r.name}},description:{type:Te.GraphQLString,resolve:function(r){return r.description}},isDeprecated:{type:new U.GraphQLNonNull(Te.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:Te.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});_e.__EnumValue=Pm;var ot=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"});_e.TypeKind=ot;var Rm=new U.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:ot.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:ot.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:ot.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:ot.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:ot.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:ot.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:ot.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:ot.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});_e.__TypeKind=Rm;var YW={name:"__schema",type:new U.GraphQLNonNull(Im),description:"Access the current type schema of this server.",args:[],resolve:function(t,r,n,i){var s=i.schema;return s},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};_e.SchemaMetaFieldDef=YW;var JW={name:"__type",type:Qt,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new U.GraphQLNonNull(Te.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(t,r,n,i){var s=r.name,o=i.schema;return o.getType(s)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};_e.TypeMetaFieldDef=JW;var zW={name:"__typename",type:new U.GraphQLNonNull(Te.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:function(t,r,n,i){var s=i.parentType;return s.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};_e.TypeNameMetaFieldDef=zW;var D0=Object.freeze([Im,Am,Nm,Qt,Cm,zo,Pm,Rm]);_e.introspectionTypes=D0;function XW(e){return D0.some(function(t){var r=t.name;return e.name===r})}});var Tt=v(We=>{"use strict";f();Object.defineProperty(We,"__esModule",{value:!0});We.isDirective=j0;We.assertDirective=o2;We.isSpecifiedDirective=a2;We.specifiedDirectives=We.GraphQLSpecifiedByDirective=We.GraphQLDeprecatedDirective=We.DEFAULT_DEPRECATION_REASON=We.GraphQLSkipDirective=We.GraphQLIncludeDirective=We.GraphQLDirective=void 0;var ZW=oi(is()),e2=_r(),t2=oi(fe()),L0=oi(zu()),xm=oi(Kt()),r2=oi(Do()),n2=oi(Er()),i2=oi(ku()),cr=Zi(),pl=Tr(),hl=ae();function oi(e){return e&&e.__esModule?e:{default:e}}function k0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s2(e,t,r){return t&&k0(e.prototype,t),r&&k0(e,r),e}function j0(e){return(0,r2.default)(e,ai)}function o2(e){if(!j0(e))throw new Error("Expected ".concat((0,t2.default)(e)," to be a GraphQL directive."));return e}var ai=(function(){function e(r){var n,i;this.name=r.name,this.description=r.description,this.locations=r.locations,this.isRepeatable=(n=r.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=r.extensions&&(0,L0.default)(r.extensions),this.astNode=r.astNode,r.name||(0,xm.default)(0,"Directive must be named."),Array.isArray(r.locations)||(0,xm.default)(0,"@".concat(r.name," locations must be an Array."));var s=(i=r.args)!==null&&i!==void 0?i:{};(0,n2.default)(s)&&!Array.isArray(s)||(0,xm.default)(0,"@".concat(r.name," args must be an object with argument names as keys.")),this.args=(0,ZW.default)(s).map(function(o){var a=o[0],c=o[1];return{name:a,description:c.description,type:c.type,defaultValue:c.defaultValue,deprecationReason:c.deprecationReason,extensions:c.extensions&&(0,L0.default)(c.extensions),astNode:c.astNode}})}var t=e.prototype;return t.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:(0,hl.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},t.toString=function(){return"@"+this.name},t.toJSON=function(){return this.toString()},s2(e,[{key:e2.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLDirective"}}]),e})();We.GraphQLDirective=ai;(0,i2.default)(ai);var M0=new ai({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[cr.DirectiveLocation.FIELD,cr.DirectiveLocation.FRAGMENT_SPREAD,cr.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new hl.GraphQLNonNull(pl.GraphQLBoolean),description:"Included when true."}}});We.GraphQLIncludeDirective=M0;var q0=new ai({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[cr.DirectiveLocation.FIELD,cr.DirectiveLocation.FRAGMENT_SPREAD,cr.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new hl.GraphQLNonNull(pl.GraphQLBoolean),description:"Skipped when true."}}});We.GraphQLSkipDirective=q0;var F0="No longer supported";We.DEFAULT_DEPRECATION_REASON=F0;var U0=new ai({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[cr.DirectiveLocation.FIELD_DEFINITION,cr.DirectiveLocation.ARGUMENT_DEFINITION,cr.DirectiveLocation.INPUT_FIELD_DEFINITION,cr.DirectiveLocation.ENUM_VALUE],args:{reason:{type:pl.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:F0}}});We.GraphQLDeprecatedDirective=U0;var V0=new ai({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[cr.DirectiveLocation.SCALAR],args:{url:{type:new hl.GraphQLNonNull(pl.GraphQLString),description:"The URL that specifies the behaviour of this scalar."}}});We.GraphQLSpecifiedByDirective=V0;var G0=Object.freeze([M0,q0,U0,V0]);We.specifiedDirectives=G0;function a2(e){return G0.some(function(t){var r=t.name;return r===e.name})}});var ci=v(ls=>{"use strict";f();Object.defineProperty(ls,"__esModule",{value:!0});ls.isSchema=K0;ls.assertSchema=g2;ls.GraphQLSchema=void 0;var c2=vn(ns()),u2=vn(vm()),Dm=vn(Pt()),l2=_r(),Lm=vn(fe()),f2=vn(zu()),ml=vn(Kt()),d2=vn(Do()),p2=vn(Er()),h2=Wt(),$0=Tt(),ur=ae();function vn(e){return e&&e.__esModule?e:{default:e}}function B0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m2(e,t,r){return t&&B0(e.prototype,t),r&&B0(e,r),e}function K0(e){return(0,d2.default)(e,H0)}function g2(e){if(!K0(e))throw new Error("Expected ".concat((0,Lm.default)(e)," to be a GraphQL schema."));return e}var H0=(function(){function e(r){var n;this.__validationErrors=r.assumeValid===!0?[]:void 0,(0,p2.default)(r)||(0,ml.default)(0,"Must provide configuration object."),!r.types||Array.isArray(r.types)||(0,ml.default)(0,'"types" must be Array if provided but got: '.concat((0,Lm.default)(r.types),".")),!r.directives||Array.isArray(r.directives)||(0,ml.default)(0,'"directives" must be Array if provided but got: '+"".concat((0,Lm.default)(r.directives),".")),this.description=r.description,this.extensions=r.extensions&&(0,f2.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=r.extensionASTNodes,this._queryType=r.query,this._mutationType=r.mutation,this._subscriptionType=r.subscription,this._directives=(n=r.directives)!==null&&n!==void 0?n:$0.specifiedDirectives;var i=new Set(r.types);if(r.types!=null)for(var s=0,o=r.types;s<o.length;s++){var a=o[s];i.delete(a),lr(a,i)}this._queryType!=null&&lr(this._queryType,i),this._mutationType!=null&&lr(this._mutationType,i),this._subscriptionType!=null&&lr(this._subscriptionType,i);for(var c=0,u=this._directives;c<u.length;c++){var l=u[c];if((0,$0.isDirective)(l))for(var d=0,p=l.args;d<p.length;d++){var h=p[d];lr(h.type,i)}}lr(h2.__Schema,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var g=0,y=(0,u2.default)(i);g<y.length;g++){var E=y[g];if(E!=null){var S=E.name;if(S||(0,ml.default)(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[S]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(S,'".'));if(this._typeMap[S]=E,(0,ur.isInterfaceType)(E))for(var _=0,w=E.getInterfaces();_<w.length;_++){var I=w[_];if((0,ur.isInterfaceType)(I)){var T=this._implementationsMap[I.name];T===void 0&&(T=this._implementationsMap[I.name]={objects:[],interfaces:[]}),T.interfaces.push(E)}}else if((0,ur.isObjectType)(E))for(var N=0,P=E.getInterfaces();N<P.length;N++){var O=P[N];if((0,ur.isInterfaceType)(O)){var $=this._implementationsMap[O.name];$===void 0&&($=this._implementationsMap[O.name]={objects:[],interfaces:[]}),$.objects.push(E)}}}}}var t=e.prototype;return t.getQueryType=function(){return this._queryType},t.getMutationType=function(){return this._mutationType},t.getSubscriptionType=function(){return this._subscriptionType},t.getTypeMap=function(){return this._typeMap},t.getType=function(n){return this.getTypeMap()[n]},t.getPossibleTypes=function(n){return(0,ur.isUnionType)(n)?n.getTypes():this.getImplementations(n).objects},t.getImplementations=function(n){var i=this._implementationsMap[n.name];return i??{objects:[],interfaces:[]}},t.isPossibleType=function(n,i){return this.isSubType(n,i)},t.isSubType=function(n,i){var s=this._subTypeMap[n.name];if(s===void 0){if(s=Object.create(null),(0,ur.isUnionType)(n))for(var o=0,a=n.getTypes();o<a.length;o++){var c=a[o];s[c.name]=!0}else{for(var u=this.getImplementations(n),l=0,d=u.objects;l<d.length;l++){var p=d[l];s[p.name]=!0}for(var h=0,g=u.interfaces;h<g.length;h++){var y=g[h];s[y.name]=!0}}this._subTypeMap[n.name]=s}return s[i.name]!==void 0},t.getDirectives=function(){return this._directives},t.getDirective=function(n){return(0,c2.default)(this.getDirectives(),function(i){return i.name===n})},t.toConfig=function(){var n;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:(0,Dm.default)(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[],assumeValid:this.__validationErrors!==void 0}},m2(e,[{key:l2.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLSchema"}}]),e})();ls.GraphQLSchema=H0;function lr(e,t){var r=(0,ur.getNamedType)(e);if(!t.has(r)){if(t.add(r),(0,ur.isUnionType)(r))for(var n=0,i=r.getTypes();n<i.length;n++){var s=i[n];lr(s,t)}else if((0,ur.isObjectType)(r)||(0,ur.isInterfaceType)(r)){for(var o=0,a=r.getInterfaces();o<a.length;o++){var c=a[o];lr(c,t)}for(var u=0,l=(0,Dm.default)(r.getFields());u<l.length;u++){var d=l[u];lr(d.type,t);for(var p=0,h=d.args;p<h.length;p++){var g=h[p];lr(g.type,t)}}}else if((0,ur.isInputObjectType)(r))for(var y=0,E=(0,Dm.default)(r.getFields());y<E.length;y++){var S=E[y];lr(S.type,t)}}return t}});var ea=v(gl=>{"use strict";f();Object.defineProperty(gl,"__esModule",{value:!0});gl.validateSchema=Z0;gl.assertValidSchema=b2;var Q0=jm(ns()),Zo=jm(Pt()),lt=jm(fe()),y2=H(),v2=Mo(),E2=Hh(),W0=Bo(),_2=ci(),S2=Wt(),X0=Tt(),Ue=ae();function jm(e){return e&&e.__esModule?e:{default:e}}function Z0(e){if((0,_2.assertSchema)(e),e.__validationErrors)return e.__validationErrors;var t=new T2(e);w2(t),O2(t),I2(t);var r=t.getErrors();return e.__validationErrors=r,r}function b2(e){var t=Z0(e);if(t.length!==0)throw new Error(t.map(function(r){return r.message}).join(`
74
-
75
- `))}var T2=(function(){function e(r){this._errors=[],this.schema=r}var t=e.prototype;return t.reportError=function(n,i){var s=Array.isArray(i)?i.filter(Boolean):i;this.addError(new y2.GraphQLError(n,s))},t.addError=function(n){this._errors.push(n)},t.getErrors=function(){return this._errors},e})();function w2(e){var t=e.schema,r=t.getQueryType();if(!r)e.reportError("Query root type must be provided.",t.astNode);else if(!(0,Ue.isObjectType)(r)){var n;e.reportError("Query root type must be Object type, it cannot be ".concat((0,lt.default)(r),"."),(n=km(t,"query"))!==null&&n!==void 0?n:r.astNode)}var i=t.getMutationType();if(i&&!(0,Ue.isObjectType)(i)){var s;e.reportError("Mutation root type must be Object type if provided, it cannot be "+"".concat((0,lt.default)(i),"."),(s=km(t,"mutation"))!==null&&s!==void 0?s:i.astNode)}var o=t.getSubscriptionType();if(o&&!(0,Ue.isObjectType)(o)){var a;e.reportError("Subscription root type must be Object type if provided, it cannot be "+"".concat((0,lt.default)(o),"."),(a=km(t,"subscription"))!==null&&a!==void 0?a:o.astNode)}}function km(e,t){for(var r=Mm(e,function(s){return s.operationTypes}),n=0;n<r.length;n++){var i=r[n];if(i.operation===t)return i.type}}function O2(e){for(var t=0,r=e.schema.getDirectives();t<r.length;t++){var n=r[t];if(!(0,X0.isDirective)(n)){e.reportError("Expected directive but got: ".concat((0,lt.default)(n),"."),n?.astNode);continue}ui(e,n);for(var i=0,s=n.args;i<s.length;i++){var o=s[i];if(ui(e,o),(0,Ue.isInputType)(o.type)||e.reportError("The type of @".concat(n.name,"(").concat(o.name,":) must be Input Type ")+"but got: ".concat((0,lt.default)(o.type),"."),o.astNode),(0,Ue.isRequiredArgument)(o)&&o.deprecationReason!=null){var a;e.reportError("Required argument @".concat(n.name,"(").concat(o.name,":) cannot be deprecated."),[qm(o.astNode),(a=o.astNode)===null||a===void 0?void 0:a.type])}}}}function ui(e,t){var r=(0,E2.isValidNameError)(t.name);r&&e.addError((0,v2.locatedError)(r,t.astNode))}function I2(e){for(var t=x2(e),r=e.schema.getTypeMap(),n=0,i=(0,Zo.default)(r);n<i.length;n++){var s=i[n];if(!(0,Ue.isNamedType)(s)){e.reportError("Expected GraphQL named type but got: ".concat((0,lt.default)(s),"."),s.astNode);continue}(0,S2.isIntrospectionType)(s)||ui(e,s),(0,Ue.isObjectType)(s)||(0,Ue.isInterfaceType)(s)?(Y0(e,s),J0(e,s)):(0,Ue.isUnionType)(s)?C2(e,s):(0,Ue.isEnumType)(s)?P2(e,s):(0,Ue.isInputObjectType)(s)&&(R2(e,s),t(s))}}function Y0(e,t){var r=(0,Zo.default)(t.getFields());r.length===0&&e.reportError("Type ".concat(t.name," must define one or more fields."),fs(t));for(var n=0;n<r.length;n++){var i=r[n];if(ui(e,i),!(0,Ue.isOutputType)(i.type)){var s;e.reportError("The type of ".concat(t.name,".").concat(i.name," must be Output Type ")+"but got: ".concat((0,lt.default)(i.type),"."),(s=i.astNode)===null||s===void 0?void 0:s.type)}for(var o=0,a=i.args;o<a.length;o++){var c=a[o],u=c.name;if(ui(e,c),!(0,Ue.isInputType)(c.type)){var l;e.reportError("The type of ".concat(t.name,".").concat(i.name,"(").concat(u,":) must be Input ")+"Type but got: ".concat((0,lt.default)(c.type),"."),(l=c.astNode)===null||l===void 0?void 0:l.type)}if((0,Ue.isRequiredArgument)(c)&&c.deprecationReason!=null){var d;e.reportError("Required argument ".concat(t.name,".").concat(i.name,"(").concat(u,":) cannot be deprecated."),[qm(c.astNode),(d=c.astNode)===null||d===void 0?void 0:d.type])}}}}function J0(e,t){for(var r=Object.create(null),n=0,i=t.getInterfaces();n<i.length;n++){var s=i[n];if(!(0,Ue.isInterfaceType)(s)){e.reportError("Type ".concat((0,lt.default)(t)," must only implement Interface types, ")+"it cannot implement ".concat((0,lt.default)(s),"."),Xo(t,s));continue}if(t===s){e.reportError("Type ".concat(t.name," cannot implement itself because it would create a circular reference."),Xo(t,s));continue}if(r[s.name]){e.reportError("Type ".concat(t.name," can only implement ").concat(s.name," once."),Xo(t,s));continue}r[s.name]=!0,N2(e,t,s),A2(e,t,s)}}function A2(e,t,r){for(var n=t.getFields(),i=0,s=(0,Zo.default)(r.getFields());i<s.length;i++){var o=s[i],a=o.name,c=n[a];if(!c){e.reportError("Interface field ".concat(r.name,".").concat(a," expected but ").concat(t.name," does not provide it."),[o.astNode].concat(fs(t)));continue}if(!(0,W0.isTypeSubTypeOf)(e.schema,c.type,o.type)){var u,l;e.reportError("Interface field ".concat(r.name,".").concat(a," expects type ")+"".concat((0,lt.default)(o.type)," but ").concat(t.name,".").concat(a," ")+"is type ".concat((0,lt.default)(c.type),"."),[(u=o.astNode)===null||u===void 0?void 0:u.type,(l=c.astNode)===null||l===void 0?void 0:l.type])}for(var d=function(w,I){var T=I[w],N=T.name,P=(0,Q0.default)(c.args,function(Z){return Z.name===N});if(!P)return e.reportError("Interface field argument ".concat(r.name,".").concat(a,"(").concat(N,":) expected but ").concat(t.name,".").concat(a," does not provide it."),[T.astNode,c.astNode]),"continue";if(!(0,W0.isEqualType)(T.type,P.type)){var O,$;e.reportError("Interface field argument ".concat(r.name,".").concat(a,"(").concat(N,":) ")+"expects type ".concat((0,lt.default)(T.type)," but ")+"".concat(t.name,".").concat(a,"(").concat(N,":) is type ")+"".concat((0,lt.default)(P.type),"."),[(O=T.astNode)===null||O===void 0?void 0:O.type,($=P.astNode)===null||$===void 0?void 0:$.type])}},p=0,h=o.args;p<h.length;p++)var g=d(p,h);for(var y=function(w,I){var T=I[w],N=T.name,P=(0,Q0.default)(o.args,function(O){return O.name===N});!P&&(0,Ue.isRequiredArgument)(T)&&e.reportError("Object field ".concat(t.name,".").concat(a," includes required argument ").concat(N," that is missing from the Interface field ").concat(r.name,".").concat(a,"."),[T.astNode,o.astNode])},E=0,S=c.args;E<S.length;E++)y(E,S)}}function N2(e,t,r){for(var n=t.getInterfaces(),i=0,s=r.getInterfaces();i<s.length;i++){var o=s[i];n.indexOf(o)===-1&&e.reportError(o===t?"Type ".concat(t.name," cannot implement ").concat(r.name," because it would create a circular reference."):"Type ".concat(t.name," must implement ").concat(o.name," because it is implemented by ").concat(r.name,"."),[].concat(Xo(r,o),Xo(t,r)))}}function C2(e,t){var r=t.getTypes();r.length===0&&e.reportError("Union type ".concat(t.name," must define one or more member types."),fs(t));for(var n=Object.create(null),i=0;i<r.length;i++){var s=r[i];if(n[s.name]){e.reportError("Union type ".concat(t.name," can only include type ").concat(s.name," once."),z0(t,s.name));continue}n[s.name]=!0,(0,Ue.isObjectType)(s)||e.reportError("Union type ".concat(t.name," can only include Object types, ")+"it cannot include ".concat((0,lt.default)(s),"."),z0(t,String(s)))}}function P2(e,t){var r=t.getValues();r.length===0&&e.reportError("Enum type ".concat(t.name," must define one or more values."),fs(t));for(var n=0;n<r.length;n++){var i=r[n],s=i.name;ui(e,i),(s==="true"||s==="false"||s==="null")&&e.reportError("Enum type ".concat(t.name," cannot include value: ").concat(s,"."),i.astNode)}}function R2(e,t){var r=(0,Zo.default)(t.getFields());r.length===0&&e.reportError("Input Object type ".concat(t.name," must define one or more fields."),fs(t));for(var n=0;n<r.length;n++){var i=r[n];if(ui(e,i),!(0,Ue.isInputType)(i.type)){var s;e.reportError("The type of ".concat(t.name,".").concat(i.name," must be Input Type ")+"but got: ".concat((0,lt.default)(i.type),"."),(s=i.astNode)===null||s===void 0?void 0:s.type)}if((0,Ue.isRequiredInputField)(i)&&i.deprecationReason!=null){var o;e.reportError("Required input field ".concat(t.name,".").concat(i.name," cannot be deprecated."),[qm(i.astNode),(o=i.astNode)===null||o===void 0?void 0:o.type])}}}function x2(e){var t=Object.create(null),r=[],n=Object.create(null);return i;function i(s){if(!t[s.name]){t[s.name]=!0,n[s.name]=r.length;for(var o=(0,Zo.default)(s.getFields()),a=0;a<o.length;a++){var c=o[a];if((0,Ue.isNonNullType)(c.type)&&(0,Ue.isInputObjectType)(c.type.ofType)){var u=c.type.ofType,l=n[u.name];if(r.push(c),l===void 0)i(u);else{var d=r.slice(l),p=d.map(function(h){return h.name}).join(".");e.reportError('Cannot reference Input Object "'.concat(u.name,'" within itself through a series of non-null fields: "').concat(p,'".'),d.map(function(h){return h.astNode}))}r.pop()}}n[s.name]=void 0}}}function fs(e){var t=e.astNode,r=e.extensionASTNodes;return t?r?[t].concat(r):[t]:r??[]}function Mm(e,t){for(var r=[],n=0,i=fs(e);n<i.length;n++){var s,o=i[n];r=r.concat((s=t(o))!==null&&s!==void 0?s:[])}return r}function Xo(e,t){return Mm(e,function(r){return r.interfaces}).filter(function(r){return r.name.value===t.name})}function z0(e,t){return Mm(e,function(r){return r.types}).filter(function(r){return r.name.value===t})}function qm(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(function(r){return r.name.value===X0.GraphQLDeprecatedDirective.name})}});var wr=v(Vm=>{"use strict";f();Object.defineProperty(Vm,"__esModule",{value:!0});Vm.typeFromAST=Um;var D2=tA(fe()),L2=tA(st()),Fm=be(),eA=ae();function tA(e){return e&&e.__esModule?e:{default:e}}function Um(e,t){var r;if(t.kind===Fm.Kind.LIST_TYPE)return r=Um(e,t.type),r&&new eA.GraphQLList(r);if(t.kind===Fm.Kind.NON_NULL_TYPE)return r=Um(e,t.type),r&&new eA.GraphQLNonNull(r);if(t.kind===Fm.Kind.NAMED_TYPE)return e.getType(t.name.value);(0,L2.default)(0,"Unexpected type node: "+(0,D2.default)(t))}});var yl=v(ta=>{"use strict";f();Object.defineProperty(ta,"__esModule",{value:!0});ta.visitWithTypeInfo=U2;ta.TypeInfo=void 0;var k2=M2(ns()),je=be(),j2=zi(),rA=cn(),Me=ae(),ds=Wt(),nA=wr();function M2(e){return e&&e.__esModule?e:{default:e}}var q2=(function(){function e(r,n,i){this._schema=r,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??F2,i&&((0,Me.isInputType)(i)&&this._inputTypeStack.push(i),(0,Me.isCompositeType)(i)&&this._parentTypeStack.push(i),(0,Me.isOutputType)(i)&&this._typeStack.push(i))}var t=e.prototype;return t.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},t.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},t.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},t.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},t.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},t.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},t.getDirective=function(){return this._directive},t.getArgument=function(){return this._argument},t.getEnumValue=function(){return this._enumValue},t.enter=function(n){var i=this._schema;switch(n.kind){case je.Kind.SELECTION_SET:{var s=(0,Me.getNamedType)(this.getType());this._parentTypeStack.push((0,Me.isCompositeType)(s)?s:void 0);break}case je.Kind.FIELD:{var o=this.getParentType(),a,c;o&&(a=this._getFieldDef(i,o,n),a&&(c=a.type)),this._fieldDefStack.push(a),this._typeStack.push((0,Me.isOutputType)(c)?c:void 0);break}case je.Kind.DIRECTIVE:this._directive=i.getDirective(n.name.value);break;case je.Kind.OPERATION_DEFINITION:{var u;switch(n.operation){case"query":u=i.getQueryType();break;case"mutation":u=i.getMutationType();break;case"subscription":u=i.getSubscriptionType();break}this._typeStack.push((0,Me.isObjectType)(u)?u:void 0);break}case je.Kind.INLINE_FRAGMENT:case je.Kind.FRAGMENT_DEFINITION:{var l=n.typeCondition,d=l?(0,nA.typeFromAST)(i,l):(0,Me.getNamedType)(this.getType());this._typeStack.push((0,Me.isOutputType)(d)?d:void 0);break}case je.Kind.VARIABLE_DEFINITION:{var p=(0,nA.typeFromAST)(i,n.type);this._inputTypeStack.push((0,Me.isInputType)(p)?p:void 0);break}case je.Kind.ARGUMENT:{var h,g,y,E=(h=this.getDirective())!==null&&h!==void 0?h:this.getFieldDef();E&&(g=(0,k2.default)(E.args,function(O){return O.name===n.name.value}),g&&(y=g.type)),this._argument=g,this._defaultValueStack.push(g?g.defaultValue:void 0),this._inputTypeStack.push((0,Me.isInputType)(y)?y:void 0);break}case je.Kind.LIST:{var S=(0,Me.getNullableType)(this.getInputType()),_=(0,Me.isListType)(S)?S.ofType:S;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,Me.isInputType)(_)?_:void 0);break}case je.Kind.OBJECT_FIELD:{var w=(0,Me.getNamedType)(this.getInputType()),I,T;(0,Me.isInputObjectType)(w)&&(T=w.getFields()[n.name.value],T&&(I=T.type)),this._defaultValueStack.push(T?T.defaultValue:void 0),this._inputTypeStack.push((0,Me.isInputType)(I)?I:void 0);break}case je.Kind.ENUM:{var N=(0,Me.getNamedType)(this.getInputType()),P;(0,Me.isEnumType)(N)&&(P=N.getValue(n.value)),this._enumValue=P;break}}},t.leave=function(n){switch(n.kind){case je.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case je.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case je.Kind.DIRECTIVE:this._directive=null;break;case je.Kind.OPERATION_DEFINITION:case je.Kind.INLINE_FRAGMENT:case je.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case je.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case je.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case je.Kind.LIST:case je.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case je.Kind.ENUM:this._enumValue=null;break}},e})();ta.TypeInfo=q2;function F2(e,t,r){var n=r.name.value;if(n===ds.SchemaMetaFieldDef.name&&e.getQueryType()===t)return ds.SchemaMetaFieldDef;if(n===ds.TypeMetaFieldDef.name&&e.getQueryType()===t)return ds.TypeMetaFieldDef;if(n===ds.TypeNameMetaFieldDef.name&&(0,Me.isCompositeType)(t))return ds.TypeNameMetaFieldDef;if((0,Me.isObjectType)(t)||(0,Me.isInterfaceType)(t))return t.getFields()[n]}function U2(e,t){return{enter:function(n){e.enter(n);var i=(0,rA.getVisitFn)(t,n.kind,!1);if(i){var s=i.apply(t,arguments);return s!==void 0&&(e.leave(n),(0,j2.isNode)(s)&&e.enter(s)),s}},leave:function(n){var i=(0,rA.getVisitFn)(t,n.kind,!0),s;return i&&(s=i.apply(t,arguments)),e.leave(n),s}}}});var li=v(fr=>{"use strict";f();Object.defineProperty(fr,"__esModule",{value:!0});fr.isDefinitionNode=V2;fr.isExecutableDefinitionNode=iA;fr.isSelectionNode=G2;fr.isValueNode=$2;fr.isTypeNode=B2;fr.isTypeSystemDefinitionNode=sA;fr.isTypeDefinitionNode=oA;fr.isTypeSystemExtensionNode=aA;fr.isTypeExtensionNode=cA;var de=be();function V2(e){return iA(e)||sA(e)||aA(e)}function iA(e){return e.kind===de.Kind.OPERATION_DEFINITION||e.kind===de.Kind.FRAGMENT_DEFINITION}function G2(e){return e.kind===de.Kind.FIELD||e.kind===de.Kind.FRAGMENT_SPREAD||e.kind===de.Kind.INLINE_FRAGMENT}function $2(e){return e.kind===de.Kind.VARIABLE||e.kind===de.Kind.INT||e.kind===de.Kind.FLOAT||e.kind===de.Kind.STRING||e.kind===de.Kind.BOOLEAN||e.kind===de.Kind.NULL||e.kind===de.Kind.ENUM||e.kind===de.Kind.LIST||e.kind===de.Kind.OBJECT}function B2(e){return e.kind===de.Kind.NAMED_TYPE||e.kind===de.Kind.LIST_TYPE||e.kind===de.Kind.NON_NULL_TYPE}function sA(e){return e.kind===de.Kind.SCHEMA_DEFINITION||oA(e)||e.kind===de.Kind.DIRECTIVE_DEFINITION}function oA(e){return e.kind===de.Kind.SCALAR_TYPE_DEFINITION||e.kind===de.Kind.OBJECT_TYPE_DEFINITION||e.kind===de.Kind.INTERFACE_TYPE_DEFINITION||e.kind===de.Kind.UNION_TYPE_DEFINITION||e.kind===de.Kind.ENUM_TYPE_DEFINITION||e.kind===de.Kind.INPUT_OBJECT_TYPE_DEFINITION}function aA(e){return e.kind===de.Kind.SCHEMA_EXTENSION||cA(e)}function cA(e){return e.kind===de.Kind.SCALAR_TYPE_EXTENSION||e.kind===de.Kind.OBJECT_TYPE_EXTENSION||e.kind===de.Kind.INTERFACE_TYPE_EXTENSION||e.kind===de.Kind.UNION_TYPE_EXTENSION||e.kind===de.Kind.ENUM_TYPE_EXTENSION||e.kind===de.Kind.INPUT_OBJECT_TYPE_EXTENSION}});var $m=v(Gm=>{"use strict";f();Object.defineProperty(Gm,"__esModule",{value:!0});Gm.ExecutableDefinitionsRule=Q2;var K2=H(),uA=be(),H2=li();function Q2(e){return{Document:function(r){for(var n=0,i=r.definitions;n<i.length;n++){var s=i[n];if(!(0,H2.isExecutableDefinitionNode)(s)){var o=s.kind===uA.Kind.SCHEMA_DEFINITION||s.kind===uA.Kind.SCHEMA_EXTENSION?"schema":'"'+s.name.value+'"';e.reportError(new K2.GraphQLError("The ".concat(o," definition is not executable."),s))}}return!1}}}});var Km=v(Bm=>{"use strict";f();Object.defineProperty(Bm,"__esModule",{value:!0});Bm.UniqueOperationNamesRule=Y2;var W2=H();function Y2(e){var t=Object.create(null);return{OperationDefinition:function(n){var i=n.name;return i&&(t[i.value]?e.reportError(new W2.GraphQLError('There can be only one operation named "'.concat(i.value,'".'),[t[i.value],i])):t[i.value]=i),!1},FragmentDefinition:function(){return!1}}}});var Qm=v(Hm=>{"use strict";f();Object.defineProperty(Hm,"__esModule",{value:!0});Hm.LoneAnonymousOperationRule=X2;var J2=H(),z2=be();function X2(e){var t=0;return{Document:function(n){t=n.definitions.filter(function(i){return i.kind===z2.Kind.OPERATION_DEFINITION}).length},OperationDefinition:function(n){!n.name&&t>1&&e.reportError(new J2.GraphQLError("This anonymous operation must be the only defined operation.",n))}}}});var Ym=v(Wm=>{"use strict";f();Object.defineProperty(Wm,"__esModule",{value:!0});Wm.SingleFieldSubscriptionsRule=eY;var Z2=H();function eY(e){return{OperationDefinition:function(r){r.operation==="subscription"&&r.selectionSet.selections.length!==1&&e.reportError(new Z2.GraphQLError(r.name?'Subscription "'.concat(r.name.value,'" must select only one top level field.'):"Anonymous Subscription must select only one top level field.",r.selectionSet.selections.slice(1)))}}}});var Xm=v(zm=>{"use strict";f();Object.defineProperty(zm,"__esModule",{value:!0});zm.KnownTypeNamesRule=oY;var tY=lA(ln()),rY=lA(fn()),nY=H(),Jm=li(),iY=Tr(),sY=Wt();function lA(e){return e&&e.__esModule?e:{default:e}}function oY(e){for(var t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null),i=0,s=e.getDocument().definitions;i<s.length;i++){var o=s[i];(0,Jm.isTypeDefinitionNode)(o)&&(n[o.name.value]=!0)}var a=Object.keys(r).concat(Object.keys(n));return{NamedType:function(u,l,d,p,h){var g=u.name.value;if(!r[g]&&!n[g]){var y,E=(y=h[2])!==null&&y!==void 0?y:d,S=E!=null&&cY(E);if(S&&aY(g))return;var _=(0,rY.default)(g,S?fA.concat(a):a);e.reportError(new nY.GraphQLError('Unknown type "'.concat(g,'".')+(0,tY.default)(_),u))}}}}var fA=[].concat(iY.specifiedScalarTypes,sY.introspectionTypes).map(function(e){return e.name});function aY(e){return fA.indexOf(e)!==-1}function cY(e){return!Array.isArray(e)&&((0,Jm.isTypeSystemDefinitionNode)(e)||(0,Jm.isTypeSystemExtensionNode)(e))}});var eg=v(Zm=>{"use strict";f();Object.defineProperty(Zm,"__esModule",{value:!0});Zm.FragmentsOnCompositeTypesRule=uY;var dA=H(),pA=bt(),hA=ae(),mA=wr();function uY(e){return{InlineFragment:function(r){var n=r.typeCondition;if(n){var i=(0,mA.typeFromAST)(e.getSchema(),n);if(i&&!(0,hA.isCompositeType)(i)){var s=(0,pA.print)(n);e.reportError(new dA.GraphQLError('Fragment cannot condition on non composite type "'.concat(s,'".'),n))}}},FragmentDefinition:function(r){var n=(0,mA.typeFromAST)(e.getSchema(),r.typeCondition);if(n&&!(0,hA.isCompositeType)(n)){var i=(0,pA.print)(r.typeCondition);e.reportError(new dA.GraphQLError('Fragment "'.concat(r.name.value,'" cannot condition on non composite type "').concat(i,'".'),r.typeCondition))}}}}});var rg=v(tg=>{"use strict";f();Object.defineProperty(tg,"__esModule",{value:!0});tg.VariablesAreInputTypesRule=hY;var lY=H(),fY=bt(),dY=ae(),pY=wr();function hY(e){return{VariableDefinition:function(r){var n=(0,pY.typeFromAST)(e.getSchema(),r.type);if(n&&!(0,dY.isInputType)(n)){var i=r.variable.name.value,s=(0,fY.print)(r.type);e.reportError(new lY.GraphQLError('Variable "$'.concat(i,'" cannot be non-input type "').concat(s,'".'),r.type))}}}}});var ig=v(ng=>{"use strict";f();Object.defineProperty(ng,"__esModule",{value:!0});ng.ScalarLeafsRule=gY;var gA=mY(fe()),yA=H(),vA=ae();function mY(e){return e&&e.__esModule?e:{default:e}}function gY(e){return{Field:function(r){var n=e.getType(),i=r.selectionSet;if(n){if((0,vA.isLeafType)((0,vA.getNamedType)(n))){if(i){var s=r.name.value,o=(0,gA.default)(n);e.reportError(new yA.GraphQLError('Field "'.concat(s,'" must not have a selection since type "').concat(o,'" has no subfields.'),i))}}else if(!i){var a=r.name.value,c=(0,gA.default)(n);e.reportError(new yA.GraphQLError('Field "'.concat(a,'" of type "').concat(c,'" must have a selection of subfields. Did you mean "').concat(a,' { ... }"?'),r))}}}}}});var og=v(sg=>{"use strict";f();Object.defineProperty(sg,"__esModule",{value:!0});sg.FieldsOnCorrectTypeRule=SY;var yY=vl(vm()),EA=vl(ln()),vY=vl(fn()),EY=vl(Fo()),_Y=H(),ra=ae();function vl(e){return e&&e.__esModule?e:{default:e}}function SY(e){return{Field:function(r){var n=e.getParentType();if(n){var i=e.getFieldDef();if(!i){var s=e.getSchema(),o=r.name.value,a=(0,EA.default)("to use an inline fragment on",bY(s,n,o));a===""&&(a=(0,EA.default)(TY(n,o))),e.reportError(new _Y.GraphQLError('Cannot query field "'.concat(o,'" on type "').concat(n.name,'".')+a,r))}}}}}function bY(e,t,r){if(!(0,ra.isAbstractType)(t))return[];for(var n=new Set,i=Object.create(null),s=0,o=e.getPossibleTypes(t);s<o.length;s++){var a=o[s];if(a.getFields()[r]){n.add(a),i[a.name]=1;for(var c=0,u=a.getInterfaces();c<u.length;c++){var l,d=u[c];d.getFields()[r]&&(n.add(d),i[d.name]=((l=i[d.name])!==null&&l!==void 0?l:0)+1)}}}return(0,yY.default)(n).sort(function(p,h){var g=i[h.name]-i[p.name];return g!==0?g:(0,ra.isInterfaceType)(p)&&e.isSubType(p,h)?-1:(0,ra.isInterfaceType)(h)&&e.isSubType(h,p)?1:(0,EY.default)(p.name,h.name)}).map(function(p){return p.name})}function TY(e,t){if((0,ra.isObjectType)(e)||(0,ra.isInterfaceType)(e)){var r=Object.keys(e.getFields());return(0,vY.default)(t,r)}return[]}});var cg=v(ag=>{"use strict";f();Object.defineProperty(ag,"__esModule",{value:!0});ag.UniqueFragmentNamesRule=OY;var wY=H();function OY(e){var t=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(n){var i=n.name.value;return t[i]?e.reportError(new wY.GraphQLError('There can be only one fragment named "'.concat(i,'".'),[t[i],n.name])):t[i]=n.name,!1}}}});var lg=v(ug=>{"use strict";f();Object.defineProperty(ug,"__esModule",{value:!0});ug.KnownFragmentNamesRule=AY;var IY=H();function AY(e){return{FragmentSpread:function(r){var n=r.name.value,i=e.getFragment(n);i||e.reportError(new IY.GraphQLError('Unknown fragment "'.concat(n,'".'),r.name))}}}});var dg=v(fg=>{"use strict";f();Object.defineProperty(fg,"__esModule",{value:!0});fg.NoUnusedFragmentsRule=CY;var NY=H();function CY(e){var t=[],r=[];return{OperationDefinition:function(i){return t.push(i),!1},FragmentDefinition:function(i){return r.push(i),!1},Document:{leave:function(){for(var i=Object.create(null),s=0;s<t.length;s++)for(var o=t[s],a=0,c=e.getRecursivelyReferencedFragments(o);a<c.length;a++){var u=c[a];i[u.name.value]=!0}for(var l=0;l<r.length;l++){var d=r[l],p=d.name.value;i[p]!==!0&&e.reportError(new NY.GraphQLError('Fragment "'.concat(p,'" is never used.'),d))}}}}}});var mg=v(hg=>{"use strict";f();Object.defineProperty(hg,"__esModule",{value:!0});hg.PossibleFragmentSpreadsRule=xY;var El=RY(fe()),_A=H(),pg=ae(),PY=wr(),SA=Bo();function RY(e){return e&&e.__esModule?e:{default:e}}function xY(e){return{InlineFragment:function(r){var n=e.getType(),i=e.getParentType();if((0,pg.isCompositeType)(n)&&(0,pg.isCompositeType)(i)&&!(0,SA.doTypesOverlap)(e.getSchema(),n,i)){var s=(0,El.default)(i),o=(0,El.default)(n);e.reportError(new _A.GraphQLError('Fragment cannot be spread here as objects of type "'.concat(s,'" can never be of type "').concat(o,'".'),r))}},FragmentSpread:function(r){var n=r.name.value,i=DY(e,n),s=e.getParentType();if(i&&s&&!(0,SA.doTypesOverlap)(e.getSchema(),i,s)){var o=(0,El.default)(s),a=(0,El.default)(i);e.reportError(new _A.GraphQLError('Fragment "'.concat(n,'" cannot be spread here as objects of type "').concat(o,'" can never be of type "').concat(a,'".'),r))}}}}function DY(e,t){var r=e.getFragment(t);if(r){var n=(0,PY.typeFromAST)(e.getSchema(),r.typeCondition);if((0,pg.isCompositeType)(n))return n}}});var yg=v(gg=>{"use strict";f();Object.defineProperty(gg,"__esModule",{value:!0});gg.NoFragmentCyclesRule=kY;var LY=H();function kY(e){var t=Object.create(null),r=[],n=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(o){return i(o),!1}};function i(s){if(!t[s.name.value]){var o=s.name.value;t[o]=!0;var a=e.getFragmentSpreads(s.selectionSet);if(a.length!==0){n[o]=r.length;for(var c=0;c<a.length;c++){var u=a[c],l=u.name.value,d=n[l];if(r.push(u),d===void 0){var p=e.getFragment(l);p&&i(p)}else{var h=r.slice(d),g=h.slice(0,-1).map(function(y){return'"'+y.name.value+'"'}).join(", ");e.reportError(new LY.GraphQLError('Cannot spread fragment "'.concat(l,'" within itself')+(g!==""?" via ".concat(g,"."):"."),h))}r.pop()}n[o]=void 0}}}}});var Eg=v(vg=>{"use strict";f();Object.defineProperty(vg,"__esModule",{value:!0});vg.UniqueVariableNamesRule=MY;var jY=H();function MY(e){var t=Object.create(null);return{OperationDefinition:function(){t=Object.create(null)},VariableDefinition:function(n){var i=n.variable.name.value;t[i]?e.reportError(new jY.GraphQLError('There can be only one variable named "$'.concat(i,'".'),[t[i],n.variable.name])):t[i]=n.variable.name}}}});var Sg=v(_g=>{"use strict";f();Object.defineProperty(_g,"__esModule",{value:!0});_g.NoUndefinedVariablesRule=FY;var qY=H();function FY(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),s=0;s<i.length;s++){var o=i[s],a=o.node,c=a.name.value;t[c]!==!0&&e.reportError(new qY.GraphQLError(n.name?'Variable "$'.concat(c,'" is not defined by operation "').concat(n.name.value,'".'):'Variable "$'.concat(c,'" is not defined.'),[a,n]))}}},VariableDefinition:function(n){t[n.variable.name.value]=!0}}}});var Tg=v(bg=>{"use strict";f();Object.defineProperty(bg,"__esModule",{value:!0});bg.NoUnusedVariablesRule=VY;var UY=H();function VY(e){var t=[];return{OperationDefinition:{enter:function(){t=[]},leave:function(n){for(var i=Object.create(null),s=e.getRecursiveVariableUsages(n),o=0;o<s.length;o++){var a=s[o],c=a.node;i[c.name.value]=!0}for(var u=0,l=t;u<l.length;u++){var d=l[u],p=d.variable.name.value;i[p]!==!0&&e.reportError(new UY.GraphQLError(n.name?'Variable "$'.concat(p,'" is never used in operation "').concat(n.name.value,'".'):'Variable "$'.concat(p,'" is never used.'),d))}}},VariableDefinition:function(n){t.push(n)}}}});var Og=v(wg=>{"use strict";f();Object.defineProperty(wg,"__esModule",{value:!0});wg.KnownDirectivesRule=BY;var GY=wA(fe()),TA=wA(st()),bA=H(),Ne=be(),Ye=Zi(),$Y=Tt();function wA(e){return e&&e.__esModule?e:{default:e}}function BY(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():$Y.specifiedDirectives,i=0;i<n.length;i++){var s=n[i];t[s.name]=s.locations}for(var o=e.getDocument().definitions,a=0;a<o.length;a++){var c=o[a];c.kind===Ne.Kind.DIRECTIVE_DEFINITION&&(t[c.name.value]=c.locations.map(function(u){return u.value}))}return{Directive:function(l,d,p,h,g){var y=l.name.value,E=t[y];if(!E){e.reportError(new bA.GraphQLError('Unknown directive "@'.concat(y,'".'),l));return}var S=KY(g);S&&E.indexOf(S)===-1&&e.reportError(new bA.GraphQLError('Directive "@'.concat(y,'" may not be used on ').concat(S,"."),l))}}}function KY(e){var t=e[e.length-1];switch(!Array.isArray(t)||(0,TA.default)(0),t.kind){case Ne.Kind.OPERATION_DEFINITION:return HY(t.operation);case Ne.Kind.FIELD:return Ye.DirectiveLocation.FIELD;case Ne.Kind.FRAGMENT_SPREAD:return Ye.DirectiveLocation.FRAGMENT_SPREAD;case Ne.Kind.INLINE_FRAGMENT:return Ye.DirectiveLocation.INLINE_FRAGMENT;case Ne.Kind.FRAGMENT_DEFINITION:return Ye.DirectiveLocation.FRAGMENT_DEFINITION;case Ne.Kind.VARIABLE_DEFINITION:return Ye.DirectiveLocation.VARIABLE_DEFINITION;case Ne.Kind.SCHEMA_DEFINITION:case Ne.Kind.SCHEMA_EXTENSION:return Ye.DirectiveLocation.SCHEMA;case Ne.Kind.SCALAR_TYPE_DEFINITION:case Ne.Kind.SCALAR_TYPE_EXTENSION:return Ye.DirectiveLocation.SCALAR;case Ne.Kind.OBJECT_TYPE_DEFINITION:case Ne.Kind.OBJECT_TYPE_EXTENSION:return Ye.DirectiveLocation.OBJECT;case Ne.Kind.FIELD_DEFINITION:return Ye.DirectiveLocation.FIELD_DEFINITION;case Ne.Kind.INTERFACE_TYPE_DEFINITION:case Ne.Kind.INTERFACE_TYPE_EXTENSION:return Ye.DirectiveLocation.INTERFACE;case Ne.Kind.UNION_TYPE_DEFINITION:case Ne.Kind.UNION_TYPE_EXTENSION:return Ye.DirectiveLocation.UNION;case Ne.Kind.ENUM_TYPE_DEFINITION:case Ne.Kind.ENUM_TYPE_EXTENSION:return Ye.DirectiveLocation.ENUM;case Ne.Kind.ENUM_VALUE_DEFINITION:return Ye.DirectiveLocation.ENUM_VALUE;case Ne.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Ne.Kind.INPUT_OBJECT_TYPE_EXTENSION:return Ye.DirectiveLocation.INPUT_OBJECT;case Ne.Kind.INPUT_VALUE_DEFINITION:{var r=e[e.length-3];return r.kind===Ne.Kind.INPUT_OBJECT_TYPE_DEFINITION?Ye.DirectiveLocation.INPUT_FIELD_DEFINITION:Ye.DirectiveLocation.ARGUMENT_DEFINITION}}}function HY(e){switch(e){case"query":return Ye.DirectiveLocation.QUERY;case"mutation":return Ye.DirectiveLocation.MUTATION;case"subscription":return Ye.DirectiveLocation.SUBSCRIPTION}(0,TA.default)(0,"Unexpected operation: "+(0,GY.default)(e))}});var Ng=v(Ag=>{"use strict";f();Object.defineProperty(Ag,"__esModule",{value:!0});Ag.UniqueDirectivesPerLocationRule=YY;var QY=H(),Ig=be(),OA=li(),WY=Tt();function YY(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():WY.specifiedDirectives,i=0;i<n.length;i++){var s=n[i];t[s.name]=!s.isRepeatable}for(var o=e.getDocument().definitions,a=0;a<o.length;a++){var c=o[a];c.kind===Ig.Kind.DIRECTIVE_DEFINITION&&(t[c.name.value]=!c.repeatable)}var u=Object.create(null),l=Object.create(null);return{enter:function(p){if(p.directives!=null){var h;if(p.kind===Ig.Kind.SCHEMA_DEFINITION||p.kind===Ig.Kind.SCHEMA_EXTENSION)h=u;else if((0,OA.isTypeDefinitionNode)(p)||(0,OA.isTypeExtensionNode)(p)){var g=p.name.value;h=l[g],h===void 0&&(l[g]=h=Object.create(null))}else h=Object.create(null);for(var y=0,E=p.directives;y<E.length;y++){var S=E[y],_=S.name.value;t[_]&&(h[_]?e.reportError(new QY.GraphQLError('The directive "@'.concat(_,'" can only be used once at this location.'),[h[_],S])):h[_]=S)}}}}}});var Cg=v(_l=>{"use strict";f();Object.defineProperty(_l,"__esModule",{value:!0});_l.KnownArgumentNamesRule=ZY;_l.KnownArgumentNamesOnDirectivesRule=xA;var NA=RA(ln()),CA=RA(fn()),PA=H(),JY=be(),zY=Tt();function RA(e){return e&&e.__esModule?e:{default:e}}function IA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function AA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?IA(Object(r),!0).forEach(function(n){XY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):IA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function XY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZY(e){return AA(AA({},xA(e)),{},{Argument:function(r){var n=e.getArgument(),i=e.getFieldDef(),s=e.getParentType();if(!n&&i&&s){var o=r.name.value,a=i.args.map(function(u){return u.name}),c=(0,CA.default)(o,a);e.reportError(new PA.GraphQLError('Unknown argument "'.concat(o,'" on field "').concat(s.name,".").concat(i.name,'".')+(0,NA.default)(c),r))}}})}function xA(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():zY.specifiedDirectives,i=0;i<n.length;i++){var s=n[i];t[s.name]=s.args.map(function(d){return d.name})}for(var o=e.getDocument().definitions,a=0;a<o.length;a++){var c=o[a];if(c.kind===JY.Kind.DIRECTIVE_DEFINITION){var u,l=(u=c.arguments)!==null&&u!==void 0?u:[];t[c.name.value]=l.map(function(d){return d.name.value})}}return{Directive:function(p){var h=p.name.value,g=t[h];if(p.arguments&&g)for(var y=0,E=p.arguments;y<E.length;y++){var S=E[y],_=S.name.value;if(g.indexOf(_)===-1){var w=(0,CA.default)(_,g);e.reportError(new PA.GraphQLError('Unknown argument "'.concat(_,'" on directive "@').concat(h,'".')+(0,NA.default)(w),S))}}return!1}}}});var Rg=v(Pg=>{"use strict";f();Object.defineProperty(Pg,"__esModule",{value:!0});Pg.UniqueArgumentNamesRule=tJ;var eJ=H();function tJ(e){var t=Object.create(null);return{Field:function(){t=Object.create(null)},Directive:function(){t=Object.create(null)},Argument:function(n){var i=n.name.value;return t[i]?e.reportError(new eJ.GraphQLError('There can be only one argument named "'.concat(i,'".'),[t[i],n.name])):t[i]=n.name,!1}}}});var Dg=v(xg=>{"use strict";f();Object.defineProperty(xg,"__esModule",{value:!0});xg.ValuesOfCorrectTypeRule=oJ;var rJ=ia(Pt()),nJ=ia(un()),na=ia(fe()),iJ=ia(ln()),sJ=ia(fn()),di=H(),Sl=bt(),Or=ae();function ia(e){return e&&e.__esModule?e:{default:e}}function oJ(e){return{ListValue:function(r){var n=(0,Or.getNullableType)(e.getParentInputType());if(!(0,Or.isListType)(n))return fi(e,r),!1},ObjectValue:function(r){var n=(0,Or.getNamedType)(e.getInputType());if(!(0,Or.isInputObjectType)(n))return fi(e,r),!1;for(var i=(0,nJ.default)(r.fields,function(l){return l.name.value}),s=0,o=(0,rJ.default)(n.getFields());s<o.length;s++){var a=o[s],c=i[a.name];if(!c&&(0,Or.isRequiredInputField)(a)){var u=(0,na.default)(a.type);e.reportError(new di.GraphQLError('Field "'.concat(n.name,".").concat(a.name,'" of required type "').concat(u,'" was not provided.'),r))}}},ObjectField:function(r){var n=(0,Or.getNamedType)(e.getParentInputType()),i=e.getInputType();if(!i&&(0,Or.isInputObjectType)(n)){var s=(0,sJ.default)(r.name.value,Object.keys(n.getFields()));e.reportError(new di.GraphQLError('Field "'.concat(r.name.value,'" is not defined by type "').concat(n.name,'".')+(0,iJ.default)(s),r))}},NullValue:function(r){var n=e.getInputType();(0,Or.isNonNullType)(n)&&e.reportError(new di.GraphQLError('Expected value of type "'.concat((0,na.default)(n),'", found ').concat((0,Sl.print)(r),"."),r))},EnumValue:function(r){return fi(e,r)},IntValue:function(r){return fi(e,r)},FloatValue:function(r){return fi(e,r)},StringValue:function(r){return fi(e,r)},BooleanValue:function(r){return fi(e,r)}}}function fi(e,t){var r=e.getInputType();if(r){var n=(0,Or.getNamedType)(r);if(!(0,Or.isLeafType)(n)){var i=(0,na.default)(r);e.reportError(new di.GraphQLError('Expected value of type "'.concat(i,'", found ').concat((0,Sl.print)(t),"."),t));return}try{var s=n.parseLiteral(t,void 0);if(s===void 0){var o=(0,na.default)(r);e.reportError(new di.GraphQLError('Expected value of type "'.concat(o,'", found ').concat((0,Sl.print)(t),"."),t))}}catch(c){var a=(0,na.default)(r);c instanceof di.GraphQLError?e.reportError(c):e.reportError(new di.GraphQLError('Expected value of type "'.concat(a,'", found ').concat((0,Sl.print)(t),"; ")+c.message,t,void 0,void 0,void 0,c))}}}});var kg=v(Tl=>{"use strict";f();Object.defineProperty(Tl,"__esModule",{value:!0});Tl.ProvidedRequiredArgumentsRule=lJ;Tl.ProvidedRequiredArgumentsOnDirectivesRule=FA;var kA=qA(fe()),bl=qA(un()),jA=H(),MA=be(),aJ=bt(),cJ=Tt(),Lg=ae();function qA(e){return e&&e.__esModule?e:{default:e}}function DA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function LA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DA(Object(r),!0).forEach(function(n){uJ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uJ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lJ(e){return LA(LA({},FA(e)),{},{Field:{leave:function(r){var n,i=e.getFieldDef();if(!i)return!1;for(var s=(n=r.arguments)!==null&&n!==void 0?n:[],o=(0,bl.default)(s,function(p){return p.name.value}),a=0,c=i.args;a<c.length;a++){var u=c[a],l=o[u.name];if(!l&&(0,Lg.isRequiredArgument)(u)){var d=(0,kA.default)(u.type);e.reportError(new jA.GraphQLError('Field "'.concat(i.name,'" argument "').concat(u.name,'" of type "').concat(d,'" is required, but it was not provided.'),r))}}}}})}function FA(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():cJ.specifiedDirectives,i=0;i<n.length;i++){var s=n[i];t[s.name]=(0,bl.default)(s.args.filter(Lg.isRequiredArgument),function(d){return d.name})}for(var o=e.getDocument().definitions,a=0;a<o.length;a++){var c=o[a];if(c.kind===MA.Kind.DIRECTIVE_DEFINITION){var u,l=(u=c.arguments)!==null&&u!==void 0?u:[];t[c.name.value]=(0,bl.default)(l.filter(fJ),function(d){return d.name.value})}}return{Directive:{leave:function(p){var h=p.name.value,g=t[h];if(g)for(var y,E=(y=p.arguments)!==null&&y!==void 0?y:[],S=(0,bl.default)(E,function(P){return P.name.value}),_=0,w=Object.keys(g);_<w.length;_++){var I=w[_];if(!S[I]){var T=g[I].type,N=(0,Lg.isType)(T)?(0,kA.default)(T):(0,aJ.print)(T);e.reportError(new jA.GraphQLError('Directive "@'.concat(h,'" argument "').concat(I,'" of type "').concat(N,'" is required, but it was not provided.'),p))}}}}}}function fJ(e){return e.type.kind===MA.Kind.NON_NULL_TYPE&&e.defaultValue==null}});var Mg=v(jg=>{"use strict";f();Object.defineProperty(jg,"__esModule",{value:!0});jg.VariablesInAllowedPositionRule=gJ;var UA=mJ(fe()),dJ=H(),pJ=be(),VA=ae(),hJ=wr(),GA=Bo();function mJ(e){return e&&e.__esModule?e:{default:e}}function gJ(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),s=0;s<i.length;s++){var o=i[s],a=o.node,c=o.type,u=o.defaultValue,l=a.name.value,d=t[l];if(d&&c){var p=e.getSchema(),h=(0,hJ.typeFromAST)(p,d.type);if(h&&!yJ(p,h,d.defaultValue,c,u)){var g=(0,UA.default)(h),y=(0,UA.default)(c);e.reportError(new dJ.GraphQLError('Variable "$'.concat(l,'" of type "').concat(g,'" used in position expecting type "').concat(y,'".'),[d,a]))}}}}},VariableDefinition:function(n){t[n.variable.name.value]=n}}}function yJ(e,t,r,n,i){if((0,VA.isNonNullType)(n)&&!(0,VA.isNonNullType)(t)){var s=r!=null&&r.kind!==pJ.Kind.NULL,o=i!==void 0;if(!s&&!o)return!1;var a=n.ofType;return(0,GA.isTypeSubTypeOf)(e,t,a)}return(0,GA.isTypeSubTypeOf)(e,t,n)}});var Bg=v($g=>{"use strict";f();Object.defineProperty($g,"__esModule",{value:!0});$g.OverlappingFieldsCanBeMergedRule=SJ;var vJ=Vg(ns()),EJ=Vg(is()),$A=Vg(fe()),_J=H(),qg=be(),BA=bt(),wt=ae(),KA=wr();function Vg(e){return e&&e.__esModule?e:{default:e}}function HA(e){return Array.isArray(e)?e.map(function(t){var r=t[0],n=t[1];return'subfields "'.concat(r,'" conflict because ')+HA(n)}).join(" and "):e}function SJ(e){var t=new NJ,r=new Map;return{SelectionSet:function(i){for(var s=bJ(e,r,t,e.getParentType(),i),o=0;o<s.length;o++){var a=s[o],c=a[0],u=c[0],l=c[1],d=a[1],p=a[2],h=HA(l);e.reportError(new _J.GraphQLError('Fields "'.concat(u,'" conflict because ').concat(h,". Use different aliases on the fields to fetch both if this was intentional."),d.concat(p)))}}}}function bJ(e,t,r,n,i){var s=[],o=Il(e,t,n,i),a=o[0],c=o[1];if(wJ(e,s,t,r,a),c.length!==0)for(var u=0;u<c.length;u++){wl(e,s,t,r,!1,a,c[u]);for(var l=u+1;l<c.length;l++)Ol(e,s,t,r,!1,c[u],c[l])}return s}function wl(e,t,r,n,i,s,o){var a=e.getFragment(o);if(a){var c=Ug(e,r,a),u=c[0],l=c[1];if(s!==u){Gg(e,t,r,n,i,s,u);for(var d=0;d<l.length;d++){var p=l[d];n.has(p,o,i)||(n.add(p,o,i),wl(e,t,r,n,i,s,l[d]))}}}}function Ol(e,t,r,n,i,s,o){if(s!==o&&!n.has(s,o,i)){n.add(s,o,i);var a=e.getFragment(s),c=e.getFragment(o);if(!(!a||!c)){var u=Ug(e,r,a),l=u[0],d=u[1],p=Ug(e,r,c),h=p[0],g=p[1];Gg(e,t,r,n,i,l,h);for(var y=0;y<g.length;y++)Ol(e,t,r,n,i,s,g[y]);for(var E=0;E<d.length;E++)Ol(e,t,r,n,i,d[E],o)}}}function TJ(e,t,r,n,i,s,o,a){var c=[],u=Il(e,t,i,s),l=u[0],d=u[1],p=Il(e,t,o,a),h=p[0],g=p[1];if(Gg(e,c,t,r,n,l,h),g.length!==0)for(var y=0;y<g.length;y++)wl(e,c,t,r,n,l,g[y]);if(d.length!==0)for(var E=0;E<d.length;E++)wl(e,c,t,r,n,h,d[E]);for(var S=0;S<d.length;S++)for(var _=0;_<g.length;_++)Ol(e,c,t,r,n,d[S],g[_]);return c}function wJ(e,t,r,n,i){for(var s=0,o=(0,EJ.default)(i);s<o.length;s++){var a=o[s],c=a[0],u=a[1];if(u.length>1)for(var l=0;l<u.length;l++)for(var d=l+1;d<u.length;d++){var p=QA(e,r,n,!1,c,u[l],u[d]);p&&t.push(p)}}}function Gg(e,t,r,n,i,s,o){for(var a=0,c=Object.keys(s);a<c.length;a++){var u=c[a],l=o[u];if(l)for(var d=s[u],p=0;p<d.length;p++)for(var h=0;h<l.length;h++){var g=QA(e,r,n,i,u,d[p],l[h]);g&&t.push(g)}}}function QA(e,t,r,n,i,s,o){var a=s[0],c=s[1],u=s[2],l=o[0],d=o[1],p=o[2],h=n||a!==l&&(0,wt.isObjectType)(a)&&(0,wt.isObjectType)(l);if(!h){var g,y,E=c.name.value,S=d.name.value;if(E!==S)return[[i,'"'.concat(E,'" and "').concat(S,'" are different fields')],[c],[d]];var _=(g=c.arguments)!==null&&g!==void 0?g:[],w=(y=d.arguments)!==null&&y!==void 0?y:[];if(!OJ(_,w))return[[i,"they have differing arguments"],[c],[d]]}var I=u?.type,T=p?.type;if(I&&T&&Fg(I,T))return[[i,'they return conflicting types "'.concat((0,$A.default)(I),'" and "').concat((0,$A.default)(T),'"')],[c],[d]];var N=c.selectionSet,P=d.selectionSet;if(N&&P){var O=TJ(e,t,r,h,(0,wt.getNamedType)(I),N,(0,wt.getNamedType)(T),P);return AJ(O,i,c,d)}}function OJ(e,t){return e.length!==t.length?!1:e.every(function(r){var n=(0,vJ.default)(t,function(i){return i.name.value===r.name.value});return n?IJ(r.value,n.value):!1})}function IJ(e,t){return(0,BA.print)(e)===(0,BA.print)(t)}function Fg(e,t){return(0,wt.isListType)(e)?(0,wt.isListType)(t)?Fg(e.ofType,t.ofType):!0:(0,wt.isListType)(t)?!0:(0,wt.isNonNullType)(e)?(0,wt.isNonNullType)(t)?Fg(e.ofType,t.ofType):!0:(0,wt.isNonNullType)(t)?!0:(0,wt.isLeafType)(e)||(0,wt.isLeafType)(t)?e!==t:!1}function Il(e,t,r,n){var i=t.get(n);if(!i){var s=Object.create(null),o=Object.create(null);WA(e,r,n,s,o),i=[s,Object.keys(o)],t.set(n,i)}return i}function Ug(e,t,r){var n=t.get(r.selectionSet);if(n)return n;var i=(0,KA.typeFromAST)(e.getSchema(),r.typeCondition);return Il(e,t,i,r.selectionSet)}function WA(e,t,r,n,i){for(var s=0,o=r.selections;s<o.length;s++){var a=o[s];switch(a.kind){case qg.Kind.FIELD:{var c=a.name.value,u=void 0;((0,wt.isObjectType)(t)||(0,wt.isInterfaceType)(t))&&(u=t.getFields()[c]);var l=a.alias?a.alias.value:c;n[l]||(n[l]=[]),n[l].push([t,a,u]);break}case qg.Kind.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case qg.Kind.INLINE_FRAGMENT:{var d=a.typeCondition,p=d?(0,KA.typeFromAST)(e.getSchema(),d):t;WA(e,p,a.selectionSet,n,i);break}}}}function AJ(e,t,r,n){if(e.length>0)return[[t,e.map(function(i){var s=i[0];return s})],e.reduce(function(i,s){var o=s[1];return i.concat(o)},[r]),e.reduce(function(i,s){var o=s[2];return i.concat(o)},[n])]}var NJ=(function(){function e(){this._data=Object.create(null)}var t=e.prototype;return t.has=function(n,i,s){var o=this._data[n],a=o&&o[i];return a===void 0?!1:s===!1?a===!1:!0},t.add=function(n,i,s){this._pairSetAdd(n,i,s),this._pairSetAdd(i,n,s)},t._pairSetAdd=function(n,i,s){var o=this._data[n];o||(o=Object.create(null),this._data[n]=o),o[i]=s},e})()});var Hg=v(Kg=>{"use strict";f();Object.defineProperty(Kg,"__esModule",{value:!0});Kg.UniqueInputFieldNamesRule=PJ;var CJ=H();function PJ(e){var t=[],r=Object.create(null);return{ObjectValue:{enter:function(){t.push(r),r=Object.create(null)},leave:function(){r=t.pop()}},ObjectField:function(i){var s=i.name.value;r[s]?e.reportError(new CJ.GraphQLError('There can be only one input field named "'.concat(s,'".'),[r[s],i.name])):r[s]=i.name}}}});var Wg=v(Qg=>{"use strict";f();Object.defineProperty(Qg,"__esModule",{value:!0});Qg.MaxIntrospectionDepthRule=DJ;var RJ=H(),YA=be(),xJ=3;function DJ(e){function t(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Object.create(null),i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(r.kind===YA.Kind.FRAGMENT_SPREAD){var s=r.name.value;if(n[s]===!0)return!1;var o=e.getFragment(s);if(!o)return!1;try{return n[s]=!0,t(o,n,i)}finally{n[s]=null}}if(r.kind===YA.Kind.FIELD&&(r.name.value==="fields"||r.name.value==="interfaces"||r.name.value==="possibleTypes"||r.name.value==="inputFields")&&(i++,i>=xJ))return!0;if("selectionSet"in r&&r.selectionSet)for(var a=0,c=r.selectionSet.selections;a<c.length;a++){var u=c[a];if(t(u,n,i))return!0}return!1}return{Field:function(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new RJ.GraphQLError("Maximum introspection depth exceeded",[n])),!1}}}});var Jg=v(Yg=>{"use strict";f();Object.defineProperty(Yg,"__esModule",{value:!0});Yg.LoneSchemaDefinitionRule=LJ;var JA=H();function LJ(e){var t,r,n,i=e.getSchema(),s=(t=(r=(n=i?.astNode)!==null&&n!==void 0?n:i?.getQueryType())!==null&&r!==void 0?r:i?.getMutationType())!==null&&t!==void 0?t:i?.getSubscriptionType(),o=0;return{SchemaDefinition:function(c){if(s){e.reportError(new JA.GraphQLError("Cannot define a new schema within a schema extension.",c));return}o>0&&e.reportError(new JA.GraphQLError("Must provide only one schema definition.",c)),++o}}}});var Xg=v(zg=>{"use strict";f();Object.defineProperty(zg,"__esModule",{value:!0});zg.UniqueOperationTypesRule=kJ;var zA=H();function kJ(e){var t=e.getSchema(),r=Object.create(null),n=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(s){for(var o,a=(o=s.operationTypes)!==null&&o!==void 0?o:[],c=0;c<a.length;c++){var u=a[c],l=u.operation,d=r[l];n[l]?e.reportError(new zA.GraphQLError("Type for ".concat(l," already defined in the schema. It cannot be redefined."),u)):d?e.reportError(new zA.GraphQLError("There can be only one ".concat(l," type in schema."),[d,u])):r[l]=u}return!1}}});var ey=v(Zg=>{"use strict";f();Object.defineProperty(Zg,"__esModule",{value:!0});Zg.UniqueTypeNamesRule=jJ;var XA=H();function jJ(e){var t=Object.create(null),r=e.getSchema();return{ScalarTypeDefinition:n,ObjectTypeDefinition:n,InterfaceTypeDefinition:n,UnionTypeDefinition:n,EnumTypeDefinition:n,InputObjectTypeDefinition:n};function n(i){var s=i.name.value;if(r!=null&&r.getType(s)){e.reportError(new XA.GraphQLError('Type "'.concat(s,'" already exists in the schema. It cannot also be defined in this type definition.'),i.name));return}return t[s]?e.reportError(new XA.GraphQLError('There can be only one type named "'.concat(s,'".'),[t[s],i.name])):t[s]=i.name,!1}}});var ry=v(ty=>{"use strict";f();Object.defineProperty(ty,"__esModule",{value:!0});ty.UniqueEnumValueNamesRule=qJ;var ZA=H(),MJ=ae();function qJ(e){var t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(s){var o,a=s.name.value;n[a]||(n[a]=Object.create(null));for(var c=(o=s.values)!==null&&o!==void 0?o:[],u=n[a],l=0;l<c.length;l++){var d=c[l],p=d.name.value,h=r[a];(0,MJ.isEnumType)(h)&&h.getValue(p)?e.reportError(new ZA.GraphQLError('Enum value "'.concat(a,".").concat(p,'" already exists in the schema. It cannot also be defined in this type extension.'),d.name)):u[p]?e.reportError(new ZA.GraphQLError('Enum value "'.concat(a,".").concat(p,'" can only be defined once.'),[u[p],d.name])):u[p]=d.name}return!1}}});var sy=v(iy=>{"use strict";f();Object.defineProperty(iy,"__esModule",{value:!0});iy.UniqueFieldDefinitionNamesRule=FJ;var eN=H(),ny=ae();function FJ(e){var t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(s){var o,a=s.name.value;n[a]||(n[a]=Object.create(null));for(var c=(o=s.fields)!==null&&o!==void 0?o:[],u=n[a],l=0;l<c.length;l++){var d=c[l],p=d.name.value;UJ(r[a],p)?e.reportError(new eN.GraphQLError('Field "'.concat(a,".").concat(p,'" already exists in the schema. It cannot also be defined in this type extension.'),d.name)):u[p]?e.reportError(new eN.GraphQLError('Field "'.concat(a,".").concat(p,'" can only be defined once.'),[u[p],d.name])):u[p]=d.name}return!1}}function UJ(e,t){return(0,ny.isObjectType)(e)||(0,ny.isInterfaceType)(e)||(0,ny.isInputObjectType)(e)?e.getFields()[t]!=null:!1}});var ay=v(oy=>{"use strict";f();Object.defineProperty(oy,"__esModule",{value:!0});oy.UniqueDirectiveNamesRule=VJ;var tN=H();function VJ(e){var t=Object.create(null),r=e.getSchema();return{DirectiveDefinition:function(i){var s=i.name.value;if(r!=null&&r.getDirective(s)){e.reportError(new tN.GraphQLError('Directive "@'.concat(s,'" already exists in the schema. It cannot be redefined.'),i.name));return}return t[s]?e.reportError(new tN.GraphQLError('There can be only one directive named "@'.concat(s,'".'),[t[s],i.name])):t[s]=i.name,!1}}}});var uy=v(cy=>{"use strict";f();Object.defineProperty(cy,"__esModule",{value:!0});cy.PossibleTypeExtensionsRule=KJ;var nN=Al(fe()),iN=Al(st()),GJ=Al(ln()),$J=Al(fn()),rN=H(),Pe=be(),BJ=li(),ps=ae(),En;function Al(e){return e&&e.__esModule?e:{default:e}}function hs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KJ(e){for(var t=e.getSchema(),r=Object.create(null),n=0,i=e.getDocument().definitions;n<i.length;n++){var s=i[n];(0,BJ.isTypeDefinitionNode)(s)&&(r[s.name.value]=s)}return{ScalarTypeExtension:o,ObjectTypeExtension:o,InterfaceTypeExtension:o,UnionTypeExtension:o,EnumTypeExtension:o,InputObjectTypeExtension:o};function o(a){var c=a.name.value,u=r[c],l=t?.getType(c),d;if(u?d=HJ[u.kind]:l&&(d=QJ(l)),d){if(d!==a.kind){var p=WJ(a.kind);e.reportError(new rN.GraphQLError("Cannot extend non-".concat(p,' type "').concat(c,'".'),u?[u,a]:a))}}else{var h=Object.keys(r);t&&(h=h.concat(Object.keys(t.getTypeMap())));var g=(0,$J.default)(c,h);e.reportError(new rN.GraphQLError('Cannot extend type "'.concat(c,'" because it is not defined.')+(0,GJ.default)(g),a.name))}}}var HJ=(En={},hs(En,Pe.Kind.SCALAR_TYPE_DEFINITION,Pe.Kind.SCALAR_TYPE_EXTENSION),hs(En,Pe.Kind.OBJECT_TYPE_DEFINITION,Pe.Kind.OBJECT_TYPE_EXTENSION),hs(En,Pe.Kind.INTERFACE_TYPE_DEFINITION,Pe.Kind.INTERFACE_TYPE_EXTENSION),hs(En,Pe.Kind.UNION_TYPE_DEFINITION,Pe.Kind.UNION_TYPE_EXTENSION),hs(En,Pe.Kind.ENUM_TYPE_DEFINITION,Pe.Kind.ENUM_TYPE_EXTENSION),hs(En,Pe.Kind.INPUT_OBJECT_TYPE_DEFINITION,Pe.Kind.INPUT_OBJECT_TYPE_EXTENSION),En);function QJ(e){if((0,ps.isScalarType)(e))return Pe.Kind.SCALAR_TYPE_EXTENSION;if((0,ps.isObjectType)(e))return Pe.Kind.OBJECT_TYPE_EXTENSION;if((0,ps.isInterfaceType)(e))return Pe.Kind.INTERFACE_TYPE_EXTENSION;if((0,ps.isUnionType)(e))return Pe.Kind.UNION_TYPE_EXTENSION;if((0,ps.isEnumType)(e))return Pe.Kind.ENUM_TYPE_EXTENSION;if((0,ps.isInputObjectType)(e))return Pe.Kind.INPUT_OBJECT_TYPE_EXTENSION;(0,iN.default)(0,"Unexpected type: "+(0,nN.default)(e))}function WJ(e){switch(e){case Pe.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case Pe.Kind.OBJECT_TYPE_EXTENSION:return"object";case Pe.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case Pe.Kind.UNION_TYPE_EXTENSION:return"union";case Pe.Kind.ENUM_TYPE_EXTENSION:return"enum";case Pe.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object"}(0,iN.default)(0,"Unexpected kind: "+(0,nN.default)(e))}});var ly=v(_n=>{"use strict";f();Object.defineProperty(_n,"__esModule",{value:!0});_n.specifiedSDLRules=_n.specifiedRules=_n.recommendedRules=void 0;var YJ=$m(),JJ=Km(),zJ=Qm(),XJ=Ym(),sN=Xm(),ZJ=eg(),ez=rg(),tz=ig(),rz=og(),nz=cg(),iz=lg(),sz=dg(),oz=mg(),az=yg(),cz=Eg(),uz=Sg(),lz=Tg(),oN=Og(),aN=Ng(),cN=Cg(),uN=Rg(),fz=Dg(),lN=kg(),dz=Mg(),pz=Bg(),fN=Hg(),hz=Wg(),mz=Jg(),gz=Xg(),yz=ey(),vz=ry(),Ez=sy(),_z=ay(),Sz=uy(),dN=Object.freeze([hz.MaxIntrospectionDepthRule]);_n.recommendedRules=dN;var bz=Object.freeze([YJ.ExecutableDefinitionsRule,JJ.UniqueOperationNamesRule,zJ.LoneAnonymousOperationRule,XJ.SingleFieldSubscriptionsRule,sN.KnownTypeNamesRule,ZJ.FragmentsOnCompositeTypesRule,ez.VariablesAreInputTypesRule,tz.ScalarLeafsRule,rz.FieldsOnCorrectTypeRule,nz.UniqueFragmentNamesRule,iz.KnownFragmentNamesRule,sz.NoUnusedFragmentsRule,oz.PossibleFragmentSpreadsRule,az.NoFragmentCyclesRule,cz.UniqueVariableNamesRule,uz.NoUndefinedVariablesRule,lz.NoUnusedVariablesRule,oN.KnownDirectivesRule,aN.UniqueDirectivesPerLocationRule,cN.KnownArgumentNamesRule,uN.UniqueArgumentNamesRule,fz.ValuesOfCorrectTypeRule,lN.ProvidedRequiredArgumentsRule,dz.VariablesInAllowedPositionRule,pz.OverlappingFieldsCanBeMergedRule,fN.UniqueInputFieldNamesRule].concat(dN));_n.specifiedRules=bz;var Tz=Object.freeze([mz.LoneSchemaDefinitionRule,gz.UniqueOperationTypesRule,yz.UniqueTypeNamesRule,vz.UniqueEnumValueNamesRule,Ez.UniqueFieldDefinitionNamesRule,_z.UniqueDirectiveNamesRule,sN.KnownTypeNamesRule,oN.KnownDirectivesRule,aN.UniqueDirectivesPerLocationRule,Sz.PossibleTypeExtensionsRule,cN.KnownArgumentNamesOnDirectivesRule,uN.UniqueArgumentNamesRule,fN.UniqueInputFieldNamesRule,lN.ProvidedRequiredArgumentsOnDirectivesRule]);_n.specifiedSDLRules=Tz});var dy=v(Sn=>{"use strict";f();Object.defineProperty(Sn,"__esModule",{value:!0});Sn.ValidationContext=Sn.SDLValidationContext=Sn.ASTValidationContext=void 0;var pN=be(),wz=cn(),hN=yl();function mN(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var fy=(function(){function e(r,n){this._ast=r,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}var t=e.prototype;return t.reportError=function(n){this._onError(n)},t.getDocument=function(){return this._ast},t.getFragment=function(n){var i=this._fragments;return i||(this._fragments=i=this.getDocument().definitions.reduce(function(s,o){return o.kind===pN.Kind.FRAGMENT_DEFINITION&&(s[o.name.value]=o),s},Object.create(null))),i[n]},t.getFragmentSpreads=function(n){var i=this._fragmentSpreads.get(n);if(!i){i=[];for(var s=[n];s.length!==0;)for(var o=s.pop(),a=0,c=o.selections;a<c.length;a++){var u=c[a];u.kind===pN.Kind.FRAGMENT_SPREAD?i.push(u):u.selectionSet&&s.push(u.selectionSet)}this._fragmentSpreads.set(n,i)}return i},t.getRecursivelyReferencedFragments=function(n){var i=this._recursivelyReferencedFragments.get(n);if(!i){i=[];for(var s=Object.create(null),o=[n.selectionSet];o.length!==0;)for(var a=o.pop(),c=0,u=this.getFragmentSpreads(a);c<u.length;c++){var l=u[c],d=l.name.value;if(s[d]!==!0){s[d]=!0;var p=this.getFragment(d);p&&(i.push(p),o.push(p.selectionSet))}}this._recursivelyReferencedFragments.set(n,i)}return i},e})();Sn.ASTValidationContext=fy;var Oz=(function(e){mN(t,e);function t(n,i,s){var o;return o=e.call(this,n,s)||this,o._schema=i,o}var r=t.prototype;return r.getSchema=function(){return this._schema},t})(fy);Sn.SDLValidationContext=Oz;var Iz=(function(e){mN(t,e);function t(n,i,s,o){var a;return a=e.call(this,i,o)||this,a._schema=n,a._typeInfo=s,a._variableUsages=new Map,a._recursiveVariableUsages=new Map,a}var r=t.prototype;return r.getSchema=function(){return this._schema},r.getVariableUsages=function(i){var s=this._variableUsages.get(i);if(!s){var o=[],a=new hN.TypeInfo(this._schema);(0,wz.visit)(i,(0,hN.visitWithTypeInfo)(a,{VariableDefinition:function(){return!1},Variable:function(u){o.push({node:u,type:a.getInputType(),defaultValue:a.getDefaultValue()})}})),s=o,this._variableUsages.set(i,s)}return s},r.getRecursiveVariableUsages=function(i){var s=this._recursiveVariableUsages.get(i);if(!s){s=this.getVariableUsages(i);for(var o=0,a=this.getRecursivelyReferencedFragments(i);o<a.length;o++){var c=a[o];s=s.concat(this.getVariableUsages(c))}this._recursiveVariableUsages.set(i,s)}return s},r.getType=function(){return this._typeInfo.getType()},r.getParentType=function(){return this._typeInfo.getParentType()},r.getInputType=function(){return this._typeInfo.getInputType()},r.getParentInputType=function(){return this._typeInfo.getParentInputType()},r.getFieldDef=function(){return this._typeInfo.getFieldDef()},r.getDirective=function(){return this._typeInfo.getDirective()},r.getArgument=function(){return this._typeInfo.getArgument()},r.getEnumValue=function(){return this._typeInfo.getEnumValue()},t})(fy);Sn.ValidationContext=Iz});var gs=v(ms=>{"use strict";f();Object.defineProperty(ms,"__esModule",{value:!0});ms.validate=Rz;ms.validateSDL=py;ms.assertValidSDL=xz;ms.assertValidSDLExtension=Dz;var Az=Pz(Kt()),Nz=H(),Nl=cn(),Cz=ea(),gN=yl(),yN=ly(),vN=dy();function Pz(e){return e&&e.__esModule?e:{default:e}}function Rz(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:yN.specifiedRules,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new gN.TypeInfo(e),i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{maxErrors:void 0};t||(0,Az.default)(0,"Must provide document."),(0,Cz.assertValidSchema)(e);var s=Object.freeze({}),o=[],a=new vN.ValidationContext(e,t,n,function(u){if(i.maxErrors!=null&&o.length>=i.maxErrors)throw o.push(new Nz.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),s;o.push(u)}),c=(0,Nl.visitInParallel)(r.map(function(u){return u(a)}));try{(0,Nl.visit)(t,(0,gN.visitWithTypeInfo)(n,c))}catch(u){if(u!==s)throw u}return o}function py(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:yN.specifiedSDLRules,n=[],i=new vN.SDLValidationContext(e,t,function(o){n.push(o)}),s=r.map(function(o){return o(i)});return(0,Nl.visit)(e,(0,Nl.visitInParallel)(s)),n}function xz(e){var t=py(e);if(t.length!==0)throw new Error(t.map(function(r){return r.message}).join(`
76
-
77
- `))}function Dz(e,t){var r=py(e,t);if(r.length!==0)throw new Error(r.map(function(n){return n.message}).join(`
78
-
79
- `))}});var EN=v(hy=>{"use strict";f();Object.defineProperty(hy,"__esModule",{value:!0});hy.default=Lz;function Lz(e){var t;return function(n,i,s){t||(t=new WeakMap);var o=t.get(n),a;if(o){if(a=o.get(i),a){var c=a.get(s);if(c!==void 0)return c}}else o=new WeakMap,t.set(n,o);a||(a=new WeakMap,o.set(i,a));var u=e(n,i,s);return a.set(s,u),u}}});var _N=v(my=>{"use strict";f();Object.defineProperty(my,"__esModule",{value:!0});my.default=Mz;var kz=jz(Ou());function jz(e){return e&&e.__esModule?e:{default:e}}function Mz(e,t,r){return e.reduce(function(n,i){return(0,kz.default)(n)?n.then(function(s){return t(s,i)}):t(n,i)},r)}});var SN=v(gy=>{"use strict";f();Object.defineProperty(gy,"__esModule",{value:!0});gy.default=qz;function qz(e){var t=Object.keys(e),r=t.map(function(n){return e[n]});return Promise.all(r).then(function(n){return n.reduce(function(i,s,o){return i[t[o]]=s,i},Object.create(null))})}});var sa=v(Cl=>{"use strict";f();Object.defineProperty(Cl,"__esModule",{value:!0});Cl.addPath=Fz;Cl.pathToArray=Uz;function Fz(e,t,r){return{prev:e,key:t,typename:r}}function Uz(e){for(var t=[],r=e;r;)t.push(r.key),r=r.prev;return t.reverse()}});var Rl=v(yy=>{"use strict";f();Object.defineProperty(yy,"__esModule",{value:!0});yy.getOperationRootType=Vz;var Pl=H();function Vz(e,t){if(t.operation==="query"){var r=e.getQueryType();if(!r)throw new Pl.GraphQLError("Schema does not define the required query root type.",t);return r}if(t.operation==="mutation"){var n=e.getMutationType();if(!n)throw new Pl.GraphQLError("Schema is not configured for mutations.",t);return n}if(t.operation==="subscription"){var i=e.getSubscriptionType();if(!i)throw new Pl.GraphQLError("Schema is not configured for subscriptions.",t);return i}throw new Pl.GraphQLError("Can only have query, mutation and subscription operations.",t)}});var Ey=v(vy=>{"use strict";f();Object.defineProperty(vy,"__esModule",{value:!0});vy.default=Gz;function Gz(e){return e.map(function(t){return typeof t=="number"?"["+t.toString()+"]":"."+t}).join("")}});var aa=v(_y=>{"use strict";f();Object.defineProperty(_y,"__esModule",{value:!0});_y.valueFromAST=oa;var $z=xl(Pt()),Bz=xl(un()),Kz=xl(fe()),Hz=xl(st()),ys=be(),pi=ae();function xl(e){return e&&e.__esModule?e:{default:e}}function oa(e,t,r){if(e){if(e.kind===ys.Kind.VARIABLE){var n=e.name.value;if(r==null||r[n]===void 0)return;var i=r[n];return i===null&&(0,pi.isNonNullType)(t)?void 0:i}if((0,pi.isNonNullType)(t))return e.kind===ys.Kind.NULL?void 0:oa(e,t.ofType,r);if(e.kind===ys.Kind.NULL)return null;if((0,pi.isListType)(t)){var s=t.ofType;if(e.kind===ys.Kind.LIST){for(var o=[],a=0,c=e.values;a<c.length;a++){var u=c[a];if(bN(u,r)){if((0,pi.isNonNullType)(s))return;o.push(null)}else{var l=oa(u,s,r);if(l===void 0)return;o.push(l)}}return o}var d=oa(e,s,r);return d===void 0?void 0:[d]}if((0,pi.isInputObjectType)(t)){if(e.kind!==ys.Kind.OBJECT)return;for(var p=Object.create(null),h=(0,Bz.default)(e.fields,function(I){return I.name.value}),g=0,y=(0,$z.default)(t.getFields());g<y.length;g++){var E=y[g],S=h[E.name];if(!S||bN(S.value,r)){if(E.defaultValue!==void 0)p[E.name]=E.defaultValue;else if((0,pi.isNonNullType)(E.type))return;continue}var _=oa(S.value,E.type,r);if(_===void 0)return;p[E.name]=_}return p}if((0,pi.isLeafType)(t)){var w;try{w=t.parseLiteral(e,r)}catch{return}return w===void 0?void 0:w}(0,Hz.default)(0,"Unexpected input type: "+(0,Kz.default)(t))}}function bN(e,t){return e.kind===ys.Kind.VARIABLE&&(t==null||t[e.name.value]===void 0)}});var by=v(Sy=>{"use strict";f();Object.defineProperty(Sy,"__esModule",{value:!0});Sy.coerceInputValue=r4;var Qz=bn(Pt()),Dl=bn(fe()),Wz=bn(st()),Yz=bn(ln()),Jz=bn(Er()),zz=bn(cl()),Xz=bn(fn()),Zz=bn(Ey()),qr=sa(),hi=H(),ca=ae();function bn(e){return e&&e.__esModule?e:{default:e}}function TN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function e4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?TN(Object(r),!0).forEach(function(n){t4(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TN(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function t4(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r4(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n4;return ua(e,t,r)}function n4(e,t,r){var n="Invalid value "+(0,Dl.default)(t);throw e.length>0&&(n+=' at "value'.concat((0,Zz.default)(e),'"')),r.message=n+": "+r.message,r}function ua(e,t,r,n){if((0,ca.isNonNullType)(t)){if(e!=null)return ua(e,t.ofType,r,n);r((0,qr.pathToArray)(n),e,new hi.GraphQLError('Expected non-nullable type "'.concat((0,Dl.default)(t),'" not to be null.')));return}if(e==null)return null;if((0,ca.isListType)(t)){var i=t.ofType,s=(0,zz.default)(e,function(_,w){var I=(0,qr.addPath)(n,w,void 0);return ua(_,i,r,I)});return s??[ua(e,i,r,n)]}if((0,ca.isInputObjectType)(t)){if(!(0,Jz.default)(e)){r((0,qr.pathToArray)(n),e,new hi.GraphQLError('Expected type "'.concat(t.name,'" to be an object.')));return}for(var o=Object.create(null),a=t.getFields(),c=0,u=(0,Qz.default)(a);c<u.length;c++){var l=u[c],d=e[l.name];if(d===void 0){if(l.defaultValue!==void 0)o[l.name]=l.defaultValue;else if((0,ca.isNonNullType)(l.type)){var p=(0,Dl.default)(l.type);r((0,qr.pathToArray)(n),e,new hi.GraphQLError('Field "'.concat(l.name,'" of required type "').concat(p,'" was not provided.')))}continue}o[l.name]=ua(d,l.type,r,(0,qr.addPath)(n,l.name,t.name))}for(var h=0,g=Object.keys(e);h<g.length;h++){var y=g[h];if(!a[y]){var E=(0,Xz.default)(y,Object.keys(t.getFields()));r((0,qr.pathToArray)(n),e,new hi.GraphQLError('Field "'.concat(y,'" is not defined by type "').concat(t.name,'".')+(0,Yz.default)(E)))}}return e4({},o)}if((0,ca.isLeafType)(t)){var S;try{S=t.parseValue(e)}catch(_){_ instanceof hi.GraphQLError?r((0,qr.pathToArray)(n),e,_):r((0,qr.pathToArray)(n),e,new hi.GraphQLError('Expected type "'.concat(t.name,'". ')+_.message,void 0,void 0,void 0,void 0,_));return}return S===void 0&&r((0,qr.pathToArray)(n),e,new hi.GraphQLError('Expected type "'.concat(t.name,'".'))),S}(0,Wz.default)(0,"Unexpected input type: "+(0,Dl.default)(t))}});var fa=v(la=>{"use strict";f();Object.defineProperty(la,"__esModule",{value:!0});la.getVariableValues=l4;la.getArgumentValues=CN;la.getDirectiveValues=d4;var i4=Ll(ns()),s4=Ll(un()),vs=Ll(fe()),o4=Ll(Ey()),Fr=H(),wN=be(),IN=bt(),Es=ae(),a4=wr(),AN=aa(),c4=by();function Ll(e){return e&&e.__esModule?e:{default:e}}function ON(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function NN(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ON(Object(r),!0).forEach(function(n){u4(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ON(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function u4(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l4(e,t,r,n){var i=[],s=n?.maxErrors;try{var o=f4(e,t,r,function(a){if(s!=null&&i.length>=s)throw new Fr.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:o}}catch(a){i.push(a)}return{errors:i}}function f4(e,t,r,n){for(var i=Object.create(null),s=function(u){var l=t[u],d=l.variable.name.value,p=(0,a4.typeFromAST)(e,l.type);if(!(0,Es.isInputType)(p)){var h=(0,IN.print)(l.type);return n(new Fr.GraphQLError('Variable "$'.concat(d,'" expected value of type "').concat(h,'" which cannot be used as an input type.'),l.type)),"continue"}if(!PN(r,d)){if(l.defaultValue)i[d]=(0,AN.valueFromAST)(l.defaultValue,p);else if((0,Es.isNonNullType)(p)){var g=(0,vs.default)(p);n(new Fr.GraphQLError('Variable "$'.concat(d,'" of required type "').concat(g,'" was not provided.'),l))}return"continue"}var y=r[d];if(y===null&&(0,Es.isNonNullType)(p)){var E=(0,vs.default)(p);return n(new Fr.GraphQLError('Variable "$'.concat(d,'" of non-null type "').concat(E,'" must not be null.'),l)),"continue"}i[d]=(0,c4.coerceInputValue)(y,p,function(S,_,w){var I='Variable "$'.concat(d,'" got invalid value ')+(0,vs.default)(_);S.length>0&&(I+=' at "'.concat(d).concat((0,o4.default)(S),'"')),n(new Fr.GraphQLError(I+"; "+w.message,l,void 0,void 0,void 0,w.originalError))})},o=0;o<t.length;o++)var a=s(o);return NN({},i)}function CN(e,t,r){for(var n,i=Object.create(null),s=(n=t.arguments)!==null&&n!==void 0?n:[],o=(0,s4.default)(s,function(S){return S.name.value}),a=0,c=e.args;a<c.length;a++){var u=c[a],l=u.name,d=u.type,p=o[l];if(!p){if(u.defaultValue!==void 0)i[l]=u.defaultValue;else if((0,Es.isNonNullType)(d))throw new Fr.GraphQLError('Argument "'.concat(l,'" of required type "').concat((0,vs.default)(d),'" ')+"was not provided.",t);continue}var h=p.value,g=h.kind===wN.Kind.NULL;if(h.kind===wN.Kind.VARIABLE){var y=h.name.value;if(r==null||!PN(r,y)){if(u.defaultValue!==void 0)i[l]=u.defaultValue;else if((0,Es.isNonNullType)(d))throw new Fr.GraphQLError('Argument "'.concat(l,'" of required type "').concat((0,vs.default)(d),'" ')+'was provided the variable "$'.concat(y,'" which was not provided a runtime value.'),h);continue}g=r[y]==null}if(g&&(0,Es.isNonNullType)(d))throw new Fr.GraphQLError('Argument "'.concat(l,'" of non-null type "').concat((0,vs.default)(d),'" ')+"must not be null.",h);var E=(0,AN.valueFromAST)(h,d,r);if(E===void 0)throw new Fr.GraphQLError('Argument "'.concat(l,'" has invalid value ').concat((0,IN.print)(h),"."),h);i[l]=E}return NN({},i)}function d4(e,t,r){var n=t.directives&&(0,i4.default)(t.directives,function(i){return i.name.value===e.name});if(n)return CN(e,n,r)}function PN(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var ma=v(xt=>{"use strict";f();Object.defineProperty(xt,"__esModule",{value:!0});xt.execute=_4;xt.executeSync=S4;xt.assertValidExecutionArguments=FN;xt.buildExecutionContext=UN;xt.collectFields=pa;xt.buildResolveInfo=$N;xt.getFieldDef=HN;xt.defaultFieldResolver=xt.defaultTypeResolver=void 0;var Ss=Vr(fe()),p4=Vr(EN()),h4=Vr(st()),RN=Vr(Kt()),Yt=Vr(Ou()),Iy=Vr(Er()),m4=Vr(cl()),g4=Vr(_N()),xN=Vr(SN()),mi=sa(),Ir=H(),kl=Mo(),da=be(),y4=ea(),_s=Wt(),DN=Tt(),Ur=ae(),v4=wr(),E4=Rl(),jl=fa();function Vr(e){return e&&e.__esModule?e:{default:e}}function _4(e,t,r,n,i,s,o,a){return arguments.length===1?wy(e):wy({schema:e,document:t,rootValue:r,contextValue:n,variableValues:i,operationName:s,fieldResolver:o,typeResolver:a})}function S4(e){var t=wy(e);if((0,Yt.default)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function wy(e){var t=e.schema,r=e.document,n=e.rootValue,i=e.contextValue,s=e.variableValues,o=e.operationName,a=e.fieldResolver,c=e.typeResolver;FN(t,r,s);var u=UN(t,r,n,i,s,o,a,c);if(Array.isArray(u))return{errors:u};var l=b4(u,u.operation,n);return qN(u,l)}function qN(e,t){return(0,Yt.default)(t)?t.then(function(r){return qN(e,r)}):e.errors.length===0?{data:t}:{errors:e.errors,data:t}}function FN(e,t,r){t||(0,RN.default)(0,"Must provide document."),(0,y4.assertValidSchema)(e),r==null||(0,Iy.default)(r)||(0,RN.default)(0,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function UN(e,t,r,n,i,s,o,a){for(var c,u,l,d=Object.create(null),p=0,h=t.definitions;p<h.length;p++){var g=h[p];switch(g.kind){case da.Kind.OPERATION_DEFINITION:if(s==null){if(l!==void 0)return[new Ir.GraphQLError("Must provide operation name if query contains multiple operations.")];l=g}else((c=g.name)===null||c===void 0?void 0:c.value)===s&&(l=g);break;case da.Kind.FRAGMENT_DEFINITION:d[g.name.value]=g;break}}if(!l)return s!=null?[new Ir.GraphQLError('Unknown operation named "'.concat(s,'".'))]:[new Ir.GraphQLError("Must provide an operation.")];var y=(u=l.variableDefinitions)!==null&&u!==void 0?u:[],E=(0,jl.getVariableValues)(e,y,i??{},{maxErrors:50});return E.errors?E.errors:{schema:e,fragments:d,rootValue:r,contextValue:n,operation:l,variableValues:E.coerced,fieldResolver:o??KN,typeResolver:a??BN,errors:[]}}function b4(e,t,r){var n=(0,E4.getOperationRootType)(e.schema,t),i=pa(e,n,t.selectionSet,Object.create(null),Object.create(null)),s=void 0;try{var o=t.operation==="mutation"?T4(e,n,r,s,i):VN(e,n,r,s,i);return(0,Yt.default)(o)?o.then(void 0,function(a){return e.errors.push(a),Promise.resolve(null)}):o}catch(a){return e.errors.push(a),null}}function T4(e,t,r,n,i){return(0,g4.default)(Object.keys(i),function(s,o){var a=i[o],c=(0,mi.addPath)(n,o,t.name),u=GN(e,t,r,a,c);return u===void 0?s:(0,Yt.default)(u)?u.then(function(l){return s[o]=l,s}):(s[o]=u,s)},Object.create(null))}function VN(e,t,r,n,i){var s=Object.create(null),o=!1;try{for(var a=0,c=Object.keys(i);a<c.length;a++){var u=c[a],l=i[u],d=(0,mi.addPath)(n,u,t.name),p=GN(e,t,r,l,d);p!==void 0&&(s[u]=p,(0,Yt.default)(p)&&(o=!0))}}catch(h){if(o)return(0,xN.default)(s).finally(function(){throw h});throw h}return o?(0,xN.default)(s):s}function pa(e,t,r,n,i){for(var s=0,o=r.selections;s<o.length;s++){var a=o[s];switch(a.kind){case da.Kind.FIELD:{if(!Ty(e,a))continue;var c=w4(a);n[c]||(n[c]=[]),n[c].push(a);break}case da.Kind.INLINE_FRAGMENT:{if(!Ty(e,a)||!LN(e,a,t))continue;pa(e,t,a.selectionSet,n,i);break}case da.Kind.FRAGMENT_SPREAD:{var u=a.name.value;if(i[u]||!Ty(e,a))continue;i[u]=!0;var l=e.fragments[u];if(!l||!LN(e,l,t))continue;pa(e,t,l.selectionSet,n,i);break}}}return n}function Ty(e,t){var r=(0,jl.getDirectiveValues)(DN.GraphQLSkipDirective,t,e.variableValues);if(r?.if===!0)return!1;var n=(0,jl.getDirectiveValues)(DN.GraphQLIncludeDirective,t,e.variableValues);return n?.if!==!1}function LN(e,t,r){var n=t.typeCondition;if(!n)return!0;var i=(0,v4.typeFromAST)(e.schema,n);return i===r?!0:(0,Ur.isAbstractType)(i)?e.schema.isSubType(i,r):!1}function w4(e){return e.alias?e.alias.value:e.name.value}function GN(e,t,r,n,i){var s,o=n[0],a=o.name.value,c=HN(e.schema,t,a);if(c){var u=c.type,l=(s=c.resolve)!==null&&s!==void 0?s:e.fieldResolver,d=$N(e,c,n,t,i);try{var p=(0,jl.getArgumentValues)(c,n[0],e.variableValues),h=e.contextValue,g=l(r,p,h,d),y;return(0,Yt.default)(g)?y=g.then(function(S){return ha(e,u,n,d,i,S)}):y=ha(e,u,n,d,i,g),(0,Yt.default)(y)?y.then(void 0,function(S){var _=(0,kl.locatedError)(S,n,(0,mi.pathToArray)(i));return Ml(_,u,e)}):y}catch(S){var E=(0,kl.locatedError)(S,n,(0,mi.pathToArray)(i));return Ml(E,u,e)}}}function $N(e,t,r,n,i){return{fieldName:t.name,fieldNodes:r,returnType:t.type,parentType:n,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function Ml(e,t,r){if((0,Ur.isNonNullType)(t))throw e;return r.errors.push(e),null}function ha(e,t,r,n,i,s){if(s instanceof Error)throw s;if((0,Ur.isNonNullType)(t)){var o=ha(e,t.ofType,r,n,i,s);if(o===null)throw new Error("Cannot return null for non-nullable field ".concat(n.parentType.name,".").concat(n.fieldName,"."));return o}if(s==null)return null;if((0,Ur.isListType)(t))return O4(e,t,r,n,i,s);if((0,Ur.isLeafType)(t))return I4(t,s);if((0,Ur.isAbstractType)(t))return A4(e,t,r,n,i,s);if((0,Ur.isObjectType)(t))return Oy(e,t,r,n,i,s);(0,h4.default)(0,"Cannot complete value of unexpected output type: "+(0,Ss.default)(t))}function O4(e,t,r,n,i,s){var o=t.ofType,a=!1,c=(0,m4.default)(s,function(u,l){var d=(0,mi.addPath)(i,l,void 0);try{var p;return(0,Yt.default)(u)?p=u.then(function(g){return ha(e,o,r,n,d,g)}):p=ha(e,o,r,n,d,u),(0,Yt.default)(p)?(a=!0,p.then(void 0,function(g){var y=(0,kl.locatedError)(g,r,(0,mi.pathToArray)(d));return Ml(y,o,e)})):p}catch(g){var h=(0,kl.locatedError)(g,r,(0,mi.pathToArray)(d));return Ml(h,o,e)}});if(c==null)throw new Ir.GraphQLError('Expected Iterable, but did not find one for field "'.concat(n.parentType.name,".").concat(n.fieldName,'".'));return a?Promise.all(c):c}function I4(e,t){var r=e.serialize(t);if(r===void 0)throw new Error('Expected a value of type "'.concat((0,Ss.default)(e),'" but ')+"received: ".concat((0,Ss.default)(t)));return r}function A4(e,t,r,n,i,s){var o,a=(o=t.resolveType)!==null&&o!==void 0?o:e.typeResolver,c=e.contextValue,u=a(s,c,n,t);return(0,Yt.default)(u)?u.then(function(l){return Oy(e,kN(l,e,t,r,n,s),r,n,i,s)}):Oy(e,kN(u,e,t,r,n,s),r,n,i,s)}function kN(e,t,r,n,i,s){if(e==null)throw new Ir.GraphQLError('Abstract type "'.concat(r.name,'" must resolve to an Object type at runtime for field "').concat(i.parentType.name,".").concat(i.fieldName,'". Either the "').concat(r.name,'" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.'),n);var o=(0,Ur.isNamedType)(e)?e.name:e;if(typeof o!="string")throw new Ir.GraphQLError('Abstract type "'.concat(r.name,'" must resolve to an Object type at runtime for field "').concat(i.parentType.name,".").concat(i.fieldName,'" with ')+"value ".concat((0,Ss.default)(s),', received "').concat((0,Ss.default)(e),'".'));var a=t.schema.getType(o);if(a==null)throw new Ir.GraphQLError('Abstract type "'.concat(r.name,'" was resolve to a type "').concat(o,'" that does not exist inside schema.'),n);if(!(0,Ur.isObjectType)(a))throw new Ir.GraphQLError('Abstract type "'.concat(r.name,'" was resolve to a non-object type "').concat(o,'".'),n);if(!t.schema.isSubType(r,a))throw new Ir.GraphQLError('Runtime Object type "'.concat(a.name,'" is not a possible type for "').concat(r.name,'".'),n);return a}function Oy(e,t,r,n,i,s){if(t.isTypeOf){var o=t.isTypeOf(s,e.contextValue,n);if((0,Yt.default)(o))return o.then(function(a){if(!a)throw jN(t,s,r);return MN(e,t,r,i,s)});if(!o)throw jN(t,s,r)}return MN(e,t,r,i,s)}function jN(e,t,r){return new Ir.GraphQLError('Expected value of type "'.concat(e.name,'" but got: ').concat((0,Ss.default)(t),"."),r)}function MN(e,t,r,n,i){var s=N4(e,t,r);return VN(e,t,i,n,s)}var N4=(0,p4.default)(C4);function C4(e,t,r){for(var n=Object.create(null),i=Object.create(null),s=0;s<r.length;s++){var o=r[s];o.selectionSet&&(n=pa(e,t,o.selectionSet,n,i))}return n}var BN=function(t,r,n,i){if((0,Iy.default)(t)&&typeof t.__typename=="string")return t.__typename;for(var s=n.schema.getPossibleTypes(i),o=[],a=0;a<s.length;a++){var c=s[a];if(c.isTypeOf){var u=c.isTypeOf(t,r,n);if((0,Yt.default)(u))o[a]=u;else if(u)return c.name}}if(o.length)return Promise.all(o).then(function(l){for(var d=0;d<l.length;d++)if(l[d])return s[d].name})};xt.defaultTypeResolver=BN;var KN=function(t,r,n,i){if((0,Iy.default)(t)||typeof t=="function"){var s=t[i.fieldName];return typeof s=="function"?t[i.fieldName](r,n,i):s}};xt.defaultFieldResolver=KN;function HN(e,t,r){return r===_s.SchemaMetaFieldDef.name&&e.getQueryType()===t?_s.SchemaMetaFieldDef:r===_s.TypeMetaFieldDef.name&&e.getQueryType()===t?_s.TypeMetaFieldDef:r===_s.TypeNameMetaFieldDef.name?_s.TypeNameMetaFieldDef:t.getFields()[r]}});var QN=v(Fl=>{"use strict";f();Object.defineProperty(Fl,"__esModule",{value:!0});Fl.graphql=j4;Fl.graphqlSync=M4;var P4=k4(Ou()),R4=ts(),x4=gs(),D4=ea(),L4=ma();function k4(e){return e&&e.__esModule?e:{default:e}}function j4(e,t,r,n,i,s,o,a){var c=arguments;return new Promise(function(u){return u(c.length===1?ql(e):ql({schema:e,source:t,rootValue:r,contextValue:n,variableValues:i,operationName:s,fieldResolver:o,typeResolver:a}))})}function M4(e,t,r,n,i,s,o,a){var c=arguments.length===1?ql(e):ql({schema:e,source:t,rootValue:r,contextValue:n,variableValues:i,operationName:s,fieldResolver:o,typeResolver:a});if((0,P4.default)(c))throw new Error("GraphQL execution failed to complete synchronously.");return c}function ql(e){var t=e.schema,r=e.source,n=e.rootValue,i=e.contextValue,s=e.variableValues,o=e.operationName,a=e.fieldResolver,c=e.typeResolver,u=(0,D4.validateSchema)(t);if(u.length>0)return{errors:u};var l;try{l=(0,R4.parse)(r)}catch(p){return{errors:[p]}}var d=(0,x4.validate)(t,l);return d.length>0?{errors:d}:(0,L4.execute)({schema:t,document:l,rootValue:n,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:c})}});var YN=v(R=>{"use strict";f();Object.defineProperty(R,"__esModule",{value:!0});Object.defineProperty(R,"isSchema",{enumerable:!0,get:function(){return Ay.isSchema}});Object.defineProperty(R,"assertSchema",{enumerable:!0,get:function(){return Ay.assertSchema}});Object.defineProperty(R,"GraphQLSchema",{enumerable:!0,get:function(){return Ay.GraphQLSchema}});Object.defineProperty(R,"isType",{enumerable:!0,get:function(){return Y.isType}});Object.defineProperty(R,"isScalarType",{enumerable:!0,get:function(){return Y.isScalarType}});Object.defineProperty(R,"isObjectType",{enumerable:!0,get:function(){return Y.isObjectType}});Object.defineProperty(R,"isInterfaceType",{enumerable:!0,get:function(){return Y.isInterfaceType}});Object.defineProperty(R,"isUnionType",{enumerable:!0,get:function(){return Y.isUnionType}});Object.defineProperty(R,"isEnumType",{enumerable:!0,get:function(){return Y.isEnumType}});Object.defineProperty(R,"isInputObjectType",{enumerable:!0,get:function(){return Y.isInputObjectType}});Object.defineProperty(R,"isListType",{enumerable:!0,get:function(){return Y.isListType}});Object.defineProperty(R,"isNonNullType",{enumerable:!0,get:function(){return Y.isNonNullType}});Object.defineProperty(R,"isInputType",{enumerable:!0,get:function(){return Y.isInputType}});Object.defineProperty(R,"isOutputType",{enumerable:!0,get:function(){return Y.isOutputType}});Object.defineProperty(R,"isLeafType",{enumerable:!0,get:function(){return Y.isLeafType}});Object.defineProperty(R,"isCompositeType",{enumerable:!0,get:function(){return Y.isCompositeType}});Object.defineProperty(R,"isAbstractType",{enumerable:!0,get:function(){return Y.isAbstractType}});Object.defineProperty(R,"isWrappingType",{enumerable:!0,get:function(){return Y.isWrappingType}});Object.defineProperty(R,"isNullableType",{enumerable:!0,get:function(){return Y.isNullableType}});Object.defineProperty(R,"isNamedType",{enumerable:!0,get:function(){return Y.isNamedType}});Object.defineProperty(R,"isRequiredArgument",{enumerable:!0,get:function(){return Y.isRequiredArgument}});Object.defineProperty(R,"isRequiredInputField",{enumerable:!0,get:function(){return Y.isRequiredInputField}});Object.defineProperty(R,"assertType",{enumerable:!0,get:function(){return Y.assertType}});Object.defineProperty(R,"assertScalarType",{enumerable:!0,get:function(){return Y.assertScalarType}});Object.defineProperty(R,"assertObjectType",{enumerable:!0,get:function(){return Y.assertObjectType}});Object.defineProperty(R,"assertInterfaceType",{enumerable:!0,get:function(){return Y.assertInterfaceType}});Object.defineProperty(R,"assertUnionType",{enumerable:!0,get:function(){return Y.assertUnionType}});Object.defineProperty(R,"assertEnumType",{enumerable:!0,get:function(){return Y.assertEnumType}});Object.defineProperty(R,"assertInputObjectType",{enumerable:!0,get:function(){return Y.assertInputObjectType}});Object.defineProperty(R,"assertListType",{enumerable:!0,get:function(){return Y.assertListType}});Object.defineProperty(R,"assertNonNullType",{enumerable:!0,get:function(){return Y.assertNonNullType}});Object.defineProperty(R,"assertInputType",{enumerable:!0,get:function(){return Y.assertInputType}});Object.defineProperty(R,"assertOutputType",{enumerable:!0,get:function(){return Y.assertOutputType}});Object.defineProperty(R,"assertLeafType",{enumerable:!0,get:function(){return Y.assertLeafType}});Object.defineProperty(R,"assertCompositeType",{enumerable:!0,get:function(){return Y.assertCompositeType}});Object.defineProperty(R,"assertAbstractType",{enumerable:!0,get:function(){return Y.assertAbstractType}});Object.defineProperty(R,"assertWrappingType",{enumerable:!0,get:function(){return Y.assertWrappingType}});Object.defineProperty(R,"assertNullableType",{enumerable:!0,get:function(){return Y.assertNullableType}});Object.defineProperty(R,"assertNamedType",{enumerable:!0,get:function(){return Y.assertNamedType}});Object.defineProperty(R,"getNullableType",{enumerable:!0,get:function(){return Y.getNullableType}});Object.defineProperty(R,"getNamedType",{enumerable:!0,get:function(){return Y.getNamedType}});Object.defineProperty(R,"GraphQLScalarType",{enumerable:!0,get:function(){return Y.GraphQLScalarType}});Object.defineProperty(R,"GraphQLObjectType",{enumerable:!0,get:function(){return Y.GraphQLObjectType}});Object.defineProperty(R,"GraphQLInterfaceType",{enumerable:!0,get:function(){return Y.GraphQLInterfaceType}});Object.defineProperty(R,"GraphQLUnionType",{enumerable:!0,get:function(){return Y.GraphQLUnionType}});Object.defineProperty(R,"GraphQLEnumType",{enumerable:!0,get:function(){return Y.GraphQLEnumType}});Object.defineProperty(R,"GraphQLInputObjectType",{enumerable:!0,get:function(){return Y.GraphQLInputObjectType}});Object.defineProperty(R,"GraphQLList",{enumerable:!0,get:function(){return Y.GraphQLList}});Object.defineProperty(R,"GraphQLNonNull",{enumerable:!0,get:function(){return Y.GraphQLNonNull}});Object.defineProperty(R,"isDirective",{enumerable:!0,get:function(){return Ar.isDirective}});Object.defineProperty(R,"assertDirective",{enumerable:!0,get:function(){return Ar.assertDirective}});Object.defineProperty(R,"GraphQLDirective",{enumerable:!0,get:function(){return Ar.GraphQLDirective}});Object.defineProperty(R,"isSpecifiedDirective",{enumerable:!0,get:function(){return Ar.isSpecifiedDirective}});Object.defineProperty(R,"specifiedDirectives",{enumerable:!0,get:function(){return Ar.specifiedDirectives}});Object.defineProperty(R,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return Ar.GraphQLIncludeDirective}});Object.defineProperty(R,"GraphQLSkipDirective",{enumerable:!0,get:function(){return Ar.GraphQLSkipDirective}});Object.defineProperty(R,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return Ar.GraphQLDeprecatedDirective}});Object.defineProperty(R,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return Ar.GraphQLSpecifiedByDirective}});Object.defineProperty(R,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return Ar.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(R,"isSpecifiedScalarType",{enumerable:!0,get:function(){return gi.isSpecifiedScalarType}});Object.defineProperty(R,"specifiedScalarTypes",{enumerable:!0,get:function(){return gi.specifiedScalarTypes}});Object.defineProperty(R,"GraphQLInt",{enumerable:!0,get:function(){return gi.GraphQLInt}});Object.defineProperty(R,"GraphQLFloat",{enumerable:!0,get:function(){return gi.GraphQLFloat}});Object.defineProperty(R,"GraphQLString",{enumerable:!0,get:function(){return gi.GraphQLString}});Object.defineProperty(R,"GraphQLBoolean",{enumerable:!0,get:function(){return gi.GraphQLBoolean}});Object.defineProperty(R,"GraphQLID",{enumerable:!0,get:function(){return gi.GraphQLID}});Object.defineProperty(R,"isIntrospectionType",{enumerable:!0,get:function(){return Ot.isIntrospectionType}});Object.defineProperty(R,"introspectionTypes",{enumerable:!0,get:function(){return Ot.introspectionTypes}});Object.defineProperty(R,"__Schema",{enumerable:!0,get:function(){return Ot.__Schema}});Object.defineProperty(R,"__Directive",{enumerable:!0,get:function(){return Ot.__Directive}});Object.defineProperty(R,"__DirectiveLocation",{enumerable:!0,get:function(){return Ot.__DirectiveLocation}});Object.defineProperty(R,"__Type",{enumerable:!0,get:function(){return Ot.__Type}});Object.defineProperty(R,"__Field",{enumerable:!0,get:function(){return Ot.__Field}});Object.defineProperty(R,"__InputValue",{enumerable:!0,get:function(){return Ot.__InputValue}});Object.defineProperty(R,"__EnumValue",{enumerable:!0,get:function(){return Ot.__EnumValue}});Object.defineProperty(R,"__TypeKind",{enumerable:!0,get:function(){return Ot.__TypeKind}});Object.defineProperty(R,"TypeKind",{enumerable:!0,get:function(){return Ot.TypeKind}});Object.defineProperty(R,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return Ot.SchemaMetaFieldDef}});Object.defineProperty(R,"TypeMetaFieldDef",{enumerable:!0,get:function(){return Ot.TypeMetaFieldDef}});Object.defineProperty(R,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return Ot.TypeNameMetaFieldDef}});Object.defineProperty(R,"validateSchema",{enumerable:!0,get:function(){return WN.validateSchema}});Object.defineProperty(R,"assertValidSchema",{enumerable:!0,get:function(){return WN.assertValidSchema}});var Ay=ci(),Y=ae(),Ar=Tt(),gi=Tr(),Ot=Wt(),WN=ea()});var XN=v(Se=>{"use strict";f();Object.defineProperty(Se,"__esModule",{value:!0});Object.defineProperty(Se,"Source",{enumerable:!0,get:function(){return q4.Source}});Object.defineProperty(Se,"getLocation",{enumerable:!0,get:function(){return F4.getLocation}});Object.defineProperty(Se,"printLocation",{enumerable:!0,get:function(){return JN.printLocation}});Object.defineProperty(Se,"printSourceLocation",{enumerable:!0,get:function(){return JN.printSourceLocation}});Object.defineProperty(Se,"Kind",{enumerable:!0,get:function(){return U4.Kind}});Object.defineProperty(Se,"TokenKind",{enumerable:!0,get:function(){return V4.TokenKind}});Object.defineProperty(Se,"Lexer",{enumerable:!0,get:function(){return G4.Lexer}});Object.defineProperty(Se,"parse",{enumerable:!0,get:function(){return Ny.parse}});Object.defineProperty(Se,"parseValue",{enumerable:!0,get:function(){return Ny.parseValue}});Object.defineProperty(Se,"parseType",{enumerable:!0,get:function(){return Ny.parseType}});Object.defineProperty(Se,"print",{enumerable:!0,get:function(){return $4.print}});Object.defineProperty(Se,"visit",{enumerable:!0,get:function(){return Ul.visit}});Object.defineProperty(Se,"visitInParallel",{enumerable:!0,get:function(){return Ul.visitInParallel}});Object.defineProperty(Se,"getVisitFn",{enumerable:!0,get:function(){return Ul.getVisitFn}});Object.defineProperty(Se,"BREAK",{enumerable:!0,get:function(){return Ul.BREAK}});Object.defineProperty(Se,"Location",{enumerable:!0,get:function(){return zN.Location}});Object.defineProperty(Se,"Token",{enumerable:!0,get:function(){return zN.Token}});Object.defineProperty(Se,"isDefinitionNode",{enumerable:!0,get:function(){return Gr.isDefinitionNode}});Object.defineProperty(Se,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return Gr.isExecutableDefinitionNode}});Object.defineProperty(Se,"isSelectionNode",{enumerable:!0,get:function(){return Gr.isSelectionNode}});Object.defineProperty(Se,"isValueNode",{enumerable:!0,get:function(){return Gr.isValueNode}});Object.defineProperty(Se,"isTypeNode",{enumerable:!0,get:function(){return Gr.isTypeNode}});Object.defineProperty(Se,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return Gr.isTypeSystemDefinitionNode}});Object.defineProperty(Se,"isTypeDefinitionNode",{enumerable:!0,get:function(){return Gr.isTypeDefinitionNode}});Object.defineProperty(Se,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return Gr.isTypeSystemExtensionNode}});Object.defineProperty(Se,"isTypeExtensionNode",{enumerable:!0,get:function(){return Gr.isTypeExtensionNode}});Object.defineProperty(Se,"DirectiveLocation",{enumerable:!0,get:function(){return B4.DirectiveLocation}});var q4=Vu(),F4=Au(),JN=Dh(),U4=be(),V4=Xi(),G4=Bu(),Ny=ts(),$4=bt(),Ul=cn(),zN=zi(),Gr=li(),B4=Zi()});var ZN=v(Tn=>{"use strict";f();Object.defineProperty(Tn,"__esModule",{value:!0});Object.defineProperty(Tn,"responsePathAsArray",{enumerable:!0,get:function(){return K4.pathToArray}});Object.defineProperty(Tn,"execute",{enumerable:!0,get:function(){return Vl.execute}});Object.defineProperty(Tn,"executeSync",{enumerable:!0,get:function(){return Vl.executeSync}});Object.defineProperty(Tn,"defaultFieldResolver",{enumerable:!0,get:function(){return Vl.defaultFieldResolver}});Object.defineProperty(Tn,"defaultTypeResolver",{enumerable:!0,get:function(){return Vl.defaultTypeResolver}});Object.defineProperty(Tn,"getDirectiveValues",{enumerable:!0,get:function(){return H4.getDirectiveValues}});var K4=sa(),Vl=ma(),H4=fa()});var eC=v(Cy=>{"use strict";f();Object.defineProperty(Cy,"__esModule",{value:!0});Cy.default=W4;var Q4=_r();function W4(e){return typeof e?.[Q4.SYMBOL_ASYNC_ITERATOR]=="function"}});var iC=v(Py=>{"use strict";f();Object.defineProperty(Py,"__esModule",{value:!0});Py.default=J4;var tC=_r();function Y4(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function J4(e,t,r){var n=e[tC.SYMBOL_ASYNC_ITERATOR],i=n.call(e),s,o;typeof i.return=="function"&&(s=i.return,o=function(d){var p=function(){return Promise.reject(d)};return s.call(i).then(p,p)});function a(l){return l.done?l:rC(l.value,t).then(nC,o)}var c;if(r){var u=r;c=function(d){return rC(d,u).then(nC,o)}}return Y4({next:function(){return i.next().then(a,c)},return:function(){return s?s.call(i).then(a,c):Promise.resolve({value:void 0,done:!0})},throw:function(d){return typeof i.throw=="function"?i.throw(d).then(a,c):Promise.reject(d).catch(o)}},tC.SYMBOL_ASYNC_ITERATOR,function(){return this})}function rC(e,t){return new Promise(function(r){return r(t(e))})}function nC(e){return{value:e,done:!1}}});var fC=v(Gl=>{"use strict";f();Object.defineProperty(Gl,"__esModule",{value:!0});Gl.subscribe=t8;Gl.createSourceEventStream=lC;var z4=xy(fe()),aC=xy(eC()),Ry=sa(),cC=H(),sC=Mo(),X4=fa(),bs=ma(),Z4=Rl(),e8=xy(iC());function xy(e){return e&&e.__esModule?e:{default:e}}function t8(e,t,r,n,i,s,o,a){return arguments.length===1?oC(e):oC({schema:e,document:t,rootValue:r,contextValue:n,variableValues:i,operationName:s,fieldResolver:o,subscribeFieldResolver:a})}function uC(e){if(e instanceof cC.GraphQLError)return{errors:[e]};throw e}function oC(e){var t=e.schema,r=e.document,n=e.rootValue,i=e.contextValue,s=e.variableValues,o=e.operationName,a=e.fieldResolver,c=e.subscribeFieldResolver,u=lC(t,r,n,i,s,o,c),l=function(p){return(0,bs.execute)({schema:t,document:r,rootValue:p,contextValue:i,variableValues:s,operationName:o,fieldResolver:a})};return u.then(function(d){return(0,aC.default)(d)?(0,e8.default)(d,l,uC):d})}function lC(e,t,r,n,i,s,o){return(0,bs.assertValidExecutionArguments)(e,t,i),new Promise(function(a){var c=(0,bs.buildExecutionContext)(e,t,r,n,i,s,o);a(Array.isArray(c)?{errors:c}:r8(c))}).catch(uC)}function r8(e){var t=e.schema,r=e.operation,n=e.variableValues,i=e.rootValue,s=(0,Z4.getOperationRootType)(t,r),o=(0,bs.collectFields)(e,s,r.selectionSet,Object.create(null),Object.create(null)),a=Object.keys(o),c=a[0],u=o[c],l=u[0],d=l.name.value,p=(0,bs.getFieldDef)(t,s,d);if(!p)throw new cC.GraphQLError('The subscription field "'.concat(d,'" is not defined.'),u);var h=(0,Ry.addPath)(void 0,c,s.name),g=(0,bs.buildResolveInfo)(e,p,u,s,h);return new Promise(function(y){var E,S=(0,X4.getArgumentValues)(p,u[0],n),_=e.contextValue,w=(E=p.subscribe)!==null&&E!==void 0?E:e.fieldResolver;y(w(i,S,_,g))}).then(function(y){if(y instanceof Error)throw(0,sC.locatedError)(y,u,(0,Ry.pathToArray)(h));if(!(0,aC.default)(y))throw new Error("Subscription field must return Async Iterable. "+"Received: ".concat((0,z4.default)(y),"."));return y},function(y){throw(0,sC.locatedError)(y,u,(0,Ry.pathToArray)(h))})}});var pC=v($l=>{"use strict";f();Object.defineProperty($l,"__esModule",{value:!0});Object.defineProperty($l,"subscribe",{enumerable:!0,get:function(){return dC.subscribe}});Object.defineProperty($l,"createSourceEventStream",{enumerable:!0,get:function(){return dC.createSourceEventStream}});var dC=fC()});var jy=v(ky=>{"use strict";f();Object.defineProperty(ky,"__esModule",{value:!0});ky.NoDeprecatedCustomRule=i8;var Dy=n8(st()),ga=H(),Ly=ae();function n8(e){return e&&e.__esModule?e:{default:e}}function i8(e){return{Field:function(r){var n=e.getFieldDef(),i=n?.deprecationReason;if(n&&i!=null){var s=e.getParentType();s!=null||(0,Dy.default)(0),e.reportError(new ga.GraphQLError("The field ".concat(s.name,".").concat(n.name," is deprecated. ").concat(i),r))}},Argument:function(r){var n=e.getArgument(),i=n?.deprecationReason;if(n&&i!=null){var s=e.getDirective();if(s!=null)e.reportError(new ga.GraphQLError('Directive "@'.concat(s.name,'" argument "').concat(n.name,'" is deprecated. ').concat(i),r));else{var o=e.getParentType(),a=e.getFieldDef();o!=null&&a!=null||(0,Dy.default)(0),e.reportError(new ga.GraphQLError('Field "'.concat(o.name,".").concat(a.name,'" argument "').concat(n.name,'" is deprecated. ').concat(i),r))}}},ObjectField:function(r){var n=(0,Ly.getNamedType)(e.getParentInputType());if((0,Ly.isInputObjectType)(n)){var i=n.getFields()[r.name.value],s=i?.deprecationReason;s!=null&&e.reportError(new ga.GraphQLError("The input field ".concat(n.name,".").concat(i.name," is deprecated. ").concat(s),r))}},EnumValue:function(r){var n=e.getEnumValue(),i=n?.deprecationReason;if(n&&i!=null){var s=(0,Ly.getNamedType)(e.getInputType());s!=null||(0,Dy.default)(0),e.reportError(new ga.GraphQLError('The enum value "'.concat(s.name,".").concat(n.name,'" is deprecated. ').concat(i),r))}}}}});var hC=v(My=>{"use strict";f();Object.defineProperty(My,"__esModule",{value:!0});My.NoSchemaIntrospectionCustomRule=c8;var s8=H(),o8=ae(),a8=Wt();function c8(e){return{Field:function(r){var n=(0,o8.getNamedType)(e.getType());n&&(0,a8.isIntrospectionType)(n)&&e.reportError(new s8.GraphQLError('GraphQL introspection has been disabled, but the requested query contained the field "'.concat(r.name.value,'".'),r))}}}});var gC=v(z=>{"use strict";f();Object.defineProperty(z,"__esModule",{value:!0});Object.defineProperty(z,"validate",{enumerable:!0,get:function(){return u8.validate}});Object.defineProperty(z,"ValidationContext",{enumerable:!0,get:function(){return l8.ValidationContext}});Object.defineProperty(z,"specifiedRules",{enumerable:!0,get:function(){return mC.specifiedRules}});Object.defineProperty(z,"recommendedRules",{enumerable:!0,get:function(){return mC.recommendedRules}});Object.defineProperty(z,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return f8.ExecutableDefinitionsRule}});Object.defineProperty(z,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return d8.FieldsOnCorrectTypeRule}});Object.defineProperty(z,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return p8.FragmentsOnCompositeTypesRule}});Object.defineProperty(z,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return h8.KnownArgumentNamesRule}});Object.defineProperty(z,"KnownDirectivesRule",{enumerable:!0,get:function(){return m8.KnownDirectivesRule}});Object.defineProperty(z,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return g8.KnownFragmentNamesRule}});Object.defineProperty(z,"KnownTypeNamesRule",{enumerable:!0,get:function(){return y8.KnownTypeNamesRule}});Object.defineProperty(z,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return v8.LoneAnonymousOperationRule}});Object.defineProperty(z,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return E8.NoFragmentCyclesRule}});Object.defineProperty(z,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return _8.NoUndefinedVariablesRule}});Object.defineProperty(z,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return S8.NoUnusedFragmentsRule}});Object.defineProperty(z,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return b8.NoUnusedVariablesRule}});Object.defineProperty(z,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return T8.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(z,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return w8.PossibleFragmentSpreadsRule}});Object.defineProperty(z,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return O8.ProvidedRequiredArgumentsRule}});Object.defineProperty(z,"ScalarLeafsRule",{enumerable:!0,get:function(){return I8.ScalarLeafsRule}});Object.defineProperty(z,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return A8.SingleFieldSubscriptionsRule}});Object.defineProperty(z,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return N8.UniqueArgumentNamesRule}});Object.defineProperty(z,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return C8.UniqueDirectivesPerLocationRule}});Object.defineProperty(z,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return P8.UniqueFragmentNamesRule}});Object.defineProperty(z,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return R8.UniqueInputFieldNamesRule}});Object.defineProperty(z,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return x8.UniqueOperationNamesRule}});Object.defineProperty(z,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return D8.UniqueVariableNamesRule}});Object.defineProperty(z,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return L8.ValuesOfCorrectTypeRule}});Object.defineProperty(z,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return k8.VariablesAreInputTypesRule}});Object.defineProperty(z,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return j8.VariablesInAllowedPositionRule}});Object.defineProperty(z,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return M8.MaxIntrospectionDepthRule}});Object.defineProperty(z,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return q8.LoneSchemaDefinitionRule}});Object.defineProperty(z,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return F8.UniqueOperationTypesRule}});Object.defineProperty(z,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return U8.UniqueTypeNamesRule}});Object.defineProperty(z,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return V8.UniqueEnumValueNamesRule}});Object.defineProperty(z,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return G8.UniqueFieldDefinitionNamesRule}});Object.defineProperty(z,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return $8.UniqueDirectiveNamesRule}});Object.defineProperty(z,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return B8.PossibleTypeExtensionsRule}});Object.defineProperty(z,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return K8.NoDeprecatedCustomRule}});Object.defineProperty(z,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return H8.NoSchemaIntrospectionCustomRule}});var u8=gs(),l8=dy(),mC=ly(),f8=$m(),d8=og(),p8=eg(),h8=Cg(),m8=Og(),g8=lg(),y8=Xm(),v8=Qm(),E8=yg(),_8=Sg(),S8=dg(),b8=Tg(),T8=Bg(),w8=mg(),O8=kg(),I8=ig(),A8=Ym(),N8=Rg(),C8=Ng(),P8=cg(),R8=Hg(),x8=Km(),D8=Eg(),L8=Dg(),k8=rg(),j8=Mg(),M8=Wg(),q8=Jg(),F8=Xg(),U8=ey(),V8=ry(),G8=sy(),$8=ay(),B8=uy(),K8=jy(),H8=hC()});var yC=v(qy=>{"use strict";f();Object.defineProperty(qy,"__esModule",{value:!0});Object.defineProperty(qy,"formatError",{enumerable:!0,get:function(){return Q8.formatError}});var Q8=H()});var EC=v(yi=>{"use strict";f();Object.defineProperty(yi,"__esModule",{value:!0});Object.defineProperty(yi,"GraphQLError",{enumerable:!0,get:function(){return vC.GraphQLError}});Object.defineProperty(yi,"printError",{enumerable:!0,get:function(){return vC.printError}});Object.defineProperty(yi,"syntaxError",{enumerable:!0,get:function(){return W8.syntaxError}});Object.defineProperty(yi,"locatedError",{enumerable:!0,get:function(){return Y8.locatedError}});Object.defineProperty(yi,"formatError",{enumerable:!0,get:function(){return J8.formatError}});var vC=H(),W8=xu(),Y8=Mo(),J8=yC()});var Uy=v(Fy=>{"use strict";f();Object.defineProperty(Fy,"__esModule",{value:!0});Fy.getIntrospectionQuery=Z8;function _C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function z8(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_C(Object(r),!0).forEach(function(n){X8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_C(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function X8(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Z8(e){var t=z8({descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1},e),r=t.descriptions?"description":"",n=t.specifiedByUrl?"specifiedByUrl":"",i=t.directiveIsRepeatable?"isRepeatable":"",s=t.schemaDescription?r:"";function o(a){return t.inputValueDeprecation?a:""}return`
80
- query IntrospectionQuery {
81
- __schema {
82
- `.concat(s,`
83
- queryType { name }
84
- mutationType { name }
85
- subscriptionType { name }
86
- types {
87
- ...FullType
88
- }
89
- directives {
90
- name
91
- `).concat(r,`
92
- `).concat(i,`
93
- locations
94
- args`).concat(o("(includeDeprecated: true)"),` {
95
- ...InputValue
96
- }
97
- }
98
- }
99
- }
100
-
101
- fragment FullType on __Type {
102
- kind
103
- name
104
- `).concat(r,`
105
- `).concat(n,`
106
- fields(includeDeprecated: true) {
107
- name
108
- `).concat(r,`
109
- args`).concat(o("(includeDeprecated: true)"),` {
110
- ...InputValue
111
- }
112
- type {
113
- ...TypeRef
114
- }
115
- isDeprecated
116
- deprecationReason
117
- }
118
- inputFields`).concat(o("(includeDeprecated: true)"),` {
119
- ...InputValue
120
- }
121
- interfaces {
122
- ...TypeRef
123
- }
124
- enumValues(includeDeprecated: true) {
125
- name
126
- `).concat(r,`
127
- isDeprecated
128
- deprecationReason
129
- }
130
- possibleTypes {
131
- ...TypeRef
132
- }
133
- }
134
-
135
- fragment InputValue on __InputValue {
136
- name
137
- `).concat(r,`
138
- type { ...TypeRef }
139
- defaultValue
140
- `).concat(o("isDeprecated"),`
141
- `).concat(o("deprecationReason"),`
142
- }
143
-
144
- fragment TypeRef on __Type {
145
- kind
146
- name
147
- ofType {
148
- kind
149
- name
150
- ofType {
151
- kind
152
- name
153
- ofType {
154
- kind
155
- name
156
- ofType {
157
- kind
158
- name
159
- ofType {
160
- kind
161
- name
162
- ofType {
163
- kind
164
- name
165
- ofType {
166
- kind
167
- name
168
- }
169
- }
170
- }
171
- }
172
- }
173
- }
174
- }
175
- }
176
- `)}});var Gy=v(Vy=>{"use strict";f();Object.defineProperty(Vy,"__esModule",{value:!0});Vy.getOperationAST=t3;var e3=be();function t3(e,t){for(var r=null,n=0,i=e.definitions;n<i.length;n++){var s=i[n];if(s.kind===e3.Kind.OPERATION_DEFINITION){var o;if(t==null){if(r)return null;r=s}else if(((o=s.name)===null||o===void 0?void 0:o.value)===t)return s}}return r}});var bC=v($y=>{"use strict";f();Object.defineProperty($y,"__esModule",{value:!0});$y.introspectionFromSchema=u3;var r3=o3(st()),n3=ts(),i3=ma(),s3=Uy();function o3(e){return e&&e.__esModule?e:{default:e}}function SC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function a3(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SC(Object(r),!0).forEach(function(n){c3(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function c3(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u3(e,t){var r=a3({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0},t),n=(0,n3.parse)((0,s3.getIntrospectionQuery)(r)),i=(0,i3.executeSync)({schema:e,document:n});return!i.errors&&i.data||(0,r3.default)(0),i.data}});var wC=v(By=>{"use strict";f();Object.defineProperty(By,"__esModule",{value:!0});By.buildClientSchema=y3;var l3=ya(Pt()),Dt=ya(fe()),f3=ya(Kt()),Bl=ya(qo()),TC=ya(Er()),d3=ts(),p3=ci(),h3=Tt(),m3=Tr(),Nr=Wt(),Lt=ae(),g3=aa();function ya(e){return e&&e.__esModule?e:{default:e}}function y3(e,t){(0,TC.default)(e)&&(0,TC.default)(e.__schema)||(0,f3.default)(0,'Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: '.concat((0,Dt.default)(e),"."));for(var r=e.__schema,n=(0,Bl.default)(r.types,function(A){return A.name},function(A){return y(A)}),i=0,s=[].concat(m3.specifiedScalarTypes,Nr.introspectionTypes);i<s.length;i++){var o=s[i];n[o.name]&&(n[o.name]=o)}var a=r.queryType?h(r.queryType):null,c=r.mutationType?h(r.mutationType):null,u=r.subscriptionType?h(r.subscriptionType):null,l=r.directives?r.directives.map(ie):[];return new p3.GraphQLSchema({description:r.description,query:a,mutation:c,subscription:u,types:(0,l3.default)(n),directives:l,assumeValid:t?.assumeValid});function d(A){if(A.kind===Nr.TypeKind.LIST){var X=A.ofType;if(!X)throw new Error("Decorated type deeper than introspection query.");return new Lt.GraphQLList(d(X))}if(A.kind===Nr.TypeKind.NON_NULL){var De=A.ofType;if(!De)throw new Error("Decorated type deeper than introspection query.");var Kn=d(De);return new Lt.GraphQLNonNull((0,Lt.assertNullableType)(Kn))}return p(A)}function p(A){var X=A.name;if(!X)throw new Error("Unknown type reference: ".concat((0,Dt.default)(A),"."));var De=n[X];if(!De)throw new Error("Invalid or incomplete schema, unknown type: ".concat(X,". Ensure that a full introspection query is used in order to build a client schema."));return De}function h(A){return(0,Lt.assertObjectType)(p(A))}function g(A){return(0,Lt.assertInterfaceType)(p(A))}function y(A){if(A!=null&&A.name!=null&&A.kind!=null)switch(A.kind){case Nr.TypeKind.SCALAR:return E(A);case Nr.TypeKind.OBJECT:return _(A);case Nr.TypeKind.INTERFACE:return w(A);case Nr.TypeKind.UNION:return I(A);case Nr.TypeKind.ENUM:return T(A);case Nr.TypeKind.INPUT_OBJECT:return N(A)}var X=(0,Dt.default)(A);throw new Error("Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ".concat(X,"."))}function E(A){return new Lt.GraphQLScalarType({name:A.name,description:A.description,specifiedByUrl:A.specifiedByUrl})}function S(A){if(A.interfaces===null&&A.kind===Nr.TypeKind.INTERFACE)return[];if(!A.interfaces){var X=(0,Dt.default)(A);throw new Error("Introspection result missing interfaces: ".concat(X,"."))}return A.interfaces.map(g)}function _(A){return new Lt.GraphQLObjectType({name:A.name,description:A.description,interfaces:function(){return S(A)},fields:function(){return P(A)}})}function w(A){return new Lt.GraphQLInterfaceType({name:A.name,description:A.description,interfaces:function(){return S(A)},fields:function(){return P(A)}})}function I(A){if(!A.possibleTypes){var X=(0,Dt.default)(A);throw new Error("Introspection result missing possibleTypes: ".concat(X,"."))}return new Lt.GraphQLUnionType({name:A.name,description:A.description,types:function(){return A.possibleTypes.map(h)}})}function T(A){if(!A.enumValues){var X=(0,Dt.default)(A);throw new Error("Introspection result missing enumValues: ".concat(X,"."))}return new Lt.GraphQLEnumType({name:A.name,description:A.description,values:(0,Bl.default)(A.enumValues,function(De){return De.name},function(De){return{description:De.description,deprecationReason:De.deprecationReason}})})}function N(A){if(!A.inputFields){var X=(0,Dt.default)(A);throw new Error("Introspection result missing inputFields: ".concat(X,"."))}return new Lt.GraphQLInputObjectType({name:A.name,description:A.description,fields:function(){return $(A.inputFields)}})}function P(A){if(!A.fields)throw new Error("Introspection result missing fields: ".concat((0,Dt.default)(A),"."));return(0,Bl.default)(A.fields,function(X){return X.name},O)}function O(A){var X=d(A.type);if(!(0,Lt.isOutputType)(X)){var De=(0,Dt.default)(X);throw new Error("Introspection must provide output type for fields, but received: ".concat(De,"."))}if(!A.args){var Kn=(0,Dt.default)(A);throw new Error("Introspection result missing field args: ".concat(Kn,"."))}return{description:A.description,deprecationReason:A.deprecationReason,type:X,args:$(A.args)}}function $(A){return(0,Bl.default)(A,function(X){return X.name},Z)}function Z(A){var X=d(A.type);if(!(0,Lt.isInputType)(X)){var De=(0,Dt.default)(X);throw new Error("Introspection must provide input type for arguments, but received: ".concat(De,"."))}var Kn=A.defaultValue!=null?(0,g3.valueFromAST)((0,d3.parseValue)(A.defaultValue),X):void 0;return{description:A.description,type:X,defaultValue:Kn,deprecationReason:A.deprecationReason}}function ie(A){if(!A.args){var X=(0,Dt.default)(A);throw new Error("Introspection result missing directive args: ".concat(X,"."))}if(!A.locations){var De=(0,Dt.default)(A);throw new Error("Introspection result missing directive locations: ".concat(De,"."))}return new h3.GraphQLDirective({name:A.name,description:A.description,isRepeatable:A.isRepeatable,locations:A.locations.slice(),args:$(A.args)})}}});var Ky=v(Ea=>{"use strict";f();Object.defineProperty(Ea,"__esModule",{value:!0});Ea.extendSchema=O3;Ea.extendSchemaImpl=jC;Ea.getDescription=vi;var v3=Ts(Pt()),E3=Ts(un()),OC=Ts(fe()),va=Ts(Yh()),IC=Ts(st()),_3=Ts(Kt()),Jt=be(),S3=Xi(),b3=es(),AC=li(),T3=gs(),DC=fa(),NC=ci(),LC=Tr(),kC=Wt(),Hl=Tt(),Re=ae(),CC=aa();function Ts(e){return e&&e.__esModule?e:{default:e}}function PC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PC(Object(r),!0).forEach(function(n){w3(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function w3(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O3(e,t,r){(0,NC.assertSchema)(e),t!=null&&t.kind===Jt.Kind.DOCUMENT||(0,_3.default)(0,"Must provide valid Document AST."),r?.assumeValid!==!0&&r?.assumeValidSDL!==!0&&(0,T3.assertValidSDLExtension)(t,e);var n=e.toConfig(),i=jC(n,t,r);return n===i?e:new NC.GraphQLSchema(i)}function jC(e,t,r){for(var n,i,s,o,a=[],c=Object.create(null),u=[],l,d=[],p=0,h=t.definitions;p<h.length;p++){var g=h[p];if(g.kind===Jt.Kind.SCHEMA_DEFINITION)l=g;else if(g.kind===Jt.Kind.SCHEMA_EXTENSION)d.push(g);else if((0,AC.isTypeDefinitionNode)(g))a.push(g);else if((0,AC.isTypeExtensionNode)(g)){var y=g.name.value,E=c[y];c[y]=E?E.concat([g]):[g]}else g.kind===Jt.Kind.DIRECTIVE_DEFINITION&&u.push(g)}if(Object.keys(c).length===0&&a.length===0&&u.length===0&&d.length===0&&l==null)return e;for(var S=Object.create(null),_=0,w=e.types;_<w.length;_++){var I=w[_];S[I.name]=X(I)}for(var T=0;T<a.length;T++){var N,P=a[T],O=P.name.value;S[O]=(N=RC[O])!==null&&N!==void 0?N:ZF(P)}var $=pe(pe({query:e.query&&ie(e.query),mutation:e.mutation&&ie(e.mutation),subscription:e.subscription&&ie(e.subscription)},l&&ib([l])),ib(d));return pe(pe({description:(n=l)===null||n===void 0||(i=n.description)===null||i===void 0?void 0:i.value},$),{},{types:(0,v3.default)(S),directives:[].concat(e.directives.map(A),u.map(XF)),extensions:void 0,astNode:(s=l)!==null&&s!==void 0?s:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(d),assumeValid:(o=r?.assumeValid)!==null&&o!==void 0?o:!1});function Z(C){return(0,Re.isListType)(C)?new Re.GraphQLList(Z(C.ofType)):(0,Re.isNonNullType)(C)?new Re.GraphQLNonNull(Z(C.ofType)):ie(C)}function ie(C){return S[C.name]}function A(C){var G=C.toConfig();return new Hl.GraphQLDirective(pe(pe({},G),{},{args:(0,va.default)(G.args,nb)}))}function X(C){if((0,kC.isIntrospectionType)(C)||(0,LC.isSpecifiedScalarType)(C))return C;if((0,Re.isScalarType)(C))return WF(C);if((0,Re.isObjectType)(C))return YF(C);if((0,Re.isInterfaceType)(C))return JF(C);if((0,Re.isUnionType)(C))return zF(C);if((0,Re.isEnumType)(C))return Kn(C);if((0,Re.isInputObjectType)(C))return De(C);(0,IC.default)(0,"Unexpected type: "+(0,OC.default)(C))}function De(C){var G,j=C.toConfig(),V=(G=c[j.name])!==null&&G!==void 0?G:[];return new Re.GraphQLInputObjectType(pe(pe({},j),{},{fields:function(){return pe(pe({},(0,va.default)(j.fields,function(ge){return pe(pe({},ge),{},{type:Z(ge.type)})})),ob(V))},extensionASTNodes:j.extensionASTNodes.concat(V)}))}function Kn(C){var G,j=C.toConfig(),V=(G=c[C.name])!==null&&G!==void 0?G:[];return new Re.GraphQLEnumType(pe(pe({},j),{},{values:pe(pe({},j.values),ab(V)),extensionASTNodes:j.extensionASTNodes.concat(V)}))}function WF(C){for(var G,j=C.toConfig(),V=(G=c[j.name])!==null&&G!==void 0?G:[],se=j.specifiedByUrl,ge=0;ge<V.length;ge++){var ye,ve=V[ge];se=(ye=xC(ve))!==null&&ye!==void 0?ye:se}return new Re.GraphQLScalarType(pe(pe({},j),{},{specifiedByUrl:se,extensionASTNodes:j.extensionASTNodes.concat(V)}))}function YF(C){var G,j=C.toConfig(),V=(G=c[j.name])!==null&&G!==void 0?G:[];return new Re.GraphQLObjectType(pe(pe({},j),{},{interfaces:function(){return[].concat(C.getInterfaces().map(ie),Gc(V))},fields:function(){return pe(pe({},(0,va.default)(j.fields,rb)),Vc(V))},extensionASTNodes:j.extensionASTNodes.concat(V)}))}function JF(C){var G,j=C.toConfig(),V=(G=c[j.name])!==null&&G!==void 0?G:[];return new Re.GraphQLInterfaceType(pe(pe({},j),{},{interfaces:function(){return[].concat(C.getInterfaces().map(ie),Gc(V))},fields:function(){return pe(pe({},(0,va.default)(j.fields,rb)),Vc(V))},extensionASTNodes:j.extensionASTNodes.concat(V)}))}function zF(C){var G,j=C.toConfig(),V=(G=c[j.name])!==null&&G!==void 0?G:[];return new Re.GraphQLUnionType(pe(pe({},j),{},{types:function(){return[].concat(C.getTypes().map(ie),cb(V))},extensionASTNodes:j.extensionASTNodes.concat(V)}))}function rb(C){return pe(pe({},C),{},{type:Z(C.type),args:(0,va.default)(C.args,nb)})}function nb(C){return pe(pe({},C),{},{type:Z(C.type)})}function ib(C){for(var G={},j=0;j<C.length;j++)for(var V,se=C[j],ge=(V=se.operationTypes)!==null&&V!==void 0?V:[],ye=0;ye<ge.length;ye++){var ve=ge[ye];G[ve.operation]=Uc(ve.type)}return G}function Uc(C){var G,j=C.name.value,V=(G=RC[j])!==null&&G!==void 0?G:S[j];if(V===void 0)throw new Error('Unknown type: "'.concat(j,'".'));return V}function fo(C){return C.kind===Jt.Kind.LIST_TYPE?new Re.GraphQLList(fo(C.type)):C.kind===Jt.Kind.NON_NULL_TYPE?new Re.GraphQLNonNull(fo(C.type)):Uc(C)}function XF(C){var G=C.locations.map(function(j){var V=j.value;return V});return new Hl.GraphQLDirective({name:C.name.value,description:vi(C,r),locations:G,isRepeatable:C.repeatable,args:sb(C.arguments),astNode:C})}function Vc(C){for(var G=Object.create(null),j=0;j<C.length;j++)for(var V,se=C[j],ge=(V=se.fields)!==null&&V!==void 0?V:[],ye=0;ye<ge.length;ye++){var ve=ge[ye];G[ve.name.value]={type:fo(ve.type),description:vi(ve,r),args:sb(ve.arguments),deprecationReason:Kl(ve),astNode:ve}}return G}function sb(C){for(var G=C??[],j=Object.create(null),V=0;V<G.length;V++){var se=G[V],ge=fo(se.type);j[se.name.value]={type:ge,description:vi(se,r),defaultValue:(0,CC.valueFromAST)(se.defaultValue,ge),deprecationReason:Kl(se),astNode:se}}return j}function ob(C){for(var G=Object.create(null),j=0;j<C.length;j++)for(var V,se=C[j],ge=(V=se.fields)!==null&&V!==void 0?V:[],ye=0;ye<ge.length;ye++){var ve=ge[ye],po=fo(ve.type);G[ve.name.value]={type:po,description:vi(ve,r),defaultValue:(0,CC.valueFromAST)(ve.defaultValue,po),deprecationReason:Kl(ve),astNode:ve}}return G}function ab(C){for(var G=Object.create(null),j=0;j<C.length;j++)for(var V,se=C[j],ge=(V=se.values)!==null&&V!==void 0?V:[],ye=0;ye<ge.length;ye++){var ve=ge[ye];G[ve.name.value]={description:vi(ve,r),deprecationReason:Kl(ve),astNode:ve}}return G}function Gc(C){for(var G=[],j=0;j<C.length;j++)for(var V,se=C[j],ge=(V=se.interfaces)!==null&&V!==void 0?V:[],ye=0;ye<ge.length;ye++){var ve=ge[ye];G.push(Uc(ve))}return G}function cb(C){for(var G=[],j=0;j<C.length;j++)for(var V,se=C[j],ge=(V=se.types)!==null&&V!==void 0?V:[],ye=0;ye<ge.length;ye++){var ve=ge[ye];G.push(Uc(ve))}return G}function ZF(C){var G,j=C.name.value,V=vi(C,r),se=(G=c[j])!==null&&G!==void 0?G:[];switch(C.kind){case Jt.Kind.OBJECT_TYPE_DEFINITION:{var ge=se,ye=[C].concat(ge);return new Re.GraphQLObjectType({name:j,description:V,interfaces:function(){return Gc(ye)},fields:function(){return Vc(ye)},astNode:C,extensionASTNodes:ge})}case Jt.Kind.INTERFACE_TYPE_DEFINITION:{var ve=se,po=[C].concat(ve);return new Re.GraphQLInterfaceType({name:j,description:V,interfaces:function(){return Gc(po)},fields:function(){return Vc(po)},astNode:C,extensionASTNodes:ve})}case Jt.Kind.ENUM_TYPE_DEFINITION:{var ub=se,e1=[C].concat(ub);return new Re.GraphQLEnumType({name:j,description:V,values:ab(e1),astNode:C,extensionASTNodes:ub})}case Jt.Kind.UNION_TYPE_DEFINITION:{var lb=se,t1=[C].concat(lb);return new Re.GraphQLUnionType({name:j,description:V,types:function(){return cb(t1)},astNode:C,extensionASTNodes:lb})}case Jt.Kind.SCALAR_TYPE_DEFINITION:{var r1=se;return new Re.GraphQLScalarType({name:j,description:V,specifiedByUrl:xC(C),astNode:C,extensionASTNodes:r1})}case Jt.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var fb=se,n1=[C].concat(fb);return new Re.GraphQLInputObjectType({name:j,description:V,fields:function(){return ob(n1)},astNode:C,extensionASTNodes:fb})}}(0,IC.default)(0,"Unexpected type definition node: "+(0,OC.default)(C))}}var RC=(0,E3.default)(LC.specifiedScalarTypes.concat(kC.introspectionTypes),function(e){return e.name});function Kl(e){var t=(0,DC.getDirectiveValues)(Hl.GraphQLDeprecatedDirective,e);return t?.reason}function xC(e){var t=(0,DC.getDirectiveValues)(Hl.GraphQLSpecifiedByDirective,e);return t?.url}function vi(e,t){if(e.description)return e.description.value;if(t?.commentDescriptions===!0){var r=I3(e);if(r!==void 0)return(0,b3.dedentBlockStringValue)(`
177
- `+r)}}function I3(e){var t=e.loc;if(t){for(var r=[],n=t.startToken.prev;n!=null&&n.kind===S3.TokenKind.COMMENT&&n.next&&n.prev&&n.line+1===n.next.line&&n.line!==n.prev.line;){var i=String(n.value);r.push(i),n=n.prev}return r.length>0?r.reverse().join(`
178
- `):void 0}}});var FC=v(Ql=>{"use strict";f();Object.defineProperty(Ql,"__esModule",{value:!0});Ql.buildASTSchema=qC;Ql.buildSchema=L3;var A3=D3(Kt()),N3=be(),C3=ts(),P3=gs(),R3=ci(),MC=Tt(),x3=Ky();function D3(e){return e&&e.__esModule?e:{default:e}}function qC(e,t){e!=null&&e.kind===N3.Kind.DOCUMENT||(0,A3.default)(0,"Must provide valid Document AST."),t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&(0,P3.assertValidSDL)(e);var r={description:void 0,types:[],directives:[],extensions:void 0,extensionASTNodes:[],assumeValid:!1},n=(0,x3.extendSchemaImpl)(r,e,t);if(n.astNode==null)for(var i=0,s=n.types;i<s.length;i++){var o=s[i];switch(o.name){case"Query":n.query=o;break;case"Mutation":n.mutation=o;break;case"Subscription":n.subscription=o;break}}for(var a=n.directives,c=function(d){var p=MC.specifiedDirectives[d];a.every(function(h){return h.name!==p.name})&&a.push(p)},u=0;u<MC.specifiedDirectives.length;u++)c(u);return new R3.GraphQLSchema(n)}function L3(e,t){var r=(0,C3.parse)(e,{noLocation:t?.noLocation,allowLegacySDLEmptyFields:t?.allowLegacySDLEmptyFields,allowLegacySDLImplementsInterfaces:t?.allowLegacySDLImplementsInterfaces,experimentalFragmentVariables:t?.experimentalFragmentVariables});return qC(r,{commentDescriptions:t?.commentDescriptions,assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}});var VC=v(Wy=>{"use strict";f();Object.defineProperty(Wy,"__esModule",{value:!0});Wy.lexicographicSortSchema=B3;var k3=_a(Pt()),j3=_a(fe()),M3=_a(st()),q3=_a(qo()),F3=_a(Fo()),U3=ci(),V3=Tt(),G3=Wt(),yt=ae();function _a(e){return e&&e.__esModule?e:{default:e}}function UC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UC(Object(r),!0).forEach(function(n){$3(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $3(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B3(e){var t=e.toConfig(),r=(0,q3.default)(Hy(t.types),function(p){return p.name},d);return new U3.GraphQLSchema($e($e({},t),{},{types:(0,k3.default)(r),directives:Hy(t.directives).map(o),query:s(t.query),mutation:s(t.mutation),subscription:s(t.subscription)}));function n(p){return(0,yt.isListType)(p)?new yt.GraphQLList(n(p.ofType)):(0,yt.isNonNullType)(p)?new yt.GraphQLNonNull(n(p.ofType)):i(p)}function i(p){return r[p.name]}function s(p){return p&&i(p)}function o(p){var h=p.toConfig();return new V3.GraphQLDirective($e($e({},h),{},{locations:Qy(h.locations,function(g){return g}),args:a(h.args)}))}function a(p){return Wl(p,function(h){return $e($e({},h),{},{type:n(h.type)})})}function c(p){return Wl(p,function(h){return $e($e({},h),{},{type:n(h.type),args:a(h.args)})})}function u(p){return Wl(p,function(h){return $e($e({},h),{},{type:n(h.type)})})}function l(p){return Hy(p).map(i)}function d(p){if((0,yt.isScalarType)(p)||(0,G3.isIntrospectionType)(p))return p;if((0,yt.isObjectType)(p)){var h=p.toConfig();return new yt.GraphQLObjectType($e($e({},h),{},{interfaces:function(){return l(h.interfaces)},fields:function(){return c(h.fields)}}))}if((0,yt.isInterfaceType)(p)){var g=p.toConfig();return new yt.GraphQLInterfaceType($e($e({},g),{},{interfaces:function(){return l(g.interfaces)},fields:function(){return c(g.fields)}}))}if((0,yt.isUnionType)(p)){var y=p.toConfig();return new yt.GraphQLUnionType($e($e({},y),{},{types:function(){return l(y.types)}}))}if((0,yt.isEnumType)(p)){var E=p.toConfig();return new yt.GraphQLEnumType($e($e({},E),{},{values:Wl(E.values)}))}if((0,yt.isInputObjectType)(p)){var S=p.toConfig();return new yt.GraphQLInputObjectType($e($e({},S),{},{fields:function(){return u(S.fields)}}))}(0,M3.default)(0,"Unexpected type: "+(0,j3.default)(p))}}function Wl(e,t){for(var r=Object.create(null),n=Qy(Object.keys(e),function(a){return a}),i=0;i<n.length;i++){var s=n[i],o=e[s];r[s]=t?t(o):o}return r}function Hy(e){return Qy(e,function(t){return t.name})}function Qy(e,t){return e.slice().sort(function(r,n){var i=t(r),s=t(n);return(0,F3.default)(i,s)})}});var YC=v(Sa=>{"use strict";f();Object.defineProperty(Sa,"__esModule",{value:!0});Sa.printSchema=Q3;Sa.printIntrospectionSchema=W3;Sa.printType=KC;var Jy=tv(Pt()),K3=tv(fe()),GC=tv(st()),zy=bt(),H3=es(),$C=Wt(),Xy=Tr(),Zy=Tt(),ws=ae(),ev=Jo();function tv(e){return e&&e.__esModule?e:{default:e}}function Q3(e,t){return BC(e,function(r){return!(0,Zy.isSpecifiedDirective)(r)},Y3,t)}function W3(e,t){return BC(e,Zy.isSpecifiedDirective,$C.isIntrospectionType,t)}function Y3(e){return!(0,Xy.isSpecifiedScalarType)(e)&&!(0,$C.isIntrospectionType)(e)}function BC(e,t,r,n){var i=e.getDirectives().filter(t),s=(0,Jy.default)(e.getTypeMap()).filter(r);return[J3(e)].concat(i.map(function(o){return i5(o,n)}),s.map(function(o){return KC(o,n)})).filter(Boolean).join(`
179
-
180
- `)+`
181
- `}function J3(e){if(!(e.description==null&&z3(e))){var t=[],r=e.getQueryType();r&&t.push(" query: ".concat(r.name));var n=e.getMutationType();n&&t.push(" mutation: ".concat(n.name));var i=e.getSubscriptionType();return i&&t.push(" subscription: ".concat(i.name)),zt({},e)+`schema {
182
- `.concat(t.join(`
183
- `),`
184
- }`)}}function z3(e){var t=e.getQueryType();if(t&&t.name!=="Query")return!1;var r=e.getMutationType();if(r&&r.name!=="Mutation")return!1;var n=e.getSubscriptionType();return!(n&&n.name!=="Subscription")}function KC(e,t){if((0,ws.isScalarType)(e))return X3(e,t);if((0,ws.isObjectType)(e))return Z3(e,t);if((0,ws.isInterfaceType)(e))return e5(e,t);if((0,ws.isUnionType)(e))return t5(e,t);if((0,ws.isEnumType)(e))return r5(e,t);if((0,ws.isInputObjectType)(e))return n5(e,t);(0,GC.default)(0,"Unexpected type: "+(0,K3.default)(e))}function X3(e,t){return zt(t,e)+"scalar ".concat(e.name)+s5(e)}function HC(e){var t=e.getInterfaces();return t.length?" implements "+t.map(function(r){return r.name}).join(" & "):""}function Z3(e,t){return zt(t,e)+"type ".concat(e.name)+HC(e)+QC(t,e)}function e5(e,t){return zt(t,e)+"interface ".concat(e.name)+HC(e)+QC(t,e)}function t5(e,t){var r=e.getTypes(),n=r.length?" = "+r.join(" | "):"";return zt(t,e)+"union "+e.name+n}function r5(e,t){var r=e.getValues().map(function(n,i){return zt(t,n," ",!i)+" "+n.name+nv(n.deprecationReason)});return zt(t,e)+"enum ".concat(e.name)+rv(r)}function n5(e,t){var r=(0,Jy.default)(e.getFields()).map(function(n,i){return zt(t,n," ",!i)+" "+Yy(n)});return zt(t,e)+"input ".concat(e.name)+rv(r)}function QC(e,t){var r=(0,Jy.default)(t.getFields()).map(function(n,i){return zt(e,n," ",!i)+" "+n.name+WC(e,n.args," ")+": "+String(n.type)+nv(n.deprecationReason)});return rv(r)}function rv(e){return e.length!==0?` {
185
- `+e.join(`
186
- `)+`
187
- }`:""}function WC(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return t.length===0?"":t.every(function(n){return!n.description})?"("+t.map(Yy).join(", ")+")":`(
188
- `+t.map(function(n,i){return zt(e,n," "+r,!i)+" "+r+Yy(n)}).join(`
189
- `)+`
190
- `+r+")"}function Yy(e){var t=(0,ev.astFromValue)(e.defaultValue,e.type),r=e.name+": "+String(e.type);return t&&(r+=" = ".concat((0,zy.print)(t))),r+nv(e.deprecationReason)}function i5(e,t){return zt(t,e)+"directive @"+e.name+WC(t,e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function nv(e){if(e==null)return"";var t=(0,ev.astFromValue)(e,Xy.GraphQLString);return t&&e!==Zy.DEFAULT_DEPRECATION_REASON?" @deprecated(reason: "+(0,zy.print)(t)+")":" @deprecated"}function s5(e){if(e.specifiedByUrl==null)return"";var t=e.specifiedByUrl,r=(0,ev.astFromValue)(t,Xy.GraphQLString);return r||(0,GC.default)(0,"Unexpected null value returned from `astFromValue` for specifiedByUrl")," @specifiedBy(url: "+(0,zy.print)(r)+")"}function zt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=t.description;if(i==null)return"";if(e?.commentDescriptions===!0)return o5(i,r,n);var s=i.length>70,o=(0,H3.printBlockString)(i,"",s),a=r&&!n?`
191
- `+r:r;return a+o.replace(/\n/g,`
192
- `+r)+`
193
- `}function o5(e,t,r){var n=t&&!r?`
194
- `:"",i=e.split(`
195
- `).map(function(s){return t+(s!==""?"# "+s:"#")}).join(`
196
- `);return n+i+`
197
- `}});var JC=v(iv=>{"use strict";f();Object.defineProperty(iv,"__esModule",{value:!0});iv.concatAST=a5;function a5(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t=t.concat(n.definitions)}return{kind:"Document",definitions:t}}});var ZC=v(sv=>{"use strict";f();Object.defineProperty(sv,"__esModule",{value:!0});sv.separateOperations=u5;var Yl=be(),c5=cn();function u5(e){for(var t=[],r=Object.create(null),n=0,i=e.definitions;n<i.length;n++){var s=i[n];switch(s.kind){case Yl.Kind.OPERATION_DEFINITION:t.push(s);break;case Yl.Kind.FRAGMENT_DEFINITION:r[s.name.value]=zC(s.selectionSet);break}}for(var o=Object.create(null),a=function(l){for(var d=t[l],p=new Set,h=0,g=zC(d.selectionSet);h<g.length;h++){var y=g[h];XC(p,r,y)}var E=d.name?d.name.value:"";o[E]={kind:Yl.Kind.DOCUMENT,definitions:e.definitions.filter(function(S){return S===d||S.kind===Yl.Kind.FRAGMENT_DEFINITION&&p.has(S.name.value)})}},c=0;c<t.length;c++)a(c);return o}function XC(e,t,r){if(!e.has(r)){e.add(r);var n=t[r];if(n!==void 0)for(var i=0;i<n.length;i++){var s=n[i];XC(e,t,s)}}}function zC(e){var t=[];return(0,c5.visit)(e,{FragmentSpread:function(n){t.push(n.name.value)}}),t}});var nP=v(av=>{"use strict";f();Object.defineProperty(av,"__esModule",{value:!0});av.stripIgnoredCharacters=l5;var eP=Vu(),ov=Xi(),tP=Bu(),rP=es();function l5(e){for(var t=(0,eP.isSource)(e)?e:new eP.Source(e),r=t.body,n=new tP.Lexer(t),i="",s=!1;n.advance().kind!==ov.TokenKind.EOF;){var o=n.token,a=o.kind,c=!(0,tP.isPunctuatorTokenKind)(o.kind);s&&(c||o.kind===ov.TokenKind.SPREAD)&&(i+=" ");var u=r.slice(o.start,o.end);a===ov.TokenKind.BLOCK_STRING?i+=f5(u):i+=u,s=c}return i}function f5(e){var t=e.slice(3,-3),r=(0,rP.dedentBlockStringValue)(t);(0,rP.getBlockStringIndentation)(r)>0&&(r=`
198
- `+r);var n=r[r.length-1],i=n==='"'&&r.slice(-4)!=='\\"""';return(i||n==="\\")&&(r+=`
199
- `),'"""'+r+'"""'}});var pP=v(wn=>{"use strict";f();Object.defineProperty(wn,"__esModule",{value:!0});wn.findBreakingChanges=E5;wn.findDangerousChanges=_5;wn.DangerousChangeType=wn.BreakingChangeType=void 0;var Os=wa(Pt()),iP=wa(un()),d5=wa(fe()),fP=wa(st()),p5=wa(Fo()),h5=bt(),m5=cn(),g5=Tr(),he=ae(),y5=Jo();function wa(e){return e&&e.__esModule?e:{default:e}}function sP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function oP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sP(Object(r),!0).forEach(function(n){v5(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function v5(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Be=Object.freeze({TYPE_REMOVED:"TYPE_REMOVED",TYPE_CHANGED_KIND:"TYPE_CHANGED_KIND",TYPE_REMOVED_FROM_UNION:"TYPE_REMOVED_FROM_UNION",VALUE_REMOVED_FROM_ENUM:"VALUE_REMOVED_FROM_ENUM",REQUIRED_INPUT_FIELD_ADDED:"REQUIRED_INPUT_FIELD_ADDED",IMPLEMENTED_INTERFACE_REMOVED:"IMPLEMENTED_INTERFACE_REMOVED",FIELD_REMOVED:"FIELD_REMOVED",FIELD_CHANGED_KIND:"FIELD_CHANGED_KIND",REQUIRED_ARG_ADDED:"REQUIRED_ARG_ADDED",ARG_REMOVED:"ARG_REMOVED",ARG_CHANGED_KIND:"ARG_CHANGED_KIND",DIRECTIVE_REMOVED:"DIRECTIVE_REMOVED",DIRECTIVE_ARG_REMOVED:"DIRECTIVE_ARG_REMOVED",REQUIRED_DIRECTIVE_ARG_ADDED:"REQUIRED_DIRECTIVE_ARG_ADDED",DIRECTIVE_REPEATABLE_REMOVED:"DIRECTIVE_REPEATABLE_REMOVED",DIRECTIVE_LOCATION_REMOVED:"DIRECTIVE_LOCATION_REMOVED"});wn.BreakingChangeType=Be;var $r=Object.freeze({VALUE_ADDED_TO_ENUM:"VALUE_ADDED_TO_ENUM",TYPE_ADDED_TO_UNION:"TYPE_ADDED_TO_UNION",OPTIONAL_INPUT_FIELD_ADDED:"OPTIONAL_INPUT_FIELD_ADDED",OPTIONAL_ARG_ADDED:"OPTIONAL_ARG_ADDED",IMPLEMENTED_INTERFACE_ADDED:"IMPLEMENTED_INTERFACE_ADDED",ARG_DEFAULT_VALUE_CHANGE:"ARG_DEFAULT_VALUE_CHANGE"});wn.DangerousChangeType=$r;function E5(e,t){var r=dP(e,t).filter(function(n){return n.type in Be});return r}function _5(e,t){var r=dP(e,t).filter(function(n){return n.type in $r});return r}function dP(e,t){return[].concat(b5(e,t),S5(e,t))}function S5(e,t){for(var r=[],n=Br(e.getDirectives(),t.getDirectives()),i=0,s=n.removed;i<s.length;i++){var o=s[i];r.push({type:Be.DIRECTIVE_REMOVED,description:"".concat(o.name," was removed.")})}for(var a=0,c=n.persisted;a<c.length;a++){for(var u=c[a],l=u[0],d=u[1],p=Br(l.args,d.args),h=0,g=p.added;h<g.length;h++){var y=g[h];(0,he.isRequiredArgument)(y)&&r.push({type:Be.REQUIRED_DIRECTIVE_ARG_ADDED,description:"A required arg ".concat(y.name," on directive ").concat(l.name," was added.")})}for(var E=0,S=p.removed;E<S.length;E++){var _=S[E];r.push({type:Be.DIRECTIVE_ARG_REMOVED,description:"".concat(_.name," was removed from ").concat(l.name,".")})}l.isRepeatable&&!d.isRepeatable&&r.push({type:Be.DIRECTIVE_REPEATABLE_REMOVED,description:"Repeatable flag was removed from ".concat(l.name,".")});for(var w=0,I=l.locations;w<I.length;w++){var T=I[w];d.locations.indexOf(T)===-1&&r.push({type:Be.DIRECTIVE_LOCATION_REMOVED,description:"".concat(T," was removed from ").concat(l.name,".")})}}return r}function b5(e,t){for(var r=[],n=Br((0,Os.default)(e.getTypeMap()),(0,Os.default)(t.getTypeMap())),i=0,s=n.removed;i<s.length;i++){var o=s[i];r.push({type:Be.TYPE_REMOVED,description:(0,g5.isSpecifiedScalarType)(o)?"Standard scalar ".concat(o.name," was removed because it is not referenced anymore."):"".concat(o.name," was removed.")})}for(var a=0,c=n.persisted;a<c.length;a++){var u=c[a],l=u[0],d=u[1];(0,he.isEnumType)(l)&&(0,he.isEnumType)(d)?r.push.apply(r,O5(l,d)):(0,he.isUnionType)(l)&&(0,he.isUnionType)(d)?r.push.apply(r,w5(l,d)):(0,he.isInputObjectType)(l)&&(0,he.isInputObjectType)(d)?r.push.apply(r,T5(l,d)):(0,he.isObjectType)(l)&&(0,he.isObjectType)(d)||(0,he.isInterfaceType)(l)&&(0,he.isInterfaceType)(d)?r.push.apply(r,cP(l,d).concat(aP(l,d))):l.constructor!==d.constructor&&r.push({type:Be.TYPE_CHANGED_KIND,description:"".concat(l.name," changed from ")+"".concat(uP(l)," to ").concat(uP(d),".")})}return r}function T5(e,t){for(var r=[],n=Br((0,Os.default)(e.getFields()),(0,Os.default)(t.getFields())),i=0,s=n.added;i<s.length;i++){var o=s[i];(0,he.isRequiredInputField)(o)?r.push({type:Be.REQUIRED_INPUT_FIELD_ADDED,description:"A required field ".concat(o.name," on input type ").concat(e.name," was added.")}):r.push({type:$r.OPTIONAL_INPUT_FIELD_ADDED,description:"An optional field ".concat(o.name," on input type ").concat(e.name," was added.")})}for(var a=0,c=n.removed;a<c.length;a++){var u=c[a];r.push({type:Be.FIELD_REMOVED,description:"".concat(e.name,".").concat(u.name," was removed.")})}for(var l=0,d=n.persisted;l<d.length;l++){var p=d[l],h=p[0],g=p[1],y=Ta(h.type,g.type);y||r.push({type:Be.FIELD_CHANGED_KIND,description:"".concat(e.name,".").concat(h.name," changed type from ")+"".concat(String(h.type)," to ").concat(String(g.type),".")})}return r}function w5(e,t){for(var r=[],n=Br(e.getTypes(),t.getTypes()),i=0,s=n.added;i<s.length;i++){var o=s[i];r.push({type:$r.TYPE_ADDED_TO_UNION,description:"".concat(o.name," was added to union type ").concat(e.name,".")})}for(var a=0,c=n.removed;a<c.length;a++){var u=c[a];r.push({type:Be.TYPE_REMOVED_FROM_UNION,description:"".concat(u.name," was removed from union type ").concat(e.name,".")})}return r}function O5(e,t){for(var r=[],n=Br(e.getValues(),t.getValues()),i=0,s=n.added;i<s.length;i++){var o=s[i];r.push({type:$r.VALUE_ADDED_TO_ENUM,description:"".concat(o.name," was added to enum type ").concat(e.name,".")})}for(var a=0,c=n.removed;a<c.length;a++){var u=c[a];r.push({type:Be.VALUE_REMOVED_FROM_ENUM,description:"".concat(u.name," was removed from enum type ").concat(e.name,".")})}return r}function aP(e,t){for(var r=[],n=Br(e.getInterfaces(),t.getInterfaces()),i=0,s=n.added;i<s.length;i++){var o=s[i];r.push({type:$r.IMPLEMENTED_INTERFACE_ADDED,description:"".concat(o.name," added to interfaces implemented by ").concat(e.name,".")})}for(var a=0,c=n.removed;a<c.length;a++){var u=c[a];r.push({type:Be.IMPLEMENTED_INTERFACE_REMOVED,description:"".concat(e.name," no longer implements interface ").concat(u.name,".")})}return r}function cP(e,t){for(var r=[],n=Br((0,Os.default)(e.getFields()),(0,Os.default)(t.getFields())),i=0,s=n.removed;i<s.length;i++){var o=s[i];r.push({type:Be.FIELD_REMOVED,description:"".concat(e.name,".").concat(o.name," was removed.")})}for(var a=0,c=n.persisted;a<c.length;a++){var u=c[a],l=u[0],d=u[1];r.push.apply(r,I5(e,l,d));var p=ba(l.type,d.type);p||r.push({type:Be.FIELD_CHANGED_KIND,description:"".concat(e.name,".").concat(l.name," changed type from ")+"".concat(String(l.type)," to ").concat(String(d.type),".")})}return r}function I5(e,t,r){for(var n=[],i=Br(t.args,r.args),s=0,o=i.removed;s<o.length;s++){var a=o[s];n.push({type:Be.ARG_REMOVED,description:"".concat(e.name,".").concat(t.name," arg ").concat(a.name," was removed.")})}for(var c=0,u=i.persisted;c<u.length;c++){var l=u[c],d=l[0],p=l[1],h=Ta(d.type,p.type);if(!h)n.push({type:Be.ARG_CHANGED_KIND,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," has changed type from ")+"".concat(String(d.type)," to ").concat(String(p.type),".")});else if(d.defaultValue!==void 0)if(p.defaultValue===void 0)n.push({type:$r.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," defaultValue was removed.")});else{var g=lP(d.defaultValue,d.type),y=lP(p.defaultValue,p.type);g!==y&&n.push({type:$r.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," has changed defaultValue from ").concat(g," to ").concat(y,".")})}}for(var E=0,S=i.added;E<S.length;E++){var _=S[E];(0,he.isRequiredArgument)(_)?n.push({type:Be.REQUIRED_ARG_ADDED,description:"A required arg ".concat(_.name," on ").concat(e.name,".").concat(t.name," was added.")}):n.push({type:$r.OPTIONAL_ARG_ADDED,description:"An optional arg ".concat(_.name," on ").concat(e.name,".").concat(t.name," was added.")})}return n}function ba(e,t){return(0,he.isListType)(e)?(0,he.isListType)(t)&&ba(e.ofType,t.ofType)||(0,he.isNonNullType)(t)&&ba(e,t.ofType):(0,he.isNonNullType)(e)?(0,he.isNonNullType)(t)&&ba(e.ofType,t.ofType):(0,he.isNamedType)(t)&&e.name===t.name||(0,he.isNonNullType)(t)&&ba(e,t.ofType)}function Ta(e,t){return(0,he.isListType)(e)?(0,he.isListType)(t)&&Ta(e.ofType,t.ofType):(0,he.isNonNullType)(e)?(0,he.isNonNullType)(t)&&Ta(e.ofType,t.ofType)||!(0,he.isNonNullType)(t)&&Ta(e.ofType,t):(0,he.isNamedType)(t)&&e.name===t.name}function uP(e){if((0,he.isScalarType)(e))return"a Scalar type";if((0,he.isObjectType)(e))return"an Object type";if((0,he.isInterfaceType)(e))return"an Interface type";if((0,he.isUnionType)(e))return"a Union type";if((0,he.isEnumType)(e))return"an Enum type";if((0,he.isInputObjectType)(e))return"an Input type";(0,fP.default)(0,"Unexpected type: "+(0,d5.default)(e))}function lP(e,t){var r=(0,y5.astFromValue)(e,t);r!=null||(0,fP.default)(0);var n=(0,m5.visit)(r,{ObjectValue:function(s){var o=[].concat(s.fields);return o.sort(function(a,c){return(0,p5.default)(a.name.value,c.name.value)}),oP(oP({},s),{},{fields:o})}});return(0,h5.print)(n)}function Br(e,t){for(var r=[],n=[],i=[],s=(0,iP.default)(e,function(p){var h=p.name;return h}),o=(0,iP.default)(t,function(p){var h=p.name;return h}),a=0;a<e.length;a++){var c=e[a],u=o[c.name];u===void 0?n.push(c):i.push([c,u])}for(var l=0;l<t.length;l++){var d=t[l];s[d.name]===void 0&&r.push(d)}return{added:r,persisted:i,removed:n}}});var hP=v(cv=>{"use strict";f();Object.defineProperty(cv,"__esModule",{value:!0});cv.findDeprecatedUsages=C5;var A5=gs(),N5=jy();function C5(e,t){return(0,A5.validate)(e,t,[N5.NoDeprecatedCustomRule])}});var EP=v(oe=>{"use strict";f();Object.defineProperty(oe,"__esModule",{value:!0});Object.defineProperty(oe,"getIntrospectionQuery",{enumerable:!0,get:function(){return P5.getIntrospectionQuery}});Object.defineProperty(oe,"getOperationAST",{enumerable:!0,get:function(){return R5.getOperationAST}});Object.defineProperty(oe,"getOperationRootType",{enumerable:!0,get:function(){return x5.getOperationRootType}});Object.defineProperty(oe,"introspectionFromSchema",{enumerable:!0,get:function(){return D5.introspectionFromSchema}});Object.defineProperty(oe,"buildClientSchema",{enumerable:!0,get:function(){return L5.buildClientSchema}});Object.defineProperty(oe,"buildASTSchema",{enumerable:!0,get:function(){return mP.buildASTSchema}});Object.defineProperty(oe,"buildSchema",{enumerable:!0,get:function(){return mP.buildSchema}});Object.defineProperty(oe,"extendSchema",{enumerable:!0,get:function(){return gP.extendSchema}});Object.defineProperty(oe,"getDescription",{enumerable:!0,get:function(){return gP.getDescription}});Object.defineProperty(oe,"lexicographicSortSchema",{enumerable:!0,get:function(){return k5.lexicographicSortSchema}});Object.defineProperty(oe,"printSchema",{enumerable:!0,get:function(){return uv.printSchema}});Object.defineProperty(oe,"printType",{enumerable:!0,get:function(){return uv.printType}});Object.defineProperty(oe,"printIntrospectionSchema",{enumerable:!0,get:function(){return uv.printIntrospectionSchema}});Object.defineProperty(oe,"typeFromAST",{enumerable:!0,get:function(){return j5.typeFromAST}});Object.defineProperty(oe,"valueFromAST",{enumerable:!0,get:function(){return M5.valueFromAST}});Object.defineProperty(oe,"valueFromASTUntyped",{enumerable:!0,get:function(){return q5.valueFromASTUntyped}});Object.defineProperty(oe,"astFromValue",{enumerable:!0,get:function(){return F5.astFromValue}});Object.defineProperty(oe,"TypeInfo",{enumerable:!0,get:function(){return yP.TypeInfo}});Object.defineProperty(oe,"visitWithTypeInfo",{enumerable:!0,get:function(){return yP.visitWithTypeInfo}});Object.defineProperty(oe,"coerceInputValue",{enumerable:!0,get:function(){return U5.coerceInputValue}});Object.defineProperty(oe,"concatAST",{enumerable:!0,get:function(){return V5.concatAST}});Object.defineProperty(oe,"separateOperations",{enumerable:!0,get:function(){return G5.separateOperations}});Object.defineProperty(oe,"stripIgnoredCharacters",{enumerable:!0,get:function(){return $5.stripIgnoredCharacters}});Object.defineProperty(oe,"isEqualType",{enumerable:!0,get:function(){return lv.isEqualType}});Object.defineProperty(oe,"isTypeSubTypeOf",{enumerable:!0,get:function(){return lv.isTypeSubTypeOf}});Object.defineProperty(oe,"doTypesOverlap",{enumerable:!0,get:function(){return lv.doTypesOverlap}});Object.defineProperty(oe,"assertValidName",{enumerable:!0,get:function(){return vP.assertValidName}});Object.defineProperty(oe,"isValidNameError",{enumerable:!0,get:function(){return vP.isValidNameError}});Object.defineProperty(oe,"BreakingChangeType",{enumerable:!0,get:function(){return Jl.BreakingChangeType}});Object.defineProperty(oe,"DangerousChangeType",{enumerable:!0,get:function(){return Jl.DangerousChangeType}});Object.defineProperty(oe,"findBreakingChanges",{enumerable:!0,get:function(){return Jl.findBreakingChanges}});Object.defineProperty(oe,"findDangerousChanges",{enumerable:!0,get:function(){return Jl.findDangerousChanges}});Object.defineProperty(oe,"findDeprecatedUsages",{enumerable:!0,get:function(){return B5.findDeprecatedUsages}});var P5=Uy(),R5=Gy(),x5=Rl(),D5=bC(),L5=wC(),mP=FC(),gP=Ky(),k5=VC(),uv=YC(),j5=wr(),M5=aa(),q5=am(),F5=Jo(),yP=yl(),U5=by(),V5=JC(),G5=ZC(),$5=nP(),lv=Bo(),vP=Hh(),Jl=pP(),B5=hP()});var As=v(b=>{"use strict";f();Object.defineProperty(b,"__esModule",{value:!0});Object.defineProperty(b,"version",{enumerable:!0,get:function(){return _P.version}});Object.defineProperty(b,"versionInfo",{enumerable:!0,get:function(){return _P.versionInfo}});Object.defineProperty(b,"graphql",{enumerable:!0,get:function(){return SP.graphql}});Object.defineProperty(b,"graphqlSync",{enumerable:!0,get:function(){return SP.graphqlSync}});Object.defineProperty(b,"GraphQLSchema",{enumerable:!0,get:function(){return x.GraphQLSchema}});Object.defineProperty(b,"GraphQLDirective",{enumerable:!0,get:function(){return x.GraphQLDirective}});Object.defineProperty(b,"GraphQLScalarType",{enumerable:!0,get:function(){return x.GraphQLScalarType}});Object.defineProperty(b,"GraphQLObjectType",{enumerable:!0,get:function(){return x.GraphQLObjectType}});Object.defineProperty(b,"GraphQLInterfaceType",{enumerable:!0,get:function(){return x.GraphQLInterfaceType}});Object.defineProperty(b,"GraphQLUnionType",{enumerable:!0,get:function(){return x.GraphQLUnionType}});Object.defineProperty(b,"GraphQLEnumType",{enumerable:!0,get:function(){return x.GraphQLEnumType}});Object.defineProperty(b,"GraphQLInputObjectType",{enumerable:!0,get:function(){return x.GraphQLInputObjectType}});Object.defineProperty(b,"GraphQLList",{enumerable:!0,get:function(){return x.GraphQLList}});Object.defineProperty(b,"GraphQLNonNull",{enumerable:!0,get:function(){return x.GraphQLNonNull}});Object.defineProperty(b,"specifiedScalarTypes",{enumerable:!0,get:function(){return x.specifiedScalarTypes}});Object.defineProperty(b,"GraphQLInt",{enumerable:!0,get:function(){return x.GraphQLInt}});Object.defineProperty(b,"GraphQLFloat",{enumerable:!0,get:function(){return x.GraphQLFloat}});Object.defineProperty(b,"GraphQLString",{enumerable:!0,get:function(){return x.GraphQLString}});Object.defineProperty(b,"GraphQLBoolean",{enumerable:!0,get:function(){return x.GraphQLBoolean}});Object.defineProperty(b,"GraphQLID",{enumerable:!0,get:function(){return x.GraphQLID}});Object.defineProperty(b,"specifiedDirectives",{enumerable:!0,get:function(){return x.specifiedDirectives}});Object.defineProperty(b,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return x.GraphQLIncludeDirective}});Object.defineProperty(b,"GraphQLSkipDirective",{enumerable:!0,get:function(){return x.GraphQLSkipDirective}});Object.defineProperty(b,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return x.GraphQLDeprecatedDirective}});Object.defineProperty(b,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return x.GraphQLSpecifiedByDirective}});Object.defineProperty(b,"TypeKind",{enumerable:!0,get:function(){return x.TypeKind}});Object.defineProperty(b,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return x.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(b,"introspectionTypes",{enumerable:!0,get:function(){return x.introspectionTypes}});Object.defineProperty(b,"__Schema",{enumerable:!0,get:function(){return x.__Schema}});Object.defineProperty(b,"__Directive",{enumerable:!0,get:function(){return x.__Directive}});Object.defineProperty(b,"__DirectiveLocation",{enumerable:!0,get:function(){return x.__DirectiveLocation}});Object.defineProperty(b,"__Type",{enumerable:!0,get:function(){return x.__Type}});Object.defineProperty(b,"__Field",{enumerable:!0,get:function(){return x.__Field}});Object.defineProperty(b,"__InputValue",{enumerable:!0,get:function(){return x.__InputValue}});Object.defineProperty(b,"__EnumValue",{enumerable:!0,get:function(){return x.__EnumValue}});Object.defineProperty(b,"__TypeKind",{enumerable:!0,get:function(){return x.__TypeKind}});Object.defineProperty(b,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return x.SchemaMetaFieldDef}});Object.defineProperty(b,"TypeMetaFieldDef",{enumerable:!0,get:function(){return x.TypeMetaFieldDef}});Object.defineProperty(b,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return x.TypeNameMetaFieldDef}});Object.defineProperty(b,"isSchema",{enumerable:!0,get:function(){return x.isSchema}});Object.defineProperty(b,"isDirective",{enumerable:!0,get:function(){return x.isDirective}});Object.defineProperty(b,"isType",{enumerable:!0,get:function(){return x.isType}});Object.defineProperty(b,"isScalarType",{enumerable:!0,get:function(){return x.isScalarType}});Object.defineProperty(b,"isObjectType",{enumerable:!0,get:function(){return x.isObjectType}});Object.defineProperty(b,"isInterfaceType",{enumerable:!0,get:function(){return x.isInterfaceType}});Object.defineProperty(b,"isUnionType",{enumerable:!0,get:function(){return x.isUnionType}});Object.defineProperty(b,"isEnumType",{enumerable:!0,get:function(){return x.isEnumType}});Object.defineProperty(b,"isInputObjectType",{enumerable:!0,get:function(){return x.isInputObjectType}});Object.defineProperty(b,"isListType",{enumerable:!0,get:function(){return x.isListType}});Object.defineProperty(b,"isNonNullType",{enumerable:!0,get:function(){return x.isNonNullType}});Object.defineProperty(b,"isInputType",{enumerable:!0,get:function(){return x.isInputType}});Object.defineProperty(b,"isOutputType",{enumerable:!0,get:function(){return x.isOutputType}});Object.defineProperty(b,"isLeafType",{enumerable:!0,get:function(){return x.isLeafType}});Object.defineProperty(b,"isCompositeType",{enumerable:!0,get:function(){return x.isCompositeType}});Object.defineProperty(b,"isAbstractType",{enumerable:!0,get:function(){return x.isAbstractType}});Object.defineProperty(b,"isWrappingType",{enumerable:!0,get:function(){return x.isWrappingType}});Object.defineProperty(b,"isNullableType",{enumerable:!0,get:function(){return x.isNullableType}});Object.defineProperty(b,"isNamedType",{enumerable:!0,get:function(){return x.isNamedType}});Object.defineProperty(b,"isRequiredArgument",{enumerable:!0,get:function(){return x.isRequiredArgument}});Object.defineProperty(b,"isRequiredInputField",{enumerable:!0,get:function(){return x.isRequiredInputField}});Object.defineProperty(b,"isSpecifiedScalarType",{enumerable:!0,get:function(){return x.isSpecifiedScalarType}});Object.defineProperty(b,"isIntrospectionType",{enumerable:!0,get:function(){return x.isIntrospectionType}});Object.defineProperty(b,"isSpecifiedDirective",{enumerable:!0,get:function(){return x.isSpecifiedDirective}});Object.defineProperty(b,"assertSchema",{enumerable:!0,get:function(){return x.assertSchema}});Object.defineProperty(b,"assertDirective",{enumerable:!0,get:function(){return x.assertDirective}});Object.defineProperty(b,"assertType",{enumerable:!0,get:function(){return x.assertType}});Object.defineProperty(b,"assertScalarType",{enumerable:!0,get:function(){return x.assertScalarType}});Object.defineProperty(b,"assertObjectType",{enumerable:!0,get:function(){return x.assertObjectType}});Object.defineProperty(b,"assertInterfaceType",{enumerable:!0,get:function(){return x.assertInterfaceType}});Object.defineProperty(b,"assertUnionType",{enumerable:!0,get:function(){return x.assertUnionType}});Object.defineProperty(b,"assertEnumType",{enumerable:!0,get:function(){return x.assertEnumType}});Object.defineProperty(b,"assertInputObjectType",{enumerable:!0,get:function(){return x.assertInputObjectType}});Object.defineProperty(b,"assertListType",{enumerable:!0,get:function(){return x.assertListType}});Object.defineProperty(b,"assertNonNullType",{enumerable:!0,get:function(){return x.assertNonNullType}});Object.defineProperty(b,"assertInputType",{enumerable:!0,get:function(){return x.assertInputType}});Object.defineProperty(b,"assertOutputType",{enumerable:!0,get:function(){return x.assertOutputType}});Object.defineProperty(b,"assertLeafType",{enumerable:!0,get:function(){return x.assertLeafType}});Object.defineProperty(b,"assertCompositeType",{enumerable:!0,get:function(){return x.assertCompositeType}});Object.defineProperty(b,"assertAbstractType",{enumerable:!0,get:function(){return x.assertAbstractType}});Object.defineProperty(b,"assertWrappingType",{enumerable:!0,get:function(){return x.assertWrappingType}});Object.defineProperty(b,"assertNullableType",{enumerable:!0,get:function(){return x.assertNullableType}});Object.defineProperty(b,"assertNamedType",{enumerable:!0,get:function(){return x.assertNamedType}});Object.defineProperty(b,"getNullableType",{enumerable:!0,get:function(){return x.getNullableType}});Object.defineProperty(b,"getNamedType",{enumerable:!0,get:function(){return x.getNamedType}});Object.defineProperty(b,"validateSchema",{enumerable:!0,get:function(){return x.validateSchema}});Object.defineProperty(b,"assertValidSchema",{enumerable:!0,get:function(){return x.assertValidSchema}});Object.defineProperty(b,"Token",{enumerable:!0,get:function(){return we.Token}});Object.defineProperty(b,"Source",{enumerable:!0,get:function(){return we.Source}});Object.defineProperty(b,"Location",{enumerable:!0,get:function(){return we.Location}});Object.defineProperty(b,"getLocation",{enumerable:!0,get:function(){return we.getLocation}});Object.defineProperty(b,"printLocation",{enumerable:!0,get:function(){return we.printLocation}});Object.defineProperty(b,"printSourceLocation",{enumerable:!0,get:function(){return we.printSourceLocation}});Object.defineProperty(b,"Lexer",{enumerable:!0,get:function(){return we.Lexer}});Object.defineProperty(b,"TokenKind",{enumerable:!0,get:function(){return we.TokenKind}});Object.defineProperty(b,"parse",{enumerable:!0,get:function(){return we.parse}});Object.defineProperty(b,"parseValue",{enumerable:!0,get:function(){return we.parseValue}});Object.defineProperty(b,"parseType",{enumerable:!0,get:function(){return we.parseType}});Object.defineProperty(b,"print",{enumerable:!0,get:function(){return we.print}});Object.defineProperty(b,"visit",{enumerable:!0,get:function(){return we.visit}});Object.defineProperty(b,"visitInParallel",{enumerable:!0,get:function(){return we.visitInParallel}});Object.defineProperty(b,"getVisitFn",{enumerable:!0,get:function(){return we.getVisitFn}});Object.defineProperty(b,"BREAK",{enumerable:!0,get:function(){return we.BREAK}});Object.defineProperty(b,"Kind",{enumerable:!0,get:function(){return we.Kind}});Object.defineProperty(b,"DirectiveLocation",{enumerable:!0,get:function(){return we.DirectiveLocation}});Object.defineProperty(b,"isDefinitionNode",{enumerable:!0,get:function(){return we.isDefinitionNode}});Object.defineProperty(b,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return we.isExecutableDefinitionNode}});Object.defineProperty(b,"isSelectionNode",{enumerable:!0,get:function(){return we.isSelectionNode}});Object.defineProperty(b,"isValueNode",{enumerable:!0,get:function(){return we.isValueNode}});Object.defineProperty(b,"isTypeNode",{enumerable:!0,get:function(){return we.isTypeNode}});Object.defineProperty(b,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return we.isTypeSystemDefinitionNode}});Object.defineProperty(b,"isTypeDefinitionNode",{enumerable:!0,get:function(){return we.isTypeDefinitionNode}});Object.defineProperty(b,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return we.isTypeSystemExtensionNode}});Object.defineProperty(b,"isTypeExtensionNode",{enumerable:!0,get:function(){return we.isTypeExtensionNode}});Object.defineProperty(b,"execute",{enumerable:!0,get:function(){return Is.execute}});Object.defineProperty(b,"executeSync",{enumerable:!0,get:function(){return Is.executeSync}});Object.defineProperty(b,"defaultFieldResolver",{enumerable:!0,get:function(){return Is.defaultFieldResolver}});Object.defineProperty(b,"defaultTypeResolver",{enumerable:!0,get:function(){return Is.defaultTypeResolver}});Object.defineProperty(b,"responsePathAsArray",{enumerable:!0,get:function(){return Is.responsePathAsArray}});Object.defineProperty(b,"getDirectiveValues",{enumerable:!0,get:function(){return Is.getDirectiveValues}});Object.defineProperty(b,"subscribe",{enumerable:!0,get:function(){return bP.subscribe}});Object.defineProperty(b,"createSourceEventStream",{enumerable:!0,get:function(){return bP.createSourceEventStream}});Object.defineProperty(b,"validate",{enumerable:!0,get:function(){return ee.validate}});Object.defineProperty(b,"ValidationContext",{enumerable:!0,get:function(){return ee.ValidationContext}});Object.defineProperty(b,"specifiedRules",{enumerable:!0,get:function(){return ee.specifiedRules}});Object.defineProperty(b,"recommendedRules",{enumerable:!0,get:function(){return ee.recommendedRules}});Object.defineProperty(b,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return ee.ExecutableDefinitionsRule}});Object.defineProperty(b,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return ee.FieldsOnCorrectTypeRule}});Object.defineProperty(b,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return ee.FragmentsOnCompositeTypesRule}});Object.defineProperty(b,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return ee.KnownArgumentNamesRule}});Object.defineProperty(b,"KnownDirectivesRule",{enumerable:!0,get:function(){return ee.KnownDirectivesRule}});Object.defineProperty(b,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return ee.KnownFragmentNamesRule}});Object.defineProperty(b,"KnownTypeNamesRule",{enumerable:!0,get:function(){return ee.KnownTypeNamesRule}});Object.defineProperty(b,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return ee.LoneAnonymousOperationRule}});Object.defineProperty(b,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return ee.NoFragmentCyclesRule}});Object.defineProperty(b,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return ee.NoUndefinedVariablesRule}});Object.defineProperty(b,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return ee.NoUnusedFragmentsRule}});Object.defineProperty(b,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return ee.NoUnusedVariablesRule}});Object.defineProperty(b,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return ee.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(b,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return ee.PossibleFragmentSpreadsRule}});Object.defineProperty(b,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return ee.ProvidedRequiredArgumentsRule}});Object.defineProperty(b,"ScalarLeafsRule",{enumerable:!0,get:function(){return ee.ScalarLeafsRule}});Object.defineProperty(b,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return ee.SingleFieldSubscriptionsRule}});Object.defineProperty(b,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return ee.UniqueArgumentNamesRule}});Object.defineProperty(b,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return ee.UniqueDirectivesPerLocationRule}});Object.defineProperty(b,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return ee.UniqueFragmentNamesRule}});Object.defineProperty(b,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return ee.UniqueInputFieldNamesRule}});Object.defineProperty(b,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return ee.UniqueOperationNamesRule}});Object.defineProperty(b,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return ee.UniqueVariableNamesRule}});Object.defineProperty(b,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return ee.ValuesOfCorrectTypeRule}});Object.defineProperty(b,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return ee.VariablesAreInputTypesRule}});Object.defineProperty(b,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return ee.VariablesInAllowedPositionRule}});Object.defineProperty(b,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return ee.MaxIntrospectionDepthRule}});Object.defineProperty(b,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return ee.LoneSchemaDefinitionRule}});Object.defineProperty(b,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return ee.UniqueOperationTypesRule}});Object.defineProperty(b,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return ee.UniqueTypeNamesRule}});Object.defineProperty(b,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return ee.UniqueEnumValueNamesRule}});Object.defineProperty(b,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return ee.UniqueFieldDefinitionNamesRule}});Object.defineProperty(b,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return ee.UniqueDirectiveNamesRule}});Object.defineProperty(b,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return ee.PossibleTypeExtensionsRule}});Object.defineProperty(b,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return ee.NoDeprecatedCustomRule}});Object.defineProperty(b,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return ee.NoSchemaIntrospectionCustomRule}});Object.defineProperty(b,"GraphQLError",{enumerable:!0,get:function(){return Oa.GraphQLError}});Object.defineProperty(b,"syntaxError",{enumerable:!0,get:function(){return Oa.syntaxError}});Object.defineProperty(b,"locatedError",{enumerable:!0,get:function(){return Oa.locatedError}});Object.defineProperty(b,"printError",{enumerable:!0,get:function(){return Oa.printError}});Object.defineProperty(b,"formatError",{enumerable:!0,get:function(){return Oa.formatError}});Object.defineProperty(b,"getIntrospectionQuery",{enumerable:!0,get:function(){return le.getIntrospectionQuery}});Object.defineProperty(b,"getOperationAST",{enumerable:!0,get:function(){return le.getOperationAST}});Object.defineProperty(b,"getOperationRootType",{enumerable:!0,get:function(){return le.getOperationRootType}});Object.defineProperty(b,"introspectionFromSchema",{enumerable:!0,get:function(){return le.introspectionFromSchema}});Object.defineProperty(b,"buildClientSchema",{enumerable:!0,get:function(){return le.buildClientSchema}});Object.defineProperty(b,"buildASTSchema",{enumerable:!0,get:function(){return le.buildASTSchema}});Object.defineProperty(b,"buildSchema",{enumerable:!0,get:function(){return le.buildSchema}});Object.defineProperty(b,"getDescription",{enumerable:!0,get:function(){return le.getDescription}});Object.defineProperty(b,"extendSchema",{enumerable:!0,get:function(){return le.extendSchema}});Object.defineProperty(b,"lexicographicSortSchema",{enumerable:!0,get:function(){return le.lexicographicSortSchema}});Object.defineProperty(b,"printSchema",{enumerable:!0,get:function(){return le.printSchema}});Object.defineProperty(b,"printType",{enumerable:!0,get:function(){return le.printType}});Object.defineProperty(b,"printIntrospectionSchema",{enumerable:!0,get:function(){return le.printIntrospectionSchema}});Object.defineProperty(b,"typeFromAST",{enumerable:!0,get:function(){return le.typeFromAST}});Object.defineProperty(b,"valueFromAST",{enumerable:!0,get:function(){return le.valueFromAST}});Object.defineProperty(b,"valueFromASTUntyped",{enumerable:!0,get:function(){return le.valueFromASTUntyped}});Object.defineProperty(b,"astFromValue",{enumerable:!0,get:function(){return le.astFromValue}});Object.defineProperty(b,"TypeInfo",{enumerable:!0,get:function(){return le.TypeInfo}});Object.defineProperty(b,"visitWithTypeInfo",{enumerable:!0,get:function(){return le.visitWithTypeInfo}});Object.defineProperty(b,"coerceInputValue",{enumerable:!0,get:function(){return le.coerceInputValue}});Object.defineProperty(b,"concatAST",{enumerable:!0,get:function(){return le.concatAST}});Object.defineProperty(b,"separateOperations",{enumerable:!0,get:function(){return le.separateOperations}});Object.defineProperty(b,"stripIgnoredCharacters",{enumerable:!0,get:function(){return le.stripIgnoredCharacters}});Object.defineProperty(b,"isEqualType",{enumerable:!0,get:function(){return le.isEqualType}});Object.defineProperty(b,"isTypeSubTypeOf",{enumerable:!0,get:function(){return le.isTypeSubTypeOf}});Object.defineProperty(b,"doTypesOverlap",{enumerable:!0,get:function(){return le.doTypesOverlap}});Object.defineProperty(b,"assertValidName",{enumerable:!0,get:function(){return le.assertValidName}});Object.defineProperty(b,"isValidNameError",{enumerable:!0,get:function(){return le.isValidNameError}});Object.defineProperty(b,"BreakingChangeType",{enumerable:!0,get:function(){return le.BreakingChangeType}});Object.defineProperty(b,"DangerousChangeType",{enumerable:!0,get:function(){return le.DangerousChangeType}});Object.defineProperty(b,"findBreakingChanges",{enumerable:!0,get:function(){return le.findBreakingChanges}});Object.defineProperty(b,"findDangerousChanges",{enumerable:!0,get:function(){return le.findDangerousChanges}});Object.defineProperty(b,"findDeprecatedUsages",{enumerable:!0,get:function(){return le.findDeprecatedUsages}});var _P=NI(),SP=QN(),x=YN(),we=XN(),Is=ZN(),bP=pC(),ee=gC(),Oa=EC(),le=EP()});var MP=v((Wye,Kr)=>{f();var mv=k("fs"),tf=k("path"),z5=k("os"),X5=k("crypto"),xP=["\u25C8 encrypted .env [www.dotenvx.com]","\u25C8 secrets for agents [www.dotenvx.com]","\u2301 auth for agents [www.vestauth.com]","\u2318 custom filepath { path: '/custom/path/.env' }","\u2318 enable debugging { debug: true }","\u2318 override existing { override: true }","\u2318 suppress logs { quiet: true }","\u2318 multiple files { path: ['.env.local', '.env'] }"];function Z5(){return xP[Math.floor(Math.random()*xP.length)]}function Ns(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function eX(){return process.stdout.isTTY}function tX(e){return eX()?`\x1B[2m${e}\x1B[0m`:e}var rX=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function nX(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
200
- `);let n;for(;(n=rX.exec(r))!=null;){let i=n[1],s=n[2]||"";s=s.trim();let o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(s=s.replace(/\\n/g,`
201
- `),s=s.replace(/\\r/g,"\r")),t[i]=s}return t}function iX(e){e=e||{};let t=jP(e);e.path=t;let r=Je.configDotenv(e);if(!r.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw o.code="MISSING_DATA",o}let n=kP(e).split(","),i=n.length,s;for(let o=0;o<i;o++)try{let a=n[o].trim(),c=oX(r,a);s=Je.decrypt(c.ciphertext,c.key);break}catch(a){if(o+1>=i)throw a}return Je.parse(s)}function sX(e){console.error(`\u26A0 ${e}`)}function Na(e){console.log(`\u2506 ${e}`)}function LP(e){console.log(`\u25C7 ${e}`)}function kP(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function oX(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let s=`DOTENV_VAULT_${i.toUpperCase()}`,o=e.parsed[s];if(!o){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:o,key:n}}function jP(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)mv.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=tf.resolve(process.cwd(),".env.vault");return mv.existsSync(t)?t:null}function DP(e){return e[0]==="~"?tf.join(z5.homedir(),e.slice(1)):e}function aX(e){let t=Ns(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=Ns(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&LP("loading env from encrypted .env.vault");let n=Je._parseVault(e),i=process.env;return e&&e.processEnv!=null&&(i=e.processEnv),Je.populate(i,n,e),{parsed:n}}function cX(e){let t=tf.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let i=Ns(n.DOTENV_CONFIG_DEBUG||e&&e.debug),s=Ns(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:i&&Na("no encoding is specified (UTF-8 is used by default)");let o=[t];if(e&&e.path)if(!Array.isArray(e.path))o=[DP(e.path)];else{o=[];for(let l of e.path)o.push(DP(l))}let a,c={};for(let l of o)try{let d=Je.parse(mv.readFileSync(l,{encoding:r}));Je.populate(c,d,e)}catch(d){i&&Na(`failed to load ${l} ${d.message}`),a=d}let u=Je.populate(n,c,e);if(i=Ns(n.DOTENV_CONFIG_DEBUG||i),s=Ns(n.DOTENV_CONFIG_QUIET||s),i||!s){let l=Object.keys(u).length,d=[];for(let p of o)try{let h=tf.relative(process.cwd(),p);d.push(h)}catch(h){i&&Na(`failed to load ${p} ${h.message}`),a=h}LP(`injected env (${l}) from ${d.join(",")} ${tX(`// tip: ${Z5()}`)}`)}return a?{parsed:c,error:a}:{parsed:c}}function uX(e){if(kP(e).length===0)return Je.configDotenv(e);let t=jP(e);return t?Je._configVault(e):(sX(`you set DOTENV_KEY but you are missing a .env.vault file at ${t}`),Je.configDotenv(e))}function lX(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),s=n.subarray(-16);n=n.subarray(12,-16);try{let o=X5.createDecipheriv("aes-256-gcm",r,i);return o.setAuthTag(s),`${o.update(n)}${o.final()}`}catch(o){let a=o instanceof RangeError,c=o.message==="Invalid key length",u=o.message==="Unsupported state or unable to authenticate data";if(a||c){let l=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw l.code="INVALID_DOTENV_KEY",l}else if(u){let l=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw l.code="DECRYPTION_FAILED",l}else throw o}}function fX(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override),s={};if(typeof t!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(t))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=t[o],s[o]=t[o]),n&&Na(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):(e[o]=t[o],s[o]=t[o]);return s}var Je={configDotenv:cX,_configVault:aX,_parseVault:iX,config:uX,decrypt:lX,parse:nX,populate:fX};Kr.exports.configDotenv=Je.configDotenv;Kr.exports._configVault=Je._configVault;Kr.exports._parseVault=Je._parseVault;Kr.exports.config=Je.config;Kr.exports.decrypt=Je.decrypt;Kr.exports.parse=Je.parse;Kr.exports.populate=Je.populate;Kr.exports=Je});var IR=v((pve,OR)=>{f();OR.exports=Ps;function Ps(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ps.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-r:e+r}return Math.min(e,this.max)|0};Ps.prototype.reset=function(){this.attempts=0};Ps.prototype.setMin=function(e){this.ms=e};Ps.prototype.setMax=function(e){this.max=e};Ps.prototype.setJitter=function(e){this.jitter=e}});var NR=v((mve,vv)=>{"use strict";f();var yX=Object.prototype.hasOwnProperty,vt="~";function Ca(){}Object.create&&(Ca.prototype=Object.create(null),new Ca().__proto__||(vt=!1));function vX(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function AR(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var s=new vX(r,n||e,i),o=vt?vt+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],s]:e._events[o].push(s):(e._events[o]=s,e._eventsCount++),e}function af(e,t){--e._eventsCount===0?e._events=new Ca:delete e._events[t]}function ft(){this._events=new Ca,this._eventsCount=0}ft.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)yX.call(r,n)&&t.push(vt?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};ft.prototype.listeners=function(t){var r=vt?vt+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i<s;i++)o[i]=n[i].fn;return o};ft.prototype.listenerCount=function(t){var r=vt?vt+t:t,n=this._events[r];return n?n.fn?1:n.length:0};ft.prototype.emit=function(t,r,n,i,s,o){var a=vt?vt+t:t;if(!this._events[a])return!1;var c=this._events[a],u=arguments.length,l,d;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,n),!0;case 4:return c.fn.call(c.context,r,n,i),!0;case 5:return c.fn.call(c.context,r,n,i,s),!0;case 6:return c.fn.call(c.context,r,n,i,s,o),!0}for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c.fn.apply(c.context,l)}else{var p=c.length,h;for(d=0;d<p;d++)switch(c[d].once&&this.removeListener(t,c[d].fn,void 0,!0),u){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,r);break;case 3:c[d].fn.call(c[d].context,r,n);break;case 4:c[d].fn.call(c[d].context,r,n,i);break;default:if(!l)for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c[d].fn.apply(c[d].context,l)}}return!0};ft.prototype.on=function(t,r,n){return AR(this,t,r,n,!1)};ft.prototype.once=function(t,r,n){return AR(this,t,r,n,!0)};ft.prototype.removeListener=function(t,r,n,i){var s=vt?vt+t:t;if(!this._events[s])return this;if(!r)return af(this,s),this;var o=this._events[s];if(o.fn)o.fn===r&&(!i||o.once)&&(!n||o.context===n)&&af(this,s);else{for(var a=0,c=[],u=o.length;a<u;a++)(o[a].fn!==r||i&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[s]=c.length===1?c[0]:c:af(this,s)}return this};ft.prototype.removeAllListeners=function(t){var r;return t?(r=vt?vt+t:t,this._events[r]&&af(this,r)):(this._events=new Ca,this._eventsCount=0),this};ft.prototype.off=ft.prototype.removeListener;ft.prototype.addListener=ft.prototype.on;ft.prefixed=vt;ft.EventEmitter=ft;typeof vv<"u"&&(vv.exports=ft)});var CR=v(Ev=>{"use strict";f();Object.defineProperty(Ev,"__esModule",{value:!0});function EX(e){return typeof e=="string"}Ev.default=EX});var Sv=v(_v=>{"use strict";f();Object.defineProperty(_v,"__esModule",{value:!0});function _X(e){return e!==null&&typeof e=="object"}_v.default=_X});var PR=v(bv=>{"use strict";f();Object.defineProperty(bv,"__esModule",{value:!0});bv.default=SX;function SX(e){var t,r=e.Symbol;return typeof r=="function"?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}});var RR=v((wv,Tv)=>{"use strict";f();Object.defineProperty(wv,"__esModule",{value:!0});var bX=PR(),TX=wX(bX);function wX(e){return e&&e.__esModule?e:{default:e}}var Rs;typeof self<"u"?Rs=self:typeof window<"u"?Rs=window:typeof global<"u"?Rs=global:typeof Tv<"u"?Rs=Tv:Rs=Function("return this")();var OX=(0,TX.default)(Rs);wv.default=OX});var cf=v(xs=>{"use strict";f();Object.defineProperty(xs,"__esModule",{value:!0});xs.GRAPHQL_SUBSCRIPTIONS=xs.GRAPHQL_WS=void 0;var IX="graphql-ws";xs.GRAPHQL_WS=IX;var AX="graphql-subscriptions";xs.GRAPHQL_SUBSCRIPTIONS=AX});var xR=v(Ds=>{"use strict";f();Object.defineProperty(Ds,"__esModule",{value:!0});Ds.WS_TIMEOUT=Ds.MIN_WS_TIMEOUT=void 0;var NX=1e3;Ds.MIN_WS_TIMEOUT=NX;var CX=3e4;Ds.WS_TIMEOUT=CX});var Pa=v(Ov=>{"use strict";f();Object.defineProperty(Ov,"__esModule",{value:!0});var PX=(function(){function e(){throw new Error("Static Class")}return e.GQL_CONNECTION_INIT="connection_init",e.GQL_CONNECTION_ACK="connection_ack",e.GQL_CONNECTION_ERROR="connection_error",e.GQL_CONNECTION_KEEP_ALIVE="ka",e.GQL_CONNECTION_TERMINATE="connection_terminate",e.GQL_START="start",e.GQL_DATA="data",e.GQL_ERROR="error",e.GQL_COMPLETE="complete",e.GQL_STOP="stop",e.SUBSCRIPTION_START="subscription_start",e.SUBSCRIPTION_DATA="subscription_data",e.SUBSCRIPTION_SUCCESS="subscription_success",e.SUBSCRIPTION_FAIL="subscription_fail",e.SUBSCRIPTION_END="subscription_end",e.INIT="init",e.INIT_SUCCESS="init_success",e.INIT_FAIL="init_fail",e.KEEP_ALIVE="keepalive",e})();Ov.default=PX});var qR=v(Xt=>{"use strict";f();var Ls=Xt&&Xt.__assign||function(){return Ls=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ls.apply(this,arguments)},RX=Xt&&Xt.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{u(n.next(l))}catch(d){o(d)}}function c(l){try{u(n.throw(l))}catch(d){o(d)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})},xX=Xt&&Xt.__generator||function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},DR=Xt&&Xt.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.SubscriptionClient=void 0;var LR=typeof global<"u"?global:typeof window<"u"?window:{},DX=LR.WebSocket||LR.MozWebSocket,kR=IR(),LX=NR(),jR=CR(),kX=Sv(),jX=bt(),MX=Gy(),qX=RR(),FX=cf(),MR=xR(),Et=Pa(),UX=(function(){function e(t,r,n,i){var s=r||{},o=s.connectionCallback,a=o===void 0?void 0:o,c=s.connectionParams,u=c===void 0?{}:c,l=s.minTimeout,d=l===void 0?MR.MIN_WS_TIMEOUT:l,p=s.timeout,h=p===void 0?MR.WS_TIMEOUT:p,g=s.reconnect,y=g===void 0?!1:g,E=s.reconnectionAttempts,S=E===void 0?1/0:E,_=s.lazy,w=_===void 0?!1:_,I=s.inactivityTimeout,T=I===void 0?0:I,N=s.wsOptionArguments,P=N===void 0?[]:N;if(this.wsImpl=n||DX,!this.wsImpl)throw new Error("Unable to find native implementation, or alternative implementation for WebSocket!");this.wsProtocols=i||FX.GRAPHQL_WS,this.connectionCallback=a,this.url=t,this.operations={},this.nextOperationId=0,this.minWsTimeout=d,this.wsTimeout=h,this.unsentMessagesQueue=[],this.reconnect=y,this.reconnecting=!1,this.reconnectionAttempts=S,this.lazy=!!w,this.inactivityTimeout=T,this.closedByUser=!1,this.backoff=new kR({jitter:.5}),this.eventEmitter=new LX.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(u),this.wsOptionArguments=P,this.lazy||this.connect()}return Object.defineProperty(e.prototype,"status",{get:function(){return this.client===null?this.wsImpl.CLOSED:this.client.readyState},enumerable:!1,configurable:!0}),e.prototype.close=function(t,r){t===void 0&&(t=!0),r===void 0&&(r=!0),this.clearInactivityTimeout(),this.client!==null&&(this.closedByUser=r,t&&(this.clearCheckConnectionInterval(),this.clearMaxConnectTimeout(),this.clearTryReconnectTimeout(),this.unsubscribeAll(),this.sendMessage(void 0,Et.default.GQL_CONNECTION_TERMINATE,null)),this.client.close(),this.client.onopen=null,this.client.onclose=null,this.client.onerror=null,this.client.onmessage=null,this.client=null,this.eventEmitter.emit("disconnected"),t||this.tryReconnect())},e.prototype.request=function(t){var r,n=this.getObserver.bind(this),i=this.executeOperation.bind(this),s=this.unsubscribe.bind(this),o;return this.clearInactivityTimeout(),r={},r[qX.default]=function(){return this},r.subscribe=function(a,c,u){var l=n(a,c,u);return o=i(t,function(d,p){d===null&&p===null?l.complete&&l.complete():d?l.error&&l.error(d[0]):l.next&&l.next(p)}),{unsubscribe:function(){o&&(s(o),o=null)}}},r},e.prototype.on=function(t,r,n){var i=this.eventEmitter.on(t,r,n);return function(){i.off(t,r,n)}},e.prototype.onConnected=function(t,r){return this.on("connected",t,r)},e.prototype.onConnecting=function(t,r){return this.on("connecting",t,r)},e.prototype.onDisconnected=function(t,r){return this.on("disconnected",t,r)},e.prototype.onReconnected=function(t,r){return this.on("reconnected",t,r)},e.prototype.onReconnecting=function(t,r){return this.on("reconnecting",t,r)},e.prototype.onError=function(t,r){return this.on("error",t,r)},e.prototype.unsubscribeAll=function(){var t=this;Object.keys(this.operations).forEach(function(r){t.unsubscribe(r)})},e.prototype.applyMiddlewares=function(t){var r=this;return new Promise(function(n,i){var s=function(o,a){var c=function(u){if(u)i(u);else if(o.length>0){var l=o.shift();l&&l.applyMiddleware.apply(a,[t,c])}else n(t)};c()};s(DR([],r.middlewares,!0),r)})},e.prototype.use=function(t){var r=this;return t.map(function(n){if(typeof n.applyMiddleware=="function")r.middlewares.push(n);else throw new Error("Middleware must implement the applyMiddleware function.")}),this},e.prototype.getConnectionParams=function(t){return function(){return new Promise(function(r,n){if(typeof t=="function")try{return r(t.call(null))}catch(i){return n(i)}r(t)})}},e.prototype.executeOperation=function(t,r){var n=this;this.client===null&&this.connect();var i=this.generateOperationId();return this.operations[i]={options:t,handler:r},this.applyMiddlewares(t).then(function(s){n.checkOperationOptions(s,r),n.operations[i]&&(n.operations[i]={options:s,handler:r},n.sendMessage(i,Et.default.GQL_START,s))}).catch(function(s){n.unsubscribe(i),r(n.formatErrors(s))}),i},e.prototype.getObserver=function(t,r,n){return typeof t=="function"?{next:function(i){return t(i)},error:function(i){return r&&r(i)},complete:function(){return n&&n()}}:t},e.prototype.createMaxConnectTimeGenerator=function(){var t=this.minWsTimeout,r=this.wsTimeout;return new kR({min:t,max:r,factor:1.2})},e.prototype.clearCheckConnectionInterval=function(){this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnectionIntervalId=null)},e.prototype.clearMaxConnectTimeout=function(){this.maxConnectTimeoutId&&(clearTimeout(this.maxConnectTimeoutId),this.maxConnectTimeoutId=null)},e.prototype.clearTryReconnectTimeout=function(){this.tryReconnectTimeoutId&&(clearTimeout(this.tryReconnectTimeoutId),this.tryReconnectTimeoutId=null)},e.prototype.clearInactivityTimeout=function(){this.inactivityTimeoutId&&(clearTimeout(this.inactivityTimeoutId),this.inactivityTimeoutId=null)},e.prototype.setInactivityTimeout=function(){var t=this;this.inactivityTimeout>0&&Object.keys(this.operations).length===0&&(this.inactivityTimeoutId=setTimeout(function(){Object.keys(t.operations).length===0&&t.close()},this.inactivityTimeout))},e.prototype.checkOperationOptions=function(t,r){var n=t.query,i=t.variables,s=t.operationName;if(!n)throw new Error("Must provide a query.");if(!r)throw new Error("Must provide an handler.");if(!(0,jR.default)(n)&&!(0,MX.getOperationAST)(n,s)||s&&!(0,jR.default)(s)||i&&!(0,kX.default)(i))throw new Error("Incorrect option types. query must be a string or a document,`operationName` must be a string, and `variables` must be an object.")},e.prototype.buildMessage=function(t,r,n){var i=n&&n.query?Ls(Ls({},n),{query:typeof n.query=="string"?n.query:(0,jX.print)(n.query)}):n;return{id:t,type:r,payload:i}},e.prototype.formatErrors=function(t){return Array.isArray(t)?t:t&&t.errors?this.formatErrors(t.errors):t&&t.message?[t]:[{name:"FormatedError",message:"Unknown error",originalError:t}]},e.prototype.sendMessage=function(t,r,n){this.sendMessageRaw(this.buildMessage(t,r,n))},e.prototype.sendMessageRaw=function(t){switch(this.status){case this.wsImpl.OPEN:var r=JSON.stringify(t);try{JSON.parse(r)}catch{this.eventEmitter.emit("error",new Error("Message must be JSON-serializable. Got: "+t))}this.client.send(r);break;case this.wsImpl.CONNECTING:this.unsentMessagesQueue.push(t);break;default:this.reconnecting||this.eventEmitter.emit("error",new Error("A message was not sent because socket is not connected, is closing or is already closed. Message was: "+JSON.stringify(t)))}},e.prototype.generateOperationId=function(){return String(++this.nextOperationId)},e.prototype.tryReconnect=function(){var t=this;if(!(!this.reconnect||this.backoff.attempts>=this.reconnectionAttempts)){this.reconnecting||(Object.keys(this.operations).forEach(function(n){t.unsentMessagesQueue.push(t.buildMessage(n,Et.default.GQL_START,t.operations[n].options))}),this.reconnecting=!0),this.clearTryReconnectTimeout();var r=this.backoff.duration();this.tryReconnectTimeoutId=setTimeout(function(){t.connect()},r)}},e.prototype.flushUnsentMessagesQueue=function(){var t=this;this.unsentMessagesQueue.forEach(function(r){t.sendMessageRaw(r)}),this.unsentMessagesQueue=[]},e.prototype.checkConnection=function(){if(this.wasKeepAliveReceived){this.wasKeepAliveReceived=!1;return}this.reconnecting||this.close(!1,!0)},e.prototype.checkMaxConnectTimeout=function(){var t=this;this.clearMaxConnectTimeout(),this.maxConnectTimeoutId=setTimeout(function(){t.status!==t.wsImpl.OPEN&&(t.reconnecting=!0,t.close(!1,!0))},this.maxConnectTimeGenerator.duration())},e.prototype.connect=function(){var t,r=this;this.client=new((t=this.wsImpl).bind.apply(t,DR([void 0,this.url,this.wsProtocols],this.wsOptionArguments,!1))),this.checkMaxConnectTimeout(),this.client.onopen=function(){return RX(r,void 0,void 0,function(){var n,i;return xX(this,function(s){switch(s.label){case 0:if(this.status!==this.wsImpl.OPEN)return[3,4];this.clearMaxConnectTimeout(),this.closedByUser=!1,this.eventEmitter.emit(this.reconnecting?"reconnecting":"connecting"),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.connectionParams()];case 2:return n=s.sent(),this.sendMessage(void 0,Et.default.GQL_CONNECTION_INIT,n),this.flushUnsentMessagesQueue(),[3,4];case 3:return i=s.sent(),this.sendMessage(void 0,Et.default.GQL_CONNECTION_ERROR,i),this.flushUnsentMessagesQueue(),[3,4];case 4:return[2]}})})},this.client.onclose=function(){r.closedByUser||r.close(!1,!1)},this.client.onerror=function(n){r.eventEmitter.emit("error",n)},this.client.onmessage=function(n){var i=n.data;r.processReceivedData(i)}},e.prototype.processReceivedData=function(t){var r,n;try{r=JSON.parse(t),n=r.id}catch{throw new Error("Message must be JSON-parseable. Got: "+t)}if([Et.default.GQL_DATA,Et.default.GQL_COMPLETE,Et.default.GQL_ERROR].indexOf(r.type)!==-1&&!this.operations[n]){this.unsubscribe(n);return}switch(r.type){case Et.default.GQL_CONNECTION_ERROR:this.connectionCallback&&this.connectionCallback(r.payload);break;case Et.default.GQL_CONNECTION_ACK:this.eventEmitter.emit(this.reconnecting?"reconnected":"connected",r.payload),this.reconnecting=!1,this.backoff.reset(),this.maxConnectTimeGenerator.reset(),this.connectionCallback&&this.connectionCallback();break;case Et.default.GQL_COMPLETE:var i=this.operations[n].handler;delete this.operations[n],i.call(this,null,null);break;case Et.default.GQL_ERROR:this.operations[n].handler(this.formatErrors(r.payload),null),delete this.operations[n];break;case Et.default.GQL_DATA:var s=r.payload.errors?Ls(Ls({},r.payload),{errors:this.formatErrors(r.payload.errors)}):r.payload;this.operations[n].handler(null,s);break;case Et.default.GQL_CONNECTION_KEEP_ALIVE:var o=typeof this.wasKeepAliveReceived>"u";this.wasKeepAliveReceived=!0,o&&this.checkConnection(),this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnection()),this.checkConnectionIntervalId=setInterval(this.checkConnection.bind(this),this.wsTimeout);break;default:throw new Error("Invalid message type!")}},e.prototype.unsubscribe=function(t){this.operations[t]&&(delete this.operations[t],this.setInactivityTimeout(),this.sendMessage(t,Et.default.GQL_STOP,void 0))},e})();Xt.SubscriptionClient=UX});var _i=v((xve,FR)=>{"use strict";f();FR.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}}});var Ra=v((Lve,Iv)=>{"use strict";f();var{EMPTY_BUFFER:VX}=_i();function UR(e,t){if(e.length===0)return VX;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let i=0;i<e.length;i++){let s=e[i];r.set(s,n),n+=s.length}return n<t?r.slice(0,n):r}function VR(e,t,r,n,i){for(let s=0;s<i;s++)r[n+s]=e[s]^t[s&3]}function GR(e,t){let r=e.length;for(let n=0;n<r;n++)e[n]^=t[n&3]}function $R(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function uf(e){if(uf.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=Buffer.from(e):ArrayBuffer.isView(e)?t=Buffer.from(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),uf.readOnly=!1),t}try{let e=k("bufferutil"),t=e.BufferUtil||e;Iv.exports={concat:UR,mask(r,n,i,s,o){o<48?VR(r,n,i,s,o):t.mask(r,n,i,s,o)},toArrayBuffer:$R,toBuffer:uf,unmask(r,n){r.length<32?GR(r,n):t.unmask(r,n)}}}catch{Iv.exports={concat:UR,mask:VR,toArrayBuffer:$R,toBuffer:uf,unmask:GR}}});var HR=v((jve,KR)=>{"use strict";f();var BR=Symbol("kDone"),Av=Symbol("kRun"),Nv=class{constructor(t){this[BR]=()=>{this.pending--,this[Av]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Av]()}[Av](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[BR])}}};KR.exports=Nv});var La=v((qve,JR)=>{"use strict";f();var xa=k("zlib"),QR=Ra(),GX=HR(),{kStatusCode:WR,NOOP:$X}=_i(),BX=Buffer.from([0,0,255,255]),df=Symbol("permessage-deflate"),Hr=Symbol("total-length"),Da=Symbol("callback"),On=Symbol("buffers"),ff=Symbol("error"),lf,Cv=class{constructor(t,r,n){if(this._maxPayload=n|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!lf){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;lf=new GX(i)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Da];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let i=r[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=i})}),t}decompress(t,r,n){lf.add(i=>{this._decompress(t,r,(s,o)=>{i(),n(s,o)})})}compress(t,r,n){lf.add(i=>{this._compress(t,r,(s,o)=>{i(),n(s,o)})})}_decompress(t,r,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?xa.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=xa.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[df]=this,this._inflate[Hr]=0,this._inflate[On]=[],this._inflate.on("error",HX),this._inflate.on("data",YR)}this._inflate[Da]=n,this._inflate.write(t),r&&this._inflate.write(BX),this._inflate.flush(()=>{let s=this._inflate[ff];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=QR.concat(this._inflate[On],this._inflate[Hr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Hr]=0,this._inflate[On]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(t,r,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?xa.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=xa.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[Hr]=0,this._deflate[On]=[],this._deflate.on("error",$X),this._deflate.on("data",KX)}this._deflate[Da]=n,this._deflate.write(t),this._deflate.flush(xa.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=QR.concat(this._deflate[On],this._deflate[Hr]);r&&(s=s.slice(0,s.length-4)),this._deflate[Da]=null,this._deflate[Hr]=0,this._deflate[On]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};JR.exports=Cv;function KX(e){this[On].push(e),this[Hr]+=e.length}function YR(e){if(this[Hr]+=e.length,this[df]._maxPayload<1||this[Hr]<=this[df]._maxPayload){this[On].push(e);return}this[ff]=new RangeError("Max payload size exceeded"),this[ff].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ff][WR]=1009,this.removeListener("data",YR),this.reset()}function HX(e){this[df]._inflate=null,e[WR]=1007,this[Da](e)}});var Rv=v((Uve,Pv)=>{"use strict";f();function zR(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function XR(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}try{let e=k("utf-8-validate");typeof e=="object"&&(e=e.Validation.isValidUTF8),Pv.exports={isValidStatusCode:zR,isValidUTF8(t){return t.length<150?XR(t):e(t)}}}catch{Pv.exports={isValidStatusCode:zR,isValidUTF8:XR}}});var kv=v((Gve,ix)=>{"use strict";f();var{Writable:QX}=k("stream"),ZR=La(),{BINARY_TYPES:WX,EMPTY_BUFFER:YX,kStatusCode:JX,kWebSocket:zX}=_i(),{concat:xv,toArrayBuffer:XX,unmask:ZX}=Ra(),{isValidStatusCode:e6,isValidUTF8:ex}=Rv(),ka=0,tx=1,rx=2,nx=3,Dv=4,t6=5,Lv=class extends QX{constructor(t,r,n,i,s,o){super(),this._binaryType=t||WX[0],this[zX]=void 0,this._extensions=r||{},this._isServer=!!n,this._maxBufferedChunks=s|0,this._maxFragments=o|0,this._maxPayload=i|0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=ka,this._loop=!1}_write(t,r,n){if(this._opcode===8&&this._state==ka)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks)return n(qe(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=n.slice(t),n.slice(0,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],i=r.length-t;t>=n.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),i),this._buffers[0]=n.slice(t)),t-=n.length}while(t>0);return r}startLoop(t){let r;this._loop=!0;do switch(this._state){case ka:r=this.getInfo();break;case tx:r=this.getPayloadLength16();break;case rx:r=this.getPayloadLength64();break;case nx:this.getMask();break;case Dv:r=this.getData(t);break;default:this._loop=!1;return}while(this._loop);t(r)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0)return this._loop=!1,qe(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");let r=(t[0]&64)===64;if(r&&!this._extensions[ZR.extensionName])return this._loop=!1,qe(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(r)return this._loop=!1,qe(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,qe(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented)return this._loop=!1,qe(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin)return this._loop=!1,qe(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(r)return this._loop=!1,qe(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,qe(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}else return this._loop=!1,qe(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked)return this._loop=!1,qe(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,qe(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(this._payloadLength===126)this._state=tx;else if(this._payloadLength===127)this._state=rx;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),r=t.readUInt32BE(0);return r>Math.pow(2,21)-1?(this._loop=!1,qe(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=r*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,qe(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=nx:this._state=Dv}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Dv}getData(t){let r=YX;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&ZX(r,this._mask)}if(this._opcode>7)return this.controlMessage(r);if(this._compressed){this._state=t6,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments)return this._loop=!1,qe(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");this._messageLength=this._totalPayloadLength,this._fragments.push(r)}return this.dataMessage()}decompress(t,r){this._extensions[ZR.extensionName].decompress(t,this._fin,(i,s)=>{if(i)return r(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return r(qe(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));if(this._maxFragments>0&&this._fragments.length>=this._maxFragments)return r(qe(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));this._fragments.push(s)}let o=this.dataMessage();if(o)return r(o);this.startLoop(r)})}dataMessage(){if(this._fin){let t=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=xv(r,t):this._binaryType==="arraybuffer"?n=XX(xv(r,t)):n=r,this.emit("message",n)}else{let n=xv(r,t);if(!ex(n))return this._loop=!1,qe(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",n.toString())}}this._state=ka}controlMessage(t){if(this._opcode===8)if(this._loop=!1,t.length===0)this.emit("conclude",1005,""),this.end();else{if(t.length===1)return qe(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{let r=t.readUInt16BE(0);if(!e6(r))return qe(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");let n=t.slice(2);if(!ex(n))return qe(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",r,n.toString()),this.end()}}else this._opcode===9?this.emit("ping",t):this.emit("pong",t);this._state=ka}};ix.exports=Lv;function qe(e,t,r,n,i){let s=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(s,qe),s.code=i,s[JX]=n,s}});var Mv=v((Hve,ax)=>{"use strict";f();var Bve=k("net"),Kve=k("tls"),{randomFillSync:r6}=k("crypto"),sx=La(),{EMPTY_BUFFER:n6}=_i(),{isValidStatusCode:i6}=Rv(),{mask:ox,toBuffer:Qr}=Ra(),Si=Buffer.alloc(4),jv=class e{constructor(t,r){this._extensions=r||{},this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,r){let n=r.mask&&r.readOnly,i=r.mask?6:2,s=t.length;t.length>=65536?(i+=8,s=127):t.length>125&&(i+=2,s=126);let o=Buffer.allocUnsafe(n?t.length+i:i);return o[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(o[0]|=64),o[1]=s,s===126?o.writeUInt16BE(t.length,2):s===127&&(o.writeUInt32BE(0,2),o.writeUInt32BE(t.length,6)),r.mask?(r6(Si,0,4),o[1]|=128,o[i-4]=Si[0],o[i-3]=Si[1],o[i-2]=Si[2],o[i-1]=Si[3],n?(ox(t,Si,o,i,t.length),[o]):(ox(t,Si,t,0,t.length),[o,t])):[o,t]}close(t,r,n,i){let s;if(t===void 0)s=n6;else{if(typeof t!="number"||!i6(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||r==="")s=Buffer.allocUnsafe(2),s.writeUInt16BE(t,0);else{let o=Buffer.byteLength(r);if(o>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+o),s.writeUInt16BE(t,0),s.write(r,2)}}this._deflating?this.enqueue([this.doClose,s,n,i]):this.doClose(s,n,i)}doClose(t,r,n){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:8,mask:r,readOnly:!1}),n)}ping(t,r,n){let i=Qr(t);if(i.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPing,i,r,Qr.readOnly,n]):this.doPing(i,r,Qr.readOnly,n)}doPing(t,r,n,i){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:9,mask:r,readOnly:n}),i)}pong(t,r,n){let i=Qr(t);if(i.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPong,i,r,Qr.readOnly,n]):this.doPong(i,r,Qr.readOnly,n)}doPong(t,r,n,i){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:10,mask:r,readOnly:n}),i)}send(t,r,n){let i=Qr(t),s=this._extensions[sx.extensionName],o=r.binary?2:1,a=r.compress;if(this._firstFragment?(this._firstFragment=!1,a&&s&&(a=i.length>=s._threshold),this._compress=a):(a=!1,o=0),r.fin&&(this._firstFragment=!0),s){let c={fin:r.fin,rsv1:a,opcode:o,mask:r.mask,readOnly:Qr.readOnly};this._deflating?this.enqueue([this.dispatch,i,this._compress,c,n]):this.dispatch(i,this._compress,c,n)}else this.sendFrame(e.frame(i,{fin:r.fin,rsv1:!1,opcode:o,mask:r.mask,readOnly:Qr.readOnly}),n)}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let s=this._extensions[sx.extensionName];this._bufferedBytes+=t.length,this._deflating=!0,s.compress(t,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");typeof i=="function"&&i(c);for(let u=0;u<this._queue.length;u++){let l=this._queue[u][4];typeof l=="function"&&l(c)}return}this._bufferedBytes-=t.length,this._deflating=!1,n.readOnly=!1,this.sendFrame(e.frame(a,n),i),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[1].length,Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[1].length,this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};ax.exports=jv});var ux=v((Wve,cx)=>{"use strict";f();var ks=class{constructor(t,r){this.target=r,this.type=t}},qv=class extends ks{constructor(t,r){super("message",r),this.data=t}},Fv=class extends ks{constructor(t,r,n){super("close",n),this.wasClean=n._closeFrameReceived&&n._closeFrameSent,this.reason=r,this.code=t}},Uv=class extends ks{constructor(t){super("open",t)}},Vv=class extends ks{constructor(t,r){super("error",r),this.message=t.message,this.error=t}},s6={addEventListener(e,t,r){if(typeof t!="function")return;function n(c){t.call(this,new qv(c,this))}function i(c,u){t.call(this,new Fv(c,u,this))}function s(c){t.call(this,new Vv(c,this))}function o(){t.call(this,new Uv(this))}let a=r&&r.once?"once":"on";e==="message"?(n._listener=t,this[a](e,n)):e==="close"?(i._listener=t,this[a](e,i)):e==="error"?(s._listener=t,this[a](e,s)):e==="open"?(o._listener=t,this[a](e,o)):this[a](e,t)},removeEventListener(e,t){let r=this.listeners(e);for(let n=0;n<r.length;n++)(r[n]===t||r[n]._listener===t)&&this.removeListener(e,r[n])}};cx.exports=s6});var Gv=v((Jve,lx)=>{"use strict";f();var ja=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Pr(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function o6(e){let t=Object.create(null);if(e===void 0||e==="")return t;let r=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,u=-1,l=0;for(;l<e.length;l++){let p=e.charCodeAt(l);if(o===void 0)if(u===-1&&ja[p]===1)c===-1&&(c=l);else if(p===32||p===9)u===-1&&c!==-1&&(u=l);else if(p===59||p===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1&&(u=l);let h=e.slice(c,u);p===44?(Pr(t,h,r),r=Object.create(null)):o=h,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${l}`);else if(a===void 0)if(u===-1&&ja[p]===1)c===-1&&(c=l);else if(p===32||p===9)u===-1&&c!==-1&&(u=l);else if(p===59||p===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1&&(u=l),Pr(r,e.slice(c,u),!0),p===44&&(Pr(t,o,r),r=Object.create(null),o=void 0),c=u=-1}else if(p===61&&c!==-1&&u===-1)a=e.slice(c,l),c=u=-1;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(i){if(ja[p]!==1)throw new SyntaxError(`Unexpected character at index ${l}`);c===-1?c=l:n||(n=!0),i=!1}else if(s)if(ja[p]===1)c===-1&&(c=l);else if(p===34&&c!==-1)s=!1,u=l;else if(p===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(p===34&&e.charCodeAt(l-1)===61)s=!0;else if(u===-1&&ja[p]===1)c===-1&&(c=l);else if(c!==-1&&(p===32||p===9))u===-1&&(u=l);else if(p===59||p===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1&&(u=l);let h=e.slice(c,u);n&&(h=h.replace(/\\/g,""),n=!1),Pr(r,a,h),p===44&&(Pr(t,o,r),r=Object.create(null),o=void 0),a=void 0,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${l}`)}if(c===-1||s)throw new SyntaxError("Unexpected end of input");u===-1&&(u=l);let d=e.slice(c,u);return o===void 0?Pr(t,d,r):(a===void 0?Pr(r,d,!0):n?Pr(r,a,d.replace(/\\/g,"")):Pr(r,a,d),Pr(t,o,r)),t}function a6(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}lx.exports={format:a6,parse:o6}});var Wv=v((Zve,_x)=>{"use strict";f();var c6=k("events"),u6=k("https"),l6=k("http"),px=k("net"),f6=k("tls"),{randomBytes:d6,createHash:p6}=k("crypto"),{Readable:Xve}=k("stream"),{URL:$v}=k("url"),In=La(),h6=kv(),m6=Mv(),{BINARY_TYPES:fx,EMPTY_BUFFER:Bv,GUID:g6,kStatusCode:y6,kWebSocket:dt,NOOP:hx}=_i(),{addEventListener:v6,removeEventListener:E6}=ux(),{format:_6,parse:S6}=Gv(),{toBuffer:b6}=Ra(),Wr=["CONNECTING","OPEN","CLOSING","CLOSED"],Kv=[8,13],T6=30*1e3,Ve=class e extends c6{constructor(t,r,n){super(),this._binaryType=fx[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._extensions={},this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(r)?r=r.join(", "):typeof r=="object"&&r!==null&&(n=r,r=void 0),mx(this,t,r,n)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(t){fx.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get onclose(){}set onclose(t){}get onerror(){}set onerror(t){}get onopen(){}set onopen(t){}get onmessage(){}set onmessage(t){}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,n,i,s){let o=new h6(this.binaryType,this._extensions,this._isServer,n,i,s);this._sender=new m6(t,this._extensions),this._receiver=o,this._socket=t,o[dt]=this,t[dt]=this,o.on("conclude",I6),o.on("drain",A6),o.on("error",N6),o.on("message",C6),o.on("ping",P6),o.on("pong",R6),t.setTimeout(0),t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",yx),t.on("data",pf),t.on("end",vx),t.on("error",Ex),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[In.extensionName]&&this._extensions[In.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING)return kt(this,this._req,"WebSocket was closed before the connection was established");if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),T6)}}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Qv(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Bv,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Qv(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Bv,r,n)}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Qv(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[In.extensionName]||(i.compress=!1),this._sender.send(t||Bv,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING)return kt(this,this._req,"WebSocket was closed before the connection was established");this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Ve,"CONNECTING",{enumerable:!0,value:Wr.indexOf("CONNECTING")});Object.defineProperty(Ve.prototype,"CONNECTING",{enumerable:!0,value:Wr.indexOf("CONNECTING")});Object.defineProperty(Ve,"OPEN",{enumerable:!0,value:Wr.indexOf("OPEN")});Object.defineProperty(Ve.prototype,"OPEN",{enumerable:!0,value:Wr.indexOf("OPEN")});Object.defineProperty(Ve,"CLOSING",{enumerable:!0,value:Wr.indexOf("CLOSING")});Object.defineProperty(Ve.prototype,"CLOSING",{enumerable:!0,value:Wr.indexOf("CLOSING")});Object.defineProperty(Ve,"CLOSED",{enumerable:!0,value:Wr.indexOf("CLOSED")});Object.defineProperty(Ve.prototype,"CLOSED",{enumerable:!0,value:Wr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Ve.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Ve.prototype,`on${e}`,{enumerable:!0,get(){let t=this.listeners(e);for(let r=0;r<t.length;r++)if(t[r]._listener)return t[r]._listener},set(t){let r=this.listeners(e);for(let n=0;n<r.length;n++)r[n]._listener&&this.removeListener(e,r[n]);this.addEventListener(e,t)}})});Ve.prototype.addEventListener=v6;Ve.prototype.removeEventListener=E6;_x.exports=Ve;function mx(e,t,r,n){let i={protocolVersion:Kv[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!Kv.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Kv.join(", ")})`);let s;t instanceof $v?(s=t,e._url=t.href):(s=new $v(t),e._url=t);let o=s.protocol==="ws+unix:";if(!s.host&&(!o||!s.pathname)){let h=new Error(`Invalid URL: ${e.url}`);if(e._redirects===0)throw h;Hv(e,h);return}let a=s.protocol==="wss:"||s.protocol==="https:",c=a?443:80,u=d6(16).toString("base64"),l=a?u6.get:l6.get,d;if(i.createConnection=a?O6:w6,i.defaultPort=i.defaultPort||c,i.port=s.port||c,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket",...i.headers},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(d=new In(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=_6({[In.extensionName]:d.offer()})),r&&(i.headers["Sec-WebSocket-Protocol"]=r),i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),o){let h=i.path.split(":");i.socketPath=h[0],i.path=h[1]}if(i.followRedirects){if(e._redirects===0){e._originalUnixSocket=o,e._originalSecure=a,e._originalHostOrSocketPath=o?i.socketPath:s.host;let h=n&&n.headers;if(n={...n,headers:{}},h)for(let[g,y]of Object.entries(h))n.headers[g.toLowerCase()]=y}else{let h=o?e._originalUnixSocket?i.socketPath===e._originalHostOrSocketPath:!1:e._originalUnixSocket?!1:s.host===e._originalHostOrSocketPath;(!h||e._originalSecure&&!a)&&(delete i.headers.authorization,delete i.headers.cookie,h||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64"))}let p=e._req=l(i);i.timeout&&p.on("timeout",()=>{kt(e,p,"Opening handshake has timed out")}),p.on("error",h=>{p===null||p.aborted||(p=e._req=null,Hv(e,h))}),p.on("response",h=>{let g=h.headers.location,y=h.statusCode;if(g&&i.followRedirects&&y>=300&&y<400){if(++e._redirects>i.maxRedirects){kt(e,p,"Maximum redirects exceeded");return}p.abort();let E;try{E=new $v(g,t)}catch(S){Hv(e,S);return}mx(e,E,r,n)}else e.emit("unexpected-response",p,h)||kt(e,p,`Unexpected server response: ${h.statusCode}`)}),p.on("upgrade",(h,g,y)=>{if(e.emit("upgrade",h),e.readyState!==Ve.CONNECTING)return;p=e._req=null;let E=h.headers.upgrade;if(E===void 0||E.toLowerCase()!=="websocket"){kt(e,g,"Invalid Upgrade header");return}let S=p6("sha1").update(u+g6).digest("base64");if(h.headers["sec-websocket-accept"]!==S){kt(e,g,"Invalid Sec-WebSocket-Accept header");return}let _=h.headers["sec-websocket-protocol"],w=(r||"").split(/, */),I;if(!r&&_?I="Server sent a subprotocol but none was requested":r&&!_?I="Server sent no subprotocol":_&&!w.includes(_)&&(I="Server sent an invalid subprotocol"),I){kt(e,g,I);return}_&&(e._protocol=_);let T=h.headers["sec-websocket-extensions"];if(T!==void 0){if(!d){kt(e,g,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let N;try{N=S6(T)}catch{kt(e,g,"Invalid Sec-WebSocket-Extensions header");return}let P=Object.keys(N);if(P.length){if(P.length!==1||P[0]!==In.extensionName){kt(e,g,"Server indicated an extension that was not requested");return}try{d.accept(N[In.extensionName])}catch{kt(e,g,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[In.extensionName]=d}}e.setSocket(g,y,i.maxPayload,i.maxBufferedChunks,i.maxFragments)})}function Hv(e,t){e._readyState=Ve.CLOSING,e.emit("error",t),e.emitClose()}function w6(e){return e.path=e.socketPath,px.connect(e)}function O6(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=px.isIP(e.host)?"":e.host),f6.connect(e)}function kt(e,t,r){e._readyState=Ve.CLOSING;let n=new Error(r);Error.captureStackTrace(n,kt),t.setHeader?(t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),t.once("abort",e.emitClose.bind(e)),e.emit("error",n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function Qv(e,t,r){if(t){let n=b6(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${Wr[e.readyState]})`);r(n)}}function I6(e,t){let r=this[dt];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[dt]!==void 0&&(r._socket.removeListener("data",pf),process.nextTick(gx,r._socket),e===1005?r.close():r.close(e,t))}function A6(){this[dt]._socket.resume()}function N6(e){let t=this[dt];t._socket[dt]!==void 0&&(t._socket.removeListener("data",pf),process.nextTick(gx,t._socket),t.close(e[y6])),t.emit("error",e)}function dx(){this[dt].emitClose()}function C6(e){this[dt].emit("message",e)}function P6(e){let t=this[dt];t.pong(e,!t._isServer,hx),t.emit("ping",e)}function R6(e){this[dt].emit("pong",e)}function gx(e){e.resume()}function yx(){let e=this[dt];this.removeListener("close",yx),this.removeListener("data",pf),this.removeListener("end",vx),e._readyState=Ve.CLOSING;let t;!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null&&e._receiver.write(t),e._receiver.end(),this[dt]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",dx),e._receiver.on("finish",dx))}function pf(e){this[dt]._receiver.write(e)||this.pause()}function vx(){let e=this[dt];e._readyState=Ve.CLOSING,e._receiver.end(),this.end()}function Ex(){let e=this[dt];this.removeListener("error",Ex),this.on("error",hx),e&&(e._readyState=Ve.CLOSING,this.destroy())}});var wx=v((tEe,Tx)=>{"use strict";f();var{Duplex:x6}=k("stream");function Sx(e){e.emit("close")}function D6(){!this.destroyed&&this._writableState.finished&&this.destroy()}function bx(e){this.removeListener("error",bx),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function L6(e,t){let r=!0,n=!0;function i(){r&&e._socket.resume()}e.readyState===e.CONNECTING?e.once("open",function(){e._receiver.removeAllListeners("drain"),e._receiver.on("drain",i)}):(e._receiver.removeAllListeners("drain"),e._receiver.on("drain",i));let s=new x6({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(a){s.push(a)||(r=!1,e._socket.pause())}),e.once("error",function(a){s.destroyed||(n=!1,s.destroy(a))}),e.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(o,a){if(e.readyState===e.CLOSED){a(o),process.nextTick(Sx,s);return}let c=!1;e.once("error",function(l){c=!0,a(l)}),e.once("close",function(){c||a(o),process.nextTick(Sx,s)}),n&&e.terminate()},s._final=function(o){if(e.readyState===e.CONNECTING){e.once("open",function(){s._final(o)});return}e._socket!==null&&(e._socket._writableState.finished?(o(),s._readableState.endEmitted&&s.destroy()):(e._socket.once("finish",function(){o()}),e.close()))},s._read=function(){(e.readyState===e.OPEN||e.readyState===e.CLOSING)&&!r&&(r=!0,e._receiver._writableState.needDrain||e._socket.resume())},s._write=function(o,a,c){if(e.readyState===e.CONNECTING){e.once("open",function(){s._write(o,a,c)});return}e.send(o,c)},s.on("end",D6),s.on("error",bx),s}Tx.exports=L6});var Cx=v((oEe,Nx)=>{"use strict";f();var k6=k("events"),hf=k("http"),nEe=k("https"),iEe=k("net"),sEe=k("tls"),{createHash:j6}=k("crypto"),bi=La(),M6=Wv(),{format:q6,parse:F6}=Gv(),{GUID:U6,kWebSocket:V6}=_i(),G6=/^[+/0-9A-Za-z]{22}==$/,Ox=0,Ix=1,Ax=2,Jv=class extends k6{constructor(t,r){if(super(),t={maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=hf.createServer((n,i)=>{let s=hf.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=$6(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,n)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set),this.options=t,this._state=Ox}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(t&&this.once("close",t),this._state===Ax){process.nextTick(Yv,this);return}if(this._state===Ix)return;if(this._state=Ix,this.clients)for(let n of this.clients)n.terminate();let r=this._server;if(r&&(this._removeListeners(),this._removeListeners=this._server=null,this.options.port!=null)){r.close(Yv.bind(void 0,this));return}process.nextTick(Yv,this)}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,i){r.on("error",zv);let s=t.headers["sec-websocket-key"]!==void 0?t.headers["sec-websocket-key"].trim():!1,o=t.headers.upgrade,a=+t.headers["sec-websocket-version"],c={};if(t.method!=="GET"||o===void 0||o.toLowerCase()!=="websocket"||!s||!G6.test(s)||a!==8&&a!==13||!this.shouldHandle(t))return Ma(r,400);if(this.options.perMessageDeflate){let u=new bi(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let l=F6(t.headers["sec-websocket-extensions"]);l[bi.extensionName]&&(u.accept(l[bi.extensionName]),c[bi.extensionName]=u)}catch{return Ma(r,400)}}if(this.options.verifyClient){let u={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(u,(l,d,p,h)=>{if(!l)return Ma(r,d||401,p,h);this.completeUpgrade(s,c,t,r,n,i)});return}if(!this.options.verifyClient(u))return Ma(r,401)}this.completeUpgrade(s,c,t,r,n,i)}completeUpgrade(t,r,n,i,s,o){if(!i.readable||!i.writable)return i.destroy();if(i[V6])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Ox)return Ma(i,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${j6("sha1").update(t+U6).digest("base64")}`],u=new M6(null),l=n.headers["sec-websocket-protocol"];if(l&&(l=l.split(",").map(B6),this.options.handleProtocols?l=this.options.handleProtocols(l,n):l=l[0],l&&(c.push(`Sec-WebSocket-Protocol: ${l}`),u._protocol=l)),r[bi.extensionName]){let d=r[bi.extensionName].params,p=q6({[bi.extensionName]:[d]});c.push(`Sec-WebSocket-Extensions: ${p}`),u._extensions=r}this.emit("headers",c,n),i.write(c.concat(`\r
202
- `).join(`\r
203
- `)),i.removeListener("error",zv),u.setSocket(i,s,this.options.maxPayload,this.options.maxBufferedChunks,this.options.maxFragments),this.clients&&(this.clients.add(u),u.on("close",()=>this.clients.delete(u))),o(u,n)}};Nx.exports=Jv;function $6(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let n of Object.keys(t))e.removeListener(n,t[n])}}function Yv(e){e._state=Ax,e.emit("close")}function zv(){this.destroy()}function Ma(e,t,r,n){e.writable&&(r=r||hf.STATUS_CODES[t],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...n},e.write(`HTTP/1.1 ${t} ${hf.STATUS_CODES[t]}\r
204
- `+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
205
- `)+`\r
206
- \r
207
- `+r)),e.removeListener("error",zv),e.destroy()}function B6(e){return e.trim()}});var Rx=v((cEe,Px)=>{"use strict";f();var qa=Wv();qa.createWebSocketStream=wx();qa.Server=Cx();qa.Receiver=kv();qa.Sender=Mv();Px.exports=qa});var sE=v(_t=>{"use strict";f();_t.isIterable=xx;_t.isArrayLike=gf;_t.isCollection=H6;_t.getIterator=eE;_t.getIteratorMethod=tE;_t.createIterator=Dx;_t.forEach=Q6;_t.isAsyncIterable=Y6;_t.getAsyncIterator=Lx;_t.getAsyncIteratorMethod=nE;_t.createAsyncIterator=kx;_t.forAwaitEach=J6;var mf=typeof Symbol=="function"?Symbol:void 0,Xv=mf&&mf.iterator,K6=_t.$$iterator=Xv||"@@iterator";function xx(e){return!!tE(e)}function gf(e){var t=e!=null&&e.length;return typeof t=="number"&&t>=0&&t%1===0}function H6(e){return Object(e)===e&&(gf(e)||xx(e))}function eE(e){var t=tE(e);if(t)return t.call(e)}function tE(e){if(e!=null){var t=Xv&&e[Xv]||e["@@iterator"];if(typeof t=="function")return t}}function Dx(e){if(e!=null){var t=eE(e);if(t)return t;if(gf(e))return new rE(e)}}function rE(e){this._o=e,this._i=0}rE.prototype[K6]=function(){return this};rE.prototype.next=function(){return this._o===void 0||this._i>=this._o.length?(this._o=void 0,{value:void 0,done:!0}):{value:this._o[this._i++],done:!1}};function Q6(e,t,r){if(e!=null){if(typeof e.forEach=="function")return e.forEach(t,r);var n=0,i=eE(e);if(i){for(var s;!(s=i.next()).done;)if(t.call(r,s.value,n++,e),n>9999999)throw new TypeError("Near-infinite iteration.")}else if(gf(e))for(;n<e.length;n++)e.hasOwnProperty(n)&&t.call(r,e[n],n,e)}}var Zv=mf&&mf.asyncIterator,W6=_t.$$asyncIterator=Zv||"@@asyncIterator";function Y6(e){return!!nE(e)}function Lx(e){var t=nE(e);if(t)return t.call(e)}function nE(e){if(e!=null){var t=Zv&&e[Zv]||e["@@asyncIterator"];if(typeof t=="function")return t}}function kx(e){if(e!=null){var t=Lx(e);if(t)return t;var r=Dx(e);if(r)return new Fa(r)}}function Fa(e){this._i=e}Fa.prototype[W6]=function(){return this};Fa.prototype.next=function(e){return iE(this._i,"next",e)};Fa.prototype.return=function(e){return this._i.return?iE(this._i,"return",e):Promise.resolve({value:e,done:!0})};Fa.prototype.throw=function(e){return this._i.throw?iE(this._i,"throw",e):Promise.reject(e)};function iE(e,t,r){var n;return new Promise(function(i){n=e[t](r),i(n.value)}).then(function(i){return{value:i,done:n.done}})}function J6(e,t,r){var n=kx(e);if(n){var i=0;return new Promise(function(s,o){function a(){return n.next().then(function(c){return c.done?s():Promise.resolve(t.call(r,c.value,i++,e)).then(a).catch(o),null}).catch(o),null}a()})}}});var jx=v(yf=>{"use strict";f();Object.defineProperty(yf,"__esModule",{value:!0});yf.createEmptyIterable=void 0;var z6=sE(),X6=function(){var e;return e={next:function(){return Promise.resolve({value:void 0,done:!0})},return:function(){return Promise.resolve({value:void 0,done:!0})},throw:function(t){return Promise.reject(t)}},e[z6.$$asyncIterator]=function(){return this},e};yf.createEmptyIterable=X6});var Mx=v(vf=>{"use strict";f();Object.defineProperty(vf,"__esModule",{value:!0});vf.isASubscriptionOperation=void 0;var Z6=As(),eZ=function(e,t){var r=(0,Z6.getOperationAST)(e,t);return!!r&&r.operation==="subscription"};vf.isASubscriptionOperation=eZ});var qx=v(js=>{"use strict";f();var It=js&&js.__assign||function(){return It=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},It.apply(this,arguments)};Object.defineProperty(js,"__esModule",{value:!0});js.parseLegacyProtocolMessage=void 0;var pt=Pa(),tZ=function(e,t){var r=t;switch(t.type){case pt.default.INIT:e.isLegacy=!0,r=It(It({},t),{type:pt.default.GQL_CONNECTION_INIT});break;case pt.default.SUBSCRIPTION_START:r={id:t.id,type:pt.default.GQL_START,payload:{query:t.query,operationName:t.operationName,variables:t.variables}};break;case pt.default.SUBSCRIPTION_END:r=It(It({},t),{type:pt.default.GQL_STOP});break;case pt.default.GQL_CONNECTION_ACK:e.isLegacy&&(r=It(It({},t),{type:pt.default.INIT_SUCCESS}));break;case pt.default.GQL_CONNECTION_ERROR:e.isLegacy&&(r=It(It({},t),{type:pt.default.INIT_FAIL,payload:t.payload.message?{error:t.payload.message}:t.payload}));break;case pt.default.GQL_ERROR:e.isLegacy&&(r=It(It({},t),{type:pt.default.SUBSCRIPTION_FAIL}));break;case pt.default.GQL_DATA:e.isLegacy&&(r=It(It({},t),{type:pt.default.SUBSCRIPTION_DATA}));break;case pt.default.GQL_COMPLETE:e.isLegacy&&(r=null);break;case pt.default.SUBSCRIPTION_SUCCESS:e.isLegacy||(r=null);break;default:break}return r};js.parseLegacyProtocolMessage=tZ});var Vx=v(Ef=>{"use strict";f();Object.defineProperty(Ef,"__esModule",{value:!0});Ef.SubscriptionServer=void 0;var oE=Rx(),at=Pa(),Fx=cf(),rZ=Sv(),aE=As(),nZ=jx(),cE=sE(),iZ=Mx(),Ux=qx(),sZ=function(e){return e.on},oZ=(function(){function e(t,r){var n=this,i=t.onOperation,s=t.onOperationComplete,o=t.onConnect,a=t.onDisconnect,c=t.keepAlive;this.specifiedRules=t.validationRules||aE.specifiedRules,this.loadExecutor(t),this.onOperation=i,this.onOperationComplete=s,this.onConnect=o,this.onDisconnect=a,this.keepAlive=c,sZ(r)?this.wsServer=r:this.wsServer=new oE.Server(r||{});var u=(function(l,d){if(l.upgradeReq=d,l.protocol===void 0||l.protocol.indexOf(Fx.GRAPHQL_WS)===-1&&l.protocol.indexOf(Fx.GRAPHQL_SUBSCRIPTIONS)===-1){l.close(1002);return}var p=Object.create(null);p.initPromise=Promise.resolve(!0),p.isLegacy=!1,p.socket=l,p.request=d,p.operations={};var h=function(g){g&&(n.sendError(p,"",{message:g.message?g.message:g},at.default.GQL_CONNECTION_ERROR),setTimeout(function(){p.socket.close(1011)},10)),n.onClose(p),n.onDisconnect&&n.onDisconnect(l,p)};l.on("error",h),l.on("close",h),l.on("message",n.onMessage(p))});this.wsServer.on("connection",u),this.closeHandler=function(){n.wsServer.removeListener("connection",u),n.wsServer.close()}}return e.create=function(t,r){return new e(t,r)},Object.defineProperty(e.prototype,"server",{get:function(){return this.wsServer},enumerable:!1,configurable:!0}),e.prototype.close=function(){this.closeHandler()},e.prototype.loadExecutor=function(t){var r=t.execute,n=t.subscribe,i=t.schema,s=t.rootValue;if(!r)throw new Error("Must provide `execute` for websocket server constructor.");this.schema=i,this.rootValue=s,this.execute=r,this.subscribe=n},e.prototype.unsubscribe=function(t,r){t.operations&&t.operations[r]&&(t.operations[r].return&&t.operations[r].return(),delete t.operations[r],this.onOperationComplete&&this.onOperationComplete(t.socket,r))},e.prototype.onClose=function(t){var r=this;Object.keys(t.operations).forEach(function(n){r.unsubscribe(t,n)})},e.prototype.onMessage=function(t){var r=this;return function(n){var i;try{i=(0,Ux.parseLegacyProtocolMessage)(t,JSON.parse(n))}catch(o){r.sendError(t,null,{message:o.message},at.default.GQL_CONNECTION_ERROR);return}var s=i.id;switch(i.type){case at.default.GQL_CONNECTION_INIT:r.onConnect&&(t.initPromise=new Promise(function(o,a){try{o(r.onConnect(i.payload,t.socket,t))}catch(c){a(c)}})),t.initPromise.then(function(o){if(o===!1)throw new Error("Prohibited connection!");if(r.sendMessage(t,void 0,at.default.GQL_CONNECTION_ACK,void 0),r.keepAlive){r.sendKeepAlive(t);var a=setInterval(function(){t.socket.readyState===oE.OPEN?r.sendKeepAlive(t):clearInterval(a)},r.keepAlive)}}).catch(function(o){r.sendError(t,s,{message:o.message},at.default.GQL_CONNECTION_ERROR),setTimeout(function(){t.socket.close(1011)},10)});break;case at.default.GQL_CONNECTION_TERMINATE:t.socket.close();break;case at.default.GQL_START:t.initPromise.then(function(o){t.operations&&t.operations[s]&&r.unsubscribe(t,s);var a={query:i.payload.query,variables:i.payload.variables,operationName:i.payload.operationName,context:(0,rZ.default)(o)?Object.assign(Object.create(Object.getPrototypeOf(o)),o):{},formatResponse:void 0,formatError:void 0,callback:void 0,schema:r.schema},c=Promise.resolve(a);if(t.operations[s]=(0,nZ.createEmptyIterable)(),r.onOperation){var u=i;c=Promise.resolve(r.onOperation(u,a,t.socket))}return c.then(function(l){if(typeof l!="object"){var d="Invalid params returned from onOperation! return values must be an object!";throw r.sendError(t,s,{message:d}),new Error(d)}if(!l.schema){var d="Missing schema information. The GraphQL schema should be provided either statically in the `SubscriptionServer` constructor or as a property on the object returned from onOperation!";throw r.sendError(t,s,{message:d}),new Error(d)}var p=typeof a.query!="string"?a.query:(0,aE.parse)(a.query),h,g=(0,aE.validate)(l.schema,p,r.specifiedRules);if(g.length>0)h=Promise.resolve({errors:g});else{var y=r.execute;r.subscribe&&(0,iZ.isASubscriptionOperation)(p,l.operationName)&&(y=r.subscribe),h=Promise.resolve(y({schema:l.schema,document:p,rootValue:r.rootValue,contextValue:l.context,variableValues:l.variables,operationName:l.operationName}))}return h.then(function(E){return{executionIterable:(0,cE.isAsyncIterable)(E)?E:(0,cE.createAsyncIterator)([E]),params:l}})}).then(function(l){var d=l.executionIterable,p=l.params;return(0,cE.forAwaitEach)(d,function(h){var g=h;if(p.formatResponse)try{g=p.formatResponse(h,p)}catch(y){console.error("Error in formatResponse function:",y)}r.sendMessage(t,s,at.default.GQL_DATA,g)}).then(function(){r.sendMessage(t,s,at.default.GQL_COMPLETE,null)}).catch(function(h){var g=h;if(p.formatError)try{g=p.formatError(h,p)}catch(y){console.error("Error in formatError function: ",y)}Object.keys(g).length===0&&(g={name:g.name,message:g.message}),r.sendError(t,s,g)}),d}).then(function(l){t.operations[s]=l}).then(function(){r.sendMessage(t,s,at.default.SUBSCRIPTION_SUCCESS,void 0)}).catch(function(l){l.errors?r.sendMessage(t,s,at.default.GQL_DATA,{errors:l.errors}):r.sendError(t,s,{message:l.message}),r.unsubscribe(t,s)})}).catch(function(o){r.sendError(t,s,{message:o.message}),r.unsubscribe(t,s)});break;case at.default.GQL_STOP:r.unsubscribe(t,s);break;default:r.sendError(t,s,{message:"Invalid message type!"})}}},e.prototype.sendKeepAlive=function(t){t.isLegacy?this.sendMessage(t,void 0,at.default.KEEP_ALIVE,void 0):this.sendMessage(t,void 0,at.default.GQL_CONNECTION_KEEP_ALIVE,void 0)},e.prototype.sendMessage=function(t,r,n,i){var s=(0,Ux.parseLegacyProtocolMessage)(t,{type:n,id:r,payload:i});s&&t.socket.readyState===oE.OPEN&&t.socket.send(JSON.stringify(s))},e.prototype.sendError=function(t,r,n,i){var s=i||at.default.GQL_ERROR;if([at.default.GQL_CONNECTION_ERROR,at.default.GQL_ERROR].indexOf(s)===-1)throw new Error("overrideDefaultErrorType should be one of the allowed error messages GQL_CONNECTION_ERROR or GQL_ERROR");this.sendMessage(t,r,s,n)},e})();Ef.SubscriptionServer=oZ});var Gx=v(dr=>{"use strict";f();var aZ=dr&&dr.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),uE=dr&&dr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&aZ(t,e,r)};Object.defineProperty(dr,"__esModule",{value:!0});dr.MessageTypes=void 0;uE(qR(),dr);uE(Vx(),dr);var cZ=Pa();Object.defineProperty(dr,"MessageTypes",{enumerable:!0,get:function(){return cZ.default}});uE(cf(),dr)});var Yr=v((bEe,Kx)=>{"use strict";f();var $x=["nodebuffer","arraybuffer","fragments"],Bx=typeof Blob<"u";Bx&&$x.push("blob");Kx.exports={BINARY_TYPES:$x,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Bx,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Ua=v((wEe,_f)=>{"use strict";f();var{EMPTY_BUFFER:uZ}=Yr(),lE=Buffer[Symbol.species];function lZ(e,t){if(e.length===0)return uZ;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let i=0;i<e.length;i++){let s=e[i];r.set(s,n),n+=s.length}return n<t?new lE(r.buffer,r.byteOffset,n):r}function Hx(e,t,r,n,i){for(let s=0;s<i;s++)r[n+s]=e[s]^t[s&3]}function Qx(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function fZ(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function fE(e){if(fE.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new lE(e):ArrayBuffer.isView(e)?t=new lE(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),fE.readOnly=!1),t}_f.exports={concat:lZ,mask:Hx,toArrayBuffer:fZ,toBuffer:fE,unmask:Qx};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=k("bufferutil");_f.exports.mask=function(t,r,n,i,s){s<48?Hx(t,r,n,i,s):e.mask(t,r,n,i,s)},_f.exports.unmask=function(t,r){t.length<32?Qx(t,r):e.unmask(t,r)}}catch{}});var Jx=v((IEe,Yx)=>{"use strict";f();var Wx=Symbol("kDone"),dE=Symbol("kRun"),pE=class{constructor(t){this[Wx]=()=>{this.pending--,this[dE]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[dE]()}[dE](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[Wx])}}};Yx.exports=pE});var Fs=v((NEe,eD)=>{"use strict";f();var Va=k("zlib"),zx=Ua(),dZ=Jx(),{kStatusCode:Xx}=Yr(),pZ=Buffer[Symbol.species],hZ=Buffer.from([0,0,255,255]),bf=Symbol("permessage-deflate"),Jr=Symbol("total-length"),Ms=Symbol("callback"),An=Symbol("buffers"),qs=Symbol("error"),Sf,hE=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Sf){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Sf=new dZ(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Ms];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let i=r[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=i})}),t}decompress(t,r,n){Sf.add(i=>{this._decompress(t,r,(s,o)=>{i(),n(s,o)})})}compress(t,r,n){Sf.add(i=>{this._compress(t,r,(s,o)=>{i(),n(s,o)})})}_decompress(t,r,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?Va.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Va.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[bf]=this,this._inflate[Jr]=0,this._inflate[An]=[],this._inflate.on("error",gZ),this._inflate.on("data",Zx)}this._inflate[Ms]=n,this._inflate.write(t),r&&this._inflate.write(hZ),this._inflate.flush(()=>{let s=this._inflate[qs];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=zx.concat(this._inflate[An],this._inflate[Jr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Jr]=0,this._inflate[An]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(t,r,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?Va.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Va.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[Jr]=0,this._deflate[An]=[],this._deflate.on("data",mZ)}this._deflate[Ms]=n,this._deflate.write(t),this._deflate.flush(Va.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=zx.concat(this._deflate[An],this._deflate[Jr]);r&&(s=new pZ(s.buffer,s.byteOffset,s.length-4)),this._deflate[Ms]=null,this._deflate[Jr]=0,this._deflate[An]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};eD.exports=hE;function mZ(e){this[An].push(e),this[Jr]+=e.length}function Zx(e){if(this[Jr]+=e.length,this[bf]._maxPayload<1||this[Jr]<=this[bf]._maxPayload){this[An].push(e);return}this[qs]=new RangeError("Max payload size exceeded"),this[qs].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[qs][Xx]=1009,this.removeListener("data",Zx),this.reset()}function gZ(e){if(this[bf]._inflate=null,this[qs]){this[Ms](this[qs]);return}e[Xx]=1007,this[Ms](e)}});var Us=v((PEe,Tf)=>{"use strict";f();var{isUtf8:tD}=k("buffer"),{hasBlob:yZ}=Yr(),vZ=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function EZ(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function mE(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function _Z(e){return yZ&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Tf.exports={isBlob:_Z,isValidStatusCode:EZ,isValidUTF8:mE,tokenChars:vZ};if(tD)Tf.exports.isValidUTF8=function(e){return e.length<24?mE(e):tD(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=k("utf-8-validate");Tf.exports.isValidUTF8=function(t){return t.length<32?mE(t):e(t)}}catch{}});var _E=v((xEe,cD)=>{"use strict";f();var{Writable:SZ}=k("stream"),rD=Fs(),{BINARY_TYPES:bZ,EMPTY_BUFFER:nD,kStatusCode:TZ,kWebSocket:wZ}=Yr(),{concat:gE,toArrayBuffer:OZ,unmask:IZ}=Ua(),{isValidStatusCode:AZ,isValidUTF8:iD}=Us(),wf=Buffer[Symbol.species],Zt=0,sD=1,oD=2,aD=3,yE=4,vE=5,Of=6,EE=class extends SZ{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||bZ[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[wZ]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Zt}_write(t,r,n){if(this._opcode===8&&this._state==Zt)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){n(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new wf(n.buffer,n.byteOffset+t,n.length-t),new wf(n.buffer,n.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],i=r.length-t;t>=n.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),i),this._buffers[0]=new wf(n.buffer,n.byteOffset+t,n.length-t)),t-=n.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case Zt:this.getInfo(t);break;case sD:this.getPayloadLength16(t);break;case oD:this.getPayloadLength64(t);break;case aD:this.getMask();break;case yE:this.getData(t);break;case vE:case Of:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(i);return}let n=(r[0]&64)===64;if(n&&!this._extensions[rD.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(i);return}this._payloadLength===126?this._state=sD:this._payloadLength===127?this._state=oD:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),n=r.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(i);return}this._payloadLength=n*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=aD:this._state=yE}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=yE}getData(t){let r=nD;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&IZ(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=vE,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let n=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(n);return}this._messageLength=this._totalPayloadLength,this._fragments.push(r)}this.dataMessage(t)}decompress(t,r){this._extensions[rD.extensionName].decompress(t,this._fin,(i,s)=>{if(i)return r(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(o);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let o=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");r(o);return}this._fragments.push(s)}this.dataMessage(r),this._state===Zt&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=Zt;return}let r=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=gE(n,r):this._binaryType==="arraybuffer"?i=OZ(gE(n,r)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=Zt):(this._state=Of,setImmediate(()=>{this.emit("message",i,!0),this._state=Zt,this.startLoop(t)}))}else{let i=gE(n,r);if(!this._skipUTF8Validation&&!iD(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._state===vE||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=Zt):(this._state=Of,setImmediate(()=>{this.emit("message",i,!1),this._state=Zt,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,nD),this.end();else{let n=t.readUInt16BE(0);if(!AZ(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(s);return}let i=new wf(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!iD(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=Zt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Zt):(this._state=Of,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Zt,this.startLoop(r)}))}createError(t,r,n,i,s){this._loop=!1,this._errored=!0;let o=new t(n?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(o,this.createError),o.code=s,o[TZ]=i,o}};cD.exports=EE});var TE=v((kEe,fD)=>{"use strict";f();var{Duplex:LEe}=k("stream"),{randomFillSync:NZ}=k("crypto"),{types:{isUint8Array:CZ}}=k("util"),uD=Fs(),{EMPTY_BUFFER:PZ,kWebSocket:RZ,NOOP:xZ}=Yr(),{isBlob:Vs,isValidStatusCode:DZ}=Us(),{mask:lD,toBuffer:Ti}=Ua(),er=Symbol("kByteLength"),LZ=Buffer.alloc(4),If=8*1024,wi,Gs=If,pr=0,kZ=1,jZ=2,SE=class e{constructor(t,r,n){this._extensions=r||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=pr,this.onerror=xZ,this[RZ]=void 0}static frame(t,r){let n,i=!1,s=2,o=!1;r.mask&&(n=r.maskBuffer||LZ,r.generateMask?r.generateMask(n):(Gs===If&&(wi===void 0&&(wi=Buffer.alloc(If)),NZ(wi,0,If),Gs=0),n[0]=wi[Gs++],n[1]=wi[Gs++],n[2]=wi[Gs++],n[3]=wi[Gs++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof t=="string"?(!r.mask||o)&&r[er]!==void 0?a=r[er]:(t=Buffer.from(t),a=t.length):(a=t.length,i=r.mask&&r.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let u=Buffer.allocUnsafe(i?a+s:s);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),r.mask?(u[1]|=128,u[s-4]=n[0],u[s-3]=n[1],u[s-2]=n[2],u[s-1]=n[3],o?[u,t]:i?(lD(t,n,u,s,a),[u]):(lD(t,n,t,0,a),[u,t])):[u,t]}close(t,r,n,i){let s;if(t===void 0)s=PZ;else{if(typeof t!="number"||!DZ(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(t,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");if(s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(t,0),typeof r=="string")s.write(r,2);else if(CZ(r))s.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let o={[er]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==pr?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(e.frame(s,o),i)}ping(t,r,n){let i,s;if(typeof t=="string"?(i=Buffer.byteLength(t),s=!1):Vs(t)?(i=t.size,s=!1):(t=Ti(t),i=t.length,s=Ti.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[er]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};Vs(t)?this._state!==pr?this.enqueue([this.getBlobData,t,!1,o,n]):this.getBlobData(t,!1,o,n):this._state!==pr?this.enqueue([this.dispatch,t,!1,o,n]):this.sendFrame(e.frame(t,o),n)}pong(t,r,n){let i,s;if(typeof t=="string"?(i=Buffer.byteLength(t),s=!1):Vs(t)?(i=t.size,s=!1):(t=Ti(t),i=t.length,s=Ti.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[er]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};Vs(t)?this._state!==pr?this.enqueue([this.getBlobData,t,!1,o,n]):this.getBlobData(t,!1,o,n):this._state!==pr?this.enqueue([this.dispatch,t,!1,o,n]):this.sendFrame(e.frame(t,o),n)}send(t,r,n){let i=this._extensions[uD.extensionName],s=r.binary?2:1,o=r.compress,a,c;typeof t=="string"?(a=Buffer.byteLength(t),c=!1):Vs(t)?(a=t.size,c=!1):(t=Ti(t),a=t.length,c=Ti.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),r.fin&&(this._firstFragment=!0);let u={[er]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};Vs(t)?this._state!==pr?this.enqueue([this.getBlobData,t,this._compress,u,n]):this.getBlobData(t,this._compress,u,n):this._state!==pr?this.enqueue([this.dispatch,t,this._compress,u,n]):this.dispatch(t,this._compress,u,n)}getBlobData(t,r,n,i){this._bufferedBytes+=n[er],this._state=jZ,t.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(bE,this,a,i);return}this._bufferedBytes-=n[er];let o=Ti(s);r?this.dispatch(o,r,n,i):(this._state=pr,this.sendFrame(e.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(MZ,this,s,i)})}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let s=this._extensions[uD.extensionName];this._bufferedBytes+=n[er],this._state=kZ,s.compress(t,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");bE(this,c,i);return}this._bufferedBytes-=n[er],this._state=pr,n.readOnly=!1,this.sendFrame(e.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===pr&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][er],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][er],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};fD.exports=SE;function bE(e,t,r){typeof r=="function"&&r(t);for(let n=0;n<e._queue.length;n++){let i=e._queue[n],s=i[i.length-1];typeof s=="function"&&s(t)}}function MZ(e,t,r){bE(e,t,r),e.onerror(t)}});var _D=v((MEe,ED)=>{"use strict";f();var{kForOnEventAttribute:Ga,kListener:wE}=Yr(),dD=Symbol("kCode"),pD=Symbol("kData"),hD=Symbol("kError"),mD=Symbol("kMessage"),gD=Symbol("kReason"),$s=Symbol("kTarget"),yD=Symbol("kType"),vD=Symbol("kWasClean"),zr=class{constructor(t){this[$s]=null,this[yD]=t}get target(){return this[$s]}get type(){return this[yD]}};Object.defineProperty(zr.prototype,"target",{enumerable:!0});Object.defineProperty(zr.prototype,"type",{enumerable:!0});var Oi=class extends zr{constructor(t,r={}){super(t),this[dD]=r.code===void 0?0:r.code,this[gD]=r.reason===void 0?"":r.reason,this[vD]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[dD]}get reason(){return this[gD]}get wasClean(){return this[vD]}};Object.defineProperty(Oi.prototype,"code",{enumerable:!0});Object.defineProperty(Oi.prototype,"reason",{enumerable:!0});Object.defineProperty(Oi.prototype,"wasClean",{enumerable:!0});var Bs=class extends zr{constructor(t,r={}){super(t),this[hD]=r.error===void 0?null:r.error,this[mD]=r.message===void 0?"":r.message}get error(){return this[hD]}get message(){return this[mD]}};Object.defineProperty(Bs.prototype,"error",{enumerable:!0});Object.defineProperty(Bs.prototype,"message",{enumerable:!0});var $a=class extends zr{constructor(t,r={}){super(t),this[pD]=r.data===void 0?null:r.data}get data(){return this[pD]}};Object.defineProperty($a.prototype,"data",{enumerable:!0});var qZ={addEventListener(e,t,r={}){for(let i of this.listeners(e))if(!r[Ga]&&i[wE]===t&&!i[Ga])return;let n;if(e==="message")n=function(s,o){let a=new $a("message",{data:o?s:s.toString()});a[$s]=this,Af(t,this,a)};else if(e==="close")n=function(s,o){let a=new Oi("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[$s]=this,Af(t,this,a)};else if(e==="error")n=function(s){let o=new Bs("error",{error:s,message:s.message});o[$s]=this,Af(t,this,o)};else if(e==="open")n=function(){let s=new zr("open");s[$s]=this,Af(t,this,s)};else return;n[Ga]=!!r[Ga],n[wE]=t,r.once?this.once(e,n):this.on(e,n)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[wE]===t&&!r[Ga]){this.removeListener(e,r);break}}};ED.exports={CloseEvent:Oi,ErrorEvent:Bs,Event:zr,EventTarget:qZ,MessageEvent:$a};function Af(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var Nf=v((FEe,SD)=>{"use strict";f();var{tokenChars:Ba}=Us();function Rr(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function FZ(e){let t=Object.create(null),r=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,u=-1,l=-1,d=0;for(;d<e.length;d++)if(u=e.charCodeAt(d),o===void 0)if(l===-1&&Ba[u]===1)c===-1&&(c=d);else if(d!==0&&(u===32||u===9))l===-1&&c!==-1&&(l=d);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let h=e.slice(c,l);u===44?(Rr(t,h,r),r=Object.create(null)):o=h,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);else if(a===void 0)if(l===-1&&Ba[u]===1)c===-1&&(c=d);else if(u===32||u===9)l===-1&&c!==-1&&(l=d);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d),Rr(r,e.slice(c,l),!0),u===44&&(Rr(t,o,r),r=Object.create(null),o=void 0),c=l=-1}else if(u===61&&c!==-1&&l===-1)a=e.slice(c,d),c=l=-1;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(i){if(Ba[u]!==1)throw new SyntaxError(`Unexpected character at index ${d}`);c===-1?c=d:n||(n=!0),i=!1}else if(s)if(Ba[u]===1)c===-1&&(c=d);else if(u===34&&c!==-1)s=!1,l=d;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(u===34&&e.charCodeAt(d-1)===61)s=!0;else if(l===-1&&Ba[u]===1)c===-1&&(c=d);else if(c!==-1&&(u===32||u===9))l===-1&&(l=d);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let h=e.slice(c,l);n&&(h=h.replace(/\\/g,""),n=!1),Rr(r,a,h),u===44&&(Rr(t,o,r),r=Object.create(null),o=void 0),a=void 0,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);if(c===-1||s||u===32||u===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=d);let p=e.slice(c,l);return o===void 0?Rr(t,p,r):(a===void 0?Rr(r,p,!0):n?Rr(r,a,p.replace(/\\/g,"")):Rr(r,a,p),Rr(t,o,r)),t}function UZ(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}SD.exports={format:UZ,parse:FZ}});var xf=v(($Ee,DD)=>{"use strict";f();var VZ=k("events"),GZ=k("https"),$Z=k("http"),wD=k("net"),BZ=k("tls"),{randomBytes:KZ,createHash:HZ}=k("crypto"),{Duplex:VEe,Readable:GEe}=k("stream"),{URL:OE}=k("url"),Nn=Fs(),QZ=_E(),WZ=TE(),{isBlob:YZ}=Us(),{BINARY_TYPES:bD,CLOSE_TIMEOUT:JZ,EMPTY_BUFFER:Cf,GUID:zZ,kForOnEventAttribute:IE,kListener:XZ,kStatusCode:ZZ,kWebSocket:et,NOOP:OD}=Yr(),{EventTarget:{addEventListener:e9,removeEventListener:t9}}=_D(),{format:r9,parse:n9}=Nf(),{toBuffer:i9}=Ua(),ID=Symbol("kAborted"),AE=[8,13],Xr=["CONNECTING","OPEN","CLOSING","CLOSED"],s9=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,xe=class e extends VZ{constructor(t,r,n){super(),this._binaryType=bD[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Cf,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(n=r,r=[]):r=[r]),AD(this,t,r,n)):(this._autoPong=n.autoPong,this._closeTimeout=n.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){bD.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,n){let i=new QZ({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new WZ(t,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=t,i[et]=this,s[et]=this,t[et]=this,i.on("conclude",c9),i.on("drain",u9),i.on("error",l9),i.on("message",f9),i.on("ping",d9),i.on("pong",p9),s.onerror=h9,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",PD),t.on("data",Rf),t.on("end",RD),t.on("error",xD),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Nn.extensionName]&&this._extensions[Nn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){jt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),CD(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){NE(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Cf,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){NE(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Cf,r,n)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){NE(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[Nn.extensionName]||(i.compress=!1),this._sender.send(t||Cf,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){jt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(xe,"CONNECTING",{enumerable:!0,value:Xr.indexOf("CONNECTING")});Object.defineProperty(xe.prototype,"CONNECTING",{enumerable:!0,value:Xr.indexOf("CONNECTING")});Object.defineProperty(xe,"OPEN",{enumerable:!0,value:Xr.indexOf("OPEN")});Object.defineProperty(xe.prototype,"OPEN",{enumerable:!0,value:Xr.indexOf("OPEN")});Object.defineProperty(xe,"CLOSING",{enumerable:!0,value:Xr.indexOf("CLOSING")});Object.defineProperty(xe.prototype,"CLOSING",{enumerable:!0,value:Xr.indexOf("CLOSING")});Object.defineProperty(xe,"CLOSED",{enumerable:!0,value:Xr.indexOf("CLOSED")});Object.defineProperty(xe.prototype,"CLOSED",{enumerable:!0,value:Xr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(xe.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(xe.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[IE])return t[XZ];return null},set(t){for(let r of this.listeners(e))if(r[IE]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[IE]:!0})}})});xe.prototype.addEventListener=e9;xe.prototype.removeEventListener=t9;DD.exports=xe;function AD(e,t,r,n){let i={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:JZ,protocolVersion:AE[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=i.autoPong,e._closeTimeout=i.closeTimeout,!AE.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${AE.join(", ")})`);let s;if(t instanceof OE)s=t;else try{s=new OE(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),e._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let y=new SyntaxError(c);if(e._redirects===0)throw y;Pf(e,y);return}let u=o?443:80,l=KZ(16).toString("base64"),d=o?GZ.request:$Z.request,p=new Set,h;if(i.createConnection=i.createConnection||(o?a9:o9),i.defaultPort=i.defaultPort||u,i.port=s.port||u,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(h=new Nn({...i.perMessageDeflate,isServer:!1,maxPayload:i.maxPayload}),i.headers["Sec-WebSocket-Extensions"]=r9({[Nn.extensionName]:h.offer()})),r.length){for(let y of r){if(typeof y!="string"||!s9.test(y)||p.has(y))throw new SyntaxError("An invalid or duplicated subprotocol was specified");p.add(y)}i.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),a){let y=i.path.split(":");i.socketPath=y[0],i.path=y[1]}let g;if(i.followRedirects){if(e._redirects===0){e._originalIpc=a,e._originalSecure=o,e._originalHostOrSocketPath=a?i.socketPath:s.host;let y=n&&n.headers;if(n={...n,headers:{}},y)for(let[E,S]of Object.entries(y))n.headers[E.toLowerCase()]=S}else if(e.listenerCount("redirect")===0){let y=a?e._originalIpc?i.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:s.host===e._originalHostOrSocketPath;(!y||e._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,y||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),g=e._req=d(i),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=d(i);i.timeout&&g.on("timeout",()=>{jt(e,g,"Opening handshake has timed out")}),g.on("error",y=>{g===null||g[ID]||(g=e._req=null,Pf(e,y))}),g.on("response",y=>{let E=y.headers.location,S=y.statusCode;if(E&&i.followRedirects&&S>=300&&S<400){if(++e._redirects>i.maxRedirects){jt(e,g,"Maximum redirects exceeded");return}g.abort();let _;try{_=new OE(E,t)}catch{let I=new SyntaxError(`Invalid URL: ${E}`);Pf(e,I);return}AD(e,_,r,n)}else e.emit("unexpected-response",g,y)||jt(e,g,`Unexpected server response: ${y.statusCode}`)}),g.on("upgrade",(y,E,S)=>{if(e.emit("upgrade",y),e.readyState!==xe.CONNECTING)return;g=e._req=null;let _=y.headers.upgrade;if(_===void 0||_.toLowerCase()!=="websocket"){jt(e,E,"Invalid Upgrade header");return}let w=HZ("sha1").update(l+zZ).digest("base64");if(y.headers["sec-websocket-accept"]!==w){jt(e,E,"Invalid Sec-WebSocket-Accept header");return}let I=y.headers["sec-websocket-protocol"],T;if(I!==void 0?p.size?p.has(I)||(T="Server sent an invalid subprotocol"):T="Server sent a subprotocol but none was requested":p.size&&(T="Server sent no subprotocol"),T){jt(e,E,T);return}I&&(e._protocol=I);let N=y.headers["sec-websocket-extensions"];if(N!==void 0){if(!h){jt(e,E,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let P;try{P=n9(N)}catch{jt(e,E,"Invalid Sec-WebSocket-Extensions header");return}let O=Object.keys(P);if(O.length!==1||O[0]!==Nn.extensionName){jt(e,E,"Server indicated an extension that was not requested");return}try{h.accept(P[Nn.extensionName])}catch{jt(e,E,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Nn.extensionName]=h}e.setSocket(E,S,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(g,e):g.end()}function Pf(e,t){e._readyState=xe.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function o9(e){return e.path=e.socketPath,wD.connect(e)}function a9(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=wD.isIP(e.host)?"":e.host),BZ.connect(e)}function jt(e,t,r){e._readyState=xe.CLOSING;let n=new Error(r);Error.captureStackTrace(n,jt),t.setHeader?(t[ID]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Pf,e,n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function NE(e,t,r){if(t){let n=YZ(t)?t.size:i9(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${Xr[e.readyState]})`);process.nextTick(r,n)}}function c9(e,t){let r=this[et];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[et]!==void 0&&(r._socket.removeListener("data",Rf),process.nextTick(ND,r._socket),e===1005?r.close():r.close(e,t))}function u9(){let e=this[et];e.isPaused||e._socket.resume()}function l9(e){let t=this[et];t._socket[et]!==void 0&&(t._socket.removeListener("data",Rf),process.nextTick(ND,t._socket),t.close(e[ZZ])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function TD(){this[et].emitClose()}function f9(e,t){this[et].emit("message",e,t)}function d9(e){let t=this[et];t._autoPong&&t.pong(e,!this._isServer,OD),t.emit("ping",e)}function p9(e){this[et].emit("pong",e)}function ND(e){e.resume()}function h9(e){let t=this[et];t.readyState!==xe.CLOSED&&(t.readyState===xe.OPEN&&(t._readyState=xe.CLOSING,CD(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function CD(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function PD(){let e=this[et];if(this.removeListener("close",PD),this.removeListener("data",Rf),this.removeListener("end",RD),e._readyState=xe.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[et]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",TD),e._receiver.on("finish",TD))}function Rf(e){this[et]._receiver.write(e)||this.pause()}function RD(){let e=this[et];e._readyState=xe.CLOSING,e._receiver.end(),this.end()}function xD(){let e=this[et];this.removeListener("error",xD),this.on("error",OD),e&&(e._readyState=xe.CLOSING,this.destroy())}});var MD=v((HEe,jD)=>{"use strict";f();var KEe=xf(),{Duplex:m9}=k("stream");function LD(e){e.emit("close")}function g9(){!this.destroyed&&this._writableState.finished&&this.destroy()}function kD(e){this.removeListener("error",kD),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function y9(e,t){let r=!0,n=new m9({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||e.pause()}),e.once("error",function(s){n.destroyed||(r=!1,n.destroy(s))}),e.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(e.readyState===e.CLOSED){s(i),process.nextTick(LD,n);return}let o=!1;e.once("error",function(c){o=!0,s(c)}),e.once("close",function(){o||s(i),process.nextTick(LD,n)}),r&&e.terminate()},n._final=function(i){if(e.readyState===e.CONNECTING){e.once("open",function(){n._final(i)});return}e._socket!==null&&(e._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(e._socket.once("finish",function(){i()}),e.close()))},n._read=function(){e.isPaused&&e.resume()},n._write=function(i,s,o){if(e.readyState===e.CONNECTING){e.once("open",function(){n._write(i,s,o)});return}e.send(i,o)},n.on("end",g9),n.on("error",kD),n}jD.exports=y9});var CE=v((WEe,qD)=>{"use strict";f();var{tokenChars:v9}=Us();function E9(e){let t=new Set,r=-1,n=-1,i=0;for(i;i<e.length;i++){let o=e.charCodeAt(i);if(n===-1&&v9[o]===1)r===-1&&(r=i);else if(i!==0&&(o===32||o===9))n===-1&&r!==-1&&(n=i);else if(o===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=e.slice(r,n);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);t.add(a),r=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(r===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=e.slice(r,i);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return t.add(s),t}qD.exports={parse:E9}});var KD=v((zEe,BD)=>{"use strict";f();var _9=k("events"),Df=k("http"),{Duplex:JEe}=k("stream"),{createHash:S9}=k("crypto"),FD=Nf(),Ii=Fs(),b9=CE(),T9=xf(),{CLOSE_TIMEOUT:w9,GUID:O9,kWebSocket:I9}=Yr(),A9=/^[+/0-9A-Za-z]{22}==$/,UD=0,VD=1,$D=2,PE=class extends _9{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:w9,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:T9,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Df.createServer((n,i)=>{let s=Df.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=N9(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,n)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=UD}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===$D){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(Ka,this);return}if(t&&this.once("close",t),this._state!==VD)if(this._state=VD,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Ka,this):process.nextTick(Ka,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{Ka(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,i){r.on("error",GD);let s=t.headers["sec-websocket-key"],o=t.headers.upgrade,a=+t.headers["sec-websocket-version"];if(t.method!=="GET"){Ai(this,t,r,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){Ai(this,t,r,400,"Invalid Upgrade header");return}if(s===void 0||!A9.test(s)){Ai(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Ai(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){Ha(r,400);return}let c=t.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=b9.parse(c)}catch{Ai(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let l=t.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&l!==void 0){let p=new Ii({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let h=FD.parse(l);h[Ii.extensionName]&&(p.accept(h[Ii.extensionName]),d[Ii.extensionName]=p)}catch{Ai(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let p={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(p,(h,g,y,E)=>{if(!h)return Ha(r,g||401,y,E);this.completeUpgrade(d,s,u,t,r,n,i)});return}if(!this.options.verifyClient(p))return Ha(r,401)}this.completeUpgrade(d,s,u,t,r,n,i)}completeUpgrade(t,r,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[I9])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>UD)return Ha(s,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${S9("sha1").update(r+O9).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(n.size){let d=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;d&&(u.push(`Sec-WebSocket-Protocol: ${d}`),l._protocol=d)}if(t[Ii.extensionName]){let d=t[Ii.extensionName].params,p=FD.format({[Ii.extensionName]:[d]});u.push(`Sec-WebSocket-Extensions: ${p}`),l._extensions=t}this.emit("headers",u,i),s.write(u.concat(`\r
208
- `).join(`\r
209
- `)),s.removeListener("error",GD),l.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Ka,this)})),a(l,i)}};BD.exports=PE;function N9(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let n of Object.keys(t))e.removeListener(n,t[n])}}function Ka(e){e._state=$D,e.emit("close")}function GD(){this.destroy()}function Ha(e,t,r,n){r=r||Df.STATUS_CODES[t],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...n},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${Df.STATUS_CODES[t]}\r
210
- `+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
211
- `)+`\r
212
- \r
213
- `+r)}function Ai(e,t,r,n,i,s){if(e.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,Ai),e.emit("wsClientError",o,r,t)}else Ha(r,n,i,s)}});var ue=v(ct=>{"use strict";f();var o_=Symbol.for("yaml.alias"),Lk=Symbol.for("yaml.document"),Zf=Symbol.for("yaml.map"),kk=Symbol.for("yaml.pair"),a_=Symbol.for("yaml.scalar"),ed=Symbol.for("yaml.seq"),Zr=Symbol.for("yaml.node.type"),yte=e=>!!e&&typeof e=="object"&&e[Zr]===o_,vte=e=>!!e&&typeof e=="object"&&e[Zr]===Lk,Ete=e=>!!e&&typeof e=="object"&&e[Zr]===Zf,_te=e=>!!e&&typeof e=="object"&&e[Zr]===kk,jk=e=>!!e&&typeof e=="object"&&e[Zr]===a_,Ste=e=>!!e&&typeof e=="object"&&e[Zr]===ed;function Mk(e){if(e&&typeof e=="object")switch(e[Zr]){case Zf:case ed:return!0}return!1}function bte(e){if(e&&typeof e=="object")switch(e[Zr]){case o_:case Zf:case a_:case ed:return!0}return!1}var Tte=e=>(jk(e)||Mk(e))&&!!e.anchor;ct.ALIAS=o_;ct.DOC=Lk;ct.MAP=Zf;ct.NODE_TYPE=Zr;ct.PAIR=kk;ct.SCALAR=a_;ct.SEQ=ed;ct.hasAnchor=Tte;ct.isAlias=yte;ct.isCollection=Mk;ct.isDocument=vte;ct.isMap=Ete;ct.isNode=bte;ct.isPair=_te;ct.isScalar=jk;ct.isSeq=Ste});var ic=v(c_=>{"use strict";f();var Xe=ue(),At=Symbol("break visit"),qk=Symbol("skip children"),xr=Symbol("remove node");function td(e,t){let r=Fk(t);Xe.isDocument(e)?Js(null,e.contents,r,Object.freeze([e]))===xr&&(e.contents=null):Js(null,e,r,Object.freeze([]))}td.BREAK=At;td.SKIP=qk;td.REMOVE=xr;function Js(e,t,r,n){let i=Uk(e,t,r,n);if(Xe.isNode(i)||Xe.isPair(i))return Vk(e,n,i),Js(e,i,r,n);if(typeof i!="symbol"){if(Xe.isCollection(t)){n=Object.freeze(n.concat(t));for(let s=0;s<t.items.length;++s){let o=Js(s,t.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===At)return At;o===xr&&(t.items.splice(s,1),s-=1)}}}else if(Xe.isPair(t)){n=Object.freeze(n.concat(t));let s=Js("key",t.key,r,n);if(s===At)return At;s===xr&&(t.key=null);let o=Js("value",t.value,r,n);if(o===At)return At;o===xr&&(t.value=null)}}return i}async function rd(e,t){let r=Fk(t);Xe.isDocument(e)?await zs(null,e.contents,r,Object.freeze([e]))===xr&&(e.contents=null):await zs(null,e,r,Object.freeze([]))}rd.BREAK=At;rd.SKIP=qk;rd.REMOVE=xr;async function zs(e,t,r,n){let i=await Uk(e,t,r,n);if(Xe.isNode(i)||Xe.isPair(i))return Vk(e,n,i),zs(e,i,r,n);if(typeof i!="symbol"){if(Xe.isCollection(t)){n=Object.freeze(n.concat(t));for(let s=0;s<t.items.length;++s){let o=await zs(s,t.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===At)return At;o===xr&&(t.items.splice(s,1),s-=1)}}}else if(Xe.isPair(t)){n=Object.freeze(n.concat(t));let s=await zs("key",t.key,r,n);if(s===At)return At;s===xr&&(t.key=null);let o=await zs("value",t.value,r,n);if(o===At)return At;o===xr&&(t.value=null)}}return i}function Fk(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Uk(e,t,r,n){if(typeof r=="function")return r(e,t,n);if(Xe.isMap(t))return r.Map?.(e,t,n);if(Xe.isSeq(t))return r.Seq?.(e,t,n);if(Xe.isPair(t))return r.Pair?.(e,t,n);if(Xe.isScalar(t))return r.Scalar?.(e,t,n);if(Xe.isAlias(t))return r.Alias?.(e,t,n)}function Vk(e,t,r){let n=t[t.length-1];if(Xe.isCollection(n))n.items[e]=r;else if(Xe.isPair(n))e==="key"?n.key=r:n.value=r;else if(Xe.isDocument(n))n.contents=r;else{let i=Xe.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}c_.visit=td;c_.visitAsync=rd});var u_=v($k=>{"use strict";f();var Gk=ue(),wte=ic(),Ote={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ite=e=>e.replace(/[!,[\]{}]/g,t=>Ote[t]),sc=class e{constructor(t,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,r)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,r){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let n=t.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,o]=n;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,o),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(t,r){if(t==="!")return"!";if(t[0]!=="!")return r(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let o=t.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,n,i]=t.match(/^(.*!)([^!]*)$/s);i||r(`The ${t} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(o){return r(String(o)),null}return n==="!"?t:(r(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[r,n]of Object.entries(this.tags))if(t.startsWith(n))return r+Ite(t.substring(n.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(t&&n.length>0&&Gk.isNode(t.contents)){let s={};wte.visit(t.contents,(o,a)=>{Gk.isNode(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of n)s==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(a=>a.startsWith(o)))&&r.push(`%TAG ${s} ${o}`);return r.join(`
214
- `)}};sc.defaultYaml={explicit:!1,version:"1.2"};sc.defaultTags={"!!":"tag:yaml.org,2002:"};$k.Directives=sc});var nd=v(oc=>{"use strict";f();var Bk=ue(),Ate=ic();function Nte(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(r)}return!0}function Kk(e){let t=new Set;return Ate.visit(e,{Value(r,n){n.anchor&&t.add(n.anchor)}}),t}function Hk(e,t){for(let r=1;;++r){let n=`${e}${r}`;if(!t.has(n))return n}}function Cte(e,t){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=Kk(e));let o=Hk(t,i);return i.add(o),o},setAnchors:()=>{for(let s of r){let o=n.get(s);if(typeof o=="object"&&o.anchor&&(Bk.isScalar(o.node)||Bk.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:n}}oc.anchorIsValid=Nte;oc.anchorNames=Kk;oc.createNodeAnchors=Cte;oc.findNewAnchor=Hk});var l_=v(Qk=>{"use strict";f();function ac(e,t,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let o=n[i],a=ac(e,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),o=ac(e,n,i,s);o===void 0?n.delete(i):o!==s&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let s=ac(e,n,i,i);s===void 0?n.delete(i):s!==i&&(n.delete(i),n.add(s))}else for(let[i,s]of Object.entries(n)){let o=ac(e,n,i,s);o===void 0?delete n[i]:o!==s&&(n[i]=o)}return e.call(t,r,n)}Qk.applyReviver=ac});var Dn=v(Yk=>{"use strict";f();var Pte=ue();function Wk(e,t,r){if(Array.isArray(e))return e.map((n,i)=>Wk(n,String(i),r));if(e&&typeof e.toJSON=="function"){if(!r||!Pte.hasAnchor(e))return e.toJSON(t,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=e.toJSON(t,r);return r.onCreate&&r.onCreate(i),i}return typeof e=="bigint"&&!r?.keep?Number(e):e}Yk.toJS=Wk});var id=v(zk=>{"use strict";f();var Rte=l_(),Jk=ue(),xte=Dn(),f_=class{constructor(t){Object.defineProperty(this,Jk.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!Jk.isDocument(t))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:t,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=xte.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:u}of o.anchors.values())i(u,c);return typeof s=="function"?Rte.applyReviver(s,{"":a},"",a):a}};zk.NodeBase=f_});var cc=v(Xk=>{"use strict";f();var Dte=nd(),Lte=ic(),Xs=ue(),kte=id(),jte=Dn(),d_=class extends kte.NodeBase{constructor(t){super(Xs.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Lte.visit(t,{Node:(s,o)=>{(Xs.isAlias(o)||Xs.hasAnchor(o))&&n.push(o)}}),r&&(r.aliasResolveCache=n));let i;for(let s of n){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(t,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=r,o=this.resolve(i,r);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(o);if(a||(jte.toJS(o,null,r),a=n.get(o)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=sd(i,o,n)),a.count*a.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(t,r,n){let i=`*${this.source}`;if(t){if(Dte.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}};function sd(e,t,r){if(Xs.isAlias(t)){let n=t.resolve(e),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Xs.isCollection(t)){let n=0;for(let i of t.items){let s=sd(e,i,r);s>n&&(n=s)}return n}else if(Xs.isPair(t)){let n=sd(e,t.key,r),i=sd(e,t.value,r);return Math.max(n,i)}return 1}Xk.Alias=d_});var Ke=v(p_=>{"use strict";f();var Mte=ue(),qte=id(),Fte=Dn(),Ute=e=>!e||typeof e!="function"&&typeof e!="object",Ln=class extends qte.NodeBase{constructor(t){super(Mte.SCALAR),this.value=t}toJSON(t,r){return r?.keep?this.value:Fte.toJS(this.value,t,r)}toString(){return String(this.value)}};Ln.BLOCK_FOLDED="BLOCK_FOLDED";Ln.BLOCK_LITERAL="BLOCK_LITERAL";Ln.PLAIN="PLAIN";Ln.QUOTE_DOUBLE="QUOTE_DOUBLE";Ln.QUOTE_SINGLE="QUOTE_SINGLE";p_.Scalar=Ln;p_.isScalarValue=Ute});var uc=v(ej=>{"use strict";f();var Vte=cc(),Pi=ue(),Zk=Ke(),Gte="tag:yaml.org,2002:";function $te(e,t,r){if(t){let n=r.filter(s=>s.tag===t),i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return r.find(n=>n.identify?.(e)&&!n.format)}function Bte(e,t,r){if(Pi.isDocument(e)&&(e=e.contents),Pi.isNode(e))return e;if(Pi.isPair(e)){let d=r.schema[Pi.MAP].createNode?.(r.schema,null,r);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=r,c;if(n&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=i(e)),new Vte.Alias(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=Gte+t.slice(2));let u=$te(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new Zk.Scalar(e);return c&&(c.node=d),d}u=e instanceof Map?o[Pi.MAP]:Symbol.iterator in Object(e)?o[Pi.SEQ]:o[Pi.MAP]}s&&(s(u),delete r.onTagObj);let l=u?.createNode?u.createNode(r.schema,e,r):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(r.schema,e,r):new Zk.Scalar(e);return t?l.tag=t:u.default||(l.tag=u.tag),c&&(c.node=l),l}ej.createNode=Bte});var ad=v(od=>{"use strict";f();var Kte=uc(),Dr=ue(),Hte=id();function h_(e,t,r){let n=r;for(let i=t.length-1;i>=0;--i){let s=t[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=n,n=o}else n=new Map([[s,n]])}return Kte.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var tj=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,m_=class extends Hte.NodeBase{constructor(t,r){super(t),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(t){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(r.schema=t),r.items=r.items.map(n=>Dr.isNode(n)||Dr.isPair(n)?n.clone(t):n),this.range&&(r.range=this.range.slice()),r}addIn(t,r){if(tj(t))this.add(r);else{let[n,...i]=t,s=this.get(n,!0);if(Dr.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,h_(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(t){let[r,...n]=t;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Dr.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(t,r){let[n,...i]=t,s=this.get(n,!0);return i.length===0?!r&&Dr.isScalar(s)?s.value:s:Dr.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(t){return this.items.every(r=>{if(!Dr.isPair(r))return!1;let n=r.value;return n==null||t&&Dr.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(t){let[r,...n]=t;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Dr.isCollection(i)?i.hasIn(n):!1}setIn(t,r){let[n,...i]=t;if(i.length===0)this.set(n,r);else{let s=this.get(n,!0);if(Dr.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,h_(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};od.Collection=m_;od.collectionFromPath=h_;od.isEmptyPath=tj});var lc=v(cd=>{"use strict";f();var Qte=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function g_(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Wte=(e,t,r)=>e.endsWith(`
215
- `)?g_(r,t):r.includes(`
216
- `)?`
217
- `+g_(r,t):(e.endsWith(" ")?"":" ")+r;cd.indentComment=g_;cd.lineComment=Wte;cd.stringifyComment=Qte});var nj=v(fc=>{"use strict";f();var Yte="flow",y_="block",ud="quoted";function Jte(e,t,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return e;i<s&&(s=0);let c=Math.max(1+s,1+i-t.length);if(e.length<=c)return e;let u=[],l={},d=i-t.length;typeof n=="number"&&(n>i-Math.max(2,s)?u.push(0):d=i-n);let p,h,g=!1,y=-1,E=-1,S=-1;r===y_&&(y=rj(e,y,t.length),y!==-1&&(d=y+c));for(let w;w=e[y+=1];){if(r===ud&&w==="\\"){switch(E=y,e[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}S=y}if(w===`
218
- `)r===y_&&(y=rj(e,y,t.length)),d=y+t.length+c,p=void 0;else{if(w===" "&&h&&h!==" "&&h!==`
219
- `&&h!==" "){let I=e[y+1];I&&I!==" "&&I!==`
220
- `&&I!==" "&&(p=y)}if(y>=d)if(p)u.push(p),d=p+c,p=void 0;else if(r===ud){for(;h===" "||h===" ";)h=w,w=e[y+=1],g=!0;let I=y>S+1?y-2:E-1;if(l[I])return e;u.push(I),l[I]=!0,d=I+c,p=void 0}else g=!0}h=w}if(g&&a&&a(),u.length===0)return e;o&&o();let _=e.slice(0,u[0]);for(let w=0;w<u.length;++w){let I=u[w],T=u[w+1]||e.length;I===0?_=`
221
- ${t}${e.slice(0,T)}`:(r===ud&&l[I]&&(_+=`${e[I]}\\`),_+=`
222
- ${t}${e.slice(I+1,T)}`)}return _}function rj(e,t,r){let n=t,i=t+1,s=e[i];for(;s===" "||s===" ";)if(t<i+r)s=e[++t];else{do s=e[++t];while(s&&s!==`
223
- `);n=t,i=t+1,s=e[i]}return n}fc.FOLD_BLOCK=y_;fc.FOLD_FLOW=Yte;fc.FOLD_QUOTED=ud;fc.foldFlowLines=Jte});var pc=v(ij=>{"use strict";f();var hr=Ke(),kn=nj(),fd=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),dd=e=>/^(%|---|\.\.\.)/m.test(e);function zte(e,t,r){if(!t||t<0)return!1;let n=t-r,i=e.length;if(i<=n)return!1;for(let s=0,o=0;s<i;++s)if(e[s]===`
224
- `){if(s-o>n)return!0;if(o=s+1,i-o<=n)return!1}return!0}function dc(e,t){let r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(dd(e)?" ":""),o="",a=0;for(let c=0,u=r[c];u;u=r[++c])if(u===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(o+=r.slice(a,c)+"\\ ",c+=1,a=c,u="\\"),u==="\\")switch(r[c+1]){case"u":{o+=r.slice(a,c);let l=r.substr(c+2,4);switch(l){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:l.substr(0,2)==="00"?o+="\\x"+l.substr(2):o+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length<i)c+=1;else{for(o+=r.slice(a,c)+`
225
-
226
- `;r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"';)o+=`
227
- `,c+=2;o+=s,r[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+r.slice(a):r,n?o:kn.foldFlowLines(o,s,kn.FOLD_QUOTED,fd(t,!1))}function v_(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
228
- `)||/[ \t]\n|\n[ \t]/.test(e))return dc(e,t);let r=t.indent||(dd(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
229
- ${r}`)+"'";return t.implicitKey?n:kn.foldFlowLines(n,r,kn.FOLD_FLOW,fd(t,!1))}function Zs(e,t){let{singleQuote:r}=t.options,n;if(r===!1)n=dc;else{let i=e.includes('"'),s=e.includes("'");i&&!s?n=v_:s&&!i?n=dc:n=r?v_:dc}return n(e,t)}var E_;try{E_=new RegExp(`(^|(?<!
230
- ))
231
- +(?!
232
- |$)`,"g")}catch{E_=/\n+(?!\n|$)/g}function ld({comment:e,type:t,value:r},n,i,s){let{blockQuote:o,commentString:a,lineWidth:c}=n.options;if(!o||/\n[\t ]+$/.test(r))return Zs(r,n);let u=n.indent||(n.forceBlockIndent||dd(r)?" ":""),l=o==="literal"?!0:o==="folded"||t===hr.Scalar.BLOCK_FOLDED?!1:t===hr.Scalar.BLOCK_LITERAL?!0:!zte(r,c,u.length);if(!r)return l?`|
233
- `:`>
234
- `;let d,p;for(p=r.length;p>0;--p){let T=r[p-1];if(T!==`
235
- `&&T!==" "&&T!==" ")break}let h=r.substring(p),g=h.indexOf(`
236
- `);g===-1?d="-":r===h||g!==h.length-1?(d="+",s&&s()):d="",h&&(r=r.slice(0,-h.length),h[h.length-1]===`
237
- `&&(h=h.slice(0,-1)),h=h.replace(E_,`$&${u}`));let y=!1,E,S=-1;for(E=0;E<r.length;++E){let T=r[E];if(T===" ")y=!0;else if(T===`
238
- `)S=E;else break}let _=r.substring(0,S<E?S+1:E);_&&(r=r.substring(_.length),_=_.replace(/\n+/g,`$&${u}`));let I=(y?u?"2":"1":"")+d;if(e&&(I+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!l){let T=r.replace(/\n+/g,`
239
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`),N=!1,P=fd(n,!0);o!=="folded"&&t!==hr.Scalar.BLOCK_FOLDED&&(P.onOverflow=()=>{N=!0});let O=kn.foldFlowLines(`${_}${T}${h}`,u,kn.FOLD_BLOCK,P);if(!N)return`>${I}
240
- ${u}${O}`}return r=r.replace(/\n+/g,`$&${u}`),`|${I}
241
- ${u}${_}${r}${h}`}function Xte(e,t,r,n){let{type:i,value:s}=e,{actualString:o,implicitKey:a,indent:c,indentStep:u,inFlow:l}=t;if(a&&s.includes(`
242
- `)||l&&/[[\]{},]/.test(s))return Zs(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||l||!s.includes(`
243
- `)?Zs(s,t):ld(e,t,r,n);if(!a&&!l&&i!==hr.Scalar.PLAIN&&s.includes(`
244
- `))return ld(e,t,r,n);if(dd(s)){if(c==="")return t.forceBlockIndent=!0,ld(e,t,r,n);if(a&&c===u)return Zs(s,t)}let d=s.replace(/\n+/g,`$&
245
- ${c}`);if(o){let p=y=>y.default&&y.tag!=="tag:yaml.org,2002:str"&&y.test?.test(d),{compat:h,tags:g}=t.doc.schema;if(g.some(p)||h?.some(p))return Zs(s,t)}return a?d:kn.foldFlowLines(d,c,kn.FOLD_FLOW,fd(t,!1))}function Zte(e,t,r,n){let{implicitKey:i,inFlow:s}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;a!==hr.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=hr.Scalar.QUOTE_DOUBLE);let c=l=>{switch(l){case hr.Scalar.BLOCK_FOLDED:case hr.Scalar.BLOCK_LITERAL:return i||s?Zs(o.value,t):ld(o,t,r,n);case hr.Scalar.QUOTE_DOUBLE:return dc(o.value,t);case hr.Scalar.QUOTE_SINGLE:return v_(o.value,t);case hr.Scalar.PLAIN:return Xte(o,t,r,n);default:return null}},u=c(a);if(u===null){let{defaultKeyType:l,defaultStringType:d}=t.options,p=i&&l||d;if(u=c(p),u===null)throw new Error(`Unsupported default string type ${p}`)}return u}ij.stringifyString=Zte});var hc=v(__=>{"use strict";f();var ere=nd(),jn=ue(),tre=lc(),rre=pc();function nre(e,t){let r=Object.assign({blockQuote:!0,commentString:tre.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function ire(e,t){if(t.tag){let i=e.filter(s=>s.tag===t.tag);if(i.length>0)return i.find(s=>s.format===t.format)??i[0]}let r,n;if(jn.isScalar(t)){n=t.value;let i=e.filter(s=>s.identify?.(n));if(i.length>1){let s=i.filter(o=>o.test);s.length>0&&(i=s)}r=i.find(s=>s.format===t.format)??i.find(s=>!s.format)}else n=t,r=e.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function sre(e,t,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(jn.isScalar(e)||jn.isCollection(e))&&e.anchor;s&&ere.anchorIsValid(s)&&(r.add(s),i.push(`&${s}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}function ore(e,t,r,n){if(jn.isPair(e))return e.toString(t,r,n);if(jn.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,s=jn.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>i=c});i??(i=ire(t.doc.schema.tags,s));let o=sre(s,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(s,t,r,n):jn.isScalar(s)?rre.stringifyString(s,t,r,n):s.toString(t,r,n);return o?jn.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
246
- ${t.indent}${a}`:a}__.createStringifyContext=nre;__.stringify=ore});var cj=v(aj=>{"use strict";f();var en=ue(),sj=Ke(),oj=hc(),mc=lc();function are({key:e,value:t},r,n,i){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:u,indentSeq:l,simpleKeys:d}}=r,p=en.isNode(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(en.isCollection(e)||!en.isNode(e)&&typeof e=="object"){let P="With simple keys, collection cannot be used as a key value";throw new Error(P)}}let h=!d&&(!e||p&&t==null&&!r.inFlow||en.isCollection(e)||(en.isScalar(e)?e.type===sj.Scalar.BLOCK_FOLDED||e.type===sj.Scalar.BLOCK_LITERAL:typeof e=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!h&&(d||!s),indent:a+c});let g=!1,y=!1,E=oj.stringify(e,r,()=>g=!0,()=>y=!0);if(!h&&!r.inFlow&&E.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(r.inFlow){if(s||t==null)return g&&n&&n(),E===""?"?":h?`? ${E}`:E}else if(s&&!d||t==null&&h)return E=`? ${E}`,p&&!g?E+=mc.lineComment(E,r.indent,u(p)):y&&i&&i(),E;g&&(p=null),h?(p&&(E+=mc.lineComment(E,r.indent,u(p))),E=`? ${E}
247
- ${a}:`):(E=`${E}:`,p&&(E+=mc.lineComment(E,r.indent,u(p))));let S,_,w;en.isNode(t)?(S=!!t.spaceBefore,_=t.commentBefore,w=t.comment):(S=!1,_=null,w=null,t&&typeof t=="object"&&(t=o.createNode(t))),r.implicitKey=!1,!h&&!p&&en.isScalar(t)&&(r.indentAtStart=E.length+1),y=!1,!l&&c.length>=2&&!r.inFlow&&!h&&en.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(r.indent=r.indent.substring(2));let I=!1,T=oj.stringify(t,r,()=>I=!0,()=>y=!0),N=" ";if(p||S||_){if(N=S?`
248
- `:"",_){let P=u(_);N+=`
249
- ${mc.indentComment(P,r.indent)}`}T===""&&!r.inFlow?N===`
250
- `&&w&&(N=`
251
-
252
- `):N+=`
253
- ${r.indent}`}else if(!h&&en.isCollection(t)){let P=T[0],O=T.indexOf(`
254
- `),$=O!==-1,Z=r.inFlow??t.flow??t.items.length===0;if($||!Z){let ie=!1;if($&&(P==="&"||P==="!")){let A=T.indexOf(" ");P==="&"&&A!==-1&&A<O&&T[A+1]==="!"&&(A=T.indexOf(" ",A+1)),(A===-1||O<A)&&(ie=!0)}ie||(N=`
255
- ${r.indent}`)}}else(T===""||T[0]===`
256
- `)&&(N="");return E+=N+T,r.inFlow?I&&n&&n():w&&!I?E+=mc.lineComment(E,r.indent,u(w)):y&&i&&i(),E}aj.stringifyPair=are});var b_=v(S_=>{"use strict";f();var uj=k("process");function cre(e,...t){e==="debug"&&console.log(...t)}function ure(e,t){(e==="debug"||e==="warn")&&(typeof uj.emitWarning=="function"?uj.emitWarning(t):console.warn(t))}S_.debug=cre;S_.warn=ure});var yd=v(gd=>{"use strict";f();var md=ue(),lj=Ke(),pd="<<",hd={identify:e=>e===pd||typeof e=="symbol"&&e.description===pd,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new lj.Scalar(Symbol(pd)),{addToJSMap:fj}),stringify:()=>pd},lre=(e,t)=>(hd.identify(t)||md.isScalar(t)&&(!t.type||t.type===lj.Scalar.PLAIN)&&hd.identify(t.value))&&e?.doc.schema.tags.some(r=>r.tag===hd.tag&&r.default);function fj(e,t,r){let n=dj(e,r);if(md.isSeq(n))for(let i of n.items)T_(e,t,i);else if(Array.isArray(n))for(let i of n)T_(e,t,i);else T_(e,t,n)}function T_(e,t,r){let n=dj(e,r);if(!md.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,e,Map);for(let[s,o]of i)t instanceof Map?t.has(s)||t.set(s,o):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function dj(e,t){return e&&md.isAlias(t)?t.resolve(e.doc,e):t}gd.addMergeToJSMap=fj;gd.isMergeKey=lre;gd.merge=hd});var O_=v(mj=>{"use strict";f();var fre=b_(),pj=yd(),dre=hc(),hj=ue(),w_=Dn();function pre(e,t,{key:r,value:n}){if(hj.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if(pj.isMergeKey(e,r))pj.addMergeToJSMap(e,t,n);else{let i=w_.toJS(r,"",e);if(t instanceof Map)t.set(i,w_.toJS(n,i,e));else if(t instanceof Set)t.add(i);else{let s=hre(r,i,e),o=w_.toJS(n,s,e);s in t?Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[s]=o}}return t}function hre(e,t,r){if(t===null)return"";if(typeof t!="object")return String(t);if(hj.isNode(e)&&r?.doc){let n=dre.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),fre.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(t)}mj.addPairToJSMap=pre});var Mn=v(I_=>{"use strict";f();var gj=uc(),mre=cj(),gre=O_(),vd=ue();function yre(e,t,r){let n=gj.createNode(e,void 0,r),i=gj.createNode(t,void 0,r);return new Ed(n,i)}var Ed=class e{constructor(t,r=null){Object.defineProperty(this,vd.NODE_TYPE,{value:vd.PAIR}),this.key=t,this.value=r}clone(t){let{key:r,value:n}=this;return vd.isNode(r)&&(r=r.clone(t)),vd.isNode(n)&&(n=n.clone(t)),new e(r,n)}toJSON(t,r){let n=r?.mapAsMap?new Map:{};return gre.addPairToJSMap(r,n,this)}toString(t,r,n){return t?.doc?mre.stringifyPair(this,t,r,n):JSON.stringify(this)}};I_.Pair=Ed;I_.createPair=yre});var A_=v(vj=>{"use strict";f();var Ri=ue(),yj=hc(),_d=lc();function vre(e,t,r){return(t.inFlow??e.flow?_re:Ere)(e,t,r)}function Ere({comment:e,items:t},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:u}}=r,l=Object.assign({},r,{indent:s,type:null}),d=!1,p=[];for(let g=0;g<t.length;++g){let y=t[g],E=null;if(Ri.isNode(y))!d&&y.spaceBefore&&p.push(""),Sd(r,p,y.commentBefore,d),y.comment&&(E=y.comment);else if(Ri.isPair(y)){let _=Ri.isNode(y.key)?y.key:null;_&&(!d&&_.spaceBefore&&p.push(""),Sd(r,p,_.commentBefore,d))}d=!1;let S=yj.stringify(y,l,()=>E=null,()=>d=!0);E&&(S+=_d.lineComment(S,s,u(E))),d&&E&&(d=!1),p.push(n+S)}let h;if(p.length===0)h=i.start+i.end;else{h=p[0];for(let g=1;g<p.length;++g){let y=p[g];h+=y?`
257
- ${c}${y}`:`
258
- `}}return e?(h+=`
259
- `+_d.indentComment(u(e),c),a&&a()):d&&o&&o(),h}function _re({items:e},t,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=t;n+=s;let c=Object.assign({},t,{indent:n,inFlow:!0,type:null}),u=!1,l=0,d=[];for(let g=0;g<e.length;++g){let y=e[g],E=null;if(Ri.isNode(y))y.spaceBefore&&d.push(""),Sd(t,d,y.commentBefore,!1),y.comment&&(E=y.comment);else if(Ri.isPair(y)){let _=Ri.isNode(y.key)?y.key:null;_&&(_.spaceBefore&&d.push(""),Sd(t,d,_.commentBefore,!1),_.comment&&(u=!0));let w=Ri.isNode(y.value)?y.value:null;w?(w.comment&&(E=w.comment),w.commentBefore&&(u=!0)):y.value==null&&_?.comment&&(E=_.comment)}E&&(u=!0);let S=yj.stringify(y,c,()=>E=null);u||(u=d.length>l||S.includes(`
260
- `)),g<e.length-1?S+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(u||(u=d.reduce((_,w)=>_+w.length+2,2)+(S.length+2)>t.options.lineWidth)),u&&(S+=",")),E&&(S+=_d.lineComment(S,n,a(E))),d.push(S),l=d.length}let{start:p,end:h}=r;if(d.length===0)return p+h;if(!u){let g=d.reduce((y,E)=>y+E.length+2,2);u=t.options.lineWidth>0&&g>t.options.lineWidth}if(u){let g=p;for(let y of d)g+=y?`
261
- ${s}${i}${y}`:`
262
- `;return`${g}
263
- ${i}${h}`}else return`${p}${o}${d.join(" ")}${o}${h}`}function Sd({indent:e,options:{commentString:t}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=_d.indentComment(t(n),e);r.push(s.trimStart())}}vj.stringifyCollection=vre});var Fn=v(C_=>{"use strict";f();var Sre=A_(),bre=O_(),Tre=ad(),qn=ue(),bd=Mn(),wre=Ke();function gc(e,t){let r=qn.isScalar(t)?t.value:t;for(let n of e)if(qn.isPair(n)&&(n.key===t||n.key===r||qn.isScalar(n.key)&&n.key.value===r))return n}var N_=class extends Tre.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(qn.MAP,t),this.items=[]}static from(t,r,n){let{keepUndefined:i,replacer:s}=n,o=new this(t),a=(c,u)=>{if(typeof s=="function")u=s.call(r,c,u);else if(Array.isArray(s)&&!s.includes(c))return;(u!==void 0||i)&&o.items.push(bd.createPair(c,u,n))};if(r instanceof Map)for(let[c,u]of r)a(c,u);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,r){let n;qn.isPair(t)?n=t:!t||typeof t!="object"||!("key"in t)?n=new bd.Pair(t,t?.value):n=new bd.Pair(t.key,t.value);let i=gc(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);qn.isScalar(i.value)&&wre.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let o=this.items.findIndex(a=>s(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(t){let r=gc(this.items,t);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(t,r){let i=gc(this.items,t)?.value;return(!r&&qn.isScalar(i)?i.value:i)??void 0}has(t){return!!gc(this.items,t)}set(t,r){this.add(new bd.Pair(t,r),!0)}toJSON(t,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let s of this.items)bre.addPairToJSMap(r,i,s);return i}toString(t,r,n){if(!t)return JSON.stringify(this);for(let i of this.items)if(!qn.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Sre.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:n,onComment:r})}};C_.YAMLMap=N_;C_.findPair=gc});var eo=v(_j=>{"use strict";f();var Ore=ue(),Ej=Fn(),Ire={collection:"map",default:!0,nodeClass:Ej.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return Ore.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,r)=>Ej.YAMLMap.from(e,t,r)};_j.map=Ire});var Un=v(Sj=>{"use strict";f();var Are=uc(),Nre=A_(),Cre=ad(),wd=ue(),Pre=Ke(),Rre=Dn(),P_=class extends Cre.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(wd.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let r=Td(t);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(t,r){let n=Td(t);if(typeof n!="number")return;let i=this.items[n];return!r&&wd.isScalar(i)?i.value:i}has(t){let r=Td(t);return typeof r=="number"&&r<this.items.length}set(t,r){let n=Td(t);if(typeof n!="number")throw new Error(`Expected a valid index, not ${t}.`);let i=this.items[n];wd.isScalar(i)&&Pre.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(t,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let s of this.items)n.push(Rre.toJS(s,String(i++),r));return n}toString(t,r,n){return t?Nre.stringifyCollection(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(t,r,n){let{replacer:i}=n,s=new this(t);if(r&&Symbol.iterator in Object(r)){let o=0;for(let a of r){if(typeof i=="function"){let c=r instanceof Set?a:String(o++);a=i.call(r,c,a)}s.items.push(Are.createNode(a,void 0,n))}}return s}};function Td(e){let t=wd.isScalar(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}Sj.YAMLSeq=P_});var to=v(Tj=>{"use strict";f();var xre=ue(),bj=Un(),Dre={collection:"seq",default:!0,nodeClass:bj.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return xre.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,r)=>bj.YAMLSeq.from(e,t,r)};Tj.seq=Dre});var yc=v(wj=>{"use strict";f();var Lre=pc(),kre={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,r,n){return t=Object.assign({actualString:!0},t),Lre.stringifyString(e,t,r,n)}};wj.string=kre});var Od=v(Aj=>{"use strict";f();var Oj=Ke(),Ij={identify:e=>e==null,createNode:()=>new Oj.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Oj.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&Ij.test.test(e)?e:t.options.nullStr};Aj.nullTag=Ij});var R_=v(Cj=>{"use strict";f();var jre=Ke(),Nj={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new jre.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},r){if(e&&Nj.test.test(e)){let n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?r.options.trueStr:r.options.falseStr}};Cj.boolTag=Nj});var ro=v(Pj=>{"use strict";f();function Mre({format:e,minFractionDigits:t,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=t-(s.length-o-1);for(;a-- >0;)s+="0"}return s}Pj.stringifyNumber=Mre});var D_=v(Id=>{"use strict";f();var qre=Ke(),x_=ro(),Fre={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:x_.stringifyNumber},Ure={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():x_.stringifyNumber(e)}},Vre={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new qre.Scalar(parseFloat(e)),r=e.indexOf(".");return r!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-r-1),t},stringify:x_.stringifyNumber};Id.float=Vre;Id.floatExp=Ure;Id.floatNaN=Fre});var k_=v(Nd=>{"use strict";f();var Rj=ro(),Ad=e=>typeof e=="bigint"||Number.isInteger(e),L_=(e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r);function xj(e,t,r){let{value:n}=e;return Ad(n)&&n>=0?r+n.toString(t):Rj.stringifyNumber(e)}var Gre={identify:e=>Ad(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>L_(e,2,8,r),stringify:e=>xj(e,8,"0o")},$re={identify:Ad,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>L_(e,0,10,r),stringify:Rj.stringifyNumber},Bre={identify:e=>Ad(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>L_(e,2,16,r),stringify:e=>xj(e,16,"0x")};Nd.int=$re;Nd.intHex=Bre;Nd.intOct=Gre});var Lj=v(Dj=>{"use strict";f();var Kre=eo(),Hre=Od(),Qre=to(),Wre=yc(),Yre=R_(),j_=D_(),M_=k_(),Jre=[Kre.map,Qre.seq,Wre.string,Hre.nullTag,Yre.boolTag,M_.intOct,M_.int,M_.intHex,j_.floatNaN,j_.floatExp,j_.float];Dj.schema=Jre});var Mj=v(jj=>{"use strict";f();var zre=Ke(),Xre=eo(),Zre=to();function kj(e){return typeof e=="bigint"||Number.isInteger(e)}var Cd=({value:e})=>JSON.stringify(e),ene=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Cd},{identify:e=>e==null,createNode:()=>new zre.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Cd},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Cd},{identify:kj,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:r})=>r?BigInt(e):parseInt(e,10),stringify:({value:e})=>kj(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Cd}],tne={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},rne=[Xre.map,Zre.seq].concat(ene,tne);jj.schema=rne});var F_=v(qj=>{"use strict";f();var vc=k("buffer"),q_=Ke(),nne=pc(),ine={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof vc.Buffer=="function")return vc.Buffer.from(e,"base64");if(typeof atob=="function"){let r=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:r},n,i,s){if(!r)return"";let o=r,a;if(typeof vc.Buffer=="function")a=o instanceof vc.Buffer?o.toString("base64"):vc.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let u=0;u<o.length;++u)c+=String.fromCharCode(o[u]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=q_.Scalar.BLOCK_LITERAL),t!==q_.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),u=Math.ceil(a.length/c),l=new Array(u);for(let d=0,p=0;d<u;++d,p+=c)l[d]=a.substr(p,c);a=l.join(t===q_.Scalar.BLOCK_LITERAL?`
264
- `:" ")}return nne.stringifyString({comment:e,type:t,value:a},n,i,s)}};qj.binary=ine});var xd=v(Rd=>{"use strict";f();var Pd=ue(),U_=Mn(),sne=Ke(),one=Un();function Fj(e,t){if(Pd.isSeq(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(!Pd.isPair(n)){if(Pd.isMap(n)){n.items.length>1&&t("Each pair must have its own sequence indicator");let i=n.items[0]||new U_.Pair(new sne.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
265
- ${i.key.commentBefore}`:n.commentBefore),n.comment){let s=i.value??i.key;s.comment=s.comment?`${n.comment}
266
- ${s.comment}`:n.comment}n=i}e.items[r]=Pd.isPair(n)?n:new U_.Pair(n)}}else t("Expected a sequence for this tag");return e}function Uj(e,t,r){let{replacer:n}=r,i=new one.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof n=="function"&&(o=n.call(t,String(s++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let u=Object.keys(o);if(u.length===1)a=u[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else a=o;i.items.push(U_.createPair(a,c,r))}return i}var ane={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Fj,createNode:Uj};Rd.createPairs=Uj;Rd.pairs=ane;Rd.resolvePairs=Fj});var $_=v(G_=>{"use strict";f();var Vj=ue(),V_=Dn(),Ec=Fn(),cne=Un(),Gj=xd(),xi=class e extends cne.YAMLSeq{constructor(){super(),this.add=Ec.YAMLMap.prototype.add.bind(this),this.delete=Ec.YAMLMap.prototype.delete.bind(this),this.get=Ec.YAMLMap.prototype.get.bind(this),this.has=Ec.YAMLMap.prototype.has.bind(this),this.set=Ec.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,r){if(!r)return super.toJSON(t);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,o;if(Vj.isPair(i)?(s=V_.toJS(i.key,"",r),o=V_.toJS(i.value,s,r)):s=V_.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,o)}return n}static from(t,r,n){let i=Gj.createPairs(t,r,n),s=new this;return s.items=i.items,s}};xi.tag="tag:yaml.org,2002:omap";var une={collection:"seq",identify:e=>e instanceof Map,nodeClass:xi,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=Gj.resolvePairs(e,t),n=[];for(let{key:i}of r.items)Vj.isScalar(i)&&(n.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new xi,r)},createNode:(e,t,r)=>xi.from(e,t,r)};G_.YAMLOMap=xi;G_.omap=une});var Qj=v(B_=>{"use strict";f();var $j=Ke();function Bj({value:e,source:t},r){return t&&(e?Kj:Hj).test.test(t)?t:e?r.options.trueStr:r.options.falseStr}var Kj={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new $j.Scalar(!0),stringify:Bj},Hj={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new $j.Scalar(!1),stringify:Bj};B_.falseTag=Hj;B_.trueTag=Kj});var Wj=v(Dd=>{"use strict";f();var lne=Ke(),K_=ro(),fne={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:K_.stringifyNumber},dne={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():K_.stringifyNumber(e)}},pne={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new lne.Scalar(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(r!==-1){let n=e.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(t.minFractionDigits=n.length)}return t},stringify:K_.stringifyNumber};Dd.float=pne;Dd.floatExp=dne;Dd.floatNaN=fne});var Jj=v(Sc=>{"use strict";f();var Yj=ro(),_c=e=>typeof e=="bigint"||Number.isInteger(e);function Ld(e,t,r,{intAsBigInt:n}){let i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let o=BigInt(e);return i==="-"?BigInt(-1)*o:o}let s=parseInt(e,r);return i==="-"?-1*s:s}function H_(e,t,r){let{value:n}=e;if(_c(n)){let i=n.toString(t);return n<0?"-"+r+i.substr(1):r+i}return Yj.stringifyNumber(e)}var hne={identify:_c,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>Ld(e,2,2,r),stringify:e=>H_(e,2,"0b")},mne={identify:_c,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>Ld(e,1,8,r),stringify:e=>H_(e,8,"0")},gne={identify:_c,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>Ld(e,0,10,r),stringify:Yj.stringifyNumber},yne={identify:_c,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>Ld(e,2,16,r),stringify:e=>H_(e,16,"0x")};Sc.int=gne;Sc.intBin=hne;Sc.intHex=yne;Sc.intOct=mne});var W_=v(Q_=>{"use strict";f();var Md=ue(),kd=Mn(),jd=Fn(),Di=class e extends jd.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let r;Md.isPair(t)?r=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?r=new kd.Pair(t.key,null):r=new kd.Pair(t,null),jd.findPair(this.items,r.key)||this.items.push(r)}get(t,r){let n=jd.findPair(this.items,t);return!r&&Md.isPair(n)?Md.isScalar(n.key)?n.key.value:n.key:n}set(t,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=jd.findPair(this.items,t);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new kd.Pair(t))}toJSON(t,r){return super.toJSON(t,r,Set)}toString(t,r,n){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(t,r,n){let{replacer:i}=n,s=new this(t);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof i=="function"&&(o=i.call(r,o,o)),s.items.push(kd.createPair(o,null,n));return s}};Di.tag="tag:yaml.org,2002:set";var vne={collection:"map",identify:e=>e instanceof Set,nodeClass:Di,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>Di.from(e,t,r),resolve(e,t){if(Md.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new Di,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};Q_.YAMLSet=Di;Q_.set=vne});var J_=v(qd=>{"use strict";f();var Ene=ro();function Y_(e,t){let r=e[0],n=r==="-"||r==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),s=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return r==="-"?i(-1)*s:s}function zj(e){let{value:t}=e,r=o=>o;if(typeof t=="bigint")r=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Ene.stringifyNumber(e);let n="";t<0&&(n="-",t*=r(-1));let i=r(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),n+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var _ne={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>Y_(e,r),stringify:zj},Sne={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Y_(e,!1),stringify:zj},Xj={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(Xj.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,o,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,u=Date.UTC(r,n-1,i,s||0,o||0,a||0,c),l=t[8];if(l&&l!=="Z"){let d=Y_(l,!1);Math.abs(d)<30&&(d*=60),u-=6e4*d}return new Date(u)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};qd.floatTime=Sne;qd.intTime=_ne;qd.timestamp=Xj});var tM=v(eM=>{"use strict";f();var bne=eo(),Tne=Od(),wne=to(),One=yc(),Ine=F_(),Zj=Qj(),z_=Wj(),Fd=Jj(),Ane=yd(),Nne=$_(),Cne=xd(),Pne=W_(),X_=J_(),Rne=[bne.map,wne.seq,One.string,Tne.nullTag,Zj.trueTag,Zj.falseTag,Fd.intBin,Fd.intOct,Fd.int,Fd.intHex,z_.floatNaN,z_.floatExp,z_.float,Ine.binary,Ane.merge,Nne.omap,Cne.pairs,Pne.set,X_.intTime,X_.floatTime,X_.timestamp];eM.schema=Rne});var fM=v(tS=>{"use strict";f();var sM=eo(),xne=Od(),oM=to(),Dne=yc(),Lne=R_(),Z_=D_(),eS=k_(),kne=Lj(),jne=Mj(),aM=F_(),bc=yd(),cM=$_(),uM=xd(),rM=tM(),lM=W_(),Ud=J_(),nM=new Map([["core",kne.schema],["failsafe",[sM.map,oM.seq,Dne.string]],["json",jne.schema],["yaml11",rM.schema],["yaml-1.1",rM.schema]]),iM={binary:aM.binary,bool:Lne.boolTag,float:Z_.float,floatExp:Z_.floatExp,floatNaN:Z_.floatNaN,floatTime:Ud.floatTime,int:eS.int,intHex:eS.intHex,intOct:eS.intOct,intTime:Ud.intTime,map:sM.map,merge:bc.merge,null:xne.nullTag,omap:cM.omap,pairs:uM.pairs,seq:oM.seq,set:lM.set,timestamp:Ud.timestamp},Mne={"tag:yaml.org,2002:binary":aM.binary,"tag:yaml.org,2002:merge":bc.merge,"tag:yaml.org,2002:omap":cM.omap,"tag:yaml.org,2002:pairs":uM.pairs,"tag:yaml.org,2002:set":lM.set,"tag:yaml.org,2002:timestamp":Ud.timestamp};function qne(e,t,r){let n=nM.get(t);if(n&&!e)return r&&!n.includes(bc.merge)?n.concat(bc.merge):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let s=Array.from(nM.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(let s of e)i=i.concat(s);else typeof e=="function"&&(i=e(i.slice()));return r&&(i=i.concat(bc.merge)),i.reduce((s,o)=>{let a=typeof o=="string"?iM[o]:o;if(!a){let c=JSON.stringify(o),u=Object.keys(iM).map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return s.includes(a)||s.push(a),s},[])}tS.coreKnownTags=Mne;tS.getTags=qne});var iS=v(dM=>{"use strict";f();var rS=ue(),Fne=eo(),Une=to(),Vne=yc(),Vd=fM(),Gne=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,nS=class e{constructor({compat:t,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?Vd.getTags(t,"compat"):t?Vd.getTags(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Vd.coreKnownTags:{},this.tags=Vd.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,rS.MAP,{value:Fne.map}),Object.defineProperty(this,rS.SCALAR,{value:Vne.string}),Object.defineProperty(this,rS.SEQ,{value:Une.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Gne:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};dM.Schema=nS});var hM=v(pM=>{"use strict";f();var $ne=ue(),sS=hc(),Tc=lc();function Bne(e,t){let r=[],n=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(r.push(c),n=!0):e.directives.docStart&&(n=!0)}n&&r.push("---");let i=sS.createStringifyContext(e,t),{commentString:s}=i.options;if(e.commentBefore){r.length!==1&&r.unshift("");let c=s(e.commentBefore);r.unshift(Tc.indentComment(c,""))}let o=!1,a=null;if(e.contents){if($ne.isNode(e.contents)){if(e.contents.spaceBefore&&n&&r.push(""),e.contents.commentBefore){let l=s(e.contents.commentBefore);r.push(Tc.indentComment(l,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>o=!0,u=sS.stringify(e.contents,i,()=>a=null,c);a&&(u+=Tc.lineComment(u,"",s(a))),(u[0]==="|"||u[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${u}`:r.push(u)}else r.push(sS.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=s(e.comment);c.includes(`
267
- `)?(r.push("..."),r.push(Tc.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=e.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&r[r.length-1]!==""&&r.push(""),r.push(Tc.indentComment(s(c),"")))}return r.join(`
268
- `)+`
269
- `}pM.stringifyDocument=Bne});var wc=v(mM=>{"use strict";f();var Kne=cc(),no=ad(),rr=ue(),Hne=Mn(),Qne=Dn(),Wne=iS(),Yne=hM(),oS=nd(),Jne=l_(),zne=uc(),aS=u_(),cS=class e{constructor(t,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,rr.NODE_TYPE,{value:rr.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:o}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new aS.Directives({version:o}),this.setSchema(o,n),this.contents=t===void 0?null:this.createNode(t,i,n)}clone(){let t=Object.create(e.prototype,{[rr.NODE_TYPE]:{value:rr.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=rr.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){io(this.contents)&&this.contents.add(t)}addIn(t,r){io(this.contents)&&this.contents.addIn(t,r)}createAlias(t,r){if(!t.anchor){let n=oS.anchorNames(this);t.anchor=!r||n.has(r)?oS.findNewAnchor(r||"a",n):r}return new Kne.Alias(t.anchor)}createNode(t,r,n){let i;if(typeof r=="function")t=r.call({"":t},"",t),i=r;else if(Array.isArray(r)){let E=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,S=r.filter(E).map(String);S.length>0&&(r=r.concat(S)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:u,tag:l}=n??{},{onAnchor:d,setAnchors:p,sourceObjects:h}=oS.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:u,replacer:i,schema:this.schema,sourceObjects:h},y=zne.createNode(t,l,g);return a&&rr.isCollection(y)&&(y.flow=!0),p(),y}createPair(t,r,n={}){let i=this.createNode(t,null,n),s=this.createNode(r,null,n);return new Hne.Pair(i,s)}delete(t){return io(this.contents)?this.contents.delete(t):!1}deleteIn(t){return no.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):io(this.contents)?this.contents.deleteIn(t):!1}get(t,r){return rr.isCollection(this.contents)?this.contents.get(t,r):void 0}getIn(t,r){return no.isEmptyPath(t)?!r&&rr.isScalar(this.contents)?this.contents.value:this.contents:rr.isCollection(this.contents)?this.contents.getIn(t,r):void 0}has(t){return rr.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return no.isEmptyPath(t)?this.contents!==void 0:rr.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,r){this.contents==null?this.contents=no.collectionFromPath(this.schema,[t],r):io(this.contents)&&this.contents.set(t,r)}setIn(t,r){no.isEmptyPath(t)?this.contents=r:this.contents==null?this.contents=no.collectionFromPath(this.schema,Array.from(t),r):io(this.contents)&&this.contents.setIn(t,r)}setSchema(t,r={}){typeof t=="number"&&(t=String(t));let n;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new aS.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new aS.Directives({version:t}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new Wne.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!t,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Qne.toJS(this.contents,r??"",a);if(typeof s=="function")for(let{count:u,res:l}of a.anchors.values())s(l,u);return typeof o=="function"?Jne.applyReviver(o,{"":c},"",c):c}toJSON(t,r){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:r})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let r=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Yne.stringifyDocument(this,t)}};function io(e){if(rr.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}mM.Document=cS});var Ac=v(Ic=>{"use strict";f();var Oc=class extends Error{constructor(t,r,n,i){super(),this.name=t,this.code=n,this.message=i,this.pos=r}},uS=class extends Oc{constructor(t,r,n){super("YAMLParseError",t,r,n)}},lS=class extends Oc{constructor(t,r,n){super("YAMLWarning",t,r,n)}},Xne=(e,t)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>t.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let s=i-1,o=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let a=Math.min(s-39,o.length-79);o="\u2026"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,s))){let a=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
270
- `),o=a+o}if(/[^ ]/.test(o)){let a=1,c=r.linePos[1];c?.line===n&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-s)));let u=" ".repeat(s)+"^".repeat(a);r.message+=`:
271
-
272
- ${o}
273
- ${u}
274
- `}};Ic.YAMLError=Oc;Ic.YAMLParseError=uS;Ic.YAMLWarning=lS;Ic.prettifyError=Xne});var Nc=v(gM=>{"use strict";f();function Zne(e,{flow:t,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,u=a,l=a,d="",p="",h=!1,g=!1,y=null,E=null,S=null,_=null,w=null,I=null,T=null;for(let O of e)switch(g&&(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma"&&s(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),y&&(u&&O.type!=="comment"&&O.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),O.type){case"space":!t&&(r!=="doc-start"||n?.type!=="flow-collection")&&O.source.includes(" ")&&(y=O),l=!0;break;case"comment":{l||s(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let $=O.source.substring(1)||" ";d?d+=p+$:d=$,p="",u=!1;break}case"newline":u?d?d+=O.source:(!I||r!=="seq-item-ind")&&(c=!0):p+=O.source,u=!0,h=!0,(E||S)&&(_=O),l=!0;break;case"anchor":E&&s(O,"MULTIPLE_ANCHORS","A node can have at most one anchor"),O.source.endsWith(":")&&s(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=O,T??(T=O.offset),u=!1,l=!1,g=!0;break;case"tag":{S&&s(O,"MULTIPLE_TAGS","A node can have at most one tag"),S=O,T??(T=O.offset),u=!1,l=!1,g=!0;break}case r:(E||S)&&s(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),I&&s(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${t??"collection"}`),I=O,u=r==="seq-item-ind"||r==="explicit-key-ind",l=!1;break;case"comma":if(t){w&&s(O,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),w=O,u=!1,l=!1;break}default:s(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),u=!1,l=!1}let N=e[e.length-1],P=N?N.offset+N.source.length:i;return g&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(u&&y.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:w,found:I,spaceBefore:c,comment:d,hasNewline:h,anchor:E,tag:S,newlineAfterProp:_,end:P,start:T??P}}gM.resolveProps=Zne});var Gd=v(yM=>{"use strict";f();function fS(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
275
- `))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let r of t.start)if(r.type==="newline")return!0;if(t.sep){for(let r of t.sep)if(r.type==="newline")return!0}if(fS(t.key)||fS(t.value))return!0}return!1;default:return!0}}yM.containsNewline=fS});var dS=v(vM=>{"use strict";f();var eie=Gd();function tie(e,t,r){if(t?.type==="flow-collection"){let n=t.end[0];n.indent===e&&(n.source==="]"||n.source==="}")&&eie.containsNewline(t)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}vM.flowIndentCheck=tie});var pS=v(_M=>{"use strict";f();var EM=ue();function rie(e,t,r){let{uniqueKeys:n}=e.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,o)=>s===o||EM.isScalar(s)&&EM.isScalar(o)&&s.value===o.value;return t.some(s=>i(s.key,r))}_M.mapIncludes=rie});var IM=v(OM=>{"use strict";f();var SM=Mn(),nie=Fn(),bM=Nc(),iie=Gd(),TM=dS(),sie=pS(),wM="All mapping items must start at the same column";function oie({composeNode:e,composeEmptyNode:t},r,n,i,s){let o=s?.nodeClass??nie.YAMLMap,a=new o(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,u=null;for(let l of n.items){let{start:d,key:p,sep:h,value:g}=l,y=bM.resolveProps(d,{indicator:"explicit-key-ind",next:p??h?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),E=!y.found;if(E){if(p&&(p.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==n.indent&&i(c,"BAD_INDENT",wM)),!y.anchor&&!y.tag&&!h){u=y.end,y.comment&&(a.comment?a.comment+=`
276
- `+y.comment:a.comment=y.comment);continue}(y.newlineAfterProp||iie.containsNewline(p))&&i(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else y.found?.indent!==n.indent&&i(c,"BAD_INDENT",wM);r.atKey=!0;let S=y.end,_=p?e(r,p,y,i):t(r,S,d,null,y,i);r.schema.compat&&TM.flowIndentCheck(n.indent,p,i),r.atKey=!1,sie.mapIncludes(r,a.items,_)&&i(S,"DUPLICATE_KEY","Map keys must be unique");let w=bM.resolveProps(h??[],{indicator:"map-value-ind",next:g,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=w.end,w.found){E&&(g?.type==="block-map"&&!w.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&y.start<w.found.offset-1024&&i(_.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let I=g?e(r,g,w,i):t(r,c,h,null,w,i);r.schema.compat&&TM.flowIndentCheck(n.indent,g,i),c=I.range[2];let T=new SM.Pair(_,I);r.options.keepSourceTokens&&(T.srcToken=l),a.items.push(T)}else{E&&i(_.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),w.comment&&(_.comment?_.comment+=`
277
- `+w.comment:_.comment=w.comment);let I=new SM.Pair(_);r.options.keepSourceTokens&&(I.srcToken=l),a.items.push(I)}}return u&&u<c&&i(u,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,c,u??c],a}OM.resolveBlockMap=oie});var NM=v(AM=>{"use strict";f();var aie=Un(),cie=Nc(),uie=dS();function lie({composeNode:e,composeEmptyNode:t},r,n,i,s){let o=s?.nodeClass??aie.YAMLSeq,a=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,u=null;for(let{start:l,value:d}of n.items){let p=cie.resolveProps(l,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d?.type==="block-seq"?i(p.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{u=p.end,p.comment&&(a.comment=p.comment);continue}let h=d?e(r,d,p,i):t(r,p.end,l,null,p,i);r.schema.compat&&uie.flowIndentCheck(n.indent,d,i),c=h.range[2],a.items.push(h)}return a.range=[n.offset,c,u??c],a}AM.resolveBlockSeq=lie});var so=v(CM=>{"use strict";f();function fie(e,t,r,n){let i="";if(e){let s=!1,o="";for(let a of e){let{source:c,type:u}=a;switch(u){case"space":s=!0;break;case"comment":{r&&!s&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let l=c.substring(1)||" ";i?i+=o+l:i=l,o="";break}case"newline":i&&(o+=c),s=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=c.length}}return{comment:i,offset:t}}CM.resolveEnd=fie});var DM=v(xM=>{"use strict";f();var die=ue(),pie=Mn(),PM=Fn(),hie=Un(),mie=so(),RM=Nc(),gie=Gd(),yie=pS(),hS="Block collections are not allowed within flow collections",mS=e=>e&&(e.type==="block-map"||e.type==="block-seq");function vie({composeNode:e,composeEmptyNode:t},r,n,i,s){let o=n.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?PM.YAMLMap:hie.YAMLSeq),u=new c(r.schema);u.flow=!0;let l=r.atRoot;l&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let E=0;E<n.items.length;++E){let S=n.items[E],{start:_,key:w,sep:I,value:T}=S,N=RM.resolveProps(_,{flow:a,indicator:"explicit-key-ind",next:w??I?.[0],offset:d,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!I&&!T){E===0&&N.comma?i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):E<n.items.length-1&&i(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),N.comment&&(u.comment?u.comment+=`
278
- `+N.comment:u.comment=N.comment),d=N.end;continue}!o&&r.options.strict&&gie.containsNewline(w)&&i(w,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)N.comma&&i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(N.comma||i(N.start,"MISSING_CHAR",`Missing , between ${a} items`),N.comment){let P="";e:for(let O of _)switch(O.type){case"comma":case"space":break;case"comment":P=O.source.substring(1);break e;default:break e}if(P){let O=u.items[u.items.length-1];die.isPair(O)&&(O=O.value??O.key),O.comment?O.comment+=`
279
- `+P:O.comment=P,N.comment=N.comment.substring(P.length+1)}}if(!o&&!I&&!N.found){let P=T?e(r,T,N,i):t(r,N.end,I,null,N,i);u.items.push(P),d=P.range[2],mS(T)&&i(P.range,"BLOCK_IN_FLOW",hS)}else{r.atKey=!0;let P=N.end,O=w?e(r,w,N,i):t(r,P,_,null,N,i);mS(w)&&i(O.range,"BLOCK_IN_FLOW",hS),r.atKey=!1;let $=RM.resolveProps(I??[],{flow:a,indicator:"map-value-ind",next:T,offset:O.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if($.found){if(!o&&!N.found&&r.options.strict){if(I)for(let A of I){if(A===$.found)break;if(A.type==="newline"){i(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}N.start<$.found.offset-1024&&i($.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&T.source?.[0]===":"?i(T,"MISSING_CHAR",`Missing space after : in ${a}`):i($.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Z=T?e(r,T,$,i):$.found?t(r,$.end,I,null,$,i):null;Z?mS(T)&&i(Z.range,"BLOCK_IN_FLOW",hS):$.comment&&(O.comment?O.comment+=`
280
- `+$.comment:O.comment=$.comment);let ie=new pie.Pair(O,Z);if(r.options.keepSourceTokens&&(ie.srcToken=S),o){let A=u;yie.mapIncludes(r,A.items,O)&&i(P,"DUPLICATE_KEY","Map keys must be unique"),A.items.push(ie)}else{let A=new PM.YAMLMap(r.schema);A.flow=!0,A.items.push(ie);let X=(Z??O).range;A.range=[O.range[0],X[1],X[2]],u.items.push(A)}d=Z?Z.range[2]:$.end}}let p=o?"}":"]",[h,...g]=n.end,y=d;if(h?.source===p)y=h.offset+h.source.length;else{let E=a[0].toUpperCase()+a.substring(1),S=l?`${E} must end with a ${p}`:`${E} in block collection must be sufficiently indented and end with a ${p}`;i(d,l?"MISSING_CHAR":"BAD_INDENT",S),h&&h.source.length!==1&&g.unshift(h)}if(g.length>0){let E=mie.resolveEnd(g,y,r.options.strict,i);E.comment&&(u.comment?u.comment+=`
281
- `+E.comment:u.comment=E.comment),u.range=[n.offset,y,E.offset]}else u.range=[n.offset,y,y];return u}xM.resolveFlowCollection=vie});var kM=v(LM=>{"use strict";f();var Eie=ue(),_ie=Ke(),Sie=Fn(),bie=Un(),Tie=IM(),wie=NM(),Oie=DM();function gS(e,t,r,n,i,s){let o=r.type==="block-map"?Tie.resolveBlockMap(e,t,r,n,s):r.type==="block-seq"?wie.resolveBlockSeq(e,t,r,n,s):Oie.resolveFlowCollection(e,t,r,n,s),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function Iie(e,t,r,n,i){let s=n.tag,o=s?t.directives.tagName(s.source,p=>i(s,"TAG_RESOLVE_FAILED",p)):null;if(r.type==="block-seq"){let{anchor:p,newlineAfterProp:h}=n,g=p&&s?p.offset>s.offset?p:s:p??s;g&&(!h||h.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===Sie.YAMLMap.tagName&&a==="map"||o===bie.YAMLSeq.tagName&&a==="seq")return gS(e,t,r,i,o);let c=t.schema.tags.find(p=>p.tag===o&&p.collection===a);if(!c){let p=t.schema.knownTags[o];if(p?.collection===a)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?i(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),gS(e,t,r,i,o)}let u=gS(e,t,r,i,o,c),l=c.resolve?.(u,p=>i(s,"TAG_RESOLVE_FAILED",p),t.options)??u,d=Eie.isNode(l)?l:new _ie.Scalar(l);return d.range=u.range,d.tag=o,c?.format&&(d.format=c.format),d}LM.composeCollection=Iie});var vS=v(jM=>{"use strict";f();var yS=Ke();function Aie(e,t,r){let n=t.offset,i=Nie(t,e.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?yS.Scalar.BLOCK_FOLDED:yS.Scalar.BLOCK_LITERAL,o=t.source?Cie(t.source):[],a=o.length;for(let y=o.length-1;y>=0;--y){let E=o[y][1];if(E===""||E==="\r")a=y;else break}if(a===0){let y=i.chomp==="+"&&o.length>0?`
282
- `.repeat(Math.max(1,o.length-1)):"",E=n+i.length;return t.source&&(E+=t.source.length),{value:y,type:s,comment:i.comment,range:[n,E,E]}}let c=t.indent+i.indent,u=t.offset+i.length,l=0;for(let y=0;y<a;++y){let[E,S]=o[y];if(S===""||S==="\r")i.indent===0&&E.length>c&&(c=E.length);else{E.length<c&&r(u+E.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=E.length),l=y,c===0&&!e.atRoot&&r(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=E.length+S.length+1}for(let y=o.length-1;y>=a;--y)o[y][0].length>c&&(a=y+1);let d="",p="",h=!1;for(let y=0;y<l;++y)d+=o[y][0].slice(c)+`
283
- `;for(let y=l;y<a;++y){let[E,S]=o[y];u+=E.length+S.length+1;let _=S[S.length-1]==="\r";if(_&&(S=S.slice(0,-1)),S&&E.length<c){let I=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(u-S.length-(_?2:1),"BAD_INDENT",I),E=""}s===yS.Scalar.BLOCK_LITERAL?(d+=p+E.slice(c)+S,p=`
284
- `):E.length>c||S[0]===" "?(p===" "?p=`
285
- `:!h&&p===`
286
- `&&(p=`
287
-
288
- `),d+=p+E.slice(c)+S,p=`
289
- `,h=!0):S===""?p===`
290
- `?d+=`
291
- `:p=`
292
- `:(d+=p+S,p=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let y=a;y<o.length;++y)d+=`
293
- `+o[y][0].slice(c);d[d.length-1]!==`
294
- `&&(d+=`
295
- `);break;default:d+=`
296
- `}let g=n+i.length+t.source.length;return{value:d,type:s,comment:i.comment,range:[n,g,g]}}function Nie({offset:e,props:t},r,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],s=i[0],o=0,a="",c=-1;for(let p=1;p<i.length;++p){let h=i[p];if(!a&&(h==="-"||h==="+"))a=h;else{let g=Number(h);!o&&g?o=g:c===-1&&(c=e+p)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let u=!1,l="",d=i.length;for(let p=1;p<t.length;++p){let h=t[p];switch(h.type){case"space":u=!0;case"newline":d+=h.source.length;break;case"comment":r&&!u&&n(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=h.source.length,l=h.source.substring(1);break;case"error":n(h,"UNEXPECTED_TOKEN",h.message),d+=h.source.length;break;default:{let g=`Unexpected token in block scalar header: ${h.type}`;n(h,"UNEXPECTED_TOKEN",g);let y=h.source;y&&typeof y=="string"&&(d+=y.length)}}}return{mode:s,indent:o,chomp:a,comment:l,length:d}}function Cie(e){let t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let o=1;o<t.length;o+=2)s.push([t[o],t[o+1]]);return s}jM.resolveBlockScalar=Aie});var _S=v(qM=>{"use strict";f();var ES=Ke(),Pie=so();function Rie(e,t,r){let{offset:n,type:i,source:s,end:o}=e,a,c,u=(p,h,g)=>r(n+p,h,g);switch(i){case"scalar":a=ES.Scalar.PLAIN,c=xie(s,u);break;case"single-quoted-scalar":a=ES.Scalar.QUOTE_SINGLE,c=Die(s,u);break;case"double-quoted-scalar":a=ES.Scalar.QUOTE_DOUBLE,c=Lie(s,u);break;default:return r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let l=n+s.length,d=Pie.resolveEnd(o,l,t,r);return{value:c,type:a,comment:d.comment,range:[n,l,d.offset]}}function xie(e,t){let r="";switch(e[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${e[0]}`;break}case"@":case"`":{r=`reserved character ${e[0]}`;break}}return r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),MM(e)}function Die(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),MM(e.slice(1,-1)).replace(/''/g,"'")}function MM(e){let t,r;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
297
- `,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
298
- `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=t.exec(e);if(!n)return e;let i=n[1],s=" ",o=t.lastIndex;for(r.lastIndex=o;n=r.exec(e);)n[1]===""?s===`
299
- `?i+=s:s=`
300
- `:(i+=s+n[1],s=" "),o=r.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(e),i+s+(n?.[1]??"")}function Lie(e,t){let r="";for(let n=1;n<e.length-1;++n){let i=e[n];if(!(i==="\r"&&e[n+1]===`
301
- `))if(i===`
302
- `){let{fold:s,offset:o}=kie(e,n);r+=s,n=o}else if(i==="\\"){let s=e[++n],o=jie[s];if(o)r+=o;else if(s===`
303
- `)for(s=e[n+1];s===" "||s===" ";)s=e[++n+1];else if(s==="\r"&&e[n+1]===`
304
- `)for(s=e[++n+1];s===" "||s===" ";)s=e[++n+1];else if(s==="x"||s==="u"||s==="U"){let a=s==="x"?2:s==="u"?4:8;r+=Mie(e,n+1,a,t),n+=a}else{let a=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(i===" "||i===" "){let s=n,o=e[n+1];for(;o===" "||o===" ";)o=e[++n+1];o!==`
305
- `&&!(o==="\r"&&e[n+2]===`
306
- `)&&(r+=n>s?e.slice(s,n+1):i)}else r+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),r}function kie(e,t){let r="",n=e[t+1];for(;(n===" "||n===" "||n===`
307
- `||n==="\r")&&!(n==="\r"&&e[t+2]!==`
308
- `);)n===`
309
- `&&(r+=`
310
- `),t+=1,n=e[t+1];return r||(r=" "),{fold:r,offset:t}}var jie={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
311
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Mie(e,t,r,n){let i=e.substr(t,r),o=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}qM.resolveFlowScalar=Rie});var VM=v(UM=>{"use strict";f();var Li=ue(),FM=Ke(),qie=vS(),Fie=_S();function Uie(e,t,r,n){let{value:i,type:s,comment:o,range:a}=t.type==="block-scalar"?qie.resolveBlockScalar(e,t,n):Fie.resolveFlowScalar(t,e.options.strict,n),c=r?e.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,u;e.options.stringKeys&&e.atKey?u=e.schema[Li.SCALAR]:c?u=Vie(e.schema,i,c,r,n):t.type==="scalar"?u=Gie(e,i,t,n):u=e.schema[Li.SCALAR];let l;try{let d=u.resolve(i,p=>n(r??t,"TAG_RESOLVE_FAILED",p),e.options);l=Li.isScalar(d)?d:new FM.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);n(r??t,"TAG_RESOLVE_FAILED",p),l=new FM.Scalar(i)}return l.range=a,l.source=i,s&&(l.type=s),c&&(l.tag=c),u.format&&(l.format=u.format),o&&(l.comment=o),l}function Vie(e,t,r,n,i){if(r==="!")return e[Li.SCALAR];let s=[];for(let a of e.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)s.push(a);else return a;for(let a of s)if(a.test?.test(t))return a;let o=e.knownTags[r];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),e[Li.SCALAR])}function Gie({atKey:e,directives:t,schema:r},n,i,s){let o=r.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(n))||r[Li.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Li.SCALAR];if(o.tag!==a.tag){let c=t.tagString(o.tag),u=t.tagString(a.tag),l=`Value may be parsed as either ${c} or ${u}`;s(i,"TAG_RESOLVE_FAILED",l,!0)}}return o}UM.composeScalar=Uie});var $M=v(GM=>{"use strict";f();function $ie(e,t,r){if(t){r??(r=t.length);for(let n=r-1;n>=0;--n){let i=t[n];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++n];i?.type==="space";)e+=i.source.length,i=t[++n];break}}return e}GM.emptyScalarPosition=$ie});var HM=v(bS=>{"use strict";f();var Bie=cc(),Kie=ue(),Hie=kM(),BM=VM(),Qie=so(),Wie=$M(),Yie={composeNode:KM,composeEmptyNode:SS};function KM(e,t,r,n){let i=e.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=r,u,l=!0;switch(t.type){case"alias":u=Jie(e,t,n),(a||c)&&n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=BM.composeScalar(e,t,c,n),a&&(u.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=Hie.composeCollection(Yie,e,t,r,n),a&&(u.anchor=a.source.substring(1))}catch(d){let p=d instanceof Error?d.message:String(d);n(t,"RESOURCE_EXHAUSTION",p)}break;default:{let d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",d),l=!1}}return u??(u=SS(e,t.offset,void 0,null,r,n)),a&&u.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Kie.isScalar(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&n(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&l&&(u.srcToken=t),u}function SS(e,t,r,n,{spaceBefore:i,comment:s,anchor:o,tag:a,end:c},u){let l={type:"scalar",offset:Wie.emptyScalarPosition(t,r,n),indent:-1,source:""},d=BM.composeScalar(e,l,a,u);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=c),d}function Jie({options:e},{offset:t,source:r,end:n},i){let s=new Bie.Alias(r.substring(1));s.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=t+r.length,a=Qie.resolveEnd(n,o,e.strict,i);return s.range=[t,o,a.offset],a.comment&&(s.comment=a.comment),s}bS.composeEmptyNode=SS;bS.composeNode=KM});var YM=v(WM=>{"use strict";f();var zie=wc(),QM=HM(),Xie=so(),Zie=Nc();function ese(e,t,{offset:r,start:n,value:i,end:s},o){let a=Object.assign({_directives:t},e),c=new zie.Document(void 0,a),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},l=Zie.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!l.hasNewline&&o(l.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?QM.composeNode(u,i,l,o):QM.composeEmptyNode(u,l.end,n,null,l,o);let d=c.contents.range[2],p=Xie.resolveEnd(s,d,!1,o);return p.comment&&(c.comment=p.comment),c.range=[r,d,p.offset],c}WM.composeDoc=ese});var wS=v(XM=>{"use strict";f();var tse=k("process"),rse=u_(),nse=wc(),Cc=Ac(),JM=ue(),ise=YM(),sse=so();function Pc(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:r}=e;return[t,t+(typeof r=="string"?r.length:1)]}function zM(e){let t="",r=!1,n=!1;for(let i=0;i<e.length;++i){let s=e[i];switch(s[0]){case"#":t+=(t===""?"":n?`
312
-
313
- `:`
314
- `)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:t,afterEmptyLine:n}}var TS=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let o=Pc(r);s?this.warnings.push(new Cc.YAMLWarning(o,n,i)):this.errors.push(new Cc.YAMLParseError(o,n,i))},this.directives=new rse.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,r){let{comment:n,afterEmptyLine:i}=zM(this.prelude);if(n){let s=t.contents;if(r)t.comment=t.comment?`${t.comment}
315
- ${n}`:n;else if(i||t.directives.docStart||!s)t.commentBefore=n;else if(JM.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];JM.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
316
- ${a}`:n}else{let o=s.commentBefore;s.commentBefore=o?`${n}
317
- ${o}`:n}}if(r){for(let s=0;s<this.errors.length;++s)t.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)t.warnings.push(this.warnings[s])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:zM(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,r=!1,n=-1){for(let i of t)yield*this.next(i);yield*this.end(r,n)}*next(t){switch(tse.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(r,n,i)=>{let s=Pc(t);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let r=ise.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let r=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new Cc.YAMLParseError(Pc(t),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Cc.YAMLParseError(Pc(t),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=sse.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
318
- ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Cc.YAMLParseError(Pc(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let n=Object.assign({_directives:this.directives},this.options),i=new nse.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};XM.Composer=TS});var tq=v($d=>{"use strict";f();var ose=vS(),ase=_S(),cse=Ac(),ZM=pc();function use(e,t=!0,r){if(e){let n=(i,s,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,s,o);else throw new cse.YAMLParseError([a,a+1],s,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return ase.resolveFlowScalar(e,t,n);case"block-scalar":return ose.resolveBlockScalar({options:{strict:t}},e,n)}}return null}function lse(e,t){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=t,a=ZM.stringifyString({type:o,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:n,source:`
319
- `}];switch(a[0]){case"|":case">":{let u=a.indexOf(`
320
- `),l=a.substring(0,u),d=a.substring(u+1)+`
321
- `,p=[{type:"block-scalar-header",offset:s,indent:n,source:l}];return eq(p,c)||p.push({type:"newline",offset:-1,indent:n,source:`
322
- `}),{type:"block-scalar",offset:s,indent:n,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:a,end:c};default:return{type:"scalar",offset:s,indent:n,source:a,end:c}}}function fse(e,t,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=r,a="indent"in e?e.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let u=e.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=ZM.stringifyString({type:o,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":dse(e,c);break;case'"':OS(e,c,"double-quoted-scalar");break;case"'":OS(e,c,"single-quoted-scalar");break;default:OS(e,c,"scalar")}}function dse(e,t){let r=t.indexOf(`
323
- `),n=t.substring(0,r),i=t.substring(r+1)+`
324
- `;if(e.type==="block-scalar"){let s=e.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,e.source=i}else{let{offset:s}=e,o="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:n}];eq(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
325
- `});for(let c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:o,props:a,source:i})}}function eq(e,t){if(t)for(let r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}function OS(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{let n=e.props.slice(1),i=t.length;e.props[0].type==="block-scalar-header"&&(i-=e.props[0].source.length);for(let s of n)s.offset+=i;delete e.props,Object.assign(e,{type:r,source:t,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
326
- `};delete e.items,Object.assign(e,{type:r,source:t,end:[i]});break}default:{let n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(e))s!=="type"&&s!=="offset"&&delete e[s];Object.assign(e,{type:r,indent:n,source:t,end:i})}}}$d.createScalarToken=lse;$d.resolveAsScalar=use;$d.setScalarValue=fse});var nq=v(rq=>{"use strict";f();var pse=e=>"type"in e?Kd(e):Bd(e);function Kd(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=Kd(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=Bd(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=Bd(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=Bd(e);if(e.end)for(let r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let r of e.end)t+=r.source;return t}}}function Bd({start:e,key:t,sep:r,value:n}){let i="";for(let s of e)i+=s.source;if(t&&(i+=Kd(t)),r)for(let s of r)i+=s.source;return n&&(i+=Kd(n)),i}rq.stringify=pse});var aq=v(oq=>{"use strict";f();var IS=Symbol("break visit"),hse=Symbol("skip children"),iq=Symbol("remove item");function ki(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),sq(Object.freeze([]),e,t)}ki.BREAK=IS;ki.SKIP=hse;ki.REMOVE=iq;ki.itemAtPath=(e,t)=>{let r=e;for(let[n,i]of t){let s=r?.[n];if(s&&"items"in s)r=s.items[i];else return}return r};ki.parentCollection=(e,t)=>{let r=ki.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function sq(e,t,r){let n=r(t,e);if(typeof n=="symbol")return n;for(let i of["key","value"]){let s=t[i];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let a=sq(Object.freeze(e.concat([[i,o]])),s.items[o],r);if(typeof a=="number")o=a-1;else{if(a===IS)return IS;a===iq&&(s.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(t,e))}}return typeof n=="function"?n(t,e):n}oq.visit=ki});var Hd=v(Nt=>{"use strict";f();var AS=tq(),mse=nq(),gse=aq(),NS="\uFEFF",CS="",PS="",RS="",yse=e=>!!e&&"items"in e,vse=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Ese(e){switch(e){case NS:return"<BOM>";case CS:return"<DOC>";case PS:return"<FLOW_END>";case RS:return"<SCALAR>";default:return JSON.stringify(e)}}function _se(e){switch(e){case NS:return"byte-order-mark";case CS:return"doc-mode";case PS:return"flow-error-end";case RS:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
327
- `:case`\r
328
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Nt.createScalarToken=AS.createScalarToken;Nt.resolveAsScalar=AS.resolveAsScalar;Nt.setScalarValue=AS.setScalarValue;Nt.stringify=mse.stringify;Nt.visit=gse.visit;Nt.BOM=NS;Nt.DOCUMENT=CS;Nt.FLOW_END=PS;Nt.SCALAR=RS;Nt.isCollection=yse;Nt.isScalar=vse;Nt.prettyToken=Ese;Nt.tokenType=_se});var LS=v(uq=>{"use strict";f();var Rc=Hd();function mr(e){switch(e){case void 0:case" ":case`
329
- `:case"\r":case" ":return!0;default:return!1}}var cq=new Set("0123456789ABCDEFabcdef"),Sse=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Qd=new Set(",[]{}"),bse=new Set(` ,[]{}
330
- \r `),xS=e=>!e||bse.has(e),DS=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,r=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let t=this.pos,r=this.buffer[t];for(;r===" "||r===" ";)r=this.buffer[++t];return!r||r==="#"||r===`
331
- `?!0:r==="\r"?this.buffer[t+1]===`
332
- `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let r=this.buffer[t];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+t];if(r==="\r"){let i=this.buffer[n+t+1];if(i===`
333
- `||!i&&!this.atEnd)return t+n+1}return r===`
334
- `||n>=this.indentNext||!r&&!this.atEnd?t+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(t,3);if((n==="---"||n==="...")&&mr(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
335
- `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===Rc.BOM&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let r=t.length,n=t.indexOf("#");for(;n!==-1;){let s=t[n-1];if(s===" "||s===" "){r=n-1;break}else n=t.indexOf("#",n+1)}for(;;){let s=t[r-1];if(s===" "||s===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-r),yield*this.pushNewline(),"stream"}return yield Rc.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&mr(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!mr(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&mr(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let t=this.getLine();if(t===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(t[r]){case"#":yield*this.pushCount(t.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(xS),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,r,n=-1;do t=yield*this.pushNewline(),t>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(t+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&mr(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Rc.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(xS),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||mr(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let t=this.charAt(0),r=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let s=0;for(;this.buffer[r-1-s]==="\\";)s+=1;if(s%2===0)break;r=this.buffer.indexOf('"',r+1)}let n=this.buffer.substring(0,r),i=n.indexOf(`
336
- `,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=n.indexOf(`
337
- `,s)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){let r=this.buffer[++t];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>mr(r)||r==="#")}*parseBlockScalar(){let t=this.pos-1,r=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":r+=1;break;case`
338
- `:t=s,r=0;break;case"\r":{let o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
339
- `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(t+1);if(s===-1)break;t=this.buffer.indexOf(`
340
- `,s)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
341
- `;)n=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let s=t-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);let a=s;for(;o===" ";)o=this.buffer[--s];if(o===`
342
- `&&s>=this.pos&&s+1+r>a)t=s;else break}while(!0);return yield Rc.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let s=this.buffer[n+1];if(mr(s)||t&&Qd.has(s))break;r=n}else if(mr(i)){let s=this.buffer[n+1];if(i==="\r"&&(s===`
343
- `?(n+=1,i=`
344
- `,s=this.buffer[n+1]):r=n),s==="#"||t&&Qd.has(s))break;if(i===`
345
- `){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(t&&Qd.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Rc.SCALAR,yield*this.pushToIndex(r+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,r){let n=this.buffer.slice(this.pos,t);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(xS),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(mr(n)||r&&Qd.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,r=this.buffer[t];for(;!mr(r)&&r!==">";)r=this.buffer[++t];return yield*this.pushToIndex(r===">"?t+1:t,!1)}else{let t=this.pos+1,r=this.buffer[t];for(;r;)if(Sse.has(r))r=this.buffer[++t];else if(r==="%"&&cq.has(this.buffer[t+1])&&cq.has(this.buffer[t+2]))r=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===`
346
- `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
347
- `?yield*this.pushCount(2):0}*pushSpaces(t){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||t&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(t){let r=this.pos,n=this.buffer[r];for(;!t(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};uq.Lexer=DS});var jS=v(lq=>{"use strict";f();var kS=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let r=0,n=this.lineStarts.length;for(;r<n;){let s=r+n>>1;this.lineStarts[s]<t?r=s+1:n=s}if(this.lineStarts[r]===t)return{line:r+1,col:1};if(r===0)return{line:0,col:t};let i=this.lineStarts[r-1];return{line:r,col:t-i+1}}}};lq.LineCounter=kS});var qS=v(mq=>{"use strict";f();var Tse=k("process"),fq=Hd(),wse=LS();function Vn(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function dq(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function hq(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Wd(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function oo(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function Yd(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let r=0;r<t.length;++r)e.push(t[r])}function pq(e){if(e.start.type==="flow-seq-start")for(let t of e.items)t.sep&&!t.value&&!Vn(t.start,"explicit-key-ind")&&!Vn(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,hq(t.value)?t.value.end?Yd(t.value.end,t.sep):t.value.end=t.sep:Yd(t.start,t.sep),delete t.sep)}var MS=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new wse.Lexer,this.onNewLine=t}*parse(t,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(t,r))yield*this.next(n);r||(yield*this.end())}*next(t){if(this.source=t,Tse.env.LOG_TOKENS&&console.log("|",fq.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let r=fq.tokenType(t);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{let n=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let r=t??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&pq(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&dq(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{dq(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}let r=this.startBlockValue(t);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){let r=Wd(this.peek(2)),n=oo(r),i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];let s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:n,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
348
- `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
349
- `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let r=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)t.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Yd(i,r.start),i.push(this.sourceToken),t.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let n=!this.onKeyLine&&this.indent===t.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let o=[];for(let a=0;a<r.sep.length;++a){let c=r.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),t.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(s.push(this.sourceToken),t.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Vn(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(hq(r.key)&&!Vn(r.sep,"newline")){let o=oo(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(Vn(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=oo(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?t.items.push({start:s,key:null,sep:[this.sourceToken]}):Vn(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||r.value?(t.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!r.explicitKey&&r.sep&&!Vn(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&t.items.push({start:s});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let r=t.items[t.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Yd(i,r.start),i.push(this.sourceToken),t.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=t.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;r.value||Vn(r.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>t.indent){let n=this.startBlockValue(t);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let r=t.items[t.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?t.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?t.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?t.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let n=this.startBlockValue(t);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===t.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Wd(n),s=oo(i);pq(t);let o=t.end.splice(1,t.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let r=this.source.indexOf(`
350
- `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
351
- `,r)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=Wd(t),n=oo(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Wd(t),n=oo(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,r){return this.type!=="comment"||this.indent<=r?!1:t.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};mq.Parser=MS});var _q=v(Dc=>{"use strict";f();var gq=wS(),Ose=wc(),xc=Ac(),Ise=b_(),Ase=ue(),Nse=jS(),yq=qS();function vq(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Nse.LineCounter||null,prettyErrors:t}}function Cse(e,t={}){let{lineCounter:r,prettyErrors:n}=vq(t),i=new yq.Parser(r?.addNewLine),s=new gq.Composer(t),o=Array.from(s.compose(i.parse(e)));if(n&&r)for(let a of o)a.errors.forEach(xc.prettifyError(e,r)),a.warnings.forEach(xc.prettifyError(e,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function Eq(e,t={}){let{lineCounter:r,prettyErrors:n}=vq(t),i=new yq.Parser(r?.addNewLine),s=new gq.Composer(t),o=null;for(let a of s.compose(i.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new xc.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(xc.prettifyError(e,r)),o.warnings.forEach(xc.prettifyError(e,r))),o}function Pse(e,t,r){let n;typeof t=="function"?n=t:r===void 0&&t&&typeof t=="object"&&(r=t);let i=Eq(e,r);if(!i)return null;if(i.warnings.forEach(s=>Ise.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function Rse(e,t,r){let n=null;if(typeof t=="function"||Array.isArray(t)?n=t:r===void 0&&t&&(r=t),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=r??t??{};if(!i)return}return Ase.isDocument(e)&&!n?e.toString(r):new Ose.Document(e,n,r).toString(r)}Dc.parse=Pse;Dc.parseAllDocuments=Cse;Dc.parseDocument=Eq;Dc.stringify=Rse});var bq=v(Ee=>{"use strict";f();var xse=wS(),Dse=wc(),Lse=iS(),FS=Ac(),kse=cc(),Gn=ue(),jse=Mn(),Mse=Ke(),qse=Fn(),Fse=Un(),Use=Hd(),Vse=LS(),Gse=jS(),$se=qS(),Jd=_q(),Sq=ic();Ee.Composer=xse.Composer;Ee.Document=Dse.Document;Ee.Schema=Lse.Schema;Ee.YAMLError=FS.YAMLError;Ee.YAMLParseError=FS.YAMLParseError;Ee.YAMLWarning=FS.YAMLWarning;Ee.Alias=kse.Alias;Ee.isAlias=Gn.isAlias;Ee.isCollection=Gn.isCollection;Ee.isDocument=Gn.isDocument;Ee.isMap=Gn.isMap;Ee.isNode=Gn.isNode;Ee.isPair=Gn.isPair;Ee.isScalar=Gn.isScalar;Ee.isSeq=Gn.isSeq;Ee.Pair=jse.Pair;Ee.Scalar=Mse.Scalar;Ee.YAMLMap=qse.YAMLMap;Ee.YAMLSeq=Fse.YAMLSeq;Ee.CST=Use;Ee.Lexer=Vse.Lexer;Ee.LineCounter=Gse.LineCounter;Ee.Parser=$se.Parser;Ee.parse=Jd.parse;Ee.parseAllDocuments=Jd.parseAllDocuments;Ee.parseDocument=Jd.parseDocument;Ee.stringify=Jd.stringify;Ee.visit=Sq.visit;Ee.visitAsync=Sq.visitAsync});f();import{spawn as Oce}from"child_process";import{randomUUID as Ice}from"crypto";import{closeSync as Ace,openSync as Nce}from"fs";import{promises as Cce}from"fs";import BF from"path";f();var Bb=He($b(),1),{program:tue,createCommand:rue,createArgument:nue,createOption:iue,CommanderError:sue,InvalidArgumentError:Mp,InvalidOptionArgumentError:oue,Command:Kb,Argument:aue,Option:cue,Help:uue}=Bb.default;f();f();var TI=He(No(),1);import{promises as on}from"fs";import DK from"os";import Yn from"path";import{randomUUID as LK}from"crypto";var kr=class{workspaceRoot;mcpConfigDir;credentialsPath;configPath;projectContextPath;globalConfigDir=Yn.join(DK.homedir(),`.${te}`);globalCredentialsPath=Yn.join(this.globalConfigDir,"credentials.json");constructor(t){this.setWorkspaceRoot(t)}setWorkspaceRoot(t){this.workspaceRoot=t,this.mcpConfigDir=Yn.join(t,`.${te}`),this.credentialsPath=Yn.join(this.mcpConfigDir,"credentials.json"),this.configPath=Yn.join(this.mcpConfigDir,"config.json"),this.projectContextPath=Yn.join(this.mcpConfigDir,"project-context.json")}async ensureInitialized(){await on.mkdir(this.mcpConfigDir,{recursive:!0});let t=Yn.join(this.mcpConfigDir,".gitignore"),r="*";try{await on.writeFile(t,r,{flag:"wx"})}catch(n){if(n.code!=="EEXIST")throw n}}tempPathFor(t){return`${t}.${process.pid}.${LK()}.tmp`}async atomicWrite(t,r,n){let i=this.tempPathFor(t);await on.writeFile(i,JSON.stringify(r,null,2),n!==void 0?{mode:n}:void 0),await on.rename(i,t)}async readJsonFile(t){try{let r=await on.readFile(t,"utf8");return JSON.parse(r)}catch(r){if(r.code==="ENOENT")return null;throw r}}async unlinkIfExists(t){try{await on.unlink(t)}catch(r){if(r.code!=="ENOENT")throw r}}async fileExists(t){try{return await on.access(t),!0}catch{return!1}}async saveCredentials(t){if(!t.access_token||t.access_token.trim()==="")throw new Error("Invalid credentials: access_token is required");let r={access_token:t.access_token,token_type:t.token_type||"Bearer",savedAt:new Date().toISOString()};if(!this.validateCredentials(r))throw new Error("Invalid credentials: JWT token validation failed");await this.fileExists(this.credentialsPath)?(await this.ensureInitialized(),await this.atomicWrite(this.credentialsPath,r,384)):(await on.mkdir(this.globalConfigDir,{recursive:!0}),await this.atomicWrite(this.globalCredentialsPath,r,384)),D.info("[CredentialStore] Credentials saved successfully")}async loadCredentials(){let t=await this.readJsonFile(this.credentialsPath);if(t){if(this.validateCredentials(t))return t;D.error("[CredentialStore] Workspace credentials are invalid or expired")}let r=await this.readJsonFile(this.globalCredentialsPath);if(r){if(this.validateCredentials(r))return r;D.error("[CredentialStore] Global credentials are invalid or expired")}return null}validateCredentials(t){if(!t||!t.access_token)return D.error("[CredentialStore] Missing access token"),!1;if(t.token_type!=="Bearer")return D.error("[CredentialStore] Invalid token type:",t.token_type),!1;try{let r=TI.default.decode(t.access_token,{complete:!0});if(!r||typeof r=="string")return D.error("[CredentialStore] Failed to decode JWT token"),!1;let n=r.payload;if(n.exp){let i=n.exp*1e3,s=Date.now();if(s>=i)return D.error("[CredentialStore] JWT token has expired"),!1;let o=Math.floor((i-s)/1e3/60);D.debug(`[CredentialStore] Token valid for ${o} more minutes`)}else console.warn("[CredentialStore] JWT token does not have expiration field");return n.iss&&D.debug(`[CredentialStore] Token issued by: ${n.iss}`),n.sub&&D.debug(`[CredentialStore] Token subject: ${n.sub}`),!0}catch(r){return D.error("[CredentialStore] Error validating JWT token:",r.message),!1}}async deleteCredentials(){await this.unlinkIfExists(this.credentialsPath),await this.unlinkIfExists(this.globalCredentialsPath),D.info("[CredentialStore] Credentials deleted")}async areCredentialsValid(){return await this.loadCredentials()!==null}async saveConfig(t){await this.ensureInitialized(),await this.atomicWrite(this.configPath,t)}async loadConfig(){return this.readJsonFile(this.configPath)}async saveProjectContext(t){await this.ensureInitialized();let r={projectExId:t,lastUsed:new Date().toISOString()};await this.atomicWrite(this.projectContextPath,r)}async loadProjectContext(){return this.readJsonFile(this.projectContextPath)}async deleteProjectContext(){await this.unlinkIfExists(this.projectContextPath)}getWorkspaceRoot(){return this.workspaceRoot}getMcpConfigDir(){return this.mcpConfigDir}};f();var FP=He(No(),1);f();f();var Jn=class e extends Error{response;request;constructor(t,r){let n=`${e.extractMessage(t)}: ${JSON.stringify({response:t,request:r})}`;super(n),Object.setPrototypeOf(this,e.prototype),this.response=t,this.request=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e)}static extractMessage(t){return t.errors?.[0]?.message??`GraphQL Error (Code: ${String(t.status)})`}};f();f();f();var Ah=e=>e.toUpperCase(),Tu=e=>typeof e=="function"?e():e,Nh=(e,t)=>e.map((r,n)=>[r,t[n]]),zn=e=>{let t={};return e instanceof Headers?t=kK(e):Array.isArray(e)?e.forEach(([r,n])=>{r&&n!==void 0&&(t[r]=n)}):e&&(t=e),t},kK=e=>{let t={};return e.forEach((r,n)=>{t[n]=r}),t},OI=e=>{try{let t=e();return jK(t)?t.catch(r=>wI(r)):t}catch(t){return wI(t)}},wI=e=>e instanceof Error?e:new Error(String(e)),jK=e=>typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"&&"catch"in e&&typeof e.catch=="function"&&"finally"in e&&typeof e.finally=="function",wu=e=>{throw new Error(`Unhandled case: ${String(e)}`)},Co=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);f();var II=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0};f();var AI=(e,t,r)=>e.query?e:{query:e,variables:t,requestHeaders:r,signal:void 0};f();f();var OP=He(As(),1);f();var fv="Accept",zl="Content-Type",Ia="application/json",Xl="application/graphql-response+json";var dv=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),IP=e=>{let t=e.toLowerCase();return t.includes(Xl)||t.includes(Ia)},pv=e=>{try{if(Array.isArray(e))return{_tag:"Batch",executionResults:e.map(TP)};if(Co(e))return{_tag:"Single",executionResult:TP(e)};throw new Error(`Invalid execution result: result is not object or array.
352
- Got:
353
- ${String(e)}`)}catch(t){return t}},TP=e=>{if(typeof e!="object"||e===null)throw new Error("Invalid execution result: result is not object");let t,r,n;if("errors"in e){if(!Co(e.errors)&&!Array.isArray(e.errors))throw new Error("Invalid execution result: errors is not plain object OR array");t=e.errors}if("data"in e){if(!Co(e.data)&&e.data!==null)throw new Error("Invalid execution result: data is not plain object");r=e.data}if("extensions"in e){if(!Co(e.extensions))throw new Error("Invalid execution result: extensions is not plain object");n=e.extensions}return{data:r,errors:t,extensions:n}},AP=e=>e._tag==="Batch"?e.executionResults.some(wP):wP(e.executionResult),wP=e=>Array.isArray(e.errors)?e.errors.length>0:!!e.errors,hv=e=>typeof e=="object"&&e!==null&&"kind"in e&&e.kind===OP.Kind.OPERATION_DEFINITION;var NP=He(As(),1),CP=He(As(),1),K5=e=>{let t,r=e.definitions.filter(hv);return r.length===1&&(t=r[0].name?.value),t},H5=e=>{let t=!1,r=e.definitions.filter(hv);return r.length===1&&(t=r[0].operation==="mutation"),t},Aa=(e,t)=>{let r=typeof e=="string"||"kind"in e?e:String(e),n=typeof r=="string"?r:(0,CP.print)(r),i=!1,s;if(t)return{expression:n,isMutation:i,operationName:s};let o=OI(()=>typeof r=="string"?(0,NP.parse)(r):r);return o instanceof Error?{expression:n,isMutation:i,operationName:s}:(s=K5(o),i=H5(o),{expression:n,operationName:s,isMutation:i})};f();f();var Zl=JSON;var ef=async e=>{let t={...e,method:e.request._tag==="Single"?e.request.document.isMutation?"POST":Ah(e.method??"post"):e.request.hasMutations?"POST":Ah(e.method??"post"),fetchOptions:{...e.fetchOptions,errorPolicy:e.fetchOptions.errorPolicy??"none"}},n=await W5(t.method)(t),i=await n.text(),s;try{s=Q5(i,n.headers.get(zl),e.fetchOptions.jsonSerializer??Zl)}catch(a){s=a}let o={status:n.status,headers:n.headers,body:i};if(!n.ok){if(s instanceof Error)return new Jn({...o},{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables});let a=s._tag==="Batch"?{...s.executionResults,...o}:{...s.executionResult,...o};return new Jn(a,{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables})}if(s instanceof Error)throw s;if(AP(s)&&t.fetchOptions.errorPolicy==="none"){let a=s._tag==="Batch"?{...s.executionResults,...o}:{...s.executionResult,...o};return new Jn(a,{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables})}switch(s._tag){case"Single":return{...o,...PP(t)(s.executionResult)};case"Batch":return{...o,data:s.executionResults.map(PP(t))};default:wu(s)}},PP=e=>t=>({extensions:t.extensions,data:t.data,errors:e.fetchOptions.errorPolicy==="all"?t.errors:void 0}),Q5=(e,t,r)=>t&&IP(t)?pv(r.parse(e)):pv(e),W5=e=>async t=>{let r=new Headers(t.headers),n=null,i;r.has(fv)||r.set(fv,[Xl,Ia].join(", ")),e==="POST"?(i=(t.fetchOptions.jsonSerializer??Zl).stringify(Y5(t)),typeof i=="string"&&!r.has(zl)&&r.set(zl,Ia)):n=J5(t);let s={method:e,headers:r,body:i,...t.fetchOptions},o=new URL(t.url),a=s;if(t.middleware){let u=await Promise.resolve(t.middleware({...s,url:t.url,operationName:t.request._tag==="Single"?t.request.document.operationName:void 0,variables:t.request.variables})),{url:l,...d}=u;o=new URL(l),a=d}return n&&n.forEach((u,l)=>{o.searchParams.append(l,u)}),await(t.fetch??fetch)(o,a)},Y5=e=>{switch(e.request._tag){case"Single":return{query:e.request.document.expression,variables:e.request.variables,operationName:e.request.document.operationName};case"Batch":return Nh(e.request.query,e.request.variables??[]).map(([t,r])=>({query:t,variables:r}));default:throw wu(e.request)}},J5=e=>{let t=e.fetchOptions.jsonSerializer??Zl,r=new URLSearchParams;switch(e.request._tag){case"Single":return r.append("query",dv(e.request.document.expression)),e.request.variables&&r.append("variables",t.stringify(e.request.variables)),e.request.document.operationName&&r.append("operationName",e.request.document.operationName),r;case"Batch":{let n=e.request.variables?.map(o=>t.stringify(o))??[],i=e.request.query.map(dv),s=Nh(i,n).map(([o,a])=>({query:o,variables:a}));return r.append("query",t.stringify(s)),r}default:throw wu(e.request)}};var it=class{url;requestConfig;constructor(t,r={}){this.url=t,this.requestConfig=r}rawRequest=async(...t)=>{let[r,n,i]=t,s=AI(r,n,i),{headers:o,fetch:a=globalThis.fetch,method:c="POST",requestMiddleware:u,responseMiddleware:l,excludeOperationName:d,...p}=this.requestConfig,{url:h}=this;s.signal!==void 0&&(p.signal=s.signal);let g=Aa(s.query,d),y=await ef({url:h,request:{_tag:"Single",document:g,variables:s.variables},headers:{...zn(Tu(o)),...zn(s.requestHeaders)},fetch:a,method:c,fetchOptions:p,middleware:u});if(l&&await l(y,{operationName:g.operationName,variables:n,url:this.url}),y instanceof Error)throw y;return y};async request(t,...r){let[n,i]=r,s=RP(t,n,i),{headers:o,fetch:a=globalThis.fetch,method:c="POST",requestMiddleware:u,responseMiddleware:l,excludeOperationName:d,...p}=this.requestConfig,{url:h}=this;s.signal!==void 0&&(p.signal=s.signal);let g=Aa(s.document,d),y=await ef({url:h,request:{_tag:"Single",document:g,variables:s.variables},headers:{...zn(Tu(o)),...zn(s.requestHeaders)},fetch:a,method:c,fetchOptions:p,middleware:u});if(l&&await l(y,{operationName:g.operationName,variables:s.variables,url:this.url}),y instanceof Error)throw y;return y.data}async batchRequests(t,r){let n=II(t,r),{headers:i,excludeOperationName:s,...o}=this.requestConfig;n.signal!==void 0&&(o.signal=n.signal);let a=n.documents.map(({document:p})=>Aa(p,s)),c=a.map(({expression:p})=>p),u=a.some(({isMutation:p})=>p),l=n.documents.map(({variables:p})=>p),d=await ef({url:this.url,request:{_tag:"Batch",operationName:void 0,query:c,hasMutations:u,variables:l},headers:{...zn(Tu(i)),...zn(n.requestHeaders)},fetch:this.requestConfig.fetch??globalThis.fetch,method:this.requestConfig.method||"POST",fetchOptions:o,middleware:this.requestConfig.requestMiddleware});if(this.requestConfig.responseMiddleware&&await this.requestConfig.responseMiddleware(d,{operationName:void 0,variables:l,url:this.url}),d instanceof Error)throw d;return d.data}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,r){let{headers:n}=this.requestConfig;return n?n[t]=r:this.requestConfig.headers={[t]:r},this}setEndpoint(t){return this.url=t,this}};var RP=(e,t,r)=>e.document?e:{document:e,variables:t,requestHeaders:r,signal:void 0};f();var K=(e,...t)=>e.reduce((r,n,i)=>`${r}${n}${i in t?String(t[i]):""}`,"");f();var qP=He(MP(),1);(0,qP.config)({quiet:!0});async function Cr(e){let t=await e.loadConfig();if(!t){let r=Ft();t={authEndpoint:r.authEndpoint,apiBaseUrl:r.apiBaseUrl,callbackPort:process.env.LOCAL_CALLBACK_PORT?parseInt(process.env.LOCAL_CALLBACK_PORT,10):8088}}return t}var dX=.25,pX=300*1e3,hX=3600*1e3,mX="query { refreshToken { accessToken } }",Cs=class{store;lastRefreshAt=Date.now();constructor(t){this.store=t}async getValidToken(){let t=await this.store.loadCredentials();if(!t)throw new Error($c);return await this.refreshIfDue(t.access_token)??t.access_token}async refreshIfNeeded(){try{let t=await this.store.loadCredentials();if(!t)return;await this.refreshIfDue(t.access_token)}catch(t){D.debug(`[TokenManager] background refresh check failed: ${t.message}`)}}async refreshIfDue(t){if(!this.isDue(t))return null;try{let r=await Cr(this.store),s=(await new it(`${r.apiBaseUrl}/api/graphql`,{headers:{Authorization:`Bearer ${t}`}}).request(mX)).refreshToken?.accessToken;return s?(await this.store.saveCredentials({access_token:s,token_type:"Bearer"}),this.lastRefreshAt=Date.now(),D.info("[TokenManager] Access token refreshed"),s):(D.debug("[TokenManager] refreshToken returned no accessToken - keeping current token"),null)}catch(r){return D.debug(`[TokenManager] Token refresh failed - keeping current token: ${r.message}`),null}}isDue(t){try{let r=FP.default.decode(t,{complete:!0});if(!r||typeof r=="string")return!1;let n=r.payload;if(!n.exp)return!1;let i=Date.now(),s=n.exp*1e3-i;if(s<=0)return!1;let o=n.iat!=null?(n.exp-n.iat)*1e3*dX:pX;if(s<o)return!0;let a=n.iat!=null?n.iat*1e3:this.lastRefreshAt;return i-a>=hX}catch{return!1}}};f();import{EventEmitter as E7}from"events";f();import{randomUUID as za}from"crypto";f();f();var UP=K`
354
- query TabBarIcons {
355
- getTabBarIcons {
356
- exId
357
- url
358
- }
359
- }
360
- `,VP=K`
361
- fragment SchemaCrdtPatch on SchemaCrdtPatch {
362
- exId
363
- createdAt
364
- content
365
- patchBase64
366
- }
367
- `,gv=K`
368
- fragment SchemaCrdtPatches on SchemaCrdtPatches {
369
- lastPatchExId
370
- patches {
371
- ...SchemaCrdtPatch
372
- }
373
- }
374
- ${VP}
375
- `,rf=K`
376
- query FuzzySearchProjectName(
377
- $projectName: String!
378
- $paginator: ConnectionPaginatorInput
379
- ) {
380
- fuzzySearchProjectName(projectName: $projectName, paginator: $paginator) {
381
- pageInfo {
382
- hasNextPage
383
- endCursor {
384
- value
385
- }
386
- }
387
- edges {
388
- node {
389
- exId
390
- type
391
- name
392
- updatedAt
393
- hasPublished
394
- webProdDomain
395
- }
396
- }
397
- }
398
- }
399
- `,Ei=K`
400
- query FetchAppDetailByExId(
401
- $projectExId: String!
402
- $appExId: String
403
- $appVersionExId: String
404
- ) {
405
- # Non-reconciling resolver: the plain fetchAppDetailByExId is gated by the
406
- # backend @ReconciledSchema aspect, which demands an X-ZED-VERSION header and
407
- # migrates the project schema on read (ZED_VERSION_MISSING otherwise). The
408
- # alias keeps the response key stable so generated types stay valid.
409
- fetchAppDetailByExId: fetchAppDetailByExIdWithoutReconcile(
410
- projectExId: $projectExId
411
- appExId: $appExId
412
- appVersionExId: $appVersionExId
413
- ) {
414
- projectExId
415
- appExId
416
- appType
417
- ... on WebApp {
418
- name
419
- createdAt
420
- lastOpenedAt
421
- collaboratorTypeByLevel
422
- hasPublished
423
- config {
424
- favicon
425
- customDomain
426
- }
427
- isExpired
428
- additional
429
- project {
430
- ...ProjectDetails
431
- lastDeployedServerSchemaExId
432
- }
433
- latestDeployedServerSchema
434
- lastUploadedSchema: latestSchema {
435
- exId
436
- crdtModelUrl
437
- crdtPatches {
438
- ...SchemaCrdtPatches
439
- }
440
- }
441
- }
442
- ... on WechatMiniProgramApp {
443
- name
444
- createdAt
445
- lastOpenedAt
446
- collaboratorTypeByLevel
447
- hasPublished
448
- config {
449
- ...WechatConfigFragment
450
- }
451
- debugScriptUrl
452
- wechatMiniAppPreviewTime
453
- wechatMiniAppPreviewVersion
454
- isExpired
455
- additional
456
- project {
457
- ...ProjectDetails
458
- lastDeployedServerSchemaExId
459
- }
460
- latestDeployedServerSchema
461
- lastUploadedSchema: latestSchema {
462
- exId
463
- crdtModelUrl
464
- crdtPatches {
465
- ...SchemaCrdtPatches
466
- }
467
- }
468
- }
469
- ... on MobileApp {
470
- name
471
- createdAt
472
- lastOpenedAt
473
- collaboratorTypeByLevel
474
- hasPublished
475
- isExpired
476
- additional
477
- project {
478
- ...ProjectDetails
479
- lastDeployedServerSchemaExId
480
- }
481
- latestDeployedServerSchema
482
- lastUploadedSchema: latestSchema {
483
- exId
484
- crdtModelUrl
485
- crdtPatches {
486
- ...SchemaCrdtPatches
487
- }
488
- }
489
- }
490
- ... on Project {
491
- ...ProjectDetails
492
- lastUploadedSchema: latestSchema {
493
- exId
494
- crdtModelUrl
495
- crdtPatches {
496
- ...SchemaCrdtPatches
497
- }
498
- }
499
- deploymentEnvConfigs {
500
- exId
501
- userDeploymentEnvironment
502
- }
503
- }
504
- }
505
- }
506
-
507
- fragment ProjectDetails on Project {
508
- exId
509
- createdAt
510
- updatedAt
511
- name
512
- projectName
513
- collaboratorType
514
- collaboratorTypeByLevel
515
- schemaExId
516
- debugScriptUrl
517
- callbackConfigUrlPrefix
518
- wechatMiniAppPreviewVersion
519
- wechatMiniAppPreviewTime
520
- adminToken
521
- forBeginnerGuide
522
- hasPublished
523
- zeroUrl
524
- zeroSubscriptionUrl
525
- lastDeployedServerSchemaExId
526
- relatedTemplate {
527
- exId
528
- }
529
- projectConfig {
530
- ...ProjectConfigFragment
531
- }
532
- appList {
533
- projectExId
534
- appExId
535
- appType
536
- name
537
- lastOpenedAt
538
- collaboratorType
539
- collaboratorTypeByLevel
540
- hasPublished
541
- expireAt
542
- isExpired
543
- isRenewable
544
- additional
545
- }
546
- vectorStorageSupported
547
- isExpired
548
- webFreeProdDomain
549
- allowCopyToOtherProjects
550
- }
551
-
552
- fragment ProjectConfigFragment on ProjectConfig {
553
- wechatAppConfig {
554
- ...WechatConfigFragment
555
- }
556
- webConfig {
557
- favicon
558
- customDomain
559
- }
560
- aliyunSmsConfig {
561
- powerOfAttorneyImageExId
562
- signature {
563
- description
564
- signSource
565
- signature
566
- }
567
- }
568
- emailConfig {
569
- emailPassword
570
- emailProvider
571
- emailSender
572
- }
573
- aliPayConfig {
574
- appId
575
- merchantPrivateKey
576
- alipayPublicKey
577
- notifyUrl
578
- paymentConfigVersion
579
- }
580
- stripePayConfig {
581
- stripePrivateKey
582
- stripePublicKey
583
- callbackUrl
584
- endpointSecret
585
- paymentConfigVersion
586
- }
587
- wechatPayConfig {
588
- appId
589
- mchId
590
- mchKey
591
- notifyUrl
592
- paymentConfigVersion
593
- wechatPaymentBase64CertFileExId
594
- }
595
- supportedPlatforms
596
- registerToken
597
- }
598
-
599
- fragment WechatConfigFragment on WechatAppConfig {
600
- appId
601
- wechatAppId
602
- wechatAppSecret
603
- hasGrantedThirdPartyAuthorization
604
- wechatPaymentMerchantId
605
- wechatPaymentMerchantKey
606
- wechatPaymentNotifyUrl
607
- paymentConfigVersion
608
- wechatPaymentBase64CertFileExId
609
- wechatPrivateKeyFileExId
610
- wechatBetaAppExpireAt
611
- wechatBetaAppId
612
- }
613
-
614
- ${gv}
615
- `,gX=K`
616
- fragment OrganizationForAgent on Organization {
617
- exId
618
- displayName
619
- ownerName
620
- planType
621
- planExpireAt
622
- permissionEnabled
623
- permissionRoleLimit
624
- capabilities {
625
- capability
626
- limit {
627
- amount
628
- unlimited
629
- }
630
- }
631
- }
632
- `,nf=K`
633
- query FetchCurrentUserInfoForAgent {
634
- user {
635
- exId
636
- email
637
- phoneNumber
638
- username
639
- displayName
640
- availableTechnicalSupportHours
641
- daysSinceRegistration
642
- involvedProjectCount
643
- currentOrganization {
644
- exId
645
- }
646
- organization {
647
- exId
648
- }
649
- organizations {
650
- exId
651
- }
652
- joinedOrganizations {
653
- exId
654
- }
655
- }
656
- }
657
- `,GP=K`
658
- query FetchAccountProfileForAgent {
659
- user {
660
- exId
661
- email
662
- phoneNumber
663
- username
664
- displayName
665
- availableTechnicalSupportHours
666
- daysSinceRegistration
667
- involvedProjectCount
668
- joinedOrganizations {
669
- ...OrganizationForAgent
670
- }
671
- }
672
- }
673
-
674
- ${gX}
675
- `,$P=K`
676
- mutation CreateProjectInOrganizationForAgent(
677
- $projectName: String!
678
- $templateExId: String
679
- $platform: Platform
680
- $projectSpaceType: ProjectSpaceType!
681
- $organizationExId: String!
682
- $forBeginnerGuide: Boolean
683
- $category: ProjectContentCategory
684
- $useRefactoredComponent: Boolean
685
- $useNewType: Boolean
686
- ) {
687
- createProjectInOrganizationAsync(
688
- projectName: $projectName
689
- templateExId: $templateExId
690
- platform: $platform
691
- projectSpaceType: $projectSpaceType
692
- organizationExId: $organizationExId
693
- forBeginnerGuide: $forBeginnerGuide
694
- category: $category
695
- useRefactoredComponent: $useRefactoredComponent
696
- useNewType: $useNewType
697
- )
698
- }
699
- `,sf=K`
700
- query GetFeaturesForAgent($projectExId: String) {
701
- features(projectExId: $projectExId) {
702
- featureName
703
- enabled
704
- }
705
- }
706
- `,BP=K`
707
- mutation RenameProjectForAgent($projectExId: String!, $projectName: String!) {
708
- renameProject(projectExId: $projectExId, projectName: $projectName) {
709
- projectName
710
- }
711
- }
712
- `,KP=K`
713
- mutation RenameAppForAgent(
714
- $projectExId: String!
715
- $appExId: String!
716
- $appName: String!
717
- ) {
718
- renameApp(projectExId: $projectExId, appName: $appName, appExId: $appExId) {
719
- name
720
- }
721
- }
722
- `,HP=K`
723
- mutation DeleteProjectForAgent($projectExId: String!) {
724
- deleteProject(projectExId: $projectExId)
725
- }
726
- `,QP=K`
727
- mutation ResetProjectForAgent(
728
- $projectExId: String!
729
- $languageType: LanguageType!
730
- ) {
731
- resetProject(projectExId: $projectExId, languageType: $languageType)
732
- }
733
- `,WP=K`
734
- query FetchProjectRuntimeAdminAccess(
735
- $projectExId: String!
736
- $appExId: String
737
- $appVersionExId: String
738
- ) {
739
- fetchAppDetailByExIdWithoutReconcile(
740
- projectExId: $projectExId
741
- appExId: $appExId
742
- appVersionExId: $appVersionExId
743
- ) {
744
- appType
745
- ... on WebApp {
746
- project {
747
- adminToken
748
- zeroUrl
749
- adminZeroUrl
750
- }
751
- }
752
- ... on WechatMiniProgramApp {
753
- project {
754
- adminToken
755
- zeroUrl
756
- adminZeroUrl
757
- }
758
- }
759
- ... on Project {
760
- adminToken
761
- zeroUrl
762
- adminZeroUrl
763
- }
764
- }
765
- }
766
- `,YP=K`
767
- query FetchCrdtSchemaBySchemaExId($schemaExId: String!) {
768
- crdtSchemaBySchemaExId(schemaExId: $schemaExId) {
769
- crdtModelUrl
770
- crdtPatches {
771
- ...SchemaCrdtPatches
772
- }
773
- }
774
- }
775
- ${gv}
776
- `,JP=K`
777
- query SchemaCrdtPatchInputFields {
778
- __type(name: "SchemaCrdtPatchCreationDtoInput") {
779
- inputFields {
780
- name
781
- }
782
- }
783
- }
784
- `,zP=K`
785
- mutation BatchCreateSchemaCrdtPatch(
786
- $projectExId: String!
787
- $appExId: String
788
- $schemaExId: String!
789
- $patches: [SchemaCrdtPatchCreationDtoInput!]!
790
- ) {
791
- batchCreateSchemaCrdtPatch(
792
- projectExId: $projectExId
793
- appExId: $appExId
794
- schemaExId: $schemaExId
795
- patches: $patches
796
- ) {
797
- ...SchemaCrdtPatch
798
- }
799
- }
800
- ${VP}
801
- `,yv=K`
802
- mutation SaveSchema(
803
- $projectExId: String!
804
- $appExId: String
805
- $versionExId: String
806
- ) {
807
- saveSchema(
808
- projectExId: $projectExId
809
- appExId: $appExId
810
- versionExId: $versionExId
811
- )
812
- }
813
- `,XP=K`
814
- subscription OnNewCrdtPatchV2(
815
- $projectExId: String!
816
- $appExId: String
817
- $versionExId: String
818
- $latestPatchExIdInClient: String
819
- ) {
820
- onNewCrdtPatchV2(
821
- projectExId: $projectExId
822
- appExId: $appExId
823
- versionExId: $versionExId
824
- shouldExcludeSameSessionDiffs: true
825
- latestPatchExIdInClient: $latestPatchExIdInClient
826
- ) {
827
- ...SchemaCrdtPatches
828
- }
829
- }
830
- ${gv}
831
- `,ZP=K`
832
- subscription OnSchemaUploadV3(
833
- $projectExId: String!
834
- $appExId: String
835
- $appVersionExId: String
836
- ) {
837
- onSchemaUploadV3(
838
- projectExId: $projectExId
839
- appExId: $appExId
840
- shouldExcludeSameSessionEvent: true
841
- appVersionExId: $appVersionExId
842
- ) {
843
- ... on SchemaUploadEndV3 {
844
- __typename
845
- schemaExId
846
- continuous
847
- }
848
- ... on SchemaUploadStartV3 {
849
- __typename
850
- }
851
- }
852
- }
853
- `,eR=K`
854
- mutation DeployV2ForAgent(
855
- $schemaExId: String!
856
- $projectExId: String!
857
- $appExId: String
858
- $buildTarget: BuildTarget!
859
- ) {
860
- deployV2(
861
- schemaExId: $schemaExId
862
- projectExId: $projectExId
863
- appExId: $appExId
864
- buildTarget: $buildTarget
865
- )
866
- }
867
- `,tR=K`
868
- mutation ValidateAndDeploySupportServiceForAgent(
869
- $schemaExId: String!
870
- $projectExId: String!
871
- $appExId: String
872
- ) {
873
- validateAndDeploy(
874
- schemaExId: $schemaExId
875
- projectExId: $projectExId
876
- appExId: $appExId
877
- ) {
878
- appExId
879
- }
880
- }
881
- `,rR=K`
882
- query ResourceUsageAndBurstInfoForAgent(
883
- $projectExId: String!
884
- $nonRealTimeDisplayedResourceTypes: [ResourceType]
885
- ) {
886
- resourceUsageAndBurstInfo(
887
- projectExId: $projectExId
888
- nonRealTimeDisplayedResourceTypes: $nonRealTimeDisplayedResourceTypes
889
- ) {
890
- projectResourceUsageInfo {
891
- availableAmountWithNoExhaustionBurst
892
- resourceType
893
- resourceUsageStatus
894
- usedAmount
895
- unlimited
896
- }
897
- unitComputingPower
898
- visitTimesSupportedByComputingPower
899
- }
900
- }
901
- `,nR=K`
902
- mutation RefreshAllProjectResourcesForAgent($projectExId: String!) {
903
- refreshAllProjectResources(projectExId: $projectExId)
904
- }
905
- `,iR=K`
906
- query MonthlyResourceUsageHistoryForAgent(
907
- $projectExId: String!
908
- $resourceType: ResourceType!
909
- ) {
910
- monthlyResourceUsageHistory(
911
- projectExId: $projectExId
912
- resourceType: $resourceType
913
- )
914
- }
915
- `,sR=K`
916
- query DailyResourceUsageHistoryForAgent(
917
- $projectExId: String!
918
- $resourceType: ResourceType!
919
- ) {
920
- dailyResourceUsageHistory(
921
- projectExId: $projectExId
922
- resourceType: $resourceType
923
- )
924
- }
925
- `,oR=K`
926
- query ActiveSingleTenantResourceInfoForAgent($projectExId: String!) {
927
- findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch(
928
- projectExId: $projectExId
929
- ) {
930
- amount
931
- expireAt
932
- resourceType
933
- }
934
- }
935
- `,ove=K`
936
- query ProjectPlanAndCapabilityForAgentQuery(
937
- $projectExId: String!
938
- $appExId: String
939
- ) {
940
- fetchAppDetailByExId: fetchAppDetailByExIdWithoutReconcile(
941
- projectExId: $projectExId
942
- appExId: $appExId
943
- ) {
944
- projectExId
945
- appExId
946
- appType
947
- ... on WebApp {
948
- project {
949
- ...ProjectPlanAndCapabilityForAgent
950
- }
951
- }
952
- ... on WechatMiniProgramApp {
953
- project {
954
- ...ProjectPlanAndCapabilityForAgent
955
- }
956
- }
957
- ... on MobileApp {
958
- project {
959
- ...ProjectPlanAndCapabilityForAgent
960
- }
961
- }
962
- ... on Project {
963
- ...ProjectPlanAndCapabilityForAgent
964
- }
965
- }
966
- }
967
-
968
- fragment ProjectPlanAndCapabilityForAgent on Project {
969
- capabilities {
970
- capability
971
- limit {
972
- amount
973
- unlimited
974
- }
975
- }
976
- highestPurchasedProjectPlanType
977
- projectPlan {
978
- expireAt
979
- projectPlanType
980
- }
981
- }
982
- `,ave=K`
983
- query ProjectRpsStatsForAgent($projectExId: String!) {
984
- project(projectExId: $projectExId) {
985
- rpsStatsInLast30Days {
986
- exceededNumOfDays
987
- exceededTotal
988
- }
989
- }
990
- }
991
- `,aR=K`
992
- query SupportedCustomModelDescriptor {
993
- supportedCustomModelDescriptor {
994
- chatModelDescriptors
995
- embeddingModelDescriptors
996
- }
997
- }
998
- `,of=K`
999
- query ProjectMetadataForAgent($projectExId: String!, $appExId: String) {
1000
- fetchAppDetailByExId: fetchAppDetailByExIdWithoutReconcile(
1001
- projectExId: $projectExId
1002
- appExId: $appExId
1003
- ) {
1004
- projectExId
1005
- appExId
1006
- appType
1007
- ... on WebApp {
1008
- name
1009
- createdAt
1010
- hasPublished
1011
- isExpired
1012
- config {
1013
- customDomain
1014
- }
1015
- lastUploadedSchema: latestSchema {
1016
- exId
1017
- }
1018
- project {
1019
- ...ProjectMetaSummary
1020
- }
1021
- }
1022
- ... on WechatMiniProgramApp {
1023
- name
1024
- createdAt
1025
- hasPublished
1026
- isExpired
1027
- lastUploadedSchema: latestSchema {
1028
- exId
1029
- }
1030
- project {
1031
- ...ProjectMetaSummary
1032
- }
1033
- }
1034
- ... on MobileApp {
1035
- name
1036
- createdAt
1037
- hasPublished
1038
- isExpired
1039
- lastUploadedSchema: latestSchema {
1040
- exId
1041
- }
1042
- project {
1043
- ...ProjectMetaSummary
1044
- }
1045
- }
1046
- ... on Project {
1047
- ...ProjectMetaSummary
1048
- lastUploadedSchema: latestSchema {
1049
- exId
1050
- }
1051
- deploymentEnvConfigs {
1052
- userDeploymentEnvironment
1053
- }
1054
- }
1055
- }
1056
- project(projectExId: $projectExId) {
1057
- rpsStatsInLast30Days {
1058
- exceededNumOfDays
1059
- exceededTotal
1060
- }
1061
- }
1062
- }
1063
-
1064
- fragment ProjectMetaSummary on Project {
1065
- exId
1066
- projectName
1067
- createdAt
1068
- updatedAt
1069
- hasPublished
1070
- isExpired
1071
- lastDeployedServerSchemaExId
1072
- webFreeProdDomain
1073
- projectConfig {
1074
- supportedPlatforms
1075
- webConfig {
1076
- customDomain
1077
- }
1078
- stripePayConfig {
1079
- paymentConfigVersion
1080
- }
1081
- aliPayConfig {
1082
- paymentConfigVersion
1083
- }
1084
- wechatPayConfig {
1085
- paymentConfigVersion
1086
- }
1087
- wechatAppConfig {
1088
- paymentConfigVersion
1089
- }
1090
- aliyunSmsConfig {
1091
- powerOfAttorneyImageExId
1092
- }
1093
- emailConfig {
1094
- emailProvider
1095
- }
1096
- }
1097
- appList {
1098
- appExId
1099
- appType
1100
- name
1101
- hasPublished
1102
- isExpired
1103
- }
1104
- capabilities {
1105
- capability
1106
- limit {
1107
- amount
1108
- unlimited
1109
- }
1110
- }
1111
- highestPurchasedProjectPlanType
1112
- projectPlan {
1113
- expireAt
1114
- projectPlanType
1115
- }
1116
- }
1117
- `,cR=K`
1118
- mutation CreateStaticSiteDeploymentForAgent(
1119
- $projectExId: String!
1120
- $appExId: String
1121
- $target: StaticSiteTarget!
1122
- $files: [StaticFileInputInput]!
1123
- ) {
1124
- createStaticSiteDeployment(
1125
- projectExId: $projectExId
1126
- appExId: $appExId
1127
- target: $target
1128
- files: $files
1129
- ) {
1130
- exId
1131
- status
1132
- target
1133
- siteUrl
1134
- fileCount
1135
- totalBytes
1136
- }
1137
- }
1138
- `,uR=K`
1139
- mutation GetStaticSiteUploadUrlsForAgent(
1140
- $projectExId: String!
1141
- $appExId: String
1142
- $staticSiteDeploymentExId: String!
1143
- $offset: Int
1144
- $limit: Int
1145
- $paths: [String]
1146
- ) {
1147
- staticSiteUploadUrls(
1148
- projectExId: $projectExId
1149
- appExId: $appExId
1150
- staticSiteDeploymentExId: $staticSiteDeploymentExId
1151
- offset: $offset
1152
- limit: $limit
1153
- paths: $paths
1154
- ) {
1155
- items {
1156
- path
1157
- objectKey
1158
- uploadUrl
1159
- headers
1160
- expiresAt
1161
- }
1162
- nextOffset
1163
- totalCount
1164
- }
1165
- }
1166
- `,lR=K`
1167
- mutation CompleteStaticSiteDeploymentForAgent(
1168
- $projectExId: String!
1169
- $appExId: String
1170
- $staticSiteDeploymentExId: String!
1171
- $dryRun: Boolean
1172
- ) {
1173
- completeStaticSiteDeployment(
1174
- projectExId: $projectExId
1175
- appExId: $appExId
1176
- staticSiteDeploymentExId: $staticSiteDeploymentExId
1177
- dryRun: $dryRun
1178
- ) {
1179
- status
1180
- incomplete
1181
- missingPaths
1182
- missingCount
1183
- siteUrl
1184
- previousDeploymentExId
1185
- }
1186
- }
1187
- `,fR=K`
1188
- mutation AbortStaticSiteDeploymentForAgent(
1189
- $projectExId: String!
1190
- $appExId: String
1191
- $staticSiteDeploymentExId: String!
1192
- ) {
1193
- abortStaticSiteDeployment(
1194
- projectExId: $projectExId
1195
- appExId: $appExId
1196
- staticSiteDeploymentExId: $staticSiteDeploymentExId
1197
- ) {
1198
- exId
1199
- status
1200
- target
1201
- }
1202
- }
1203
- `,dR=K`
1204
- query GetStaticSiteStatusForAgent(
1205
- $projectExId: String!
1206
- $appExId: String
1207
- $target: StaticSiteTarget!
1208
- ) {
1209
- inProgressStaticSiteDeployment(
1210
- projectExId: $projectExId
1211
- appExId: $appExId
1212
- target: $target
1213
- ) {
1214
- exId
1215
- status
1216
- target
1217
- fileCount
1218
- totalBytes
1219
- createdAt
1220
- manifest {
1221
- path
1222
- md5Base64
1223
- sizeBytes
1224
- }
1225
- }
1226
- activeStaticSiteDeployment(
1227
- projectExId: $projectExId
1228
- appExId: $appExId
1229
- target: $target
1230
- ) {
1231
- exId
1232
- status
1233
- target
1234
- siteUrl
1235
- fileCount
1236
- totalBytes
1237
- activatedAt
1238
- }
1239
- }
1240
- `,pR=K`
1241
- mutation StartAgentSession(
1242
- $projectExId: String!
1243
- $client: String!
1244
- $clientVersion: String!
1245
- $sessionId: String!
1246
- $agent: String
1247
- ) {
1248
- startAgentSession(
1249
- projectExId: $projectExId
1250
- client: $client
1251
- clientVersion: $clientVersion
1252
- sessionId: $sessionId
1253
- agent: $agent
1254
- )
1255
- }
1256
- `,hR=K`
1257
- mutation SaveSecretForAgent(
1258
- $projectExId: String!
1259
- $schemaExId: String!
1260
- $secretValue: String!
1261
- ) {
1262
- saveSecret(
1263
- projectExId: $projectExId
1264
- schemaExId: $schemaExId
1265
- secretValue: $secretValue
1266
- ) {
1267
- secretKey
1268
- }
1269
- }
1270
- `,mR=K`
1271
- mutation CreateWechatSourceCodeDeploymentForAgent(
1272
- $projectExId: String!
1273
- $appExId: String
1274
- $files: [WechatSourceCodeFileInputInput]!
1275
- ) {
1276
- createWechatSourceCodeDeployment(
1277
- projectExId: $projectExId
1278
- appExId: $appExId
1279
- files: $files
1280
- ) {
1281
- exId
1282
- status
1283
- fileCount
1284
- totalBytes
1285
- }
1286
- }
1287
- `,gR=K`
1288
- mutation GetWechatSourceCodeUploadUrlsForAgent(
1289
- $projectExId: String!
1290
- $appExId: String
1291
- $wechatSourceCodeDeploymentExId: String!
1292
- $offset: Int
1293
- $limit: Int
1294
- $paths: [String]
1295
- ) {
1296
- wechatSourceCodeUploadUrls(
1297
- projectExId: $projectExId
1298
- appExId: $appExId
1299
- wechatSourceCodeDeploymentExId: $wechatSourceCodeDeploymentExId
1300
- offset: $offset
1301
- limit: $limit
1302
- paths: $paths
1303
- ) {
1304
- items {
1305
- path
1306
- objectKey
1307
- uploadUrl
1308
- headers
1309
- expiresAt
1310
- }
1311
- nextOffset
1312
- totalCount
1313
- }
1314
- }
1315
- `,yR=K`
1316
- mutation CompleteWechatSourceCodeUploadForAgent(
1317
- $projectExId: String!
1318
- $appExId: String
1319
- $wechatSourceCodeDeploymentExId: String!
1320
- $dryRun: Boolean
1321
- ) {
1322
- completeWechatSourceCodeUpload(
1323
- projectExId: $projectExId
1324
- appExId: $appExId
1325
- wechatSourceCodeDeploymentExId: $wechatSourceCodeDeploymentExId
1326
- dryRun: $dryRun
1327
- ) {
1328
- status
1329
- incomplete
1330
- missingPaths
1331
- missingCount
1332
- deploymentRecordExId
1333
- }
1334
- }
1335
- `,vR=K`
1336
- mutation AbortWechatSourceCodeDeploymentForAgent(
1337
- $projectExId: String!
1338
- $appExId: String
1339
- $wechatSourceCodeDeploymentExId: String!
1340
- ) {
1341
- abortWechatSourceCodeDeployment(
1342
- projectExId: $projectExId
1343
- appExId: $appExId
1344
- wechatSourceCodeDeploymentExId: $wechatSourceCodeDeploymentExId
1345
- ) {
1346
- exId
1347
- status
1348
- }
1349
- }
1350
- `,ER=K`
1351
- query GetWechatSourceCodeStatusForAgent(
1352
- $projectExId: String!
1353
- $appExId: String
1354
- ) {
1355
- inProgressWechatSourceCodeDeployment(
1356
- projectExId: $projectExId
1357
- appExId: $appExId
1358
- ) {
1359
- exId
1360
- status
1361
- fileCount
1362
- totalBytes
1363
- createdAt
1364
- lastUploadUrlIssuedAt
1365
- manifest {
1366
- path
1367
- md5Base64
1368
- sizeBytes
1369
- }
1370
- }
1371
- buildingWechatSourceCodeDeployment(
1372
- projectExId: $projectExId
1373
- appExId: $appExId
1374
- ) {
1375
- exId
1376
- status
1377
- fileCount
1378
- totalBytes
1379
- createdAt
1380
- buildStartedAt
1381
- deploymentRecordExId
1382
- }
1383
- }
1384
- `,_R=K`
1385
- query GetWechatSourceCodeDeploymentForAgent(
1386
- $projectExId: String!
1387
- $appExId: String
1388
- $wechatSourceCodeDeploymentExId: String!
1389
- ) {
1390
- wechatSourceCodeDeployment(
1391
- projectExId: $projectExId
1392
- appExId: $appExId
1393
- wechatSourceCodeDeploymentExId: $wechatSourceCodeDeploymentExId
1394
- ) {
1395
- exId
1396
- status
1397
- fileCount
1398
- totalBytes
1399
- createdAt
1400
- buildStartedAt
1401
- deploymentRecordExId
1402
- }
1403
- }
1404
- `,SR=K`
1405
- query GetWechatTrialVersionForAgent($projectExId: String!) {
1406
- project(projectExId: $projectExId) {
1407
- exId
1408
- wechatMiniAppPreviewVersion
1409
- wechatMiniAppPreviewTime
1410
- wechatMiniAppQRCodeBase64
1411
- }
1412
- }
1413
- `,bR=K`
1414
- query GetWechatTrialVersionMetaForAgent($projectExId: String!) {
1415
- project(projectExId: $projectExId) {
1416
- exId
1417
- wechatMiniAppPreviewVersion
1418
- wechatMiniAppPreviewTime
1419
- }
1420
- }
1421
- `,TR=K`
1422
- query DeployedServerSchemaForAgent($projectExId: String!) {
1423
- project(projectExId: $projectExId) {
1424
- exId
1425
- lastDeployedServerSchema
1426
- }
1427
- }
1428
- `;f();var wR=K`
1429
- query FetchLogsByPaginator(
1430
- $queryCreation: QueryCreationInputType
1431
- $paginator: PaginatorType
1432
- ) {
1433
- fetchLogsByPaginator(queryCreation: $queryCreation, paginator: $paginator) {
1434
- edges {
1435
- node {
1436
- content
1437
- createdAt
1438
- eventId
1439
- level
1440
- type
1441
- }
1442
- }
1443
- }
1444
- }
1445
- `;f();import{randomUUID as U9}from"crypto";var cL=He(Gx(),1);f();var C9=He(MD(),1),P9=He(Nf(),1),R9=He(Fs(),1),x9=He(_E(),1),D9=He(TE(),1),L9=He(CE(),1),HD=He(xf(),1),k9=He(KD(),1);var QD=HD.default;f();var WD=100*1024*1024,Lf=class{current=Promise.resolve();async run(t){let r=this.current,n=()=>{};this.current=new Promise(i=>{n=i}),await r;try{return await t()}finally{n()}}},RE=async e=>{let t=await fetch(e);if(!t.ok)throw new Error(`Failed to download CRDT model: ${t.status} ${t.statusText}`);let r=t.body?.getReader();if(!r)throw new Error("Failed to read CRDT model response body");let n=[],i=0;for(;;){let{done:a,value:c}=await r.read();if(a)break;if(i+=c.length,i>WD)throw new Error(`CRDT model is larger than ${WD} bytes`);n.push(c)}let s=new Uint8Array(i),o=0;for(let a of n)s.set(a,o),o+=a.length;return s},Qa=async(e,t)=>{try{return await t()}catch(r){return D.warn(`Optional runtime package unavailable: ${e}`,r.message),null}},YD=null,Mt=async()=>(YD??=Qa("@functorz/ztype",()=>import("./ztype-BFQK2PDI.js")).then(e=>(e?.default??e)?.com?.functorz?.ztype??null),YD),JD=null,eL=async()=>(JD??=Qa("@functorz/ztype",()=>import("./ztype-BFQK2PDI.js")).then(e=>(e?.default??e)?.kotlin?.collections??null),JD),zD=null,tL=async()=>(zD??=Mt().then(e=>e?.typesystem?.schema?.SCHEMA_VERSION??null),zD),XD=null,Wa=async()=>(XD??=Qa("@functorz/crdt-helper",()=>import("./index.cjs-JL7FJKD6.js")).then(e=>e?.Crdt??e?.default?.Crdt??null),XD),ZD=null,xE=async()=>(ZD??=Qa("json-joy/lib/json-crdt-patch/index.js",()=>import("./json-crdt-patch-X2W6V7VS.js")).then(e=>e??Qa("json-joy/lib/json-crdt/index.js",()=>import("./json-crdt-322RBKNB.js"))).then(e=>e?.Patch??e?.default?.Patch??null),ZD),Ya=e=>e?.lastUploadedSchema??null,DE=e=>[e?.project?.lastDeployedServerSchemaExId,e?.lastDeployedServerSchemaExId,e?.project?.latestDeployedServerSchema?.exId,e?.latestDeployedServerSchema?.exId].find(r=>typeof r=="string"&&r.length>0)??null,rL=e=>e==null?e:structuredClone(e),LE=(e,t)=>e?.appExId?e.appExId:t?.name??"",kE=(e,t)=>{let r=e?.typesystem?.schema?.ClientType;if(r)return t==="WECHAT_MINI_PROGRAM"?r.WECHAT_MINI_PROGRAM??r.WECHAT??r.WEB:t==="MOBILE"?r.MOBILE??r.WEB:r.WEB},Ks=e=>{let t=e?.typesystem?.schema?.Product?.[mo];if(!t)throw new Error(`ztype runtime has no Product enum member for ${mo}`);return t},nL=e=>{let t=e?.typesystem?.schema?.Locale?.EN;if(!t)throw new Error("ztype runtime has no Locale enum member for EN");return t},j9=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return String(e)}},kf=e=>({componentId:e?.componentId??null,message:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("EN"):e?.message??String(e),zhMessage:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("ZH"):void 0,platform:e?.platform??null,isBackendError:!!e?.isBackendError,fullPath:j9(e?.fullPath??[])}),jf=e=>e.stableErrors.concat(e.betaErrors).filter(t=>!!t.isBackendError),iL=e=>jf(e).length,sL=(e,t)=>{if(t.__typename==="DiffItem"){let r=t.pathComponents?.at(-1)?.key??"";if(t.operation==="delete"){delete e[r];return}e[r]=structuredClone(t.newValue);return}if(t.__typename==="ArrayDiffItem"){let r=t.pathComponents?.at(-1)?.index??-1;if(!Array.isArray(e)||r<0)throw new Error("Invalid array diff target");if(t.operation==="delete"){e.splice(r,1);return}if(t.operation==="insert"){e.splice(r,0,structuredClone(t.newValue));return}e[r]=structuredClone(t.newValue)}};f();var oL=He(No(),1);import{createRequire as M9}from"module";var q9=M9(import.meta.url);var Mf=e=>{if(tn){if(e==="@functorz/ztype")return tn.ztype;if(e==="@functorz/crdt-helper")return tn.crdtHelper;if(e==="json-joy")return tn.jsonJoy}try{let t=q9(`${e}/package.json`);return t.ztypeBuild??t.version??"unknown"}catch{return"unavailable"}},F9=async()=>{if(tn)return{ztypeVersion:tn.ztype,ztypeSchemaVersion:tn.ztypeSchemaVersion};try{let e=await Mt();return{ztypeVersion:Mf("@functorz/ztype"),ztypeSchemaVersion:e?.ZTypeSystem?.getSchemaVersion?.()??"unknown"}}catch{return{ztypeVersion:Mf("@functorz/ztype"),ztypeSchemaVersion:"unavailable"}}};async function jE(){let e=db(),t=await F9();return{agentVersion:e.version??"0.0.0",nodeMajor:process.versions.node.split(".")[0],platform:process.platform,arch:process.arch,ztypeVersion:t.ztypeVersion,ztypeSchemaVersion:t.ztypeSchemaVersion,crdtHelperVersion:Mf("@functorz/crdt-helper"),jsonJoyVersion:Mf("json-joy")}}async function Hs(e,t){let[r,n,i]=await Promise.all([jE(),Cr(e),e.loadCredentials()]),s=i?oL.default.decode(i.access_token):null,o=typeof s=="object"&&s!==null?String(s.sub??s.exId??s.id??"authenticated"):"anonymous";return{...r,product:te,apiBaseUrl:n.apiBaseUrl,authUserId:o,workspaceRoot:e.getWorkspaceRoot(),typeSystemMode:qi(),startupFlags:[...t].sort()}}function aL(e,t){return JSON.stringify(e)===JSON.stringify(t)}var qE=U9(),uL=`${te}/${Hn()}`,V9=e=>{if(!e)return e;if(Array.isArray(e))return e.map(([r,n])=>[r,String(r).toLowerCase()==="authorization"?"Bearer <redacted>":n]);if(typeof e=="object"&&"forEach"in e&&typeof e.forEach=="function"){let r={};return e.forEach((n,i)=>{r[i]=i.toLowerCase()==="authorization"?"Bearer <redacted>":String(n)}),r}let t={};for(let[r,n]of Object.entries(e))t[r]=r.toLowerCase()==="authorization"?"Bearer <redacted>":String(n);return t};function FE(e){if(!Array.isArray(e)||e.length===0)return null;let t=e.map(r=>{let n=r,i=typeof n.operation=="string"?n.operation:null,s=typeof n.errorType=="string"?n.errorType:typeof n.extensions?.classification=="string"?n.extensions.classification:null,o=typeof n.message=="string"?n.message:null;return!o&&!i&&!s?null:`${i?`${i}: `:""}${o??"GraphQL error"}${s?` (${s})`:""}`}).filter(r=>!!r);return t.length>0?t.join("; "):null}var G9=e=>{if(typeof e=="string")return e;if(e instanceof Uint8Array)return Buffer.from(e).toString("utf8");try{return String(e)}catch{return"<unserializable body>"}},Qs=async(e,t)=>{let r=gp();D.debug(`[HTTP] Request URL: ${e.toString()}`),t?.headers&&D.debug(`[HTTP] Request Headers: ${JSON.stringify(V9(t.headers))}`),r&&t?.body!=null&&D.debug(`[GQL] Request Body: ${G9(t.body)}`);let n=await fetch(e,t),i=null;try{i=await n.clone().text()}catch(s){D.debug(`[GQL] Response read failed: ${String(s)}`)}if(r&&D.debug(`[GQL] Response ${n.status}: ${i??"<read failed>"}`),i&&i.includes('"errors"')){let s=null;try{s=JSON.parse(i).errors}catch{s=null}let o=FE(s);o&&D.warn(`[GQL] ${n.status} errors: ${o}`)}return n};async function UE(e,t){let r=await e.getValidToken(),n=await Cr(t),i={Authorization:`Bearer ${r}`,"User-Locale":"en_US","X-SESSION-ID":qE,"X-Client":uL},s=await tL();return s&&(i["X-ZED-VERSION"]=s),process.env.REACT_APP_VERSION&&(i["X-REACT-APP-VERSION"]=process.env.REACT_APP_VERSION),new it(`${n.apiBaseUrl}/api/graphql`,{headers:i,fetch:Qs})}var ME=class extends QD{constructor(...t){super(...t),this.on("error",r=>D.debug(`[SUB] socket error: ${r.message}`))}};async function lL(e,t){let r=await e.getValidToken(),i=`${(await Cr(t)).apiBaseUrl.replace(/^http:/,"ws:").replace(/^https:/,"wss:")}/api/graphql-subscription`;return async(s,o,a)=>{let c=gp(),u={authToken:r,"X-SESSION-ID":qE,"X-Client":uL};D.debug(`[SUB] connecting ${i} params=${JSON.stringify({...u,authToken:"Bearer <redacted>"})}`);let l=new cL.SubscriptionClient(i,{lazy:!0,reconnect:!0,minTimeout:3e3,connectionParams:u},ME);l.onConnected(()=>D.debug("[SUB] connected")),l.onReconnected(()=>D.debug("[SUB] reconnected")),l.onDisconnected(()=>D.debug("[SUB] disconnected")),l.onError(h=>D.debug(`[SUB] error ${h?.message??String(h)}`));let p=[{name:"onNewCrdtPatchV2",query:XP,variables:{projectExId:s.projectExId,appExId:s.appExId??null,versionExId:s.appVersionExId??null,latestPatchExIdInClient:o}},{name:"onSchemaUploadV3",query:ZP,variables:{projectExId:s.projectExId,appExId:s.appExId??null,appVersionExId:s.appVersionExId??null}}].map(h=>(D.debug(`[SUB] subscribe ${h.name} vars=${JSON.stringify(h.variables)}`),l.request({query:h.query,variables:h.variables}).subscribe({next:g=>{c&&D.debug(`[SUB] ${h.name} event: ${JSON.stringify(g)}`),a()},error:g=>{D.warn("Schema subscription event failed",String(g)),a()}})));return{unsubscribe(){for(let h of p)h.unsubscribe();l.close(!1,!1)}}}}async function fL(e,t){if(t.projectExId)return await e.saveProjectContext(t.projectExId),t.projectExId;let r=await e.loadProjectContext();if(!r?.projectExId)throw new Error("No projectExId provided and no current project is set");return r.projectExId}async function VE(e,t,r,n){try{await e.request(pR,{projectExId:t,client:te,clientVersion:Hn(),sessionId:n??qE,agent:r??null}),D.debug(`[agent-session] started for project ${t}`)}catch(i){D.debug(`[agent-session] skipped: ${String(i)}`)}}f();f();f();import{createHash as $9}from"crypto";var B9=e=>!!(e&&typeof e=="object"&&!Array.isArray(e)),GE=e=>{if(Array.isArray(e))return e.map(r=>r===void 0?null:GE(r));if(!B9(e))return e;let t={};for(let r of Object.keys(e).sort()){let n=e[r];n!==void 0&&(t[r]=GE(n))}return t},K9=e=>JSON.stringify(GE(e)),H9=e=>$9("sha256").update(K9(e)).digest("hex"),dL=e=>({projectExId:e.projectExId,appExId:e.appExId??null,appVersionExId:e.appVersionExId??null,schemaExId:e.schemaExId??null,lastPatchExId:e.lastPatchExId??null,snapshotHash:H9(e.snapshot),deployedSchemaExId:e.deployedSchemaExId??null,checkedAt:e.checkedAt??new Date().toISOString()}),pL=(e,t)=>!e||!t?e!==t:e.schemaExId!==t.schemaExId||e.lastPatchExId!==t.lastPatchExId||e.snapshotHash!==t.snapshotHash||e.deployedSchemaExId!==t.deployedSchemaExId,qf=e=>e.changes.length>0;var hL=null,Q9=()=>(hL??=Mt().then(e=>{let t=e?.typesystem?.schema?.diff?.computeSemanticSchemaChanges;return typeof t=="function"?t:null}),hL),W9=async(e,t)=>{let r=await Q9();return r?r(e,t):{changes:[]}},$E=(e,t)=>W9(JSON.stringify(e),JSON.stringify(t));f();var Y9="Functorz";function mL(e,t,r,n){let i=e?.typesystem?.settings,s=e?.typesystem?.schema,o=t?.KtList,a=t?.KtMap;if(!i?.ExtraContext||!s?.CustomChatModelDescriptor||!s?.AIModelDescriptors||!o||!a)return D.warn("ztype ExtraContext symbols missing; schema graph will be built without custom models"),null;try{let{ExtraContext:c}=i,{AIModelDescriptors:u,CustomChatModelDescriptor:l,CustomEmbeddingModelDescriptor:d,ModelCustomParamDescriptor:p,CustomModelParam:h,CustomChatCompletionFeatures:g,Identifier:y,MediaOutputCardinality:E}=s,S=O=>a.fromJsMap(new Map(Object.entries(O??{}))),_=O=>typeof O=="string"?O==="single"?E.SINGLE:O==="multiple"?E.MULTIPLE:E.NONE:typeof O=="boolean"&&O?E.MULTIPLE:E.NONE,w=O=>new p(O.name,S(O.displayName),O.type,S(O.description)),I=O=>new h(w(O.serverUrl),w(O.apiToken),o.fromJsArray((O.extensionParams??[]).map($=>new p($.name,S($.displayName),$.type,S($.displayName))))),T=O=>O.provider===Y9&&O.customModelIdentifier?new y(O.customModelIdentifier.id,O.customModelIdentifier.namespace):null,N=(r?.chatModelDescriptors??[]).map(O=>new l(O.provider,O.name,I(O.paramToConfigure),O.delisted,new g(O.features.streamResponse,O.features.multiModal,O.features.imageInput??!1,!1,O.features.videoInput??!1,O.features.imageMessageInput??!1,!1,O.features.videoMessageInput??!1,O.features.tools,O.features.reasoningContent,O.features.imageOutput,O.features.videoOutput,_(O.features.imageOutput),_(O.features.videoOutput),null,O.features.structuredOutput),T(O))),P=(r?.embeddingModelDescriptors??[]).map(O=>new d(O.provider,O.name,I(O.paramToConfigure),T(O),O.delisted));return new c(new u(o.fromJsArray(N),o.fromJsArray(P)),a.fromJsMap(new Map),n)}catch(c){return D.warn("ztype ExtraContext construction failed; schema graph will be built without custom models",c.message),null}}f();var Cn=class extends Error{constructor(r,n){super(r);this.diagnostics=n;this.name="ZtypeValidationError"}};f();function Ff(e,t,r,n=null){let i=kE(e,r?.appType);return e.api.ZTypeCoreApi.genZTypeApiContext(t,Ks(e),i,LE(r,i),nL(e),n)}function gL(e,t){return LE(t,kE(e,t?.appType))}f();var yL={QUERY:"query",MUTATION:"mutation"},vL={SUCCESS:"2xx",PERMANENT_FAIL:"4xx",TEMPORARY_FAIL:"5xx"};function EL(e){let t=r=>{if(Array.isArray(r))return r.map(t);if(r&&typeof r=="object"){let n={};for(let[i,s]of Object.entries(r))i==="operation"&&typeof s=="string"&&yL[s]!==void 0?n[i]=yL[s]:i==="responseBranch"&&typeof s=="string"&&vL[s]!==void 0?n[i]=vL[s]:n[i]=t(s);return n}return r};return e.map(t)}function _L(e){let t=r=>typeof r=="string"&&!r.startsWith("http://")&&!r.startsWith("https://");for(let r of e){let n=r;if(!n?.args||typeof n.args!="object")continue;let i=n.args,s=[];if(n.name==="UPDATE_TPA_CONFIG")s.push(i.url);else if(n.name==="ADD_TPA_CONFIGS"&&Array.isArray(i.items))for(let o of i.items)o&&typeof o=="object"&&s.push(o.url);for(let o of s)if(t(o))return`url "${o}" is not an absolute URL. A TPA config url must include the scheme and host (e.g. https://api.example.com/v1/resource) \u2014 find the API's base URL in its documentation.`}return null}f();var Pn=e=>e==null,BE=(e,t)=>{if(Pn(e)&&Pn(t)||e===t)return!0;if(Pn(e)||Pn(t)||typeof e!="object"||typeof t!="object")return!1;let r=e,n=t,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let s of i)if(!BE(r[s],n[s]))return!1;return!0};var KE=e=>{let t=new Set;for(let r of e)if(t.add(r.pathComponents.map(n=>n.index!==void 0?`[${n.index}]`:`.${n.key}`).join("").replace(/^\./,"")),t.size>=20)break;return[...t]},SL=e=>{if(e.__typename==="DiffItem")switch(e.operation){case"add":return{__typename:"DiffItem",oldValue:e.newValue,newValue:null,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"DiffItem",oldValue:null,newValue:e.oldValue,operation:"add",pathComponents:e.pathComponents};case"update":return{__typename:"DiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}else switch(e.operation){case"insert":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:null,previousValue:e.previousValue,nextValue:e.nextValue,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"ArrayDiffItem",oldValue:null,newValue:e.oldValue,previousValue:e.previousValue,nextValue:e.nextValue,operation:"insert",pathComponents:e.pathComponents};case"update":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}throw new Error(`Cannot reverse diff item: ${JSON.stringify(e)}`)},J9=e=>e.key??e.index??"",z9=(e,t)=>{let r=e;for(let n of t){if(r===null||typeof r!="object")return;r=r[n]}return r},X9=(e,t)=>{if(t.__typename!=="DiffItem")return null;let r=t.pathComponents.at(-1)?.key;if(r===void 0)return null;let n=BE(e[r],t.oldValue);switch(t.operation){case"add":e[r]=t.newValue;break;case"update":if(!n)return null;e[r]=t.newValue;break;case"delete":if(!Object.prototype.hasOwnProperty.call(e,r)||!n)return null;delete e[r];break;default:return null}return t},Z9=(e,t)=>{if(t.__typename!=="ArrayDiffItem")return null;let r=t.pathComponents.at(-1)?.index;if(r===void 0||r>e.length)return null;let n=()=>BE(e[r],t.oldValue);switch(t.operation){case"insert":e.splice(r,0,t.newValue);break;case"delete":if(!n())return null;e.splice(r,1);break;case"update":if(!n())return null;e.splice(r,1,t.newValue);break;default:return null}return t},bL=(e,t)=>{let r=e,n=new WeakSet,i=o=>{if(r===null||typeof r!="object")return r;n.has(r)||(r=Array.isArray(r)?[...r]:{...r},n.add(r));let a=r;for(let c of o){let u=a[c];if(u!==null&&typeof u=="object"){if(!n.has(u)){let l=Array.isArray(u)?[...u]:{...u};n.add(l),a[c]=l}a=a[c]}else a=u}return a},s=[];for(let o of t)try{let c=o.pathComponents.map(J9).slice(0,-1);if(Pn(z9(r,c)))continue;let u=i(c);if(Array.isArray(u)){let l=Z9(u,o);l&&s.push(l)}else if(u!==null&&typeof u=="object"){let l=X9(u,o);l&&s.push(l)}}catch{continue}return s};f();var e7=3e4,Uf=class{constructor(t){this.options=t}timer=null;subscriptionHandle=null;running=!1;isActive(){return this.timer!==null||this.subscriptionHandle!==null}start(){this.timer||this.subscriptionHandle||!this.options.subscriptionFactory||this.options.subscriptionFactory(this.options.sessionKey,this.options.getLastPatchExId(),()=>{this.run()}).then(t=>{this.subscriptionHandle=t}).catch(t=>{D.warn("Schema subscription failed; falling back to polling",t.message)}).finally(()=>{this.schedulePoll()})}dispose(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.subscriptionHandle?.unsubscribe(),this.subscriptionHandle=null}schedulePoll(){!this.options.subscriptionFactory||this.timer||(this.timer=setTimeout(()=>{this.timer=null,this.run().finally(()=>this.schedulePoll())},e7),this.timer.unref())}async run(){if(!this.running){this.running=!0;try{await this.options.refresh()}finally{this.running=!1}}}};f();var TL=(e,t)=>{let r=new WeakMap,n=o=>{let a=r.get(o);return a||(a=Array.isArray(o)?[...o]:{...o},r.set(o,a)),a},i=new WeakMap,s=n(e);for(let o of t){let a=(o?.pathComponents??[]).slice(0,-1),c=e,u=s;for(let l of a){let d=l.key??l.index??"",p=c[d];if(p===null||typeof p!="object")break;if(Array.isArray(p)){let h=i.get(p);h||(h=structuredClone(p),i.set(p,h)),u[d]=h;break}u[d]=n(p),c=p,u=u[d]}}return s};f();f();var t7=new Set(["BACKEND_ONLY","COMBINED"]),Ja=e=>!e?.appType||t7.has(e.appType)?!1:(e.project?.appList??[]).some(t=>t.appType==="BACKEND_ONLY"),OL=(e,t)=>{if(!t)return e;let r=t.model.view();return{...e,server:r?.server??null}},Vf=e=>e?.pathComponents?.[0]?.key==="server",wL=e=>typeof e=="string"&&e.length>0?e:null,HE=(e,t)=>{let r=e.serverDoc;if(r){let i=wL(r.schemaExId);return i?{ok:!0,appExId:null,schemaExId:i}:{ok:!1,error:"the backend app document has no schemaExId"}}if(e.serverDocRequired===!0)return{ok:!1,error:"this client app's server lives in the backend app's document, which did not load, so there is nothing to sync; retry, or run project sync-backend without appExId"};let n=wL(e.schemaExId);return n?{ok:!0,appExId:t,schemaExId:n}:{ok:!1,error:"the session has no schemaExId"}};f();var QE=null,IL=async e=>(QE??=e.request(JP).then(t=>(t.__type?.inputFields??[]).some(r=>r.name==="origin")).catch(()=>(QE=null,!1)),await QE?{origin:"MCP"}:{});var WE=300*1e3,r7=100,n7=50,i7=["dataModel","types"];function s7(e){let t=e.server;if(!t||typeof t!="object"||Array.isArray(t))return e;let r={};for(let i of i7){let s=t[i];s!==void 0&&(r[i]=s)}let n={};return e.version!==void 0&&(n.version=e.version),n.server=r,n}var o7={ADD_ACTION_FLOW_OUTPUT_FIELDS:"SET_ACTION_FLOW_OUTPUT",DELETE_ACTION_FLOW_OUTPUT_FIELDS:"CLEAR_ACTION_FLOW_OUTPUT",SET_ACTION_FLOW_OUTPUT:"ADD_ACTION_FLOW_OUTPUT_FIELDS",CLEAR_ACTION_FLOW_OUTPUT:"DELETE_ACTION_FLOW_OUTPUT_FIELDS"};function AL(e){return e==="post_type_system_refactor"?"post-type-system-refactor (refactored)":"pre-type-system-refactor (legacy)"}function a7(e,t,r){let n=`${e} requires a ${AL(t)} schema, but this project is ${AL(r)}.`,i=o7[e];if(i)return`${n} Use ${i} instead.`;if(t!=="post_type_system_refactor")return`${n} Use the corresponding post-type-system-refactor op instead.`;let s="The daemon auto-detects migrated projects from the loaded schema \u2014 do not force MCP_TYPE_SYSTEM=post to bypass this gate; it cannot migrate the project, and post-only config written into a pre-refactor schema is invisible to the editor.";return/^(GET_ALL_API|GET_API|ADD_API|UPDATE_API|DELETE_API)/.test(e)?`${n} API-integration workspaces only exist after the type-system refactor. ${s} To integrate an external HTTP endpoint on this project, use the TPA ops instead (third-party-api.md, e.g. ADD_TPA_CONFIGS).`:`${n} Enums and object/custom types only exist after the type-system refactor \u2014 migrate the project in the editor first. ${s}`}function c7(e){if(typeof e!="string")return e;let t=e.trim();if(!/^[[{]|^(true|false|null|-?\d)/.test(t))return e;try{return JSON.parse(t)}catch{return e}}function u7(e){if(typeof e!="string")return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;let r={};for(let[n,i]of Object.entries(t))r[n]=c7(i);return r}function l7(e){let t=new Set;return e.map(r=>{if(!r||typeof r!="object")return r;let n=r,i=typeof n.toolCallId=="string"&&n.toolCallId?n.toolCallId:null;if(i!==null&&t.has(i))throw new Error(`Duplicate toolCallId: ${i}`);let s=i??za();return t.add(s),i===s?n:{...n,toolCallId:s}})}function f7(e,t){if(!e)return;let r=new Map(Object.entries(e)),n=t.map((i,s)=>{if(!r.has(i))throw new Error(`Missing ztype response for tool call ${s}`);let o=r.get(i);return r.delete(i),o});if(r.size>0)throw new Error(`Unexpected ztype responses: ${[...r.keys()].join(", ")}`);return n}function d7(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?Object.values(t).find(n=>typeof n=="string")??t:t):[]}function p7(e){let t=e??{},r=t.data??{},n={},i=u7(r.responseByToolCallId??t.responseByToolCallId);i&&Object.keys(i).length>0&&(n.responses=i);let s=r.schemaDiff??t.schemaDiff;s&&(n.schemaDiff=s);let o=d7(t.errors??r.errors);return o.length>0&&(n.errors=o),n}function h7(e){let t=e??{},r=t.data?.updatedReadState;if(r!=null)return r;if(typeof t.updatedReadStateJson=="string")try{return JSON.parse(t.updatedReadStateJson)}catch{return}}function m7(e){return(e??{}).data?.touchesComponents===!0}function g7(e,t){let r=e??{};if(r.isSuccess!==!1)return{};let n={},i=typeof r.failedToolCallId=="string"?t.indexOf(r.failedToolCallId):-1;i>=0&&(n.failedIndex=i),typeof r.errorCode=="string"&&(n.errorCode=r.errorCode),r.failedBeforeExecution===!0&&(n.failedBeforeExecution=!0);let s=Array.isArray(r.detailKeys)?r.detailKeys:[],o=Array.isArray(r.detailValues)?r.detailValues:[];if(s.length>0&&s.length===o.length){let a={};s.forEach((c,u)=>{typeof c=="string"&&typeof o[u]=="string"&&(a[c]=o[u])}),Object.keys(a).length>0&&(n.errorDetails=a)}return n}async function y7(e){let r=(await Mt())?.application?.schemaops?.SchemaOpsErrorCode?.DEPENDENCY_CONFLICT?.name,i=(e.diagnostics?.stableErrors??[]).map(s=>{let o=s??{};return[o.componentId,o.message].filter(a=>typeof a=="string"&&a!=="").join(": ")}).filter(s=>s!=="");return{applied:{applied:!1,reason:"ztype validation interrupted the batch"},errors:i.length>0?i:[e.message],...typeof r=="string"?{errorCode:r}:{},errorDetails:{dependents:i.join("; ")},ztypeDiagnostics:e.diagnostics}}function v7(e){return e?e.available===!1||(e.stableErrors?.length??0)>0||(e.betaErrors?.length??0)>0:!1}var Xa=class e{constructor(t,r,n,i){this.client=t;this.sessionKey=r;this.onSchemaEvent=i;this.key=e.stringifyKey(r),this.watcher=new Uf({sessionKey:r,subscriptionFactory:n,getLastPatchExId:()=>this.lastPatchExId,refresh:()=>this.runWatchRefresh()})}crdtBinary=null;model=null;serverDoc=null;schemaGraph=null;extraContext=null;extraContextLoaded=!1;enabledProjectFeatureNames=[];appDetail=null;snapshot=null;schemaExId=null;lastPatchExId=null;appliedPatchExIds=new Set;staleReason="not loaded";lastError=null;lastZtypeDiagnostics=null;diagnosedFor=null;lastRevision=null;events=[];undoStack=[];redoStack=[];watcher;loadedAt=0;lastUsedAt=Date.now();mutex=new Lf;key;static stringifyKey(t){return[t.projectExId,t.appExId??"",t.appVersionExId??""].join(":")}isExpired(t=Date.now()){return t-this.lastUsedAt>WE}currentView(){if(!this.model)throw new Error("CRDT model not loaded");return OL(this.model.view(),this.serverDoc)}lastPatchExIds(){return[this.lastPatchExId,this.serverDoc?.lastPatchExId??null].filter(t=>typeof t=="string")}refactorState(){return this.snapshot?Sb(this.snapshot.server):null}assertToolCallsMatchTypeSystem(t){let r=this.refactorState();if(!r)throw new Error("Schema is not loaded; run schema load before calling schema tools.");for(let n of t){let i=n?.name;if(typeof i!="string")continue;let s=_b[i];if(s&&s!==r)throw new Error(a7(i,s,r))}}normalizeExternalColumnTypes(t){let r=new Set(["typeIdentifier","basicTypeNameOrTypeId"]),n={TEXT:"STRING",INTEGER:"BIGINT",FLOAT8:"DECIMAL"},i=s=>{if(Array.isArray(s))return s.map(i);if(s&&typeof s=="object"){let o={};for(let[a,c]of Object.entries(s))o[a]=r.has(a)&&typeof c=="string"&&n[c.toUpperCase()]?n[c.toUpperCase()]:i(c);return o}return s};return t.map(i)}status(){return{key:this.key,projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null,appVersionExId:this.sessionKey.appVersionExId??null,schemaExId:this.schemaExId,lastPatchExId:this.lastPatchExId,serverDocRequired:Ja(this.appDetail),serverDoc:this.serverDoc?{schemaExId:this.serverDoc.schemaExId,lastPatchExId:this.serverDoc.lastPatchExId}:null,loadedAt:this.loadedAt?new Date(this.loadedAt).toISOString():null,lastUsedAt:new Date(this.lastUsedAt).toISOString(),staleReason:this.staleReason,lastError:this.lastError,typeSystem:this.refactorState(),typeSystemMode:this.refactorState()??qi(),schemaRevision:this.lastRevision,ztypeDiagnostics:this.lastZtypeDiagnostics,crdtBinaryBytes:this.crdtBinary?.byteLength??null,hasCrdtModel:this.model!==null,hasZtypeGraph:this.schemaGraph!==null,schemaEventCount:this.events.length,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,watcherActive:this.watcher.isActive()}}state(){return{...this.status(),latestEvent:this.events.at(-1)??null}}listEvents(t,r=100){if(!t)return this.events.slice(-r);let n=this.events.findIndex(i=>i.id===t);return(n>=0?this.events.slice(n+1):this.events).slice(-r)}async checkRemoteAndSync(){return this.mutex.run(async()=>this.withErrorState(async()=>this.checkRemoteAndSyncLocked("remote")))}async load(t=!1){return this.mutex.run(async()=>this.withErrorState(()=>this.loadLocked(t)))}async sync(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),!this.schemaExId)return this.loadLocked();let t=await this.client.request(YP,{schemaExId:this.schemaExId}),r=t.crdtSchemaBySchemaExId?.crdtPatches?.patches??[];return await this.applyNetworkPatches(r),await this.syncServerDocLocked(),this.model&&(this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics()),this.lastPatchExId=t.crdtSchemaBySchemaExId?.crdtPatches?.lastPatchExId??this.lastPatchExId,this.updateRevision(),this.status()}))}getSnapshot(t=!1){if(this.touch(),this.model?.view&&(this.snapshot=this.currentView()),!this.snapshot)throw new Error("Project schema is not loaded");return t?this.snapshot:s7(this.snapshot)}dataModel(){let t=this.getSnapshot().server;return!t||typeof t!="object"?null:t.dataModel??null}async save(){return this.mutex.run(async()=>this.withErrorState(async()=>{this.touch();let t=await this.currentZtypeDiagnostics(),r=await this.client.request(yv,{projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null,versionExId:this.sessionKey.appVersionExId??null});if(this.schemaExId=r.saveSchema,this.serverDoc){let n=await this.client.request(yv,{projectExId:this.sessionKey.projectExId,appExId:null,versionExId:null});this.serverDoc.schemaExId=n.saveSchema}return this.updateRevision(),{...this.status(),ztypeDiagnostics:t}}))}async validate(){return this.mutex.run(async()=>this.withErrorState(async()=>(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.currentZtypeDiagnostics())))}async ztypeToolCalls(t,r=!1,n=null,i=!1){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),!this.schemaGraph)throw new Error("ztype runtime is unavailable; install @functorz/ztype in this package");this.assertToolCallsMatchTypeSystem(t);let s=await Mt(),o=s?.api;if(!o?.ZTypeCoreApi||!o?.ZTypeSchemaOpsApi)throw new Error("ztype SchemaOps API is unavailable");let a=Ff(s,this.schemaGraph,this.appDetail,await this.getExtraContext(s)),c=l7(t),u=_L(c);if(u)throw new Error(u);let l=c.map(S=>S&&typeof S=="object"?S.toolCallId:void 0).filter(S=>typeof S=="string"),d=this.withProjectFeatures(o.ZTypeCoreApi,()=>o.ZTypeSchemaOpsApi.toolCalls(a,this.normalizeExternalColumnTypes(EL(c)),n??null)),p=p7(d),h=p.schemaDiff,g=f7(p.responses,l),y={},E=h7(d);if(E!=null&&(y.updatedReadState=E),g&&(y.responses=g),p.errors&&(y.errors=p.errors,Object.assign(y,g7(d,l)),y.applied={applied:!1,reason:"batch rejected by ztype"}),h&&r&&(y.schemaDiff=h),h)try{y.applied=await this.applySchemaDiffLocked(h,{skipValidation:i}),m7(d)&&(y.touchesComponents=!0)}catch(S){if(!(S instanceof Cn))throw S;let _=await y7(S);return Object.assign(y,_,{errors:[...Array.isArray(y.errors)?y.errors:[],..._.errors]}),y}return await this.attachValidationErrorIfAny(y),y}))}async attachValidationErrorIfAny(t){let r=await this.currentZtypeDiagnostics();v7(r)&&(t.ztypeDiagnostics=r)}async undo(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.undoStack.length===0)return{...this.status(),undone:!1,reason:"nothing to undo"};let t=this.undoStack[this.undoStack.length-1],r=t.dataSource.map(SL).reverse(),n=await this.applyReversibleLocked(r);return n?(this.undoStack.pop(),this.redoStack.push(t),{...n,undone:!0,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,reverted:t.semanticChanges??void 0,revertedPaths:KE(t.dataSource)}):{...this.status(),undone:!1,reason:"schema diverged since this change; undo no longer applies cleanly"}}))}async redo(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.redoStack.length===0)return{...this.status(),redone:!1,reason:"nothing to redo"};let t=this.redoStack[this.redoStack.length-1],r=await this.applyReversibleLocked(t.dataSource);return r?(this.redoStack.pop(),this.undoStack.push(t),{...r,redone:!0,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,reapplied:t.semanticChanges??void 0,reappliedPaths:KE(t.dataSource)}):{...this.status(),redone:!1,reason:"schema diverged since this change; redo no longer applies cleanly"}}))}async applyReversibleLocked(t){if(!this.model)throw new Error("CRDT model not loaded");let r=this.currentView(),n=bL(r,t);if(n.length!==t.length)return null;let i=n.filter(s=>!(s.__typename==="DiffItem"&&Pn(s.oldValue)&&Pn(s.newValue)));return i.length===0?null:this.applySchemaDiffLocked({id:za(),dataSource:i},{recordUndo:!1})}async recordUndoEntry(t,r,n){let i=await Wa();if(!i?.generateDiff)return;let s=[];i.generateDiff({before:t,after:r,prefix:[],result:s}),s.length!==0&&(this.undoStack.push({id:za(),dataSource:s,semanticChanges:n}),this.undoStack.length>n7&&this.undoStack.shift(),this.redoStack=[])}async loadLocked(t=!1){if(this.touch(),this.model&&!t&&!this.staleReason)return this.status();let n=(await this.client.request(Ei,this.sessionKey)).fetchAppDetailByExId;if(!n)throw new Error(`Project not found: ${this.sessionKey.projectExId}`);let i=Ya(n);if(!i?.crdtModelUrl||!i.exId)throw new Error("Project has no uploaded CRDT schema");let s=await RE(i.crdtModelUrl);return this.crdtBinary=s,this.appliedPatchExIds.clear(),this.lastPatchExId=null,this.serverDoc=null,this.undoStack=[],this.redoStack=[],this.appDetail=n,await this.initializeRuntime(s,i.crdtPatches?.patches??[],n),this.schemaExId=i.exId,this.lastPatchExId=i.crdtPatches?.lastPatchExId??null,this.loadedAt=Date.now(),this.model&&this.schemaGraph?this.staleReason=!this.serverDoc&&Ja(n)?"backend app document unavailable":null:this.model&&!this.schemaGraph&&(this.staleReason="ztype runtime unavailable"),this.updateRevision(),this.watcher.start(),this.status()}async applySchemaDiffLocked(t,r={}){if(Array.isArray(t.dataSource)&&t.dataSource.length===0)return{...this.status(),applied:!1,reason:"empty schema diff"};if(!this.serverDoc&&Ja(this.appDetail)&&(t.dataSource??[]).some(Vf))throw new Error("This client app's server lives in the backend app's document, which is not loaded; refusing to write server changes into the client document. Run schema load again.");let i=(r.recordUndo??process.env.MOMEN_MCP_UNDO!=="0")&&this.snapshot?TL(this.snapshot,t.dataSource??[]):null,s=this.currentRevision(),o=await Mt(),a=o?.api?.ZTypeCoreApi,c=await Wa();if(!a||!c?.executeCrdtNodeUpdateAndTransformDiff||!c.generateDiff)throw new Error("CRDT/ztype write runtime is unavailable");let u=Ff(o,this.schemaGraph,this.appDetail,await this.getExtraContext(o)),l=this.withProjectFeatures(a,()=>a.batchUpdateSchemaGraph(u,[t]));if(l?.interruptErrors?.length>0){let g={available:!0,stableErrors:[...l.interruptErrors].map(kf),betaErrors:[]};if(r.skipValidation!==!0)throw new Cn("ztype validation interrupted schema update",g)}if(!this.model)throw new Error("CRDT model not loaded");D.debug(`[Session] applying schemaDiff dataSource: ${JSON.stringify(t.dataSource).slice(0,4e3)}`);try{await this.uploadByDoc(c,t.dataSource??[],this.model)}catch(g){D.error(`[Session] CRDT apply/upload failed; reloading session to discard the diverged graph: ${g.message}`);let{undoStack:y,redoStack:E}=this;try{await this.loadLocked(!0),this.undoStack=y,this.redoStack=E}catch(S){D.error(`[Session] reload after the failed write failed too; unloading the session so the next command loads it again: ${S.message}`),this.model=null,this.snapshot=null,this.schemaGraph=null,this.schemaExId=null,this.diagnosedFor=null,this.staleReason="a write failed and the reload after it failed too"}throw g}this.schemaGraph=l.updatedGraph,this.snapshot=this.currentView();let d=await this.refreshZtypeDiagnostics(),p=this.updateRevision(),h=i&&s&&i.server!==this.snapshot.server?await $E({version:i.version,server:i.server},{version:this.snapshot.version,server:this.snapshot.server}):null;return h&&qf(h)&&s&&p&&this.appendSchemaEvent("local",s,p,h),i&&await this.recordUndoEntry(i,this.snapshot,h&&qf(h)?h:null).catch(g=>D.warn(`[Session] the write landed but its undo entry could not be recorded: ${g.message}`)),{...this.status(),ztypeDiagnostics:d,backendErrorCount:iL(d),_schema:h&&qf(h)?{change:h}:void 0}}async uploadByDoc(t,r,n){let i=this.serverDoc,s=i?r.filter(Vf):[],o=i?r.filter(c=>!Vf(c)):r,a=i&&s.length>0&&o.length>0?rL(i.model.view()):null;if(i&&s.length>0)for(let c of await this.uploadDocPatch(t,s,i.model,null,i.schemaExId))i.appliedPatchExIds.add(c.exId),i.lastPatchExId=c.exId;if(o.length!==0)try{for(let c of await this.uploadDocPatch(t,o,n,this.sessionKey.appExId??null,this.schemaExId))this.appliedPatchExIds.add(c.exId),this.lastPatchExId=c.exId}catch(c){if(i&&a){let u=[];t.generateDiff({before:i.model.view(),after:a,prefix:[],result:u}),u.length>0&&await this.uploadDocPatch(t,u,i.model,null,i.schemaExId).catch(l=>{throw new Error(`The server half of this change was saved to the backend app's document, but the client half failed (${c.message}) and reverting the server half failed too (${l.message}). Those server changes are live without their client counterparts: read the schema again before retrying, or the retry applies them a second time.`)})}throw c}}async uploadDocPatch(t,r,n,i,s){let o=t.executeCrdtNodeUpdateAndTransformDiff(r,n,this.snapshot,sL),a=za(),c=await IL(this.client);return(await this.client.request(zP,{projectExId:this.sessionKey.projectExId,appExId:i,schemaExId:s,patches:[{content:{id:a,dataSource:o.diffsFromCrdt},patchBase64:o.patchBase64,uuid:a,...c}]})).batchCreateSchemaCrdtPatch??[]}async checkRemoteAndSyncLocked(t){if(!this.model||!this.schemaExId||!this.snapshot)return await this.loadLocked(),null;let r=this.currentRevision();if(!r)return null;let n={version:this.snapshot.version,server:this.snapshot.server},s=(await this.client.request(Ei,this.sessionKey)).fetchAppDetailByExId,o=Ya(s);if(!o?.exId)return null;let a=o.crdtPatches?.lastPatchExId??null,c=o.exId,u=DE(s);if(!await this.syncServerDocLocked()&&c===this.schemaExId&&a===this.lastPatchExId&&u===this.lastRevision?.deployedSchemaExId)return this.appDetail=s??this.appDetail,this.updateRevision(),null;c!==this.schemaExId||!o.crdtModelUrl?await this.loadLocked(!0):(this.appDetail=s??this.appDetail,await this.applyNetworkPatches(o.crdtPatches?.patches??[]),this.model&&(this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics()),this.lastPatchExId=a,this.updateRevision());let d=this.currentRevision();if(!d||!pL(r,d))return null;let p=await $E(n,{version:this.snapshot?.version,server:this.snapshot?.server});return this.appendSchemaEvent(t==="watch"?"remote":t,r,d,p),{type:"SCHEMA_STALE",message:"Project schema changed since this session last used it; session was refreshed before executing the command.",projectExId:this.sessionKey.projectExId,fromRevision:r,toRevision:d,semanticChanges:p,detectedAt:new Date().toISOString()}}currentRevision(){return this.lastRevision??this.updateRevision()}updateRevision(){return!this.snapshot&&!this.crdtBinary?(this.lastRevision=null,null):(this.lastRevision=dL({projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??this.appDetail?.appExId??null,appVersionExId:this.sessionKey.appVersionExId??null,schemaExId:this.schemaExId,lastPatchExId:this.lastPatchExId,snapshot:this.snapshot??{binaryBytes:this.crdtBinary?.byteLength??null},deployedSchemaExId:DE(this.appDetail)}),this.lastRevision)}appendSchemaEvent(t,r,n,i){let s={id:za(),type:"SCHEMA_CHANGED",source:t,projectExId:this.sessionKey.projectExId,fromRevision:r,toRevision:n,semanticChanges:i,detectedAt:new Date().toISOString()};this.events.push(s),this.events=this.events.slice(-r7),this.onSchemaEvent?.(s)}async runWatchRefresh(){let t=this.lastUsedAt;try{await this.mutex.run(async()=>{await this.withErrorState(async()=>this.checkRemoteAndSyncLocked("watch"))})}catch(r){D.warn("Schema watch refresh failed",r.message)}finally{this.lastUsedAt=t}}dispose(){this.watcher.dispose()}async initializeRuntime(t,r,n){let i=await Wa();if(!i?.initModelByBinary){this.model=null,this.snapshot={binaryBytes:t.length,patches:r},this.schemaGraph=null,this.diagnosedFor=null,this.appDetail=n,this.staleReason="CRDT runtime unavailable";return}this.model=i.initModelByBinary(t),await this.applyNetworkPatches(r),this.model&&(Ja(n)&&(this.serverDoc=await this.loadServerDoc(i).catch(s=>(D.warn("Backend app document unavailable; loading this client app's own document alone",s.message),null))),this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics())}async applyNetworkPatches(t){let r=t.filter(i=>!!(i?.exId&&!this.appliedPatchExIds.has(i.exId)));if(!this.model||r.length===0)return;let n=await xE();if(!n?.fromBinary)throw new Error("json-joy Patch runtime is unavailable");this.model.applyBatch(r.map(i=>n.fromBinary(Buffer.from(i.patchBase64,"base64"))));for(let i of r)this.appliedPatchExIds.add(i.exId),this.lastPatchExId=i.exId;this.snapshot=this.currentView()}async loadServerDoc(t){let r=await this.client.request(Ei,{projectExId:this.sessionKey.projectExId}),n=Ya(r.fetchAppDetailByExId);if(!n?.crdtModelUrl||!n.exId||!t.initModelByBinary)throw new Error("Could not load the backend app's document this client app's server half lives in");let i={model:t.initModelByBinary(await RE(n.crdtModelUrl)),schemaExId:n.exId,lastPatchExId:null,appliedPatchExIds:new Set};return await this.applyServerPatches(i,n.crdtPatches?.patches??[]),i.lastPatchExId=n.crdtPatches?.lastPatchExId??i.lastPatchExId,i}async applyServerPatches(t,r){let n=r.filter(s=>!!(s?.exId&&!t.appliedPatchExIds.has(s.exId)));if(n.length===0)return!1;let i=await xE();if(!i?.fromBinary)throw new Error("json-joy Patch runtime is unavailable");t.model.applyBatch(n.map(s=>i.fromBinary(Buffer.from(s.patchBase64,"base64"))));for(let s of n)t.appliedPatchExIds.add(s.exId),t.lastPatchExId=s.exId;return!0}async syncServerDocLocked(){let t=this.serverDoc;if(!t)return!1;let r=await this.client.request(Ei,{projectExId:this.sessionKey.projectExId}),n=Ya(r.fetchAppDetailByExId);if(!n?.exId)return!1;let i=n.crdtPatches?.lastPatchExId??null;return n.exId===t.schemaExId&&i===t.lastPatchExId?!1:n.exId!==t.schemaExId?(this.serverDoc=await this.loadServerDoc(await Wa()),!0):(await this.applyServerPatches(t,n.crdtPatches?.patches??[]),t.lastPatchExId=i,!0)}async resolveZtypeGraph(){let t=await Mt(),r=t?.api;if(!r?.ZTypeCoreApi||!this.snapshot){this.schemaGraph=null,this.diagnosedFor=null,this.staleReason="ztype runtime unavailable";return}let n=r.ZTypeCoreApi.parseZSchemaFromJsObject(this.snapshot),i=await this.getExtraContext(t);this.schemaGraph=this.withProjectFeatures(r.ZTypeCoreApi,()=>r.ZTypeCoreApi.resolveZSchemaToSchemaGraph(n,i))}withProjectFeatures(t,r){return t.withEnabledFeatures(this.enabledProjectFeatureNames,r)}async getExtraContext(t){if(this.extraContextLoaded)return this.extraContext;this.extraContextLoaded=!0;try{let[r,n,i]=await Promise.all([eL(),this.client.request(aR).then(s=>s.supportedCustomModelDescriptor??null).catch(s=>(D.warn("extraContext: model descriptors unavailable",s.message),null)),this.client.request(sf,{projectExId:this.sessionKey.projectExId}).then(s=>(s.features??[]).filter(o=>o.enabled).map(o=>o.featureName)).catch(s=>(D.warn("extraContext: project features unavailable; ztype runs with every feature off",s.message),[]))]);this.enabledProjectFeatureNames=i,this.extraContext=mL(t,r,n,Ks(t))}catch(r){D.warn("extraContext build failed; resolving schema without it",r.message),this.extraContext=null}return this.extraContext}diagnosticsInputs(){return{graph:this.schemaGraph,target:`${this.appDetail?.appType??""}:${this.appDetail?.appExId??""}`,extraContext:this.extraContext,featureNames:this.enabledProjectFeatureNames}}async currentZtypeDiagnostics(){let t=this.diagnosedFor,r=this.diagnosticsInputs();return this.lastZtypeDiagnostics&&t&&Object.keys(r).every(n=>t[n]===r[n])?this.lastZtypeDiagnostics:this.refreshZtypeDiagnostics()}async refreshZtypeDiagnostics(){if(this.diagnosedFor=null,this.lastZtypeDiagnostics=null,!this.schemaGraph||!this.appDetail)return this.lastZtypeDiagnostics={available:!1,stableErrors:[],betaErrors:[],error:this.staleReason??"ztype schema graph is not loaded"},this.lastZtypeDiagnostics;let t=await Mt(),r=t?.api;if(!r?.ZTypeCoreApi||!r?.ZTypeValidationApi)return this.lastZtypeDiagnostics={available:!1,stableErrors:[],betaErrors:[],error:"ztype validation API is unavailable"},this.lastZtypeDiagnostics;let n=Ff(t,this.schemaGraph,this.appDetail,await this.getExtraContext(t)),i=this.withProjectFeatures(r.ZTypeCoreApi,()=>r.ZTypeValidationApi.validateSchemaGraph(n,gL(t,this.appDetail)));return this.lastZtypeDiagnostics={available:!0,stableErrors:[...i?.errors??i?.stableErrors??[]].map(kf),betaErrors:[...i?.warnings??i?.betaErrors??[]].map(kf)},this.diagnosedFor=this.diagnosticsInputs(),this.lastZtypeDiagnostics}touch(){this.lastUsedAt=Date.now()}async withErrorState(t){try{let r=await t();return this.lastError=null,r}catch(r){throw this.lastError=r instanceof Error?r.message:String(r),r}}};var Gf=class{constructor(t,r){this.clientFactory=t;this.subscriptionFactory=r}sessions=new Map;emitter=new E7;clear(){for(let t of this.sessions.values())t.dispose();this.sessions.clear()}sweep(){let t=Date.now();for(let[r,n]of this.sessions.entries())n.isExpired(t)&&(n.dispose(),this.sessions.delete(r))}status(){return this.sweep(),{projectSessionIdleTtlMs:WE,sessions:[...this.sessions.values()].map(t=>t.status())}}async load(t,r=!1){return(await this.getSession(t)).load(r)}async sync(t){return(await this.getSession(t)).sync()}async snapshot(t,r=!1){return(await this.getSession(t)).getSnapshot(r)}async dataModel(t){return(await this.getSession(t)).dataModel()}async save(t){return(await this.getSession(t)).save()}async validate(t){return(await this.getSession(t)).validate()}async ztypeToolCalls(t,r,n=!1,i=null,s=!1){return(await this.getSession(t)).ztypeToolCalls(r,n,i,s)}async currentSchemaExId(t){let r=await this.getSession(t);await r.load(!1);let n=r.status().schemaExId;return typeof n=="string"?n:null}async lastPatchExIds(t){let r=await this.getSession(t);return await r.load(!1),await r.checkRemoteAndSync(),r.lastPatchExIds()}async undo(t){return(await this.getSession(t)).undo()}async redo(t){return(await this.getSession(t)).redo()}async checkRemoteAndSync(t){return(await this.getSession(t)).checkRemoteAndSync()}schemaState(t){this.sweep();let r=[...this.sessions.values()].filter(n=>!t||n.status().projectExId===t);return{projectExId:t??null,sessions:r.map(n=>n.state())}}schemaEvents(t,r,n=100){this.sweep();let i=[...this.sessions.values()].filter(s=>!t||s.status().projectExId===t);return{projectExId:t??null,events:i.flatMap(s=>s.listEvents(r,n))}}async getSession(t){this.sweep();let r=Xa.stringifyKey(t),n=this.sessions.get(r);if(n)return n;let i=new Xa(await this.clientFactory(),t,this.subscriptionFactory,s=>{this.emitter.emit("schemaChanged",s)});return this.sessions.set(r,i),i}};function qt(e,t){return{projectExId:e,appExId:t.appExId??null,appVersionExId:t.appVersionExId??null}}f();var NL=e=>e??{},Q=e=>typeof e=="string"&&e.length>0?e:void 0,ce=e=>typeof e=="string"&&e.length>0?e:null,ke=(e,t=!1)=>typeof e=="boolean"?e:t,tt=(e,t)=>typeof e=="number"&&Number.isFinite(e)?e:t,Ni=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0,Ge=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},Ci=(e,t)=>{let r=Q(e);if(!r)throw new Error(`${t} is required`);return r},St=(e,t)=>{if(!t)return e;if(e&&typeof e=="object"&&!Array.isArray(e)){let r=e,n=Ge(r._schema);return{...r,_schema:{...n,warning:t}}}return{result:e,_schema:{warning:t}}},_7=e=>new Promise(t=>{setTimeout(t,e)}),$f=e=>{let t=e?.name;if(typeof t!="string"||t.length===0)return null;let r=typeof e?.type=="string"?e.type:"";return/IMAGE|VIDEO|FILE/.test(r)?r.includes("LIST")?`${t}_ids`:`${t}_id`:t},CL=(e,t)=>{let n=e?.tableMetadata?.find(i=>i?.name===t)?.columnMetadata?.map(i=>$f(i))?.filter(i=>i!==null);return n?.length?n.slice(0,20):["id"]},S7=/token|secret|password|privatekey|merchantkey|mchkey|apikey/i,YE=e=>{if(Array.isArray(e))return e.map(YE);if(!e||typeof e!="object")return e;let t={};for(let[r,n]of Object.entries(e))t[r]=S7.test(r)?"<redacted>":YE(n);return t},JE=(e,t)=>ke(t.includeSecrets,!1)?e:YE(e),PL=async(e,t)=>{let r={projectExId:Q(t.projectExId),appExId:ce(t.appExId),appVersionExId:ce(t.appVersionExId)},n=await fL(e,r);if(r.appExId!==null&&r.appExId===n)throw new Error(`appExId was given the project exId (${n}). appExId names an app inside the project, never the project itself: leave it unset to address the project (its backend, and the whole schema of a single-client project), or take an app exId from \`project metadata\` -> apps[] whose appExId is non-null.`);return{...r,projectExId:n}},RL=async(e,t)=>{let r=Q(t.organizationExId),n=Q(t.projectSpaceType);if(r&&n)return{organizationExId:r,projectSpaceType:n};let s=(await e.request(nf))?.user,o=s?.currentOrganization??s?.organization??s?.organizations?.[0]??s?.joinedOrganizations?.[0];if(!o?.exId)throw new Error("No default organization found; pass organizationExId and projectSpaceType");return{organizationExId:r??o.exId,projectSpaceType:n??"PERSONAL"}},b7=async(e,t)=>((await e.request(rf,{projectName:t,paginator:{first:20}}))?.fuzzySearchProjectName?.edges??[]).find(s=>s?.node?.name===t)?.node??null,xL=async(e,t,r)=>{let n=Date.now()+r;for(;Date.now()<n;){let i=await b7(e,t);if(i)return i;await _7(2e3)}return null},DL=(e,t,r,n=!0)=>{if(Q(t.confirmProjectExId)!==e&&!(n&&ke(t.force,!1)))throw new Error(`${r} is destructive; pass confirmProjectExId=${e}`+(n?" or force=true":""))},T7=e=>e?"project"in e?e.project:"adminToken"in e?e:null:null,w7=e=>e.replace(/\/api\/graphql-v2(\/?)$/,"/api/graphql-admin$1"),Ws=async(e,t)=>{let r=await e.request(WP,t),n=T7(r?.fetchAppDetailByExIdWithoutReconcile);if(!n?.adminToken)throw new Error(`Runtime commands need the project admin token, which only project editors get; none was returned for project ${t.projectExId}`);let i=n.zeroUrl??Ft().zeroApiUrlTemplate.replace("{projectExId}",t.projectExId),s={authorization:`Bearer ${n.adminToken}`};return{adminToken:n.adminToken,zeroUrl:i,dataClient:new it(i,{headers:s,fetch:Qs}),adminClient:new it(n.adminZeroUrl??w7(i),{headers:s,fetch:Qs})}};f();f();import{promises as O7}from"fs";import I7 from"path";var A7=async(e,t)=>{let r=Q(e.cwd);if(!r)throw new Error("cwd is required");let n=I7.resolve(r);if(!(await O7.stat(n)).isDirectory())throw new Error(`Path is not a directory: ${n}`);return t.credentialStore.setWorkspaceRoot(n),t.schemaManager.clear(),t.ok({cwd:n},`Current working directory set to ${n}`)},LL={"workspace.set":A7};f();var UL=He(No(),1);f();import{createServer as kL}from"http";import N7 from"open";var Za=class{config;constructor(t){this.config=t}async findAvailablePort(t){let r=t||this.config.callbackPort||8088;return new Promise((n,i)=>{let s=kL();s.on("error",o=>{o.code==="EADDRINUSE"?n(this.findAvailablePort(r+1)):i(o)}),s.listen(r,()=>{let o=s.address(),a=typeof o=="object"&&o!==null?o.port:r;s.close(()=>n(a))})})}async authenticate(){let t=await this.findAvailablePort(),r=`http://localhost:${t}/callback`;D.info(`[JwtAuth] Using callback URL: ${r}`),D.info("[JwtAuth] Opening browser for authentication...");let n=await new Promise((i,s)=>{let o=null,a=!1,c=kL(async(u,l)=>{if(!u.url)return;let d=new URL(u.url,`http://localhost:${t}`);if(d.pathname==="/callback"){D.info(`[JwtAuth] Callback received: ${u.url}`);let p=d.searchParams.get("token");if(!p||p.trim()===""){D.info("[JwtAuth] No token parameter found in callback URL"),D.info("[JwtAuth] Available parameters:",Array.from(d.searchParams.keys()).join(", "));let g=this.errorPage("No authentication token received");l.writeHead(400,{"Content-Type":"text/html"}),l.end(g),a||(a=!0,o&&clearTimeout(o),c.close(),s(new Error("No token parameter in callback")));return}D.info(`[JwtAuth] Token received (length: ${p.length} chars)`);let h=this.successPage();l.writeHead(200,{"Content-Type":"text/html"}),l.end(h),setTimeout(()=>{a||(a=!0,o&&clearTimeout(o),c.close(),i(p))},1e3)}});c.on("error",u=>{a||(a=!0,o&&clearTimeout(o),s(u))}),c.listen(t,async()=>{let u=new URL(this.config.authEndpoint);u.searchParams.set("redirect_uri",r),D.info(`[JwtAuth] Opening: ${u.toString()}`);try{await N7(u.toString())}catch{D.info("[JwtAuth] Could not open browser automatically"),D.info("[JwtAuth] Please open this URL manually:"),D.info(u.toString())}}),o=setTimeout(()=>{a||(a=!0,c.close(),s(new Error("Authentication timeout - no response after 5 minutes")))},3e5)});return D.info("[JwtAuth] JWT token received successfully"),{access_token:n,token_type:"Bearer"}}renderPage(t){let r=t.autoClose?`
1446
- <script>
1447
- setTimeout(() => {
1448
- window.close();
1449
- }, 2000);
1450
- </script>`:"";return`
1451
- <!DOCTYPE html>
1452
- <html>
1453
- <head>
1454
- <meta charset="utf-8">
1455
- <title>${t.title}</title>
1456
- <style>
1457
- body {
1458
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
1459
- display: flex;
1460
- justify-content: center;
1461
- align-items: center;
1462
- height: 100vh;
1463
- margin: 0;
1464
- background: linear-gradient(135deg, ${t.gradient});
1465
- }
1466
- .container {
1467
- background: white;
1468
- padding: 2.5rem;
1469
- border-radius: 1rem;
1470
- box-shadow: 0 20px 60px rgba(0,0,0,0.3);
1471
- text-align: center;
1472
- max-width: 400px;
1473
- }
1474
- h1 {
1475
- margin: 0 0 1rem;
1476
- color: ${t.headingColor};
1477
- font-size: 1.5rem;
1478
- }
1479
- p {
1480
- color: #666;
1481
- margin: 0;
1482
- line-height: 1.6;
1483
- }
1484
- .icon {
1485
- font-size: 3rem;
1486
- margin-bottom: 1rem;
1487
- }
1488
- </style>
1489
- </head>
1490
- <body>
1491
- <div class="container">
1492
- <div class="icon">${t.icon}</div>
1493
- <h1>${t.heading}</h1>
1494
- <p>${t.body}</p>
1495
- <p style="margin-top: 1rem; font-size: 0.9em; opacity: 0.8;">${t.footer}</p>
1496
- </div>${r}
1497
- </body>
1498
- </html>`}successPage(){return this.renderPage({title:"Token Received",gradient:"#667eea 0%, #764ba2 100%",headingColor:"#333",icon:"\u2713",heading:"Token Received",body:"MCP server authenticated successfully.",footer:"You can close this window.",autoClose:!0})}errorPage(t){return this.renderPage({title:"Authentication Error",gradient:"#f093fb 0%, #f5576c 100%",headingColor:"#d93025",icon:"\u26A0\uFE0F",heading:"Authentication Error",body:t,footer:"Please try again."})}};f();var ze=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},ec=e=>Array.isArray(e)?e:[];function jL(e){let t={};for(let r of ec(e)){let n=ze(r),i=n.capability;if(typeof i!="string")continue;let s=ze(n.limit);t[i]=s.unlimited?"unlimited":s.amount??0}return t}function Bf(e,t){if(Array.isArray(e))return e.map(r=>Bf(r,t));if(e&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))t.has(n)||(r[n]=Bf(i,t));return r}return e}var ML=new Set(["crdtPatches","crdtModelUrl","latestDeployedServerSchema","additional"]);function Kf(e){let t=ze(e),r=ze(t.fetchAppDetailByExId),n=ze(r.project),i=h=>r[h]??n[h],s=ze(i("projectConfig")),o=ze(r.config).customDomain??ze(s.webConfig).customDomain??i("webFreeProdDomain")??null,a=i("lastDeployedServerSchemaExId")??null,c=ze(r.lastUploadedSchema).exId??null,u=ec(i("appList")).map(h=>{let g=ze(h);return{appExId:g.appExId,appType:g.appType,name:g.name,published:g.hasPublished??!1,expired:g.isExpired??!1}}),l=ze(i("projectPlan")),d=ze(ze(t.project).rpsStatsInLast30Days),p={projectExId:r.projectExId??n.exId??null,projectName:i("projectName")??r.name??null,appType:r.appType??null,supportedPlatforms:s.supportedPlatforms??null,createdAt:i("createdAt")??null,updatedAt:i("updatedAt")??null,published:i("hasPublished")??!1,expired:i("isExpired")??!1,webDomain:o,deployedSchemaExId:a,uploadedSchemaExId:c,hasUndeployedChanges:c!=null&&c!==a,deploymentEnvs:ec(i("deploymentEnvConfigs")).map(h=>ze(h).userDeploymentEnvironment).filter(h=>h!=null),integrations:{stripe:s.stripePayConfig!=null,alipay:s.aliPayConfig!=null,wechatPay:s.wechatPayConfig!=null,wechatApp:s.wechatAppConfig!=null,sms:s.aliyunSmsConfig!=null,email:s.emailConfig!=null},plan:{type:l.projectPlanType??null,expireAt:l.expireAt??null,highestPurchased:i("highestPurchasedProjectPlanType")??null},capabilities:jL(i("capabilities")),rpsLast30Days:{exceededDays:d.exceededNumOfDays??0,exceededTotal:d.exceededTotal??0}};return u.length>0&&(p.apps=u),p}function qL(e){let t=ze(e),r={};for(let n of ec(t.projectResourceUsageInfo)){let i=ze(n),s=i.resourceType;typeof s=="string"&&(r[s]={used:i.usedAmount??0,available:i.availableAmountWithNoExhaustionBurst??null,status:i.resourceUsageStatus??null,unlimited:i.unlimited??!1})}return{resources:r,unitComputingPower:t.unitComputingPower??null,visitTimesSupportedByComputingPower:t.visitTimesSupportedByComputingPower??null}}function FL(e){let t=ze(ze(e).user),r=ec(t.joinedOrganizations).map(n=>{let i=ze(n);return{exId:i.exId,displayName:i.displayName,ownerName:i.ownerName,planType:i.planType,planExpireAt:i.planExpireAt,permissionEnabled:i.permissionEnabled,permissionRoleLimit:i.permissionRoleLimit,capabilities:jL(i.capabilities)}});return{exId:t.exId,email:t.email,phoneNumber:t.phoneNumber,username:t.username,displayName:t.displayName,availableTechnicalSupportHours:t.availableTechnicalSupportHours,daysSinceRegistration:t.daysSinceRegistration,involvedProjectCount:t.involvedProjectCount,organizations:r}}async function zE(e){let t=await e.loadCredentials();if(!t)return null;let r=UL.default.decode(t.access_token),n=r&&typeof r=="object"?r:null;return{tokenType:t.token_type,savedAt:t.savedAt,jwt:n?{sub:n.sub,roles:n.roles,iat:n.iat,exp:n.exp}:r}}var C7=async(e,t)=>{let r=await Cr(t.credentialStore),n=await new Za(r).authenticate();return await t.credentialStore.saveCredentials(n),t.ok(await zE(t.credentialStore),"Authenticated")},P7=async(e,t)=>{await t.credentialStore.deleteCredentials();let r=await Cr(t.credentialStore),n=await new Za(r).authenticate();return await t.credentialStore.saveCredentials(n),t.ok(await zE(t.credentialStore),"Authenticated")},R7=async(e,t)=>(await t.credentialStore.deleteCredentials(),await t.credentialStore.deleteProjectContext(),t.schemaManager.clear(),t.ok(void 0,"Logged out")),x7=async(e,t)=>{let r=await zE(t.credentialStore);return r?t.ok(r):t.fail(new Error($c))},D7=async(e,t)=>t.ok(FL(await t.client.request(GP))),VL={"auth.login":C7,"auth.reauth":P7,"auth.logout":R7,"auth.whoami":x7,"account.profile":D7};f();f();import{spawn as L7}from"child_process";var GL=18e4,Qf=Math.floor(GL/1e3),k7=GL+5e3,$L=()=>(process.env.MCP_HITL??"").trim().toLowerCase()==="off";function Rn(e,t){return new Promise(r=>{let n="",i="",s=!1,o=L7(e,t,{stdio:["ignore","pipe","pipe"]}),a=setTimeout(()=>{s||(o.kill("SIGKILL"),s=!0,r({code:null,stdout:n,stderr:i,timedOut:!0}))},k7);a.unref(),o.stdout?.on("data",c=>{n+=c.toString()}),o.stderr?.on("data",c=>{i+=c.toString()}),o.on("error",c=>{s||(s=!0,clearTimeout(a),r({code:null,stdout:n,stderr:i,spawnError:c}))}),o.on("close",c=>{s||(s=!0,clearTimeout(a),r({code:c,stdout:n,stderr:i}))})})}async function j7(e,t){let n=["on run argv","set pid to item 1 of argv","set verb to item 2 of argv",'set msg to "This will " & verb & " project " & pid & "." & return & "This action is IRREVERSIBLE." & return & return & "Type the project id to confirm:"',"try",`set dlg to display dialog msg with title "Human approval required" default answer "" buttons {"Cancel", "Confirm"} default button "Cancel" cancel button "Cancel" with icon caution giving up after ${Qf}`,"on error number -128",'return "__CANCELLED__"',"end try",'if (gave up of dlg) then return "__CANCELLED__"',"return text returned of dlg","end run"].flatMap(o=>["-e",o]);n.push(e,t);let i=await Rn("osascript",n);if(i.spawnError)return"unavailable";if(i.timedOut)return"denied";if(i.code!==0)return"unavailable";let s=i.stdout.trim();return s==="__CANCELLED__"?"denied":s===e?"approved":"denied"}async function M7(e,t){if(!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)return"unavailable";let r=`This will ${t} project ${e}.
1499
- This action is IRREVERSIBLE.
1500
-
1501
- Type the project id to confirm:`,n=await Rn("zenity",["--entry","--title=Human approval required",`--text=${r}`,`--timeout=${Qf}`]);if(!n.spawnError)return n.timedOut?"denied":n.code===0&&n.stdout.trim()===e?"approved":"denied";let i=await Rn("kdialog",["--title","Human approval required","--inputbox",r,""]);return i.spawnError?"unavailable":i.timedOut?"denied":i.code===0&&i.stdout.trim()===e?"approved":"denied"}async function q7(e,t){let r=`This will ${t} project ${e}. This action is IRREVERSIBLE.
1502
-
1503
- Type the project id to confirm:`,i=`Add-Type -AssemblyName Microsoft.VisualBasic;$r=[Microsoft.VisualBasic.Interaction]::InputBox('${(o=>o.replace(/'/g,"''"))(r)}','Human approval required','');Write-Output $r`,s=await Rn("powershell",["-NoProfile","-NonInteractive","-Command",i]);return s.spawnError?"unavailable":s.timedOut?"denied":s.code!==0?"unavailable":s.stdout.trim()===e?"approved":"denied"}async function F7(e,t){switch(process.platform){case"darwin":return j7(e,t);case"linux":return M7(e,t);case"win32":return q7(e,t);default:return"unavailable"}}async function tc(e,t,r,n={}){if($L()){DL(e,t,r,n.allowForce??!0);return}let i=await F7(e,r);if(i==="approved"){yp("notice",`Human approved ${r} of project ${e}`);return}throw i==="unavailable"?new Error(`${r} requires human approval via a GUI dialog, but no dialog could be shown on this host (headless/SSH/CI). Set MCP_HITL=off to bypass with the confirmProjectExId/force text gate.`):new Error(`${r} was not approved: the confirmation dialog was cancelled or the project id was not entered correctly.`)}var Hf=e=>e.replace(/\r?\n$/,"");async function U7(e){let r=["on run argv","set lbl to item 1 of argv",'set msg to "Enter the value for secret " & quote & lbl & quote & ":"',"try",`set dlg to display dialog msg with title "Set secret value" default answer "" with hidden answer buttons {"Cancel", "Save"} default button "Save" cancel button "Cancel" with icon note giving up after ${Qf}`,"on error number -128",'return "__CANCELLED__"',"end try",'if (gave up of dlg) then return "__CANCELLED__"',"return text returned of dlg","end run"].flatMap(s=>["-e",s]);r.push(e);let n=await Rn("osascript",r);if(n.spawnError||n.code!==0)return{ok:!1,reason:"unavailable"};if(n.timedOut)return{ok:!1,reason:"cancelled"};let i=Hf(n.stdout);return i==="__CANCELLED__"?{ok:!1,reason:"cancelled"}:{ok:!0,value:i}}async function V7(e){if(!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)return{ok:!1,reason:"unavailable"};let t=`Enter the value for secret "${e}":`,r=await Rn("zenity",["--entry","--hide-text","--title=Set secret value",`--text=${t}`,`--timeout=${Qf}`]);if(!r.spawnError)return r.timedOut?{ok:!1,reason:"cancelled"}:r.code===0?{ok:!0,value:Hf(r.stdout)}:{ok:!1,reason:"cancelled"};let n=await Rn("kdialog",["--title","Set secret value","--password",t]);return n.spawnError?{ok:!1,reason:"unavailable"}:n.timedOut?{ok:!1,reason:"cancelled"}:n.code===0?{ok:!0,value:Hf(n.stdout)}:{ok:!1,reason:"cancelled"}}async function G7(e){let t=o=>o.replace(/'/g,"''"),r=`Enter the value for secret "${e}":`,n=["Add-Type -AssemblyName System.Windows.Forms;","Add-Type -AssemblyName System.Drawing;","$f=New-Object System.Windows.Forms.Form;$f.Text='Set secret value';$f.Width=440;$f.Height=180;$f.StartPosition='CenterScreen';$f.TopMost=$true;",`$l=New-Object System.Windows.Forms.Label;$l.Text='${t(r)}';$l.AutoSize=$true;$l.Top=15;$l.Left=15;$f.Controls.Add($l);`,"$t=New-Object System.Windows.Forms.TextBox;$t.UseSystemPasswordChar=$true;$t.Width=400;$t.Top=45;$t.Left=15;$f.Controls.Add($t);","$ok=New-Object System.Windows.Forms.Button;$ok.Text='Save';$ok.Top=90;$ok.Left=235;$ok.DialogResult=[System.Windows.Forms.DialogResult]::OK;$f.Controls.Add($ok);$f.AcceptButton=$ok;","$cn=New-Object System.Windows.Forms.Button;$cn.Text='Cancel';$cn.Top=90;$cn.Left=325;$cn.DialogResult=[System.Windows.Forms.DialogResult]::Cancel;$f.Controls.Add($cn);$f.CancelButton=$cn;",'$r=$f.ShowDialog();if($r -eq [System.Windows.Forms.DialogResult]::OK){Write-Output $t.Text}else{Write-Output "__CANCELLED__"}'].join(""),i=await Rn("powershell",["-NoProfile","-NonInteractive","-STA","-Command",n]);if(i.spawnError||i.code!==0)return{ok:!1,reason:"unavailable"};if(i.timedOut)return{ok:!1,reason:"cancelled"};let s=Hf(i.stdout);return s==="__CANCELLED__"?{ok:!1,reason:"cancelled"}:{ok:!0,value:s}}async function BL(e){if($L())throw new Error("Setting a secret value needs a native GUI dialog so the value stays off the tool call, but MCP_HITL=off. Run without MCP_HITL=off on a machine with a desktop session.");let t;switch(process.platform){case"darwin":t=await U7(e);break;case"linux":t=await V7(e);break;case"win32":t=await G7(e);break;default:t={ok:!1,reason:"unavailable"}}if(t.ok){if(!t.value)throw new Error("No secret value was entered.");return yp("notice",`Human entered a value for secret "${e}"`),t.value}throw t.reason==="unavailable"?new Error("Setting a secret value requires a native GUI dialog, but none could be shown on this host (headless/SSH/CI)."):new Error("Setting the secret value was cancelled.")}var KL=async(e,t)=>{let n=(await t.client.request(rf,{projectName:Q(e.projectName)??"",paginator:{after:ce(e.cursor),first:tt(e.limit,20)}})).fuzzySearchProjectName,i=(n?.edges??[]).map(a=>a?.node).filter(a=>a!=null),s=n?.pageInfo,o=s?.hasNextPage?s.endCursor?.value??null:null;return t.ok({projects:i,nextCursor:o})},$7="CREATE_PROJECT_WITH_ZUI",B7=async e=>{try{return((await e.client.request(sf,{projectExId:null})).features??[]).some(r=>r.featureName===$7&&r.enabled)}catch{return!1}},K7=async(e,t)=>{let r=Q(e.projectName)??Q(e.name);if(!r)throw new Error("projectName is required");let n=await RL(t.client,e),i=typeof e.useNewType=="boolean"?e.useNewType:await B7(t),o=(await t.client.request($P,{projectName:r,templateExId:ce(e.templateExId),platform:ce(e.platform),projectSpaceType:n.projectSpaceType,organizationExId:n.organizationExId,forBeginnerGuide:ke(e.forBeginnerGuide,!1),category:ce(e.category),useRefactoredComponent:ke(e.useRefactoredComponent,!0),useNewType:ke(e.useNewType,i)})).createProjectInOrganizationAsync;if(!o)throw new Error("Project creation failed: taskId is missing");let c=ke(e.wait,!0)?await xL(t.client,r,tt(e.timeoutMs,12e4)):null;return c?.exId&&(await t.credentialStore.saveProjectContext(String(c.exId)),await VE(t.client,String(c.exId),t.codingAgent,t.hostSessionId)),t.ok({taskId:o,project:c,projectSpace:n})},H7=async(e,t)=>{let r=Q(e.projectExId);if(!r)throw new Error("projectExId is required");return await t.credentialStore.saveProjectContext(r),await VE(t.client,r,t.codingAgent,t.hostSessionId),t.ok({projectExId:r},`Current project set to ${r}`)},Q7=async(e,t)=>t.ok(await t.credentialStore.loadProjectContext()),W7=async(e,t)=>{let r=await t.getProjectArgs(e),n=await t.client.request(Ei,r);return t.ok(JE(Bf(n,ML),e))},Y7=async(e,t)=>{let r=await t.getProjectArgs(e),n=await t.client.request(of,r);return ke(e.raw,!1)?t.ok(JE(n,e)):t.ok(Kf(n))},J7=async(e,t)=>{let r=await t.getProjectArgs(e),n=Q(e.projectName)??Q(e.name);if(!n)throw new Error("projectName is required");return t.ok(await t.client.request(BP,{projectExId:r.projectExId,projectName:n}))},z7=async(e,t)=>{let r=await t.getProjectArgs(e),n=Q(e.appExId),i=Q(e.appName)??Q(e.name);if(!n)throw new Error("appExId is required");if(!i)throw new Error("appName is required");return t.ok(await t.client.request(KP,{projectExId:r.projectExId,appExId:n,appName:i}))},X7=async(e,t)=>{let r=await t.getProjectArgs(e);await tc(r.projectExId,e,"delete");let n=await t.client.request(HP,{projectExId:r.projectExId});return(await t.credentialStore.loadProjectContext())?.projectExId===r.projectExId&&await t.credentialStore.deleteProjectContext(),t.schemaManager.clear(),t.ok(n)},Z7=async(e,t)=>{let r=await t.getProjectArgs(e);await tc(r.projectExId,e,"reset");let n=Q(e.languageType)??"EN";return t.ok(await t.client.request(QP,{projectExId:r.projectExId,languageType:n}))},eee=async(e,t)=>{let r=await t.getProjectArgs(e);ke(e.refresh,!1)&&await t.client.request(nR,{projectExId:r.projectExId});let n=Q(e.resourceType),[i,s,o,a]=await Promise.all([t.client.request(rR,{projectExId:r.projectExId,nonRealTimeDisplayedResourceTypes:Ni(e.nonRealTimeDisplayedResourceTypes)}),t.client.request(oR,{projectExId:r.projectExId}).catch(l=>({error:l instanceof Error?l.message:String(l)})),n?t.client.request(iR,{projectExId:r.projectExId,resourceType:n}):Promise.resolve(null),n?t.client.request(sR,{projectExId:r.projectExId,resourceType:n}):Promise.resolve(null)]),c=s&&"findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch"in s?s.findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch:null,u={usage:qL(i.resourceUsageAndBurstInfo)};return c&&c.length>0&&(u.singleTenant=c),o?.monthlyResourceUsageHistory!=null&&(u.monthly=o.monthlyResourceUsageHistory),a?.dailyResourceUsageHistory!=null&&(u.daily=a.dailyResourceUsageHistory),t.ok(u)},HL={"projects.search":KL,"projects.list":KL,"project.create":K7,"project.set_current":H7,"project.get_current":Q7,"project.detail":W7,"project.metadata":Y7,"project.rename":J7,"project.rename_app":z7,"project.delete":X7,"project.reset":Z7,"project.resources":eee};f();async function Wf(e,t){let r=await t.checkSchema(e),n=await t.getProjectArgs(e);return{warning:r,projectArgs:n,sArgs:qt(n.projectExId,n)}}var Ys=e=>async(t,r)=>{let{warning:n,sArgs:i}=await Wf(t,r);return r.ok(St(await e(r.schemaManager,i),n))},tee=Ys((e,t)=>e.load(t)),ree=Ys((e,t)=>e.load(t,!0)),nee=async(e,t)=>{let r=Q(e.projectExId)?await t.checkSchema(e):null;return t.ok(St(t.schemaManager.status(),r))},iee=async(e,t)=>t.ok(t.schemaManager.schemaState(Q(e.projectExId))),see=async(e,t)=>t.ok(t.schemaManager.schemaEvents(Q(e.projectExId),ce(e.afterEventId),tt(e.limit,100))),oee=Ys((e,t)=>e.sync(t)),aee=async(e,t)=>{let{warning:r,sArgs:n}=await Wf(e,t),i=await t.schemaManager.snapshot(n,ke(e.full,!1));return t.ok(St(i,r))},cee=Ys((e,t)=>e.validate(t)),uee=Ys((e,t)=>e.undo(t)),lee=Ys((e,t)=>e.redo(t)),XE=async(e,t)=>{let{warning:r,projectArgs:n,sArgs:i}=await Wf(e,t),s=await t.schemaManager.load(i),o=HE(s,n.appExId??null);if(!o.ok)return{ok:!1,error:o.error,data:St({status:s},r)};let a=await t.schemaManager.validate(i),c=jf(a);if(c.length>0&&!ke(e.allowValidationErrors,!1))return{ok:!1,error:"ztype backend validation errors block backend sync",data:St({ztypeDiagnostics:a,backendErrors:c},r)};let u=await t.schemaManager.save(i),l=HE(u,n.appExId??null);if(!l.ok)throw new Error(`schema.save: ${l.error}`);let d=u.serverDoc??null,p=l.schemaExId,h=l.appExId,g=ke(e.validateMultiClient,!1)&&!!d,y=ke(e.validateMultiClient,!1)&&!d?await t.client.request(tR,{projectExId:n.projectExId,appExId:h,schemaExId:p}):await t.client.request(eR,{projectExId:n.projectExId,appExId:h,schemaExId:p,buildTarget:Q(e.buildTarget)??"SUPPORT_SERVICE"});return t.ok(St({saved:u,deploy:y,ztypeDiagnostics:a,...g?{multiClientValidationSkipped:!0}:{}},r))},fee=async(e,t)=>{let{warning:r,sArgs:n}=await Wf(e,t),i=Array.isArray(e.toolCalls)?e.toolCalls:[];if(i.length===0)throw new Error("toolCalls must be a non-empty array");let s=ke(e.verbose,!1),o=await t.schemaManager.ztypeToolCalls(n,i,s,e.readState??null,ke(e.force,!1));return t.ok(St(o,r))},QL={"schema.load":tee,"schema.reload":ree,"schema.status":nee,"schema.state":iee,"schema.events":see,"schema.sync":oee,"schema.snapshot":aee,"schema.validate":cee,"project.sync_backend":XE,"schema.ztype_tool_calls":fee,"schema.undo":uee,"schema.redo":lee};f();f();var tr=e=>Array.isArray(e)?e:[],Yf=e=>Ge(Ge(e).server),dee=e=>{for(let t of e){let r=Ge(t);if(r.type==="FLOW_END"&&r.removable!==!0)return ce(r.uniqueId)}return null},WL=(e,t)=>{let n=tr(Yf(e).actionFlows).find(o=>Ge(o).uniqueId===t);if(!n)throw new Error(`No action flow with id ${t}. Check the id with project.inspect.`);let i=Ge(n),s=dee(tr(i.allNodes));if(!s)throw new Error(`Action flow ${t} has no terminal end node, so it cannot be debugged.`);return{definition:i,endNodeId:s,displayName:ce(i.displayName),isAsync:i.isAsync===!0}},e_=50,pee=e=>{for(let t=0;t<e.length-1;t++)if(e[t].key==="componentById")return ce(e[t+1].key);return null},YL=(e,t=e_)=>{let r=Ge(e);if(r.available===!1)return{count:0,errors:[],unavailable:!0};let n=[...tr(r.stableErrors),...tr(r.betaErrors)].map(Ge),i=n.slice(0,t).map(o=>{let a=tr(o.fullPath).map(Ge),c={message:ce(o.message)??"",path:a},u=ce(o.platform);u&&(c.platform=u);let l=pee(a)??ce(o.componentId);return l&&(c.componentId=l),c}),s={count:n.length,errors:i};return n.length>i.length&&(s.truncated=!0),s},hee=e=>{let t=Ge(e);if(t.available!==!1)return tr(t.stableErrors).length+tr(t.betaErrors).length},JL=(e,t,r)=>{let n=hee(Ge(t).ztypeDiagnostics),i=e?{status:"IN_PROGRESS",message:"The schema was saved and the backend deploy was started. Check deploy status for the outcome; this reports the deploy was accepted, not that it finished."}:{status:"FAILED",message:r??"The backend sync was refused and reported no reason."};return n!==void 0&&(i.projectErrorCount=n),i},zL=e=>({typeSystemTrack:Yf(e).editorConfiguration!=null?"POST":"PRE"}),mee=e=>{let t=new Map;for(let r of tr(e.actionFlows)){let n=Ge(r),i=ce(n.uniqueId),s=ce(n.displayName);i&&s&&t.set(i,s)}return t},gee=e=>{let t=new Map;for(let r of tr(Ge(e.dataModel).tables)){let n=Ge(r),i=ce(n.uniqueId)??ce(n.id),s=ce(n.name);i&&s&&t.set(i,s)}return t},XL=e=>{let t=Yf(e),r=mee(t),n=gee(t),i=tr(t.triggerConfigurations).map(o=>{let a=Ge(o),c=ce(a.tableId);return{triggerId:ce(a.uniqueId),displayName:ce(a.displayName),enabled:a.enabled===!0,tableName:c?n.get(c)??null:null,operation:ce(Ge(a.trigger).dbOperationType),flowNames:tr(a.actions).map(u=>ce(Ge(u).actionFlowUniqueId)).filter(u=>!!u).map(u=>r.get(u)).filter(u=>!!u)}}),s=tr(t.scheduledJobConfigurations).map(o=>{let a=Ge(o),c=ce(Ge(a.action).actionFlowUniqueId);return{triggerId:ce(a.uniqueId),name:ce(a.name),enabled:a.enabled!==!1,cron:ce(a.cron),flowName:c?r.get(c)??null:null}});return{dbTriggers:i,scheduledTriggers:s}},yee=["dataModel","actionFlows","callbackConfigurations","scheduledJobConfigurations","triggerConfigurations","thirdPartyApiConfigs","apiWorkSpaces","zAiConfigs","roleConfigs","authenticationConfig","secretConfigs"],ZE=(e,t)=>{if(e===t)return!0;if(e==null)return t==null;if(t==null)return!1;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((r,n)=>ZE(r,t[n]));if(typeof e=="object"&&typeof t=="object"){let r=e,n=t,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let s of i)if(!ZE(r[s],n[s]))return!1;return!0}return!1},ZL=(e,t)=>{if(t==null)return{hasPendingChanges:!1,changedAreas:[],known:!1};let r=Yf(e),n=Ge(t),i=yee.filter(s=>!ZE(r[s],n[s]));return{hasPendingChanges:i.length>0,changedAreas:[...i],known:!0}};f();import{execSync as vee}from"node:child_process";import{createRequire as Eee}from"node:module";import _ee from"node:path";var ek=18e4,See=15e3,bee=3e4,tk=["--js-flags=--max-old-space-size=1024","--renderer-process-limit=1"],Tee=async()=>{try{return await import("playwright")}catch{let e=vee("npm root -g").toString().trim();return Eee(_ee.join(e,"noop.js"))("playwright")}},t_=class{browser=null;context=null;page=null;loadedFor=null;loadedWithPatches=new Set;queue=Promise.resolve();run(t,r){let n=this.queue.then(()=>this.runNow(t,r));return this.queue=n.catch(()=>{}),n}async close(){await this.browser?.close().catch(()=>{}),this.browser=null,this.context=null,this.page=null,this.loadedFor=null}async runNow(t,r){let n=await this.pageFor(t,r);if(!await n.evaluate(()=>globalThis.__ZION_AGENT_CANVAS__.isInSync()).catch(()=>!1))n=await this.load(t,r);else for(let s of r.lastPatchExIds)if(!this.loadedWithPatches.has(s)&&!await this.waitForPatch(n,s)){n=await this.load(t,r);break}return r.pageId&&(await n.evaluate(({pageId:s,breakpoint:o})=>globalThis.__ZION_AGENT_CANVAS__.focus(s,o),{pageId:r.pageId,breakpoint:r.breakpoint}),await n.waitForFunction(({pageId:s,breakpoint:o})=>globalThis.__ZION_AGENT_CANVAS__.isFocused(s,o),{pageId:r.pageId,breakpoint:r.breakpoint},{timeout:bee})),n.evaluate(({rpc:s,args:o,sessionExId:a})=>globalThis.__ZION_AGENT_CANVAS__.dispatch(s,o,a),{rpc:r.rpc,args:r.args,sessionExId:r.sessionExId})}async pageFor(t,r){let n=`${t.projectExId}/${t.appExId}`;return this.page&&!this.page.isClosed()&&this.browser?.isConnected()&&this.loadedFor===n?this.page:this.load(t,r)}async waitForPatch(t,r){try{return await t.waitForFunction(n=>globalThis.__ZION_AGENT_CANVAS__.hasAppliedPatch(n),r,{timeout:See}),!0}catch{return!1}}async load(t,r){let n=Ft().editorBaseUrl;if(!this.browser?.isConnected()||!this.context){await this.close();let{chromium:s}=await Tee(),o=process.env.EDITOR_HOST_RESOLVER_RULES;this.browser=await s.launch({headless:!0,args:o?[...tk,`--host-resolver-rules=${o}`]:tk}),this.context=await this.browser.newContext({viewport:{width:1280,height:800}})}await this.context.addCookies([{name:"loggedInUserStorageKey",value:encodeURIComponent(JSON.stringify({exId:t.user.exId,username:t.user.username,token:t.token,roleNames:[],registeredWithInLastMinute:!1})),url:n}]),(!this.page||this.page.isClosed())&&(this.page=await this.context.newPage());let i=new URLSearchParams({mode:"AGENT_CANVAS",leftSideTab:"page"});return r.pageId&&i.set("componentId",r.pageId),r.breakpoint&&i.set("breakpoint",r.breakpoint),this.loadedWithPatches=new Set(r.lastPatchExIds),this.loadedFor=null,await this.page.goto(`${n}/multi-client/tool/${t.projectExId}/${t.appExId}/design?${i}`,{waitUntil:"domcontentloaded",timeout:ek}),await this.page.waitForFunction(()=>!!globalThis.__ZION_AGENT_CANVAS__&&!!globalThis.document.querySelector("#canvas-viewport [data-meta-id]"),void 0,{timeout:ek}),this.loadedFor=`${t.projectExId}/${t.appExId}`,this.page}},rk=new t_;var rc=async(e,t)=>{let r=await t.getProjectArgs(e),n=qt(r.projectExId,r);return await t.schemaManager.load(n),{projectArgs:r,sArgs:n,snapshot:await t.schemaManager.snapshot(n,!0)}},wee=async(e,t)=>{let r=Q(e.flowId);if(!r)return t.fail(new Error("Provide a 'flowId'."));let{snapshot:n}=await rc(e,t);return t.ok(WL(n,r))},Oee=async(e,t)=>{let{snapshot:r}=await rc(e,t);return t.ok(XL(r))},Iee=async(e,t)=>{let{projectArgs:r,snapshot:n}=await rc(e,t),i=await t.client.request(TR,{projectExId:r.projectExId});return t.ok(ZL(n,i?.project?.lastDeployedServerSchema??null))},Aee=async(e,t)=>{let{snapshot:r}=await rc(e,t);return t.ok(zL(r))},Nee=async(e,t)=>{let{sArgs:r}=await rc(e,t);return t.ok(YL(await t.schemaManager.validate(r),tt(e.limit,e_)))},Cee=async(e,t)=>{let r=await XE(e,t);return t.ok(JL(r.ok,r.data,r.error??null))},Pee=async(e,t)=>{if(e.appExId)return e.appExId;let n=(Kf(await t.client.request(of,e)).apps??[]).filter(i=>i.appExId&&i.appType!=="BACKEND_ONLY");if(n.length===0)throw new Error("The project has no client app, so there is no canvas to render.");if(n.length>1)throw new Error(`Pass appExId: the project has ${n.length} client apps (${n.map(i=>i.appExId).join(", ")}), so the canvas to render is ambiguous.`);return n[0].appExId},nk=async(e,t,r,n)=>{let i=await n.getProjectArgs(r),s=qt(i.projectExId,i),o=await Pee(i,n),a=await n.client.request(nf);if(!a?.user?.exId)throw new Error("Could not resolve the signed-in account to render the canvas as.");return rk.run({projectExId:i.projectExId,appExId:o,token:await n.tokenManager.getValidToken(),user:{exId:a.user.exId,username:a.user.username??null}},{rpc:e,args:t,sessionExId:Q(r.sessionExId)??"",pageId:Q(r.pageId)??null,breakpoint:Q(r.breakpoint)??null,lastPatchExIds:await n.schemaManager.lastPatchExIds(s)})},Ree=["pageId","componentId","mode","breakpoint","maxWidth","limit"],ik=e=>Object.fromEntries(Ree.filter(t=>e[t]!==void 0).map(t=>[t,e[t]])),xee=async(e,t)=>t.ok(await nk("editor.getClippedComponents",ik(e),e,t)),Dee=async(e,t)=>Q(e.sessionExId)?t.ok(await nk("editor.captureCanvas",ik(e),e,t)):t.fail(new Error("Provide 'sessionExId': the capture is stored as that agent session's media.")),sk={"bridge.flow_definition":wee,"bridge.trigger_bindings":Oee,"bridge.deploy_status":Iee,"bridge.type_system_track":Aee,"bridge.project_errors":Nee,"bridge.sync_backend":Cee,"bridge.clipped_components":xee,"bridge.capture_canvas":Dee};f();f();var Lee=/Subselection required for type '(FZ_\w+)' of field '([^'/]+\/)?([^']+)'/,kee=/Unknown field argument '(where|limit|offset|order_by)'/,jee=/Field '([^']+)' in type '([^']+)' is undefined/,Mee=/field name '([^']+)' that is not defined for input object type '(\w+)'/,qee=(e,t)=>{let r=Array.from({length:t.length+1},(n,i)=>i);for(let n=1;n<=e.length;n+=1){let i=[n];for(let s=1;s<=t.length;s+=1)i[s]=Math.min(r[s]+1,i[s-1]+1,r[s-1]+(e[n-1]===t[s-1]?0:1));r=i}return r[t.length]},ak=(e,t)=>{let r=Math.max(2,Math.ceil(t.length/2));return e.map(n=>({name:n,score:qee(n.toLowerCase(),t.toLowerCase())})).filter(n=>n.score<=r).sort((n,i)=>n.score-i.score).slice(0,3).map(n=>n.name)},Fee=e=>(e?.tableMetadata??[]).flatMap(t=>[t?.name,t?.displayName].filter(r=>typeof r=="string"&&r.length>0)),Jf=(e,t)=>(e?.tableMetadata??[]).find(r=>r?.name===t),ok=(e,t)=>{let r=t?.columnMetadata??[],n=r.find(s=>s?.displayName===e&&s?.name);if(n){let s=$f(n)??n.name;return`'${e}' is a column DISPLAY name, which the runtime never accepts \u2014 pass '${s}'.`}if(r.some(s=>s?.name===e))return`'${e}' is in the project schema but not in the deployed backend. Run 'project sync-backend', then retry.`;let i=ak(r.flatMap(s=>[s?.name,s?.displayName]).filter(s=>typeof s=="string"&&s.length>0),e);return i.length>0?`No column '${e}'. Closest: ${i.join(", ")}.`:`No column '${e}' on this table.`},Uee=(e,t,r)=>{let n=Lee.exec(e);if(n){let u=n[3];return`'${u}' is a media column \u2014 the runtime takes the asset id as '${u}_id', the only form it filters, sorts or writes. Read the asset's url or metadata with runtime graphql instead: ${u} { id url }.`}if(kee.test(e))return`'${t}' exists in the runtime but is not a table collection \u2014 it takes no where/limit/order_by. Query it with runtime graphql instead.`;let i=Mee.exec(e);if(i)return ok(i[1],Jf(r,t));let s=jee.exec(e);if(!s)return null;let[,o,a]=s;if(a!=="Query"&&a!=="Mutation")return ok(o,Jf(r,t));if(Jf(r,t))return`'${t}' is in the project schema but not in the deployed backend. Run 'project sync-backend', then retry \u2014 every runtime call hits the deployed app, never the draft.`;let c=ak(Fee(r),t);return c.length>0?`No table '${t}' in the project schema. Closest: ${c.join(", ")}.`:`No table '${t}' in the project schema \u2014 'schema snapshot' lists the ones there are.`},ck=(e,t,r)=>{let n=e instanceof Error?e.message:String(e),i=Uee(n,t,r);return i?e instanceof Error?(e.runtimeDiagnosis=i,e):new Error(`${n}
1504
- ${i}`):e},uk=(e,t,r)=>{let n=e?.tableMetadata??[];if(!n.some(s=>s?.name===t)){let s=n.find(o=>o?.displayName===t&&o?.name);if(s?.name)throw new Error(`'${t}' is a table DISPLAY name, which the runtime never accepts \u2014 pass '${s.name}'.`)}let i=Jf(e,t)?.columnMetadata??[];for(let s of r??[]){let o=i.find(c=>c?.name===s)??i.find(c=>c?.displayName===s),a=o?$f(o):null;if(!(!o||!a||a===s))throw new Error(o.name===s?`'${s}' is a media column \u2014 pass '${a}', the asset id, which is the only form the runtime filters, sorts or writes. For the asset's url or metadata, select subfields with runtime graphql: ${s} { id url }.`:`'${s}' is a column DISPLAY name, which the runtime never accepts \u2014 pass '${a}'.`)}};f();f();var Vee=/^[A-Za-z_][A-Za-z0-9_]*$/,xn=(e,t)=>{if(!Vee.test(e))throw new Error(`${t} must be a GraphQL identifier`)},r_=(e,t)=>{for(let r of e)xn(r,t)},zf=(e,t)=>{if(e.length===0)throw new Error("at least one field must be selected");return r_(e,"fields"),e.map(r=>`${t}${r}`).join(`
1505
- `)},lk=(e,t)=>(xn(e,"table"),`query AgentQuery($where: ${e}_bool_exp, $limit: Int, $offset: Int, $order_by: [${e}_order_by!]) {
1506
- ${e}(where: $where, limit: $limit, offset: $offset, order_by: $order_by) {
1507
- ${zf(t," ")}
1508
- }
1509
- }`),fk=e=>(xn(e,"table"),`query AgentAggregate($where: ${e}_bool_exp) {
1510
- ${e}_aggregate(where: $where) {
1511
- aggregate {
1512
- count
1513
- }
1514
- }
1515
- }`),dk=(e,t)=>(xn(e,"table"),`mutation AgentInsert($objects: [${e}_insert_input!]!) {
1516
- insert_${e}(objects: $objects) {
1517
- affected_rows
1518
- returning {
1519
- ${zf(t," ")}
1520
- }
1521
- }
1522
- }`),pk=(e,t)=>(xn(e,"table"),`mutation AgentUpdate($where: ${e}_bool_exp!, $set: ${e}_set_input!) {
1523
- update_${e}(where: $where, _set: $set) {
1524
- affected_rows
1525
- returning {
1526
- ${zf(t," ")}
1527
- }
1528
- }
1529
- }`),hk=(e,t)=>(xn(e,"table"),`mutation AgentDelete($where: ${e}_bool_exp!) {
1530
- delete_${e}(where: $where) {
1531
- affected_rows
1532
- returning {
1533
- ${zf(t," ")}
1534
- }
1535
- }
1536
- }`),mk=()=>`mutation AgentRunCode($jsCode: String!, $args: JsonObject, $updateDb: Boolean!) {
1537
- fz_debug_action_code(jsCode: $jsCode, args: $args, updateDb: $updateDb)
1538
- }`;var Gee=20,$ee=200,Bee=20,n_="id",i_=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},Ek=e=>Array.isArray(e)?e:[],Kee=(e,t)=>typeof e=="boolean"?e:e==null?t:String(e).toLowerCase()==="true",gk=(e,t)=>typeof e=="number"&&Number.isFinite(e)?Math.trunc(e):t,yk=(e,t)=>{let r=e[t];if(typeof r!="string"||r.trim()==="")throw new Error(`'${t}' is required.`);return r},vk=(e,t,r)=>{let n=i_(e.where);if(Object.keys(n).length>0)return n;if(e[r]===!0)return{};throw new Error(`'where' is required and must not be empty \u2014 this ${t} runs against the live app and there is no change-everything option.`)},Xf=(e,t)=>{let r=Ek(e.fields).filter(n=>typeof n=="string"&&n.trim()!=="");return r.length>0?(r_(r,"fields"),r):t.length>0?t.slice(0,Bee):[n_]},Hee=e=>e.includes(n_)?e:[n_,...e],s_=(e,t,r=[])=>{if(e==="runtime.run_code")return{document:mk(),variables:{jsCode:yk(t,"jsCode"),args:i_(t.args),updateDb:Kee(t.updateDb,!1)},rootField:"fz_debug_action_code"};let n=yk(t,"tableName");switch(xn(n,"tableName"),e){case"runtime.query":return{document:lk(n,Xf(t,r)),variables:{where:t.where??{},limit:Math.min(gk(t.limit,Gee),$ee),offset:gk(t.offset,0),order_by:t.orderBy??null},rootField:n};case"runtime.aggregate":return{document:fk(n),variables:{where:t.where??{}},rootField:`${n}_aggregate`};case"runtime.insert":{let i=Ek(t.objects);if(i.length===0)throw new Error("'objects' must contain at least one row to insert.");if(i.some(s=>!s||typeof s!="object"||Array.isArray(s)))throw new Error("every entry in 'objects' must be an object of column values.");return{document:dk(n,Hee(Xf(t,r))),variables:{objects:i},rootField:`insert_${n}`}}case"runtime.update":{let i=vk(t,"update","allowUpdateAll"),s=i_(t.set);if(Object.keys(s).length===0)throw new Error("'set' must contain at least one column to change.");return{document:pk(n,Xf(t,r)),variables:{where:i,set:s},rootField:`update_${n}`}}case"runtime.delete":return{document:hk(n,Xf(t,r)),variables:{where:vk(t,"delete","allowDeleteAll")},rootField:`delete_${n}`};default:throw new Error(`'${e}' is not a planned runtime operation.`)}},_k=e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;let t=Object.keys(e);return t.length===1?e[t[0]]:e};async function nc(e,t,r,n){let i=await r.checkSchema(t),s=await r.getProjectArgs(t),o=Ci(t.tableName,"tableName"),[a,c]=await Promise.all([r.schemaManager.dataModel(qt(s.projectExId,s)),Ws(r.client,s)]);uk(a,o,Ni(t.fields));let u=s_(e,{...t,tableName:o},CL(a,o)),l;try{l=await c.dataClient.request(u.document,u.variables)}catch(d){throw ck(d,o,a)}return r.ok(St(n?_k(l):l,i))}var Qee=async(e,t)=>{let r=await t.checkSchema(e),n=await t.getProjectArgs(e),i=Ci(e.query,"query"),o=await(await Ws(t.client,n)).dataClient.request(i,e.variables??{});return t.ok(St(o,r))},Wee=async(e,t)=>nc("runtime.query",e,t,!1),Yee=async(e,t)=>nc("runtime.aggregate",e,t,!1),Jee=async(e,t)=>nc("runtime.insert",e,t,!0),zee=async(e,t)=>nc("runtime.update",e,t,!0),Xee=async(e,t)=>nc("runtime.delete",e,t,!0),Zee=async(e,t)=>{let r=await t.getProjectArgs(e),n=s_("runtime.run_code",e),s=await(await Ws(t.client,r)).adminClient.request(n.document,n.variables);return t.ok({keptWrites:n.variables.updateDb===!0,result:s?.fz_debug_action_code})},Sk={"runtime.graphql":Qee,"runtime.run_code":Zee,"runtime.query":Wee,"runtime.aggregate":Yee,"runtime.insert":Jee,"runtime.update":zee,"runtime.delete":Xee};f();var ete=["GATEWAY","ACTION_FLOW","ACTION_FLOW_NODE","ACTION_FLOW_CONTEXT_LOG","DEPLOYMENT","TPA","TRIGGER","SQL_GENERATION","GQL","ZAI"],tte=["INFO","WARNING","ERROR"],rte=50,nte=100,bk=5,Tk=e=>`${e.toISOString().slice(0,19)}Z`,ite=e=>{if(!e)return new Date;let t=new Date(e);return Number.isNaN(t.getTime())?new Date:t},wk=(e,t)=>{if(!e)return;let r=e.map(n=>n.toUpperCase()).filter(n=>t.includes(n));return r.length>0?r:void 0},ste=async(e,t)=>{let r=await t.getProjectArgs(e),{adminToken:n}=await Ws(t.client,r),i=ite(Q(e.requestCreatedAt)),s={start:Tk(new Date(i.getTime()-bk*6e4)),end:Tk(new Date(i.getTime()+bk*6e4)),desc:!0},o=wk(Ni(e.types),ete);o&&(s.type=o);let a=wk(Ni(e.levels),tte);a&&(s.level=a);let c=Q(e.customQueryCondition);c&&(s.customQueryCondition=c);let u=Math.min(nte,tt(e.limit,rte)),l=Ft().logApiUrlTemplate.replace("{projectExId}",r.projectExId),h=((await new it(l,{headers:{authorization:`Bearer ${n}`},fetch:Qs}).request(wR,{queryCreation:s,paginator:{first:u}}))?.fetchLogsByPaginator?.edges??[]).map(g=>g?.node).filter(g=>!!g);return t.ok({entries:h})},Ok={"logs.search":ste};f();f();var ote=async()=>(await import("./corpus-XVQ4ZV2V.js")).DOCS_CORPUS,ate=3,Ik=null,cte=e=>{let t=new Map;for(let r of e)t.set(r.path,r);for(let r of e)for(let n of r.aliases??[])t.has(n)||t.set(n,r);return t},ute=e=>{let t=e.map(r=>{let n=vp(r.content),i=vp(r.title);for(let s=0;s<ate;s+=1)n.push(...i);return{ref:r,tokens:n}});return{index:bb(t),byPath:cte(e)}},Ak=async()=>(Ik??=ute(await ote()),Ik),Nk=async(e,t=10)=>{let{index:r}=await Ak();return Tb(r,e).filter(n=>n.score>0).sort((n,i)=>i.score-n.score).slice(0,Math.max(1,t)).map(n=>({path:n.ref.path,title:n.ref.title,url:n.ref.url}))},lte=e=>{let t=e.trim().replace(/\.mdx$/,"").replace(/^\/+/,"/").replace(/\/+$/,"");return t===""||t==="/"?"/":t.startsWith("/")?t:`/${t}`},Ck=async e=>(await Ak()).byPath.get(lte(e))??null;var fte=async(e,t)=>{let r=Q(e.query);if(!r)throw new Error("query is required");let n=tt(e.limit,10);return t.ok({results:await Nk(r,n)})},dte=async(e,t)=>{let r=Q(e.path);if(!r)throw new Error("path is required");let n=await Ck(r);if(!n)throw new Error(`No doc page found for path: ${r}`);return t.ok(n)},Pk={"docs.search":fte,"docs.get_page":dte};f();var pte=async(e,t)=>{let r=Q(e.query);if(!r)throw new Error("query is required");let n=e.variables&&typeof e.variables=="object"?e.variables:{};return t.ok(await t.client.request(r,n))},Rk={"platform.graphql":pte};f();var hte=async(e,t)=>{let r=await Mt(),n=r?.api?.ZTypePredefinedApi;if(!n)return t.fail(new Error("ztype predefined template API is unavailable"));let s=n.getActionFlowTemplates(Ks(r)).map(o=>({templateCodeId:o.preDefinedCodeId,displayName:o.displayName,group:o.directory,async:o.async,inputs:o.input,outputs:o.output}));return t.ok({templates:s})},xk={"actionflow.list_node_templates":hte};f();var mte=e=>{if(!e)return null;let t=e.split("?")[0]?.split("/").pop();if(!t)return null;let r=t.replace(/\.[a-z0-9]+$/i,"");return r.length>0?r:null},gte=async(e,t)=>{let n=(await t.client.request(UP)).getTabBarIcons.flatMap(i=>i?[{name:mte(i.url),exId:i.exId}]:[]);return t.ok({icons:n,note:n.length===0?"This deployment ships no preset tab-bar icons; upload one in the editor and use its exId.":"A name ending in _selected is the pressed-state partner of the icon with the same prefix; for the plain icons use the same exId for both states."})},Dk={"component.tab_bar_icons":gte};f();var Fq=He(bq(),1);f();function Bse(e){let t;try{t=new URL(e)}catch{throw new Error(`Unsupported or malformed URL: ${e}`)}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error(`Only http/https URLs are allowed: ${e}`);return t}async function Kse(e,t){let r=e.body?.getReader();if(!r)throw new Error(`Empty response body from ${t}`);let n=[],i=0;for(;;){let{done:s,value:o}=await r.read();if(s)break;if(i+=o.byteLength,i>10485760)throw await r.cancel(),new Error("Response exceeds size limit of 10485760 bytes");n.push(o)}return Buffer.concat(n).toString("utf8")}async function US(e){let t=e;for(let r=0;r<=5;r++){let n=Bse(t),i=await fetch(n,{redirect:"manual",signal:AbortSignal.timeout(2e4),headers:{Accept:"application/json, application/yaml, text/yaml, text/html, */*","User-Agent":"Momen-Agent-TpaImport"}});if(i.status>=300&&i.status<400){let s=i.headers.get("location");if(await i.body?.cancel(),!s)throw new Error(`Redirect without Location from ${t}`);t=new URL(s,n).toString();continue}if(!i.ok)throw await i.body?.cancel(),new Error(`HTTP ${i.status} fetching ${t}`);return{finalUrl:n.toString(),contentType:i.headers.get("content-type"),body:await Kse(i,t)}}throw new Error(`Too many redirects fetching ${e}`)}f();var Hse=/(?:href|src|url)\s*[=:]\s*["']?([^"'\s>)]+)/gi,Qse=/<(script|style|noscript|svg|iframe|canvas|template|nav|footer|aside)\b[\s\S]*?<\/\1\s*>/gi,Wse=new Set(["css","js","png","jpg","jpeg","gif","svg","ico","woff","woff2","ttf","webp","mp4","zip","pdf"]);function Tq(e,t){if(e&&e.toLowerCase().includes("html"))return!0;let r=t.trimStart();return r.startsWith("<")&&!r.startsWith("<?xml")}function wq(e){let t=e.length>4e3?e.slice(0,4e3):e;return t.includes('"openapi"')||t.includes('"swagger"')||/(^|\n)\s*openapi\s*:/.test(t)||/(^|\n)\s*swagger\s*:/.test(t)}function Oq(e,t){try{return new URL(t,e).toString()}catch{return t.startsWith("http")?t:null}}var Yse=/^https?:\/\/app\.swaggerhub\.com\/apis(?:-docs)?\/([^/?#]+)\/([^/?#]+)\/([^/?#]+)/i;function Jse(e){let t=e.match(Yse);return t?`https://api.swaggerhub.com/apis/${t[1]}/${t[2]}/${t[3]}`:null}function Iq(e,t){let r=[],n=i=>{i&&r.length<20&&!r.includes(i)&&r.push(i)};for(let i of e.matchAll(Hse)){if(r.length>=20)break;let s=i[1],o=s.toLowerCase();if(!(o.includes("openapi")||o.includes("swagger")||(o.endsWith(".json")||o.endsWith(".yaml")||o.endsWith(".yml"))&&o.includes("api")))continue;let c=Oq(t,s);n(c&&Jse(c)),n(c)}return r}function Aq(e,t){let r=[],n;try{n=new URL(t).host}catch{return r}for(let i of e.matchAll(/<a\b[^>]*href\s*=\s*["']([^"'#]+)[^"']*["']/gi)){if(r.length>=40)break;let s;try{s=new URL(i[1],t)}catch{continue}if(s.host!==n)continue;s.hash="";let o=s.toString(),a=s.pathname.toLowerCase(),c=a.slice(a.lastIndexOf(".")+1);Wse.has(c)||o===t||r.includes(o)||r.push(o)}return r}var zse={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",copy:"\xA9"};function VS(e){return e.replace(/&#x([0-9a-f]+);/gi,(t,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&#(\d+);/g,(t,r)=>String.fromCodePoint(parseInt(r,10))).replace(/&([a-z]+);/gi,(t,r)=>zse[r.toLowerCase()]??t)}var Lc=e=>e.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();function Nq(e,t){let r=e.replace(/<!--[\s\S]*?-->/g,"").replace(Qse,"");return r=r.replace(/<pre\b[^>]*>([\s\S]*?)<\/pre\s*>/gi,(n,i)=>`
1539
- \`\`\`
1540
- ${VS(Xse(i))}
1541
- \`\`\`
1542
- `),r=r.replace(/<code\b[^>]*>([\s\S]*?)<\/code\s*>/gi,(n,i)=>`\`${VS(Lc(i))}\``),r=r.replace(/<a\b[^>]*href\s*=\s*["']([^"']+)["'][^>]*>([\s\S]*?)<\/a\s*>/gi,(n,i,s)=>{let o=Lc(s);if(!o)return"";let a=Oq(t,i);return a?`[${o}](${a})`:o}),r=r.replace(/<h([1-6])\b[^>]*>([\s\S]*?)<\/h\1\s*>/gi,(n,i,s)=>`
1543
-
1544
- ${"#".repeat(Number(i))} ${Lc(s)}
1545
-
1546
- `),r=r.replace(/<t[hd]\b[^>]*>([\s\S]*?)<\/t[hd]\s*>/gi,(n,i)=>` ${Lc(i)} |`).replace(/<tr\b[^>]*>/gi,`
1547
- |`).replace(/<\/tr\s*>/gi,""),r=r.replace(/<li\b[^>]*>/gi,`
1548
- - `).replace(/<br\s*\/?>/gi,`
1549
- `).replace(/<\/(p|div|section|article|ul|ol|table|thead|tbody|dl|blockquote)\s*>/gi,`
1550
-
1551
- `).replace(/<(strong|b)\b[^>]*>([\s\S]*?)<\/\1\s*>/gi,(n,i,s)=>`**${Lc(s)}**`),r=VS(r.replace(/<[^>]+>/g," ")),r.replace(/[^\S\n]+\n/g,`
1552
- `).replace(/[ \t]{3,}/g," ").replace(/\n{3,}/g,`
1553
-
1554
- `).trim()}var Xse=e=>e.replace(/<[^>]+>/g,"");f();var Zse=new Set(["page","pageindex","pagenumber","pageno","offset","start"]),eoe=new Set(["pagesize","limit","size","perpage","per_page","count"]),xq=["get","post","put","delete","patch"],Cq={SUCCESS:"2",PERMANENT_FAIL:"4",TEMPORARY_FAIL:"5"},ne=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:null;function Dq(e){if(typeof e.swagger=="string"&&!e.swagger.startsWith("2"))throw new Error(`Unsupported Swagger version ${e.swagger}; provide an OpenAPI v3 (or Swagger 2.0) spec, or author the configs with the granular TPA tools.`);if(typeof e.swagger!="string"&&(typeof e.openapi!="string"||!e.openapi.startsWith("3")))throw new Error('Not an OpenAPI v3 document (missing "openapi: 3.x"). If this is a docs page rather than a spec, use fetch_doc to read it and author the configs with the granular TPA tools.')}function Lq(e){if(typeof e.swagger!="string")return e;let t=Array.isArray(e.schemes)?e.schemes.map(String):[],r=t.includes("https")?"https":t[0]??"https",n=typeof e.host=="string"?e.host:"",i=typeof e.basePath=="string"?e.basePath:"",s=n?[{url:`${r}://${n}${i}`}]:i?[{url:i}]:[],o=u=>{let{name:l,in:d,required:p,description:h}=u,g={};for(let y of["type","format","items","enum","properties"])u[y]!==void 0&&(g[y]=u[y]);return{name:l,in:d,required:p,description:h,schema:g}},a=u=>{let l={...u},d=Array.isArray(u.parameters)?u.parameters:[],p=d.find(g=>g.in==="body");l.parameters=d.filter(g=>g.in!=="body"&&g.in!=="formData").map(o),p&&ne(p.schema)&&(l.requestBody={content:{"application/json":{schema:p.schema}}});let h=ne(u.responses);if(h){let g={};for(let[y,E]of Object.entries(h)){let S=ne(E);g[y]=S&&ne(S.schema)?{content:{"application/json":{schema:S.schema}}}:E}l.responses=g}return l},c={};for(let[u,l]of Object.entries(ne(e.paths)??{})){let d=ne(l);if(!d)continue;let p={};Array.isArray(d.parameters)&&(p.parameters=d.parameters.filter(h=>h.in!=="body"&&h.in!=="formData").map(o));for(let h of xq){let g=ne(d[h]);g&&(p[h]=a(g))}c[u]=p}return{openapi:"3.0.0",servers:s,paths:c,components:{schemas:ne(e.definitions)??{},securitySchemes:ne(e.securityDefinitions)??{}},security:Array.isArray(e.security)?e.security:[]}}function kq(e,t,r){let n=[],i=[],s=0,o=aoe(e),a=coe(e),c=toe(e),u=ne(e.paths);if(!u)return{configs:n,totalOperations:0,included:0,notes:i};for(let[l,d]of Object.entries(u)){if(!foe(l,t))continue;let p=ne(d);if(!p)continue;let h=Array.isArray(p.parameters)?p.parameters:[];for(let g of xq){let y=ne(p[g]);if(!y)continue;let E=g.toUpperCase(),S=doe(E);if(!S){i.push(`Skipped ${E} ${l} (unsupported HTTP method)`);continue}s++,!(n.length>=r)&&n.push(noe(a,l,S,E,y,h,o,roe(y,c)))}}return s>n.length&&i.push(`Import capped at ${r} endpoints; ${s-n.length} not imported. Use pathsFilter to select more.`),n.some(l=>!l.url.startsWith("http"))&&i.push("The spec declares no absolute server URL, so the imported endpoint urls are relative and cannot be called as-is. Determine the API's base URL from its documentation and fix each config with UPDATE_TPA_CONFIG."),{configs:n,totalOperations:s,included:n.length,notes:i}}function toe(e){let t=new Map,r=ne(ne(e.components)?.securitySchemes);for(let[n,i]of Object.entries(r??{})){let s=ne(i);if(s?.type!=="apiKey"||typeof s.name!="string")continue;let o=s.in==="query"?"QUERY":s.in==="header"?"HEADER":null;o&&t.set(n,{name:s.name,position:o})}return{schemes:t,globalRequirements:Array.isArray(e.security)?e.security:[]}}function roe(e,t){let r=Array.isArray(e.security)?e.security:t.globalRequirements,n=new Set(r.flatMap(s=>Object.keys(ne(s)??{}))),i=[];for(let s of n){let o=t.schemes.get(s);o&&i.push(o)}return i}function noe(e,t,r,n,i,s,o,a){let c=[],u=Array.isArray(i.parameters)?i.parameters:[],l=new Set(u.map(g=>`${String(g.name)}\0${String(g.in)}`)),d=[...u,...s.filter(g=>!l.has(`${String(g.name)}\0${String(g.in)}`))];for(let g of d){let y=poe(g.in);if(!y)continue;let E=g.required===!0||y==="PATH";c.push({position:y,node:kc(String(g.name??""),ne(g.schema),E,o,0)})}c.push(...ioe(i,o));for(let g of a)c.some(y=>y.position===g.position&&y.node.name===g.name)||c.push({position:g.position,node:{name:g.name,type:"TEXT",itemType:null,required:!0,children:[]}});let p=soe(i,o),h=ooe(c);return{name:loe(i,n,t),url:uoe(e,t),method:r,operation:r==="GET"?"query":"mutation",parameters:c,responses:p,paging:h}}function ioe(e,t){let r=[],n=ne(ne(e.requestBody)?.content);if(!n)return r;let i=Mq(n);if(!i)return r;let s=GS(i,t,0);if(s&&zd(s)==="object"&&ne(s.properties)){let o=jq(s);for(let[a,c]of Object.entries(ne(s.properties)))r.push({position:"BODY",node:kc(a,ne(c),o.includes(a),t,1)})}else r.push({position:"BODY",node:kc("body",i,!1,t,0)});return r}function soe(e,t){let r=[],n=ne(e.responses);if(!n)return r;for(let i of Object.keys(Cq)){let s=Cq[i],o=Object.entries(n).find(([u])=>u.startsWith(s)),a=ne(ne(o?.[1])?.content);if(!a)continue;let c=Mq(a);c&&r.push({branch:i,root:kc("response",c,!1,t,0)})}return r}function kc(e,t,r,n,i){let s=GS(t,n,i);if(!s||i>6)return{name:e,type:"TEXT",itemType:null,required:r,children:[]};let o=zd(s);if(o==="object")return{name:e,type:"OBJECT",itemType:null,required:r,children:Pq(s,n,i)};if(o==="array"){let a=GS(ne(s.items),n,i);return a&&zd(a)==="object"?{name:e,type:"ARRAY",itemType:"OBJECT",required:r,children:Pq(a,n,i)}:{name:e,type:"ARRAY",itemType:a?Rq(a):"TEXT",required:r,children:[]}}return{name:e,type:Rq(s),itemType:null,required:r,children:[]}}function Pq(e,t,r){let n=ne(e.properties);if(!n)return[];let i=jq(e);return Object.entries(n).map(([s,o])=>kc(s,ne(o),i.includes(s),t,r+1))}function GS(e,t,r){let n=e,i=0;for(;n&&typeof n.$ref=="string"&&n.$ref.trim()!==""&&i++<6;)n=t.get(hoe(n.$ref))??null;return n}function zd(e){let t=Array.isArray(e.type)?e.type.find(r=>r!=="null"):e.type;return typeof t=="string"?t:ne(e.properties)?"object":"string"}function Rq(e){let t=zd(e),r=typeof e.format=="string"?e.format:null;switch(t){case"integer":return r==="int64"?"BIGINT":"INTEGER";case"number":return"FLOAT8";case"boolean":return"BOOLEAN";default:return"TEXT"}}function jq(e){return Array.isArray(e.required)?e.required.filter(t=>typeof t=="string"):[]}function Mq(e){let t=ne(e["application/json"]);if(!t){let r=Object.keys(e).find(n=>n.toLowerCase().includes("json"));t=r?ne(e[r]):null}if(!t){let r=Object.values(e)[0];t=ne(r)}return t?ne(t.schema):null}function ooe(e){let t=null,r=null;for(let n of e){if(n.position!=="QUERY")continue;let i=n.node.name.toLowerCase();!t&&Zse.has(i)&&(t=n.node.name),!r&&eoe.has(i)&&(r=n.node.name)}return!t||!r?null:{pageIndexPath:[t],pageSizePath:[r],pageIndexStartValue:t.toLowerCase().includes("offset")?0:1}}function aoe(e){let t=ne(ne(e.components)?.schemas),r=new Map;if(t)for(let[n,i]of Object.entries(t)){let s=ne(i);s&&r.set(n,s)}return r}function coe(e){let t=Array.isArray(e.servers)?e.servers:[],r=ne(t[0])?.url;return typeof r=="string"?r:""}function uoe(e,t){return e.trim()===""?t:e.endsWith("/")&&t.startsWith("/")?e.slice(0,-1)+t:!e.endsWith("/")&&!t.startsWith("/")?`${e}/${t}`:e+t}function loe(e,t,r){return typeof e.operationId=="string"&&e.operationId.trim()?e.operationId:typeof e.summary=="string"&&e.summary.trim()?e.summary:`${t} ${r}`}function foe(e,t){return!t||t.length===0?!0:t.some(r=>r&&r.trim()!==""&&e.includes(r))}function doe(e){switch(e){case"GET":return"GET";case"POST":case"PATCH":return"POST";case"PUT":return"PUT";case"DELETE":return"DELETE";default:return null}}function poe(e){if(typeof e!="string")return null;switch(e.toLowerCase()){case"query":return"QUERY";case"path":return"PATH";case"header":return"HEADER";default:return null}}function hoe(e){let t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}var goe=25,Uq=15,yoe=3600*1e3,$n=class extends Error{};async function voe(e,t){let r=await t.checkSchema(e),n=await t.getProjectArgs(e);return{warning:r,sArgs:qt(n.projectExId,n)}}function Eoe(e,t){return async r=>{let n=await e.schemaManager.ztypeToolCalls(t,r);if(Array.isArray(n.errors)&&n.errors.length>0)throw new $n(n.errors.map(i=>String(i)).join("; ")||"schema op failed");if(!Array.isArray(n.responses)||n.responses.length!==r.length)throw new $n("schema ops returned no responses");return n.responses}}function _oe(e){try{return JSON.parse(e)}catch{try{let t=(0,Fq.parse)(e);if(t&&typeof t=="object"&&!Array.isArray(t))return t;throw new Error("document is not a mapping")}catch(t){throw new Error(`Spec is not valid JSON or YAML: ${t.message}`)}}}var $S=e=>({name:e.name,type:e.type,...e.itemType?{itemType:e.itemType}:{},required:e.required}),nr=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:null;function Soe(e){let t=new Map,r=i=>{let s=nr(i);s&&(typeof s.uniqueId=="string"&&t.set(s.uniqueId,s),Array.isArray(s.parameters)&&s.parameters.forEach(r))};(Array.isArray(e.parameters)?e.parameters:[]).forEach(r);let n=nr(e.response);for(let i of["successResponse","permanentFailResponse","temporaryFailResponse"])r(nr(n?.[i])?.responseData);return t}var boe={SUCCESS:"successResponse",PERMANENT_FAIL:"permanentFailResponse",TEMPORARY_FAIL:"temporaryFailResponse"};function Toe(e,t){let r=nr(e.response),n=nr(nr(r?.[boe[t]])?.responseData);return typeof n?.uniqueId=="string"?n.uniqueId:null}function woe(e,t,r){let n=Array.isArray(e.parameters)?e.parameters:[];for(let i of n){let s=nr(i);if(s?.name===r&&s?.position===t)return typeof s.uniqueId=="string"?s.uniqueId:null}return null}function Ooe(e,t,r){let n=e.get(t)?.parameters;if(!Array.isArray(n))return null;for(let i of n){let s=nr(i);if(s?.name===r)return typeof s.uniqueId=="string"?s.uniqueId:null}return null}var BS=(e,t)=>{if(!e)throw new $n(`could not resolve uniqueId for '${t}'`);return e},KS=e=>e.children.length>0;async function Ioe(e){let[t]=await e([{name:"GET_ALL_TPA_CONFIGS_INFO",args:{}}]),r=new Set;if(Array.isArray(t))for(let n of t){let i=nr(n);typeof i?.name=="string"&&r.add(i.name)}return r}function Aoe(e,t){let r=new Set(t);return e.map(n=>{let i=n.name,s=2;for(;r.has(i);)i=`${n.name} (${s++})`;return r.add(i),{...n,name:i}})}async function Noe(e,t){let[r]=await e([{name:"ADD_TPA_CONFIGS",args:{items:t.map(o=>({name:o.name,url:o.url,method:o.method,operation:o.operation}))}}]),n=r;Array.isArray(n)||([n]=await e([{name:"GET_ALL_TPA_CONFIGS_INFO",args:{}}]));let i=new Map;if(Array.isArray(n))for(let o of n){let a=nr(o);typeof a?.name=="string"&&typeof a?.tpaConfigId=="string"&&i.set(a.name,a.tpaConfigId)}let s=new Map;for(let o of t){let a=i.get(o.name);if(!a)throw new $n(`endpoint '${o.name}' not found after creation`);s.set(o.name,a)}return s}async function Coe(e,t,r){let n=[];for(let a of r.parameters)n.push({name:"ADD_TPA_CONFIG_PARAMETERS",args:{tpaConfigId:t,items:{[a.position]:$S(a.node)}}});for(let a of r.responses)n.push({name:"ADD_TPA_RESPONSE_DATA",args:{tpaConfigId:t,responseBranch:a.branch,responseData:$S(a.root)}});r.paging&&n.push({name:"SET_TPA_CONFIG_PAGING",args:{tpaConfigId:t,pageIndexPath:r.paging.pageIndexPath,pageSizePath:r.paging.pageSizePath,...r.paging.pageIndexStartValue!==null?{pageIndexStartValue:r.paging.pageIndexStartValue}:{}}}),n.push({name:"GET_TPA_CONFIG_DETAIL",args:{tpaConfigId:t}});let i=await e(n),s=nr(i[i.length-1]);if(!s)throw new $n(`could not read back config detail for '${r.name}'`);let o=[];for(let a of r.parameters)KS(a.node)&&o.push({response:!1,responseBranch:null,parentUniqueId:BS(woe(s,a.position,a.node.name),a.node.name),children:a.node.children});for(let a of r.responses)KS(a.root)&&o.push({response:!0,responseBranch:a.branch,parentUniqueId:BS(Toe(s,a.branch),`response:${a.branch}`),children:a.root.children});for(;o.length>0;){let a=o.map(p=>({name:p.response?"ADD_TPA_RESPONSE_DATA_CHILDREN":"ADD_TPA_PARAMETER_CHILDREN",args:{tpaConfigId:t,parentUniqueId:p.parentUniqueId,items:p.children.map($S),...p.response?{responseBranch:p.responseBranch}:{}}}));a.push({name:"GET_TPA_CONFIG_DETAIL",args:{tpaConfigId:t}});let c=await e(a),u=nr(c[c.length-1]);if(!u)throw new $n("could not read back config detail while nesting children");let l=Soe(u),d=[];for(let p of o)for(let h of p.children)KS(h)&&d.push({response:p.response,responseBranch:p.responseBranch,parentUniqueId:BS(Ooe(l,p.parentUniqueId,h.name),h.name),children:h.children});o=d}}async function Poe(e,t){t.length!==0&&await e([{name:"DELETE_TPA_CONFIGS",args:{tpaConfigIds:t}}]).catch(()=>{})}async function Roe(e,t){if(t.configs.length===0)return{success:!0,message:"No importable operations found in the spec.",created:0,configs:[],notes:t.notes};let r=Aoe(t.configs,await Ioe(e)),n;try{n=await Noe(e,r)}catch(o){return{success:!1,message:`Failed to create endpoints: ${o.message}`,created:0,configs:[],notes:t.notes}}let i=[...n.values()],s=[];try{for(let o of r){let a=n.get(o.name);await Coe(e,a,o),s.push({name:o.name,tpaConfigId:a,parameters:o.parameters.length,responseBranches:o.responses.length})}}catch(o){return await Poe(e,i),{success:!1,message:`Import failed and was rolled back: ${o.message}`,created:0,configs:[],notes:t.notes}}return{success:!0,message:`Imported ${s.length} endpoint(s). Editing creates a new version; run project sync-backend for changes to take effect in production.`,created:s.length,configs:s,notes:t.notes}}var xoe=async(e,t)=>{let r=Q(e.url),n=Q(e.specText),s=(Array.isArray(e.pathsFilter)?e.pathsFilter.map(String):typeof e.pathsFilter=="string"?[e.pathsFilter]:null)?.flatMap(p=>{if(p.trimStart().startsWith("["))try{let h=JSON.parse(p);if(Array.isArray(h))return h.map(String)}catch{}return[p]})??null,o;if(n&&n.trim()!=="")o=n;else if(r&&r.trim()!=="")o=(await US(r)).body;else throw new Error("Provide either 'url' or 'specText'.");let a=_oe(o);Dq(a);let c=kq(Lq(a),s,goe),{warning:u,sArgs:l}=await voe(e,t),d=await Roe(Eoe(t,l),c);return t.ok(St(d,u))},qq=new Map;function Doe(e){let t=Date.now(),r=qq.get(e),n=r&&t-r.startedAt<yoe?r:{used:0,startedAt:t};return n.used+=1,qq.set(e,n),Uq-n.used}var Loe=async(e,t)=>{let r=Q(e.url);if(!r||r.trim()==="")throw new Error("Provide a 'url' to fetch.");let n=Doe(t.credentialStore.getWorkspaceRoot());if(n<0)throw new Error(`fetch budget exhausted (${Uq} per session) \u2014 import a discovered spec with tpa import-from-openapi, or author configs from what you have already read.`);let i=await US(r),s=Tq(i.contentType,i.body),o=s?Iq(i.body,i.finalUrl):[],a=s?Aq(i.body,i.finalUrl):[],c=s?Nq(i.body,i.finalUrl):i.body,u=Math.max(0,Math.min(tt(e.offset,0),c.length)),l=c.slice(u,u+2e4);return t.ok({finalUrl:i.finalUrl,contentType:i.contentType,looksLikeSpec:wq(i.body),specLinks:o,pageLinks:a,truncated:u+l.length<c.length,totalLength:c.length,fetchesRemaining:n,content:l})},Vq={"tpa.import_from_openapi":xoe,"tpa.fetch_doc":Loe};f();var koe=async(e,t)=>{let r=ce(e.secretId),n=ce(e.displayName),i=ce(e.description);if(!!r==!!n)return t.fail("Provide exactly one of secretId (set an existing secret) or displayName (create a new one).");let s=await t.checkSchema(e),o=await t.getProjectArgs(e),a=qt(o.projectExId,o),c=await t.schemaManager.currentSchemaExId(a);if(!c)throw new Error("No loaded schema for the project; load the project schema before setting a secret value.");let u=await BL(n??r),d=(await t.client.request(hR,{projectExId:o.projectExId,schemaExId:c,secretValue:u})).saveSecret?.secretKey;if(!d)throw new Error("saveSecret did not return a secretKey.");let p=r?{name:"UPDATE_SECRET_CONFIG",args:{secretId:r,secretKey:d}}:{name:"ADD_SECRET_CONFIGS",args:{items:[{displayName:n,secretKey:d,...i?{description:i}:{}}]}},h=await t.schemaManager.ztypeToolCalls(a,[p],!1);return t.ok(St({status:"SAVED",applied:h},s))},Gq={"secret.save_value":koe};f();f();f();import{createHash as joe}from"node:crypto";import Xd from"node:fs/promises";import Zd from"node:path";var gr=class extends Error{},Moe=1024,qoe=255,Foe=e=>{let t=e.slice(e.lastIndexOf("/")+1),r=t.lastIndexOf(".");return r<=0||r===t.length-1?null:t.slice(r+1).toLowerCase()},$q=(e,t)=>Zd.relative(e,t).split(Zd.sep).join("/").normalize("NFC"),Uoe=e=>{if(e.length>Moe||e.startsWith("/")||e.endsWith("/")||e.includes("\\")||e.includes("//")||e.includes(":"))throw new gr(`Invalid asset path: ${e}`);for(let t of e.split("/"))if(t===""||t==="."||t===".."||t.length>qoe)throw new gr(`Invalid asset path: ${e}`);for(let t of e){let r=t.charCodeAt(0);if(r<32||r===127)throw new gr(`Invalid asset path: ${e}`)}},Voe=async e=>{let t=joe("md5"),r=await Xd.open(e,"r");try{let n=r.createReadStream();for await(let i of n)t.update(i)}finally{await r.close()}return t.digest("base64")},Bq=async(e,t,r,n)=>{let i=await Xd.readdir(t,{withFileTypes:!0}),s=[],o=[];for(let a of i){let c=Zd.join(t,a.name),u=n&&a.name.startsWith(".");if(a.isDirectory()){if(u||r.has(a.name)){o.push(`${$q(e,c)}/`);continue}let l=await Bq(e,c,r,n);s.push(...l.files),o.push(...l.prunedDirectories)}else a.isFile()&&!u&&s.push(c)}return{files:s,prunedDirectories:o}};async function ep(e,t,r={}){let n=Zd.resolve(e);if(!(await Xd.stat(n).catch(()=>null))?.isDirectory())throw new gr(`Not a directory: ${n}`);let s=r.maxFileSizeBytes??t.maxFileSizeBytes,o=t.reservedFiles??new Set,a=await Bq(n,n,t.ignoredDirectories??new Set,t.ignoreHidden??!1),c=a.files.sort(),u=[],l=[...a.prunedDirectories.sort()],d=[],p=0;for(let h of c){let g=$q(n,h);if(o.has(g)){d.push(g);continue}let y=Foe(g);if(y===null||!t.allowedExtensions.has(y)){l.push(g);continue}Uoe(g);let{size:E}=await Xd.stat(h);if(E>s)throw new gr(`${g} is ${E} bytes, over the ${s}-byte per-file limit`);u.push({path:g,absolutePath:h,md5Base64:await Voe(h),sizeBytes:E}),p+=E}if(u.length===0)throw new gr(`No uploadable files found under ${n}`);if(!u.some(h=>h.path===t.entryFile))throw new gr(`${n} has no ${t.entryFile} at its root \u2014 a ${t.label} deployment must have one. ${t.entryHint}`);if(t.maxFileCount!==void 0&&u.length>t.maxFileCount)throw new gr(`${n} holds ${u.length} uploadable files, over the ${t.maxFileCount}-file limit`);if(t.maxTotalBytes!==void 0&&p>t.maxTotalBytes)throw new gr(`${n} totals ${p} bytes, over the ${t.maxTotalBytes}-byte package limit`);return{files:u,totalBytes:p,skipped:l,reserved:d}}var Goe=new Set(["html","htm","js","mjs","cjs","css","map","json","webmanifest","txt","xml","csv","wasm","pdf","svg","png","jpg","jpeg","gif","webp","avif","ico","bmp","woff","woff2","ttf","otf","eot","mp4","webm","mp3","wav","ogg"]),$oe="index.html",Boe=2*1024*1024*1024,Koe={label:"static site",entryFile:$oe,entryHint:"Point --dir at the build output directory (e.g. ./dist), not the project root.",allowedExtensions:Goe,maxFileSizeBytes:Boe};function Kq(e,t={}){return ep(e,Koe,t)}f();import Hoe from"node:fs/promises";var Qoe=12e4,Woe=1e3/(1024*1024),Hq=3,Yoe=500,Joe=256*1024*1024,zoe=e=>new Promise(t=>setTimeout(t,e)),Xoe=e=>e>=500||e===429,Zoe=async(e,t,r)=>{let n=AbortSignal.timeout(Math.ceil(Qoe+t.byteLength*Woe)),i=await fetch(e.uploadUrl,{method:"PUT",headers:e.headers,body:t,signal:r?AbortSignal.any([r,n]):n});if(!i.ok){let s=await i.text().catch(()=>""),o=new Error(`PUT ${e.path} failed with ${i.status}${s?`: ${s.slice(0,300)}`:""}`);throw Xoe(i.status)||Object.assign(o,{fatal:!0}),o}await i.body?.cancel()},eae=async(e,t,r)=>{let n=await Hoe.readFile(t),i;for(let s=1;s<=Hq;s+=1)try{await Zoe(e,n,r);return}catch(o){if(i=o,r?.aborted||o.fatal||s===Hq)break;await zoe(Yoe*2**(s-1))}throw i},HS=class{constructor(t){this.limit=t}inFlight=0;waiters=[];async acquire(t){for(;this.inFlight>0&&this.inFlight+t>this.limit;)await new Promise(r=>this.waiters.push(r));this.inFlight+=t}release(t){this.inFlight-=t;let r=this.waiters;this.waiters=[];for(let n of r)n()}};async function tp(e,t,r,n){let i=[],s=[],o=new HS(Joe),a=0,c=async()=>{for(;;){if(n?.aborted)return;let l=a;if(a+=1,l>=e.length)return;let d=e[l],p=t(d.path);if(!p){s.push({path:d.path,error:"no local file matches this manifest path"});continue}await o.acquire(p.sizeBytes);try{await eae(d,p.absolutePath,n),i.push(d.path)}catch(h){s.push({path:d.path,error:h instanceof Error?h.message:String(h)})}finally{o.release(p.sizeBytes)}}},u=Math.max(1,Math.min(r,e.length));return await Promise.all(Array.from({length:u},()=>c())),{uploaded:i,failures:s}}var tae=8,rae=32,Qq=200,nae=6,iae=6e4,sae=3,Wq=e=>{let t=(Q(e.target)??"BETA").toUpperCase();if(t!=="BETA"&&t!=="PROD")throw new Error(`target must be BETA or PROD, got ${t}`);return t},QS=async(e,t)=>{let r=await t.getProjectArgs(e);return{projectExId:r.projectExId,appExId:r.appExId??null,target:Wq(e)}},WS=(e,t)=>t.client.request(dR,e),Yq=(e,t,r)=>r.client.request(fR,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t}),Jq=async(e,t,r,n)=>(await n.client.request(lR,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t,dryRun:r})).completeStaticSiteDeployment,zq=async(e,t,r,n,i)=>{let s=await i.client.request(uR,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t,offset:n?null:r,limit:n?null:Qq,paths:n}),o=(s.staticSiteUploadUrls.items??[]).filter(c=>c!==null),a=o.map(c=>Date.parse(String(c.expiresAt??""))).filter(c=>Number.isFinite(c));return{targets:o.map(c=>({path:c.path??"",uploadUrl:c.uploadUrl??"",headers:c.headers??{}})),nextOffset:s.staticSiteUploadUrls.nextOffset??null,expiresAt:a.length?Math.min(...a):null}},oae=e=>e!==null&&e-iae<=Date.now(),aae=async(e,t,r,n,i,s)=>{let o=[],a=[],c=r;for(let u=1;;u+=1){let l=await tp(c.targets,h=>n.get(h),i,s.signal);o.push(...l.uploaded);let p=oae(c.expiresAt)&&u<sae&&!s.signal?.aborted?l.failures.filter(h=>n.has(h.path)):[];if(a.push(...l.failures.filter(h=>!p.includes(h))),p.length===0)return{uploaded:o,failures:a};c=await zq(e,t,null,p.map(h=>h.path),s)}},cae=async(e,t,r,n,i,s)=>{let o=[],a=[],c=i?null:0,u=i?[...i]:null;for(;;){s.signal?.throwIfAborted();let l=u?.splice(0,Qq)??null;if(l&&l.length===0)break;let d=await zq(e,t,l?null:c,l,s),p=await aae(e,t,d,r,n,s);if(o.push(...p.uploaded),a.push(...p.failures),l)continue;let h=d.nextOffset;if(h!==null&&c!==null&&h<=c)throw new Error(`upload url pagination stalled at offset ${c} (server returned ${h})`);if(c=h,c===null)break}return{uploaded:o,failures:a}},uae=(e,t)=>{if(e.length!==t.length)return!1;let r=new Map(t.map(n=>[n.path??"",n.md5Base64??""]));return e.every(n=>r.get(n.path)===n.md5Base64)},lae=async(e,t,r,n)=>{let s=(await WS(e,n)).inProgressStaticSiteDeployment;if(s){if(!r&&uae(t,s.manifest))return{deploymentExId:s.exId,resumed:!0,resumedStatus:s.status};await Yq(e,s.exId,n)}return{deploymentExId:(await n.client.request(cR,{projectExId:e.projectExId,appExId:e.appExId,target:e.target,files:t.map(a=>({path:a.path,md5Base64:a.md5Base64,sizeBytes:a.sizeBytes}))})).createStaticSiteDeployment.exId,resumed:!1,resumedStatus:null}},Xq=e=>{let t=(e.missingPaths??[]).filter(r=>typeof r=="string");return e.missingCount>t.length?null:t},fae=async(e,t,r,n)=>r!=="UPLOADING"?null:Xq(await Jq(e,t,!0,n)),dae=async(e,t)=>{let r=Ci(e.dir,"dir"),n=ke(e.dryRun,!1),i=ke(e.force,!1),s=Wq(e),o=Math.max(1,Math.min(tt(e.concurrency,tae),rae)),a=await Kq(r);if(n)return t.ok({dryRun:!0,target:s,fileCount:a.files.length,totalBytes:a.totalBytes,skipped:a.skipped,files:a.files.map(w=>({path:w.path,sizeBytes:w.sizeBytes}))});let c=await QS(e,t);c.target==="PROD"&&await tc(c.projectExId,e,"deploy to production",{allowForce:!1});let u=new Map(a.files.map(w=>[w.path,w])),{deploymentExId:l,resumed:d,resumedStatus:p}=await lae(c,a.files,i,t),h=d?await fae(c,l,p,t):null,g=new Set,y=[],E=null,S=Number.POSITIVE_INFINITY,_=0;for(let w=1;w<=nae;w+=1){_=w;let I=await cae(c,l,u,o,h,t);for(let T of I.uploaded)g.add(T);if(y=I.failures,E=await Jq(c,l,!1,t),!E.incomplete||E.missingCount>=S||(S=E.missingCount,h=Xq(E),h?.length===0))break}return!E||E.incomplete?t.fail(new Error(`deployment ${l} is still missing ${E?.missingCount??"?"} file(s) after ${_} upload pass(es): ${(E?.missingPaths??[]).slice(0,10).join(", ")}${y.length?`; upload errors: ${y[0].error}`:""}. Re-run to resume, or pass force=true to start over.`)):t.ok({deploymentExId:l,target:c.target,resumed:d,fileCount:a.files.length,totalBytes:a.totalBytes,uploaded:g.size,skipped:a.skipped,siteUrl:E.siteUrl,previousDeploymentExId:E.previousDeploymentExId,...y.length?{uploadRetries:y}:{}})},pae=async(e,t)=>{let r=await QS(e,t),n=await WS(r,t);return t.ok({target:r.target,inProgress:n.inProgressStaticSiteDeployment?{deploymentExId:n.inProgressStaticSiteDeployment.exId,status:n.inProgressStaticSiteDeployment.status,fileCount:n.inProgressStaticSiteDeployment.fileCount,totalBytes:n.inProgressStaticSiteDeployment.totalBytes,createdAt:n.inProgressStaticSiteDeployment.createdAt}:null,active:n.activeStaticSiteDeployment?{deploymentExId:n.activeStaticSiteDeployment.exId,siteUrl:n.activeStaticSiteDeployment.siteUrl,fileCount:n.activeStaticSiteDeployment.fileCount,totalBytes:n.activeStaticSiteDeployment.totalBytes,activatedAt:n.activeStaticSiteDeployment.activatedAt}:null})},hae=async(e,t)=>{let r=await QS(e,t),i=Q(e.deploymentExId)??(await WS(r,t)).inProgressStaticSiteDeployment?.exId;if(!i)return t.ok({target:r.target,aborted:null},"no in-progress deployment to abort");let s=await Yq(r,i,t);return t.ok({deploymentExId:i,target:r.target,status:s.abortStaticSiteDeployment.status})},Zq={"site.deploy":dae,"site.status":pae,"site.abort":hae};f();import rF from"node:fs/promises";import nF from"node:path";f();var mae=new Set(["js","ts","json","wxml","wxss","wxs","png","jpg","jpeg","gif","svg","webp","ico","ttf","otf","woff","woff2","mp3","mp4","wasm","cer","txt"]),gae=new Set(["project.config.json","project.private.config.json"]),yae=new Set(["node_modules"]),vae="app.json",Eae=5e3,eF=20*1024*1024,_ae={label:"WeChat mini program source",entryFile:vae,entryHint:"Point --dir at the mini program root (the directory holding app.js / app.json / app.wxss).",allowedExtensions:mae,ignoredDirectories:yae,ignoreHidden:!0,reservedFiles:gae,maxFileSizeBytes:eF,maxFileCount:Eae,maxTotalBytes:eF};function tF(e,t={}){return ep(e,_ae,t)}var Sae=8,bae=32,iF=200,Tae=6,wae=6e4,Oae=3,Iae=900,Aae=5e3,sF="wechat-trial-qrcode.jpg",rp=async(e,t)=>{let r=await t.getProjectArgs(e);return{projectExId:r.projectExId,appExId:r.appExId??null}},YS=(e,t)=>t.client.request(ER,e),oF=(e,t,r)=>r.client.request(vR,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t}),aF=async(e,t,r,n)=>(await n.client.request(yR,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t,dryRun:r})).completeWechatSourceCodeUpload,cF=async(e,t,r,n,i)=>{let s=await i.client.request(gR,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t,offset:n?null:r,limit:n?null:iF,paths:n}),o=(s.wechatSourceCodeUploadUrls.items??[]).filter(c=>c!==null),a=o.map(c=>Date.parse(String(c.expiresAt??""))).filter(c=>Number.isFinite(c));return{targets:o.map(c=>({path:c.path??"",uploadUrl:c.uploadUrl??"",headers:c.headers??{}})),nextOffset:s.wechatSourceCodeUploadUrls.nextOffset??null,expiresAt:a.length?Math.min(...a):null}},Nae=e=>e!==null&&e-wae<=Date.now(),Cae=async(e,t,r,n,i,s)=>{let o=[],a=[],c=r;for(let u=1;;u+=1){let l=await tp(c.targets,h=>n.get(h),i,s.signal);o.push(...l.uploaded);let p=Nae(c.expiresAt)&&u<Oae&&!s.signal?.aborted?l.failures.filter(h=>n.has(h.path)):[];if(a.push(...l.failures.filter(h=>!p.includes(h))),p.length===0)return{uploaded:o,failures:a};c=await cF(e,t,null,p.map(h=>h.path),s)}},Pae=async(e,t,r,n,i,s)=>{let o=[],a=[],c=i?null:0,u=i?[...i]:null;for(;;){s.signal?.throwIfAborted();let l=u?.splice(0,iF)??null;if(l&&l.length===0)break;let d=await cF(e,t,l?null:c,l,s),p=await Cae(e,t,d,r,n,s);if(o.push(...p.uploaded),a.push(...p.failures),l)continue;let h=d.nextOffset;if(h!==null&&c!==null&&h<=c)throw new Error(`upload url pagination stalled at offset ${c} (server returned ${h})`);if(c=h,c===null)break}return{uploaded:o,failures:a}},Rae=(e,t)=>{if(e.length!==t.length)return!1;let r=new Map(t.map(n=>[n.path??"",n.md5Base64??""]));return e.every(n=>r.get(n.path)===n.md5Base64)},xae=async(e,t,r,n)=>{let i=await YS(e,n),s=i.buildingWechatSourceCodeDeployment;if(s)throw new Error(`deployment ${s.exId} is already BUILDING (started ${s.buildStartedAt}) \u2014 a build cannot be aborted and blocks the next upload. Wait for it to finish, then re-run.`);let o=i.inProgressWechatSourceCodeDeployment;if(o){if(!r&&Rae(t,o.manifest))return{deploymentExId:o.exId,resumed:!0,resumedStatus:o.status};await oF(e,o.exId,n)}return{deploymentExId:(await n.client.request(mR,{projectExId:e.projectExId,appExId:e.appExId,files:t.map(c=>({path:c.path,md5Base64:c.md5Base64,sizeBytes:c.sizeBytes}))})).createWechatSourceCodeDeployment.exId,resumed:!1,resumedStatus:null}},uF=e=>{let t=(e.missingPaths??[]).filter(r=>typeof r=="string");return e.missingCount>t.length?null:t},Dae=async(e,t,r,n)=>r!=="UPLOADING"?null:uF(await aF(e,t,!0,n)),Lae=async(e,t,r)=>(await r.client.request(_R,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t})).wechatSourceCodeDeployment,lF=async(e,t)=>(await t.client.request(SR,{projectExId:e.projectExId})).project,kae=async(e,t)=>(await t.client.request(bR,{projectExId:e.projectExId})).project,jae=(e,t)=>new Promise((r,n)=>{let i=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(i),n(t?.reason??new Error("aborted"))};if(t?.aborted){s();return}t?.addEventListener("abort",s,{once:!0})}),fF=async(e,t)=>{let r=nF.resolve(t),n=Buffer.from(e,"base64");return await rF.mkdir(nF.dirname(r),{recursive:!0}),await rF.writeFile(r,n),{qrCodePath:r,qrCodeBytes:n.length}},Mae=async(e,t,r,n)=>{let i=Date.now(),s=i+r*1e3;for(;;){n.signal?.throwIfAborted();let a=(await Lae(e,t,n))?.status??null,c=Math.round((Date.now()-i)/1e3);if(a!=="BUILDING"&&a!=="UPLOADING")return{status:a,timedOut:!1,waitedSeconds:c};if(Date.now()>=s)return{status:a,timedOut:!0,waitedSeconds:c};await jae(Math.min(Aae,Math.max(0,s-Date.now())),n.signal)}},qae=async(e,t)=>{let r=Ci(e.dir,"dir"),n=ke(e.dryRun,!1),i=ke(e.force,!1),s=ke(e.wait,!0),o=Math.max(0,tt(e.timeoutSeconds,Iae)),a=Q(e.qrOut)??sF,c=Math.max(1,Math.min(tt(e.concurrency,Sae),bae)),u=await tF(r);if(n)return t.ok({dryRun:!0,fileCount:u.files.length,totalBytes:u.totalBytes,skipped:u.skipped,serverManaged:u.reserved,files:u.files.map(Z=>({path:Z.path,sizeBytes:Z.sizeBytes}))});let l=await rp(e,t),d=new Map(u.files.map(Z=>[Z.path,Z])),{deploymentExId:p,resumed:h,resumedStatus:g}=await xae(l,u.files,i,t),y=h?await Dae(l,p,g,t):null,E=new Set,S=[],_=null,w=Number.POSITIVE_INFINITY,I=0;for(let Z=1;Z<=Tae;Z+=1){I=Z;let ie=await Pae(l,p,d,c,y,t);for(let A of ie.uploaded)E.add(A);if(S=ie.failures,_=await aF(l,p,!1,t),!_.incomplete||_.missingCount>=w||(w=_.missingCount,y=uF(_),y?.length===0))break}if(!_||_.incomplete)return t.fail(new Error(`deployment ${p} is still missing ${_?.missingCount??"?"} file(s) after ${I} upload pass(es): ${(_?.missingPaths??[]).slice(0,10).join(", ")}${S.length?`; upload errors: ${S[0].error}`:""}. Re-run to resume, or pass force=true to start over.`));let T={deploymentExId:p,resumed:h,fileCount:u.files.length,totalBytes:u.totalBytes,uploaded:E.size,skipped:u.skipped,serverManaged:u.reserved,deploymentRecordExId:_.deploymentRecordExId,...S.length?{uploadRetries:S}:{}};if(!s)return t.ok({...T,status:_.status,waited:!1});let N=await Mae(l,p,o,t);if(N.timedOut)return t.ok({...T,status:N.status,waited:!0,timedOut:!0,waitedSeconds:N.waitedSeconds},`build is still running after ${N.waitedSeconds}s \u2014 poll \`wechat status\` for the trial version`);if(N.status!=="SUCCEEDED")return t.fail(new Error(`deployment ${p} ended in ${N.status} after ${N.waitedSeconds}s. The upload landed but the WeChat build did not succeed; check the deployment record ${_.deploymentRecordExId??"(none)"} for the failure.`));let P=await lF(l,t),O=P?.wechatMiniAppQRCodeBase64??null,$=O?await fF(O,a):null;return t.ok({...T,status:N.status,waited:!0,waitedSeconds:N.waitedSeconds,trialVersion:P?.wechatMiniAppPreviewVersion??null,trialVersionCommittedAt:P?.wechatMiniAppPreviewTime??null,...$??{qrCodePath:null}})},Fae=async(e,t)=>{let r=await rp(e,t),n=await YS(r,t),i=await kae(r,t);return t.ok({trial:{version:i?.wechatMiniAppPreviewVersion??null,committedAt:i?.wechatMiniAppPreviewTime??null},inProgress:n.inProgressWechatSourceCodeDeployment?{deploymentExId:n.inProgressWechatSourceCodeDeployment.exId,status:n.inProgressWechatSourceCodeDeployment.status,fileCount:n.inProgressWechatSourceCodeDeployment.fileCount,totalBytes:n.inProgressWechatSourceCodeDeployment.totalBytes,createdAt:n.inProgressWechatSourceCodeDeployment.createdAt,lastUploadUrlIssuedAt:n.inProgressWechatSourceCodeDeployment.lastUploadUrlIssuedAt}:null,building:n.buildingWechatSourceCodeDeployment?{deploymentExId:n.buildingWechatSourceCodeDeployment.exId,status:n.buildingWechatSourceCodeDeployment.status,fileCount:n.buildingWechatSourceCodeDeployment.fileCount,totalBytes:n.buildingWechatSourceCodeDeployment.totalBytes,buildStartedAt:n.buildingWechatSourceCodeDeployment.buildStartedAt,deploymentRecordExId:n.buildingWechatSourceCodeDeployment.deploymentRecordExId}:null})},Uae=async(e,t)=>{let r=await rp(e,t),i=Q(e.deploymentExId)??(await YS(r,t)).inProgressWechatSourceCodeDeployment?.exId;if(!i)return t.ok({aborted:null},"no in-progress upload to abort");let s=await oF(r,i,t);return t.ok({deploymentExId:i,status:s.abortWechatSourceCodeDeployment.status})},Vae=async(e,t)=>{let r=await rp(e,t),n=Q(e.out)??sF,i=await lF(r,t),s=i?.wechatMiniAppQRCodeBase64??null;if(!s)return t.fail(new Error("no trial version QR code is available for this project yet \u2014 run `wechat deploy` and let the build finish first."));let o=await fF(s,n);return t.ok({...o,trialVersion:i?.wechatMiniAppPreviewVersion??null,trialVersionCommittedAt:i?.wechatMiniAppPreviewTime??null})},dF={"wechat.deploy":qae,"wechat.status":Fae,"wechat.abort":Uae,"wechat.qrcode":Vae};f();var pF={...LL,...VL,...HL,...QL,...sk,...Sk,...Ok,...Pk,...Rk,...xk,...Dk,...Vq,...Gq,...Zq,...dF};f();f();var Gae=new Map([["claude-code","Claude Code"],["codex-mcp-client","Codex"]]);function hF(e){let t=typeof e?.name=="string"?e.name:"",r=typeof e?.title=="string"?e.title:"";return Gae.get(t)??(r||t||"the coding agent")}function np(e="the coding agent"){return`quit ${e} completely and open it again (starting a new chat in the same window may keep the old tools)`}function ji(e,t,r){let n=`${te} ${e.current} is older than the minimum supported version ${e.minSupported} (latest ${e.latest})`,i=t?`, and upgrading it automatically failed: ${t}`:"";return`${n}${i}. Calls to the backend keep failing until it is upgraded, so stop retrying and tell the user, in their language: update the ${pb} plugin from the plugin marketplace (or run \`npm i -g ${te}@latest\` if ${te} was installed with npm), then ${np(r)} so it starts the new version.`}function mF(e,t){return`${te} is upgrading itself from ${e} to ${t} in the background because the backend no longer supports ${e}. Nothing is broken and the user does not need to do anything: retry this call in about a minute.`}function gF(e,t,r){return`Note: ${te} upgraded itself from ${e} to ${t} during this session and ran this call on ${t}, but ${r} did not reload its tool list, so tools added in ${t} are not visible to you. Tell the user once, in their language, that ${te} was upgraded and that to use the new version's tools they should ${np(r)}. Then carry on with their request; everything that worked before still works.`}function yF(e,t,r,n){let i=np(r);return n.upgradedFrom&&n.toolListReloaded?`${te} has no tool ${e}. ${te} upgraded itself from ${n.upgradedFrom} to ${t} during this session and ${r} has already reloaded its tool list, so ${e} was from the old list: use the tools you have now instead. The user does not need to restart anything.`:n.upgradedFrom?`${te} has no tool ${e}. ${te} upgraded itself from ${n.upgradedFrom} to ${t} during this session, so your tool list is still the ${n.upgradedFrom} one. Tell the user, in their language, to ${i} so you get the current tools, then try again.`:`${te} ${t} has no tool ${e}. Use only the tools in your current tool list; if that list was loaded from another ${te} version, tell the user, in their language, to ${i}, then try again.`}function vF(e,t,r,n){return n?`${te} upgraded itself from ${e} to ${t} during this session and ${r} has already reloaded its tool list, so check this tool's current arguments and try again.`:`${te} upgraded itself from ${e} to ${t} during this session, so this tool's arguments may have changed since your tool list was loaded. If the error does not make sense against your tool list, tell the user, in their language, to ${np(r)}.`}var $ae=K`
1555
- query SupportedMcpVersion {
1556
- supportedMcpVersion {
1557
- latest
1558
- minSupported
1559
- }
1560
- }
1561
- `,Bae=3600*1e3,Kae=3600*1e3;function EF(e={}){let t=e.check??jc,r=e.now??Date.now,n=e.ttlMs??Bae,i=e.unknownTtlMs??Kae,s=null,o=null;return{async check(){return s&&r()<s.expiresAt?s.result:o||(o=t().then(a=>(s={result:a,expiresAt:r()+(a.status==="unknown"?i:n)},a)).finally(()=>{o=null}),o)}}}function Hae(e){let t=e instanceof Error?e.message:String(e);return/supportedMcpVersion|Cannot query field|Validation error|undefined/i.test(t)?"backend does not advertise a supported version":"backend version check unavailable"}async function jc(){let{agentVersion:e}=await jE();try{let t=Ft(),r=new it(`${t.apiBaseUrl}/api/graphql`,{headers:{"User-Locale":"en_US"}}),{supportedMcpVersion:n}=await r.request($ae),{latest:i,minSupported:s}=n;return{status:Fi(e,s)<0?"outdated":"ok",current:e,latest:i,minSupported:s}}catch(t){return D.debug(`[version-check] skipped: ${String(t)}`),{status:"unknown",current:e,reason:Hae(t)}}}function ip(e){return e.status==="outdated"?ji(e):e.status==="ok"?`${te} ${e.current} meets the backend minimum ${e.minSupported} (latest ${e.latest}).`:`${te} ${e.current}: ${e.reason}; skipping compatibility check.`}var Qae=new Set(["docs.search","docs.get_page","auth.login","auth.reauth","auth.logout","auth.whoami","workspace.set"]),Wae=e=>new Proxy({},{get(){throw new Error(`${e} is a local-only command and has no authenticated client`)}});function Yae(e){if(!(e instanceof Error))return String(e);let r=FE(e.response?.errors)||e.message||String(e),n=e.runtimeDiagnosis;return typeof n=="string"?`${r}
1562
- ${n}`:r}function sp(e,t={}){let r=new kr(e),n=new Cs(r),i=new Gf(()=>UE(n,r),t.watchSchemaChanges?async(...u)=>(await lL(n,r))(...u):void 0),s=EF({check:t.checkMcpVersion}),o=(u,l)=>({ok:!0,data:u,message:l}),a=u=>(u instanceof Error&&u.stack&&D.debug(`[AgentApp] command failed: ${u.stack}`),{ok:!1,error:Yae(u),data:u instanceof Cn?{ztypeDiagnostics:u.diagnostics}:void 0});return{execute:async(u,l)=>{let d=NL(u.args),p=Qae.has(u.name);try{if(!p){let w=await s.check();if(w.status==="outdated")return{ok:!1,error:ip(w),data:{upgrade:w}}}let h=pF[u.name];if(!h)throw new Error(`Unknown command: ${u.name}`);let g=p?Wae(u.name):await UE(n,r),y=null,E=async w=>(y??=await PL(r,w),y),S=async w=>{let I=await E(w);return i.checkRemoteAndSync(qt(I.projectExId,I))},_={credentialStore:r,tokenManager:n,schemaManager:i,client:g,signal:l,codingAgent:u.agent,hostSessionId:u.sessionId,getProjectArgs:E,checkSchema:S,ok:o,fail:a};return await h(d,_)}catch(h){return a(h)}},schemaManager:i,setWorkspaceRoot(u){r.setWorkspaceRoot(u),i.clear()},stop(){i.clear()}}}f();import op from"net";f();import{StringDecoder as Jae}from"string_decoder";var Mc=e=>{let t=new Jae("utf8"),r="";return n=>{for(r+=t.write(n);;){let i=r.indexOf(`
1563
- `);if(i<0)return;let s=r.slice(0,i);r=r.slice(i+1),s.trim()!==""&&e(s)}}};var zae=600*1e3;async function Ct(e,t,r){let{socketPath:n,token:i}=e,s=`${Date.now()}-${Math.random().toString(16).slice(2)}`,o={id:s,token:i,command:t};return new Promise((a,c)=>{let u=n.startsWith("tcp://")?op.createConnection(SF(n)):op.createConnection(n),l=setTimeout(()=>{u.destroy(),c(new Error(`Timed out waiting for daemon response to ${t.name}`))},zae),d=()=>{r&&r.removeEventListener("abort",p)},p=()=>{clearTimeout(l),u.destroy(),c(new Error(`Request aborted: ${t.name}`))};if(r){if(r.aborted){p();return}r.addEventListener("abort",p)}u.on("connect",()=>{u.write(`${JSON.stringify(o)}
1564
- `)}),u.on("data",Mc(h=>{clearTimeout(l),d(),u.end();try{let g=JSON.parse(h);if(g.id!==s){c(new Error("Daemon response id mismatch"));return}a(g.result)}catch(g){c(g)}})),u.on("error",h=>{clearTimeout(l),d(),c(h)})})}function _F(e,t,r){let{socketPath:n,token:i}=e,s=null,o=!1,a=null,c=()=>{if(o)return;s=n.startsWith("tcp://")?op.createConnection(SF(n)):op.createConnection(n);let u=`sub-${Date.now()}-${Math.random().toString(16).slice(2)}`,l={id:u,token:i,command:{name:"schema.subscribe"}},d=s;d.on("connect",()=>{d.write(`${JSON.stringify(l)}
1565
- `)}),d.on("data",Mc(p=>{if(!d.destroyed)try{let h=JSON.parse(p);if(h.id===u)return;h.event==="schemaChanged"&&t(h.data)}catch(h){D.warn(`Failed to parse daemon event, destroying socket to force reconnect. Line: ${p}`,h),d.destroy()}})),s.on("error",p=>{o||r(p)}),s.on("close",()=>{s=null,o||(a=setTimeout(c,2e3))})};return c(),{unsubscribe(){o=!0,a&&clearTimeout(a),s&&s.end()}}}function SF(e){let t=new URL(e),r=Number.parseInt(t.port,10);if(!t.hostname||!Number.isInteger(r))throw new Error(`Invalid daemon TCP endpoint: ${e}`);return{host:t.hostname,port:r}}f();import{createHash as Xae,randomUUID as bF}from"crypto";import{promises as ao,rmSync as Zae}from"fs";import co from"path";var ece="registry.json",Bn=class{constructor(t){this.workspaceRoot=t;this.root=co.join(t,`.${te}`,"daemon"),this.logRoot=co.join(this.root,"logs"),this.socketRoot=co.join(this.root,"sockets"),this.registryPath=co.join(this.root,ece)}root;logRoot;socketRoot;registryPath;async ensure(){await ao.mkdir(this.root,{recursive:!0,mode:448}),await ao.mkdir(this.logRoot,{recursive:!0,mode:448}),await ao.mkdir(this.socketRoot,{recursive:!0,mode:448})}async list(){await this.ensure();try{let t=await ao.readFile(this.registryPath,"utf8"),r=JSON.parse(t),n=r.filter(i=>this.isProcessAlive(i.pid));if(n.length!==r.length){for(let i of r)this.isProcessAlive(i.pid)||this.unlinkSocket(i.socketPath);await this.write(n)}return n}catch(t){if(t.code==="ENOENT")return[];throw t}}async findCompatible(t){return(await this.list()).find(n=>aL(t,n.compatibility)&&this.isProcessAlive(n.pid))??null}async upsert(t){let r=(await this.list()).filter(n=>n.uid!==t.uid);r.push(t),await this.write(r)}async remove(t){let r=await this.list();for(let n of r)n.pid===t&&this.unlinkSocket(n.socketPath);await this.write(r.filter(n=>n.pid!==t))}createRecord(t){let r=bF(),n=Xae("sha256").update(`${this.workspaceRoot}:${r}`).digest("hex").slice(0,16),i=new Date().toISOString();return{uid:r,pid:process.pid,socketPath:this.chooseSocketPath(n),token:bF(),logPath:co.join(this.logRoot,`${n}.log`),status:"idle",startedAt:i,lastBusyAt:i,compatibility:t}}chooseSocketPath(t){if(process.platform==="win32")return"tcp://127.0.0.1:0";let r=co.join(this.socketRoot,`${t}.sock`);return r.length<=100?r:"tcp://127.0.0.1:0"}unlinkSocket(t){if(!t.startsWith("tcp://"))try{Zae(t,{force:!0})}catch{}}async write(t){await this.ensure();let r=`${this.registryPath}.tmp`;await ao.writeFile(r,JSON.stringify(t,null,2),{mode:384}),await ao.rename(r,this.registryPath)}isProcessAlive(t){try{return process.kill(t,0),!0}catch{return!1}}};f();import{chmodSync as tce}from"fs";import rce from"net";var ap=10800*1e3;async function TF(e){let t=e.idleTimeoutMs??ap,r=new Bn(e.workspaceRoot),n=new kr(e.workspaceRoot),i=new Cs(n),s=await Hs(n,e.startupFlags??[]),o=r.createRecord(s),a=sp(e.workspaceRoot,{watchSchemaChanges:!0}),c=new Set;a.schemaManager.emitter.on("schemaChanged",T=>{let N=JSON.stringify({event:"schemaChanged",data:T})+`
1566
- `;for(let P of c)try{P.write(N)}catch{c.delete(P)}});let u=new Map,l=0,d=!1,p=Date.now(),h=null,g=()=>{p=Date.now()},y=(T,N)=>`${JSON.stringify({id:T,result:N})}
1567
- `,E=async()=>{o.compatibility=await Hs(n,e.startupFlags??[]),await r.upsert(o)},S=async T=>{switch(T.command.name){case"daemon.ping":return{ok:!0,data:{pid:process.pid,record:o,pins:u.size}};case"daemon.pin":{let N=typeof T.command.args?.token=="string"?T.command.args.token:`${Date.now()}-${Math.random()}`;return u.set(N,{token:N,lastSeenAt:Date.now()}),{ok:!0,data:{token:N}}}case"daemon.heartbeat":{let N=T.command.args?.token;return typeof N=="string"&&u.has(N)&&u.set(N,{token:N,lastSeenAt:Date.now()}),{ok:!0}}case"daemon.unpin":{let N=T.command.args?.token;return typeof N=="string"&&u.delete(N),{ok:!0}}case"daemon.stop":return d=!0,setTimeout(()=>w(0),25),{ok:!0,message:"Stopping daemon"};default:return null}},_=()=>{let T=Date.now();for(let[N,P]of u.entries())T-P.lastSeenAt>t&&u.delete(N)},w=async T=>{h&&h.close(),a.stop(),await r.remove(process.pid).catch(()=>{}),process.exit(T)};setInterval(()=>{_(),a.schemaManager.sweep(),d||i.refreshIfNeeded(),!(d||l>0||u.size>0)&&Date.now()-p>t&&(D.info("Daemon idle timeout reached; shutting down"),w(0))},3e4).unref(),h=rce.createServer(T=>{let N=!1,P=new Map;T.on("close",()=>{c.delete(T);for(let $ of P.values())$.abort();P.clear()}),T.on("error",()=>{c.delete(T);for(let $ of P.values())$.abort();P.clear()});let O=$=>{(async()=>{l+=1,g();let Z="unknown";try{let ie=JSON.parse($);if(Z=ie.id,ie.token!==o.token){T.write(y(ie.id,{ok:!1,error:"Unauthorized: invalid or missing daemon token"}));return}if(ie.command.name==="schema.subscribe"){N=!0,c.add(T),T.write(y(ie.id,{ok:!0,message:"Subscribed to schema events"}));return}let A=new AbortController;P.set(ie.id,A);let De=await S(ie)??await a.execute(ie.command,A.signal);De.ok&&(ie.command.name==="auth.login"||ie.command.name==="auth.reauth"||ie.command.name==="auth.logout")&&await E(),T.write(y(ie.id,De))}catch(ie){let A=Z!=="unknown"?Z:nce($);T.write(y(A,{ok:!1,error:ie instanceof Error?ie.message:String(ie)}))}finally{l-=1,g(),Z!=="unknown"&&P.delete(Z),N||T.end()}})()};T.on("data",Mc(O))}),await r.ensure(),await new Promise((T,N)=>{if(h?.once("error",N),o.socketPath.startsWith("tcp://")){h?.listen(0,"127.0.0.1",()=>{let O=h?.address();if(!O||typeof O=="string"){N(new Error("Daemon TCP listener did not expose a port"));return}o.socketPath=`tcp://127.0.0.1:${O.port}`,T()});return}let P=o.socketPath;h?.listen(P,()=>{try{tce(P,384)}catch{}T()})}),await r.upsert(o),D.info(`Daemon listening on ${o.socketPath}`),Eb(),process.on("SIGINT",()=>void w(0)),process.on("SIGTERM",()=>void w(0))}function nce(e){try{return JSON.parse(e).id??"unknown"}catch{return"unknown"}}f();f();import wF from"node:process";f();var uo=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
1568
- `);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),ice(r)}clear(){this._buffer=void 0}};function ice(e){return wb.parse(JSON.parse(e))}function cp(e){return JSON.stringify(e)+`
1569
- `}var up=class{constructor(t=wF.stdin,r=wF.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new uo,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(t){return new Promise(r=>{let n=cp(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};import{spawn as vce}from"child_process";import xF from"path";import{randomUUID as Ece}from"crypto";f();function OF(){let{productName:e}=Pb();return`# ${e} MCP \u2014 no-code platform (visual UI + PostgreSQL + actionflows)
1570
- Two modes. **Builder**: edit the data model, bindings, action flows, request filters, UI, third-party APIs, project lifecycle, deploys, and data with tools. **Consultant**: for what tools can't change (permission config, payment setup, formula columns), diagnose and guide the user through the editor.
1571
-
1572
- ## Session
1573
- - Pin a project with set_current_project (or pass projectExId); resolve a name via get_projects.
1574
- - Warm it with schema_session op=LOAD before reading/editing. Edits apply immediately (CRDT patch) but are NOT live until sync_backend; schema_undo reverts the last; re-read before the next.
1575
- - Deploy with schema_session op=VALIDATE \u2192 sync_backend; never sync an unvalidated session.
1576
-
1577
- ## Tools \u2014 call guide {plugin} for an area's rules before editing it
1578
- Schema editing: one tool per capability, each {op, args} where op is a schema ToolName \u2014 database, type, bindings, actionflow, api, tpa, zai, component. Read/write ALL runtime data (queries, mutations, aggregates, invoking actionflows/AI, uploads) via runtime_graphql. Diagnose: search_logs. Docs: search_docs \u2192 get_doc_page.
1579
-
1580
- ## Cannot do (consultant only)
1581
- Permission config, payment module/credentials, and formula COLUMNS are editor-only. (Formula data BINDINGS via schema_create_binding op=FORMULA are fine \u2014 different thing.)
1582
-
1583
- ## Always
1584
- Ask when ambiguous. Ground every call in what you retrieved \u2014 never fabricate table/column/enum/component names; verify names before any query/mutation. Before deleting tables/columns/relations/enums, list what's removed and warn of data loss. Data-model/permission/actionflow changes take effect only after sync_backend. Reply in the user's language.`}f();import{randomUUID as sce}from"crypto";f();function lp(e){if(e.ok||typeof e.data!="object"||e.data===null)return null;let t=e.data.upgrade;return t?.status!=="outdated"||typeof t.current!="string"||typeof t.latest!="string"||typeof t.minSupported!="string"?null:t}function qc(e){let t=mp(e.minSupported)?e.minSupported:e.current;return[...new Set([e.latest,e.minSupported])].filter(mp).filter(r=>Fi(r,e.current)>0&&Fi(r,t)>=0).sort((r,n)=>Fi(n,r))}function lo(e){return qc(e)[0]??null}async function IF(e,t,r=new go,n){let i=lo(e);if(!i||!yo(n))return{kind:"UNAVAILABLE"};process.stderr.write(`[${te}] ${e.current} is no longer supported by the backend; upgrading to ${i}...
1585
- `);let s;try{s=await r.installFirst(qc(e))}catch(o){return{kind:"FAILED",reason:o instanceof Error?o.message:String(o)}}return{kind:"RERAN",status:await mb(r,s,t)}}async function AF(e,t=new go,r){if(!yo(r))return;let n=await e();n.status==="outdated"&&lo(n)&&await t.installFirst(qc(n))}var NF=`__MCP_UPGRADE_HANDOVER_${sce()}__`,oce=4e4,ace=3e4,cce=600*1e3,uce=2e3,lce=`${te} upgraded itself from`,fce=/^(MCP error -?\d+: )?Tool \S+ not found/,dce=/^(MCP error -?\d+: )?Input validation error/,pce=new Set(["logging/setLevel","resources/subscribe","resources/unsubscribe"]),hce=["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed"],CF=e=>"method"in e&&"id"in e,RF=e=>"id"in e&&!("method"in e),fp=class{constructor(t){this.options=t}onmessage;onclose;onerror;pending=new Map;initializeRequest=null;negotiatedProtocol=null;logLevelRequest=null;subscriptions=new Map;upgrade=null;relay=null;toolsRelisted=new zS;startedAt=Date.now();upgradeNoted=!1;async start(){let{inner:t}=this.options;t.onmessage=(r,n)=>this.fromHost(r,n),t.onclose=()=>this.onclose?.(),t.onerror=r=>this.onerror?.(r),await t.start()}async close(){this.relay?.close(),await this.options.inner.close()}setProtocolVersion(t){this.options.inner.setProtocolVersion?.(t)}async send(t,r){if(RF(t)){let n=this.pending.get(t.id);if(this.pending.delete(t.id),n&&this.upgrade&&JSON.stringify(t).includes(NF)){this.handOver(n);return}if(n?.method==="initialize"){let i=t.result?.protocolVersion;this.negotiatedProtocol=typeof i=="string"?i:null}n&&(t=await this.withToolHint(n,t))}await this.options.inner.send(t,r)}wrapSender(t){return async(r,n)=>{let i=await t(r,n),s=lp(i);return!s||!this.options.canUpgrade(s)?i:(this.requestUpgrade(s),{ok:!1,error:NF})}}fromHost(t,r){if(CF(t)&&t.method==="tools/list"&&this.toolsRelisted.mark(),this.relay){this.relay.send(t);return}CF(t)&&(this.remember(t),this.pending.set(t.id,t)),this.onmessage?.(t,r)}remember(t){if(t.method==="initialize")this.initializeRequest=t;else if(t.method==="logging/setLevel")this.logLevelRequest=t;else if(pce.has(t.method)){let r=String(t.params?.uri??"");t.method==="resources/subscribe"?this.subscriptions.set(r,t):this.subscriptions.delete(r)}}requestUpgrade(t){let r=this.upgrade;if(r?.kind==="RUNNING"||r?.kind==="FAILED"&&Date.now()-r.at<cce)return;let n=this.performUpgrade(t);this.upgrade={kind:"RUNNING",version:t,target:n},n.catch(i=>{let s=i instanceof Error?i.message:String(i);D.warn(`[upgrade] handover failed: ${s}`),this.upgrade={kind:"FAILED",version:t,reason:s,at:Date.now()}})}async performUpgrade(t){let r=this.initializeRequest;if(!r)throw new Error("the MCP client never initialized this server");let n=await this.options.prepare(t),i=new XS(n,this.options.launch(n),s=>this.options.inner.send(s),s=>{this.relay===i&&this.options.onRelayExit?.(s)});try{await i.initialize(r,this.negotiatedProtocol,[...this.logLevelRequest?[this.logLevelRequest]:[],...this.subscriptions.values()])}catch(s){throw i.close(),s}this.relay=i,this.toolsRelisted.reset();for(let s of hce)await this.options.inner.send({jsonrpc:"2.0",method:s});return D.info(`[upgrade] handed this session over to ${n} (was ${this.options.currentVersion})`),this.options.onRelayActive?.(),i}async handOver(t){let r=this.upgrade;if(!r){await this.options.inner.send(JS(t,"internal error: upgrade was not requested"));return}if(r.kind==="FAILED"){await this.options.inner.send(JS(t,ji(r.version,r.reason,this.host())));return}let n=await yce(r.target,this.options.waitMs??oce);if(n.kind==="DONE"){let s=this.options.currentVersion,o=n.value.version;n.value.send(t,async a=>{let c=await this.toolsRelisted.waitFor(this.reloadGraceMs()),u=this.upgradeNoted;return this.upgradeNoted=!0,c||u||JSON.stringify(a).includes(lce)?a:PF(a,gF(s,o,this.host()))});return}let i=n.kind==="TIMEOUT"?mF(r.version.current,lo(r.version)??r.version.latest):ji(r.version,n.reason,this.host());await this.options.inner.send(JS(t,i))}reloadGraceMs(){return this.options.toolReloadGraceMs??uce}async hostRelistedTools(){let t=this.startedAt+2*this.reloadGraceMs()-Date.now();return this.toolsRelisted.waitFor(Math.max(0,t))}host(){let t=this.initializeRequest?.params?.clientInfo;return hF(t)}async withToolHint(t,r){if(t.method!=="tools/call")return r;let n=mce(r);if(n===null)return r;let{upgradedFrom:i,currentVersion:s}=this.options;return fce.test(n)?gce(r,yF(String(t.params?.name??""),s,this.host(),{upgradedFrom:i,toolListReloaded:i?await this.hostRelistedTools():!1})):i&&dce.test(n)?PF(r,vF(i,s,this.host(),await this.hostRelistedTools())):r}};function mce(e){let t=e.result,r=t?.content?.[0];return t?.isError&&r?.type==="text"&&typeof r.text=="string"?r.text:null}function gce(e,t){return{jsonrpc:"2.0",id:e.id,result:{content:[{type:"text",text:t}],isError:!0}}}function PF(e,t){if(e.error)return{jsonrpc:"2.0",id:e.id,error:{...e.error,message:`${e.error.message}
1586
- ${t}`}};let r=e.result;return r?.content?{jsonrpc:"2.0",id:e.id,result:{...r,content:[...r.content,{type:"text",text:t}]}}:e}function JS(e,t){return e.method==="tools/call"?{jsonrpc:"2.0",id:e.id,result:{content:[{type:"text",text:t}],isError:!0}}:{jsonrpc:"2.0",id:e.id,error:{code:-32603,message:t}}}var zS=class{seen=!1;waiters=new Set;reset(){this.seen=!1}mark(){this.seen=!0;for(let t of this.waiters)t();this.waiters.clear()}waitFor(t){return this.seen||t<=0?Promise.resolve(this.seen):new Promise(r=>{let n=()=>{clearTimeout(i),r(!0)},i=setTimeout(()=>{this.waiters.delete(n),r(!1)},t);this.waiters.add(n)})}};function yce(e,t){return new Promise(r=>{let n=setTimeout(()=>r({kind:"TIMEOUT"}),t);e.then(i=>{clearTimeout(n),r({kind:"DONE",value:i})},i=>{clearTimeout(n),r({kind:"FAILED",reason:i instanceof Error?i.message:String(i)})})})}var XS=class{constructor(t,r,n,i){this.version=t;this.child=r;this.toHost=n;r.stdout.on("data",a=>{for(this.buffer.append(a);;){let c;try{c=this.buffer.readMessage()}catch(u){D.warn(`[upgrade] unreadable message from new version: ${String(u)}`);continue}if(!c)break;this.route(c)}}),r.stdin.on("error",()=>{});let s=!1,o=(a,c)=>{if(!s){s=!0;for(let u of this.waiters.values())u({jsonrpc:"2.0",id:"",error:{code:-32603,message:c}});this.waiters.clear(),this.closed||Promise.allSettled([...this.inflight]).then(()=>i(a))}};r.on("error",a=>o(1,`it could not start: ${a.message}`)),r.on("exit",a=>o(a??1,`it exited with ${a}`))}buffer=new uo;intercepts=new Map;inflight=new Set;waiters=new Map;sequence=0;closed=!1;send(t,r){r&&"id"in t&&t.id!==void 0&&this.intercepts.set(t.id,r),this.closed||this.child.stdin.write(cp(t))}async initialize(t,r,n){let i=await this.request(t.method,{...t.params,...r?{protocolVersion:r}:{}});if(i.error)throw new Error(`the new version did not initialize: ${i.error.message}`);let s=i.result?.protocolVersion;if(r&&s!==r)throw new Error(`the new version speaks MCP ${String(s)}, but this session uses ${r}`);this.send({jsonrpc:"2.0",method:"notifications/initialized"});for(let o of n)await this.request(o.method,o.params).catch(()=>{})}close(){this.closed||(this.closed=!0,this.child.stdin.end())}request(t,r){this.sequence+=1;let n=`handover-${this.sequence}`;return new Promise((i,s)=>{let o=setTimeout(()=>{this.waiters.delete(n),s(new Error(`the new version did not answer ${t}`))},ace);this.waiters.set(n,a=>{clearTimeout(o),i(a)}),this.send({jsonrpc:"2.0",id:n,method:t,params:r})})}route(t){if(RF(t)){let r=typeof t.id=="string"?this.waiters.get(t.id):void 0;if(r){this.waiters.delete(t.id),r(t);return}let n=this.intercepts.get(t.id);if(n){this.intercepts.delete(t.id);let i=n(t).then(s=>this.toHost(s));this.inflight.add(i),i.finally(()=>this.inflight.delete(i));return}}this.toHost(t)}};var dp=mo.toLowerCase(),DF=e=>`${dp}://project/${encodeURIComponent(e)}/schema-state`,LF=e=>`${dp}://project/${encodeURIComponent(e)}/schema-events`,kF=e=>Array.isArray(e)?String(e[0]??""):String(e??"");async function ZS(e){let t=xF.resolve(e),r=await Fc(t),n=jF(),i=async()=>{await Ct(r,{name:"daemon.pin",args:{token:n}})},s=async()=>{await Ct(r,{name:"daemon.unpin",args:{token:n}}).catch(()=>{})};await i();let o=setInterval(()=>{Ct(r,{name:"daemon.heartbeat",args:{token:n}}).catch(()=>{})},6e4);o.unref();let a=new Ab({name:te,version:"1.0.0"},{instructions:OF(),capabilities:{tools:{},prompts:{},resources:{subscribe:!0}}});yb(a);let c=new Set;a.server.setRequestHandler(Ob,_=>(c.add(_.params.uri),{})),a.server.setRequestHandler(Ib,_=>(c.delete(_.params.uri),{}));let u=process.env.MCP_HOST_SESSION_ID||Ece(),l=async(_,w)=>{if(_.agent??=a.server.getClientVersion()?.name,_.sessionId??=u,_.name==="workspace.set"&&typeof _.args?.cwd=="string"){let I=xF.resolve(_.args.cwd);if(_.args.cwd=I,I!==t){let T=r;r=await Fc(I),t=I,await Ct(T,{name:"daemon.unpin",args:{token:n}},w).catch(()=>{}),await i()}}return Ct(r,_,w)},d=new go,p=new fp({inner:new up,currentVersion:Hn(),upgradedFrom:process.env.MCP_UPGRADED_FROM||void 0,canUpgrade:_=>yo()&&lo(_)!==null,prepare:_=>d.installFirst(qc(_)),launch:_=>vce(process.execPath,[d.binPath(_),"mcp","--cwd",t],{stdio:["pipe","pipe","inherit"],env:{...process.env,MCP_HOST_SESSION_ID:u,MCP_UPGRADED_FROM:Hn()}}),onRelayActive:()=>{clearInterval(o),y.unsubscribe(),s()},onRelayExit:_=>process.exit(_)});Cb(a,p.wrapSender(l)),Rb(a,p.wrapSender(l));let h=async()=>{let _=await Ct(r,{name:"schema.status"});if(!_.ok)return[];let I=_.data?.sessions;return Array.isArray(I)?[...new Set(I.map(T=>T?.projectExId).filter(T=>typeof T=="string"))]:[]};a.registerResource("project-schema-state",new Ep(`${dp}://project/{projectExId}/schema-state`,{list:async()=>({resources:(await h()).map(_=>({uri:DF(_),name:`schema-state-${_}`,title:`Schema state ${_}`,description:"Current in-memory schema revision and stale/change notification state.",mimeType:"application/json"}))})}),{title:"Project Schema State",description:"Current in-memory schema revision and stale/change notification state.",mimeType:"application/json"},async(_,w)=>{let I=kF(w.projectExId),T=await Ct(r,{name:"schema.state",args:{projectExId:I}});return{contents:[{uri:_.href,mimeType:"application/json",text:JSON.stringify(T.ok?T.data:T,null,2)}]}}),a.registerResource("project-schema-events",new Ep(`${dp}://project/{projectExId}/schema-events`,{list:async()=>({resources:(await h()).map(_=>({uri:LF(_),name:`schema-events-${_}`,title:`Schema events ${_}`,description:"Recent semantic schema-change events observed by the daemon.",mimeType:"application/json"}))})}),{title:"Project Schema Events",description:"Recent semantic schema-change events observed by the daemon.",mimeType:"application/json"},async(_,w)=>{let I=kF(w.projectExId),T=await Ct(r,{name:"schema.events",args:{projectExId:I}});return{contents:[{uri:_.href,mimeType:"application/json",text:JSON.stringify(T.ok?T.data:T,null,2)}]}}),await a.connect(p),process.env.MCP_UPGRADED_FROM||AF(jc,d).catch(_=>{D.warn(`[upgrade] prefetch failed: ${String(_)}`)});let g=new Set,y=_F(r,async _=>{if(!_?.id||g.has(_.id))return;g.add(_.id);let w=String(_.projectExId??"");if(!w)return;let I=DF(w),T=LF(w),N=[c.has(I)?a.server.sendResourceUpdated({uri:I}):Promise.resolve(),c.has(T)?a.server.sendResourceUpdated({uri:T}):Promise.resolve()];await Promise.all([...N,a.sendLoggingMessage({level:"notice",logger:te,data:{message:"Project schema changed",projectExId:w,event:_}})])},_=>{D.warn("Daemon subscription error",_.message)}),E=!1,S=async()=>{E||(E=!0,clearInterval(o),y.unsubscribe(),await s(),await a.close())};process.on("SIGINT",()=>{S().finally(()=>process.exit(0))}),process.on("SIGTERM",()=>{S().finally(()=>process.exit(0))}),process.stdin.on("end",()=>{S().finally(()=>process.exit(0))}),process.stdin.on("close",()=>{S().finally(()=>process.exit(0))}),process.on("exit",()=>{clearInterval(o),y.unsubscribe()})}f();var _ce=/^-?\d+(\.\d+)?$/;function Sce(e){return e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")}function bce(e){if(e==="true")return!0;if(e==="false")return!1;if(_ce.test(e))return Number(e);if(Sce(e))try{return JSON.parse(e)}catch{return e}return e}function MF(e){let t=Number(e);if(Number.isNaN(t))throw new Mp("expected a number");return t}function eb(e){try{return JSON.parse(e)}catch{throw new Mp("expected valid JSON")}}function qF(e){if(typeof e!="string")return{};try{let t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function Tce(e){let t={};for(let r=0;r<e.length;r++){let n=e[r];if(!n.startsWith("--"))continue;let i=n.slice(2),s,o=i.indexOf("=");if(o!==-1)s=i.slice(o+1),i=i.slice(0,o);else{let a=e[r+1];a!==void 0&&!a.startsWith("--")&&(s=a,r+=1)}s===void 0?i.startsWith("no-")?t[i.slice(3)]=!1:t[i]=!0:t[i]=bce(s)}return t}function FF(e,t,r){let n=qF(e.args);return Object.assign(n,Tce(t)),r&&(n.subcommand=r),n}function UF(e,t){let r=qF(t.args),n=e.opts();for(let i of e.options){let s=i.attributeName();e.getOptionValueSource(s)==="cli"&&(r[s]=n[s])}return r}f();function wce(e){let t=e,r=!1;for(;;)if(t instanceof Ut.ZodOptional)r=!0,t=t.unwrap();else if(t instanceof Ut.ZodNullable)t=t.unwrap();else if(t instanceof Ut.ZodDefault)t=t.removeDefault();else break;return{base:t,optional:r}}function VF(e,t){for(let[r,n]of Object.entries(t)){let{base:i,optional:s}=wce(n),o=s?"":"required",a=`${o} JSON`.trim();i instanceof Ut.ZodBoolean?(e.option(`--${r}`,o),e.option(`--no-${r}`)):i instanceof Ut.ZodNumber?e.option(`--${r} <value>`,o,MF):i instanceof Ut.ZodArray?i.element instanceof Ut.ZodString?e.option(`--${r} <values...>`,o):e.option(`--${r} <json>`,a,eb):i instanceof Ut.ZodRecord||i instanceof Ut.ZodObject||i instanceof Ut.ZodAny||i instanceof Ut.ZodUnknown?e.option(`--${r} <json>`,a,eb):e.option(`--${r} <value>`,o)}}var tb=["default"],KF=[];function Mi(e){return typeof e.cwd=="string"?BF.resolve(e.cwd):process.env.WORKSPACE_ROOT||process.cwd()}function pp(e){return e.pretty===void 0?!0:!e.pretty}async function HF(e,t,r){let n={name:e,args:t},i=Mi(r),s=r.daemon===!1?await qce(n,i):await Mce(n,i),o=lp(s);if(o){let a=await IF(o,KF);if(a.kind==="RERAN"){gb(a.status);return}a.kind==="FAILED"&&(s={...s,error:ji(o,a.reason)})}hp(s,pp(r)),s.ok||(process.exitCode=1)}async function Pce(e){let t=await Fc(Mi(e));hp({ok:!0,data:QF(t),message:"Daemon started"},pp(e))}async function Rce(e){await TF({workspaceRoot:Mi(e),idleTimeoutMs:Fce(process.env.ZED_AGENT_DAEMON_IDLE_TTL)??ap,startupFlags:tb})}async function xce(e){let r=await new Bn(Mi(e)).list();hp({ok:!0,data:r.map(QF)},pp(e))}async function Dce(e){let t=Mi(e),r=new Bn(t),n=new kr(t),i=await Hs(n,tb),s=await r.list(),o=[];for(let a of s)if(JSON.stringify(a.compatibility)===JSON.stringify(i))try{await Ct(a,{name:"daemon.stop"}),o.push(a.pid)}catch{await r.remove(a.pid)}hp({ok:!0,data:{stopped:o}},pp(e))}function GF(e,t){return e.commands.find(r=>r.name()===t)}function $F(e,t,r,n,i){let s=e;for(let c=0;c<t.length-1;c+=1)s=GF(s,t[c])??s.command(t[c]);let o=t[t.length-1];if(GF(s,o))return;let a=s.command(o).description(r);i&&VF(a,i),a.action(async(c,u)=>{let l=u.optsWithGlobals();await HF(n,UF(u,l),l)})}function Lce(e,t,r,n){$F(e,r.path.split(" "),t.description,t.command,n),r.alias&&$F(e,r.alias.split(" "),t.description,t.command,n)}function kce(){let e=Ft(),t=Object.keys(hb).join(", ");return["","Backend environment:",` Active: ${e.name} (select with ZION_ENV / MCP_ENV; known: ${t})`,` API: ${e.apiBaseUrl}`,` Auth: ${e.authEndpoint}`," Override any endpoint individually with BACKEND_API_BASE,"," BACKEND_AUTH_ENDPOINT, ZERO_API_URL_TEMPLATE, LOG_API_URL_TEMPLATE.","","Type system:",` Mode: ${qi()} (set MCP_TYPE_SYSTEM=pre or post; default pre)`," Post-only writes (enums, object/custom types) are gated unless the project"," is detected as post-refactor or MCP_TYPE_SYSTEM=post.","","Upgrades:"," When the backend stops supporting this version, the newer release is installed",` into ~/.${te}/versions and the call continues on it; later starts run it directly.`," MCP_AUTO_UPGRADE=0 turns this off and only reports the required upgrade.","","Logs:",` File: ${vb()}`,` Level: ${process.env.MCP_LOG_LEVEL??"info"} (set MCP_LOG_LEVEL; debug, or verbose)`," Verbose: MCP_LOG_LEVEL=verbose (or MCP_LOG_GQL=1) logs full GraphQL bodies + subscription events"," Rotation: 50 MB x 5 files; data older than 1 day is truncated"," Override: MCP_LOG_DIR, MCP_LOG_MAX_BYTES, MCP_LOG_MAX_FILES,"," MCP_LOG_MAX_AGE_DAYS (0 disables), MCP_LOG_FILE=off"].join(`
1587
- `)}function jce(e){return e instanceof Error&&"code"in e&&typeof e.code=="string"&&e.code.startsWith("commander.")}async function kNe(e=process.argv.slice(2)){KF=e;let t=new Kb;t.name(te).allowUnknownOption(!0).allowExcessArguments(!0).exitOverride(),t.option("--no-daemon","Run command one-shot without starting or using daemon"),t.option("--cwd <dir>","Workspace root for product config and daemon registry"),t.option("--pretty","Human-oriented output"),t.option("--args <json>","Pass arguments as JSON string"),t.command("mcp").description("Run MCP Bridge").allowUnknownOption(!0).action(async(i,s)=>{await ZS(Mi(s.optsWithGlobals()))}),t.command("version-check").description("Compare this CLI against the backend-advertised minimum supported version").action(async()=>{let i=await jc();process.stdout.write(`${ip(i)}
1588
- `),i.status==="outdated"&&(process.exitCode=1)}),t.command("tool-surface",{hidden:!0}).description("Print the MCP tools, prompts and CLI verbs this version exposes, as JSON").action(async()=>{let{collectToolSurface:i}=await import("./surface-S5OGOVQV.js");process.stdout.write(`${JSON.stringify(await i(),null,2)}
1589
- `)});let r=t.command("daemon").description("Daemon control"),n=[["start","Start daemon",Pce],["foreground","Run daemon in foreground",Rce],["status","Get daemon status",xce],["stop","Stop daemon",Dce]];for(let[i,s,o]of n)r.command(i).description(s).action(async(a,c)=>{await o(c.optsWithGlobals())});for(let i of Nb){if(!i.cli)continue;let s=i.cli,o=i.tool?.inputSchema;Lce(t,i,s,o)}t.argument("[parts...]","Custom agent command or MCP Bridge").action(async(i,s,o)=>{let a=o.optsWithGlobals();if(!i||i.length===0){await ZS(Mi(a));return}let c=[],u=[],l=!1;for(let d of i)!l&&d.startsWith("--")&&(l=!0),(l?u:c).push(d);await HF(c[0],FF(a,u,c[1]),a)}),t.addHelpText("afterAll",kce);try{await t.parseAsync(["node",te,...e])}catch(i){if(jce(i)){i.code==="commander.help"||i.code==="commander.helpDisplayed"||i.code==="commander.version"||(process.exitCode=1);return}throw i}}async function Mce(e,t){let r=await Fc(t);return Ct(r,e)}async function qce(e,t){let r=sp(t);try{return await r.execute(e)}finally{r.stop()}}async function Fc(e){let t=new Bn(e),r=new kr(e),n=await Hs(r,tb),i=await t.findCompatible(n);if(i)try{if((await Ct(i,{name:"daemon.ping"})).ok)return i}catch{await t.remove(i.pid)}let s=t.createRecord(n);await t.ensure(),await Cce.mkdir(BF.dirname(s.logPath),{recursive:!0});let o=Nce(s.logPath,"a"),a=Oce(process.execPath,[process.argv[1],"daemon","foreground"],{cwd:e,detached:!0,env:{...process.env,WORKSPACE_ROOT:e,ZED_AGENT_DAEMON_IDLE_TTL:process.env.ZED_AGENT_DAEMON_IDLE_TTL??String(ap)},stdio:["ignore",o,o]});Ace(o),a.unref();let c=Date.now()+1e4,u=null;for(;Date.now()<c;){await Uce(200);let l=await t.findCompatible(n);if(l)try{if((await Ct(l,{name:"daemon.ping"})).ok)return l}catch(d){u=d}}throw new Error(`Failed to start daemon${u?`: ${u.message}`:""}`)}function QF(e){let{token:t,...r}=e;return r}function hp(e,t){if(t){let r=e.ok?e.data??(e.message!==void 0?{message:e.message}:{}):{error:e.error,...e.data!==void 0?{data:e.data}:{}};process.stdout.write(`${JSON.stringify(r,null,2)}
1590
- `);return}e.message&&process.stdout.write(`${e.message}
1591
- `),e.data!==void 0&&process.stdout.write(`${JSON.stringify(e.data,null,2)}
1592
- `),e.error&&process.stderr.write(`${e.error}
1593
- `)}function Fce(e){if(!e)return null;if(/^\d+$/.test(e))return Number(e);let t=e.match(/^(\d+)(ms|s|m|h)$/);if(!t)return null;let r=Number(t[1]),n=t[2];return n==="ms"?r:n==="s"?r*1e3:n==="m"?r*6e4:r*60*6e4}function jF(){return Ice()}var Uce=e=>new Promise(t=>{setTimeout(t,e)});export{jF as createMcpPinToken,Fc as ensureDaemon,kNe as runCli};