ruru
Version:
Grafast-flavoured GraphiQL distribution
2 lines • 42.7 kB
JavaScript
export const __webpack_esm_id__=5708;export const __webpack_esm_ids__=[5708];export const __webpack_esm_modules__={5708(e){var t;e.exports=(t=function(){var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,r=(t,n)=>{for(var i in n)e(t,i,{get:n[i],enumerable:!0})},s={};r(s,{languages:()=>X,options:()=>z,parsers:()=>H,printers:()=>qe});var a=(e,t,n,i)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,i):n.global?t.replace(n,i):t.split(n).join(i)},o="line",l=()=>{},c=l,u=l;function p(e){return c(e),{type:"indent",contents:e}}function h(e,t={}){return c(e),u(t.expandedStates,!0),{type:"group",id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function d(e,t="",n={}){return c(e),""!==t&&c(t),{type:"if-break",breakContents:e,flatContents:t,groupId:n.groupId}}var f={type:o},E={type:o,soft:!0},m=[{type:o,hard:!0},{type:"break-parent"}];function T(e,t){c(e),u(t);let n=[];for(let i=0;i<t.length;i++)0!==i&&n.push(e),n.push(t[i]);return n}function N(e){return(t,n,i)=>{let r=!(null==i||!i.backwards);if(!1===n)return!1;let{length:s}=t,a=n;for(;a>=0&&a<s;){let n=t.charAt(a);if(e instanceof RegExp){if(!e.test(n))return a}else if(!e.includes(n))return a;r?a--:a++}return(-1===a||a===s)&&a}}N(/\s/u);var I=N(" \t"),y=N(",; \t"),v=N(/[^\n\r]/u);var _=function(e,t,n){let i=!(null==n||!n.backwards);if(!1===t)return!1;let r=e.charAt(t);if(i){if("\r"===e.charAt(t-1)&&"\n"===r)return t-2;if("\n"===r||"\r"===r||"\u2028"===r||"\u2029"===r)return t-1}else{if("\r"===r&&"\n"===e.charAt(t+1))return t+2;if("\n"===r||"\r"===r||"\u2028"===r||"\u2029"===r)return t+1}return t};var O=function(e,t,n={}){let i=I(e,n.backwards?t-1:t,n);return i!==_(e,i,n)};var x=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;n<e.length;++n)if("*"===e.charAt(n)&&"/"===e.charAt(n+1))return n+2;return t};var A=function(e,t){return!1!==t&&("/"===e.charAt(t)&&"/"===e.charAt(t+1)?v(e,t):t)};var D=function(e,t){let n=null,i=t;for(;i!==n;)n=i,i=y(e,i),i=x(e,i),i=I(e,i);return i=A(e,i),i=_(e,i),!1!==i&&O(e,i)};var g=function(e){return Array.isArray(e)&&e.length>0},k=class extends Error{name="UnexpectedNodeError";constructor(e,t,n="type"){super(`Unexpected ${t} node ${n}: ${JSON.stringify(e[n])}.`),this.node=e}},S=k,C=null;function b(e){if(null!==C&&(C.property,1)){let e=C;return C=b.prototype=null,e}return C=b.prototype=e??Object.create(null),new b}for(let e=0;e<=10;e++)b();var L,R,F=function(e,t="type"){return function(e){b(e)}(e),function(n){let i=n[t],r=e[i];if(!Array.isArray(r))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:n});return r}},w=class{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},P=class{constructor(e,t,n,i,r,s){this.kind=e,this.start=t,this.end=n,this.line=i,this.column=r,this.value=s,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}}},U={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"]};new Set(Object.keys(U)),(R=L||(L={})).QUERY="query",R.MUTATION="mutation",R.SUBSCRIPTION="subscription";var V=F(U,"kind");function M(e){return e.loc.start}function B(e){return e.loc.end}var j=/^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u,K=/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u;var $=function(e,t,n){let{node:i}=e;if(!i.description)return"";let r=[n("description")];return"InputValueDefinition"!==i.kind||i.description.block?r.push(m):r.push(f),r};function G(e,t,n){if(0===n.directives.length)return"";let i=T(f,e.map(t,"directives"));return"FragmentDefinition"===n.kind||"OperationDefinition"===n.kind?h([f,i]):[" ",h(p([E,i]))]}function Y(e,t,n,i){return e.map(({isLast:e,node:i})=>{let r=n();return!e&&D(t.originalText,B(i))?[r,m]:r},i)}function J(e,t){let{node:n}=e;return g(n.variableDefinitions)?h(["(",p([E,T([d("",", "),E],e.map(t,"variableDefinitions"))]),E,")"]):""}function q(e,t){"StringValue"===e.kind&&e.block&&!e.value.includes("\n")&&(t.value=e.value.trim())}q.ignoredProperties=new Set(["loc","comments"]);var Q={print:function(e,t,n){let{node:i}=e;switch(i.kind){case"Document":return[...T(m,Y(e,t,n,"definitions")),m];case"OperationDefinition":{let r="{"!==t.originalText[M(i)],s=!!i.name;return[r?i.operation:"",r&&s?[" ",n("name")]:"",r&&!s&&g(i.variableDefinitions)?" ":"",J(e,n),G(e,n,i),r||s?" ":"",n("selectionSet")]}case"FragmentDefinition":return["fragment ",n("name"),J(e,n)," on ",n("typeCondition"),G(e,n,i)," ",n("selectionSet")];case"SelectionSet":return["{",p([m,T(m,Y(e,t,n,"selections"))]),m,"}"];case"Field":return h([i.alias?[n("alias"),": "]:"",n("name"),i.arguments.length>0?h(["(",p([E,T([d("",", "),E],Y(e,t,n,"arguments"))]),E,")"]):"",G(e,n,i),i.selectionSet?" ":"",n("selectionSet")]);case"Name":case"IntValue":case"FloatValue":case"EnumValue":return i.value;case"StringValue":if(i.block){let e=a(!1,i.value,'"""',String.raw`\"""`).split("\n");return 1===e.length&&(e[0]=e[0].trim()),e.every(e=>""===e)&&(e.length=0),T(m,['"""',...e,'"""'])}return['"',a(!1,a(!1,i.value,/["\\]/gu,String.raw`\$&`),"\n",String.raw`\n`),'"'];case"BooleanValue":return i.value?"true":"false";case"NullValue":return"null";case"Variable":return["$",n("name")];case"ListValue":return h(["[",p([E,T([d("",", "),E],e.map(n,"values"))]),E,"]"]);case"ObjectValue":{let r=t.bracketSpacing&&i.fields.length>0?" ":"";return h(["{",r,p([E,T([d("",", "),E],e.map(n,"fields"))]),E,d("",r),"}"])}case"ObjectField":case"Argument":return[n("name"),": ",n("value")];case"Directive":return["@",n("name"),i.arguments.length>0?h(["(",p([E,T([d("",", "),E],Y(e,t,n,"arguments"))]),E,")"]):""];case"NamedType":return n("name");case"VariableDefinition":return[n("variable"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",G(e,n,i)];case"ObjectTypeExtension":case"ObjectTypeDefinition":case"InputObjectTypeExtension":case"InputObjectTypeDefinition":case"InterfaceTypeExtension":case"InterfaceTypeDefinition":{let{kind:r}=i,s=[];return r.endsWith("TypeDefinition")?s.push($(e,t,n)):s.push("extend "),r.startsWith("ObjectType")?s.push("type"):r.startsWith("InputObjectType")?s.push("input"):s.push("interface"),s.push(" ",n("name")),!r.startsWith("InputObjectType")&&i.interfaces.length>0&&s.push(" implements ",...function(e,t,n){let{node:i}=e,r=[],{interfaces:s}=i,a=e.map(n,"interfaces");for(let e=0;e<s.length;e++){let n=s[e];r.push(a[e]);let i=s[e+1];if(i){let e=t.originalText.slice(n.loc.end,i.loc.start).includes("#");r.push(" &",e?f:" ")}}return r}(e,t,n)),s.push(G(e,n,i)),i.fields.length>0&&s.push([" {",p([m,T(m,Y(e,t,n,"fields"))]),m,"}"]),s}case"FieldDefinition":return[$(e,t,n),n("name"),i.arguments.length>0?h(["(",p([E,T([d("",", "),E],Y(e,t,n,"arguments"))]),E,")"]):"",": ",n("type"),G(e,n,i)];case"DirectiveDefinition":return[$(e,t,n),"directive ","@",n("name"),i.arguments.length>0?h(["(",p([E,T([d("",", "),E],Y(e,t,n,"arguments"))]),E,")"]):"",i.repeatable?" repeatable":""," on ",...T(" | ",e.map(n,"locations"))];case"EnumTypeExtension":case"EnumTypeDefinition":return[$(e,t,n),"EnumTypeExtension"===i.kind?"extend ":"","enum ",n("name"),G(e,n,i),i.values.length>0?[" {",p([m,T(m,Y(e,t,n,"values"))]),m,"}"]:""];case"EnumValueDefinition":return[$(e,t,n),n("name"),G(e,n,i)];case"InputValueDefinition":return[$(e,t,n),n("name"),": ",n("type"),i.defaultValue?[" = ",n("defaultValue")]:"",G(e,n,i)];case"SchemaExtension":return["extend schema",G(e,n,i),...i.operationTypes.length>0?[" {",p([m,T(m,Y(e,t,n,"operationTypes"))]),m,"}"]:[]];case"SchemaDefinition":return[$(e,t,n),"schema",G(e,n,i)," {",i.operationTypes.length>0?p([m,T(m,Y(e,t,n,"operationTypes"))]):"",m,"}"];case"OperationTypeDefinition":return[i.operation,": ",n("type")];case"FragmentSpread":return["...",n("name"),G(e,n,i)];case"InlineFragment":return["...",i.typeCondition?[" on ",n("typeCondition")]:"",G(e,n,i)," ",n("selectionSet")];case"UnionTypeExtension":case"UnionTypeDefinition":return h([$(e,t,n),h(["UnionTypeExtension"===i.kind?"extend ":"","union ",n("name"),G(e,n,i),i.types.length>0?[" =",d(""," "),p([d([f,"| "]),T([f,"| "],e.map(n,"types"))])]:""])]);case"ScalarTypeExtension":case"ScalarTypeDefinition":return[$(e,t,n),"ScalarTypeExtension"===i.kind?"extend ":"","scalar ",n("name"),G(e,n,i)];case"NonNullType":return[n("type"),"!"];case"ListType":return["[",n("type"),"]"];default:throw new S(i,"Graphql","kind")}},massageAstNode:q,hasPrettierIgnore:function(e){var t;let{node:n}=e;return null==(t=null==n?void 0:n.comments)?void 0:t.some(e=>"prettier-ignore"===e.value.trim())},insertPragma:function(e){return`# @format\n\n${e}`},printComment:function(e){let t=e.node;if("Comment"===t.kind)return"#"+t.value.trimEnd();throw new Error("Not a comment: "+JSON.stringify(t))},canAttachComment:function(e){return"Comment"!==e.kind},getVisitorKeys:V},X=[{name:"GraphQL",type:"data",extensions:[".graphql",".gql",".graphqls"],tmScope:"source.graphql",aceMode:"text",parsers:["graphql"],vscodeLanguageIds:["graphql"],linguistLanguageId:139}],z={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."}},H={};function W(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}r(H,{graphql:()=>Je});var Z=/\r\n|[\n\r]/g;function ee(e,t){let n=0,i=1;for(let r of e.body.matchAll(Z)){if("number"==typeof r.index||W(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function te(e){return ne(e.source,ee(e.source,e.start))}function ne(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,a=t.line+s,o=1===t.line?n:0,l=t.column+o,c=`${e.name}:${a}:${l}\n`,u=i.split(/\r\n|[\n\r]/g),p=u[r];if(p.length>120){let e=Math.floor(l/80),t=l%80,n=[];for(let e=0;e<p.length;e+=80)n.push(p.slice(e,e+80));return c+ie([[`${a} |`,n[0]],...n.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return c+ie([[a-1+" |",u[r-1]],[`${a} |`,p],["|","^".padStart(l)],[`${a+1} |`,u[r+1]]])}function ie(e){let t=e.filter(([e,t])=>void 0!==t),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?" "+t:"")).join("\n")}var re,se,ae,oe=class e extends Error{constructor(t,...n){var i,r,s;let{nodes:a,source:o,positions:l,path:c,originalError:u,extensions:p}=function(e){let t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(n);super(t),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=le(Array.isArray(a)?a:a?[a]:void 0);let h=le(null===(i=this.nodes)||void 0===i?void 0:i.map(e=>e.loc).filter(e=>null!=e));this.source=o??(null==h||null===(r=h[0])||void 0===r?void 0:r.source),this.positions=l??(null==h?void 0:h.map(e=>e.start)),this.locations=l&&o?l.map(e=>ee(o,e)):null==h?void 0:h.map(e=>ee(e.source,e.start));let d=function(e){return"object"==typeof e&&null!==e}(null==u?void 0:u.extensions)?null==u?void 0:u.extensions:void 0;this.extensions=null!==(s=p??d)&&void 0!==s?s: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}}),null!=u&&u.stack?Object.defineProperty(this,"stack",{value:u.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 e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+="\n\n"+te(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+="\n\n"+ne(this.source,t);return e}toJSON(){let e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function le(e){return void 0===e||0===e.length?void 0:e}function ce(e,t,n){return new oe(`Syntax Error: ${n}`,{source:e,positions:[t]})}function ue(e){return 9===e||32===e}function pe(e){return e>=48&&e<=57}function he(e){return e>=97&&e<=122||e>=65&&e<=90}function de(e){return he(e)||95===e}function fe(e){return he(e)||pe(e)||95===e}function Ee(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let t=0;t<e.length;++t){var s;let a=e[t],o=me(a);o!==a.length&&(i=null!==(s=i)&&void 0!==s?s:t,r=t,0!==t&&o<n&&(n=o))}return e.map((e,t)=>0===t?e:e.slice(n)).slice(null!==(t=i)&&void 0!==t?t:0,r+1)}function me(e){let t=0;for(;t<e.length&&ue(e.charCodeAt(t));)++t;return t}(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"})(re||(re={})),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"}(se||(se={})),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"}(ae||(ae={}));var Te=class{constructor(e){let t=new P(ae.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==ae.EOF)do{if(e.next)e=e.next;else{let t=xe(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===ae.COMMENT);return e}};function Ne(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Ie(e,t){return ye(e.charCodeAt(t))&&ve(e.charCodeAt(t+1))}function ye(e){return e>=55296&&e<=56319}function ve(e){return e>=56320&&e<=57343}function _e(e,t){let n=e.source.body.codePointAt(t);if(void 0===n)return ae.EOF;if(n>=32&&n<=126){let e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Oe(e,t,n,i,r){let s=e.line,a=1+n-e.lineStart;return new P(t,n,i,s,a,r)}function xe(e,t){let n=e.source.body,i=n.length,r=t;for(;r<i;){let t=n.charCodeAt(r);switch(t){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:10===n.charCodeAt(r+1)?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return Ae(e,r);case 33:return Oe(e,ae.BANG,r,r+1);case 36:return Oe(e,ae.DOLLAR,r,r+1);case 38:return Oe(e,ae.AMP,r,r+1);case 40:return Oe(e,ae.PAREN_L,r,r+1);case 41:return Oe(e,ae.PAREN_R,r,r+1);case 46:if(46===n.charCodeAt(r+1)&&46===n.charCodeAt(r+2))return Oe(e,ae.SPREAD,r,r+3);break;case 58:return Oe(e,ae.COLON,r,r+1);case 61:return Oe(e,ae.EQUALS,r,r+1);case 64:return Oe(e,ae.AT,r,r+1);case 91:return Oe(e,ae.BRACKET_L,r,r+1);case 93:return Oe(e,ae.BRACKET_R,r,r+1);case 123:return Oe(e,ae.BRACE_L,r,r+1);case 124:return Oe(e,ae.PIPE,r,r+1);case 125:return Oe(e,ae.BRACE_R,r,r+1);case 34:return 34===n.charCodeAt(r+1)&&34===n.charCodeAt(r+2)?Fe(e,r):ke(e,r)}if(pe(t)||45===t)return De(e,r,t);if(de(t))return we(e,r);throw ce(e.source,r,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Ne(t)||Ie(n,r)?`Unexpected character: ${_e(e,r)}.`:`Invalid character: ${_e(e,r)}.`)}return Oe(e,ae.EOF,i,i)}function Ae(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let e=n.charCodeAt(r);if(10===e||13===e)break;if(Ne(e))++r;else{if(!Ie(n,r))break;r+=2}}return Oe(e,ae.COMMENT,t,r,n.slice(t+1,r))}function De(e,t,n){let i=e.source.body,r=t,s=n,a=!1;if(45===s&&(s=i.charCodeAt(++r)),48===s){if(s=i.charCodeAt(++r),pe(s))throw ce(e.source,r,`Invalid number, unexpected digit after 0: ${_e(e,r)}.`)}else r=ge(e,r,s),s=i.charCodeAt(r);if(46===s&&(a=!0,s=i.charCodeAt(++r),r=ge(e,r,s),s=i.charCodeAt(r)),(69===s||101===s)&&(a=!0,s=i.charCodeAt(++r),(43===s||45===s)&&(s=i.charCodeAt(++r)),r=ge(e,r,s),s=i.charCodeAt(r)),46===s||de(s))throw ce(e.source,r,`Invalid number, expected digit but got: ${_e(e,r)}.`);return Oe(e,a?ae.FLOAT:ae.INT,t,r,i.slice(t,r))}function ge(e,t,n){if(!pe(n))throw ce(e.source,t,`Invalid number, expected digit but got: ${_e(e,t)}.`);let i=e.source.body,r=t+1;for(;pe(i.charCodeAt(r));)++r;return r}function ke(e,t){let n=e.source.body,i=n.length,r=t+1,s=r,a="";for(;r<i;){let i=n.charCodeAt(r);if(34===i)return a+=n.slice(s,r),Oe(e,ae.STRING,t,r+1,a);if(92===i){a+=n.slice(s,r);let t=117===n.charCodeAt(r+1)?123===n.charCodeAt(r+2)?Se(e,r):Ce(e,r):Re(e,r);a+=t.value,r+=t.size,s=r;continue}if(10===i||13===i)break;if(Ne(i))++r;else{if(!Ie(n,r))throw ce(e.source,r,`Invalid character within String: ${_e(e,r)}.`);r+=2}}throw ce(e.source,r,"Unterminated string.")}function Se(e,t){let n=e.source.body,i=0,r=3;for(;r<12;){let e=n.charCodeAt(t+r++);if(125===e){if(r<5||!Ne(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|Le(e),i<0)break}throw ce(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function Ce(e,t){let n=e.source.body,i=be(n,t+2);if(Ne(i))return{value:String.fromCodePoint(i),size:6};if(ye(i)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){let e=be(n,t+8);if(ve(e))return{value:String.fromCodePoint(i,e),size:12}}throw ce(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function be(e,t){return Le(e.charCodeAt(t))<<12|Le(e.charCodeAt(t+1))<<8|Le(e.charCodeAt(t+2))<<4|Le(e.charCodeAt(t+3))}function Le(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Re(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:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw ce(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Fe(e,t){let n=e.source.body,i=n.length,r=e.lineStart,s=t+3,a=s,o="",l=[];for(;s<i;){let i=n.charCodeAt(s);if(34===i&&34===n.charCodeAt(s+1)&&34===n.charCodeAt(s+2)){o+=n.slice(a,s),l.push(o);let i=Oe(e,ae.BLOCK_STRING,t,s+3,Ee(l).join("\n"));return e.line+=l.length-1,e.lineStart=r,i}if(92!==i||34!==n.charCodeAt(s+1)||34!==n.charCodeAt(s+2)||34!==n.charCodeAt(s+3))if(10!==i&&13!==i)if(Ne(i))++s;else{if(!Ie(n,s))throw ce(e.source,s,`Invalid character within String: ${_e(e,s)}.`);s+=2}else o+=n.slice(a,s),l.push(o),13===i&&10===n.charCodeAt(s+1)?s+=2:++s,o="",a=s,r=s;else o+=n.slice(a,s),a=s+1,s+=4}throw ce(e.source,s,"Unterminated string.")}function we(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i&&fe(n.charCodeAt(r));)++r;return Oe(e,ae.NAME,t,r,n.slice(t,r))}function Pe(e,t){if(!e)throw new Error(t)}function Ue(e){return Ve(e,[])}function Ve(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){let t=e.toJSON();if(t!==e)return"string"==typeof t?t:Ve(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let i=0;i<n;++i)r.push(Ve(e[i],t));return 1===i?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}(e,n);return function(e,t){let n=Object.entries(e);return 0===n.length?"{}":t.length>2?"["+function(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){let t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]":"{ "+n.map(([e,n])=>e+": "+Ve(n,t)).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}var Me=globalThis.process?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var n;let i=t.prototype[Symbol.toStringTag];if(i===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(n=e.constructor)||void 0===n?void 0:n.name)){let t=Ue(e);throw new Error(`Cannot use ${i} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1},Be=class{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||Pe(!1,`Body must be a string. Received: ${Ue(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Pe(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Pe(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};var je=class{constructor(e,t={}){let n=function(e){return Me(e,Be)}(e)?e:new Be(e);this._lexer=new Te(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(ae.NAME);return this.node(e,{kind:se.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:se.DOCUMENT,definitions:this.many(ae.SOF,this.parseDefinition,ae.EOF)})}parseDefinition(){if(this.peek(ae.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===ae.NAME){switch(t.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(e)throw ce(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(ae.BRACE_L))return this.node(e,{kind:se.OPERATION_DEFINITION,operation:L.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let t,n=this.parseOperationType();return this.peek(ae.NAME)&&(t=this.parseName()),this.node(e,{kind:se.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(ae.NAME);switch(e.value){case"query":return L.QUERY;case"mutation":return L.MUTATION;case"subscription":return L.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(ae.PAREN_L,this.parseVariableDefinition,ae.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:se.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(ae.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(ae.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(ae.DOLLAR),this.node(e,{kind:se.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:se.SELECTION_SET,selections:this.many(ae.BRACE_L,this.parseSelection,ae.BRACE_R)})}parseSelection(){return this.peek(ae.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e,t,n=this._lexer.token,i=this.parseName();return this.expectOptionalToken(ae.COLON)?(e=i,t=this.parseName()):t=i,this.node(n,{kind:se.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(ae.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(ae.PAREN_L,t,ae.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,n=this.parseName();return this.expectToken(ae.COLON),this.node(t,{kind:se.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(ae.SPREAD);let t=this.expectOptionalKeyword("on");return!t&&this.peek(ae.NAME)?this.node(e,{kind:se.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:se.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:se.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:se.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case ae.BRACKET_L:return this.parseList(e);case ae.BRACE_L:return this.parseObject(e);case ae.INT:return this.advanceLexer(),this.node(t,{kind:se.INT,value:t.value});case ae.FLOAT:return this.advanceLexer(),this.node(t,{kind:se.FLOAT,value:t.value});case ae.STRING:case ae.BLOCK_STRING:return this.parseStringLiteral();case ae.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:se.BOOLEAN,value:!0});case"false":return this.node(t,{kind:se.BOOLEAN,value:!1});case"null":return this.node(t,{kind:se.NULL});default:return this.node(t,{kind:se.ENUM,value:t.value})}case ae.DOLLAR:if(e){if(this.expectToken(ae.DOLLAR),this._lexer.token.kind===ae.NAME){let e=this._lexer.token.value;throw ce(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:se.STRING,value:e.value,block:e.kind===ae.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:se.LIST,values:this.any(ae.BRACKET_L,()=>this.parseValueLiteral(e),ae.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:se.OBJECT,fields:this.any(ae.BRACE_L,()=>this.parseObjectField(e),ae.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,n=this.parseName();return this.expectToken(ae.COLON),this.node(t,{kind:se.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(ae.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(ae.AT),this.node(t,{kind:se.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e,t=this._lexer.token;if(this.expectOptionalToken(ae.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(ae.BRACKET_R),e=this.node(t,{kind:se.LIST_TYPE,type:n})}else e=this.parseNamedType();return this.expectOptionalToken(ae.BANG)?this.node(t,{kind:se.NON_NULL_TYPE,type:e}):e}parseNamedType(){return this.node(this._lexer.token,{kind:se.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(ae.STRING)||this.peek(ae.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.many(ae.BRACE_L,this.parseOperationTypeDefinition,ae.BRACE_R);return this.node(e,{kind:se.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(ae.COLON);let n=this.parseNamedType();return this.node(e,{kind:se.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:se.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:i})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:se.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(ae.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(ae.BRACE_L,this.parseFieldDefinition,ae.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(ae.COLON);let r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:se.FIELD_DEFINITION,description:t,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(ae.PAREN_L,this.parseInputValueDef,ae.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(ae.COLON);let i,r=this.parseTypeReference();this.expectOptionalToken(ae.EQUALS)&&(i=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(e,{kind:se.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:s})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:se.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:se.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(ae.EQUALS)?this.delimitedMany(ae.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:se.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(ae.BRACE_L,this.parseEnumValueDefinition,ae.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:se.ENUM_VALUE_DEFINITION,description:t,name:n,directives:i})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw ce(this._lexer.source,this._lexer.token.start,`${Ke(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:se.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(ae.BRACE_L,this.parseInputValueDef,ae.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===ae.NAME)switch(e.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(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let t=this.parseConstDirectives(),n=this.optionalMany(ae.BRACE_L,this.parseOperationTypeDefinition,ae.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:se.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:se.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:se.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:se.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let t=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:se.UNION_TYPE_EXTENSION,name:t,directives:n,types:i})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let t=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:se.ENUM_TYPE_EXTENSION,name:t,directives:n,values:i})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let t=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:se.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(ae.AT);let n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let s=this.parseDirectiveLocations();return this.node(e,{kind:se.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(ae.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(re,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new w(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw ce(this._lexer.source,t.start,`Expected ${$e(e)}, found ${Ke(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){let t=this._lexer.token;if(t.kind!==ae.NAME||t.value!==e)throw ce(this._lexer.source,t.start,`Expected "${e}", found ${Ke(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===ae.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){let t=e??this._lexer.token;return ce(this._lexer.source,t.start,`Unexpected ${Ke(t)}.`)}any(e,t,n){this.expectToken(e);let i=[];for(;!this.expectOptionalToken(n);)i.push(t.call(this));return i}optionalMany(e,t,n){if(this.expectOptionalToken(e)){let e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);let i=[];do{i.push(t.call(this))}while(!this.expectOptionalToken(n));return i}delimitedMany(e,t){this.expectOptionalToken(e);let n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==ae.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw ce(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}};function Ke(e){let t=e.value;return $e(e.kind)+(null!=t?` "${t}"`:"")}function $e(e){return function(e){return e===ae.BANG||e===ae.DOLLAR||e===ae.AMP||e===ae.PAREN_L||e===ae.PAREN_R||e===ae.SPREAD||e===ae.COLON||e===ae.EQUALS||e===ae.AT||e===ae.BRACKET_L||e===ae.BRACKET_R||e===ae.BRACE_L||e===ae.PIPE||e===ae.BRACE_R}(e)?`"${e}"`:e}var Ge=function(e,t){let n=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(n,t)};var Ye={allowLegacyFragmentVariables:!0};var Je={parse:function(e){let t;try{t=function(e,t){let n=new je(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}(e,Ye)}catch(e){throw function(e){if("GraphQLError"===(null==e?void 0:e.name)){let{message:t,locations:[n]}=e;return Ge(t,{loc:{start:n},cause:e})}return e}(e)}return t.comments=function(e){let t=[],{startToken:n,endToken:i}=e.loc;for(let e=n;e!==i;e=e.next)"Comment"===e.kind&&t.push({...e,loc:{start:e.start,end:e.end}});return t}(t),t},astFormat:"graphql",hasPragma:function(e){return K.test(e)},hasIgnorePragma:function(e){return j.test(e)},locStart:M,locEnd:B},qe={graphql:Q};return(r=>((r,s,a,o)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let l of n(s))!i.call(r,l)&&l!==a&&e(r,l,{get:()=>s[l],enumerable:!(o=t(s,l))||o.enumerable});return r})(e({},"__esModule",{value:!0}),r))(s)}()).default||t}};
//# sourceMappingURL=5708.js.map