import{aG as $,aH as g,aI as G,aJ as H,aK as X,aL as j,aM as L,aN as c,aO as _,aP as Z,aQ as M,aR as ee,N as te,aS as ne,aT as se,aU as ie,u as re,A as ae,aV as oe}from"./entry.mF3_sHCd.js";function ce(t){return typeof t=="object"&&t!==null}function he(t,e){if(!!!t)throw new Error("Unexpected invariant triggered.")}const ue=/\r\n|[\n\r]/g;function R(t,e){let n=0,i=1;for(const s of t.body.matchAll(ue)){if(typeof s.index=="number"||he(!1),s.index>=e)break;n=s.index+s[0].length,i+=1}return{line:i,column:e+1-n}}function le(t){return K(t.source,R(t.source,t.start))}function K(t,e){const n=t.locationOffset.column-1,i="".padStart(n)+t.body,s=e.line-1,r=t.locationOffset.line-1,o=e.line+r,h=e.line===1?n:0,l=e.column+h,f=`${t.name}:${o}:${l}
`,u=i.split(/\r\n|[\n\r]/g),E=u[s];if(E.length>120){const x=Math.floor(l/80),D=l%80,m=[];for(let T=0;T<E.length;T+=80)m.push(E.slice(T,T+80));return f+U([[`${o} |`,m[0]],...m.slice(1,x+1).map(T=>["|",T]),["|","^".padStart(D)],["|",m[x+1]]])}return f+U([[`${o-1} |`,u[s-1]],[`${o} |`,E],["|","^".padStart(l)],[`${o+1} |`,u[s+1]]])}function U(t){const e=t.filter(([i,s])=>s!==void 0),n=Math.max(...e.map(([i])=>i.length));return e.map(([i,s])=>i.padStart(n)+(s?" "+s:"")).join(`
`)}function pe(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}class P extends Error{constructor(e,...n){var i,s,r;const{nodes:o,source:h,positions:l,path:f,originalError:u,extensions:E}=pe(n);super(e),this.name="GraphQLError",this.path=f??void 0,this.originalError=u??void 0,this.nodes=B(Array.isArray(o)?o:o?[o]:void 0);const x=B((i=this.nodes)===null||i===void 0?void 0:i.map(m=>m.loc).filter(m=>m!=null));this.source=h??(x==null||(s=x[0])===null||s===void 0?void 0:s.source),this.positions=l??(x==null?void 0:x.map(m=>m.start)),this.locations=l&&h?l.map(m=>R(h,m)):x==null?void 0:x.map(m=>R(m.source,m.start));const D=ce(u==null?void 0:u.extensions)?u==null?void 0:u.extensions:void 0;this.extensions=(r=E??D)!==null&&r!==void 0?r: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}}),u!=null&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,P):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(const n of this.nodes)n.loc&&(e+=`

`+le(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+=`

`+K(this.source,n);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function B(t){return t===void 0||t.length===0?void 0:t}function d(t,e,n){return new P(`Syntax Error: ${n}`,{source:t,positions:[e]})}var w;(function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(w||(w={}));var a;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(a||(a={}));class de{constructor(e){const n=new $(a.SOF,0,0,0,0);this.source=e,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 e=this.token;if(e.kind!==a.EOF)do if(e.next)e=e.next;else{const n=Ee(this,e.end);e.next=n,n.prev=e,e=n}while(e.kind===a.COMMENT);return e}}function fe(t){return t===a.BANG||t===a.DOLLAR||t===a.AMP||t===a.PAREN_L||t===a.PAREN_R||t===a.SPREAD||t===a.COLON||t===a.EQUALS||t===a.AT||t===a.BRACKET_L||t===a.BRACKET_R||t===a.BRACE_L||t===a.PIPE||t===a.BRACE_R}function I(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function b(t,e){return q(t.charCodeAt(e))&&Y(t.charCodeAt(e+1))}function q(t){return t>=55296&&t<=56319}function Y(t){return t>=56320&&t<=57343}function N(t,e){const n=t.source.body.codePointAt(e);if(n===void 0)return a.EOF;if(n>=32&&n<=126){const i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function p(t,e,n,i,s){const r=t.line,o=1+n-t.lineStart;return new $(e,n,i,r,o,s)}function Ee(t,e){const n=t.source.body,i=n.length;let s=e;for(;s<i;){const r=n.charCodeAt(s);switch(r){case 65279:case 9:case 32:case 44:++s;continue;case 10:++s,++t.line,t.lineStart=s;continue;case 13:n.charCodeAt(s+1)===10?s+=2:++s,++t.line,t.lineStart=s;continue;case 35:return me(t,s);case 33:return p(t,a.BANG,s,s+1);case 36:return p(t,a.DOLLAR,s,s+1);case 38:return p(t,a.AMP,s,s+1);case 40:return p(t,a.PAREN_L,s,s+1);case 41:return p(t,a.PAREN_R,s,s+1);case 46:if(n.charCodeAt(s+1)===46&&n.charCodeAt(s+2)===46)return p(t,a.SPREAD,s,s+3);break;case 58:return p(t,a.COLON,s,s+1);case 61:return p(t,a.EQUALS,s,s+1);case 64:return p(t,a.AT,s,s+1);case 91:return p(t,a.BRACKET_L,s,s+1);case 93:return p(t,a.BRACKET_R,s,s+1);case 123:return p(t,a.BRACE_L,s,s+1);case 124:return p(t,a.PIPE,s,s+1);case 125:return p(t,a.BRACE_R,s,s+1);case 34:return n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34?ye(t,s):Ne(t,s)}if(g(r)||r===45)return xe(t,s,r);if(G(r))return ke(t,s);throw d(t.source,s,r===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:I(r)||b(n,s)?`Unexpected character: ${N(t,s)}.`:`Invalid character: ${N(t,s)}.`)}return p(t,a.EOF,i,i)}function me(t,e){const n=t.source.body,i=n.length;let s=e+1;for(;s<i;){const r=n.charCodeAt(s);if(r===10||r===13)break;if(I(r))++s;else if(b(n,s))s+=2;else break}return p(t,a.COMMENT,e,s,n.slice(e+1,s))}function xe(t,e,n){const i=t.source.body;let s=e,r=n,o=!1;if(r===45&&(r=i.charCodeAt(++s)),r===48){if(r=i.charCodeAt(++s),g(r))throw d(t.source,s,`Invalid number, unexpected digit after 0: ${N(t,s)}.`)}else s=S(t,s,r),r=i.charCodeAt(s);if(r===46&&(o=!0,r=i.charCodeAt(++s),s=S(t,s,r),r=i.charCodeAt(s)),(r===69||r===101)&&(o=!0,r=i.charCodeAt(++s),(r===43||r===45)&&(r=i.charCodeAt(++s)),s=S(t,s,r),r=i.charCodeAt(s)),r===46||G(r))throw d(t.source,s,`Invalid number, expected digit but got: ${N(t,s)}.`);return p(t,o?a.FLOAT:a.INT,e,s,i.slice(e,s))}function S(t,e,n){if(!g(n))throw d(t.source,e,`Invalid number, expected digit but got: ${N(t,e)}.`);const i=t.source.body;let s=e+1;for(;g(i.charCodeAt(s));)++s;return s}function Ne(t,e){const n=t.source.body,i=n.length;let s=e+1,r=s,o="";for(;s<i;){const h=n.charCodeAt(s);if(h===34)return o+=n.slice(r,s),p(t,a.STRING,e,s+1,o);if(h===92){o+=n.slice(r,s);const l=n.charCodeAt(s+1)===117?n.charCodeAt(s+2)===123?Te(t,s):Ae(t,s):Ie(t,s);o+=l.value,s+=l.size,r=s;continue}if(h===10||h===13)break;if(I(h))++s;else if(b(n,s))s+=2;else throw d(t.source,s,`Invalid character within String: ${N(t,s)}.`)}throw d(t.source,s,"Unterminated string.")}function Te(t,e){const n=t.source.body;let i=0,s=3;for(;s<12;){const r=n.charCodeAt(e+s++);if(r===125){if(s<5||!I(i))break;return{value:String.fromCodePoint(i),size:s}}if(i=i<<4|k(r),i<0)break}throw d(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+s)}".`)}function Ae(t,e){const n=t.source.body,i=V(n,e+2);if(I(i))return{value:String.fromCodePoint(i),size:6};if(q(i)&&n.charCodeAt(e+6)===92&&n.charCodeAt(e+7)===117){const s=V(n,e+8);if(Y(s))return{value:String.fromCodePoint(i,s),size:12}}throw d(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function V(t,e){return k(t.charCodeAt(e))<<12|k(t.charCodeAt(e+1))<<8|k(t.charCodeAt(e+2))<<4|k(t.charCodeAt(e+3))}function k(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Ie(t,e){const n=t.source.body;switch(n.charCodeAt(e+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:`
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:"	",size:2}}throw d(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function ye(t,e){const n=t.source.body,i=n.length;let s=t.lineStart,r=e+3,o=r,h="";const l=[];for(;r<i;){const f=n.charCodeAt(r);if(f===34&&n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34){h+=n.slice(o,r),l.push(h);const u=p(t,a.BLOCK_STRING,e,r+3,H(l).join(`
`));return t.line+=l.length-1,t.lineStart=s,u}if(f===92&&n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34&&n.charCodeAt(r+3)===34){h+=n.slice(o,r),o=r+1,r+=4;continue}if(f===10||f===13){h+=n.slice(o,r),l.push(h),f===13&&n.charCodeAt(r+1)===10?r+=2:++r,h="",o=r,s=r;continue}if(I(f))++r;else if(b(n,r))r+=2;else throw d(t.source,r,`Invalid character within String: ${N(t,r)}.`)}throw d(t.source,r,"Unterminated string.")}function ke(t,e){const n=t.source.body,i=n.length;let s=e+1;for(;s<i;){const r=n.charCodeAt(s);if(X(r))++s;else break}return p(t,a.NAME,e,s,n.slice(e,s))}const _e=globalThis.process&&!0,Oe=_e?function(e,n){return e instanceof n}:function(e,n){if(e instanceof n)return!0;if(typeof e=="object"&&e!==null){var i;const s=n.prototype[Symbol.toStringTag],r=Symbol.toStringTag in e?e[Symbol.toStringTag]:(i=e.constructor)===null||i===void 0?void 0:i.name;if(s===r){const o=j(e);throw new Error(`Cannot use ${s} "${o}" from another module or realm.

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

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

Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.`)}}return!1};class Q{constructor(e,n="GraphQL request",i={line:1,column:1}){typeof e=="string"||L(!1,`Body must be a string. Received: ${j(e)}.`),this.body=e,this.name=n,this.locationOffset=i,this.locationOffset.line>0||L(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||L(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function ve(t){return Oe(t,Q)}function ge(t,e){return new Ce(t,e).parseDocument()}class Ce{constructor(e,n={}){const i=ve(e)?e:new Q(e);this._lexer=new de(i),this._options=n,this._tokenCounter=0}parseName(){const e=this.expectToken(a.NAME);return this.node(e,{kind:c.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:c.DOCUMENT,definitions:this.many(a.SOF,this.parseDefinition,a.EOF)})}parseDefinition(){if(this.peek(a.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===a.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(e)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(){const e=this._lexer.token;if(this.peek(a.BRACE_L))return this.node(e,{kind:c.OPERATION_DEFINITION,operation:_.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let i;return this.peek(a.NAME)&&(i=this.parseName()),this.node(e,{kind:c.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(a.NAME);switch(e.value){case"query":return _.QUERY;case"mutation":return _.MUTATION;case"subscription":return _.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(a.PAREN_L,this.parseVariableDefinition,a.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:c.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(a.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(a.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(a.DOLLAR),this.node(e,{kind:c.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:c.SELECTION_SET,selections:this.many(a.BRACE_L,this.parseSelection,a.BRACE_R)})}parseSelection(){return this.peek(a.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let i,s;return this.expectOptionalToken(a.COLON)?(i=n,s=this.parseName()):s=n,this.node(e,{kind:c.FIELD,alias:i,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(a.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(a.PAREN_L,n,a.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(a.COLON),this.node(n,{kind:c.ARGUMENT,name:i,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(a.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(a.NAME)?this.node(e,{kind:c.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:c.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:c.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:c.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(e){const n=this._lexer.token;switch(n.kind){case a.BRACKET_L:return this.parseList(e);case a.BRACE_L:return this.parseObject(e);case a.INT:return this.advanceLexer(),this.node(n,{kind:c.INT,value:n.value});case a.FLOAT:return this.advanceLexer(),this.node(n,{kind:c.FLOAT,value:n.value});case a.STRING:case a.BLOCK_STRING:return this.parseStringLiteral();case a.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:c.BOOLEAN,value:!0});case"false":return this.node(n,{kind:c.BOOLEAN,value:!1});case"null":return this.node(n,{kind:c.NULL});default:return this.node(n,{kind:c.ENUM,value:n.value})}case a.DOLLAR:if(e)if(this.expectToken(a.DOLLAR),this._lexer.token.kind===a.NAME){const 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(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:c.STRING,value:e.value,block:e.kind===a.BLOCK_STRING})}parseList(e){const n=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:c.LIST,values:this.any(a.BRACKET_L,n,a.BRACKET_R)})}parseObject(e){const n=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:c.OBJECT,fields:this.any(a.BRACE_L,n,a.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,i=this.parseName();return this.expectToken(a.COLON),this.node(n,{kind:c.OBJECT_FIELD,name:i,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(a.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(a.AT),this.node(n,{kind:c.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(a.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(a.BRACKET_R),n=this.node(e,{kind:c.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(a.BANG)?this.node(e,{kind:c.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:c.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(a.STRING)||this.peek(a.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),s=this.many(a.BRACE_L,this.parseOperationTypeDefinition,a.BRACE_R);return this.node(e,{kind:c.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:s})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(a.COLON);const i=this.parseNamedType();return this.node(e,{kind:c.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),s=this.parseConstDirectives();return this.node(e,{kind:c.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:s})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),s=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:c.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:s,directives:r,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(a.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(a.BRACE_L,this.parseFieldDefinition,a.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),i=this.parseName(),s=this.parseArgumentDefs();this.expectToken(a.COLON);const r=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:c.FIELD_DEFINITION,description:n,name:i,arguments:s,type:r,directives:o})}parseArgumentDefs(){return this.optionalMany(a.PAREN_L,this.parseInputValueDef,a.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(a.COLON);const s=this.parseTypeReference();let r;this.expectOptionalToken(a.EQUALS)&&(r=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:c.INPUT_VALUE_DEFINITION,description:n,name:i,type:s,defaultValue:r,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),s=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:c.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:s,directives:r,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),s=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:c.UNION_TYPE_DEFINITION,description:n,name:i,directives:s,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(a.EQUALS)?this.delimitedMany(a.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),s=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:c.ENUM_TYPE_DEFINITION,description:n,name:i,directives:s,values:r})}parseEnumValuesDefinition(){return this.optionalMany(a.BRACE_L,this.parseEnumValueDefinition,a.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),s=this.parseConstDirectives();return this.node(e,{kind:c.ENUM_VALUE_DEFINITION,description:n,name:i,directives:s})}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,`${O(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),s=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:c.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:s,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(a.BRACE_L,this.parseInputValueDef,a.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===a.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(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(a.BRACE_L,this.parseOperationTypeDefinition,a.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:c.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(e,{kind:c.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(i.length===0&&s.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:c.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:s,fields:r})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(i.length===0&&s.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:c.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:s,fields:r})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:c.UNION_TYPE_EXTENSION,name:n,directives:i,types:s})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:c.ENUM_TYPE_EXTENSION,name:n,directives:i,values:s})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:c.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:s})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(a.AT);const i=this.parseName(),s=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:c.DIRECTIVE_DEFINITION,description:n,name:i,arguments:s,repeatable:r,locations:o})}parseDirectiveLocations(){return this.delimitedMany(a.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(w,n.value))return n;throw this.unexpected(e)}node(e,n){return this._options.noLocation!==!0&&(n.loc=new Z(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw d(this._lexer.source,n.start,`Expected ${z(e)}, found ${O(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const n=this._lexer.token;if(n.kind===a.NAME&&n.value===e)this.advanceLexer();else throw d(this._lexer.source,n.start,`Expected "${e}", found ${O(n)}.`)}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===a.NAME&&n.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const n=e??this._lexer.token;return d(this._lexer.source,n.start,`Unexpected ${O(n)}.`)}any(e,n,i){this.expectToken(e);const s=[];for(;!this.expectOptionalToken(i);)s.push(n.call(this));return s}optionalMany(e,n,i){if(this.expectOptionalToken(e)){const s=[];do s.push(n.call(this));while(!this.expectOptionalToken(i));return s}return[]}many(e,n,i){this.expectToken(e);const s=[];do s.push(n.call(this));while(!this.expectOptionalToken(i));return s}delimitedMany(e,n){this.expectOptionalToken(e);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(e));return i}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(e!==void 0&&n.kind!==a.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw d(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function O(t){const e=t.value;return z(t.kind)+(e!=null?` "${e}"`:"")}function z(t){return fe(t)?`"${t}"`:t}var v=new Map,F=new Map,J=!0,C=!1;function W(t){return t.replace(/[\s,]+/g," ").trim()}function be(t){return W(t.source.body.substring(t.start,t.end))}function De(t){var e=new Set,n=[];return t.definitions.forEach(function(i){if(i.kind==="FragmentDefinition"){var s=i.name.value,r=be(i.loc),o=F.get(s);o&&!o.has(r)?J&&console.warn("Warning: fragment with name "+s+` already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||F.set(s,o=new Set),o.add(r),e.has(r)||(e.add(r),n.push(i))}else n.push(i)}),M(M({},t),{definitions:n})}function Le(t){var e=new Set(t.definitions);e.forEach(function(i){i.loc&&delete i.loc,Object.keys(i).forEach(function(s){var r=i[s];r&&typeof r=="object"&&e.add(r)})});var n=t.loc;return n&&(delete n.startToken,delete n.endToken),t}function Se(t){var e=W(t);if(!v.has(e)){var n=ge(t,{experimentalFragmentVariables:C,allowLegacyFragmentVariables:C});if(!n||n.kind!=="Document")throw new Error("Not a valid GraphQL document.");v.set(e,Le(De(n)))}return v.get(e)}function A(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];typeof t=="string"&&(t=[t]);var i=t[0];return e.forEach(function(s,r){s&&s.kind==="Document"?i+=s.loc.source.body:i+=s,i+=t[r+1]}),Se(i)}function Re(){v.clear(),F.clear()}function we(){J=!1}function Fe(){C=!0}function Pe(){C=!1}var y={gql:A,resetCaches:Re,disableFragmentWarnings:we,enableExperimentalFragmentVariables:Fe,disableExperimentalFragmentVariables:Pe};(function(t){t.gql=y.gql,t.resetCaches=y.resetCaches,t.disableFragmentWarnings=y.disableFragmentWarnings,t.enableExperimentalFragmentVariables=y.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=y.disableExperimentalFragmentVariables})(A||(A={}));A.default=A;const Me=A;async function Be(t,e,n=!0){let i=0;const s=3,r=re();ee(),await te();const h=ae().public.baseURL;if(!h)throw new Error("baseURL is not defined in the runtime configuration.");const l=new ne({link:new se({uri:`${h}/graphql`}),cache:new ie,defaultOptions:{query:{fetchPolicy:"no-cache"}}}),f=Me`
    ${t}
  `,u=async()=>{for(;i<s;)try{if(n)return await oe(f,{variables:{useCache:n}});{const E=await l.query({query:f,variables:{useCache:n}});return{data:{value:E==null?void 0:E.data}}}}catch(E){i++,console.log(`GQL query failed in ${e}. Error: ${E}`),console.warn(`GQL query failed in ${e}, retrying in ${1e3*i}ms. RetryCount: ${i}`),await new Promise(x=>setTimeout(x,1e3*i))}throw new Error(`Gql call failed after ${s} attempts. Module: ${e}.`)};return r.runWithContext(u)}export{Be as e,A as g};
