@zuplo/graphql 6.60.36 → 6.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/esm/index.js CHANGED
@@ -22,15 +22,15 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- var jn=Object.defineProperty;var s=(e,t)=>jn(e,"name",{value:t,configurable:!0});import{ConfigurationError as sn}from"@zuplo/runtime";function b(e,t){if(!!!e)throw new Error(t)}s(b,"devAssert");function k(e){return typeof e=="object"&&e!==null}s(k,"isObjectLike");function ae(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}s(ae,"invariant");var $n=/\r\n|[\n\r]/g;function Se(e,t){let n=0,i=1;for(let r of e.body.matchAll($n)){if(typeof r.index=="number"||ae(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}s(Se,"getLocation");function Ct(e){return et(e.source,Se(e.source,e.start))}s(Ct,"printLocation");function et(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=t.line===1?n:0,d=t.column+c,f=`${e.name}:${a}:${d}
25
+ var Pn=Object.defineProperty;var s=(e,t)=>Pn(e,"name",{value:t,configurable:!0});import{ConfigurationError as sn}from"@zuplo/runtime";function b(e,t){if(!!!e)throw new Error(t)}s(b,"devAssert");function k(e){return typeof e=="object"&&e!==null}s(k,"isObjectLike");function ae(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}s(ae,"invariant");var jn=/\r\n|[\n\r]/g;function Se(e,t){let n=0,i=1;for(let r of e.body.matchAll(jn)){if(typeof r.index=="number"||ae(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}s(Se,"getLocation");function Ct(e){return et(e.source,Se(e.source,e.start))}s(Ct,"printLocation");function et(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=t.line===1?n:0,d=t.column+c,f=`${e.name}:${a}:${d}
26
26
  `,T=i.split(/\r\n|[\n\r]/g),x=T[r];if(x.length>120){let N=Math.floor(d/80),S=d%80,g=[];for(let U=0;U<x.length;U+=80)g.push(x.slice(U,U+80));return f+on([[`${a} |`,g[0]],...g.slice(1,N+1).map(U=>["|",U]),["|","^".padStart(S)],["|",g[N+1]]])}return f+on([[`${a-1} |`,T[r-1]],[`${a} |`,x],["|","^".padStart(d)],[`${a+1} |`,T[r+1]]])}s(et,"printSourceLocation");function on(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(`
27
- `)}s(on,"printPrefixedLines");function Pn(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}s(Pn,"toNormalizedOptions");var h=class e extends Error{static{s(this,"GraphQLError")}constructor(t,...n){var i,r,o;let{nodes:a,source:c,positions:d,path:f,originalError:T,extensions:x}=Pn(n);super(t),this.name="GraphQLError",this.path=f??void 0,this.originalError=T??void 0,this.nodes=an(Array.isArray(a)?a:a?[a]:void 0);let N=an((i=this.nodes)===null||i===void 0?void 0:i.map(g=>g.loc).filter(g=>g!=null));this.source=c??(N==null||(r=N[0])===null||r===void 0?void 0:r.source),this.positions=d??N?.map(g=>g.start),this.locations=d&&c?d.map(g=>Se(c,g)):N?.map(g=>Se(g.source,g.start));let S=k(T?.extensions)?T?.extensions:void 0;this.extensions=(o=x??S)!==null&&o!==void 0?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),T!=null&&T.stack?Object.defineProperty(this,"stack",{value:T.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=`
27
+ `)}s(on,"printPrefixedLines");function $n(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}s($n,"toNormalizedOptions");var h=class e extends Error{static{s(this,"GraphQLError")}constructor(t,...n){var i,r,o;let{nodes:a,source:c,positions:d,path:f,originalError:T,extensions:x}=$n(n);super(t),this.name="GraphQLError",this.path=f??void 0,this.originalError=T??void 0,this.nodes=an(Array.isArray(a)?a:a?[a]:void 0);let N=an((i=this.nodes)===null||i===void 0?void 0:i.map(g=>g.loc).filter(g=>g!=null));this.source=c??(N==null||(r=N[0])===null||r===void 0?void 0:r.source),this.positions=d??N?.map(g=>g.start),this.locations=d&&c?d.map(g=>Se(c,g)):N?.map(g=>Se(g.source,g.start));let S=k(T?.extensions)?T?.extensions:void 0;this.extensions=(o=x??S)!==null&&o!==void 0?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),T!=null&&T.stack?Object.defineProperty(this,"stack",{value:T.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=`
28
28
 
29
29
  `+Ct(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=`
30
30
 
31
- `+et(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function an(e){return e===void 0||e.length===0?void 0:e}s(an,"undefinedIfEmpty");function D(e,t,n){return new h(`Syntax Error: ${n}`,{source:e,positions:[t]})}s(D,"syntaxError");var Me=class{static{s(this,"Location")}constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},Oe=class{static{s(this,"Token")}constructor(t,n,i,r,o,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=o,this.value=a,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}}},Ft={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"]},Qn=new Set(Object.keys(Ft));function Ge(e){let t=e?.kind;return typeof t=="string"&&Qn.has(t)}s(Ge,"isNode");var H;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(H||(H={}));var I;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(I||(I={}));var p;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(p||(p={}));function tt(e){return e===9||e===32}s(tt,"isWhiteSpace");function Le(e){return e>=48&&e<=57}s(Le,"isDigit");function pn(e){return e>=97&&e<=122||e>=65&&e<=90}s(pn,"isLetter");function je(e){return pn(e)||e===95}s(je,"isNameStart");function nt(e){return pn(e)||Le(e)||e===95}s(nt,"isNameContinue");function cn(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;a<e.length;++a){var o;let c=e[a],d=Bn(c);d!==c.length&&(i=(o=i)!==null&&o!==void 0?o:a,r=a,a!==0&&d<n&&(n=d))}return e.map((a,c)=>c===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}s(cn,"dedentBlockStringLines");function Bn(e){let t=0;for(;t<e.length&&tt(e.charCodeAt(t));)++t;return t}s(Bn,"leadingWhitespace");function un(e,t){let n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=i.length===1,o=i.length>1&&i.slice(1).every(S=>S.length===0||tt(S.charCodeAt(0))),a=n.endsWith('\\"""'),c=e.endsWith('"')&&!a,d=e.endsWith("\\"),f=c||d,T=!(t!=null&&t.minimize)&&(!r||e.length>70||f||o||a),x="",N=r&&tt(e.charCodeAt(0));return(T&&!N||o)&&(x+=`
31
+ `+et(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function an(e){return e===void 0||e.length===0?void 0:e}s(an,"undefinedIfEmpty");function D(e,t,n){return new h(`Syntax Error: ${n}`,{source:e,positions:[t]})}s(D,"syntaxError");var Ge=class{static{s(this,"Location")}constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},Oe=class{static{s(this,"Token")}constructor(t,n,i,r,o,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=o,this.value=a,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}}},Ft={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"]},Qn=new Set(Object.keys(Ft));function Me(e){let t=e?.kind;return typeof t=="string"&&Qn.has(t)}s(Me,"isNode");var K;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(K||(K={}));var I;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(I||(I={}));var p;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(p||(p={}));function tt(e){return e===9||e===32}s(tt,"isWhiteSpace");function Le(e){return e>=48&&e<=57}s(Le,"isDigit");function pn(e){return e>=97&&e<=122||e>=65&&e<=90}s(pn,"isLetter");function Pe(e){return pn(e)||e===95}s(Pe,"isNameStart");function nt(e){return pn(e)||Le(e)||e===95}s(nt,"isNameContinue");function cn(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;a<e.length;++a){var o;let c=e[a],d=Bn(c);d!==c.length&&(i=(o=i)!==null&&o!==void 0?o:a,r=a,a!==0&&d<n&&(n=d))}return e.map((a,c)=>c===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}s(cn,"dedentBlockStringLines");function Bn(e){let t=0;for(;t<e.length&&tt(e.charCodeAt(t));)++t;return t}s(Bn,"leadingWhitespace");function un(e,t){let n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=i.length===1,o=i.length>1&&i.slice(1).every(S=>S.length===0||tt(S.charCodeAt(0))),a=n.endsWith('\\"""'),c=e.endsWith('"')&&!a,d=e.endsWith("\\"),f=c||d,T=!(t!=null&&t.minimize)&&(!r||e.length>70||f||o||a),x="",N=r&&tt(e.charCodeAt(0));return(T&&!N||o)&&(x+=`
32
32
  `),x+=n,(T||f)&&(x+=`
33
- `),'"""'+x+'"""'}s(un,"printBlockString");var u;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(u||(u={}));var Pe=class{static{s(this,"Lexer")}constructor(t){let n=new Oe(u.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==u.EOF)do if(t.next)t=t.next;else{let n=qn(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===u.COMMENT);return t}};function dn(e){return e===u.BANG||e===u.DOLLAR||e===u.AMP||e===u.PAREN_L||e===u.PAREN_R||e===u.SPREAD||e===u.COLON||e===u.EQUALS||e===u.AT||e===u.BRACKET_L||e===u.BRACKET_R||e===u.BRACE_L||e===u.PIPE||e===u.BRACE_R}s(dn,"isPunctuatorTokenKind");function Ae(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}s(Ae,"isUnicodeScalarValue");function it(e,t){return fn(e.charCodeAt(t))&&mn(e.charCodeAt(t+1))}s(it,"isSupplementaryCodePoint");function fn(e){return e>=55296&&e<=56319}s(fn,"isLeadingSurrogate");function mn(e){return e>=56320&&e<=57343}s(mn,"isTrailingSurrogate");function ge(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return u.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}s(ge,"printCodePointAt");function R(e,t,n,i,r){let o=e.line,a=1+n-e.lineStart;return new Oe(t,n,i,o,a,r)}s(R,"createToken");function qn(e,t){let n=e.source.body,i=n.length,r=t;for(;r<i;){let o=n.charCodeAt(r);switch(o){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return Jn(e,r);case 33:return R(e,u.BANG,r,r+1);case 36:return R(e,u.DOLLAR,r,r+1);case 38:return R(e,u.AMP,r,r+1);case 40:return R(e,u.PAREN_L,r,r+1);case 41:return R(e,u.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return R(e,u.SPREAD,r,r+3);break;case 58:return R(e,u.COLON,r,r+1);case 61:return R(e,u.EQUALS,r,r+1);case 64:return R(e,u.AT,r,r+1);case 91:return R(e,u.BRACKET_L,r,r+1);case 93:return R(e,u.BRACKET_R,r,r+1);case 123:return R(e,u.BRACE_L,r,r+1);case 124:return R(e,u.PIPE,r,r+1);case 125:return R(e,u.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?Wn(e,r):zn(e,r)}if(Le(o)||o===45)return Yn(e,r,o);if(je(o))return Zn(e,r);throw D(e.source,r,o===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Ae(o)||it(n,r)?`Unexpected character: ${ge(e,r)}.`:`Invalid character: ${ge(e,r)}.`)}return R(e,u.EOF,i,i)}s(qn,"readNextToken");function Jn(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let o=n.charCodeAt(r);if(o===10||o===13)break;if(Ae(o))++r;else if(it(n,r))r+=2;else break}return R(e,u.COMMENT,t,r,n.slice(t+1,r))}s(Jn,"readComment");function Yn(e,t,n){let i=e.source.body,r=t,o=n,a=!1;if(o===45&&(o=i.charCodeAt(++r)),o===48){if(o=i.charCodeAt(++r),Le(o))throw D(e.source,r,`Invalid number, unexpected digit after 0: ${ge(e,r)}.`)}else r=Vt(e,r,o),o=i.charCodeAt(r);if(o===46&&(a=!0,o=i.charCodeAt(++r),r=Vt(e,r,o),o=i.charCodeAt(r)),(o===69||o===101)&&(a=!0,o=i.charCodeAt(++r),(o===43||o===45)&&(o=i.charCodeAt(++r)),r=Vt(e,r,o),o=i.charCodeAt(r)),o===46||je(o))throw D(e.source,r,`Invalid number, expected digit but got: ${ge(e,r)}.`);return R(e,a?u.FLOAT:u.INT,t,r,i.slice(t,r))}s(Yn,"readNumber");function Vt(e,t,n){if(!Le(n))throw D(e.source,t,`Invalid number, expected digit but got: ${ge(e,t)}.`);let i=e.source.body,r=t+1;for(;Le(i.charCodeAt(r));)++r;return r}s(Vt,"readDigits");function zn(e,t){let n=e.source.body,i=n.length,r=t+1,o=r,a="";for(;r<i;){let c=n.charCodeAt(r);if(c===34)return a+=n.slice(o,r),R(e,u.STRING,t,r+1,a);if(c===92){a+=n.slice(o,r);let d=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?Kn(e,r):Hn(e,r):Xn(e,r);a+=d.value,r+=d.size,o=r;continue}if(c===10||c===13)break;if(Ae(c))++r;else if(it(n,r))r+=2;else throw D(e.source,r,`Invalid character within String: ${ge(e,r)}.`)}throw D(e.source,r,"Unterminated string.")}s(zn,"readString");function Kn(e,t){let n=e.source.body,i=0,r=3;for(;r<12;){let o=n.charCodeAt(t+r++);if(o===125){if(r<5||!Ae(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|$e(o),i<0)break}throw D(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}s(Kn,"readEscapedUnicodeVariableWidth");function Hn(e,t){let n=e.source.body,i=ln(n,t+2);if(Ae(i))return{value:String.fromCodePoint(i),size:6};if(fn(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let r=ln(n,t+8);if(mn(r))return{value:String.fromCodePoint(i,r),size:12}}throw D(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}s(Hn,"readEscapedUnicodeFixedWidth");function ln(e,t){return $e(e.charCodeAt(t))<<12|$e(e.charCodeAt(t+1))<<8|$e(e.charCodeAt(t+2))<<4|$e(e.charCodeAt(t+3))}s(ln,"read16BitHexCode");function $e(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}s($e,"readHexDigit");function Xn(e,t){let n=e.source.body;switch(n.charCodeAt(t+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:`
33
+ `),'"""'+x+'"""'}s(un,"printBlockString");var u;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(u||(u={}));var $e=class{static{s(this,"Lexer")}constructor(t){let n=new Oe(u.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==u.EOF)do if(t.next)t=t.next;else{let n=qn(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===u.COMMENT);return t}};function dn(e){return e===u.BANG||e===u.DOLLAR||e===u.AMP||e===u.PAREN_L||e===u.PAREN_R||e===u.SPREAD||e===u.COLON||e===u.EQUALS||e===u.AT||e===u.BRACKET_L||e===u.BRACKET_R||e===u.BRACE_L||e===u.PIPE||e===u.BRACE_R}s(dn,"isPunctuatorTokenKind");function Ae(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}s(Ae,"isUnicodeScalarValue");function it(e,t){return fn(e.charCodeAt(t))&&mn(e.charCodeAt(t+1))}s(it,"isSupplementaryCodePoint");function fn(e){return e>=55296&&e<=56319}s(fn,"isLeadingSurrogate");function mn(e){return e>=56320&&e<=57343}s(mn,"isTrailingSurrogate");function ge(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return u.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}s(ge,"printCodePointAt");function R(e,t,n,i,r){let o=e.line,a=1+n-e.lineStart;return new Oe(t,n,i,o,a,r)}s(R,"createToken");function qn(e,t){let n=e.source.body,i=n.length,r=t;for(;r<i;){let o=n.charCodeAt(r);switch(o){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return Jn(e,r);case 33:return R(e,u.BANG,r,r+1);case 36:return R(e,u.DOLLAR,r,r+1);case 38:return R(e,u.AMP,r,r+1);case 40:return R(e,u.PAREN_L,r,r+1);case 41:return R(e,u.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return R(e,u.SPREAD,r,r+3);break;case 58:return R(e,u.COLON,r,r+1);case 61:return R(e,u.EQUALS,r,r+1);case 64:return R(e,u.AT,r,r+1);case 91:return R(e,u.BRACKET_L,r,r+1);case 93:return R(e,u.BRACKET_R,r,r+1);case 123:return R(e,u.BRACE_L,r,r+1);case 124:return R(e,u.PIPE,r,r+1);case 125:return R(e,u.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?Wn(e,r):zn(e,r)}if(Le(o)||o===45)return Yn(e,r,o);if(Pe(o))return Zn(e,r);throw D(e.source,r,o===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Ae(o)||it(n,r)?`Unexpected character: ${ge(e,r)}.`:`Invalid character: ${ge(e,r)}.`)}return R(e,u.EOF,i,i)}s(qn,"readNextToken");function Jn(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let o=n.charCodeAt(r);if(o===10||o===13)break;if(Ae(o))++r;else if(it(n,r))r+=2;else break}return R(e,u.COMMENT,t,r,n.slice(t+1,r))}s(Jn,"readComment");function Yn(e,t,n){let i=e.source.body,r=t,o=n,a=!1;if(o===45&&(o=i.charCodeAt(++r)),o===48){if(o=i.charCodeAt(++r),Le(o))throw D(e.source,r,`Invalid number, unexpected digit after 0: ${ge(e,r)}.`)}else r=Vt(e,r,o),o=i.charCodeAt(r);if(o===46&&(a=!0,o=i.charCodeAt(++r),r=Vt(e,r,o),o=i.charCodeAt(r)),(o===69||o===101)&&(a=!0,o=i.charCodeAt(++r),(o===43||o===45)&&(o=i.charCodeAt(++r)),r=Vt(e,r,o),o=i.charCodeAt(r)),o===46||Pe(o))throw D(e.source,r,`Invalid number, expected digit but got: ${ge(e,r)}.`);return R(e,a?u.FLOAT:u.INT,t,r,i.slice(t,r))}s(Yn,"readNumber");function Vt(e,t,n){if(!Le(n))throw D(e.source,t,`Invalid number, expected digit but got: ${ge(e,t)}.`);let i=e.source.body,r=t+1;for(;Le(i.charCodeAt(r));)++r;return r}s(Vt,"readDigits");function zn(e,t){let n=e.source.body,i=n.length,r=t+1,o=r,a="";for(;r<i;){let c=n.charCodeAt(r);if(c===34)return a+=n.slice(o,r),R(e,u.STRING,t,r+1,a);if(c===92){a+=n.slice(o,r);let d=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?Hn(e,r):Kn(e,r):Xn(e,r);a+=d.value,r+=d.size,o=r;continue}if(c===10||c===13)break;if(Ae(c))++r;else if(it(n,r))r+=2;else throw D(e.source,r,`Invalid character within String: ${ge(e,r)}.`)}throw D(e.source,r,"Unterminated string.")}s(zn,"readString");function Hn(e,t){let n=e.source.body,i=0,r=3;for(;r<12;){let o=n.charCodeAt(t+r++);if(o===125){if(r<5||!Ae(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|je(o),i<0)break}throw D(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}s(Hn,"readEscapedUnicodeVariableWidth");function Kn(e,t){let n=e.source.body,i=ln(n,t+2);if(Ae(i))return{value:String.fromCodePoint(i),size:6};if(fn(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let r=ln(n,t+8);if(mn(r))return{value:String.fromCodePoint(i,r),size:12}}throw D(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}s(Kn,"readEscapedUnicodeFixedWidth");function ln(e,t){return je(e.charCodeAt(t))<<12|je(e.charCodeAt(t+1))<<8|je(e.charCodeAt(t+2))<<4|je(e.charCodeAt(t+3))}s(ln,"read16BitHexCode");function je(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}s(je,"readHexDigit");function Xn(e,t){let n=e.source.body;switch(n.charCodeAt(t+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:`
34
34
  `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw D(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}s(Xn,"readEscapedCharacter");function Wn(e,t){let n=e.source.body,i=n.length,r=e.lineStart,o=t+3,a=o,c="",d=[];for(;o<i;){let f=n.charCodeAt(o);if(f===34&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34){c+=n.slice(a,o),d.push(c);let T=R(e,u.BLOCK_STRING,t,o+3,cn(d).join(`
35
35
  `));return e.line+=d.length-1,e.lineStart=r,T}if(f===92&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34&&n.charCodeAt(o+3)===34){c+=n.slice(a,o),a=o+1,o+=4;continue}if(f===10||f===13){c+=n.slice(a,o),d.push(c),f===13&&n.charCodeAt(o+1)===10?o+=2:++o,c="",a=o,r=o;continue}if(Ae(f))++o;else if(it(n,o))o+=2;else throw D(e.source,o,`Invalid character within String: ${ge(e,o)}.`)}throw D(e.source,o,"Unterminated string.")}s(Wn,"readBlockString");function Zn(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let o=n.charCodeAt(r);if(nt(o))++r;else break}return R(e,u.NAME,t,r,n.slice(t,r))}s(Zn,"readName");function m(e){return rt(e,[])}s(m,"inspect");function rt(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return ei(e,t);default:return String(e)}}s(rt,"formatValue");function ei(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(ti(e)){let i=e.toJSON();if(i!==e)return typeof i=="string"?i:rt(i,n)}else if(Array.isArray(e))return ii(e,n);return ni(e,n)}s(ei,"formatObjectValue");function ti(e){return typeof e.toJSON=="function"}s(ti,"isJSONable");function ni(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+ri(e)+"]":"{ "+n.map(([r,o])=>r+": "+rt(o,t)).join(", ")+" }"}s(ni,"formatObject");function ii(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let o=0;o<n;++o)r.push(rt(e[o],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}s(ii,"formatArray");function ri(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}s(ri,"getObjectTag");var si=globalThis.process&&!0,q=s(si?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;let r=n.prototype[Symbol.toStringTag],o=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===o){let a=m(t);throw new Error(`Cannot use ${r} "${a}" from another module or realm.
36
36
 
@@ -43,7 +43,7 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
43
43
  Duplicate "graphql" modules cannot be used at the same time since different
44
44
  versions may have different capabilities and behavior. The data from one
45
45
  version used in the function from another could produce confusing and
46
- spurious results.`)}}return!1},"instanceOf");var De=class{static{s(this,"Source")}constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||b(!1,`Body must be a string. Received: ${m(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||b(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||b(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function hn(e){return q(e,De)}s(hn,"isSource");function at(e,t){let n=new ot(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}s(at,"parse");function pt(e,t){let n=new ot(e,t);n.expectToken(u.SOF);let i=n.parseValueLiteral(!1);return n.expectToken(u.EOF),i}s(pt,"parseValue");var ot=class{static{s(this,"Parser")}constructor(t,n={}){let i=hn(t)?t:new De(t);this._lexer=new Pe(i),this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(u.NAME);return this.node(t,{kind:p.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:p.DOCUMENT,definitions:this.many(u.SOF,this.parseDefinition,u.EOF)})}parseDefinition(){if(this.peek(u.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===u.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()}if(t)throw D(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(u.BRACE_L))return this.node(t,{kind:p.OPERATION_DEFINITION,operation:H.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),i;return this.peek(u.NAME)&&(i=this.parseName()),this.node(t,{kind:p.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(u.NAME);switch(t.value){case"query":return H.QUERY;case"mutation":return H.MUTATION;case"subscription":return H.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(u.PAREN_L,this.parseVariableDefinition,u.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:p.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(u.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(u.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(u.DOLLAR),this.node(t,{kind:p.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:p.SELECTION_SET,selections:this.many(u.BRACE_L,this.parseSelection,u.BRACE_R)})}parseSelection(){return this.peek(u.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(u.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:p.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(u.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(u.PAREN_L,n,u.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:p.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(u.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(u.NAME)?this.node(t,{kind:p.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:p.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:p.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:p.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case u.BRACKET_L:return this.parseList(t);case u.BRACE_L:return this.parseObject(t);case u.INT:return this.advanceLexer(),this.node(n,{kind:p.INT,value:n.value});case u.FLOAT:return this.advanceLexer(),this.node(n,{kind:p.FLOAT,value:n.value});case u.STRING:case u.BLOCK_STRING:return this.parseStringLiteral();case u.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:p.BOOLEAN,value:!0});case"false":return this.node(n,{kind:p.BOOLEAN,value:!1});case"null":return this.node(n,{kind:p.NULL});default:return this.node(n,{kind:p.ENUM,value:n.value})}case u.DOLLAR:if(t)if(this.expectToken(u.DOLLAR),this._lexer.token.kind===u.NAME){let i=this._lexer.token.value;throw D(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:p.STRING,value:t.value,block:t.kind===u.BLOCK_STRING})}parseList(t){let n=s(()=>this.parseValueLiteral(t),"item");return this.node(this._lexer.token,{kind:p.LIST,values:this.any(u.BRACKET_L,n,u.BRACKET_R)})}parseObject(t){let n=s(()=>this.parseObjectField(t),"item");return this.node(this._lexer.token,{kind:p.OBJECT,fields:this.any(u.BRACE_L,n,u.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:p.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(u.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(u.AT),this.node(n,{kind:p.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(u.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(u.BRACKET_R),n=this.node(t,{kind:p.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(u.BANG)?this.node(t,{kind:p.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:p.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(u.STRING)||this.peek(u.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);return this.node(t,{kind:p.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(u.COLON);let i=this.parseNamedType();return this.node(t,{kind:p.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:p.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:p.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(u.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseFieldDefinition,u.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(u.COLON);let o=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:p.FIELD_DEFINITION,description:n,name:i,arguments:r,type:o,directives:a})}parseArgumentDefs(){return this.optionalMany(u.PAREN_L,this.parseInputValueDef,u.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(u.COLON);let r=this.parseTypeReference(),o;this.expectOptionalToken(u.EQUALS)&&(o=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:p.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:o,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:p.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:p.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(u.EQUALS)?this.delimitedMany(u.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:p.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:o})}parseEnumValuesDefinition(){return this.optionalMany(u.BRACE_L,this.parseEnumValueDefinition,u.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:p.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw D(this._lexer.source,this._lexer.token.start,`${st(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:p.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseInputValueDef,u.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===u.NAME)switch(t.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(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:p.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:p.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:p.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:p.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:p.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:p.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:p.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(u.AT);let i=this.parseName(),r=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:p.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:o,locations:a})}parseDirectiveLocations(){return this.delimitedMany(u.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(I,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Me(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw D(this._lexer.source,n.start,`Expected ${yn(t)}, found ${st(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===u.NAME&&n.value===t)this.advanceLexer();else throw D(this._lexer.source,n.start,`Expected "${t}", found ${st(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===u.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return D(this._lexer.source,n.start,`Unexpected ${st(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==u.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw D(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};function st(e){let t=e.value;return yn(e.kind)+(t!=null?` "${t}"`:"")}s(st,"getTokenDesc");function yn(e){return dn(e)?`"${e}"`:e}s(yn,"getTokenKindDesc");function ct(e,t){let[n,i]=t?[e,t]:[void 0,e],r=" Did you mean ";n&&(r+=n+" ");let o=i.map(d=>`"${d}"`);switch(o.length){case 0:return"";case 1:return r+o[0]+"?";case 2:return r+o[0]+" or "+o[1]+"?"}let a=o.slice(0,5),c=a.pop();return r+a.join(", ")+", or "+c+"?"}s(ct,"didYouMean");function Ut(e){return e}s(Ut,"identityFunc");function we(e,t){let n=Object.create(null);for(let i of e)n[t(i)]=i;return n}s(we,"keyMap");function pe(e,t,n){let i=Object.create(null);for(let r of e)i[t(r)]=n(r);return i}s(pe,"keyValMap");function Qe(e,t){let n=Object.create(null);for(let i of Object.keys(e))n[i]=t(e[i],i);return n}s(Qe,"mapValue");function Tn(e,t){let n=0,i=0;for(;n<e.length&&i<t.length;){let r=e.charCodeAt(n),o=t.charCodeAt(i);if(ut(r)&&ut(o)){let a=0;do++n,a=a*10+r-Mt,r=e.charCodeAt(n);while(ut(r)&&a>0);let c=0;do++i,c=c*10+o-Mt,o=t.charCodeAt(i);while(ut(o)&&c>0);if(a<c)return-1;if(a>c)return 1}else{if(r<o)return-1;if(r>o)return 1;++n,++i}}return e.length-t.length}s(Tn,"naturalCompare");var Mt=48,oi=57;function ut(e){return!isNaN(e)&&Mt<=e&&e<=oi}s(ut,"isDigit");function lt(e,t){let n=Object.create(null),i=new Gt(e),r=Math.floor(e.length*.4)+1;for(let o of t){let a=i.measure(o,r);a!==void 0&&(n[o]=a)}return Object.keys(n).sort((o,a)=>{let c=n[o]-n[a];return c!==0?c:Tn(o,a)})}s(lt,"suggestionList");var Gt=class{static{s(this,"LexicalDistance")}constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=xn(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let i=t.toLowerCase();if(this._inputLowerCase===i)return 1;let r=xn(i),o=this._inputArray;if(r.length<o.length){let T=r;r=o,o=T}let a=r.length,c=o.length;if(a-c>n)return;let d=this._rows;for(let T=0;T<=c;T++)d[0][T]=T;for(let T=1;T<=a;T++){let x=d[(T-1)%3],N=d[T%3],S=N[0]=T;for(let g=1;g<=c;g++){let U=r[T-1]===o[g-1]?0:1,K=Math.min(x[g]+1,N[g-1]+1,x[g-1]+U);if(T>1&&g>1&&r[T-1]===o[g-2]&&r[T-2]===o[g-1]){let V=d[(T-2)%3][g-2];K=Math.min(K,V+1)}K<S&&(S=K),N[g]=K}if(S>n)return}let f=d[a%3][c];return f<=n?f:void 0}};function xn(e){let t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=e.charCodeAt(i);return n}s(xn,"stringToArray");function $(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,i]of Object.entries(e))t[n]=i;return t}s($,"toObjMap");function Nn(e){return`"${e.replace(ai,pi)}"`}s(Nn,"printString");var ai=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function pi(e){return ci[e.charCodeAt(0)]}s(pi,"escapedReplacer");var ci=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];var jt=Object.freeze({});function he(e,t,n=Ft){let i=new Map;for(let V of Object.values(p))i.set(V,Re(t,V));let r,o=Array.isArray(e),a=[e],c=-1,d=[],f=e,T,x,N=[],S=[];do{c++;let V=c===a.length,me=V&&d.length!==0;if(V){if(T=S.length===0?void 0:N[N.length-1],f=x,x=S.pop(),me)if(o){f=f.slice();let ee=0;for(let[Ue,_e]of d){let Ze=Ue-ee;_e===null?(f.splice(Ze,1),ee++):f[Ze]=_e}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(let[ee,Ue]of d)f[ee]=Ue}c=r.index,a=r.keys,d=r.edits,o=r.inArray,r=r.prev}else if(x){if(T=o?c:a[c],f=x[T],f==null)continue;N.push(T)}let se;if(!Array.isArray(f)){var g,U;Ge(f)||b(!1,`Invalid AST Node: ${m(f)}.`);let ee=V?(g=i.get(f.kind))===null||g===void 0?void 0:g.leave:(U=i.get(f.kind))===null||U===void 0?void 0:U.enter;if(se=ee?.call(t,f,T,x,N,S),se===jt)break;if(se===!1){if(!V){N.pop();continue}}else if(se!==void 0&&(d.push([T,se]),!V))if(Ge(se))f=se;else{N.pop();continue}}if(se===void 0&&me&&d.push([T,f]),V)N.pop();else{var K;r={inArray:o,index:c,keys:a,edits:d,prev:r},o=Array.isArray(f),a=o?f:(K=n[f.kind])!==null&&K!==void 0?K:[],c=-1,d=[],x&&S.push(x),x=f}}while(r!==void 0);return d.length!==0?d[d.length-1][1]:e}s(he,"visit");function Re(e,t){let n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}s(Re,"getEnterLeaveForKind");function P(e){return he(e,li)}s(P,"print");var ui=80,li={Name:{leave:s(e=>e.value,"leave")},Variable:{leave:s(e=>"$"+e.name,"leave")},Document:{leave:s(e=>y(e.definitions,`
46
+ spurious results.`)}}return!1},"instanceOf");var De=class{static{s(this,"Source")}constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||b(!1,`Body must be a string. Received: ${m(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||b(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||b(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function hn(e){return q(e,De)}s(hn,"isSource");function at(e,t){let n=new ot(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}s(at,"parse");function pt(e,t){let n=new ot(e,t);n.expectToken(u.SOF);let i=n.parseValueLiteral(!1);return n.expectToken(u.EOF),i}s(pt,"parseValue");var ot=class{static{s(this,"Parser")}constructor(t,n={}){let i=hn(t)?t:new De(t);this._lexer=new $e(i),this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(u.NAME);return this.node(t,{kind:p.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:p.DOCUMENT,definitions:this.many(u.SOF,this.parseDefinition,u.EOF)})}parseDefinition(){if(this.peek(u.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===u.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()}if(t)throw D(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(u.BRACE_L))return this.node(t,{kind:p.OPERATION_DEFINITION,operation:K.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),i;return this.peek(u.NAME)&&(i=this.parseName()),this.node(t,{kind:p.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(u.NAME);switch(t.value){case"query":return K.QUERY;case"mutation":return K.MUTATION;case"subscription":return K.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(u.PAREN_L,this.parseVariableDefinition,u.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:p.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(u.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(u.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(u.DOLLAR),this.node(t,{kind:p.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:p.SELECTION_SET,selections:this.many(u.BRACE_L,this.parseSelection,u.BRACE_R)})}parseSelection(){return this.peek(u.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(u.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:p.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(u.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(u.PAREN_L,n,u.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:p.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(u.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(u.NAME)?this.node(t,{kind:p.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:p.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:p.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:p.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case u.BRACKET_L:return this.parseList(t);case u.BRACE_L:return this.parseObject(t);case u.INT:return this.advanceLexer(),this.node(n,{kind:p.INT,value:n.value});case u.FLOAT:return this.advanceLexer(),this.node(n,{kind:p.FLOAT,value:n.value});case u.STRING:case u.BLOCK_STRING:return this.parseStringLiteral();case u.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:p.BOOLEAN,value:!0});case"false":return this.node(n,{kind:p.BOOLEAN,value:!1});case"null":return this.node(n,{kind:p.NULL});default:return this.node(n,{kind:p.ENUM,value:n.value})}case u.DOLLAR:if(t)if(this.expectToken(u.DOLLAR),this._lexer.token.kind===u.NAME){let i=this._lexer.token.value;throw D(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:p.STRING,value:t.value,block:t.kind===u.BLOCK_STRING})}parseList(t){let n=s(()=>this.parseValueLiteral(t),"item");return this.node(this._lexer.token,{kind:p.LIST,values:this.any(u.BRACKET_L,n,u.BRACKET_R)})}parseObject(t){let n=s(()=>this.parseObjectField(t),"item");return this.node(this._lexer.token,{kind:p.OBJECT,fields:this.any(u.BRACE_L,n,u.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:p.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(u.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(u.AT),this.node(n,{kind:p.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(u.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(u.BRACKET_R),n=this.node(t,{kind:p.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(u.BANG)?this.node(t,{kind:p.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:p.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(u.STRING)||this.peek(u.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);return this.node(t,{kind:p.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(u.COLON);let i=this.parseNamedType();return this.node(t,{kind:p.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:p.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:p.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(u.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseFieldDefinition,u.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(u.COLON);let o=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:p.FIELD_DEFINITION,description:n,name:i,arguments:r,type:o,directives:a})}parseArgumentDefs(){return this.optionalMany(u.PAREN_L,this.parseInputValueDef,u.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(u.COLON);let r=this.parseTypeReference(),o;this.expectOptionalToken(u.EQUALS)&&(o=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:p.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:o,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:p.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:p.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(u.EQUALS)?this.delimitedMany(u.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:p.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:o})}parseEnumValuesDefinition(){return this.optionalMany(u.BRACE_L,this.parseEnumValueDefinition,u.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:p.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw D(this._lexer.source,this._lexer.token.start,`${st(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:p.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseInputValueDef,u.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===u.NAME)switch(t.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(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:p.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:p.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:p.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:p.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:p.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:p.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:p.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(u.AT);let i=this.parseName(),r=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:p.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:o,locations:a})}parseDirectiveLocations(){return this.delimitedMany(u.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(I,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Ge(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw D(this._lexer.source,n.start,`Expected ${yn(t)}, found ${st(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===u.NAME&&n.value===t)this.advanceLexer();else throw D(this._lexer.source,n.start,`Expected "${t}", found ${st(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===u.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return D(this._lexer.source,n.start,`Unexpected ${st(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==u.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw D(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};function st(e){let t=e.value;return yn(e.kind)+(t!=null?` "${t}"`:"")}s(st,"getTokenDesc");function yn(e){return dn(e)?`"${e}"`:e}s(yn,"getTokenKindDesc");function ct(e,t){let[n,i]=t?[e,t]:[void 0,e],r=" Did you mean ";n&&(r+=n+" ");let o=i.map(d=>`"${d}"`);switch(o.length){case 0:return"";case 1:return r+o[0]+"?";case 2:return r+o[0]+" or "+o[1]+"?"}let a=o.slice(0,5),c=a.pop();return r+a.join(", ")+", or "+c+"?"}s(ct,"didYouMean");function Ut(e){return e}s(Ut,"identityFunc");function we(e,t){let n=Object.create(null);for(let i of e)n[t(i)]=i;return n}s(we,"keyMap");function pe(e,t,n){let i=Object.create(null);for(let r of e)i[t(r)]=n(r);return i}s(pe,"keyValMap");function Qe(e,t){let n=Object.create(null);for(let i of Object.keys(e))n[i]=t(e[i],i);return n}s(Qe,"mapValue");function Tn(e,t){let n=0,i=0;for(;n<e.length&&i<t.length;){let r=e.charCodeAt(n),o=t.charCodeAt(i);if(ut(r)&&ut(o)){let a=0;do++n,a=a*10+r-Gt,r=e.charCodeAt(n);while(ut(r)&&a>0);let c=0;do++i,c=c*10+o-Gt,o=t.charCodeAt(i);while(ut(o)&&c>0);if(a<c)return-1;if(a>c)return 1}else{if(r<o)return-1;if(r>o)return 1;++n,++i}}return e.length-t.length}s(Tn,"naturalCompare");var Gt=48,oi=57;function ut(e){return!isNaN(e)&&Gt<=e&&e<=oi}s(ut,"isDigit");function lt(e,t){let n=Object.create(null),i=new Mt(e),r=Math.floor(e.length*.4)+1;for(let o of t){let a=i.measure(o,r);a!==void 0&&(n[o]=a)}return Object.keys(n).sort((o,a)=>{let c=n[o]-n[a];return c!==0?c:Tn(o,a)})}s(lt,"suggestionList");var Mt=class{static{s(this,"LexicalDistance")}constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=xn(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let i=t.toLowerCase();if(this._inputLowerCase===i)return 1;let r=xn(i),o=this._inputArray;if(r.length<o.length){let T=r;r=o,o=T}let a=r.length,c=o.length;if(a-c>n)return;let d=this._rows;for(let T=0;T<=c;T++)d[0][T]=T;for(let T=1;T<=a;T++){let x=d[(T-1)%3],N=d[T%3],S=N[0]=T;for(let g=1;g<=c;g++){let U=r[T-1]===o[g-1]?0:1,H=Math.min(x[g]+1,N[g-1]+1,x[g-1]+U);if(T>1&&g>1&&r[T-1]===o[g-2]&&r[T-2]===o[g-1]){let V=d[(T-2)%3][g-2];H=Math.min(H,V+1)}H<S&&(S=H),N[g]=H}if(S>n)return}let f=d[a%3][c];return f<=n?f:void 0}};function xn(e){let t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=e.charCodeAt(i);return n}s(xn,"stringToArray");function j(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,i]of Object.entries(e))t[n]=i;return t}s(j,"toObjMap");function Nn(e){return`"${e.replace(ai,pi)}"`}s(Nn,"printString");var ai=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function pi(e){return ci[e.charCodeAt(0)]}s(pi,"escapedReplacer");var ci=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];var Pt=Object.freeze({});function he(e,t,n=Ft){let i=new Map;for(let V of Object.values(p))i.set(V,Re(t,V));let r,o=Array.isArray(e),a=[e],c=-1,d=[],f=e,T,x,N=[],S=[];do{c++;let V=c===a.length,me=V&&d.length!==0;if(V){if(T=S.length===0?void 0:N[N.length-1],f=x,x=S.pop(),me)if(o){f=f.slice();let ee=0;for(let[Ue,_e]of d){let Ze=Ue-ee;_e===null?(f.splice(Ze,1),ee++):f[Ze]=_e}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(let[ee,Ue]of d)f[ee]=Ue}c=r.index,a=r.keys,d=r.edits,o=r.inArray,r=r.prev}else if(x){if(T=o?c:a[c],f=x[T],f==null)continue;N.push(T)}let se;if(!Array.isArray(f)){var g,U;Me(f)||b(!1,`Invalid AST Node: ${m(f)}.`);let ee=V?(g=i.get(f.kind))===null||g===void 0?void 0:g.leave:(U=i.get(f.kind))===null||U===void 0?void 0:U.enter;if(se=ee?.call(t,f,T,x,N,S),se===Pt)break;if(se===!1){if(!V){N.pop();continue}}else if(se!==void 0&&(d.push([T,se]),!V))if(Me(se))f=se;else{N.pop();continue}}if(se===void 0&&me&&d.push([T,f]),V)N.pop();else{var H;r={inArray:o,index:c,keys:a,edits:d,prev:r},o=Array.isArray(f),a=o?f:(H=n[f.kind])!==null&&H!==void 0?H:[],c=-1,d=[],x&&S.push(x),x=f}}while(r!==void 0);return d.length!==0?d[d.length-1][1]:e}s(he,"visit");function Re(e,t){let n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}s(Re,"getEnterLeaveForKind");function $(e){return he(e,li)}s($,"print");var ui=80,li={Name:{leave:s(e=>e.value,"leave")},Variable:{leave:s(e=>"$"+e.name,"leave")},Document:{leave:s(e=>y(e.definitions,`
47
47
 
48
48
  `),"leave")},OperationDefinition:{leave(e){let t=_("(",y(e.variableDefinitions,", "),")"),n=y([e.operation,y([e.name,t]),y(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:s(({variable:e,type:t,defaultValue:n,directives:i})=>e+": "+t+_(" = ",n)+_(" ",y(i," ")),"leave")},SelectionSet:{leave:s(({selections:e})=>te(e),"leave")},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){let o=_("",e,": ")+t,a=o+_("(",y(n,", "),")");return a.length>ui&&(a=o+_(`(
49
49
  `,dt(y(n,`
@@ -70,9 +70,9 @@ spurious results.`)}}return!1},"instanceOf");var De=class{static{s(this,"Source"
70
70
  `)),`
71
71
  }`)}s(te,"block");function _(e,t,n=""){return t!=null&&t!==""?e+t+n:""}s(_,"wrap");function dt(e){return _(" ",e.replace(/\n/g,`
72
72
  `))}s(dt,"indent");function En(e){var t;return(t=e?.some(n=>n.includes(`
73
- `)))!==null&&t!==void 0?t:!1}s(En,"hasMultilineItems");function Be(e,t){switch(e.kind){case p.NULL:return null;case p.INT:return parseInt(e.value,10);case p.FLOAT:return parseFloat(e.value);case p.STRING:case p.ENUM:case p.BOOLEAN:return e.value;case p.LIST:return e.values.map(n=>Be(n,t));case p.OBJECT:return pe(e.fields,n=>n.name.value,n=>Be(n.value,t));case p.VARIABLE:return t?.[e.name.value]}}s(Be,"valueFromASTUntyped");function Q(e){if(e!=null||b(!1,"Must provide name."),typeof e=="string"||b(!1,"Expected name to be a string."),e.length===0)throw new h("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!nt(e.charCodeAt(t)))throw new h(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!je(e.charCodeAt(0)))throw new h(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}s(Q,"assertName");function $t(e){if(e==="true"||e==="false"||e==="null")throw new h(`Enum values cannot be named: ${e}`);return Q(e)}s($t,"assertEnumValueName");function mt(e){return ye(e)||G(e)||C(e)||X(e)||Y(e)||F(e)||B(e)||A(e)}s(mt,"isType");function ye(e){return q(e,J)}s(ye,"isScalarType");function G(e){return q(e,M)}s(G,"isObjectType");function ht(e){if(!G(e))throw new Error(`Expected ${m(e)} to be a GraphQL Object type.`);return e}s(ht,"assertObjectType");function C(e){return q(e,de)}s(C,"isInterfaceType");function yt(e){if(!C(e))throw new Error(`Expected ${m(e)} to be a GraphQL Interface type.`);return e}s(yt,"assertInterfaceType");function X(e){return q(e,ve)}s(X,"isUnionType");function Y(e){return q(e,ce)}s(Y,"isEnumType");function F(e){return q(e,Ie)}s(F,"isInputObjectType");function B(e){return q(e,w)}s(B,"isListType");function A(e){return q(e,E)}s(A,"isNonNullType");function z(e){return ye(e)||Y(e)||F(e)||qe(e)&&z(e.ofType)}s(z,"isInputType");function fe(e){return ye(e)||G(e)||C(e)||X(e)||Y(e)||qe(e)&&fe(e.ofType)}s(fe,"isOutputType");function Te(e){return ye(e)||Y(e)}s(Te,"isLeafType");function ue(e){return G(e)||C(e)||X(e)}s(ue,"isCompositeType");function xe(e){return C(e)||X(e)}s(xe,"isAbstractType");var w=class{static{s(this,"GraphQLList")}constructor(t){mt(t)||b(!1,`Expected ${m(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}},E=class{static{s(this,"GraphQLNonNull")}constructor(t){Tt(t)||b(!1,`Expected ${m(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};function qe(e){return B(e)||A(e)}s(qe,"isWrappingType");function Tt(e){return mt(e)&&!A(e)}s(Tt,"isNullableType");function xt(e){if(!Tt(e))throw new Error(`Expected ${m(e)} to be a GraphQL nullable type.`);return e}s(xt,"assertNullableType");function Nt(e){if(e)return A(e)?e.ofType:e}s(Nt,"getNullableType");function ne(e){if(e){let t=e;for(;qe(t);)t=t.ofType;return t}}s(ne,"getNamedType");function Et(e){return typeof e=="function"?e():e}s(Et,"resolveReadonlyArrayThunk");function gt(e){return typeof e=="function"?e():e}s(gt,"resolveObjMapThunk");var J=class{static{s(this,"GraphQLScalarType")}constructor(t){var n,i,r,o;let a=(n=t.parseValue)!==null&&n!==void 0?n:Ut;this.name=Q(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(i=t.serialize)!==null&&i!==void 0?i:Ut,this.parseValue=a,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:(c,d)=>a(Be(c,d)),this.extensions=$(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(o=t.extensionASTNodes)!==null&&o!==void 0?o:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||b(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${m(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||b(!1,`${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.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||b(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){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:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},M=class{static{s(this,"GraphQLObjectType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=$(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>In(t),this._interfaces=()=>vn(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||b(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${m(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:bn(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function vn(e){var t;let n=Et((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||b(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}s(vn,"defineInterfaces");function In(e){let t=gt(e.fields);return ke(t)||b(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Qe(t,(n,i)=>{var r;ke(n)||b(!1,`${e.name}.${i} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||b(!1,`${e.name}.${i} field resolver must be a function if provided, but got: ${m(n.resolve)}.`);let o=(r=n.args)!==null&&r!==void 0?r:{};return ke(o)||b(!1,`${e.name}.${i} args must be an object with argument names as keys.`),{name:Q(i),description:n.description,type:n.type,args:Pt(o),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:$(n.extensions),astNode:n.astNode}})}s(In,"defineFieldMap");function Pt(e){return Object.entries(e).map(([t,n])=>({name:Q(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:$(n.extensions),astNode:n.astNode}))}s(Pt,"defineArguments");function ke(e){return k(e)&&!Array.isArray(e)}s(ke,"isPlainObj");function bn(e){return Qe(e,t=>({description:t.description,type:t.type,args:Qt(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}s(bn,"fieldsToFieldsConfig");function Qt(e){return pe(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}s(Qt,"argsToArgsConfig");var de=class{static{s(this,"GraphQLInterfaceType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=$(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=In.bind(void 0,t),this._interfaces=vn.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||b(!1,`${this.name} must provide "resolveType" as a function, but got: ${m(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:bn(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},ve=class{static{s(this,"GraphQLUnionType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=$(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=di.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||b(!1,`${this.name} must provide "resolveType" as a function, but got: ${m(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function di(e){let t=Et(e.types);return Array.isArray(t)||b(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}s(di,"defineTypes");var ce=class{static{s(this,"GraphQLEnumType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.extensions=$(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof t.values=="function"?t.values:gn(this.name,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=gn(this.name,this._values())),this._values}getValue(t){return this._nameLookup===null&&(this._nameLookup=we(this.getValues(),n=>n.name)),this._nameLookup[t]}serialize(t){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(i=>[i.value,i])));let n=this._valueLookup.get(t);if(n===void 0)throw new h(`Enum "${this.name}" cannot represent value: ${m(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let i=m(t);throw new h(`Enum "${this.name}" cannot represent non-string value: ${i}.`+ft(this,i))}let n=this.getValue(t);if(n==null)throw new h(`Value "${t}" does not exist in "${this.name}" enum.`+ft(this,t));return n.value}parseLiteral(t,n){if(t.kind!==p.ENUM){let r=P(t);throw new h(`Enum "${this.name}" cannot represent non-enum value: ${r}.`+ft(this,r),{nodes:t})}let i=this.getValue(t.value);if(i==null){let r=P(t);throw new h(`Value "${r}" does not exist in "${this.name}" enum.`+ft(this,r),{nodes:t})}return i.value}toConfig(){let t=pe(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function ft(e,t){let n=e.getValues().map(r=>r.name),i=lt(t,n);return ct("the enum value",i)}s(ft,"didYouMeanEnumValue");function gn(e,t){return ke(t)||b(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,i])=>(ke(i)||b(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${m(i)}.`),{name:$t(n),description:i.description,value:i.value!==void 0?i.value:n,deprecationReason:i.deprecationReason,extensions:$(i.extensions),astNode:i.astNode}))}s(gn,"defineEnumValues");var Ie=class{static{s(this,"GraphQLInputObjectType")}constructor(t){var n,i;this.name=Q(t.name),this.description=t.description,this.extensions=$(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(i=t.isOneOf)!==null&&i!==void 0?i:!1,this._fields=fi.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=Qe(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};function fi(e){let t=gt(e.fields);return ke(t)||b(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Qe(t,(n,i)=>(!("resolve"in n)||b(!1,`${e.name}.${i} field has a resolve property, but Input Types cannot define resolvers.`),{name:Q(i),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:$(n.extensions),astNode:n.astNode}))}s(fi,"defineInputFieldMap");var vt=2147483647,It=-2147483648,Bt=new J({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(e){let t=Je(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new h(`Int cannot represent non-integer value: ${m(t)}`);if(n>vt||n<It)throw new h("Int cannot represent non 32-bit signed integer value: "+m(t));return n},parseValue(e){if(typeof e!="number"||!Number.isInteger(e))throw new h(`Int cannot represent non-integer value: ${m(e)}`);if(e>vt||e<It)throw new h(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==p.INT)throw new h(`Int cannot represent non-integer value: ${P(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>vt||t<It)throw new h(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),_n=new J({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(e){let t=Je(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isFinite(n))throw new h(`Float cannot represent non numeric value: ${m(t)}`);return n},parseValue(e){if(typeof e!="number"||!Number.isFinite(e))throw new h(`Float cannot represent non numeric value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==p.FLOAT&&e.kind!==p.INT)throw new h(`Float cannot represent non numeric value: ${P(e)}`,e);return parseFloat(e.value)}}),L=new J({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(e){let t=Je(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"&&Number.isFinite(t))return t.toString();throw new h(`String cannot represent value: ${m(e)}`)},parseValue(e){if(typeof e!="string")throw new h(`String cannot represent a non string value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==p.STRING)throw new h(`String cannot represent a non string value: ${P(e)}`,{nodes:e});return e.value}}),j=new J({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=Je(e);if(typeof t=="boolean")return t;if(Number.isFinite(t))return t!==0;throw new h(`Boolean cannot represent a non boolean value: ${m(t)}`)},parseValue(e){if(typeof e!="boolean")throw new h(`Boolean cannot represent a non boolean value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==p.BOOLEAN)throw new h(`Boolean cannot represent a non boolean value: ${P(e)}`,{nodes:e});return e.value}}),bt=new J({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(e){let t=Je(e);if(typeof t=="string")return t;if(Number.isInteger(t))return String(t);throw new h(`ID cannot represent value: ${m(e)}`)},parseValue(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isInteger(e))return e.toString();throw new h(`ID cannot represent value: ${m(e)}`)},parseLiteral(e){if(e.kind!==p.STRING&&e.kind!==p.INT)throw new h("ID cannot represent a non-string and non-integer value: "+P(e),{nodes:e});return e.value}}),qt=Object.freeze([L,Bt,_n,j,bt]);function Je(e){if(k(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!k(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}s(Je,"serializeObject");function Jt(e){return q(e,W)}s(Jt,"isDirective");var W=class{static{s(this,"GraphQLDirective")}constructor(t){var n,i;this.name=Q(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=$(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||b(!1,`@${t.name} locations must be an Array.`);let r=(i=t.args)!==null&&i!==void 0?i:{};k(r)&&!Array.isArray(r)||b(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=Pt(r)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Qt(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}},Sn=new W({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[I.FIELD,I.FRAGMENT_SPREAD,I.INLINE_FRAGMENT],args:{if:{type:new E(j),description:"Included when true."}}}),On=new W({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[I.FIELD,I.FRAGMENT_SPREAD,I.INLINE_FRAGMENT],args:{if:{type:new E(j),description:"Skipped when true."}}}),Ln="No longer supported",An=new W({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[I.FIELD_DEFINITION,I.ARGUMENT_DEFINITION,I.INPUT_FIELD_DEFINITION,I.ENUM_VALUE],args:{reason:{type:L,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:Ln}}}),Dn=new W({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[I.SCALAR],args:{url:{type:new E(L),description:"The URL that specifies the behavior of this scalar."}}}),wn=new W({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[I.INPUT_OBJECT],args:{}}),Yt=Object.freeze([Sn,On,An,Dn,wn]);function _t(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}s(_t,"isIterableObject");function be(e,t){if(A(t)){let n=be(e,t.ofType);return n?.kind===p.NULL?null:n}if(e===null)return{kind:p.NULL};if(e===void 0)return null;if(B(t)){let n=t.ofType;if(_t(e)){let i=[];for(let r of e){let o=be(r,n);o!=null&&i.push(o)}return{kind:p.LIST,values:i}}return be(e,n)}if(F(t)){if(!k(e))return null;let n=[];for(let i of Object.values(t.getFields())){let r=be(e[i.name],i.type);r&&n.push({kind:p.OBJECT_FIELD,name:{kind:p.NAME,value:i.name},value:r})}return{kind:p.OBJECT,fields:n}}if(Te(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:p.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let i=String(n);return Rn.test(i)?{kind:p.INT,value:i}:{kind:p.FLOAT,value:i}}if(typeof n=="string")return Y(t)?{kind:p.ENUM,value:n}:t===bt&&Rn.test(n)?{kind:p.INT,value:n}:{kind:p.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${m(n)}.`)}ae(!1,"Unexpected input type: "+m(t))}s(be,"astFromValue");var Rn=/^-?(?:0|[1-9][0-9]*)$/;var Ye=new M({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:s(()=>({description:{type:L,resolve:s(e=>e.description,"resolve")},types:{description:"A list of all types supported by this server.",type:new E(new w(new E(Z))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new E(Z),resolve:s(e=>e.getQueryType(),"resolve")},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Z,resolve:s(e=>e.getMutationType(),"resolve")},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Z,resolve:s(e=>e.getSubscriptionType(),"resolve")},directives:{description:"A list of all directives supported by this server.",type:new E(new w(new E(zt))),resolve:s(e=>e.getDirectives(),"resolve")}}),"fields")}),zt=new M({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
73
+ `)))!==null&&t!==void 0?t:!1}s(En,"hasMultilineItems");function Be(e,t){switch(e.kind){case p.NULL:return null;case p.INT:return parseInt(e.value,10);case p.FLOAT:return parseFloat(e.value);case p.STRING:case p.ENUM:case p.BOOLEAN:return e.value;case p.LIST:return e.values.map(n=>Be(n,t));case p.OBJECT:return pe(e.fields,n=>n.name.value,n=>Be(n.value,t));case p.VARIABLE:return t?.[e.name.value]}}s(Be,"valueFromASTUntyped");function Q(e){if(e!=null||b(!1,"Must provide name."),typeof e=="string"||b(!1,"Expected name to be a string."),e.length===0)throw new h("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!nt(e.charCodeAt(t)))throw new h(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!Pe(e.charCodeAt(0)))throw new h(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}s(Q,"assertName");function jt(e){if(e==="true"||e==="false"||e==="null")throw new h(`Enum values cannot be named: ${e}`);return Q(e)}s(jt,"assertEnumValueName");function mt(e){return ye(e)||M(e)||C(e)||X(e)||Y(e)||F(e)||B(e)||A(e)}s(mt,"isType");function ye(e){return q(e,J)}s(ye,"isScalarType");function M(e){return q(e,G)}s(M,"isObjectType");function ht(e){if(!M(e))throw new Error(`Expected ${m(e)} to be a GraphQL Object type.`);return e}s(ht,"assertObjectType");function C(e){return q(e,de)}s(C,"isInterfaceType");function yt(e){if(!C(e))throw new Error(`Expected ${m(e)} to be a GraphQL Interface type.`);return e}s(yt,"assertInterfaceType");function X(e){return q(e,ve)}s(X,"isUnionType");function Y(e){return q(e,ce)}s(Y,"isEnumType");function F(e){return q(e,Ie)}s(F,"isInputObjectType");function B(e){return q(e,w)}s(B,"isListType");function A(e){return q(e,E)}s(A,"isNonNullType");function z(e){return ye(e)||Y(e)||F(e)||qe(e)&&z(e.ofType)}s(z,"isInputType");function fe(e){return ye(e)||M(e)||C(e)||X(e)||Y(e)||qe(e)&&fe(e.ofType)}s(fe,"isOutputType");function Te(e){return ye(e)||Y(e)}s(Te,"isLeafType");function ue(e){return M(e)||C(e)||X(e)}s(ue,"isCompositeType");function xe(e){return C(e)||X(e)}s(xe,"isAbstractType");var w=class{static{s(this,"GraphQLList")}constructor(t){mt(t)||b(!1,`Expected ${m(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}},E=class{static{s(this,"GraphQLNonNull")}constructor(t){Tt(t)||b(!1,`Expected ${m(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};function qe(e){return B(e)||A(e)}s(qe,"isWrappingType");function Tt(e){return mt(e)&&!A(e)}s(Tt,"isNullableType");function xt(e){if(!Tt(e))throw new Error(`Expected ${m(e)} to be a GraphQL nullable type.`);return e}s(xt,"assertNullableType");function Nt(e){if(e)return A(e)?e.ofType:e}s(Nt,"getNullableType");function ne(e){if(e){let t=e;for(;qe(t);)t=t.ofType;return t}}s(ne,"getNamedType");function Et(e){return typeof e=="function"?e():e}s(Et,"resolveReadonlyArrayThunk");function gt(e){return typeof e=="function"?e():e}s(gt,"resolveObjMapThunk");var J=class{static{s(this,"GraphQLScalarType")}constructor(t){var n,i,r,o;let a=(n=t.parseValue)!==null&&n!==void 0?n:Ut;this.name=Q(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(i=t.serialize)!==null&&i!==void 0?i:Ut,this.parseValue=a,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:(c,d)=>a(Be(c,d)),this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(o=t.extensionASTNodes)!==null&&o!==void 0?o:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||b(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${m(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||b(!1,`${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.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||b(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){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:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},G=class{static{s(this,"GraphQLObjectType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>In(t),this._interfaces=()=>vn(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||b(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${m(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:bn(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function vn(e){var t;let n=Et((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||b(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}s(vn,"defineInterfaces");function In(e){let t=gt(e.fields);return ke(t)||b(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Qe(t,(n,i)=>{var r;ke(n)||b(!1,`${e.name}.${i} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||b(!1,`${e.name}.${i} field resolver must be a function if provided, but got: ${m(n.resolve)}.`);let o=(r=n.args)!==null&&r!==void 0?r:{};return ke(o)||b(!1,`${e.name}.${i} args must be an object with argument names as keys.`),{name:Q(i),description:n.description,type:n.type,args:$t(o),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:j(n.extensions),astNode:n.astNode}})}s(In,"defineFieldMap");function $t(e){return Object.entries(e).map(([t,n])=>({name:Q(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:j(n.extensions),astNode:n.astNode}))}s($t,"defineArguments");function ke(e){return k(e)&&!Array.isArray(e)}s(ke,"isPlainObj");function bn(e){return Qe(e,t=>({description:t.description,type:t.type,args:Qt(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}s(bn,"fieldsToFieldsConfig");function Qt(e){return pe(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}s(Qt,"argsToArgsConfig");var de=class{static{s(this,"GraphQLInterfaceType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=In.bind(void 0,t),this._interfaces=vn.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||b(!1,`${this.name} must provide "resolveType" as a function, but got: ${m(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:bn(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},ve=class{static{s(this,"GraphQLUnionType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=di.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||b(!1,`${this.name} must provide "resolveType" as a function, but got: ${m(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function di(e){let t=Et(e.types);return Array.isArray(t)||b(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}s(di,"defineTypes");var ce=class{static{s(this,"GraphQLEnumType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof t.values=="function"?t.values:gn(this.name,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=gn(this.name,this._values())),this._values}getValue(t){return this._nameLookup===null&&(this._nameLookup=we(this.getValues(),n=>n.name)),this._nameLookup[t]}serialize(t){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(i=>[i.value,i])));let n=this._valueLookup.get(t);if(n===void 0)throw new h(`Enum "${this.name}" cannot represent value: ${m(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let i=m(t);throw new h(`Enum "${this.name}" cannot represent non-string value: ${i}.`+ft(this,i))}let n=this.getValue(t);if(n==null)throw new h(`Value "${t}" does not exist in "${this.name}" enum.`+ft(this,t));return n.value}parseLiteral(t,n){if(t.kind!==p.ENUM){let r=$(t);throw new h(`Enum "${this.name}" cannot represent non-enum value: ${r}.`+ft(this,r),{nodes:t})}let i=this.getValue(t.value);if(i==null){let r=$(t);throw new h(`Value "${r}" does not exist in "${this.name}" enum.`+ft(this,r),{nodes:t})}return i.value}toConfig(){let t=pe(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function ft(e,t){let n=e.getValues().map(r=>r.name),i=lt(t,n);return ct("the enum value",i)}s(ft,"didYouMeanEnumValue");function gn(e,t){return ke(t)||b(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,i])=>(ke(i)||b(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${m(i)}.`),{name:jt(n),description:i.description,value:i.value!==void 0?i.value:n,deprecationReason:i.deprecationReason,extensions:j(i.extensions),astNode:i.astNode}))}s(gn,"defineEnumValues");var Ie=class{static{s(this,"GraphQLInputObjectType")}constructor(t){var n,i;this.name=Q(t.name),this.description=t.description,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(i=t.isOneOf)!==null&&i!==void 0?i:!1,this._fields=fi.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=Qe(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};function fi(e){let t=gt(e.fields);return ke(t)||b(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Qe(t,(n,i)=>(!("resolve"in n)||b(!1,`${e.name}.${i} field has a resolve property, but Input Types cannot define resolvers.`),{name:Q(i),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:j(n.extensions),astNode:n.astNode}))}s(fi,"defineInputFieldMap");var vt=2147483647,It=-2147483648,Bt=new J({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(e){let t=Je(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new h(`Int cannot represent non-integer value: ${m(t)}`);if(n>vt||n<It)throw new h("Int cannot represent non 32-bit signed integer value: "+m(t));return n},parseValue(e){if(typeof e!="number"||!Number.isInteger(e))throw new h(`Int cannot represent non-integer value: ${m(e)}`);if(e>vt||e<It)throw new h(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==p.INT)throw new h(`Int cannot represent non-integer value: ${$(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>vt||t<It)throw new h(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),_n=new J({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(e){let t=Je(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isFinite(n))throw new h(`Float cannot represent non numeric value: ${m(t)}`);return n},parseValue(e){if(typeof e!="number"||!Number.isFinite(e))throw new h(`Float cannot represent non numeric value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==p.FLOAT&&e.kind!==p.INT)throw new h(`Float cannot represent non numeric value: ${$(e)}`,e);return parseFloat(e.value)}}),L=new J({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(e){let t=Je(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"&&Number.isFinite(t))return t.toString();throw new h(`String cannot represent value: ${m(e)}`)},parseValue(e){if(typeof e!="string")throw new h(`String cannot represent a non string value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==p.STRING)throw new h(`String cannot represent a non string value: ${$(e)}`,{nodes:e});return e.value}}),P=new J({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=Je(e);if(typeof t=="boolean")return t;if(Number.isFinite(t))return t!==0;throw new h(`Boolean cannot represent a non boolean value: ${m(t)}`)},parseValue(e){if(typeof e!="boolean")throw new h(`Boolean cannot represent a non boolean value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==p.BOOLEAN)throw new h(`Boolean cannot represent a non boolean value: ${$(e)}`,{nodes:e});return e.value}}),bt=new J({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(e){let t=Je(e);if(typeof t=="string")return t;if(Number.isInteger(t))return String(t);throw new h(`ID cannot represent value: ${m(e)}`)},parseValue(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isInteger(e))return e.toString();throw new h(`ID cannot represent value: ${m(e)}`)},parseLiteral(e){if(e.kind!==p.STRING&&e.kind!==p.INT)throw new h("ID cannot represent a non-string and non-integer value: "+$(e),{nodes:e});return e.value}}),qt=Object.freeze([L,Bt,_n,P,bt]);function Je(e){if(k(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!k(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}s(Je,"serializeObject");function Jt(e){return q(e,W)}s(Jt,"isDirective");var W=class{static{s(this,"GraphQLDirective")}constructor(t){var n,i;this.name=Q(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=j(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||b(!1,`@${t.name} locations must be an Array.`);let r=(i=t.args)!==null&&i!==void 0?i:{};k(r)&&!Array.isArray(r)||b(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=$t(r)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Qt(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}},Sn=new W({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[I.FIELD,I.FRAGMENT_SPREAD,I.INLINE_FRAGMENT],args:{if:{type:new E(P),description:"Included when true."}}}),On=new W({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[I.FIELD,I.FRAGMENT_SPREAD,I.INLINE_FRAGMENT],args:{if:{type:new E(P),description:"Skipped when true."}}}),Ln="No longer supported",An=new W({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[I.FIELD_DEFINITION,I.ARGUMENT_DEFINITION,I.INPUT_FIELD_DEFINITION,I.ENUM_VALUE],args:{reason:{type:L,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:Ln}}}),Dn=new W({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[I.SCALAR],args:{url:{type:new E(L),description:"The URL that specifies the behavior of this scalar."}}}),wn=new W({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[I.INPUT_OBJECT],args:{}}),Yt=Object.freeze([Sn,On,An,Dn,wn]);function _t(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}s(_t,"isIterableObject");function be(e,t){if(A(t)){let n=be(e,t.ofType);return n?.kind===p.NULL?null:n}if(e===null)return{kind:p.NULL};if(e===void 0)return null;if(B(t)){let n=t.ofType;if(_t(e)){let i=[];for(let r of e){let o=be(r,n);o!=null&&i.push(o)}return{kind:p.LIST,values:i}}return be(e,n)}if(F(t)){if(!k(e))return null;let n=[];for(let i of Object.values(t.getFields())){let r=be(e[i.name],i.type);r&&n.push({kind:p.OBJECT_FIELD,name:{kind:p.NAME,value:i.name},value:r})}return{kind:p.OBJECT,fields:n}}if(Te(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:p.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let i=String(n);return Rn.test(i)?{kind:p.INT,value:i}:{kind:p.FLOAT,value:i}}if(typeof n=="string")return Y(t)?{kind:p.ENUM,value:n}:t===bt&&Rn.test(n)?{kind:p.INT,value:n}:{kind:p.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${m(n)}.`)}ae(!1,"Unexpected input type: "+m(t))}s(be,"astFromValue");var Rn=/^-?(?:0|[1-9][0-9]*)$/;var Ye=new G({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:s(()=>({description:{type:L,resolve:s(e=>e.description,"resolve")},types:{description:"A list of all types supported by this server.",type:new E(new w(new E(Z))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new E(Z),resolve:s(e=>e.getQueryType(),"resolve")},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Z,resolve:s(e=>e.getMutationType(),"resolve")},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Z,resolve:s(e=>e.getSubscriptionType(),"resolve")},directives:{description:"A list of all directives supported by this server.",type:new E(new w(new E(zt))),resolve:s(e=>e.getDirectives(),"resolve")}}),"fields")}),zt=new G({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
74
74
 
75
- 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:s(()=>({name:{type:new E(L),resolve:s(e=>e.name,"resolve")},description:{type:L,resolve:s(e=>e.description,"resolve")},isRepeatable:{type:new E(j),resolve:s(e=>e.isRepeatable,"resolve")},locations:{type:new E(new w(new E(Kt))),resolve:s(e=>e.locations,"resolve")},args:{type:new E(new w(new E(ze))),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}}),"fields")}),Kt=new ce({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:I.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:I.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:I.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:I.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:I.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:I.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:I.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:I.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:I.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:I.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:I.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:I.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:I.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:I.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:I.UNION,description:"Location adjacent to a union definition."},ENUM:{value:I.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:I.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:I.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:I.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Z=new M({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:s(()=>({kind:{type:new E(Wt),resolve(e){if(ye(e))return O.SCALAR;if(G(e))return O.OBJECT;if(C(e))return O.INTERFACE;if(X(e))return O.UNION;if(Y(e))return O.ENUM;if(F(e))return O.INPUT_OBJECT;if(B(e))return O.LIST;if(A(e))return O.NON_NULL;ae(!1,`Unexpected type: "${m(e)}".`)}},name:{type:L,resolve:s(e=>"name"in e?e.name:void 0,"resolve")},description:{type:L,resolve:s(e=>"description"in e?e.description:void 0,"resolve")},specifiedByURL:{type:L,resolve:s(e=>"specifiedByURL"in e?e.specifiedByURL:void 0,"resolve")},fields:{type:new w(new E(Ht)),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(G(e)||C(e)){let n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},interfaces:{type:new w(new E(Z)),resolve(e){if(G(e)||C(e))return e.getInterfaces()}},possibleTypes:{type:new w(new E(Z)),resolve(e,t,n,{schema:i}){if(xe(e))return i.getPossibleTypes(e)}},enumValues:{type:new w(new E(Xt)),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Y(e)){let n=e.getValues();return t?n:n.filter(i=>i.deprecationReason==null)}}},inputFields:{type:new w(new E(ze)),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(F(e)){let n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},ofType:{type:Z,resolve:s(e=>"ofType"in e?e.ofType:void 0,"resolve")},isOneOf:{type:j,resolve:s(e=>{if(F(e))return e.isOneOf},"resolve")}}),"fields")}),Ht=new M({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:s(()=>({name:{type:new E(L),resolve:s(e=>e.name,"resolve")},description:{type:L,resolve:s(e=>e.description,"resolve")},args:{type:new E(new w(new E(ze))),args:{includeDeprecated:{type:j,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new E(Z),resolve:s(e=>e.type,"resolve")},isDeprecated:{type:new E(j),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:L,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),ze=new M({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:s(()=>({name:{type:new E(L),resolve:s(e=>e.name,"resolve")},description:{type:L,resolve:s(e=>e.description,"resolve")},type:{type:new E(Z),resolve:s(e=>e.type,"resolve")},defaultValue:{type:L,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,i=be(n,t);return i?P(i):null}},isDeprecated:{type:new E(j),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:L,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),Xt=new M({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:s(()=>({name:{type:new E(L),resolve:s(e=>e.name,"resolve")},description:{type:L,resolve:s(e=>e.description,"resolve")},isDeprecated:{type:new E(j),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:L,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),O;(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(O||(O={}));var Wt=new ce({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:O.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:O.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:O.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:O.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:O.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:O.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:O.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:O.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),St={name:"__schema",type:new E(Ye),description:"Access the current type schema of this server.",args:[],resolve:s((e,t,n,{schema:i})=>i,"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Ot={name:"__type",type:Z,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new E(L),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:s((e,{name:t},n,{schema:i})=>i.getType(t),"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Lt={name:"__typename",type:new E(L),description:"The name of the current Object type at runtime.",args:[],resolve:s((e,t,n,{parentType:i})=>i.name,"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Zt=Object.freeze([Ye,zt,Kt,Z,Ht,ze,Xt,Wt]);var Ke=class{static{s(this,"GraphQLSchema")}constructor(t){var n,i;this.__validationErrors=t.assumeValid===!0?[]:void 0,k(t)||b(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||b(!1,`"types" must be Array if provided but got: ${m(t.types)}.`),!t.directives||Array.isArray(t.directives)||b(!1,`"directives" must be Array if provided but got: ${m(t.directives)}.`),this.description=t.description,this.extensions=$(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(i=t.directives)!==null&&i!==void 0?i:Yt;let r=new Set(t.types);if(t.types!=null)for(let o of t.types)r.delete(o),ie(o,r);this._queryType!=null&&ie(this._queryType,r),this._mutationType!=null&&ie(this._mutationType,r),this._subscriptionType!=null&&ie(this._subscriptionType,r);for(let o of this._directives)if(Jt(o))for(let a of o.args)ie(a.type,r);ie(Ye,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let o of r){if(o==null)continue;let a=o.name;if(a||b(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[a]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${a}".`);if(this._typeMap[a]=o,C(o)){for(let c of o.getInterfaces())if(C(c)){let d=this._implementationsMap[c.name];d===void 0&&(d=this._implementationsMap[c.name]={objects:[],interfaces:[]}),d.interfaces.push(o)}}else if(G(o)){for(let c of o.getInterfaces())if(C(c)){let d=this._implementationsMap[c.name];d===void 0&&(d=this._implementationsMap[c.name]={objects:[],interfaces:[]}),d.objects.push(o)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case H.QUERY:return this.getQueryType();case H.MUTATION:return this.getMutationType();case H.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return X(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let n=this._implementationsMap[t.name];return n??{objects:[],interfaces:[]}}isSubType(t,n){let i=this._subTypeMap[t.name];if(i===void 0){if(i=Object.create(null),X(t))for(let r of t.getTypes())i[r.name]=!0;else{let r=this.getImplementations(t);for(let o of r.objects)i[o.name]=!0;for(let o of r.interfaces)i[o.name]=!0}this._subTypeMap[t.name]=i}return i[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}};function ie(e,t){let n=ne(e);if(!t.has(n)){if(t.add(n),X(n))for(let i of n.getTypes())ie(i,t);else if(G(n)||C(n)){for(let i of n.getInterfaces())ie(i,t);for(let i of Object.values(n.getFields())){ie(i.type,t);for(let r of i.args)ie(r.type,t)}}else if(F(n))for(let i of Object.values(n.getFields()))ie(i.type,t)}return t}s(ie,"collectReferencedTypes");function Ne(e,t){switch(t.kind){case p.LIST_TYPE:{let n=Ne(e,t.type);return n&&new w(n)}case p.NON_NULL_TYPE:{let n=Ne(e,t.type);return n&&new E(n)}case p.NAMED_TYPE:return e.getType(t.name.value)}}s(Ne,"typeFromAST");var Ee=class{static{s(this,"TypeInfo")}constructor(t,n,i){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i??mi,n&&(z(n)&&this._inputTypeStack.push(n),ue(n)&&this._parentTypeStack.push(n),fe(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){let n=this._schema;switch(t.kind){case p.SELECTION_SET:{let r=ne(this.getType());this._parentTypeStack.push(ue(r)?r:void 0);break}case p.FIELD:{let r=this.getParentType(),o,a;r&&(o=this._getFieldDef(n,r,t),o&&(a=o.type)),this._fieldDefStack.push(o),this._typeStack.push(fe(a)?a:void 0);break}case p.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case p.OPERATION_DEFINITION:{let r=n.getRootType(t.operation);this._typeStack.push(G(r)?r:void 0);break}case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:{let r=t.typeCondition,o=r?Ne(n,r):ne(this.getType());this._typeStack.push(fe(o)?o:void 0);break}case p.VARIABLE_DEFINITION:{let r=Ne(n,t.type);this._inputTypeStack.push(z(r)?r:void 0);break}case p.ARGUMENT:{var i;let r,o,a=(i=this.getDirective())!==null&&i!==void 0?i:this.getFieldDef();a&&(r=a.args.find(c=>c.name===t.name.value),r&&(o=r.type)),this._argument=r,this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(z(o)?o:void 0);break}case p.LIST:{let r=Nt(this.getInputType()),o=B(r)?r.ofType:r;this._defaultValueStack.push(void 0),this._inputTypeStack.push(z(o)?o:void 0);break}case p.OBJECT_FIELD:{let r=ne(this.getInputType()),o,a;F(r)&&(a=r.getFields()[t.name.value],a&&(o=a.type)),this._defaultValueStack.push(a?a.defaultValue:void 0),this._inputTypeStack.push(z(o)?o:void 0);break}case p.ENUM:{let r=ne(this.getInputType()),o;Y(r)&&(o=r.getValue(t.value)),this._enumValue=o;break}default:}}leave(t){switch(t.kind){case p.SELECTION_SET:this._parentTypeStack.pop();break;case p.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case p.DIRECTIVE:this._directive=null;break;case p.OPERATION_DEFINITION:case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:this._typeStack.pop();break;case p.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case p.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case p.LIST:case p.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case p.ENUM:this._enumValue=null;break;default:}}};function mi(e,t,n){let i=n.name.value;if(i===St.name&&e.getQueryType()===t)return St;if(i===Ot.name&&e.getQueryType()===t)return Ot;if(i===Lt.name&&ue(t))return Lt;if(G(t)||C(t))return t.getFields()[i]}s(mi,"getFieldDef");function Ce(e,t){return{enter(...n){let i=n[0];e.enter(i);let r=Re(t,i.kind).enter;if(r){let o=r.apply(t,n);return o!==void 0&&(e.leave(i),Ge(o)&&e.enter(o)),o}},leave(...n){let i=n[0],r=Re(t,i.kind).leave,o;return r&&(o=r.apply(t,n)),e.leave(i),o}}}s(Ce,"visitWithTypeInfo");function At(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}s(At,"printPathArray");function en(e,t,n){return{prev:e,key:t,typename:n}}s(en,"addPath");function re(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}s(re,"pathToArray");function tn(e,t,n=hi){return He(e,t,n,void 0)}s(tn,"coerceInputValue");function hi(e,t,n){let i="Invalid value "+m(t);throw e.length>0&&(i+=` at "value${At(e)}"`),n.message=i+": "+n.message,n}s(hi,"defaultOnError");function He(e,t,n,i){if(A(t)){if(e!=null)return He(e,t.ofType,n,i);n(re(i),e,new h(`Expected non-nullable type "${m(t)}" not to be null.`));return}if(e==null)return null;if(B(t)){let r=t.ofType;return _t(e)?Array.from(e,(o,a)=>{let c=en(i,a,void 0);return He(o,r,n,c)}):[He(e,r,n,i)]}if(F(t)){if(!k(e)){n(re(i),e,new h(`Expected type "${t.name}" to be an object.`));return}let r={},o=t.getFields();for(let a of Object.values(o)){let c=e[a.name];if(c===void 0){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(A(a.type)){let d=m(a.type);n(re(i),e,new h(`Field "${a.name}" of required type "${d}" was not provided.`))}continue}r[a.name]=He(c,a.type,n,en(i,a.name,t.name))}for(let a of Object.keys(e))if(!o[a]){let c=lt(a,Object.keys(t.getFields()));n(re(i),e,new h(`Field "${a}" is not defined by type "${t.name}".`+ct(c)))}if(t.isOneOf){let a=Object.keys(r);a.length!==1&&n(re(i),e,new h(`Exactly one key must be specified for OneOf type "${t.name}".`));let c=a[0],d=r[c];d===null&&n(re(i).concat(c),d,new h(`Field "${c}" must be non-null.`))}return r}if(Te(t)){let r;try{r=t.parseValue(e)}catch(o){o instanceof h?n(re(i),e,o):n(re(i),e,new h(`Expected type "${t.name}". `+o.message,{originalError:o}));return}return r===void 0&&n(re(i),e,new h(`Expected type "${t.name}".`)),r}ae(!1,"Unexpected input type: "+m(t))}s(He,"coerceInputValueImpl");function le(e,t,n){if(e){if(e.kind===p.VARIABLE){let i=e.name.value;if(n==null||n[i]===void 0)return;let r=n[i];return r===null&&A(t)?void 0:r}if(A(t))return e.kind===p.NULL?void 0:le(e,t.ofType,n);if(e.kind===p.NULL)return null;if(B(t)){let i=t.ofType;if(e.kind===p.LIST){let o=[];for(let a of e.values)if(kn(a,n)){if(A(i))return;o.push(null)}else{let c=le(a,i,n);if(c===void 0)return;o.push(c)}return o}let r=le(e,i,n);return r===void 0?void 0:[r]}if(F(t)){if(e.kind!==p.OBJECT)return;let i=Object.create(null),r=we(e.fields,o=>o.name.value);for(let o of Object.values(t.getFields())){let a=r[o.name];if(!a||kn(a.value,n)){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(A(o.type))return;continue}let c=le(a.value,o.type,n);if(c===void 0)return;i[o.name]=c}if(t.isOneOf){let o=Object.keys(i);if(o.length!==1||i[o[0]]===null)return}return i}if(Te(t)){let i;try{i=t.parseLiteral(e,n)}catch{return}return i===void 0?void 0:i}ae(!1,"Unexpected input type: "+m(t))}}s(le,"valueFromAST");function kn(e,t){return e.kind===p.VARIABLE&&(t==null||t[e.name.value]===void 0)}s(kn,"isMissingVariable");function Dt(e,t,n,i){let r=[],o=i?.maxErrors;try{let a=yi(e,t,n,c=>{if(o!=null&&r.length>=o)throw new h("Too many errors processing variables, error limit reached. Execution aborted.");r.push(c)});if(r.length===0)return{coerced:a}}catch(a){r.push(a)}return{errors:r}}s(Dt,"getVariableValues");function yi(e,t,n,i){let r={};for(let o of t){let a=o.variable.name.value,c=Ne(e,o.type);if(!z(c)){let f=P(o.type);i(new h(`Variable "$${a}" expected value of type "${f}" which cannot be used as an input type.`,{nodes:o.type}));continue}if(!Cn(n,a)){if(o.defaultValue)r[a]=le(o.defaultValue,c);else if(A(c)){let f=m(c);i(new h(`Variable "$${a}" of required type "${f}" was not provided.`,{nodes:o}))}continue}let d=n[a];if(d===null&&A(c)){let f=m(c);i(new h(`Variable "$${a}" of non-null type "${f}" must not be null.`,{nodes:o}));continue}r[a]=tn(d,c,(f,T,x)=>{let N=`Variable "$${a}" got invalid value `+m(T);f.length>0&&(N+=` at "${a}${At(f)}"`),i(new h(N+"; "+x.message,{nodes:o,originalError:x}))})}return r}s(yi,"coerceVariableValues");function Xe(e,t,n){var i;let r={},o=(i=t.arguments)!==null&&i!==void 0?i:[],a=we(o,c=>c.name.value);for(let c of e.args){let d=c.name,f=c.type,T=a[d];if(!T){if(c.defaultValue!==void 0)r[d]=c.defaultValue;else if(A(f))throw new h(`Argument "${d}" of required type "${m(f)}" was not provided.`,{nodes:t});continue}let x=T.value,N=x.kind===p.NULL;if(x.kind===p.VARIABLE){let g=x.name.value;if(n==null||!Cn(n,g)){if(c.defaultValue!==void 0)r[d]=c.defaultValue;else if(A(f))throw new h(`Argument "${d}" of required type "${m(f)}" was provided the variable "$${g}" which was not provided a runtime value.`,{nodes:x});continue}N=n[g]==null}if(N&&A(f))throw new h(`Argument "${d}" of non-null type "${m(f)}" must not be null.`,{nodes:x});let S=le(x,f,n);if(S===void 0)throw new h(`Argument "${d}" has invalid value ${P(x)}.`,{nodes:x});r[d]=S}return r}s(Xe,"getArgumentValues");function We(e,t,n){var i;let r=(i=t.directives)===null||i===void 0?void 0:i.find(o=>o.name.value===e.name);if(r)return Xe(e,r,n)}s(We,"getDirectiveValues");function Cn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}s(Cn,"hasOwnProperty");var nn=class{static{s(this,"ASTValidationContext")}constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let i of this.getDocument().definitions)i.kind===p.FRAGMENT_DEFINITION&&(n[i.name.value]=i);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let i=[t],r;for(;r=i.pop();)for(let o of r.selections)o.kind===p.FRAGMENT_SPREAD?n.push(o):o.selectionSet&&i.push(o.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let i=Object.create(null),r=[t.selectionSet],o;for(;o=r.pop();)for(let a of this.getFragmentSpreads(o)){let c=a.name.value;if(i[c]!==!0){i[c]=!0;let d=this.getFragment(c);d&&(n.push(d),r.push(d.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}};var Fe=class extends nn{static{s(this,"ValidationContext")}constructor(t,n,i,r){super(n,r),this._schema=t,this._typeInfo=i,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){let i=[],r=new Ee(this._schema);he(t,Ce(r,{VariableDefinition:s(()=>!1,"VariableDefinition"),Variable(o){i.push({node:o,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),n=i,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(let i of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(i));this._recursiveVariableUsages.set(t,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}};function wt(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e},n=t.descriptions?"description":"",i=t.specifiedByUrl?"specifiedByURL":"",r=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?n:"";function a(d){return t.inputValueDeprecation?d:""}s(a,"inputDeprecation");let c=t.oneOf?"isOneOf":"";return`
75
+ 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:s(()=>({name:{type:new E(L),resolve:s(e=>e.name,"resolve")},description:{type:L,resolve:s(e=>e.description,"resolve")},isRepeatable:{type:new E(P),resolve:s(e=>e.isRepeatable,"resolve")},locations:{type:new E(new w(new E(Ht))),resolve:s(e=>e.locations,"resolve")},args:{type:new E(new w(new E(ze))),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}}),"fields")}),Ht=new ce({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:I.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:I.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:I.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:I.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:I.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:I.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:I.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:I.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:I.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:I.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:I.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:I.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:I.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:I.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:I.UNION,description:"Location adjacent to a union definition."},ENUM:{value:I.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:I.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:I.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:I.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Z=new G({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:s(()=>({kind:{type:new E(Wt),resolve(e){if(ye(e))return O.SCALAR;if(M(e))return O.OBJECT;if(C(e))return O.INTERFACE;if(X(e))return O.UNION;if(Y(e))return O.ENUM;if(F(e))return O.INPUT_OBJECT;if(B(e))return O.LIST;if(A(e))return O.NON_NULL;ae(!1,`Unexpected type: "${m(e)}".`)}},name:{type:L,resolve:s(e=>"name"in e?e.name:void 0,"resolve")},description:{type:L,resolve:s(e=>"description"in e?e.description:void 0,"resolve")},specifiedByURL:{type:L,resolve:s(e=>"specifiedByURL"in e?e.specifiedByURL:void 0,"resolve")},fields:{type:new w(new E(Kt)),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(M(e)||C(e)){let n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},interfaces:{type:new w(new E(Z)),resolve(e){if(M(e)||C(e))return e.getInterfaces()}},possibleTypes:{type:new w(new E(Z)),resolve(e,t,n,{schema:i}){if(xe(e))return i.getPossibleTypes(e)}},enumValues:{type:new w(new E(Xt)),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Y(e)){let n=e.getValues();return t?n:n.filter(i=>i.deprecationReason==null)}}},inputFields:{type:new w(new E(ze)),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(F(e)){let n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},ofType:{type:Z,resolve:s(e=>"ofType"in e?e.ofType:void 0,"resolve")},isOneOf:{type:P,resolve:s(e=>{if(F(e))return e.isOneOf},"resolve")}}),"fields")}),Kt=new G({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:s(()=>({name:{type:new E(L),resolve:s(e=>e.name,"resolve")},description:{type:L,resolve:s(e=>e.description,"resolve")},args:{type:new E(new w(new E(ze))),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new E(Z),resolve:s(e=>e.type,"resolve")},isDeprecated:{type:new E(P),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:L,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),ze=new G({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:s(()=>({name:{type:new E(L),resolve:s(e=>e.name,"resolve")},description:{type:L,resolve:s(e=>e.description,"resolve")},type:{type:new E(Z),resolve:s(e=>e.type,"resolve")},defaultValue:{type:L,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,i=be(n,t);return i?$(i):null}},isDeprecated:{type:new E(P),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:L,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),Xt=new G({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:s(()=>({name:{type:new E(L),resolve:s(e=>e.name,"resolve")},description:{type:L,resolve:s(e=>e.description,"resolve")},isDeprecated:{type:new E(P),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:L,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),O;(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(O||(O={}));var Wt=new ce({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:O.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:O.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:O.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:O.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:O.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:O.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:O.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:O.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),St={name:"__schema",type:new E(Ye),description:"Access the current type schema of this server.",args:[],resolve:s((e,t,n,{schema:i})=>i,"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Ot={name:"__type",type:Z,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new E(L),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:s((e,{name:t},n,{schema:i})=>i.getType(t),"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Lt={name:"__typename",type:new E(L),description:"The name of the current Object type at runtime.",args:[],resolve:s((e,t,n,{parentType:i})=>i.name,"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Zt=Object.freeze([Ye,zt,Ht,Z,Kt,ze,Xt,Wt]);var He=class{static{s(this,"GraphQLSchema")}constructor(t){var n,i;this.__validationErrors=t.assumeValid===!0?[]:void 0,k(t)||b(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||b(!1,`"types" must be Array if provided but got: ${m(t.types)}.`),!t.directives||Array.isArray(t.directives)||b(!1,`"directives" must be Array if provided but got: ${m(t.directives)}.`),this.description=t.description,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(i=t.directives)!==null&&i!==void 0?i:Yt;let r=new Set(t.types);if(t.types!=null)for(let o of t.types)r.delete(o),ie(o,r);this._queryType!=null&&ie(this._queryType,r),this._mutationType!=null&&ie(this._mutationType,r),this._subscriptionType!=null&&ie(this._subscriptionType,r);for(let o of this._directives)if(Jt(o))for(let a of o.args)ie(a.type,r);ie(Ye,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let o of r){if(o==null)continue;let a=o.name;if(a||b(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[a]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${a}".`);if(this._typeMap[a]=o,C(o)){for(let c of o.getInterfaces())if(C(c)){let d=this._implementationsMap[c.name];d===void 0&&(d=this._implementationsMap[c.name]={objects:[],interfaces:[]}),d.interfaces.push(o)}}else if(M(o)){for(let c of o.getInterfaces())if(C(c)){let d=this._implementationsMap[c.name];d===void 0&&(d=this._implementationsMap[c.name]={objects:[],interfaces:[]}),d.objects.push(o)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case K.QUERY:return this.getQueryType();case K.MUTATION:return this.getMutationType();case K.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return X(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let n=this._implementationsMap[t.name];return n??{objects:[],interfaces:[]}}isSubType(t,n){let i=this._subTypeMap[t.name];if(i===void 0){if(i=Object.create(null),X(t))for(let r of t.getTypes())i[r.name]=!0;else{let r=this.getImplementations(t);for(let o of r.objects)i[o.name]=!0;for(let o of r.interfaces)i[o.name]=!0}this._subTypeMap[t.name]=i}return i[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}};function ie(e,t){let n=ne(e);if(!t.has(n)){if(t.add(n),X(n))for(let i of n.getTypes())ie(i,t);else if(M(n)||C(n)){for(let i of n.getInterfaces())ie(i,t);for(let i of Object.values(n.getFields())){ie(i.type,t);for(let r of i.args)ie(r.type,t)}}else if(F(n))for(let i of Object.values(n.getFields()))ie(i.type,t)}return t}s(ie,"collectReferencedTypes");function Ne(e,t){switch(t.kind){case p.LIST_TYPE:{let n=Ne(e,t.type);return n&&new w(n)}case p.NON_NULL_TYPE:{let n=Ne(e,t.type);return n&&new E(n)}case p.NAMED_TYPE:return e.getType(t.name.value)}}s(Ne,"typeFromAST");var Ee=class{static{s(this,"TypeInfo")}constructor(t,n,i){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i??mi,n&&(z(n)&&this._inputTypeStack.push(n),ue(n)&&this._parentTypeStack.push(n),fe(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){let n=this._schema;switch(t.kind){case p.SELECTION_SET:{let r=ne(this.getType());this._parentTypeStack.push(ue(r)?r:void 0);break}case p.FIELD:{let r=this.getParentType(),o,a;r&&(o=this._getFieldDef(n,r,t),o&&(a=o.type)),this._fieldDefStack.push(o),this._typeStack.push(fe(a)?a:void 0);break}case p.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case p.OPERATION_DEFINITION:{let r=n.getRootType(t.operation);this._typeStack.push(M(r)?r:void 0);break}case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:{let r=t.typeCondition,o=r?Ne(n,r):ne(this.getType());this._typeStack.push(fe(o)?o:void 0);break}case p.VARIABLE_DEFINITION:{let r=Ne(n,t.type);this._inputTypeStack.push(z(r)?r:void 0);break}case p.ARGUMENT:{var i;let r,o,a=(i=this.getDirective())!==null&&i!==void 0?i:this.getFieldDef();a&&(r=a.args.find(c=>c.name===t.name.value),r&&(o=r.type)),this._argument=r,this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(z(o)?o:void 0);break}case p.LIST:{let r=Nt(this.getInputType()),o=B(r)?r.ofType:r;this._defaultValueStack.push(void 0),this._inputTypeStack.push(z(o)?o:void 0);break}case p.OBJECT_FIELD:{let r=ne(this.getInputType()),o,a;F(r)&&(a=r.getFields()[t.name.value],a&&(o=a.type)),this._defaultValueStack.push(a?a.defaultValue:void 0),this._inputTypeStack.push(z(o)?o:void 0);break}case p.ENUM:{let r=ne(this.getInputType()),o;Y(r)&&(o=r.getValue(t.value)),this._enumValue=o;break}default:}}leave(t){switch(t.kind){case p.SELECTION_SET:this._parentTypeStack.pop();break;case p.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case p.DIRECTIVE:this._directive=null;break;case p.OPERATION_DEFINITION:case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:this._typeStack.pop();break;case p.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case p.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case p.LIST:case p.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case p.ENUM:this._enumValue=null;break;default:}}};function mi(e,t,n){let i=n.name.value;if(i===St.name&&e.getQueryType()===t)return St;if(i===Ot.name&&e.getQueryType()===t)return Ot;if(i===Lt.name&&ue(t))return Lt;if(M(t)||C(t))return t.getFields()[i]}s(mi,"getFieldDef");function Ce(e,t){return{enter(...n){let i=n[0];e.enter(i);let r=Re(t,i.kind).enter;if(r){let o=r.apply(t,n);return o!==void 0&&(e.leave(i),Me(o)&&e.enter(o)),o}},leave(...n){let i=n[0],r=Re(t,i.kind).leave,o;return r&&(o=r.apply(t,n)),e.leave(i),o}}}s(Ce,"visitWithTypeInfo");function At(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}s(At,"printPathArray");function en(e,t,n){return{prev:e,key:t,typename:n}}s(en,"addPath");function re(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}s(re,"pathToArray");function tn(e,t,n=hi){return Ke(e,t,n,void 0)}s(tn,"coerceInputValue");function hi(e,t,n){let i="Invalid value "+m(t);throw e.length>0&&(i+=` at "value${At(e)}"`),n.message=i+": "+n.message,n}s(hi,"defaultOnError");function Ke(e,t,n,i){if(A(t)){if(e!=null)return Ke(e,t.ofType,n,i);n(re(i),e,new h(`Expected non-nullable type "${m(t)}" not to be null.`));return}if(e==null)return null;if(B(t)){let r=t.ofType;return _t(e)?Array.from(e,(o,a)=>{let c=en(i,a,void 0);return Ke(o,r,n,c)}):[Ke(e,r,n,i)]}if(F(t)){if(!k(e)){n(re(i),e,new h(`Expected type "${t.name}" to be an object.`));return}let r={},o=t.getFields();for(let a of Object.values(o)){let c=e[a.name];if(c===void 0){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(A(a.type)){let d=m(a.type);n(re(i),e,new h(`Field "${a.name}" of required type "${d}" was not provided.`))}continue}r[a.name]=Ke(c,a.type,n,en(i,a.name,t.name))}for(let a of Object.keys(e))if(!o[a]){let c=lt(a,Object.keys(t.getFields()));n(re(i),e,new h(`Field "${a}" is not defined by type "${t.name}".`+ct(c)))}if(t.isOneOf){let a=Object.keys(r);a.length!==1&&n(re(i),e,new h(`Exactly one key must be specified for OneOf type "${t.name}".`));let c=a[0],d=r[c];d===null&&n(re(i).concat(c),d,new h(`Field "${c}" must be non-null.`))}return r}if(Te(t)){let r;try{r=t.parseValue(e)}catch(o){o instanceof h?n(re(i),e,o):n(re(i),e,new h(`Expected type "${t.name}". `+o.message,{originalError:o}));return}return r===void 0&&n(re(i),e,new h(`Expected type "${t.name}".`)),r}ae(!1,"Unexpected input type: "+m(t))}s(Ke,"coerceInputValueImpl");function le(e,t,n){if(e){if(e.kind===p.VARIABLE){let i=e.name.value;if(n==null||n[i]===void 0)return;let r=n[i];return r===null&&A(t)?void 0:r}if(A(t))return e.kind===p.NULL?void 0:le(e,t.ofType,n);if(e.kind===p.NULL)return null;if(B(t)){let i=t.ofType;if(e.kind===p.LIST){let o=[];for(let a of e.values)if(kn(a,n)){if(A(i))return;o.push(null)}else{let c=le(a,i,n);if(c===void 0)return;o.push(c)}return o}let r=le(e,i,n);return r===void 0?void 0:[r]}if(F(t)){if(e.kind!==p.OBJECT)return;let i=Object.create(null),r=we(e.fields,o=>o.name.value);for(let o of Object.values(t.getFields())){let a=r[o.name];if(!a||kn(a.value,n)){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(A(o.type))return;continue}let c=le(a.value,o.type,n);if(c===void 0)return;i[o.name]=c}if(t.isOneOf){let o=Object.keys(i);if(o.length!==1||i[o[0]]===null)return}return i}if(Te(t)){let i;try{i=t.parseLiteral(e,n)}catch{return}return i===void 0?void 0:i}ae(!1,"Unexpected input type: "+m(t))}}s(le,"valueFromAST");function kn(e,t){return e.kind===p.VARIABLE&&(t==null||t[e.name.value]===void 0)}s(kn,"isMissingVariable");function Dt(e,t,n,i){let r=[],o=i?.maxErrors;try{let a=yi(e,t,n,c=>{if(o!=null&&r.length>=o)throw new h("Too many errors processing variables, error limit reached. Execution aborted.");r.push(c)});if(r.length===0)return{coerced:a}}catch(a){r.push(a)}return{errors:r}}s(Dt,"getVariableValues");function yi(e,t,n,i){let r={};for(let o of t){let a=o.variable.name.value,c=Ne(e,o.type);if(!z(c)){let f=$(o.type);i(new h(`Variable "$${a}" expected value of type "${f}" which cannot be used as an input type.`,{nodes:o.type}));continue}if(!Cn(n,a)){if(o.defaultValue)r[a]=le(o.defaultValue,c);else if(A(c)){let f=m(c);i(new h(`Variable "$${a}" of required type "${f}" was not provided.`,{nodes:o}))}continue}let d=n[a];if(d===null&&A(c)){let f=m(c);i(new h(`Variable "$${a}" of non-null type "${f}" must not be null.`,{nodes:o}));continue}r[a]=tn(d,c,(f,T,x)=>{let N=`Variable "$${a}" got invalid value `+m(T);f.length>0&&(N+=` at "${a}${At(f)}"`),i(new h(N+"; "+x.message,{nodes:o,originalError:x}))})}return r}s(yi,"coerceVariableValues");function Xe(e,t,n){var i;let r={},o=(i=t.arguments)!==null&&i!==void 0?i:[],a=we(o,c=>c.name.value);for(let c of e.args){let d=c.name,f=c.type,T=a[d];if(!T){if(c.defaultValue!==void 0)r[d]=c.defaultValue;else if(A(f))throw new h(`Argument "${d}" of required type "${m(f)}" was not provided.`,{nodes:t});continue}let x=T.value,N=x.kind===p.NULL;if(x.kind===p.VARIABLE){let g=x.name.value;if(n==null||!Cn(n,g)){if(c.defaultValue!==void 0)r[d]=c.defaultValue;else if(A(f))throw new h(`Argument "${d}" of required type "${m(f)}" was provided the variable "$${g}" which was not provided a runtime value.`,{nodes:x});continue}N=n[g]==null}if(N&&A(f))throw new h(`Argument "${d}" of non-null type "${m(f)}" must not be null.`,{nodes:x});let S=le(x,f,n);if(S===void 0)throw new h(`Argument "${d}" has invalid value ${$(x)}.`,{nodes:x});r[d]=S}return r}s(Xe,"getArgumentValues");function We(e,t,n){var i;let r=(i=t.directives)===null||i===void 0?void 0:i.find(o=>o.name.value===e.name);if(r)return Xe(e,r,n)}s(We,"getDirectiveValues");function Cn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}s(Cn,"hasOwnProperty");var nn=class{static{s(this,"ASTValidationContext")}constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let i of this.getDocument().definitions)i.kind===p.FRAGMENT_DEFINITION&&(n[i.name.value]=i);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let i=[t],r;for(;r=i.pop();)for(let o of r.selections)o.kind===p.FRAGMENT_SPREAD?n.push(o):o.selectionSet&&i.push(o.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let i=Object.create(null),r=[t.selectionSet],o;for(;o=r.pop();)for(let a of this.getFragmentSpreads(o)){let c=a.name.value;if(i[c]!==!0){i[c]=!0;let d=this.getFragment(c);d&&(n.push(d),r.push(d.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}};var Fe=class extends nn{static{s(this,"ValidationContext")}constructor(t,n,i,r){super(n,r),this._schema=t,this._typeInfo=i,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){let i=[],r=new Ee(this._schema);he(t,Ce(r,{VariableDefinition:s(()=>!1,"VariableDefinition"),Variable(o){i.push({node:o,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),n=i,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(let i of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(i));this._recursiveVariableUsages.set(t,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}};function wt(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e},n=t.descriptions?"description":"",i=t.specifiedByUrl?"specifiedByURL":"",r=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?n:"";function a(d){return t.inputValueDeprecation?d:""}s(a,"inputDeprecation");let c=t.oneOf?"isOneOf":"";return`
76
76
  query IntrospectionQuery {
77
77
  __schema {
78
78
  ${o}
@@ -178,5 +178,5 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
178
178
  }
179
179
  }
180
180
  }
181
- `}s(wt,"getIntrospectionQuery");function Rt(e,t){k(e)&&k(e.__schema)||b(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${m(e)}.`);let n=e.__schema,i=pe(n.types,l=>l.name,l=>N(l));for(let l of[...qt,...Zt])i[l.name]&&(i[l.name]=l);let r=n.queryType?T(n.queryType):null,o=n.mutationType?T(n.mutationType):null,a=n.subscriptionType?T(n.subscriptionType):null,c=n.directives?n.directives.map(Mn):[];return new Ke({description:n.description,query:r,mutation:o,subscription:a,types:Object.values(i),directives:c,assumeValid:t?.assumeValid});function d(l){if(l.kind===O.LIST){let v=l.ofType;if(!v)throw new Error("Decorated type deeper than introspection query.");return new w(d(v))}if(l.kind===O.NON_NULL){let v=l.ofType;if(!v)throw new Error("Decorated type deeper than introspection query.");let oe=d(v);return new E(xt(oe))}return f(l)}function f(l){let v=l.name;if(!v)throw new Error(`Unknown type reference: ${m(l)}.`);let oe=i[v];if(!oe)throw new Error(`Invalid or incomplete schema, unknown type: ${v}. Ensure that a full introspection query is used in order to build a client schema.`);return oe}function T(l){return ht(f(l))}function x(l){return yt(f(l))}function N(l){if(l!=null&&l.name!=null&&l.kind!=null)switch(l.kind){case O.SCALAR:return S(l);case O.OBJECT:return U(l);case O.INTERFACE:return K(l);case O.UNION:return V(l);case O.ENUM:return me(l);case O.INPUT_OBJECT:return se(l)}let v=m(l);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${v}.`)}function S(l){return new J({name:l.name,description:l.description,specifiedByURL:l.specifiedByURL})}function g(l){if(l.interfaces===null&&l.kind===O.INTERFACE)return[];if(!l.interfaces){let v=m(l);throw new Error(`Introspection result missing interfaces: ${v}.`)}return l.interfaces.map(x)}function U(l){return new M({name:l.name,description:l.description,interfaces:s(()=>g(l),"interfaces"),fields:s(()=>ee(l),"fields")})}function K(l){return new de({name:l.name,description:l.description,interfaces:s(()=>g(l),"interfaces"),fields:s(()=>ee(l),"fields")})}function V(l){if(!l.possibleTypes){let v=m(l);throw new Error(`Introspection result missing possibleTypes: ${v}.`)}return new ve({name:l.name,description:l.description,types:s(()=>l.possibleTypes.map(T),"types")})}function me(l){if(!l.enumValues){let v=m(l);throw new Error(`Introspection result missing enumValues: ${v}.`)}return new ce({name:l.name,description:l.description,values:pe(l.enumValues,v=>v.name,v=>({description:v.description,deprecationReason:v.deprecationReason}))})}function se(l){if(!l.inputFields){let v=m(l);throw new Error(`Introspection result missing inputFields: ${v}.`)}return new Ie({name:l.name,description:l.description,fields:s(()=>_e(l.inputFields),"fields"),isOneOf:l.isOneOf})}function ee(l){if(!l.fields)throw new Error(`Introspection result missing fields: ${m(l)}.`);return pe(l.fields,v=>v.name,Ue)}function Ue(l){let v=d(l.type);if(!fe(v)){let oe=m(v);throw new Error(`Introspection must provide output type for fields, but received: ${oe}.`)}if(!l.args){let oe=m(l);throw new Error(`Introspection result missing field args: ${oe}.`)}return{description:l.description,deprecationReason:l.deprecationReason,type:v,args:_e(l.args)}}function _e(l){return pe(l,v=>v.name,Ze)}function Ze(l){let v=d(l.type);if(!z(v)){let Gn=m(v);throw new Error(`Introspection must provide input type for arguments, but received: ${Gn}.`)}let oe=l.defaultValue!=null?le(pt(l.defaultValue),v):void 0;return{description:l.description,type:v,defaultValue:oe,deprecationReason:l.deprecationReason}}function Mn(l){if(!l.args){let v=m(l);throw new Error(`Introspection result missing directive args: ${v}.`)}if(!l.locations){let v=m(l);throw new Error(`Introspection result missing directive locations: ${v}.`)}return new W({name:l.name,description:l.description,isRepeatable:l.isRepeatable,locations:l.locations.slice(),args:_e(l.args)})}}s(Rt,"buildClientSchema");function ji(e,t){return`The query exceeds the maximum complexity of ${e}. Actual complexity is ${t}`}s(ji,"queryComplexityMessage");function Fn(e){let t=new Ee(e.schema),n=[],i=new Fe(e.schema,e.query,t,o=>n.push(o)),r=new rn(i,{maximumComplexity:e.maximumComplexity??1/0,estimators:e.estimators,variables:e.variables,operationName:e.operationName,context:e.context});if(he(e.query,Ce(t,r)),n.length)throw n.pop();return r.complexity}s(Fn,"getComplexity");var rn=class{static{s(this,"QueryComplexity")}context;complexity;options;OperationDefinition;estimators;includeDirectiveDef;skipDirectiveDef;variableValues;requestContext;constructor(t,n){if(Number(n.maximumComplexity)<=0)throw new Error("Maximum query complexity must be a positive number");this.context=t,this.complexity=0,this.options=n,this.includeDirectiveDef=this.context.getSchema().getDirective("include")||void 0,this.skipDirectiveDef=this.context.getSchema().getDirective("skip")||void 0,this.estimators=n.estimators,this.variableValues={},this.requestContext=n.context,this.OperationDefinition={enter:this.onOperationDefinitionEnter,leave:this.onOperationDefinitionLeave}}onOperationDefinitionEnter(t){if(typeof this.options.operationName=="string"&&this.options.operationName!==t.name?.value)return;let{coerced:n,errors:i}=Dt(this.context.getSchema(),t.variableDefinitions?[...t.variableDefinitions]:[],this.options.variables??{});if(i?.length){i.forEach(o=>this.context.reportError(o));return}this.variableValues=n||{};let r=this.context.getSchema();switch(t.operation){case"query":{let o=r.getQueryType();if(!o)throw new Error("Schema does not define the required query root type");this.complexity+=this.nodeComplexity(t,o);break}case"mutation":{let o=r.getMutationType();if(!o)throw new Error("Schema does not define the required mutation root type");this.complexity+=this.nodeComplexity(t,o);break}case"subscription":{let o=r.getSubscriptionType();if(!o)throw new Error("Schema does not define the required mutation subscription type");this.complexity+=this.nodeComplexity(t,o);break}default:throw new Error(`Query complexity could not be calculated for operation of type ${t.operation}`)}}onOperationDefinitionLeave(t){if(!(typeof this.options.operationName=="string"&&this.options.operationName!==t.name?.value)&&(this.options.onComplete&&this.options.onComplete(this.complexity),this.complexity>this.options.maximumComplexity))return this.context.reportError(this.createError())}nodeComplexity(t,n){if(t.selectionSet){let i={};(n instanceof M||n instanceof de)&&(i=n.getFields());let r;xe(n)?r=this.context.getSchema().getPossibleTypes(n).map(a=>a.name):r=[n.name];let o=t.selectionSet.selections.reduce((a,c)=>{let d=a,f=!0,T=!1;for(let x of c.directives??[])switch(x.name.value){case"include":{let S=this.includeDirectiveDef&&We(this.includeDirectiveDef,c,this.variableValues||{});typeof S?.if=="boolean"&&(f=S.if);break}case"skip":{let S=this.skipDirectiveDef&&We(this.skipDirectiveDef,c,this.variableValues||{});typeof S?.if=="boolean"&&(T=S.if);break}}if(!f||T)return a;switch(c.kind){case p.FIELD:{let x=i[c.name.value];if(!x)break;let N=ne(x.type),S;try{S=Xe(x,c,this.variableValues||{})}catch(V){return this.context.reportError(V),a}let g=0;ue(N)&&(g=this.nodeComplexity(c,N));let U={childComplexity:g,args:S,field:x,node:c,type:n,context:this.requestContext};if(!this.estimators.find(V=>{let me=V(U);return typeof me=="number"&&!Number.isNaN(me)?(d=Ve(me,a,r),!0):!1}))return this.context.reportError(new h(`No complexity could be calculated for field ${n.name}.${x.name}. At least one complexity estimator has to return a complexity score.`)),a;break}case p.FRAGMENT_SPREAD:{let x=this.context.getFragment(c.name.value);if(!x)break;let N=this.context.getSchema().getType(x.typeCondition.name.value);if(!ue(N))break;let S=this.nodeComplexity(x,N);xe(N)?d=Ve(S,a,this.context.getSchema().getPossibleTypes(N).map(g=>g.name)):d=Ve(S,a,[N.name]);break}case p.INLINE_FRAGMENT:{let x=n;if(c.typeCondition?.name&&(x=this.context.getSchema().getType(c.typeCondition.name.value)||x,!ue(x)))break;let N=this.nodeComplexity(c,x);xe(x)?d=Ve(N,a,this.context.getSchema().getPossibleTypes(x).map(S=>S.name)):d=Ve(N,a,[x.name]);break}default:{d=Ve(this.nodeComplexity(c,n),a,r);break}}return d},{});return o?Math.max(...Object.values(o),0):NaN}return 0}createError(){return typeof this.options.createError=="function"?this.options.createError(this.options.maximumComplexity,this.complexity):new h(ji(this.options.maximumComplexity,this.complexity))}};function Ve(e,t,n){for(let i of n)Object.hasOwn(t,i)?t[i]+=e:t[i]=e;return t}s(Ve,"addComplexities");function Vn(e){let t=e?.defaultComplexity??1;return n=>t+n.childComplexity}s(Vn,"simpleEstimator");var Un=s((e,t,n={})=>{let{definitions:i}=e,r=$i(i),o=Pi(i);return Object.entries(o).map(([a,c])=>kt(c,r,0,t,a,n))},"depthLimit");function $i(e){return e.reduce((t,n)=>(n.kind===p.FRAGMENT_DEFINITION&&(t[n?.name?.value??""]=n),t),{})}s($i,"getFragments");function Pi(e){return e.reduce((t,n)=>{if(n.kind===p.OPERATION_DEFINITION){let i=n?.name?.value??"";t[i]=n}return t},{})}s(Pi,"getQueriesAndMutations");function kt(e,t,n,i,r,o){if(n>i)throw o?.onLimitReached?.(n,r),new h(`${r||"Your query"} exceeds maximum operation depth of ${i}`,{nodes:[e]});let a=o?.ignore??[/^__/];switch(e.kind){case p.FIELD:return Qi(e,a)||!e.selectionSet?0:1+Math.max(...e.selectionSet.selections.map(c=>kt(c,t,n+1,i,r,o)));case p.FRAGMENT_SPREAD:return kt(t[e.name.value],t,n,i,r,o);case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:case p.OPERATION_DEFINITION:return Math.max(...e.selectionSet.selections.map(c=>kt(c,t,n,i,r,o)));default:throw new Error(`uh oh! depth crawler cannot handle: ${e.kind}`)}}s(kt,"determineDepth");var Qi=s((e,t)=>t.find(n=>e.name.value.match(n)!==null)||!1,"isIgnored");var Bi=s(async(e,t)=>{if(!t.complexityLimit)throw new sn("No complexity maximum defined, you need to pass a maxComplexity to the policy");let i=t.endpointUrl;if(!i)throw new sn("No GraphQL endpoint, you need to pass a endpointUrl to the policy");let r=wt(),c=(await(await fetch(i,{method:"POST",body:JSON.stringify({query:r}),headers:{"Content-Type":"application/json"}})).json()).data;if(!c||!c?.__schema)throw new h("GraphQL introspection query failed, enable introspection or pass a schema url in configuration.");let d=Rt(c,{assumeValid:!0}),f=Fn({estimators:[Vn({defaultComplexity:1})],schema:d,query:e,variables:{count:10}});if(t.complexityLimit&&f>t.complexityLimit)throw new h(`Query is too complex (${f}/${t.complexityLimit}), remove some fields and try again`)},"applyComplexityLimitPolicy"),qi=s(async(e,t)=>{let n=t.depthLimit;if(!n)throw new sn("No maximum depth defined, you need to pass a maxDepth to the policy");return Math.max(...Un(e,n))},"applyDepthLimitPolicy"),Ji=s(async(e,t,n)=>{try{let r=await e.clone().json(),o=at(r.query);n.useDepthLimit&&await qi(o,n.useDepthLimit),n.useComplexityLimit&&await Bi(o,n.useComplexityLimit)}catch(i){if(t.log.error(i),i instanceof h)return new Response(JSON.stringify(i.toJSON()),{status:400,headers:{"Content-Type":"application/json"}});throw i}return e},"GraphQLComplexityLimitInboundPolicy");import{HttpProblems as Yi}from"@zuplo/runtime";function zi(e){if(!e)return!1;let t=e.replace(/\s/g,"");return t.includes("__schema")||t.includes("__type")}s(zi,"isIntrospectionQuery");var Ki=s(async(e,t)=>{let i=await e.clone().json();return zi(i.query)?Yi.forbidden(e,t,{detail:"Introspection queries are not allowed"}):e},"GraphQLDisableIntrospectionInboundPolicy");export{Ji as GraphQLComplexityLimitInboundPolicy,Ki as GraphQLDisableIntrospectionInboundPolicy};
181
+ `}s(wt,"getIntrospectionQuery");function Rt(e,t){k(e)&&k(e.__schema)||b(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${m(e)}.`);let n=e.__schema,i=pe(n.types,l=>l.name,l=>N(l));for(let l of[...qt,...Zt])i[l.name]&&(i[l.name]=l);let r=n.queryType?T(n.queryType):null,o=n.mutationType?T(n.mutationType):null,a=n.subscriptionType?T(n.subscriptionType):null,c=n.directives?n.directives.map(Gn):[];return new He({description:n.description,query:r,mutation:o,subscription:a,types:Object.values(i),directives:c,assumeValid:t?.assumeValid});function d(l){if(l.kind===O.LIST){let v=l.ofType;if(!v)throw new Error("Decorated type deeper than introspection query.");return new w(d(v))}if(l.kind===O.NON_NULL){let v=l.ofType;if(!v)throw new Error("Decorated type deeper than introspection query.");let oe=d(v);return new E(xt(oe))}return f(l)}function f(l){let v=l.name;if(!v)throw new Error(`Unknown type reference: ${m(l)}.`);let oe=i[v];if(!oe)throw new Error(`Invalid or incomplete schema, unknown type: ${v}. Ensure that a full introspection query is used in order to build a client schema.`);return oe}function T(l){return ht(f(l))}function x(l){return yt(f(l))}function N(l){if(l!=null&&l.name!=null&&l.kind!=null)switch(l.kind){case O.SCALAR:return S(l);case O.OBJECT:return U(l);case O.INTERFACE:return H(l);case O.UNION:return V(l);case O.ENUM:return me(l);case O.INPUT_OBJECT:return se(l)}let v=m(l);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${v}.`)}function S(l){return new J({name:l.name,description:l.description,specifiedByURL:l.specifiedByURL})}function g(l){if(l.interfaces===null&&l.kind===O.INTERFACE)return[];if(!l.interfaces){let v=m(l);throw new Error(`Introspection result missing interfaces: ${v}.`)}return l.interfaces.map(x)}function U(l){return new G({name:l.name,description:l.description,interfaces:s(()=>g(l),"interfaces"),fields:s(()=>ee(l),"fields")})}function H(l){return new de({name:l.name,description:l.description,interfaces:s(()=>g(l),"interfaces"),fields:s(()=>ee(l),"fields")})}function V(l){if(!l.possibleTypes){let v=m(l);throw new Error(`Introspection result missing possibleTypes: ${v}.`)}return new ve({name:l.name,description:l.description,types:s(()=>l.possibleTypes.map(T),"types")})}function me(l){if(!l.enumValues){let v=m(l);throw new Error(`Introspection result missing enumValues: ${v}.`)}return new ce({name:l.name,description:l.description,values:pe(l.enumValues,v=>v.name,v=>({description:v.description,deprecationReason:v.deprecationReason}))})}function se(l){if(!l.inputFields){let v=m(l);throw new Error(`Introspection result missing inputFields: ${v}.`)}return new Ie({name:l.name,description:l.description,fields:s(()=>_e(l.inputFields),"fields"),isOneOf:l.isOneOf})}function ee(l){if(!l.fields)throw new Error(`Introspection result missing fields: ${m(l)}.`);return pe(l.fields,v=>v.name,Ue)}function Ue(l){let v=d(l.type);if(!fe(v)){let oe=m(v);throw new Error(`Introspection must provide output type for fields, but received: ${oe}.`)}if(!l.args){let oe=m(l);throw new Error(`Introspection result missing field args: ${oe}.`)}return{description:l.description,deprecationReason:l.deprecationReason,type:v,args:_e(l.args)}}function _e(l){return pe(l,v=>v.name,Ze)}function Ze(l){let v=d(l.type);if(!z(v)){let Mn=m(v);throw new Error(`Introspection must provide input type for arguments, but received: ${Mn}.`)}let oe=l.defaultValue!=null?le(pt(l.defaultValue),v):void 0;return{description:l.description,type:v,defaultValue:oe,deprecationReason:l.deprecationReason}}function Gn(l){if(!l.args){let v=m(l);throw new Error(`Introspection result missing directive args: ${v}.`)}if(!l.locations){let v=m(l);throw new Error(`Introspection result missing directive locations: ${v}.`)}return new W({name:l.name,description:l.description,isRepeatable:l.isRepeatable,locations:l.locations.slice(),args:_e(l.args)})}}s(Rt,"buildClientSchema");function Pi(e,t){return`The query exceeds the maximum complexity of ${e}. Actual complexity is ${t}`}s(Pi,"queryComplexityMessage");function Fn(e){let t=new Ee(e.schema),n=[],i=new Fe(e.schema,e.query,t,o=>n.push(o)),r=new rn(i,{maximumComplexity:e.maximumComplexity??1/0,estimators:e.estimators,variables:e.variables,operationName:e.operationName,context:e.context});if(he(e.query,Ce(t,r)),n.length)throw n.pop();return r.complexity}s(Fn,"getComplexity");var rn=class{static{s(this,"QueryComplexity")}context;complexity;options;OperationDefinition;estimators;includeDirectiveDef;skipDirectiveDef;variableValues;requestContext;constructor(t,n){if(Number(n.maximumComplexity)<=0)throw new Error("Maximum query complexity must be a positive number");this.context=t,this.complexity=0,this.options=n,this.includeDirectiveDef=this.context.getSchema().getDirective("include")||void 0,this.skipDirectiveDef=this.context.getSchema().getDirective("skip")||void 0,this.estimators=n.estimators,this.variableValues={},this.requestContext=n.context,this.OperationDefinition={enter:this.onOperationDefinitionEnter,leave:this.onOperationDefinitionLeave}}onOperationDefinitionEnter(t){if(typeof this.options.operationName=="string"&&this.options.operationName!==t.name?.value)return;let{coerced:n,errors:i}=Dt(this.context.getSchema(),t.variableDefinitions?[...t.variableDefinitions]:[],this.options.variables??{});if(i?.length){i.forEach(o=>this.context.reportError(o));return}this.variableValues=n||{};let r=this.context.getSchema();switch(t.operation){case"query":{let o=r.getQueryType();if(!o)throw new Error("Schema does not define the required query root type");this.complexity+=this.nodeComplexity(t,o);break}case"mutation":{let o=r.getMutationType();if(!o)throw new Error("Schema does not define the required mutation root type");this.complexity+=this.nodeComplexity(t,o);break}case"subscription":{let o=r.getSubscriptionType();if(!o)throw new Error("Schema does not define the required mutation subscription type");this.complexity+=this.nodeComplexity(t,o);break}default:throw new Error(`Query complexity could not be calculated for operation of type ${t.operation}`)}}onOperationDefinitionLeave(t){if(!(typeof this.options.operationName=="string"&&this.options.operationName!==t.name?.value)&&(this.options.onComplete&&this.options.onComplete(this.complexity),this.complexity>this.options.maximumComplexity))return this.context.reportError(this.createError())}nodeComplexity(t,n){if(t.selectionSet){let i={};(n instanceof G||n instanceof de)&&(i=n.getFields());let r;xe(n)?r=this.context.getSchema().getPossibleTypes(n).map(a=>a.name):r=[n.name];let o=t.selectionSet.selections.reduce((a,c)=>{let d=a,f=!0,T=!1;for(let x of c.directives??[])switch(x.name.value){case"include":{let S=this.includeDirectiveDef&&We(this.includeDirectiveDef,c,this.variableValues||{});typeof S?.if=="boolean"&&(f=S.if);break}case"skip":{let S=this.skipDirectiveDef&&We(this.skipDirectiveDef,c,this.variableValues||{});typeof S?.if=="boolean"&&(T=S.if);break}}if(!f||T)return a;switch(c.kind){case p.FIELD:{let x=i[c.name.value];if(!x)break;let N=ne(x.type),S;try{S=Xe(x,c,this.variableValues||{})}catch(V){return this.context.reportError(V),a}let g=0;ue(N)&&(g=this.nodeComplexity(c,N));let U={childComplexity:g,args:S,field:x,node:c,type:n,context:this.requestContext};if(!this.estimators.find(V=>{let me=V(U);return typeof me=="number"&&!Number.isNaN(me)?(d=Ve(me,a,r),!0):!1}))return this.context.reportError(new h(`No complexity could be calculated for field ${n.name}.${x.name}. At least one complexity estimator has to return a complexity score.`)),a;break}case p.FRAGMENT_SPREAD:{let x=this.context.getFragment(c.name.value);if(!x)break;let N=this.context.getSchema().getType(x.typeCondition.name.value);if(!ue(N))break;let S=this.nodeComplexity(x,N);xe(N)?d=Ve(S,a,this.context.getSchema().getPossibleTypes(N).map(g=>g.name)):d=Ve(S,a,[N.name]);break}case p.INLINE_FRAGMENT:{let x=n;if(c.typeCondition?.name&&(x=this.context.getSchema().getType(c.typeCondition.name.value)||x,!ue(x)))break;let N=this.nodeComplexity(c,x);xe(x)?d=Ve(N,a,this.context.getSchema().getPossibleTypes(x).map(S=>S.name)):d=Ve(N,a,[x.name]);break}default:{d=Ve(this.nodeComplexity(c,n),a,r);break}}return d},{});return o?Math.max(...Object.values(o),0):NaN}return 0}createError(){return typeof this.options.createError=="function"?this.options.createError(this.options.maximumComplexity,this.complexity):new h(Pi(this.options.maximumComplexity,this.complexity))}};function Ve(e,t,n){for(let i of n)Object.hasOwn(t,i)?t[i]+=e:t[i]=e;return t}s(Ve,"addComplexities");function Vn(e){let t=e?.defaultComplexity??1;return n=>t+n.childComplexity}s(Vn,"simpleEstimator");var Un=s((e,t,n={})=>{let{definitions:i}=e,r=ji(i),o=$i(i);return Object.entries(o).map(([a,c])=>kt(c,r,0,t,a,n))},"depthLimit");function ji(e){return e.reduce((t,n)=>(n.kind===p.FRAGMENT_DEFINITION&&(t[n?.name?.value??""]=n),t),{})}s(ji,"getFragments");function $i(e){return e.reduce((t,n)=>{if(n.kind===p.OPERATION_DEFINITION){let i=n?.name?.value??"";t[i]=n}return t},{})}s($i,"getQueriesAndMutations");function kt(e,t,n,i,r,o){if(n>i)throw o?.onLimitReached?.(n,r),new h(`${r||"Your query"} exceeds maximum operation depth of ${i}`,{nodes:[e]});let a=o?.ignore??[/^__/];switch(e.kind){case p.FIELD:return Qi(e,a)||!e.selectionSet?0:1+Math.max(...e.selectionSet.selections.map(c=>kt(c,t,n+1,i,r,o)));case p.FRAGMENT_SPREAD:return kt(t[e.name.value],t,n,i,r,o);case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:case p.OPERATION_DEFINITION:return Math.max(...e.selectionSet.selections.map(c=>kt(c,t,n,i,r,o)));default:throw new Error(`uh oh! depth crawler cannot handle: ${e.kind}`)}}s(kt,"determineDepth");var Qi=s((e,t)=>t.find(n=>e.name.value.match(n)!==null)||!1,"isIgnored");var Bi=s(async(e,t)=>{if(!t.complexityLimit)throw new sn("No complexity maximum defined, you need to pass a maxComplexity to the policy");let i=t.endpointUrl;if(!i)throw new sn("No GraphQL endpoint, you need to pass a endpointUrl to the policy");let r=wt(),c=(await(await fetch(i,{method:"POST",body:JSON.stringify({query:r}),headers:{"Content-Type":"application/json"}})).json()).data;if(!c||!c?.__schema)throw new h("GraphQL introspection query failed, enable introspection or pass a schema url in configuration.");let d=Rt(c,{assumeValid:!0}),f=Fn({estimators:[Vn({defaultComplexity:1})],schema:d,query:e,variables:{count:10}});if(t.complexityLimit&&f>t.complexityLimit)throw new h(`Query is too complex (${f}/${t.complexityLimit}), remove some fields and try again`)},"applyComplexityLimitPolicy"),qi=s(async(e,t)=>{let n=t.depthLimit;if(!n)throw new sn("No maximum depth defined, you need to pass a maxDepth to the policy");return Math.max(...Un(e,n))},"applyDepthLimitPolicy"),Ji=s(async(e,t,n)=>{try{let r=await e.clone().json(),o=at(r.query);n.useDepthLimit&&await qi(o,n.useDepthLimit),n.useComplexityLimit&&await Bi(o,n.useComplexityLimit)}catch(i){if(t.log.error(i),i instanceof h)return new Response(JSON.stringify(i.toJSON()),{status:400,headers:{"Content-Type":"application/json"}});throw i}return e},"GraphQLComplexityLimitInboundPolicy");import{HttpProblems as Yi}from"@zuplo/runtime";function zi(e){if(!e)return!1;let t=e.replace(/\s/g,"");return t.includes("__schema")||t.includes("__type")}s(zi,"isIntrospectionQuery");var Hi=s(async(e,t)=>{let i=await e.clone().json();return zi(i.query)?Yi.forbidden(e,t,{detail:"Introspection queries are not allowed"}):e},"GraphQLDisableIntrospectionInboundPolicy");function Ki(e,t,n){if(!e?.data?.__schema?.types)return e;let i=e.data.__schema,r=new Set(t);return i.types=i.types.filter(o=>!r.has(o.name)),i.types.forEach(o=>{if(o.fields&&n){let a=new Set(n[o.name]);o.fields=o.fields.filter(c=>!a.has(c.name))}}),e}s(Ki,"filterIntrospectionResult");var Xi=s(async(e,t,n,i)=>{let{excludeTypes:r,excludeTypeFields:o}=i;if(e.status!==200)return e;try{let a=await e.json();if(!a?.data?.__schema)return new Response(JSON.stringify(a),{headers:e.headers,status:e.status,statusText:e.statusText});let c=Ki(a,r,o),d=JSON.stringify(c);return new Response(d,{headers:e.headers,status:e.status,statusText:e.statusText})}catch(a){return n.log.error(a,"Error parsing GraphQL response in GraphQLIntrospectionOutboundPolicy"),new Response(JSON.stringify({error:"Failed to process response"}),{headers:e.headers,status:500})}},"GraphQLIntrospectionFilterOutboundPolicy");export{Ji as GraphQLComplexityLimitInboundPolicy,Hi as GraphQLDisableIntrospectionInboundPolicy,Xi as GraphQLIntrospectionFilterOutboundPolicy};
182
182
  //# sourceMappingURL=index.js.map