@shellicar/build-graphql 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/cjs/astro.cjs +1 -1
  2. package/dist/cjs/{chunk-CWBDTDYG.cjs → chunk-CIMVULAF.cjs} +1 -1
  3. package/dist/cjs/{chunk-CWBDTDYG.cjs.map → chunk-CIMVULAF.cjs.map} +1 -1
  4. package/dist/cjs/chunk-DOXWOAWQ.cjs +1 -0
  5. package/dist/cjs/{chunk-LAPVTCQP.cjs.map → chunk-DOXWOAWQ.cjs.map} +1 -1
  6. package/dist/cjs/{chunk-YBI6BN5C.cjs → chunk-E7MJACVF.cjs} +1 -1
  7. package/dist/cjs/{chunk-YBI6BN5C.cjs.map → chunk-E7MJACVF.cjs.map} +1 -1
  8. package/dist/cjs/{chunk-RAIHFLIL.cjs → chunk-HZGDAS4U.cjs} +1 -1
  9. package/dist/cjs/{chunk-RAIHFLIL.cjs.map → chunk-HZGDAS4U.cjs.map} +1 -1
  10. package/dist/cjs/{chunk-6VZ6FMLP.cjs → chunk-JHAJ3QBS.cjs} +1 -1
  11. package/dist/cjs/{chunk-6VZ6FMLP.cjs.map → chunk-JHAJ3QBS.cjs.map} +1 -1
  12. package/dist/cjs/{chunk-35R55OIB.cjs → chunk-MBQ4CNY3.cjs} +1 -1
  13. package/dist/cjs/{chunk-35R55OIB.cjs.map → chunk-MBQ4CNY3.cjs.map} +1 -1
  14. package/dist/cjs/{chunk-HFSPJLEV.cjs → chunk-OBTYEQED.cjs} +1 -1
  15. package/dist/cjs/{chunk-HFSPJLEV.cjs.map → chunk-OBTYEQED.cjs.map} +1 -1
  16. package/dist/cjs/{chunk-OTBCQI5I.cjs → chunk-SKRRSMYU.cjs} +1 -1
  17. package/dist/cjs/{chunk-OTBCQI5I.cjs.map → chunk-SKRRSMYU.cjs.map} +1 -1
  18. package/dist/cjs/{chunk-QKHUEGFJ.cjs → chunk-UBVX77VS.cjs} +1 -1
  19. package/dist/cjs/{chunk-QKHUEGFJ.cjs.map → chunk-UBVX77VS.cjs.map} +1 -1
  20. package/dist/cjs/{chunk-FL2YKLPG.cjs → chunk-UQK6I7TV.cjs} +1 -1
  21. package/dist/cjs/{chunk-FL2YKLPG.cjs.map → chunk-UQK6I7TV.cjs.map} +1 -1
  22. package/dist/cjs/core/consts.cjs +1 -1
  23. package/dist/cjs/core/createPlugin.cjs +1 -1
  24. package/dist/cjs/core/esbuild/createEsbuild.cjs +1 -1
  25. package/dist/cjs/core/esbuild/esbuildSetup.cjs +1 -1
  26. package/dist/cjs/core/graphql/loadGraphqlModule.cjs +1 -1
  27. package/dist/cjs/core/graphqlPluginFactory.cjs +1 -1
  28. package/dist/cjs/core/handleErrors.cjs +1 -1
  29. package/dist/cjs/core/plugin.cjs +1 -1
  30. package/dist/cjs/core/vite/createVite.cjs +1 -1
  31. package/dist/cjs/core/vite/viteHotUpdate.cjs +1 -1
  32. package/dist/cjs/esbuild.cjs +1 -1
  33. package/dist/cjs/farm.cjs +1 -1
  34. package/dist/cjs/index.cjs +1 -1
  35. package/dist/cjs/nuxt.cjs +1 -1
  36. package/dist/cjs/rolldown.cjs +1 -1
  37. package/dist/cjs/rollup.cjs +1 -1
  38. package/dist/cjs/rspack.cjs +1 -1
  39. package/dist/cjs/vite.cjs +1 -1
  40. package/dist/cjs/webpack.cjs +1 -1
  41. package/dist/esm/astro.js +1 -1
  42. package/dist/esm/{chunk-ZPGQET3I.js → chunk-BQN3IXO6.js} +1 -1
  43. package/dist/esm/{chunk-ZPGQET3I.js.map → chunk-BQN3IXO6.js.map} +1 -1
  44. package/dist/esm/{chunk-5AHHQJUU.js → chunk-EHX23IKM.js} +1 -1
  45. package/dist/esm/{chunk-5AHHQJUU.js.map → chunk-EHX23IKM.js.map} +1 -1
  46. package/dist/esm/{chunk-6XAZ5ME3.js → chunk-I7FL5AOD.js} +1 -1
  47. package/dist/esm/{chunk-6XAZ5ME3.js.map → chunk-I7FL5AOD.js.map} +1 -1
  48. package/dist/esm/{chunk-KB4LJXMX.js → chunk-KP2WBUBY.js} +1 -1
  49. package/dist/esm/{chunk-KB4LJXMX.js.map → chunk-KP2WBUBY.js.map} +1 -1
  50. package/dist/esm/{chunk-PMZ6U5XU.js → chunk-LWPNIV4H.js} +1 -1
  51. package/dist/esm/{chunk-PMZ6U5XU.js.map → chunk-LWPNIV4H.js.map} +1 -1
  52. package/dist/esm/{chunk-2U37UHC2.js → chunk-PZQXCGUD.js} +1 -1
  53. package/dist/esm/{chunk-2U37UHC2.js.map → chunk-PZQXCGUD.js.map} +1 -1
  54. package/dist/esm/chunk-Q5LQWXTP.js +1 -0
  55. package/dist/esm/{chunk-DQM2JYCA.js.map → chunk-Q5LQWXTP.js.map} +1 -1
  56. package/dist/esm/{chunk-P5SGXLHT.js → chunk-RAJPMJIA.js} +1 -1
  57. package/dist/esm/{chunk-P5SGXLHT.js.map → chunk-RAJPMJIA.js.map} +1 -1
  58. package/dist/esm/{chunk-S3FZMAUX.js → chunk-USSKRIVQ.js} +1 -1
  59. package/dist/esm/{chunk-S3FZMAUX.js.map → chunk-USSKRIVQ.js.map} +1 -1
  60. package/dist/esm/{chunk-6IFBXQLW.js → chunk-YSRKY4QW.js} +1 -1
  61. package/dist/esm/{chunk-6IFBXQLW.js.map → chunk-YSRKY4QW.js.map} +1 -1
  62. package/dist/esm/core/consts.js +1 -1
  63. package/dist/esm/core/createPlugin.js +1 -1
  64. package/dist/esm/core/esbuild/createEsbuild.js +1 -1
  65. package/dist/esm/core/esbuild/esbuildSetup.js +1 -1
  66. package/dist/esm/core/graphql/loadGraphqlModule.js +1 -1
  67. package/dist/esm/core/graphqlPluginFactory.js +1 -1
  68. package/dist/esm/core/handleErrors.js +1 -1
  69. package/dist/esm/core/plugin.js +1 -1
  70. package/dist/esm/core/vite/createVite.js +1 -1
  71. package/dist/esm/core/vite/viteHotUpdate.js +1 -1
  72. package/dist/esm/esbuild.js +1 -1
  73. package/dist/esm/farm.js +1 -1
  74. package/dist/esm/index.js +1 -1
  75. package/dist/esm/nuxt.js +1 -1
  76. package/dist/esm/rolldown.js +1 -1
  77. package/dist/esm/rollup.js +1 -1
  78. package/dist/esm/rspack.js +1 -1
  79. package/dist/esm/vite.js +1 -1
  80. package/dist/esm/webpack.js +1 -1
  81. package/package.json +11 -11
  82. package/dist/cjs/chunk-LAPVTCQP.cjs +0 -1
  83. package/dist/esm/chunk-DQM2JYCA.js +0 -1
@@ -1 +1 @@
1
- import{__name as e}from"./chunk-7QVYU63E.js";import t from"fs";import n from"readline";import i from"path";var r=e(function(){return r=Object.assign||e(function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},"__assign"),r.apply(this,arguments)},"__assign");function s(e,t){if(!Boolean(e))throw new Error(t)}function o(e){return"object"==typeof e&&null!==e}function a(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}e(s,"devAssert"),e(o,"isObjectLike"),e(a,"invariant");var c=/\r\n|[\n\r]/g;function l(e,t){let n=0,i=1;for(const r of e.body.matchAll(c)){if("number"==typeof r.index||a(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function u(e){return p(e.source,l(e.source,e.start))}function p(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=1===t.line?n:0,c=t.column+a,l=`${e.name}:${o}:${c}\n`,u=i.split(/\r\n|[\n\r]/g),p=u[r];if(p.length>120){const e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<p.length;e+=80)n.push(p.slice(e,e+80));return l+h([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return l+h([[o-1+" |",u[r-1]],[`${o} |`,p],["|","^".padStart(c)],[`${o+1} |`,u[r+1]]])}function h(e){const 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")}function d(e){const 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}e(l,"getLocation"),e(u,"printLocation"),e(p,"printSourceLocation"),e(h,"printPrefixedLines"),e(d,"toNormalizedOptions");var E=class t extends Error{static{e(this,"GraphQLError")}constructor(e,...n){var i,r,s;const{nodes:a,source:c,positions:u,path:p,originalError:h,extensions:E}=d(n);super(e),this.name="GraphQLError",this.path=null!=p?p:void 0,this.originalError=null!=h?h:void 0,this.nodes=f(Array.isArray(a)?a:a?[a]:void 0);const m=f(null===(i=this.nodes)||void 0===i?void 0:i.map(e=>e.loc).filter(e=>null!=e));this.source=null!=c?c:null==m||null===(r=m[0])||void 0===r?void 0:r.source,this.positions=null!=u?u:null==m?void 0:m.map(e=>e.start),this.locations=u&&c?u.map(e=>l(c,e)):null==m?void 0:m.map(e=>l(e.source,e.start));const T=o(null==h?void 0:h.extensions)?null==h?void 0:h.extensions:void 0;this.extensions=null!==(s=null!=E?E:T)&&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!=h&&h.stack?Object.defineProperty(this,"stack",{value:h.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,t):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 t of this.nodes)t.loc&&(e+="\n\n"+u(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+p(this.source,t);return e}toJSON(){const 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 f(e){return void 0===e||0===e.length?void 0:e}function m(e,t,n){return new E(`Syntax Error: ${n}`,{source:e,positions:[t]})}e(f,"undefinedIfEmpty"),e(m,"syntaxError");var T,N,I,O,_,D,A,v,x=class{static{e(this,"Location")}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}}},y=class{static{e(this,"Token")}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}}};function k(e){return 9===e||32===e}function g(e){return e>=48&&e<=57}function C(e){return e>=97&&e<=122||e>=65&&e<=90}function S(e){return C(e)||95===e}function R(e){return C(e)||g(e)||95===e}function L(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let t=0;t<e.length;++t){var s;const o=e[t],a=b(o);a!==o.length&&(i=null!==(s=i)&&void 0!==s?s:t,r=t,0!==t&&a<n&&(n=a))}return e.map((e,t)=>0===t?e:e.slice(n)).slice(null!==(t=i)&&void 0!==t?t:0,r+1)}function b(e){let t=0;for(;t<e.length&&k(e.charCodeAt(t));)++t;return t}new Set(Object.keys({Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]})),(N=T||(T={})).QUERY="query",N.MUTATION="mutation",N.SUBSCRIPTION="subscription",(O=I||(I={})).QUERY="QUERY",O.MUTATION="MUTATION",O.SUBSCRIPTION="SUBSCRIPTION",O.FIELD="FIELD",O.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",O.FRAGMENT_SPREAD="FRAGMENT_SPREAD",O.INLINE_FRAGMENT="INLINE_FRAGMENT",O.VARIABLE_DEFINITION="VARIABLE_DEFINITION",O.SCHEMA="SCHEMA",O.SCALAR="SCALAR",O.OBJECT="OBJECT",O.FIELD_DEFINITION="FIELD_DEFINITION",O.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",O.INTERFACE="INTERFACE",O.UNION="UNION",O.ENUM="ENUM",O.ENUM_VALUE="ENUM_VALUE",O.INPUT_OBJECT="INPUT_OBJECT",O.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",(D=_||(_={})).NAME="Name",D.DOCUMENT="Document",D.OPERATION_DEFINITION="OperationDefinition",D.VARIABLE_DEFINITION="VariableDefinition",D.SELECTION_SET="SelectionSet",D.FIELD="Field",D.ARGUMENT="Argument",D.FRAGMENT_SPREAD="FragmentSpread",D.INLINE_FRAGMENT="InlineFragment",D.FRAGMENT_DEFINITION="FragmentDefinition",D.VARIABLE="Variable",D.INT="IntValue",D.FLOAT="FloatValue",D.STRING="StringValue",D.BOOLEAN="BooleanValue",D.NULL="NullValue",D.ENUM="EnumValue",D.LIST="ListValue",D.OBJECT="ObjectValue",D.OBJECT_FIELD="ObjectField",D.DIRECTIVE="Directive",D.NAMED_TYPE="NamedType",D.LIST_TYPE="ListType",D.NON_NULL_TYPE="NonNullType",D.SCHEMA_DEFINITION="SchemaDefinition",D.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",D.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",D.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",D.FIELD_DEFINITION="FieldDefinition",D.INPUT_VALUE_DEFINITION="InputValueDefinition",D.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",D.UNION_TYPE_DEFINITION="UnionTypeDefinition",D.ENUM_TYPE_DEFINITION="EnumTypeDefinition",D.ENUM_VALUE_DEFINITION="EnumValueDefinition",D.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",D.DIRECTIVE_DEFINITION="DirectiveDefinition",D.SCHEMA_EXTENSION="SchemaExtension",D.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",D.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",D.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",D.UNION_TYPE_EXTENSION="UnionTypeExtension",D.ENUM_TYPE_EXTENSION="EnumTypeExtension",D.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",D.TYPE_COORDINATE="TypeCoordinate",D.MEMBER_COORDINATE="MemberCoordinate",D.ARGUMENT_COORDINATE="ArgumentCoordinate",D.DIRECTIVE_COORDINATE="DirectiveCoordinate",D.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate",e(k,"isWhiteSpace"),e(g,"isDigit"),e(C,"isLetter"),e(S,"isNameStart"),e(R,"isNameContinue"),e(L,"dedentBlockStringLines"),e(b,"leadingWhitespace"),(v=A||(A={})).SOF="<SOF>",v.EOF="<EOF>",v.BANG="!",v.DOLLAR="$",v.AMP="&",v.PAREN_L="(",v.PAREN_R=")",v.DOT=".",v.SPREAD="...",v.COLON=":",v.EQUALS="=",v.AT="@",v.BRACKET_L="[",v.BRACKET_R="]",v.BRACE_L="{",v.PIPE="|",v.BRACE_R="}",v.NAME="Name",v.INT="Int",v.FLOAT="Float",v.STRING="String",v.BLOCK_STRING="BlockString",v.COMMENT="Comment";var F=class{static{e(this,"Lexer")}constructor(e){const t=new y(A.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(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==A.EOF)do{if(e.next)e=e.next;else{const t=K(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===A.COMMENT);return e}};function P(e){return e===A.BANG||e===A.DOLLAR||e===A.AMP||e===A.PAREN_L||e===A.PAREN_R||e===A.DOT||e===A.SPREAD||e===A.COLON||e===A.EQUALS||e===A.AT||e===A.BRACKET_L||e===A.BRACKET_R||e===A.BRACE_L||e===A.PIPE||e===A.BRACE_R}function w(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function M(e,t){return U(e.charCodeAt(t))&&V(e.charCodeAt(t+1))}function U(e){return e>=55296&&e<=56319}function V(e){return e>=56320&&e<=57343}function B(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return A.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function j(e,t,n,i,r){const s=e.line,o=1+n-e.lineStart;return new y(t,n,i,s,o,r)}function K(e,t){const n=e.source.body,i=n.length;let r=t;for(;r<i;){const 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 G(e,r);case 33:return j(e,A.BANG,r,r+1);case 36:return j(e,A.DOLLAR,r,r+1);case 38:return j(e,A.AMP,r,r+1);case 40:return j(e,A.PAREN_L,r,r+1);case 41:return j(e,A.PAREN_R,r,r+1);case 46:if(46===n.charCodeAt(r+1)&&46===n.charCodeAt(r+2))return j(e,A.SPREAD,r,r+3);break;case 58:return j(e,A.COLON,r,r+1);case 61:return j(e,A.EQUALS,r,r+1);case 64:return j(e,A.AT,r,r+1);case 91:return j(e,A.BRACKET_L,r,r+1);case 93:return j(e,A.BRACKET_R,r,r+1);case 123:return j(e,A.BRACE_L,r,r+1);case 124:return j(e,A.PIPE,r,r+1);case 125:return j(e,A.BRACE_R,r,r+1);case 34:return 34===n.charCodeAt(r+1)&&34===n.charCodeAt(r+2)?H(e,r):J(e,r)}if(g(t)||45===t)return Y(e,r,t);if(S(t))return Z(e,r);throw m(e.source,r,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":w(t)||M(n,r)?`Unexpected character: ${B(e,r)}.`:`Invalid character: ${B(e,r)}.`)}return j(e,A.EOF,i,i)}function G(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const e=n.charCodeAt(r);if(10===e||13===e)break;if(w(e))++r;else{if(!M(n,r))break;r+=2}}return j(e,A.COMMENT,t,r,n.slice(t+1,r))}function Y(e,t,n){const i=e.source.body;let r=t,s=n,o=!1;if(45===s&&(s=i.charCodeAt(++r)),48===s){if(s=i.charCodeAt(++r),g(s))throw m(e.source,r,`Invalid number, unexpected digit after 0: ${B(e,r)}.`)}else r=$(e,r,s),s=i.charCodeAt(r);if(46===s&&(o=!0,s=i.charCodeAt(++r),r=$(e,r,s),s=i.charCodeAt(r)),69!==s&&101!==s||(o=!0,s=i.charCodeAt(++r),43!==s&&45!==s||(s=i.charCodeAt(++r)),r=$(e,r,s),s=i.charCodeAt(r)),46===s||S(s))throw m(e.source,r,`Invalid number, expected digit but got: ${B(e,r)}.`);return j(e,o?A.FLOAT:A.INT,t,r,i.slice(t,r))}function $(e,t,n){if(!g(n))throw m(e.source,t,`Invalid number, expected digit but got: ${B(e,t)}.`);const i=e.source.body;let r=t+1;for(;g(i.charCodeAt(r));)++r;return r}function J(e,t){const n=e.source.body,i=n.length;let r=t+1,s=r,o="";for(;r<i;){const i=n.charCodeAt(r);if(34===i)return o+=n.slice(s,r),j(e,A.STRING,t,r+1,o);if(92===i){o+=n.slice(s,r);const t=117===n.charCodeAt(r+1)?123===n.charCodeAt(r+2)?q(e,r):Q(e,r):W(e,r);o+=t.value,r+=t.size,s=r;continue}if(10===i||13===i)break;if(w(i))++r;else{if(!M(n,r))throw m(e.source,r,`Invalid character within String: ${B(e,r)}.`);r+=2}}throw m(e.source,r,"Unterminated string.")}function q(e,t){const n=e.source.body;let i=0,r=3;for(;r<12;){const e=n.charCodeAt(t+r++);if(125===e){if(r<5||!w(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|z(e),i<0)break}throw m(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function Q(e,t){const n=e.source.body,i=X(n,t+2);if(w(i))return{value:String.fromCodePoint(i),size:6};if(U(i)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=X(n,t+8);if(V(e))return{value:String.fromCodePoint(i,e),size:12}}throw m(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function X(e,t){return z(e.charCodeAt(t))<<12|z(e.charCodeAt(t+1))<<8|z(e.charCodeAt(t+2))<<4|z(e.charCodeAt(t+3))}function z(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function W(e,t){const 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 m(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function H(e,t){const n=e.source.body,i=n.length;let r=e.lineStart,s=t+3,o=s,a="";const c=[];for(;s<i;){const i=n.charCodeAt(s);if(34===i&&34===n.charCodeAt(s+1)&&34===n.charCodeAt(s+2)){a+=n.slice(o,s),c.push(a);const i=j(e,A.BLOCK_STRING,t,s+3,L(c).join("\n"));return e.line+=c.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(w(i))++s;else{if(!M(n,s))throw m(e.source,s,`Invalid character within String: ${B(e,s)}.`);s+=2}else a+=n.slice(o,s),c.push(a),13===i&&10===n.charCodeAt(s+1)?s+=2:++s,a="",o=s,r=s;else a+=n.slice(o,s),o=s+1,s+=4}throw m(e.source,s,"Unterminated string.")}function Z(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){if(!R(n.charCodeAt(r)))break;++r}return j(e,A.NAME,t,r,n.slice(t,r))}e(P,"isPunctuatorTokenKind"),e(w,"isUnicodeScalarValue"),e(M,"isSupplementaryCodePoint"),e(U,"isLeadingSurrogate"),e(V,"isTrailingSurrogate"),e(B,"printCodePointAt"),e(j,"createToken"),e(K,"readNextToken"),e(G,"readComment"),e(Y,"readNumber"),e($,"readDigits"),e(J,"readString"),e(q,"readEscapedUnicodeVariableWidth"),e(Q,"readEscapedUnicodeFixedWidth"),e(X,"read16BitHexCode"),e(z,"readHexDigit"),e(W,"readEscapedCharacter"),e(H,"readBlockString"),e(Z,"readName");function ee(e){return te(e,[])}function te(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return ne(e,t);default:return String(e)}}function ne(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(ie(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:te(t,n)}else if(Array.isArray(e))return se(e,n);return re(e,n)}function ie(e){return"function"==typeof e.toJSON}function re(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+oe(e)+"]";return"{ "+n.map(([e,n])=>e+": "+te(n,t)).join(", ")+" }"}function se(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),i=e.length-n,r=[];for(let i=0;i<n;++i)r.push(te(e[i],t));return 1===i?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function oe(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}e(ee,"inspect"),e(te,"formatValue"),e(ne,"formatObjectValue"),e(ie,"isJSONable"),e(re,"formatObject"),e(se,"formatArray"),e(oe,"getObjectTag");var ae=globalThis.process&&"production"===process.env.NODE_ENV,ce=e(ae?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var n;const 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)){const t=ee(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},"instanceOf"),le=class{static{e(this,"Source")}constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||s(!1,`Body must be a string. Received: ${ee(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||s(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||s(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function ue(e){return ce(e,le)}function pe(e,t){const n=new he(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}e(ue,"isSource"),e(pe,"parse");var he=class{static{e(this,"Parser")}constructor(e,t={}){const{lexer:n,...i}=t;if(n)this._lexer=n;else{const t=ue(e)?e:new le(e);this._lexer=new F(t)}this._options=i,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(A.NAME);return this.node(e,{kind:_.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:_.DOCUMENT,definitions:this.many(A.SOF,this.parseDefinition,A.EOF)})}parseDefinition(){if(this.peek(A.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===A.BRACE_L)throw m(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===A.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()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw m(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===t.value)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(A.BRACE_L))return this.node(e,{kind:_.OPERATION_DEFINITION,operation:T.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseDescription(),n=this.parseOperationType();let i;return this.peek(A.NAME)&&(i=this.parseName()),this.node(e,{kind:_.OPERATION_DEFINITION,operation:n,description:t,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 T.QUERY;case"mutation":return T.MUTATION;case"subscription":return T.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:_.VARIABLE_DEFINITION,description:this.parseDescription(),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:_.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:_.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,t=this.parseName();let n,i;return this.expectOptionalToken(A.COLON)?(n=t,i=this.parseName()):i=t,this.node(e,{kind:_.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(A.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(A.PAREN_L,t,A.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(A.COLON),this.node(t,{kind:_.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(A.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(A.NAME)?this.node(e,{kind:_.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:_.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token,t=this.parseDescription();return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:_.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:_.FRAGMENT_DEFINITION,description:t,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){const t=this._lexer.token;switch(t.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(t,{kind:_.INT,value:t.value});case A.FLOAT:return this.advanceLexer(),this.node(t,{kind:_.FLOAT,value:t.value});case A.STRING:case A.BLOCK_STRING:return this.parseStringLiteral();case A.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:_.BOOLEAN,value:!0});case"false":return this.node(t,{kind:_.BOOLEAN,value:!1});case"null":return this.node(t,{kind:_.NULL});default:return this.node(t,{kind:_.ENUM,value:t.value})}case A.DOLLAR:if(e){if(this.expectToken(A.DOLLAR),this._lexer.token.kind===A.NAME){const e=this._lexer.token.value;throw m(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(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:_.STRING,value:e.value,block:e.kind===A.BLOCK_STRING})}parseList(t){const n=e(()=>this.parseValueLiteral(t),"item");return this.node(this._lexer.token,{kind:_.LIST,values:this.any(A.BRACKET_L,n,A.BRACKET_R)})}parseObject(t){const n=e(()=>this.parseObjectField(t),"item");return this.node(this._lexer.token,{kind:_.OBJECT,fields:this.any(A.BRACE_L,n,A.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(A.COLON),this.node(t,{kind:_.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(A.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(A.AT),this.node(t,{kind:_.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(A.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(A.BRACKET_R),t=this.node(e,{kind:_.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(A.BANG)?this.node(e,{kind:_.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:_.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,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);return this.node(e,{kind:_.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(A.COLON);const n=this.parseNamedType();return this.node(e,{kind:_.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:_.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:_.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}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,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(A.COLON);const r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:_.FIELD_DEFINITION,description:t,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(A.PAREN_L,this.parseInputValueDef,A.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(A.COLON);const i=this.parseTypeReference();let r;this.expectOptionalToken(A.EQUALS)&&(r=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(e,{kind:_.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:_.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:_.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(A.EQUALS)?this.delimitedMany(A.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:_.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(A.BRACE_L,this.parseEnumValueDefinition,A.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:_.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 m(this._lexer.source,this._lexer.token.start,`${de(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:_.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,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 t=this.parseConstDirectives(),n=this.optionalMany(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:_.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:_.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const 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:_.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const 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:_.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:_.UNION_TYPE_EXTENSION,name:t,directives:n,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:_.ENUM_TYPE_EXTENSION,name:t,directives:n,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:_.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(A.AT);const n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const s=this.parseDirectiveLocations();return this.node(e,{kind:_.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(A.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(I,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){const e=this._lexer.token,t=this.expectOptionalToken(A.AT),n=this.parseName();let i,r;return!t&&this.expectOptionalToken(A.DOT)&&(i=this.parseName()),(t||i)&&this.expectOptionalToken(A.PAREN_L)&&(r=this.parseName(),this.expectToken(A.COLON),this.expectToken(A.PAREN_R)),t?r?this.node(e,{kind:_.DIRECTIVE_ARGUMENT_COORDINATE,name:n,argumentName:r}):this.node(e,{kind:_.DIRECTIVE_COORDINATE,name:n}):i?r?this.node(e,{kind:_.ARGUMENT_COORDINATE,name:n,fieldName:i,argumentName:r}):this.node(e,{kind:_.MEMBER_COORDINATE,name:n,memberName:i}):this.node(e,{kind:_.TYPE_COORDINATE,name:n})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new x(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw m(this._lexer.source,t.start,`Expected ${Ee(e)}, found ${de(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==A.NAME||t.value!==e)throw m(this._lexer.source,t.start,`Expected "${e}", found ${de(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===A.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return m(this._lexer.source,t.start,`Unexpected ${de(t)}.`)}any(e,t,n){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(n);)i.push(t.call(this));return i}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const i=[];do{i.push(t.call(this))}while(!this.expectOptionalToken(n));return i}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==A.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw m(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}};function de(e){const t=e.value;return Ee(e.kind)+(null!=t?` "${t}"`:"")}function Ee(e){return P(e)?`"${e}"`:e}e(de,"getTokenDesc"),e(Ee,"getTokenKindDesc");var fe=new Map,me=new Map,Te=!0,Ne=!1;function Ie(e){return e.replace(/[\s,]+/g," ").trim()}function Oe(e){return Ie(e.source.body.substring(e.start,e.end))}function _e(e){var t=new Set,n=[];return e.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var i=e.name.value,r=Oe(e.loc),s=me.get(i);s&&!s.has(r)?Te&&console.warn("Warning: fragment with name "+i+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):s||me.set(i,s=new Set),s.add(r),t.has(r)||(t.add(r),n.push(e))}else n.push(e)}),r(r({},e),{definitions:n})}function De(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(n){var i=e[n];i&&"object"==typeof i&&t.add(i)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}function Ae(e){var t=Ie(e);if(!fe.has(t)){var n=pe(e,{experimentalFragmentVariables:Ne,allowLegacyFragmentVariables:Ne});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");fe.set(t,De(_e(n)))}return fe.get(t)}function ve(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var i=e[0];return t.forEach(function(t,n){t&&"Document"===t.kind?i+=t.loc.source.body:i+=t,i+=e[n+1]}),Ae(i)}function xe(){fe.clear(),me.clear()}function ye(){Te=!1}function ke(){Ne=!0}function ge(){Ne=!1}e(Ie,"normalize"),e(Oe,"cacheKeyFromLoc"),e(_e,"processFragments"),e(De,"stripLoc"),e(Ae,"parseDocument"),e(ve,"gql"),e(xe,"resetCaches"),e(ye,"disableFragmentWarnings"),e(ke,"enableExperimentalFragmentVariables"),e(ge,"disableExperimentalFragmentVariables");var Ce,Se=ve,Re=xe,Le=ye,be=ke,Fe=ge;(Ce=ve||(ve={})).gql=Se,Ce.resetCaches=Re,Ce.disableFragmentWarnings=Le,Ce.enableExperimentalFragmentVariables=be,Ce.disableExperimentalFragmentVariables=Fe,ve.default=ve;var Pe=ve,we=e((e,t)=>{const n=t?t(e):e;return JSON.stringify(n,(e,t)=>void 0===t?"__undefined":t).replace(/"__undefined"/g,"undefined")},"generateDocumentNodeString"),Me=e((t,n)=>{const i=new Set,r=[],s=e(e=>{i.has(e)||(i.add(e),e.imports.forEach(e=>{const t=n[e.absolutePath];s(t)}),r.unshift(e))},"visitFile");return t.forEach(s),r},"topologicallySortParsedFiles"),Ue=e(r=>new Promise(s=>{const o=n.createInterface({input:t.createReadStream(r)});let a="";const c=[];let l=!1;const u=e((e,t)=>{const n=t.replace(e,""),s=n.replace(/"|'/g,""),o=i.join(i.dirname(r),s);c.push({absolutePath:o,relativePath:n})},"parseImportAndCapture");o.on("line",e=>{e.startsWith("#import ")?u("#import ",e):e.startsWith("# import ")?u("# import ",e):l?a+=e+"\n":"#"!==e[0]&&""!==e&&(l=!0,a+=e+"\n")}),o.on("close",()=>{s({body:a.trim(),filePath:r,imports:c})})}),"parseGraphQLFile"),Ve=e(t=>{const n={},i=[],r=new Set,s=e(e=>n[e]?Promise.resolve(null):new Promise(t=>{Ue(e).then(e=>{n[e.filePath]=e,e.imports.forEach(e=>{r.has(e.absolutePath)||(r.add(e.absolutePath),i.push(s(e.absolutePath)))});const o=i.shift();return o?o.then(t):t(null)})}),"visitAndParse");return s(t).then(()=>Me(Object.values(n),n).reduce((e,t)=>t.body+"\n\n"+e,""))},"generateGraphQLString"),Be=e((e,t,n)=>{const i={kind:"Document",definitions:[e,...t]};return we(i,n)},"generateDocumentNodeStringForOperationDefinition"),je=e(t=>e((e,t)=>(e.forEach(e=>{"FragmentDefinition"===e.kind&&(t[e.name.value]=e)}),t),"accumulateAllFragments")(t.definitions,{}),"collectAllFragmentDefinitions"),Ke=e((t,n)=>{const i=[],r=e(e=>{if("FragmentSpread"===e.kind){const t=n[e.name.value],r=Ke(t,n);i.push(...r,e.name.value)}},"handleSelectionNode");return"OperationDefinition"===t.kind?t.selectionSet.selections.forEach(e=>{var t;"Field"===e.kind&&(null==(t=e.selectionSet)||t.selections.forEach(r))}):t.selectionSet.selections.forEach(r),i},"collectAllFragmentReferences"),Ge=e((e,t)=>{const n=Pe(e),i=we(n,t),r=je(n),s=n.definitions.reduce((e,n)=>{if("OperationDefinition"===n.kind&&n.name&&n.name.value){const i=n.name.value,s=Ke(n,r).map(e=>{const t=r[e];if(!t)throw new Error(`Expected to find fragment definition for ${e}`);return t}),o=Be(n,s,t);e.push(`export const ${i} = ${o};`)}return e},[`const documentNode = ${i};`]);return s.push("export default documentNode;"),s.join("\n")},"generateContentsFromGraphqlString"),Ye=e(async(e,t)=>{if(e.startsWith("\0")&&e.endsWith(".graphql")){const n=e.slice(1),i=await Ve(n);return{code:Ge(i,t.mapDocumentNode),map:null}}},"loadGraphqlModule");export{Ye as loadGraphqlModule};//# sourceMappingURL=chunk-6IFBXQLW.js.map
1
+ import{__name as e}from"./chunk-7QVYU63E.js";import t from"fs";import n from"readline";import i from"path";var r=e(function(){return r=Object.assign||e(function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},"__assign"),r.apply(this,arguments)},"__assign");function s(e,t){if(!Boolean(e))throw new Error(t)}function o(e){return"object"==typeof e&&null!==e}function a(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}e(s,"devAssert"),e(o,"isObjectLike"),e(a,"invariant");var c=/\r\n|[\n\r]/g;function l(e,t){let n=0,i=1;for(const r of e.body.matchAll(c)){if("number"==typeof r.index||a(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function u(e){return p(e.source,l(e.source,e.start))}function p(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=1===t.line?n:0,c=t.column+a,l=`${e.name}:${o}:${c}\n`,u=i.split(/\r\n|[\n\r]/g),p=u[r];if(p.length>120){const e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<p.length;e+=80)n.push(p.slice(e,e+80));return l+h([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return l+h([[o-1+" |",u[r-1]],[`${o} |`,p],["|","^".padStart(c)],[`${o+1} |`,u[r+1]]])}function h(e){const 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")}function d(e){const 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}e(l,"getLocation"),e(u,"printLocation"),e(p,"printSourceLocation"),e(h,"printPrefixedLines"),e(d,"toNormalizedOptions");var E=class t extends Error{static{e(this,"GraphQLError")}constructor(e,...n){var i,r,s;const{nodes:a,source:c,positions:u,path:p,originalError:h,extensions:E}=d(n);super(e),this.name="GraphQLError",this.path=null!=p?p:void 0,this.originalError=null!=h?h:void 0,this.nodes=f(Array.isArray(a)?a:a?[a]:void 0);const m=f(null===(i=this.nodes)||void 0===i?void 0:i.map(e=>e.loc).filter(e=>null!=e));this.source=null!=c?c:null==m||null===(r=m[0])||void 0===r?void 0:r.source,this.positions=null!=u?u:null==m?void 0:m.map(e=>e.start),this.locations=u&&c?u.map(e=>l(c,e)):null==m?void 0:m.map(e=>l(e.source,e.start));const T=o(null==h?void 0:h.extensions)?null==h?void 0:h.extensions:void 0;this.extensions=null!==(s=null!=E?E:T)&&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!=h&&h.stack?Object.defineProperty(this,"stack",{value:h.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,t):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 t of this.nodes)t.loc&&(e+="\n\n"+u(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+p(this.source,t);return e}toJSON(){const 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 f(e){return void 0===e||0===e.length?void 0:e}function m(e,t,n){return new E(`Syntax Error: ${n}`,{source:e,positions:[t]})}e(f,"undefinedIfEmpty"),e(m,"syntaxError");var T,N,I,O,_,D,A,v,x=class{static{e(this,"Location")}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}}},y=class{static{e(this,"Token")}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}}};function k(e){return 9===e||32===e}function g(e){return e>=48&&e<=57}function C(e){return e>=97&&e<=122||e>=65&&e<=90}function S(e){return C(e)||95===e}function R(e){return C(e)||g(e)||95===e}function L(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let t=0;t<e.length;++t){var s;const o=e[t],a=b(o);a!==o.length&&(i=null!==(s=i)&&void 0!==s?s:t,r=t,0!==t&&a<n&&(n=a))}return e.map((e,t)=>0===t?e:e.slice(n)).slice(null!==(t=i)&&void 0!==t?t:0,r+1)}function b(e){let t=0;for(;t<e.length&&k(e.charCodeAt(t));)++t;return t}new Set(Object.keys({Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]})),(N=T||(T={})).QUERY="query",N.MUTATION="mutation",N.SUBSCRIPTION="subscription",(O=I||(I={})).QUERY="QUERY",O.MUTATION="MUTATION",O.SUBSCRIPTION="SUBSCRIPTION",O.FIELD="FIELD",O.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",O.FRAGMENT_SPREAD="FRAGMENT_SPREAD",O.INLINE_FRAGMENT="INLINE_FRAGMENT",O.VARIABLE_DEFINITION="VARIABLE_DEFINITION",O.SCHEMA="SCHEMA",O.SCALAR="SCALAR",O.OBJECT="OBJECT",O.FIELD_DEFINITION="FIELD_DEFINITION",O.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",O.INTERFACE="INTERFACE",O.UNION="UNION",O.ENUM="ENUM",O.ENUM_VALUE="ENUM_VALUE",O.INPUT_OBJECT="INPUT_OBJECT",O.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",(D=_||(_={})).NAME="Name",D.DOCUMENT="Document",D.OPERATION_DEFINITION="OperationDefinition",D.VARIABLE_DEFINITION="VariableDefinition",D.SELECTION_SET="SelectionSet",D.FIELD="Field",D.ARGUMENT="Argument",D.FRAGMENT_SPREAD="FragmentSpread",D.INLINE_FRAGMENT="InlineFragment",D.FRAGMENT_DEFINITION="FragmentDefinition",D.VARIABLE="Variable",D.INT="IntValue",D.FLOAT="FloatValue",D.STRING="StringValue",D.BOOLEAN="BooleanValue",D.NULL="NullValue",D.ENUM="EnumValue",D.LIST="ListValue",D.OBJECT="ObjectValue",D.OBJECT_FIELD="ObjectField",D.DIRECTIVE="Directive",D.NAMED_TYPE="NamedType",D.LIST_TYPE="ListType",D.NON_NULL_TYPE="NonNullType",D.SCHEMA_DEFINITION="SchemaDefinition",D.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",D.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",D.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",D.FIELD_DEFINITION="FieldDefinition",D.INPUT_VALUE_DEFINITION="InputValueDefinition",D.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",D.UNION_TYPE_DEFINITION="UnionTypeDefinition",D.ENUM_TYPE_DEFINITION="EnumTypeDefinition",D.ENUM_VALUE_DEFINITION="EnumValueDefinition",D.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",D.DIRECTIVE_DEFINITION="DirectiveDefinition",D.SCHEMA_EXTENSION="SchemaExtension",D.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",D.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",D.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",D.UNION_TYPE_EXTENSION="UnionTypeExtension",D.ENUM_TYPE_EXTENSION="EnumTypeExtension",D.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",D.TYPE_COORDINATE="TypeCoordinate",D.MEMBER_COORDINATE="MemberCoordinate",D.ARGUMENT_COORDINATE="ArgumentCoordinate",D.DIRECTIVE_COORDINATE="DirectiveCoordinate",D.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate",e(k,"isWhiteSpace"),e(g,"isDigit"),e(C,"isLetter"),e(S,"isNameStart"),e(R,"isNameContinue"),e(L,"dedentBlockStringLines"),e(b,"leadingWhitespace"),(v=A||(A={})).SOF="<SOF>",v.EOF="<EOF>",v.BANG="!",v.DOLLAR="$",v.AMP="&",v.PAREN_L="(",v.PAREN_R=")",v.DOT=".",v.SPREAD="...",v.COLON=":",v.EQUALS="=",v.AT="@",v.BRACKET_L="[",v.BRACKET_R="]",v.BRACE_L="{",v.PIPE="|",v.BRACE_R="}",v.NAME="Name",v.INT="Int",v.FLOAT="Float",v.STRING="String",v.BLOCK_STRING="BlockString",v.COMMENT="Comment";var F=class{static{e(this,"Lexer")}constructor(e){const t=new y(A.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(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==A.EOF)do{if(e.next)e=e.next;else{const t=K(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===A.COMMENT);return e}};function P(e){return e===A.BANG||e===A.DOLLAR||e===A.AMP||e===A.PAREN_L||e===A.PAREN_R||e===A.DOT||e===A.SPREAD||e===A.COLON||e===A.EQUALS||e===A.AT||e===A.BRACKET_L||e===A.BRACKET_R||e===A.BRACE_L||e===A.PIPE||e===A.BRACE_R}function w(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function M(e,t){return U(e.charCodeAt(t))&&V(e.charCodeAt(t+1))}function U(e){return e>=55296&&e<=56319}function V(e){return e>=56320&&e<=57343}function B(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return A.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function j(e,t,n,i,r){const s=e.line,o=1+n-e.lineStart;return new y(t,n,i,s,o,r)}function K(e,t){const n=e.source.body,i=n.length;let r=t;for(;r<i;){const 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 G(e,r);case 33:return j(e,A.BANG,r,r+1);case 36:return j(e,A.DOLLAR,r,r+1);case 38:return j(e,A.AMP,r,r+1);case 40:return j(e,A.PAREN_L,r,r+1);case 41:return j(e,A.PAREN_R,r,r+1);case 46:if(46===n.charCodeAt(r+1)&&46===n.charCodeAt(r+2))return j(e,A.SPREAD,r,r+3);break;case 58:return j(e,A.COLON,r,r+1);case 61:return j(e,A.EQUALS,r,r+1);case 64:return j(e,A.AT,r,r+1);case 91:return j(e,A.BRACKET_L,r,r+1);case 93:return j(e,A.BRACKET_R,r,r+1);case 123:return j(e,A.BRACE_L,r,r+1);case 124:return j(e,A.PIPE,r,r+1);case 125:return j(e,A.BRACE_R,r,r+1);case 34:return 34===n.charCodeAt(r+1)&&34===n.charCodeAt(r+2)?H(e,r):J(e,r)}if(g(t)||45===t)return Y(e,r,t);if(S(t))return Z(e,r);throw m(e.source,r,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":w(t)||M(n,r)?`Unexpected character: ${B(e,r)}.`:`Invalid character: ${B(e,r)}.`)}return j(e,A.EOF,i,i)}function G(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const e=n.charCodeAt(r);if(10===e||13===e)break;if(w(e))++r;else{if(!M(n,r))break;r+=2}}return j(e,A.COMMENT,t,r,n.slice(t+1,r))}function Y(e,t,n){const i=e.source.body;let r=t,s=n,o=!1;if(45===s&&(s=i.charCodeAt(++r)),48===s){if(s=i.charCodeAt(++r),g(s))throw m(e.source,r,`Invalid number, unexpected digit after 0: ${B(e,r)}.`)}else r=$(e,r,s),s=i.charCodeAt(r);if(46===s&&(o=!0,s=i.charCodeAt(++r),r=$(e,r,s),s=i.charCodeAt(r)),69!==s&&101!==s||(o=!0,s=i.charCodeAt(++r),43!==s&&45!==s||(s=i.charCodeAt(++r)),r=$(e,r,s),s=i.charCodeAt(r)),46===s||S(s))throw m(e.source,r,`Invalid number, expected digit but got: ${B(e,r)}.`);return j(e,o?A.FLOAT:A.INT,t,r,i.slice(t,r))}function $(e,t,n){if(!g(n))throw m(e.source,t,`Invalid number, expected digit but got: ${B(e,t)}.`);const i=e.source.body;let r=t+1;for(;g(i.charCodeAt(r));)++r;return r}function J(e,t){const n=e.source.body,i=n.length;let r=t+1,s=r,o="";for(;r<i;){const i=n.charCodeAt(r);if(34===i)return o+=n.slice(s,r),j(e,A.STRING,t,r+1,o);if(92===i){o+=n.slice(s,r);const t=117===n.charCodeAt(r+1)?123===n.charCodeAt(r+2)?q(e,r):Q(e,r):W(e,r);o+=t.value,r+=t.size,s=r;continue}if(10===i||13===i)break;if(w(i))++r;else{if(!M(n,r))throw m(e.source,r,`Invalid character within String: ${B(e,r)}.`);r+=2}}throw m(e.source,r,"Unterminated string.")}function q(e,t){const n=e.source.body;let i=0,r=3;for(;r<12;){const e=n.charCodeAt(t+r++);if(125===e){if(r<5||!w(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|z(e),i<0)break}throw m(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function Q(e,t){const n=e.source.body,i=X(n,t+2);if(w(i))return{value:String.fromCodePoint(i),size:6};if(U(i)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=X(n,t+8);if(V(e))return{value:String.fromCodePoint(i,e),size:12}}throw m(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function X(e,t){return z(e.charCodeAt(t))<<12|z(e.charCodeAt(t+1))<<8|z(e.charCodeAt(t+2))<<4|z(e.charCodeAt(t+3))}function z(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function W(e,t){const 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 m(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function H(e,t){const n=e.source.body,i=n.length;let r=e.lineStart,s=t+3,o=s,a="";const c=[];for(;s<i;){const i=n.charCodeAt(s);if(34===i&&34===n.charCodeAt(s+1)&&34===n.charCodeAt(s+2)){a+=n.slice(o,s),c.push(a);const i=j(e,A.BLOCK_STRING,t,s+3,L(c).join("\n"));return e.line+=c.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(w(i))++s;else{if(!M(n,s))throw m(e.source,s,`Invalid character within String: ${B(e,s)}.`);s+=2}else a+=n.slice(o,s),c.push(a),13===i&&10===n.charCodeAt(s+1)?s+=2:++s,a="",o=s,r=s;else a+=n.slice(o,s),o=s+1,s+=4}throw m(e.source,s,"Unterminated string.")}function Z(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){if(!R(n.charCodeAt(r)))break;++r}return j(e,A.NAME,t,r,n.slice(t,r))}e(P,"isPunctuatorTokenKind"),e(w,"isUnicodeScalarValue"),e(M,"isSupplementaryCodePoint"),e(U,"isLeadingSurrogate"),e(V,"isTrailingSurrogate"),e(B,"printCodePointAt"),e(j,"createToken"),e(K,"readNextToken"),e(G,"readComment"),e(Y,"readNumber"),e($,"readDigits"),e(J,"readString"),e(q,"readEscapedUnicodeVariableWidth"),e(Q,"readEscapedUnicodeFixedWidth"),e(X,"read16BitHexCode"),e(z,"readHexDigit"),e(W,"readEscapedCharacter"),e(H,"readBlockString"),e(Z,"readName");function ee(e){return te(e,[])}function te(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return ne(e,t);default:return String(e)}}function ne(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(ie(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:te(t,n)}else if(Array.isArray(e))return se(e,n);return re(e,n)}function ie(e){return"function"==typeof e.toJSON}function re(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+oe(e)+"]";return"{ "+n.map(([e,n])=>e+": "+te(n,t)).join(", ")+" }"}function se(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),i=e.length-n,r=[];for(let i=0;i<n;++i)r.push(te(e[i],t));return 1===i?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function oe(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}e(ee,"inspect"),e(te,"formatValue"),e(ne,"formatObjectValue"),e(ie,"isJSONable"),e(re,"formatObject"),e(se,"formatArray"),e(oe,"getObjectTag");var ae=globalThis.process&&"production"===process.env.NODE_ENV,ce=e(ae?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var n;const 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)){const t=ee(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},"instanceOf"),le=class{static{e(this,"Source")}constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||s(!1,`Body must be a string. Received: ${ee(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||s(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||s(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function ue(e){return ce(e,le)}function pe(e,t){const n=new he(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}e(ue,"isSource"),e(pe,"parse");var he=class{static{e(this,"Parser")}constructor(e,t={}){const{lexer:n,...i}=t;if(n)this._lexer=n;else{const t=ue(e)?e:new le(e);this._lexer=new F(t)}this._options=i,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(A.NAME);return this.node(e,{kind:_.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:_.DOCUMENT,definitions:this.many(A.SOF,this.parseDefinition,A.EOF)})}parseDefinition(){if(this.peek(A.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===A.BRACE_L)throw m(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===A.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()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw m(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===t.value)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(A.BRACE_L))return this.node(e,{kind:_.OPERATION_DEFINITION,operation:T.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseDescription(),n=this.parseOperationType();let i;return this.peek(A.NAME)&&(i=this.parseName()),this.node(e,{kind:_.OPERATION_DEFINITION,operation:n,description:t,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 T.QUERY;case"mutation":return T.MUTATION;case"subscription":return T.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:_.VARIABLE_DEFINITION,description:this.parseDescription(),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:_.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:_.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,t=this.parseName();let n,i;return this.expectOptionalToken(A.COLON)?(n=t,i=this.parseName()):i=t,this.node(e,{kind:_.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(A.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(A.PAREN_L,t,A.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(A.COLON),this.node(t,{kind:_.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(A.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(A.NAME)?this.node(e,{kind:_.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:_.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token,t=this.parseDescription();return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:_.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:_.FRAGMENT_DEFINITION,description:t,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){const t=this._lexer.token;switch(t.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(t,{kind:_.INT,value:t.value});case A.FLOAT:return this.advanceLexer(),this.node(t,{kind:_.FLOAT,value:t.value});case A.STRING:case A.BLOCK_STRING:return this.parseStringLiteral();case A.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:_.BOOLEAN,value:!0});case"false":return this.node(t,{kind:_.BOOLEAN,value:!1});case"null":return this.node(t,{kind:_.NULL});default:return this.node(t,{kind:_.ENUM,value:t.value})}case A.DOLLAR:if(e){if(this.expectToken(A.DOLLAR),this._lexer.token.kind===A.NAME){const e=this._lexer.token.value;throw m(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(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:_.STRING,value:e.value,block:e.kind===A.BLOCK_STRING})}parseList(t){const n=e(()=>this.parseValueLiteral(t),"item");return this.node(this._lexer.token,{kind:_.LIST,values:this.any(A.BRACKET_L,n,A.BRACKET_R)})}parseObject(t){const n=e(()=>this.parseObjectField(t),"item");return this.node(this._lexer.token,{kind:_.OBJECT,fields:this.any(A.BRACE_L,n,A.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(A.COLON),this.node(t,{kind:_.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(A.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(A.AT),this.node(t,{kind:_.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(A.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(A.BRACKET_R),t=this.node(e,{kind:_.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(A.BANG)?this.node(e,{kind:_.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:_.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,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);return this.node(e,{kind:_.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(A.COLON);const n=this.parseNamedType();return this.node(e,{kind:_.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:_.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:_.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}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,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(A.COLON);const r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:_.FIELD_DEFINITION,description:t,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(A.PAREN_L,this.parseInputValueDef,A.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(A.COLON);const i=this.parseTypeReference();let r;this.expectOptionalToken(A.EQUALS)&&(r=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(e,{kind:_.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:_.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:_.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(A.EQUALS)?this.delimitedMany(A.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:_.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(A.BRACE_L,this.parseEnumValueDefinition,A.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:_.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 m(this._lexer.source,this._lexer.token.start,`${de(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:_.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,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 t=this.parseConstDirectives(),n=this.optionalMany(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:_.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:_.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const 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:_.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const 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:_.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:_.UNION_TYPE_EXTENSION,name:t,directives:n,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:_.ENUM_TYPE_EXTENSION,name:t,directives:n,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:_.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(A.AT);const n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const s=this.parseDirectiveLocations();return this.node(e,{kind:_.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(A.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(I,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){const e=this._lexer.token,t=this.expectOptionalToken(A.AT),n=this.parseName();let i,r;return!t&&this.expectOptionalToken(A.DOT)&&(i=this.parseName()),(t||i)&&this.expectOptionalToken(A.PAREN_L)&&(r=this.parseName(),this.expectToken(A.COLON),this.expectToken(A.PAREN_R)),t?r?this.node(e,{kind:_.DIRECTIVE_ARGUMENT_COORDINATE,name:n,argumentName:r}):this.node(e,{kind:_.DIRECTIVE_COORDINATE,name:n}):i?r?this.node(e,{kind:_.ARGUMENT_COORDINATE,name:n,fieldName:i,argumentName:r}):this.node(e,{kind:_.MEMBER_COORDINATE,name:n,memberName:i}):this.node(e,{kind:_.TYPE_COORDINATE,name:n})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new x(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw m(this._lexer.source,t.start,`Expected ${Ee(e)}, found ${de(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==A.NAME||t.value!==e)throw m(this._lexer.source,t.start,`Expected "${e}", found ${de(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===A.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return m(this._lexer.source,t.start,`Unexpected ${de(t)}.`)}any(e,t,n){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(n);)i.push(t.call(this));return i}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const i=[];do{i.push(t.call(this))}while(!this.expectOptionalToken(n));return i}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==A.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw m(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}};function de(e){const t=e.value;return Ee(e.kind)+(null!=t?` "${t}"`:"")}function Ee(e){return P(e)?`"${e}"`:e}e(de,"getTokenDesc"),e(Ee,"getTokenKindDesc");var fe=new Map,me=new Map,Te=!0,Ne=!1;function Ie(e){return e.replace(/[\s,]+/g," ").trim()}function Oe(e){return Ie(e.source.body.substring(e.start,e.end))}function _e(e){var t=new Set,n=[];return e.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var i=e.name.value,r=Oe(e.loc),s=me.get(i);s&&!s.has(r)?Te&&console.warn("Warning: fragment with name "+i+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):s||me.set(i,s=new Set),s.add(r),t.has(r)||(t.add(r),n.push(e))}else n.push(e)}),r(r({},e),{definitions:n})}function De(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(n){var i=e[n];i&&"object"==typeof i&&t.add(i)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}function Ae(e){var t=Ie(e);if(!fe.has(t)){var n=pe(e,{experimentalFragmentVariables:Ne,allowLegacyFragmentVariables:Ne});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");fe.set(t,De(_e(n)))}return fe.get(t)}function ve(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var i=e[0];return t.forEach(function(t,n){t&&"Document"===t.kind?i+=t.loc.source.body:i+=t,i+=e[n+1]}),Ae(i)}function xe(){fe.clear(),me.clear()}function ye(){Te=!1}function ke(){Ne=!0}function ge(){Ne=!1}e(Ie,"normalize"),e(Oe,"cacheKeyFromLoc"),e(_e,"processFragments"),e(De,"stripLoc"),e(Ae,"parseDocument"),e(ve,"gql"),e(xe,"resetCaches"),e(ye,"disableFragmentWarnings"),e(ke,"enableExperimentalFragmentVariables"),e(ge,"disableExperimentalFragmentVariables");var Ce,Se=ve,Re=xe,Le=ye,be=ke,Fe=ge;(Ce=ve||(ve={})).gql=Se,Ce.resetCaches=Re,Ce.disableFragmentWarnings=Le,Ce.enableExperimentalFragmentVariables=be,Ce.disableExperimentalFragmentVariables=Fe,ve.default=ve;var Pe=ve,we=e((e,t)=>{const n=t?t(e):e;return JSON.stringify(n,(e,t)=>void 0===t?"__undefined":t).replace(/"__undefined"/g,"undefined")},"generateDocumentNodeString"),Me=e((t,n)=>{const i=new Set,r=[],s=e(e=>{i.has(e)||(i.add(e),e.imports.forEach(e=>{const t=n[e.absolutePath];s(t)}),r.unshift(e))},"visitFile");return t.forEach(s),r},"topologicallySortParsedFiles"),Ue=e(r=>new Promise(s=>{const o=n.createInterface({input:t.createReadStream(r)});let a="";const c=[];let l=!1;const u=e((e,t)=>{const n=t.replace(e,""),s=n.replace(/"|'/g,""),o=i.join(i.dirname(r),s);c.push({absolutePath:o,relativePath:n})},"parseImportAndCapture");o.on("line",e=>{e.startsWith("#import ")?u("#import ",e):e.startsWith("# import ")?u("# import ",e):l?a+=e+"\n":"#"!==e[0]&&""!==e&&(l=!0,a+=e+"\n")}),o.on("close",()=>{s({body:a.trim(),filePath:r,imports:c})})}),"parseGraphQLFile"),Ve=e(t=>{const n={},i=[],r=new Set,s=e(e=>n[e]?Promise.resolve(null):new Promise(t=>{Ue(e).then(e=>{n[e.filePath]=e,e.imports.forEach(e=>{r.has(e.absolutePath)||(r.add(e.absolutePath),i.push(s(e.absolutePath)))});const o=i.shift();return o?o.then(t):t(null)})}),"visitAndParse");return s(t).then(()=>Me(Object.values(n),n).reduce((e,t)=>t.body+"\n\n"+e,""))},"generateGraphQLString"),Be=e((e,t,n)=>{const i={kind:"Document",definitions:[e,...t]};return we(i,n)},"generateDocumentNodeStringForOperationDefinition"),je=e(t=>e((e,t)=>(e.forEach(e=>{"FragmentDefinition"===e.kind&&(t[e.name.value]=e)}),t),"accumulateAllFragments")(t.definitions,{}),"collectAllFragmentDefinitions"),Ke=e((t,n)=>{const i=[],r=e(e=>{if("FragmentSpread"===e.kind){const t=n[e.name.value],r=Ke(t,n);i.push(...r,e.name.value)}},"handleSelectionNode");return"OperationDefinition"===t.kind?t.selectionSet.selections.forEach(e=>{var t;"Field"===e.kind&&(null==(t=e.selectionSet)||t.selections.forEach(r))}):t.selectionSet.selections.forEach(r),i},"collectAllFragmentReferences"),Ge=e((e,t)=>{const n=Pe(e),i=we(n,t),r=je(n),s=n.definitions.reduce((e,n)=>{if("OperationDefinition"===n.kind&&n.name&&n.name.value){const i=n.name.value,s=Ke(n,r).map(e=>{const t=r[e];if(!t)throw new Error(`Expected to find fragment definition for ${e}`);return t}),o=Be(n,s,t);e.push(`export const ${i} = ${o};`)}return e},[`const documentNode = ${i};`]);return s.push("export default documentNode;"),s.join("\n")},"generateContentsFromGraphqlString"),Ye=e(async(e,t)=>{if(e.startsWith("\0")&&e.endsWith(".graphql")){const n=e.slice(1),i=await Ve(n);return{code:Ge(i,t.mapDocumentNode),map:null}}},"loadGraphqlModule");export{Ye as loadGraphqlModule};//# sourceMappingURL=chunk-YSRKY4QW.js.map