//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/jsutils/devAssert.mjs
function devAssert(condition, message) {
	if (!Boolean(condition)) throw new Error(message);
}
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/jsutils/isObjectLike.mjs
/**
* Return true if `value` is object-like. A value is object-like if it's not
* `null` and has a `typeof` result of "object".
*/
function isObjectLike(value) {
	return typeof value == "object" && value !== null;
}
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/jsutils/invariant.mjs
function invariant(condition, message) {
	if (!Boolean(condition)) throw new Error(message != null ? message : "Unexpected invariant triggered.");
}
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/language/location.mjs
const LineRegExp = /\r\n|[\n\r]/g;
/**
* Represents a location in a Source.
*/
/**
* Takes a Source and a UTF-8 character offset, and returns the corresponding
* line and column as a SourceLocation.
*/
function getLocation(source, position) {
	let lastLineStart = 0;
	let line = 1;
	for (const match of source.body.matchAll(LineRegExp)) {
		typeof match.index === "number" || invariant(false);
		if (match.index >= position) break;
		lastLineStart = match.index + match[0].length;
		line += 1;
	}
	return {
		line,
		column: position + 1 - lastLineStart
	};
}
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/language/printLocation.mjs
/**
* Render a helpful description of the location in the GraphQL Source document.
*/
function printLocation(location) {
	return printSourceLocation(location.source, getLocation(location.source, location.start));
}
/**
* Render a helpful description of the location in the GraphQL Source document.
*/
function printSourceLocation(source, sourceLocation) {
	const firstLineColumnOffset = source.locationOffset.column - 1;
	const body = "".padStart(firstLineColumnOffset) + source.body;
	const lineIndex = sourceLocation.line - 1;
	const lineOffset = source.locationOffset.line - 1;
	const lineNum = sourceLocation.line + lineOffset;
	const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;
	const columnNum = sourceLocation.column + columnOffset;
	const locationStr = `${source.name}:${lineNum}:${columnNum}\n`;
	const lines = body.split(/\r\n|[\n\r]/g);
	const locationLine = lines[lineIndex];
	if (locationLine.length > 120) {
		const subLineIndex = Math.floor(columnNum / 80);
		const subLineColumnNum = columnNum % 80;
		const subLines = [];
		for (let i = 0; i < locationLine.length; i += 80) subLines.push(locationLine.slice(i, i + 80));
		return locationStr + printPrefixedLines([
			[`${lineNum} |`, subLines[0]],
			...subLines.slice(1, subLineIndex + 1).map((subLine) => ["|", subLine]),
			["|", "^".padStart(subLineColumnNum)],
			["|", subLines[subLineIndex + 1]]
		]);
	}
	return locationStr + printPrefixedLines([
		[`${lineNum - 1} |`, lines[lineIndex - 1]],
		[`${lineNum} |`, locationLine],
		["|", "^".padStart(columnNum)],
		[`${lineNum + 1} |`, lines[lineIndex + 1]]
	]);
}
function printPrefixedLines(lines) {
	const existingLines = lines.filter(([_, line]) => line !== void 0);
	const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));
	return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? " " + line : "")).join("\n");
}
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/error/GraphQLError.mjs
function toNormalizedOptions(args) {
	const firstArg = args[0];
	if (firstArg == null || "kind" in firstArg || "length" in firstArg) return {
		nodes: firstArg,
		source: args[1],
		positions: args[2],
		path: args[3],
		originalError: args[4],
		extensions: args[5]
	};
	return firstArg;
}
/**
* A GraphQLError describes an Error found during the parse, validate, or
* execute phases of performing a GraphQL operation. In addition to a message
* and stack trace, it also includes information about the locations in a
* GraphQL document and/or execution result that correspond to the Error.
*/
var GraphQLError = class GraphQLError extends Error {
	/**
	* An array of `{ line, column }` locations within the source GraphQL document
	* which correspond to this error.
	*
	* Errors during validation often contain multiple locations, for example to
	* point out two things with the same name. Errors during execution include a
	* single location, the field which produced the error.
	*
	* Enumerable, and appears in the result of JSON.stringify().
	*/
	/**
	* An array describing the JSON-path into the execution response which
	* corresponds to this error. Only included for errors during execution.
	*
	* Enumerable, and appears in the result of JSON.stringify().
	*/
	/**
	* An array of GraphQL AST Nodes corresponding to this error.
	*/
	/**
	* The source GraphQL document for the first location of this error.
	*
	* Note that if this Error represents more than one node, the source may not
	* represent nodes after the first node.
	*/
	/**
	* An array of character offsets within the source GraphQL document
	* which correspond to this error.
	*/
	/**
	* The original error thrown from a field resolver during execution.
	*/
	/**
	* Extension fields to add to the formatted error.
	*/
	/**
	* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
	*/
	constructor(message, ...rawArgs) {
		var _this$nodes, _nodeLocations$, _ref;
		const { nodes, source, positions, path, originalError, extensions } = toNormalizedOptions(rawArgs);
		super(message);
		this.name = "GraphQLError";
		this.path = path !== null && path !== void 0 ? path : void 0;
		this.originalError = originalError !== null && originalError !== void 0 ? originalError : void 0;
		this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : void 0);
		const nodeLocations = undefinedIfEmpty((_this$nodes = this.nodes) === null || _this$nodes === void 0 ? void 0 : _this$nodes.map((node) => node.loc).filter((loc) => loc != null));
		this.source = source !== null && source !== void 0 ? source : nodeLocations === null || nodeLocations === void 0 ? void 0 : (_nodeLocations$ = nodeLocations[0]) === null || _nodeLocations$ === void 0 ? void 0 : _nodeLocations$.source;
		this.positions = positions !== null && positions !== void 0 ? positions : nodeLocations === null || nodeLocations === void 0 ? void 0 : nodeLocations.map((loc) => loc.start);
		this.locations = positions && source ? positions.map((pos) => getLocation(source, pos)) : nodeLocations === null || nodeLocations === void 0 ? void 0 : nodeLocations.map((loc) => getLocation(loc.source, loc.start));
		const originalExtensions = isObjectLike(originalError === null || originalError === void 0 ? void 0 : originalError.extensions) ? originalError === null || originalError === void 0 ? void 0 : originalError.extensions : void 0;
		this.extensions = (_ref = extensions !== null && extensions !== void 0 ? extensions : originalExtensions) !== null && _ref !== void 0 ? _ref : Object.create(null);
		Object.defineProperties(this, {
			message: {
				writable: true,
				enumerable: true
			},
			name: { enumerable: false },
			nodes: { enumerable: false },
			source: { enumerable: false },
			positions: { enumerable: false },
			originalError: { enumerable: false }
		});
		/* c8 ignore start */
		if (originalError !== null && originalError !== void 0 && originalError.stack) Object.defineProperty(this, "stack", {
			value: originalError.stack,
			writable: true,
			configurable: true
		});
		else if (Error.captureStackTrace) Error.captureStackTrace(this, GraphQLError);
		else Object.defineProperty(this, "stack", {
			value: Error().stack,
			writable: true,
			configurable: true
		});
		/* c8 ignore stop */
	}
	get [Symbol.toStringTag]() {
		return "GraphQLError";
	}
	toString() {
		let output = this.message;
		if (this.nodes) {
			for (const node of this.nodes) if (node.loc) output += "\n\n" + printLocation(node.loc);
		} else if (this.source && this.locations) for (const location of this.locations) output += "\n\n" + printSourceLocation(this.source, location);
		return output;
	}
	toJSON() {
		const formattedError = { message: this.message };
		if (this.locations != null) formattedError.locations = this.locations;
		if (this.path != null) formattedError.path = this.path;
		if (this.extensions != null && Object.keys(this.extensions).length > 0) formattedError.extensions = this.extensions;
		return formattedError;
	}
};
function undefinedIfEmpty(array) {
	return array === void 0 || array.length === 0 ? void 0 : array;
}
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/error/syntaxError.mjs
/**
* Produces a GraphQLError representing a syntax error, containing useful
* descriptive information about the syntax error's position in the source.
*/
function syntaxError(source, position, description) {
	return new GraphQLError(`Syntax Error: ${description}`, {
		source,
		positions: [position]
	});
}
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/language/ast.mjs
/**
* Contains a range of UTF-8 character offsets and token references that
* identify the region of the source from which the AST derived.
*/
var Location = class {
	/**
	* The character offset at which this Node begins.
	*/
	/**
	* The character offset at which this Node ends.
	*/
	/**
	* The Token at which this Node begins.
	*/
	/**
	* The Token at which this Node ends.
	*/
	/**
	* The Source document the AST represents.
	*/
	constructor(startToken, endToken, source) {
		this.start = startToken.start;
		this.end = endToken.end;
		this.startToken = startToken;
		this.endToken = endToken;
		this.source = source;
	}
	get [Symbol.toStringTag]() {
		return "Location";
	}
	toJSON() {
		return {
			start: this.start,
			end: this.end
		};
	}
};
/**
* Represents a range of characters represented by a lexical token
* within a Source.
*/
var Token = class {
	/**
	* The kind of Token.
	*/
	/**
	* The character offset at which this Node begins.
	*/
	/**
	* The character offset at which this Node ends.
	*/
	/**
	* The 1-indexed line number on which this Token appears.
	*/
	/**
	* The 1-indexed column number at which this Token begins.
	*/
	/**
	* For non-punctuation tokens, represents the interpreted value of the token.
	*
	* Note: is undefined for punctuation tokens, but typed as string for
	* convenience in the parser.
	*/
	/**
	* Tokens exist as nodes in a double-linked-list amongst all tokens
	* including ignored tokens. <SOF> is always the first node and <EOF>
	* the last.
	*/
	constructor(kind, start, end, line, column, value) {
		this.kind = kind;
		this.start = start;
		this.end = end;
		this.line = line;
		this.column = column;
		this.value = value;
		this.prev = null;
		this.next = null;
	}
	get [Symbol.toStringTag]() {
		return "Token";
	}
	toJSON() {
		return {
			kind: this.kind,
			value: this.value,
			line: this.line,
			column: this.column
		};
	}
};
/**
* The list of all possible AST node types.
*/
/**
* @internal
*/
const QueryDocumentKeys = {
	Name: [],
	Document: ["definitions"],
	OperationDefinition: [
		"description",
		"name",
		"variableDefinitions",
		"directives",
		"selectionSet"
	],
	VariableDefinition: [
		"description",
		"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: [
		"description",
		"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"
	],
	TypeCoordinate: ["name"],
	MemberCoordinate: ["name", "memberName"],
	ArgumentCoordinate: [
		"name",
		"fieldName",
		"argumentName"
	],
	DirectiveCoordinate: ["name"],
	DirectiveArgumentCoordinate: ["name", "argumentName"]
};
const kindValues = new Set(Object.keys(QueryDocumentKeys));
/**
* @internal
*/
function isNode(maybeNode) {
	const maybeKind = maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.kind;
	return typeof maybeKind === "string" && kindValues.has(maybeKind);
}
/** Name */
var OperationTypeNode;
(function(OperationTypeNode) {
	OperationTypeNode["QUERY"] = "query";
	OperationTypeNode["MUTATION"] = "mutation";
	OperationTypeNode["SUBSCRIPTION"] = "subscription";
})(OperationTypeNode || (OperationTypeNode = {}));
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/language/directiveLocation.mjs
/**
* The set of allowed directive location values.
*/
var DirectiveLocation;
(function(DirectiveLocation) {
	DirectiveLocation["QUERY"] = "QUERY";
	DirectiveLocation["MUTATION"] = "MUTATION";
	DirectiveLocation["SUBSCRIPTION"] = "SUBSCRIPTION";
	DirectiveLocation["FIELD"] = "FIELD";
	DirectiveLocation["FRAGMENT_DEFINITION"] = "FRAGMENT_DEFINITION";
	DirectiveLocation["FRAGMENT_SPREAD"] = "FRAGMENT_SPREAD";
	DirectiveLocation["INLINE_FRAGMENT"] = "INLINE_FRAGMENT";
	DirectiveLocation["VARIABLE_DEFINITION"] = "VARIABLE_DEFINITION";
	DirectiveLocation["SCHEMA"] = "SCHEMA";
	DirectiveLocation["SCALAR"] = "SCALAR";
	DirectiveLocation["OBJECT"] = "OBJECT";
	DirectiveLocation["FIELD_DEFINITION"] = "FIELD_DEFINITION";
	DirectiveLocation["ARGUMENT_DEFINITION"] = "ARGUMENT_DEFINITION";
	DirectiveLocation["INTERFACE"] = "INTERFACE";
	DirectiveLocation["UNION"] = "UNION";
	DirectiveLocation["ENUM"] = "ENUM";
	DirectiveLocation["ENUM_VALUE"] = "ENUM_VALUE";
	DirectiveLocation["INPUT_OBJECT"] = "INPUT_OBJECT";
	DirectiveLocation["INPUT_FIELD_DEFINITION"] = "INPUT_FIELD_DEFINITION";
})(DirectiveLocation || (DirectiveLocation = {}));
/**
* The enum type representing the directive location values.
*
* @deprecated Please use `DirectiveLocation`. Will be remove in v17.
*/
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/language/kinds.mjs
/**
* The set of allowed kind values for AST nodes.
*/
var Kind;
(function(Kind) {
	Kind["NAME"] = "Name";
	Kind["DOCUMENT"] = "Document";
	Kind["OPERATION_DEFINITION"] = "OperationDefinition";
	Kind["VARIABLE_DEFINITION"] = "VariableDefinition";
	Kind["SELECTION_SET"] = "SelectionSet";
	Kind["FIELD"] = "Field";
	Kind["ARGUMENT"] = "Argument";
	Kind["FRAGMENT_SPREAD"] = "FragmentSpread";
	Kind["INLINE_FRAGMENT"] = "InlineFragment";
	Kind["FRAGMENT_DEFINITION"] = "FragmentDefinition";
	Kind["VARIABLE"] = "Variable";
	Kind["INT"] = "IntValue";
	Kind["FLOAT"] = "FloatValue";
	Kind["STRING"] = "StringValue";
	Kind["BOOLEAN"] = "BooleanValue";
	Kind["NULL"] = "NullValue";
	Kind["ENUM"] = "EnumValue";
	Kind["LIST"] = "ListValue";
	Kind["OBJECT"] = "ObjectValue";
	Kind["OBJECT_FIELD"] = "ObjectField";
	Kind["DIRECTIVE"] = "Directive";
	Kind["NAMED_TYPE"] = "NamedType";
	Kind["LIST_TYPE"] = "ListType";
	Kind["NON_NULL_TYPE"] = "NonNullType";
	Kind["SCHEMA_DEFINITION"] = "SchemaDefinition";
	Kind["OPERATION_TYPE_DEFINITION"] = "OperationTypeDefinition";
	Kind["SCALAR_TYPE_DEFINITION"] = "ScalarTypeDefinition";
	Kind["OBJECT_TYPE_DEFINITION"] = "ObjectTypeDefinition";
	Kind["FIELD_DEFINITION"] = "FieldDefinition";
	Kind["INPUT_VALUE_DEFINITION"] = "InputValueDefinition";
	Kind["INTERFACE_TYPE_DEFINITION"] = "InterfaceTypeDefinition";
	Kind["UNION_TYPE_DEFINITION"] = "UnionTypeDefinition";
	Kind["ENUM_TYPE_DEFINITION"] = "EnumTypeDefinition";
	Kind["ENUM_VALUE_DEFINITION"] = "EnumValueDefinition";
	Kind["INPUT_OBJECT_TYPE_DEFINITION"] = "InputObjectTypeDefinition";
	Kind["DIRECTIVE_DEFINITION"] = "DirectiveDefinition";
	Kind["SCHEMA_EXTENSION"] = "SchemaExtension";
	Kind["SCALAR_TYPE_EXTENSION"] = "ScalarTypeExtension";
	Kind["OBJECT_TYPE_EXTENSION"] = "ObjectTypeExtension";
	Kind["INTERFACE_TYPE_EXTENSION"] = "InterfaceTypeExtension";
	Kind["UNION_TYPE_EXTENSION"] = "UnionTypeExtension";
	Kind["ENUM_TYPE_EXTENSION"] = "EnumTypeExtension";
	Kind["INPUT_OBJECT_TYPE_EXTENSION"] = "InputObjectTypeExtension";
	Kind["TYPE_COORDINATE"] = "TypeCoordinate";
	Kind["MEMBER_COORDINATE"] = "MemberCoordinate";
	Kind["ARGUMENT_COORDINATE"] = "ArgumentCoordinate";
	Kind["DIRECTIVE_COORDINATE"] = "DirectiveCoordinate";
	Kind["DIRECTIVE_ARGUMENT_COORDINATE"] = "DirectiveArgumentCoordinate";
})(Kind || (Kind = {}));
/**
* The enum type representing the possible kind values of AST nodes.
*
* @deprecated Please use `Kind`. Will be remove in v17.
*/
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/language/characterClasses.mjs
/**
* ```
* WhiteSpace ::
*   - "Horizontal Tab (U+0009)"
*   - "Space (U+0020)"
* ```
* @internal
*/
function isWhiteSpace(code) {
	return code === 9 || code === 32;
}
/**
* ```
* Digit :: one of
*   - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`
* ```
* @internal
*/
function isDigit(code) {
	return code >= 48 && code <= 57;
}
/**
* ```
* Letter :: one of
*   - `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M`
*   - `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z`
*   - `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m`
*   - `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z`
* ```
* @internal
*/
function isLetter(code) {
	return code >= 97 && code <= 122 || code >= 65 && code <= 90;
}
/**
* ```
* NameStart ::
*   - Letter
*   - `_`
* ```
* @internal
*/
function isNameStart(code) {
	return isLetter(code) || code === 95;
}
/**
* ```
* NameContinue ::
*   - Letter
*   - Digit
*   - `_`
* ```
* @internal
*/
function isNameContinue(code) {
	return isLetter(code) || isDigit(code) || code === 95;
}
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/language/blockString.mjs
/**
* Produces the value of a block string from its parsed raw value, similar to
* CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.
*
* This implements the GraphQL spec's BlockStringValue() static algorithm.
*
* @internal
*/
function dedentBlockStringLines(lines) {
	var _firstNonEmptyLine2;
	let commonIndent = Number.MAX_SAFE_INTEGER;
	let firstNonEmptyLine = null;
	let lastNonEmptyLine = -1;
	for (let i = 0; i < lines.length; ++i) {
		var _firstNonEmptyLine;
		const line = lines[i];
		const indent = leadingWhitespace(line);
		if (indent === line.length) continue;
		firstNonEmptyLine = (_firstNonEmptyLine = firstNonEmptyLine) !== null && _firstNonEmptyLine !== void 0 ? _firstNonEmptyLine : i;
		lastNonEmptyLine = i;
		if (i !== 0 && indent < commonIndent) commonIndent = indent;
	}
	return lines.map((line, i) => i === 0 ? line : line.slice(commonIndent)).slice((_firstNonEmptyLine2 = firstNonEmptyLine) !== null && _firstNonEmptyLine2 !== void 0 ? _firstNonEmptyLine2 : 0, lastNonEmptyLine + 1);
}
function leadingWhitespace(str) {
	let i = 0;
	while (i < str.length && isWhiteSpace(str.charCodeAt(i))) ++i;
	return i;
}
/**
* @internal
*/
function isPrintableAsBlockString(value) {
	if (value === "") return true;
	let isEmptyLine = true;
	let hasIndent = false;
	let hasCommonIndent = true;
	let seenNonEmptyLine = false;
	for (let i = 0; i < value.length; ++i) switch (value.codePointAt(i)) {
		case 0:
		case 1:
		case 2:
		case 3:
		case 4:
		case 5:
		case 6:
		case 7:
		case 8:
		case 11:
		case 12:
		case 14:
		case 15: return false;
		case 13: return false;
		case 10:
			if (isEmptyLine && !seenNonEmptyLine) return false;
			seenNonEmptyLine = true;
			isEmptyLine = true;
			hasIndent = false;
			break;
		case 9:
		case 32:
			hasIndent || (hasIndent = isEmptyLine);
			break;
		default:
			hasCommonIndent && (hasCommonIndent = hasIndent);
			isEmptyLine = false;
	}
	if (isEmptyLine) return false;
	if (hasCommonIndent && seenNonEmptyLine) return false;
	return true;
}
/**
* Print a block string in the indented block form by adding a leading and
* trailing blank line. However, if a block string starts with whitespace and is
* a single-line, adding a leading blank line would strip that whitespace.
*
* @internal
*/
function printBlockString(value, options) {
	const escapedValue = value.replace(/"""/g, "\\\"\"\"");
	const lines = escapedValue.split(/\r\n|[\n\r]/g);
	const isSingleLine = lines.length === 1;
	const forceLeadingNewLine = lines.length > 1 && lines.slice(1).every((line) => line.length === 0 || isWhiteSpace(line.charCodeAt(0)));
	const hasTrailingTripleQuotes = escapedValue.endsWith("\\\"\"\"");
	const hasTrailingQuote = value.endsWith("\"") && !hasTrailingTripleQuotes;
	const hasTrailingSlash = value.endsWith("\\");
	const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash;
	const printAsMultipleLines = !(options !== null && options !== void 0 && options.minimize) && (!isSingleLine || value.length > 70 || forceTrailingNewline || forceLeadingNewLine || hasTrailingTripleQuotes);
	let result = "";
	const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0));
	if (printAsMultipleLines && !skipLeadingNewLine || forceLeadingNewLine) result += "\n";
	result += escapedValue;
	if (printAsMultipleLines || forceTrailingNewline) result += "\n";
	return "\"\"\"" + result + "\"\"\"";
}
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/language/tokenKind.mjs
/**
* An exported enum describing the different kinds of tokens that the
* lexer emits.
*/
var TokenKind;
(function(TokenKind) {
	TokenKind["SOF"] = "<SOF>";
	TokenKind["EOF"] = "<EOF>";
	TokenKind["BANG"] = "!";
	TokenKind["DOLLAR"] = "$";
	TokenKind["AMP"] = "&";
	TokenKind["PAREN_L"] = "(";
	TokenKind["PAREN_R"] = ")";
	TokenKind["DOT"] = ".";
	TokenKind["SPREAD"] = "...";
	TokenKind["COLON"] = ":";
	TokenKind["EQUALS"] = "=";
	TokenKind["AT"] = "@";
	TokenKind["BRACKET_L"] = "[";
	TokenKind["BRACKET_R"] = "]";
	TokenKind["BRACE_L"] = "{";
	TokenKind["PIPE"] = "|";
	TokenKind["BRACE_R"] = "}";
	TokenKind["NAME"] = "Name";
	TokenKind["INT"] = "Int";
	TokenKind["FLOAT"] = "Float";
	TokenKind["STRING"] = "String";
	TokenKind["BLOCK_STRING"] = "BlockString";
	TokenKind["COMMENT"] = "Comment";
})(TokenKind || (TokenKind = {}));
/**
* The enum type representing the token kinds values.
*
* @deprecated Please use `TokenKind`. Will be remove in v17.
*/
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/language/lexer.mjs
/**
* A Lexer interface which provides common properties and methods required for
* lexing GraphQL source.
*
* @internal
*/
/**
* Given a Source object, creates a Lexer for that source.
* A Lexer is a stateful stream generator in that every time
* it is advanced, it returns the next token in the Source. Assuming the
* source lexes, the final Token emitted by the lexer will be of kind
* EOF, after which the lexer will repeatedly return the same EOF token
* whenever called.
*/
var Lexer = class {
	/**
	* The previously focused non-ignored token.
	*/
	/**
	* The currently focused non-ignored token.
	*/
	/**
	* The (1-indexed) line containing the current token.
	*/
	/**
	* The character offset at which the current line begins.
	*/
	constructor(source) {
		const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);
		this.source = source;
		this.lastToken = startOfFileToken;
		this.token = startOfFileToken;
		this.line = 1;
		this.lineStart = 0;
	}
	get [Symbol.toStringTag]() {
		return "Lexer";
	}
	/**
	* Advances the token stream to the next non-ignored token.
	*/
	advance() {
		this.lastToken = this.token;
		return this.token = this.lookahead();
	}
	/**
	* Looks ahead and returns the next non-ignored token, but does not change
	* the state of Lexer.
	*/
	lookahead() {
		let token = this.token;
		if (token.kind !== TokenKind.EOF) do
			if (token.next) token = token.next;
			else {
				const nextToken = readNextToken(this, token.end);
				token.next = nextToken;
				nextToken.prev = token;
				token = nextToken;
			}
		while (token.kind === TokenKind.COMMENT);
		return token;
	}
};
/**
* @internal
*/
function isPunctuatorTokenKind(kind) {
	return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.DOT || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R;
}
/**
* A Unicode scalar value is any Unicode code point except surrogate code
* points. In other words, the inclusive ranges of values 0x0000 to 0xD7FF and
* 0xE000 to 0x10FFFF.
*
* SourceCharacter ::
*   - "Any Unicode scalar value"
*/
function isUnicodeScalarValue(code) {
	return code >= 0 && code <= 55295 || code >= 57344 && code <= 1114111;
}
/**
* The GraphQL specification defines source text as a sequence of unicode scalar
* values (which Unicode defines to exclude surrogate code points). However
* JavaScript defines strings as a sequence of UTF-16 code units which may
* include surrogates. A surrogate pair is a valid source character as it
* encodes a supplementary code point (above U+FFFF), but unpaired surrogate
* code points are not valid source characters.
*/
function isSupplementaryCodePoint(body, location) {
	return isLeadingSurrogate(body.charCodeAt(location)) && isTrailingSurrogate(body.charCodeAt(location + 1));
}
function isLeadingSurrogate(code) {
	return code >= 55296 && code <= 56319;
}
function isTrailingSurrogate(code) {
	return code >= 56320 && code <= 57343;
}
/**
* Prints the code point (or end of file reference) at a given location in a
* source for use in error messages.
*
* Printable ASCII is printed quoted, while other points are printed in Unicode
* code point form (ie. U+1234).
*
* @internal
*/
function printCodePointAt(lexer, location) {
	const code = lexer.source.body.codePointAt(location);
	if (code === void 0) return TokenKind.EOF;
	else if (code >= 32 && code <= 126) {
		const char = String.fromCodePoint(code);
		return char === "\"" ? "'\"'" : `"${char}"`;
	}
	return "U+" + code.toString(16).toUpperCase().padStart(4, "0");
}
/**
* Create a token with line and column location information.
*
* @internal
*/
function createToken(lexer, kind, start, end, value) {
	const line = lexer.line;
	return new Token(kind, start, end, line, 1 + start - lexer.lineStart, value);
}
/**
* Gets the next token from the source starting at the given position.
*
* This skips over whitespace until it finds the next lexable token, then lexes
* punctuators immediately or calls the appropriate helper function for more
* complicated tokens.
*/
function readNextToken(lexer, start) {
	const body = lexer.source.body;
	const bodyLength = body.length;
	let position = start;
	while (position < bodyLength) {
		const code = body.charCodeAt(position);
		switch (code) {
			case 65279:
			case 9:
			case 32:
			case 44:
				++position;
				continue;
			case 10:
				++position;
				++lexer.line;
				lexer.lineStart = position;
				continue;
			case 13:
				if (body.charCodeAt(position + 1) === 10) position += 2;
				else ++position;
				++lexer.line;
				lexer.lineStart = position;
				continue;
			case 35: return readComment(lexer, position);
			case 33: return createToken(lexer, TokenKind.BANG, position, position + 1);
			case 36: return createToken(lexer, TokenKind.DOLLAR, position, position + 1);
			case 38: return createToken(lexer, TokenKind.AMP, position, position + 1);
			case 40: return createToken(lexer, TokenKind.PAREN_L, position, position + 1);
			case 41: return createToken(lexer, TokenKind.PAREN_R, position, position + 1);
			case 46:
				if (body.charCodeAt(position + 1) === 46 && body.charCodeAt(position + 2) === 46) return createToken(lexer, TokenKind.SPREAD, position, position + 3);
				break;
			case 58: return createToken(lexer, TokenKind.COLON, position, position + 1);
			case 61: return createToken(lexer, TokenKind.EQUALS, position, position + 1);
			case 64: return createToken(lexer, TokenKind.AT, position, position + 1);
			case 91: return createToken(lexer, TokenKind.BRACKET_L, position, position + 1);
			case 93: return createToken(lexer, TokenKind.BRACKET_R, position, position + 1);
			case 123: return createToken(lexer, TokenKind.BRACE_L, position, position + 1);
			case 124: return createToken(lexer, TokenKind.PIPE, position, position + 1);
			case 125: return createToken(lexer, TokenKind.BRACE_R, position, position + 1);
			case 34:
				if (body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) return readBlockString(lexer, position);
				return readString(lexer, position);
		}
		if (isDigit(code) || code === 45) return readNumber(lexer, position, code);
		if (isNameStart(code)) return readName(lexer, position);
		throw syntaxError(lexer.source, position, code === 39 ? "Unexpected single quote character ('), did you mean to use a double quote (\")?" : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position) ? `Unexpected character: ${printCodePointAt(lexer, position)}.` : `Invalid character: ${printCodePointAt(lexer, position)}.`);
	}
	return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength);
}
/**
* Reads a comment token from the source file.
*
* ```
* Comment :: # CommentChar* [lookahead != CommentChar]
*
* CommentChar :: SourceCharacter but not LineTerminator
* ```
*/
function readComment(lexer, start) {
	const body = lexer.source.body;
	const bodyLength = body.length;
	let position = start + 1;
	while (position < bodyLength) {
		const code = body.charCodeAt(position);
		if (code === 10 || code === 13) break;
		if (isUnicodeScalarValue(code)) ++position;
		else if (isSupplementaryCodePoint(body, position)) position += 2;
		else break;
	}
	return createToken(lexer, TokenKind.COMMENT, start, position, body.slice(start + 1, position));
}
/**
* Reads a number token from the source file, either a FloatValue or an IntValue
* depending on whether a FractionalPart or ExponentPart is encountered.
*
* ```
* IntValue :: IntegerPart [lookahead != {Digit, `.`, NameStart}]
*
* IntegerPart ::
*   - NegativeSign? 0
*   - NegativeSign? NonZeroDigit Digit*
*
* NegativeSign :: -
*
* NonZeroDigit :: Digit but not `0`
*
* FloatValue ::
*   - IntegerPart FractionalPart ExponentPart [lookahead != {Digit, `.`, NameStart}]
*   - IntegerPart FractionalPart [lookahead != {Digit, `.`, NameStart}]
*   - IntegerPart ExponentPart [lookahead != {Digit, `.`, NameStart}]
*
* FractionalPart :: . Digit+
*
* ExponentPart :: ExponentIndicator Sign? Digit+
*
* ExponentIndicator :: one of `e` `E`
*
* Sign :: one of + -
* ```
*/
function readNumber(lexer, start, firstCode) {
	const body = lexer.source.body;
	let position = start;
	let code = firstCode;
	let isFloat = false;
	if (code === 45) code = body.charCodeAt(++position);
	if (code === 48) {
		code = body.charCodeAt(++position);
		if (isDigit(code)) throw syntaxError(lexer.source, position, `Invalid number, unexpected digit after 0: ${printCodePointAt(lexer, position)}.`);
	} else {
		position = readDigits(lexer, position, code);
		code = body.charCodeAt(position);
	}
	if (code === 46) {
		isFloat = true;
		code = body.charCodeAt(++position);
		position = readDigits(lexer, position, code);
		code = body.charCodeAt(position);
	}
	if (code === 69 || code === 101) {
		isFloat = true;
		code = body.charCodeAt(++position);
		if (code === 43 || code === 45) code = body.charCodeAt(++position);
		position = readDigits(lexer, position, code);
		code = body.charCodeAt(position);
	}
	if (code === 46 || isNameStart(code)) throw syntaxError(lexer.source, position, `Invalid number, expected digit but got: ${printCodePointAt(lexer, position)}.`);
	return createToken(lexer, isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, body.slice(start, position));
}
/**
* Returns the new position in the source after reading one or more digits.
*/
function readDigits(lexer, start, firstCode) {
	if (!isDigit(firstCode)) throw syntaxError(lexer.source, start, `Invalid number, expected digit but got: ${printCodePointAt(lexer, start)}.`);
	const body = lexer.source.body;
	let position = start + 1;
	while (isDigit(body.charCodeAt(position))) ++position;
	return position;
}
/**
* Reads a single-quote string token from the source file.
*
* ```
* StringValue ::
*   - `""` [lookahead != `"`]
*   - `"` StringCharacter+ `"`
*
* StringCharacter ::
*   - SourceCharacter but not `"` or `\` or LineTerminator
*   - `\u` EscapedUnicode
*   - `\` EscapedCharacter
*
* EscapedUnicode ::
*   - `{` HexDigit+ `}`
*   - HexDigit HexDigit HexDigit HexDigit
*
* EscapedCharacter :: one of `"` `\` `/` `b` `f` `n` `r` `t`
* ```
*/
function readString(lexer, start) {
	const body = lexer.source.body;
	const bodyLength = body.length;
	let position = start + 1;
	let chunkStart = position;
	let value = "";
	while (position < bodyLength) {
		const code = body.charCodeAt(position);
		if (code === 34) {
			value += body.slice(chunkStart, position);
			return createToken(lexer, TokenKind.STRING, start, position + 1, value);
		}
		if (code === 92) {
			value += body.slice(chunkStart, position);
			const escape = body.charCodeAt(position + 1) === 117 ? body.charCodeAt(position + 2) === 123 ? readEscapedUnicodeVariableWidth(lexer, position) : readEscapedUnicodeFixedWidth(lexer, position) : readEscapedCharacter(lexer, position);
			value += escape.value;
			position += escape.size;
			chunkStart = position;
			continue;
		}
		if (code === 10 || code === 13) break;
		if (isUnicodeScalarValue(code)) ++position;
		else if (isSupplementaryCodePoint(body, position)) position += 2;
		else throw syntaxError(lexer.source, position, `Invalid character within String: ${printCodePointAt(lexer, position)}.`);
	}
	throw syntaxError(lexer.source, position, "Unterminated string.");
}
function readEscapedUnicodeVariableWidth(lexer, position) {
	const body = lexer.source.body;
	let point = 0;
	let size = 3;
	while (size < 12) {
		const code = body.charCodeAt(position + size++);
		if (code === 125) {
			if (size < 5 || !isUnicodeScalarValue(point)) break;
			return {
				value: String.fromCodePoint(point),
				size
			};
		}
		point = point << 4 | readHexDigit(code);
		if (point < 0) break;
	}
	throw syntaxError(lexer.source, position, `Invalid Unicode escape sequence: "${body.slice(position, position + size)}".`);
}
function readEscapedUnicodeFixedWidth(lexer, position) {
	const body = lexer.source.body;
	const code = read16BitHexCode(body, position + 2);
	if (isUnicodeScalarValue(code)) return {
		value: String.fromCodePoint(code),
		size: 6
	};
	if (isLeadingSurrogate(code)) {
		if (body.charCodeAt(position + 6) === 92 && body.charCodeAt(position + 7) === 117) {
			const trailingCode = read16BitHexCode(body, position + 8);
			if (isTrailingSurrogate(trailingCode)) return {
				value: String.fromCodePoint(code, trailingCode),
				size: 12
			};
		}
	}
	throw syntaxError(lexer.source, position, `Invalid Unicode escape sequence: "${body.slice(position, position + 6)}".`);
}
/**
* Reads four hexadecimal characters and returns the positive integer that 16bit
* hexadecimal string represents. For example, "000f" will return 15, and "dead"
* will return 57005.
*
* Returns a negative number if any char was not a valid hexadecimal digit.
*/
function read16BitHexCode(body, position) {
	return readHexDigit(body.charCodeAt(position)) << 12 | readHexDigit(body.charCodeAt(position + 1)) << 8 | readHexDigit(body.charCodeAt(position + 2)) << 4 | readHexDigit(body.charCodeAt(position + 3));
}
/**
* Reads a hexadecimal character and returns its positive integer value (0-15).
*
* '0' becomes 0, '9' becomes 9
* 'A' becomes 10, 'F' becomes 15
* 'a' becomes 10, 'f' becomes 15
*
* Returns -1 if the provided character code was not a valid hexadecimal digit.
*
* HexDigit :: one of
*   - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`
*   - `A` `B` `C` `D` `E` `F`
*   - `a` `b` `c` `d` `e` `f`
*/
function readHexDigit(code) {
	return code >= 48 && code <= 57 ? code - 48 : code >= 65 && code <= 70 ? code - 55 : code >= 97 && code <= 102 ? code - 87 : -1;
}
/**
* | Escaped Character | Code Point | Character Name               |
* | ----------------- | ---------- | ---------------------------- |
* | `"`               | U+0022     | double quote                 |
* | `\`               | U+005C     | reverse solidus (back slash) |
* | `/`               | U+002F     | solidus (forward slash)      |
* | `b`               | U+0008     | backspace                    |
* | `f`               | U+000C     | form feed                    |
* | `n`               | U+000A     | line feed (new line)         |
* | `r`               | U+000D     | carriage return              |
* | `t`               | U+0009     | horizontal tab               |
*/
function readEscapedCharacter(lexer, position) {
	const body = lexer.source.body;
	switch (body.charCodeAt(position + 1)) {
		case 34: return {
			value: "\"",
			size: 2
		};
		case 92: return {
			value: "\\",
			size: 2
		};
		case 47: return {
			value: "/",
			size: 2
		};
		case 98: return {
			value: "\b",
			size: 2
		};
		case 102: return {
			value: "\f",
			size: 2
		};
		case 110: return {
			value: "\n",
			size: 2
		};
		case 114: return {
			value: "\r",
			size: 2
		};
		case 116: return {
			value: "	",
			size: 2
		};
	}
	throw syntaxError(lexer.source, position, `Invalid character escape sequence: "${body.slice(position, position + 2)}".`);
}
/**
* Reads a block string token from the source file.
*
* ```
* StringValue ::
*   - `"""` BlockStringCharacter* `"""`
*
* BlockStringCharacter ::
*   - SourceCharacter but not `"""` or `\"""`
*   - `\"""`
* ```
*/
function readBlockString(lexer, start) {
	const body = lexer.source.body;
	const bodyLength = body.length;
	let lineStart = lexer.lineStart;
	let position = start + 3;
	let chunkStart = position;
	let currentLine = "";
	const blockLines = [];
	while (position < bodyLength) {
		const code = body.charCodeAt(position);
		if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {
			currentLine += body.slice(chunkStart, position);
			blockLines.push(currentLine);
			const token = createToken(lexer, TokenKind.BLOCK_STRING, start, position + 3, dedentBlockStringLines(blockLines).join("\n"));
			lexer.line += blockLines.length - 1;
			lexer.lineStart = lineStart;
			return token;
		}
		if (code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {
			currentLine += body.slice(chunkStart, position);
			chunkStart = position + 1;
			position += 4;
			continue;
		}
		if (code === 10 || code === 13) {
			currentLine += body.slice(chunkStart, position);
			blockLines.push(currentLine);
			if (code === 13 && body.charCodeAt(position + 1) === 10) position += 2;
			else ++position;
			currentLine = "";
			chunkStart = position;
			lineStart = position;
			continue;
		}
		if (isUnicodeScalarValue(code)) ++position;
		else if (isSupplementaryCodePoint(body, position)) position += 2;
		else throw syntaxError(lexer.source, position, `Invalid character within String: ${printCodePointAt(lexer, position)}.`);
	}
	throw syntaxError(lexer.source, position, "Unterminated string.");
}
/**
* Reads an alphanumeric + underscore name from the source.
*
* ```
* Name ::
*   - NameStart NameContinue* [lookahead != NameContinue]
* ```
*
* @internal
*/
function readName(lexer, start) {
	const body = lexer.source.body;
	const bodyLength = body.length;
	let position = start + 1;
	while (position < bodyLength) if (isNameContinue(body.charCodeAt(position))) ++position;
	else break;
	return createToken(lexer, TokenKind.NAME, start, position, body.slice(start, position));
}
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/jsutils/inspect.mjs
const MAX_ARRAY_LENGTH = 10;
const MAX_RECURSIVE_DEPTH = 2;
/**
* Used to print values in error messages.
*/
function inspect(value) {
	return formatValue(value, []);
}
function formatValue(value, seenValues) {
	switch (typeof value) {
		case "string": return JSON.stringify(value);
		case "function": return value.name ? `[function ${value.name}]` : "[function]";
		case "object": return formatObjectValue(value, seenValues);
		default: return String(value);
	}
}
function formatObjectValue(value, previouslySeenValues) {
	if (value === null) return "null";
	if (previouslySeenValues.includes(value)) return "[Circular]";
	const seenValues = [...previouslySeenValues, value];
	if (isJSONable(value)) {
		const jsonValue = value.toJSON();
		if (jsonValue !== value) return typeof jsonValue === "string" ? jsonValue : formatValue(jsonValue, seenValues);
	} else if (Array.isArray(value)) return formatArray(value, seenValues);
	return formatObject(value, seenValues);
}
function isJSONable(value) {
	return typeof value.toJSON === "function";
}
function formatObject(object, seenValues) {
	const entries = Object.entries(object);
	if (entries.length === 0) return "{}";
	if (seenValues.length > MAX_RECURSIVE_DEPTH) return "[" + getObjectTag(object) + "]";
	return "{ " + entries.map(([key, value]) => key + ": " + formatValue(value, seenValues)).join(", ") + " }";
}
function formatArray(array, seenValues) {
	if (array.length === 0) return "[]";
	if (seenValues.length > MAX_RECURSIVE_DEPTH) return "[Array]";
	const len = Math.min(MAX_ARRAY_LENGTH, array.length);
	const remaining = array.length - len;
	const items = [];
	for (let i = 0; i < len; ++i) items.push(formatValue(array[i], seenValues));
	if (remaining === 1) items.push("... 1 more item");
	else if (remaining > 1) items.push(`... ${remaining} more items`);
	return "[" + items.join(", ") + "]";
}
function getObjectTag(object) {
	const tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, "");
	if (tag === "Object" && typeof object.constructor === "function") {
		const name = object.constructor.name;
		if (typeof name === "string" && name !== "") return name;
	}
	return tag;
}
/**
* A replacement for instanceof which includes an error warning when multi-realm
* constructors are detected.
* See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production
* See: https://webpack.js.org/guides/production/
*/
const instanceOf = globalThis.process && true ? function instanceOf(value, constructor) {
	return value instanceof constructor;
} : function instanceOf(value, constructor) {
	if (value instanceof constructor) return true;
	if (typeof value === "object" && value !== null) {
		var _value$constructor;
		const className = constructor.prototype[Symbol.toStringTag];
		if (className === (Symbol.toStringTag in value ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name)) {
			const stringifiedValue = inspect(value);
			throw new Error(`Cannot use ${className} "${stringifiedValue}" from another module or realm.

Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.

https://yarnpkg.com/en/docs/selective-version-resolutions

Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.`);
		}
	}
	return false;
};
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/language/source.mjs
/**
* A representation of source input to GraphQL. The `name` and `locationOffset` parameters are
* optional, but they are useful for clients who store GraphQL documents in source files.
* For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might
* be useful for `name` to be `"Foo.graphql"` and location to be `{ line: 40, column: 1 }`.
* The `line` and `column` properties in `locationOffset` are 1-indexed.
*/
var Source = class {
	constructor(body, name = "GraphQL request", locationOffset = {
		line: 1,
		column: 1
	}) {
		typeof body === "string" || devAssert(false, `Body must be a string. Received: ${inspect(body)}.`);
		this.body = body;
		this.name = name;
		this.locationOffset = locationOffset;
		this.locationOffset.line > 0 || devAssert(false, "line in locationOffset is 1-indexed and must be positive.");
		this.locationOffset.column > 0 || devAssert(false, "column in locationOffset is 1-indexed and must be positive.");
	}
	get [Symbol.toStringTag]() {
		return "Source";
	}
};
/**
* Test if the given value is a Source object.
*
* @internal
*/
function isSource(source) {
	return instanceOf(source, Source);
}
//#endregion
//#region ../../node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/language/parser.mjs
/**
* Configuration options to control parser behavior
*/
/**
* Given a GraphQL source, parses it into a Document.
* Throws GraphQLError if a syntax error is encountered.
*/
function parse(source, options) {
	const parser = new Parser(source, options);
	const document = parser.parseDocument();
	Object.defineProperty(document, "tokenCount", {
		enumerable: false,
		value: parser.tokenCount
	});
	return document;
}
/**
* This class is exported only to assist people in implementing their own parsers
* without duplicating too much code and should be used only as last resort for cases
* such as experimental syntax or if certain features could not be contributed upstream.
*
* It is still part of the internal API and is versioned, so any changes to it are never
* considered breaking changes. If you still need to support multiple versions of the
* library, please use the `versionInfo` variable for version detection.
*
* @internal
*/
var Parser = class {
	constructor(source, options = {}) {
		const { lexer, ..._options } = options;
		if (lexer) this._lexer = lexer;
		else this._lexer = new Lexer(isSource(source) ? source : new Source(source));
		this._options = _options;
		this._tokenCounter = 0;
	}
	get tokenCount() {
		return this._tokenCounter;
	}
	/**
	* Converts a name lex token into a name parse node.
	*/
	parseName() {
		const token = this.expectToken(TokenKind.NAME);
		return this.node(token, {
			kind: Kind.NAME,
			value: token.value
		});
	}
	/**
	* Document : Definition+
	*/
	parseDocument() {
		return this.node(this._lexer.token, {
			kind: Kind.DOCUMENT,
			definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF)
		});
	}
	/**
	* Definition :
	*   - ExecutableDefinition
	*   - TypeSystemDefinition
	*   - TypeSystemExtension
	*
	* ExecutableDefinition :
	*   - OperationDefinition
	*   - FragmentDefinition
	*
	* TypeSystemDefinition :
	*   - SchemaDefinition
	*   - TypeDefinition
	*   - DirectiveDefinition
	*
	* TypeDefinition :
	*   - ScalarTypeDefinition
	*   - ObjectTypeDefinition
	*   - InterfaceTypeDefinition
	*   - UnionTypeDefinition
	*   - EnumTypeDefinition
	*   - InputObjectTypeDefinition
	*/
	parseDefinition() {
		if (this.peek(TokenKind.BRACE_L)) return this.parseOperationDefinition();
		const hasDescription = this.peekDescription();
		const keywordToken = hasDescription ? this._lexer.lookahead() : this._lexer.token;
		if (hasDescription && keywordToken.kind === TokenKind.BRACE_L) throw syntaxError(this._lexer.source, this._lexer.token.start, "Unexpected description, descriptions are not supported on shorthand queries.");
		if (keywordToken.kind === TokenKind.NAME) {
			switch (keywordToken.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();
			}
			switch (keywordToken.value) {
				case "query":
				case "mutation":
				case "subscription": return this.parseOperationDefinition();
				case "fragment": return this.parseFragmentDefinition();
			}
			if (hasDescription) throw syntaxError(this._lexer.source, this._lexer.token.start, "Unexpected description, only GraphQL definitions support descriptions.");
			switch (keywordToken.value) {
				case "extend": return this.parseTypeSystemExtension();
			}
		}
		throw this.unexpected(keywordToken);
	}
	/**
	* OperationDefinition :
	*  - SelectionSet
	*  - OperationType Name? VariableDefinitions? Directives? SelectionSet
	*/
	parseOperationDefinition() {
		const start = this._lexer.token;
		if (this.peek(TokenKind.BRACE_L)) return this.node(start, {
			kind: Kind.OPERATION_DEFINITION,
			operation: OperationTypeNode.QUERY,
			description: void 0,
			name: void 0,
			variableDefinitions: [],
			directives: [],
			selectionSet: this.parseSelectionSet()
		});
		const description = this.parseDescription();
		const operation = this.parseOperationType();
		let name;
		if (this.peek(TokenKind.NAME)) name = this.parseName();
		return this.node(start, {
			kind: Kind.OPERATION_DEFINITION,
			operation,
			description,
			name,
			variableDefinitions: this.parseVariableDefinitions(),
			directives: this.parseDirectives(false),
			selectionSet: this.parseSelectionSet()
		});
	}
	/**
	* OperationType : one of query mutation subscription
	*/
	parseOperationType() {
		const operationToken = this.expectToken(TokenKind.NAME);
		switch (operationToken.value) {
			case "query": return OperationTypeNode.QUERY;
			case "mutation": return OperationTypeNode.MUTATION;
			case "subscription": return OperationTypeNode.SUBSCRIPTION;
		}
		throw this.unexpected(operationToken);
	}
	/**
	* VariableDefinitions : ( VariableDefinition+ )
	*/
	parseVariableDefinitions() {
		return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R);
	}
	/**
	* VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
	*/
	parseVariableDefinition() {
		return this.node(this._lexer.token, {
			kind: Kind.VARIABLE_DEFINITION,
			description: this.parseDescription(),
			variable: this.parseVariable(),
			type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),
			defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseConstValueLiteral() : void 0,
			directives: this.parseConstDirectives()
		});
	}
	/**
	* Variable : $ Name
	*/
	parseVariable() {
		const start = this._lexer.token;
		this.expectToken(TokenKind.DOLLAR);
		return this.node(start, {
			kind: Kind.VARIABLE,
			name: this.parseName()
		});
	}
	/**
	* ```
	* SelectionSet : { Selection+ }
	* ```
	*/
	parseSelectionSet() {
		return this.node(this._lexer.token, {
			kind: Kind.SELECTION_SET,
			selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R)
		});
	}
	/**
	* Selection :
	*   - Field
	*   - FragmentSpread
	*   - InlineFragment
	*/
	parseSelection() {
		return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();
	}
	/**
	* Field : Alias? Name Arguments? Directives? SelectionSet?
	*
	* Alias : Name :
	*/
	parseField() {
		const start = this._lexer.token;
		const nameOrAlias = this.parseName();
		let alias;
		let name;
		if (this.expectOptionalToken(TokenKind.COLON)) {
			alias = nameOrAlias;
			name = this.parseName();
		} else name = nameOrAlias;
		return this.node(start, {
			kind: Kind.FIELD,
			alias,
			name,
			arguments: this.parseArguments(false),
			directives: this.parseDirectives(false),
			selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : void 0
		});
	}
	/**
	* Arguments[Const] : ( Argument[?Const]+ )
	*/
	parseArguments(isConst) {
		const item = isConst ? this.parseConstArgument : this.parseArgument;
		return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);
	}
	/**
	* Argument[Const] : Name : Value[?Const]
	*/
	parseArgument(isConst = false) {
		const start = this._lexer.token;
		const name = this.parseName();
		this.expectToken(TokenKind.COLON);
		return this.node(start, {
			kind: Kind.ARGUMENT,
			name,
			value: this.parseValueLiteral(isConst)
		});
	}
	parseConstArgument() {
		return this.parseArgument(true);
	}
	/**
	* Corresponds to both FragmentSpread and InlineFragment in the spec.
	*
	* FragmentSpread : ... FragmentName Directives?
	*
	* InlineFragment : ... TypeCondition? Directives? SelectionSet
	*/
	parseFragment() {
		const start = this._lexer.token;
		this.expectToken(TokenKind.SPREAD);
		const hasTypeCondition = this.expectOptionalKeyword("on");
		if (!hasTypeCondition && this.peek(TokenKind.NAME)) return this.node(start, {
			kind: Kind.FRAGMENT_SPREAD,
			name: this.parseFragmentName(),
			directives: this.parseDirectives(false)
		});
		return this.node(start, {
			kind: Kind.INLINE_FRAGMENT,
			typeCondition: hasTypeCondition ? this.parseNamedType() : void 0,
			directives: this.parseDirectives(false),
			selectionSet: this.parseSelectionSet()
		});
	}
	/**
	* FragmentDefinition :
	*   - fragment FragmentName on TypeCondition Directives? SelectionSet
	*
	* TypeCondition : NamedType
	*/
	parseFragmentDefinition() {
		const start = this._lexer.token;
		const description = this.parseDescription();
		this.expectKeyword("fragment");
		if (this._options.allowLegacyFragmentVariables === true) return this.node(start, {
			kind: Kind.FRAGMENT_DEFINITION,
			description,
			name: this.parseFragmentName(),
			variableDefinitions: this.parseVariableDefinitions(),
			typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
			directives: this.parseDirectives(false),
			selectionSet: this.parseSelectionSet()
		});
		return this.node(start, {
			kind: Kind.FRAGMENT_DEFINITION,
			description,
			name: this.parseFragmentName(),
			typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
			directives: this.parseDirectives(false),
			selectionSet: this.parseSelectionSet()
		});
	}
	/**
	* FragmentName : Name but not `on`
	*/
	parseFragmentName() {
		if (this._lexer.token.value === "on") throw this.unexpected();
		return this.parseName();
	}
	/**
	* Value[Const] :
	*   - [~Const] Variable
	*   - IntValue
	*   - FloatValue
	*   - StringValue
	*   - BooleanValue
	*   - NullValue
	*   - EnumValue
	*   - ListValue[?Const]
	*   - ObjectValue[?Const]
	*
	* BooleanValue : one of `true` `false`
	*
	* NullValue : `null`
	*
	* EnumValue : Name but not `true`, `false` or `null`
	*/
	parseValueLiteral(isConst) {
		const token = this._lexer.token;
		switch (token.kind) {
			case TokenKind.BRACKET_L: return this.parseList(isConst);
			case TokenKind.BRACE_L: return this.parseObject(isConst);
			case TokenKind.INT:
				this.advanceLexer();
				return this.node(token, {
					kind: Kind.INT,
					value: token.value
				});
			case TokenKind.FLOAT:
				this.advanceLexer();
				return this.node(token, {
					kind: Kind.FLOAT,
					value: token.value
				});
			case TokenKind.STRING:
			case TokenKind.BLOCK_STRING: return this.parseStringLiteral();
			case TokenKind.NAME:
				this.advanceLexer();
				switch (token.value) {
					case "true": return this.node(token, {
						kind: Kind.BOOLEAN,
						value: true
					});
					case "false": return this.node(token, {
						kind: Kind.BOOLEAN,
						value: false
					});
					case "null": return this.node(token, { kind: Kind.NULL });
					default: return this.node(token, {
						kind: Kind.ENUM,
						value: token.value
					});
				}
			case TokenKind.DOLLAR:
				if (isConst) {
					this.expectToken(TokenKind.DOLLAR);
					if (this._lexer.token.kind === TokenKind.NAME) {
						const varName = this._lexer.token.value;
						throw syntaxError(this._lexer.source, token.start, `Unexpected variable "$${varName}" in constant value.`);
					} else throw this.unexpected(token);
				}
				return this.parseVariable();
			default: throw this.unexpected();
		}
	}
	parseConstValueLiteral() {
		return this.parseValueLiteral(true);
	}
	parseStringLiteral() {
		const token = this._lexer.token;
		this.advanceLexer();
		return this.node(token, {
			kind: Kind.STRING,
			value: token.value,
			block: token.kind === TokenKind.BLOCK_STRING
		});
	}
	/**
	* ListValue[Const] :
	*   - [ ]
	*   - [ Value[?Const]+ ]
	*/
	parseList(isConst) {
		const item = () => this.parseValueLiteral(isConst);
		return this.node(this._lexer.token, {
			kind: Kind.LIST,
			values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R)
		});
	}
	/**
	* ```
	* ObjectValue[Const] :
	*   - { }
	*   - { ObjectField[?Const]+ }
	* ```
	*/
	parseObject(isConst) {
		const item = () => this.parseObjectField(isConst);
		return this.node(this._lexer.token, {
			kind: Kind.OBJECT,
			fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R)
		});
	}
	/**
	* ObjectField[Const] : Name : Value[?Const]
	*/
	parseObjectField(isConst) {
		const start = this._lexer.token;
		const name = this.parseName();
		this.expectToken(TokenKind.COLON);
		return this.node(start, {
			kind: Kind.OBJECT_FIELD,
			name,
			value: this.parseValueLiteral(isConst)
		});
	}
	/**
	* Directives[Const] : Directive[?Const]+
	*/
	parseDirectives(isConst) {
		const directives = [];
		while (this.peek(TokenKind.AT)) directives.push(this.parseDirective(isConst));
		return directives;
	}
	parseConstDirectives() {
		return this.parseDirectives(true);
	}
	/**
	* ```
	* Directive[Const] : @ Name Arguments[?Const]?
	* ```
	*/
	parseDirective(isConst) {
		const start = this._lexer.token;
		this.expectToken(TokenKind.AT);
		return this.node(start, {
			kind: Kind.DIRECTIVE,
			name: this.parseName(),
			arguments: this.parseArguments(isConst)
		});
	}
	/**
	* Type :
	*   - NamedType
	*   - ListType
	*   - NonNullType
	*/
	parseTypeReference() {
		const start = this._lexer.token;
		let type;
		if (this.expectOptionalToken(TokenKind.BRACKET_L)) {
			const innerType = this.parseTypeReference();
			this.expectToken(TokenKind.BRACKET_R);
			type = this.node(start, {
				kind: Kind.LIST_TYPE,
				type: innerType
			});
		} else type = this.parseNamedType();
		if (this.expectOptionalToken(TokenKind.BANG)) return this.node(start, {
			kind: Kind.NON_NULL_TYPE,
			type
		});
		return type;
	}
	/**
	* NamedType : Name
	*/
	parseNamedType() {
		return this.node(this._lexer.token, {
			kind: Kind.NAMED_TYPE,
			name: this.parseName()
		});
	}
	peekDescription() {
		return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);
	}
	/**
	* Description : StringValue
	*/
	parseDescription() {
		if (this.peekDescription()) return this.parseStringLiteral();
	}
	/**
	* ```
	* SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }
	* ```
	*/
	parseSchemaDefinition() {
		const start = this._lexer.token;
		const description = this.parseDescription();
		this.expectKeyword("schema");
		const directives = this.parseConstDirectives();
		const operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);
		return this.node(start, {
			kind: Kind.SCHEMA_DEFINITION,
			description,
			directives,
			operationTypes
		});
	}
	/**
	* OperationTypeDefinition : OperationType : NamedType
	*/
	parseOperationTypeDefinition() {
		const start = this._lexer.token;
		const operation = this.parseOperationType();
		this.expectToken(TokenKind.COLON);
		const type = this.parseNamedType();
		return this.node(start, {
			kind: Kind.OPERATION_TYPE_DEFINITION,
			operation,
			type
		});
	}
	/**
	* ScalarTypeDefinition : Description? scalar Name Directives[Const]?
	*/
	parseScalarTypeDefinition() {
		const start = this._lexer.token;
		const description = this.parseDescription();
		this.expectKeyword("scalar");
		const name = this.parseName();
		const directives = this.parseConstDirectives();
		return this.node(start, {
			kind: Kind.SCALAR_TYPE_DEFINITION,
			description,
			name,
			directives
		});
	}
	/**
	* ObjectTypeDefinition :
	*   Description?
	*   type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
	*/
	parseObjectTypeDefinition() {
		const start = this._lexer.token;
		const description = this.parseDescription();
		this.expectKeyword("type");
		const name = this.parseName();
		const interfaces = this.parseImplementsInterfaces();
		const directives = this.parseConstDirectives();
		const fields = this.parseFieldsDefinition();
		return this.node(start, {
			kind: Kind.OBJECT_TYPE_DEFINITION,
			description,
			name,
			interfaces,
			directives,
			fields
		});
	}
	/**
	* ImplementsInterfaces :
	*   - implements `&`? NamedType
	*   - ImplementsInterfaces & NamedType
	*/
	parseImplementsInterfaces() {
		return this.expectOptionalKeyword("implements") ? this.delimitedMany(TokenKind.AMP, this.parseNamedType) : [];
	}
	/**
	* ```
	* FieldsDefinition : { FieldDefinition+ }
	* ```
	*/
	parseFieldsDefinition() {
		return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R);
	}
	/**
	* FieldDefinition :
	*   - Description? Name ArgumentsDefinition? : Type Directives[Const]?
	*/
	parseFieldDefinition() {
		const start = this._lexer.token;
		const description = this.parseDescription();
		const name = this.parseName();
		const args = this.parseArgumentDefs();
		this.expectToken(TokenKind.COLON);
		const type = this.parseTypeReference();
		const directives = this.parseConstDirectives();
		return this.node(start, {
			kind: Kind.FIELD_DEFINITION,
			description,
			name,
			arguments: args,
			type,
			directives
		});
	}
	/**
	* ArgumentsDefinition : ( InputValueDefinition+ )
	*/
	parseArgumentDefs() {
		return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R);
	}
	/**
	* InputValueDefinition :
	*   - Description? Name : Type DefaultValue? Directives[Const]?
	*/
	parseInputValueDef() {
		const start = this._lexer.token;
		const description = this.parseDescription();
		const name = this.parseName();
		this.expectToken(TokenKind.COLON);
		const type = this.parseTypeReference();
		let defaultValue;
		if (this.expectOptionalToken(TokenKind.EQUALS)) defaultValue = this.parseConstValueLiteral();
		const directives = this.parseConstDirectives();
		return this.node(start, {
			kind: Kind.INPUT_VALUE_DEFINITION,
			description,
			name,
			type,
			defaultValue,
			directives
		});
	}
	/**
	* InterfaceTypeDefinition :
	*   - Description? interface Name Directives[Const]? FieldsDefinition?
	*/
	parseInterfaceTypeDefinition() {
		const start = this._lexer.token;
		const description = this.parseDescription();
		this.expectKeyword("interface");
		const name = this.parseName();
		const interfaces = this.parseImplementsInterfaces();
		const directives = this.parseConstDirectives();
		const fields = this.parseFieldsDefinition();
		return this.node(start, {
			kind: Kind.INTERFACE_TYPE_DEFINITION,
			description,
			name,
			interfaces,
			directives,
			fields
		});
	}
	/**
	* UnionTypeDefinition :
	*   - Description? union Name Directives[Const]? UnionMemberTypes?
	*/
	parseUnionTypeDefinition() {
		const start = this._lexer.token;
		const description = this.parseDescription();
		this.expectKeyword("union");
		const name = this.parseName();
		const directives = this.parseConstDirectives();
		const types = this.parseUnionMemberTypes();
		return this.node(start, {
			kind: Kind.UNION_TYPE_DEFINITION,
			description,
			name,
			directives,
			types
		});
	}
	/**
	* UnionMemberTypes :
	*   - = `|`? NamedType
	*   - UnionMemberTypes | NamedType
	*/
	parseUnionMemberTypes() {
		return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];
	}
	/**
	* EnumTypeDefinition :
	*   - Description? enum Name Directives[Const]? EnumValuesDefinition?
	*/
	parseEnumTypeDefinition() {
		const start = this._lexer.token;
		const description = this.parseDescription();
		this.expectKeyword("enum");
		const name = this.parseName();
		const directives = this.parseConstDirectives();
		const values = this.parseEnumValuesDefinition();
		return this.node(start, {
			kind: Kind.ENUM_TYPE_DEFINITION,
			description,
			name,
			directives,
			values
		});
	}
	/**
	* ```
	* EnumValuesDefinition : { EnumValueDefinition+ }
	* ```
	*/
	parseEnumValuesDefinition() {
		return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R);
	}
	/**
	* EnumValueDefinition : Description? EnumValue Directives[Const]?
	*/
	parseEnumValueDefinition() {
		const start = this._lexer.token;
		const description = this.parseDescription();
		const name = this.parseEnumValueName();
		const directives = this.parseConstDirectives();
		return this.node(start, {
			kind: Kind.ENUM_VALUE_DEFINITION,
			description,
			name,
			directives
		});
	}
	/**
	* EnumValue : Name but not `true`, `false` or `null`
	*/
	parseEnumValueName() {
		if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") throw syntaxError(this._lexer.source, this._lexer.token.start, `${getTokenDesc(this._lexer.token)} is reserved and cannot be used for an enum value.`);
		return this.parseName();
	}
	/**
	* InputObjectTypeDefinition :
	*   - Description? input Name Directives[Const]? InputFieldsDefinition?
	*/
	parseInputObjectTypeDefinition() {
		const start = this._lexer.token;
		const description = this.parseDescription();
		this.expectKeyword("input");
		const name = this.parseName();
		const directives = this.parseConstDirectives();
		const fields = this.parseInputFieldsDefinition();
		return this.node(start, {
			kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,
			description,
			name,
			directives,
			fields
		});
	}
	/**
	* ```
	* InputFieldsDefinition : { InputValueDefinition+ }
	* ```
	*/
	parseInputFieldsDefinition() {
		return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R);
	}
	/**
	* TypeSystemExtension :
	*   - SchemaExtension
	*   - TypeExtension
	*
	* TypeExtension :
	*   - ScalarTypeExtension
	*   - ObjectTypeExtension
	*   - InterfaceTypeExtension
	*   - UnionTypeExtension
	*   - EnumTypeExtension
	*   - InputObjectTypeDefinition
	*/
	parseTypeSystemExtension() {
		const keywordToken = this._lexer.lookahead();
		if (keywordToken.kind === TokenKind.NAME) switch (keywordToken.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(keywordToken);
	}
	/**
	* ```
	* SchemaExtension :
	*  - extend schema Directives[Const]? { OperationTypeDefinition+ }
	*  - extend schema Directives[Const]
	* ```
	*/
	parseSchemaExtension() {
		const start = this._lexer.token;
		this.expectKeyword("extend");
		this.expectKeyword("schema");
		const directives = this.parseConstDirectives();
		const operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);
		if (directives.length === 0 && operationTypes.length === 0) throw this.unexpected();
		return this.node(start, {
			kind: Kind.SCHEMA_EXTENSION,
			directives,
			operationTypes
		});
	}
	/**
	* ScalarTypeExtension :
	*   - extend scalar Name Directives[Const]
	*/
	parseScalarTypeExtension() {
		const start = this._lexer.token;
		this.expectKeyword("extend");
		this.expectKeyword("scalar");
		const name = this.parseName();
		const directives = this.parseConstDirectives();
		if (directives.length === 0) throw this.unexpected();
		return this.node(start, {
			kind: Kind.SCALAR_TYPE_EXTENSION,
			name,
			directives
		});
	}
	/**
	* ObjectTypeExtension :
	*  - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
	*  - extend type Name ImplementsInterfaces? Directives[Const]
	*  - extend type Name ImplementsInterfaces
	*/
	parseObjectTypeExtension() {
		const start = this._lexer.token;
		this.expectKeyword("extend");
		this.expectKeyword("type");
		const name = this.parseName();
		const interfaces = this.parseImplementsInterfaces();
		const directives = this.parseConstDirectives();
		const fields = this.parseFieldsDefinition();
		if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) throw this.unexpected();
		return this.node(start, {
			kind: Kind.OBJECT_TYPE_EXTENSION,
			name,
			interfaces,
			directives,
			fields
		});
	}
	/**
	* InterfaceTypeExtension :
	*  - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
	*  - extend interface Name ImplementsInterfaces? Directives[Const]
	*  - extend interface Name ImplementsInterfaces
	*/
	parseInterfaceTypeExtension() {
		const start = this._lexer.token;
		this.expectKeyword("extend");
		this.expectKeyword("interface");
		const name = this.parseName();
		const interfaces = this.parseImplementsInterfaces();
		const directives = this.parseConstDirectives();
		const fields = this.parseFieldsDefinition();
		if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) throw this.unexpected();
		return this.node(start, {
			kind: Kind.INTERFACE_TYPE_EXTENSION,
			name,
			interfaces,
			directives,
			fields
		});
	}
	/**
	* UnionTypeExtension :
	*   - extend union Name Directives[Const]? UnionMemberTypes
	*   - extend union Name Directives[Const]
	*/
	parseUnionTypeExtension() {
		const start = this._lexer.token;
		this.expectKeyword("extend");
		this.expectKeyword("union");
		const name = this.parseName();
		const directives = this.parseConstDirectives();
		const types = this.parseUnionMemberTypes();
		if (directives.length === 0 && types.length === 0) throw this.unexpected();
		return this.node(start, {
			kind: Kind.UNION_TYPE_EXTENSION,
			name,
			directives,
			types
		});
	}
	/**
	* EnumTypeExtension :
	*   - extend enum Name Directives[Const]? EnumValuesDefinition
	*   - extend enum Name Directives[Const]
	*/
	parseEnumTypeExtension() {
		const start = this._lexer.token;
		this.expectKeyword("extend");
		this.expectKeyword("enum");
		const name = this.parseName();
		const directives = this.parseConstDirectives();
		const values = this.parseEnumValuesDefinition();
		if (directives.length === 0 && values.length === 0) throw this.unexpected();
		return this.node(start, {
			kind: Kind.ENUM_TYPE_EXTENSION,
			name,
			directives,
			values
		});
	}
	/**
	* InputObjectTypeExtension :
	*   - extend input Name Directives[Const]? InputFieldsDefinition
	*   - extend input Name Directives[Const]
	*/
	parseInputObjectTypeExtension() {
		const start = this._lexer.token;
		this.expectKeyword("extend");
		this.expectKeyword("input");
		const name = this.parseName();
		const directives = this.parseConstDirectives();
		const fields = this.parseInputFieldsDefinition();
		if (directives.length === 0 && fields.length === 0) throw this.unexpected();
		return this.node(start, {
			kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,
			name,
			directives,
			fields
		});
	}
	/**
	* ```
	* DirectiveDefinition :
	*   - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations
	* ```
	*/
	parseDirectiveDefinition() {
		const start = this._lexer.token;
		const description = this.parseDescription();
		this.expectKeyword("directive");
		this.expectToken(TokenKind.AT);
		const name = this.parseName();
		const args = this.parseArgumentDefs();
		const repeatable = this.expectOptionalKeyword("repeatable");
		this.expectKeyword("on");
		const locations = this.parseDirectiveLocations();
		return this.node(start, {
			kind: Kind.DIRECTIVE_DEFINITION,
			description,
			name,
			arguments: args,
			repeatable,
			locations
		});
	}
	/**
	* DirectiveLocations :
	*   - `|`? DirectiveLocation
	*   - DirectiveLocations | DirectiveLocation
	*/
	parseDirectiveLocations() {
		return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);
	}
	parseDirectiveLocation() {
		const start = this._lexer.token;
		const name = this.parseName();
		if (Object.prototype.hasOwnProperty.call(DirectiveLocation, name.value)) return name;
		throw this.unexpected(start);
	}
	/**
	* SchemaCoordinate :
	*   - Name
	*   - Name . Name
	*   - Name . Name ( Name : )
	*   - \@ Name
	*   - \@ Name ( Name : )
	*/
	parseSchemaCoordinate() {
		const start = this._lexer.token;
		const ofDirective = this.expectOptionalToken(TokenKind.AT);
		const name = this.parseName();
		let memberName;
		if (!ofDirective && this.expectOptionalToken(TokenKind.DOT)) memberName = this.parseName();
		let argumentName;
		if ((ofDirective || memberName) && this.expectOptionalToken(TokenKind.PAREN_L)) {
			argumentName = this.parseName();
			this.expectToken(TokenKind.COLON);
			this.expectToken(TokenKind.PAREN_R);
		}
		if (ofDirective) {
			if (argumentName) return this.node(start, {
				kind: Kind.DIRECTIVE_ARGUMENT_COORDINATE,
				name,
				argumentName
			});
			return this.node(start, {
				kind: Kind.DIRECTIVE_COORDINATE,
				name
			});
		} else if (memberName) {
			if (argumentName) return this.node(start, {
				kind: Kind.ARGUMENT_COORDINATE,
				name,
				fieldName: memberName,
				argumentName
			});
			return this.node(start, {
				kind: Kind.MEMBER_COORDINATE,
				name,
				memberName
			});
		}
		return this.node(start, {
			kind: Kind.TYPE_COORDINATE,
			name
		});
	}
	/**
	* Returns a node that, if configured to do so, sets a "loc" field as a
	* location object, used to identify the place in the source that created a
	* given parsed object.
	*/
	node(startToken, node) {
		if (this._options.noLocation !== true) node.loc = new Location(startToken, this._lexer.lastToken, this._lexer.source);
		return node;
	}
	/**
	* Determines if the next token is of a given kind
	*/
	peek(kind) {
		return this._lexer.token.kind === kind;
	}
	/**
	* If the next token is of the given kind, return that token after advancing the lexer.
	* Otherwise, do not change the parser state and throw an error.
	*/
	expectToken(kind) {
		const token = this._lexer.token;
		if (token.kind === kind) {
			this.advanceLexer();
			return token;
		}
		throw syntaxError(this._lexer.source, token.start, `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`);
	}
	/**
	* If the next token is of the given kind, return "true" after advancing the lexer.
	* Otherwise, do not change the parser state and return "false".
	*/
	expectOptionalToken(kind) {
		if (this._lexer.token.kind === kind) {
			this.advanceLexer();
			return true;
		}
		return false;
	}
	/**
	* If the next token is a given keyword, advance the lexer.
	* Otherwise, do not change the parser state and throw an error.
	*/
	expectKeyword(value) {
		const token = this._lexer.token;
		if (token.kind === TokenKind.NAME && token.value === value) this.advanceLexer();
		else throw syntaxError(this._lexer.source, token.start, `Expected "${value}", found ${getTokenDesc(token)}.`);
	}
	/**
	* If the next token is a given keyword, return "true" after advancing the lexer.
	* Otherwise, do not change the parser state and return "false".
	*/
	expectOptionalKeyword(value) {
		const token = this._lexer.token;
		if (token.kind === TokenKind.NAME && token.value === value) {
			this.advanceLexer();
			return true;
		}
		return false;
	}
	/**
	* Helper function for creating an error when an unexpected lexed token is encountered.
	*/
	unexpected(atToken) {
		const token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;
		return syntaxError(this._lexer.source, token.start, `Unexpected ${getTokenDesc(token)}.`);
	}
	/**
	* Returns a possibly empty list of parse nodes, determined by the parseFn.
	* This list begins with a lex token of openKind and ends with a lex token of closeKind.
	* Advances the parser to the next lex token after the closing token.
	*/
	any(openKind, parseFn, closeKind) {
		this.expectToken(openKind);
		const nodes = [];
		while (!this.expectOptionalToken(closeKind)) nodes.push(parseFn.call(this));
		return nodes;
	}
	/**
	* Returns a list of parse nodes, determined by the parseFn.
	* It can be empty only if open token is missing otherwise it will always return non-empty list
	* that begins with a lex token of openKind and ends with a lex token of closeKind.
	* Advances the parser to the next lex token after the closing token.
	*/
	optionalMany(openKind, parseFn, closeKind) {
		if (this.expectOptionalToken(openKind)) {
			const nodes = [];
			do
				nodes.push(parseFn.call(this));
			while (!this.expectOptionalToken(closeKind));
			return nodes;
		}
		return [];
	}
	/**
	* Returns a non-empty list of parse nodes, determined by the parseFn.
	* This list begins with a lex token of openKind and ends with a lex token of closeKind.
	* Advances the parser to the next lex token after the closing token.
	*/
	many(openKind, parseFn, closeKind) {
		this.expectToken(openKind);
		const nodes = [];
		do
			nodes.push(parseFn.call(this));
		while (!this.expectOptionalToken(closeKind));
		return nodes;
	}
	/**
	* Returns a non-empty list of parse nodes, determined by the parseFn.
	* This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
	* Advances the parser to the next lex token after last item in the list.
	*/
	delimitedMany(delimiterKind, parseFn) {
		this.expectOptionalToken(delimiterKind);
		const nodes = [];
		do
			nodes.push(parseFn.call(this));
		while (this.expectOptionalToken(delimiterKind));
		return nodes;
	}
	advanceLexer() {
		const { maxTokens } = this._options;
		const token = this._lexer.advance();
		if (token.kind !== TokenKind.EOF) {
			++this._tokenCounter;
			if (maxTokens !== void 0 && this._tokenCounter > maxTokens) throw syntaxError(this._lexer.source, token.start, `Document contains more that ${maxTokens} tokens. Parsing aborted.`);
		}
	}
};
/**
* A helper function to describe a token as a string for debugging.
*/
function getTokenDesc(token) {
	const value = token.value;
	return getTokenKindDesc(token.kind) + (value != null ? ` "${value}"` : "");
}
/**
* A helper function to describe a token kind as a string for debugging.
*/
function getTokenKindDesc(kind) {
	return isPunctuatorTokenKind(kind) ? `"${kind}"` : kind;
}
//#endregion
export { printBlockString as a, Kind as c, QueryDocumentKeys as d, isNode as f, devAssert as g, isObjectLike as h, isPrintableAsBlockString as i, DirectiveLocation as l, invariant as m, instanceOf as n, isNameContinue as o, GraphQLError as p, inspect as r, isNameStart as s, parse as t, OperationTypeNode as u };

//# sourceMappingURL=parser-CkF6Qt8V.js.map