UNPKG

@jackchuka/gql-ingest

Version:

A CLI tool for ingesting data from files into a GraphQL API. Supports CSV, JSON, JSONL, and YAML file formats.

29 lines (23 loc) 641 kB
#!/usr/bin/env node var OI=Object.create;var Mc=Object.defineProperty;var II=Object.getOwnPropertyDescriptor;var SI=Object.getOwnPropertyNames;var NI=Object.getPrototypeOf,kI=Object.prototype.hasOwnProperty;var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ir=(e,t)=>{for(var n in t)Mc(e,n,{get:t[n],enumerable:!0})},wI=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of SI(t))!kI.call(e,r)&&r!==n&&Mc(e,r,{get:()=>t[r],enumerable:!(i=II(t,r))||i.enumerable});return e};var DI=(e,t,n)=>(n=e!=null?OI(NI(e)):{},wI(t||!e||!e.__esModule?Mc(n,"default",{value:e,enumerable:!0}):n,e));var r$=y(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.versionInfo=li.version=void 0;var UD="16.12.0";li.version=UD;var zD=Object.freeze({major:16,minor:12,patch:0,preReleaseTag:null});li.versionInfo=zD});var Xe=y(og=>{"use strict";Object.defineProperty(og,"__esModule",{value:!0});og.devAssert=MD;function MD(e,t){if(!!!e)throw new Error(t)}});var hu=y(ag=>{"use strict";Object.defineProperty(ag,"__esModule",{value:!0});ag.isPromise=qD;function qD(e){return typeof e?.then=="function"}});var Zt=y(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0});sg.isObjectLike=VD;function VD(e){return typeof e=="object"&&e!==null}});var Ge=y(ug=>{"use strict";Object.defineProperty(ug,"__esModule",{value:!0});ug.invariant=GD;function GD(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}});var yu=y(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});cg.getLocation=ZD;var KD=Ge(),QD=/\r\n|[\n\r]/g;function ZD(e,t){let n=0,i=1;for(let r of e.body.matchAll(QD)){if(typeof r.index=="number"||(0,KD.invariant)(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}});var lg=y(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.printLocation=JD;bu.printSourceLocation=i$;var BD=yu();function JD(e){return i$(e.source,(0,BD.getLocation)(e.source,e.start))}function i$(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=t.line===1?n:0,u=t.column+s,c=`${e.name}:${a}:${u} `,l=i.split(/\r\n|[\n\r]/g),d=l[r];if(d.length>120){let p=Math.floor(u/80),f=u%80,v=[];for(let _=0;_<d.length;_+=80)v.push(d.slice(_,_+80));return c+n$([[`${a} |`,v[0]],...v.slice(1,p+1).map(_=>["|",_]),["|","^".padStart(f)],["|",v[p+1]]])}return c+n$([[`${a-1} |`,l[r-1]],[`${a} |`,d],["|","^".padStart(u)],[`${a+1} |`,l[r+1]]])}function n$(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(` `)}});var z=y(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.GraphQLError=void 0;di.formatError=HD;di.printError=XD;var YD=Zt(),o$=yu(),a$=lg();function WD(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var dg=class e extends Error{constructor(t,...n){var i,r,o;let{nodes:a,source:s,positions:u,path:c,originalError:l,extensions:d}=WD(n);super(t),this.name="GraphQLError",this.path=c??void 0,this.originalError=l??void 0,this.nodes=s$(Array.isArray(a)?a:a?[a]:void 0);let p=s$((i=this.nodes)===null||i===void 0?void 0:i.map(v=>v.loc).filter(v=>v!=null));this.source=s??(p==null||(r=p[0])===null||r===void 0?void 0:r.source),this.positions=u??p?.map(v=>v.start),this.locations=u&&s?u.map(v=>(0,o$.getLocation)(s,v)):p?.map(v=>(0,o$.getLocation)(v.source,v.start));let f=(0,YD.isObjectLike)(l?.extensions)?l?.extensions:void 0;this.extensions=(o=d??f)!==null&&o!==void 0?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` `+(0,a$.printLocation)(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` `+(0,a$.printSourceLocation)(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};di.GraphQLError=dg;function s$(e){return e===void 0||e.length===0?void 0:e}function XD(e){return e.toString()}function HD(e){return e.toJSON()}});var ho=y(pg=>{"use strict";Object.defineProperty(pg,"__esModule",{value:!0});pg.syntaxError=tP;var eP=z();function tP(e,t,n){return new eP.GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}});var kt=y(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.Token=vt.QueryDocumentKeys=vt.OperationTypeNode=vt.Location=void 0;vt.isNode=nP;var fg=class{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}};vt.Location=fg;var mg=class{constructor(t,n,i,r,o,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=o,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}};vt.Token=mg;var u$={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"]};vt.QueryDocumentKeys=u$;var rP=new Set(Object.keys(u$));function nP(e){let t=e?.kind;return typeof t=="string"&&rP.has(t)}var gg;vt.OperationTypeNode=gg;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(gg||(vt.OperationTypeNode=gg={}))});var pi=y(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.DirectiveLocation=void 0;var vg;yo.DirectiveLocation=vg;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(vg||(yo.DirectiveLocation=vg={}))});var ee=y(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.Kind=void 0;var hg;bo.Kind=hg;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",e.TYPE_COORDINATE="TypeCoordinate",e.MEMBER_COORDINATE="MemberCoordinate",e.ARGUMENT_COORDINATE="ArgumentCoordinate",e.DIRECTIVE_COORDINATE="DirectiveCoordinate",e.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate"})(hg||(bo.Kind=hg={}))});var _o=y(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.isDigit=c$;an.isLetter=yg;an.isNameContinue=aP;an.isNameStart=oP;an.isWhiteSpace=iP;function iP(e){return e===9||e===32}function c$(e){return e>=48&&e<=57}function yg(e){return e>=97&&e<=122||e>=65&&e<=90}function oP(e){return yg(e)||e===95}function aP(e){return yg(e)||c$(e)||e===95}});var $o=y(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.dedentBlockStringLines=sP;To.isPrintableAsBlockString=cP;To.printBlockString=lP;var bg=_o();function sP(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;a<e.length;++a){var o;let s=e[a],u=uP(s);u!==s.length&&(i=(o=i)!==null&&o!==void 0?o:a,r=a,a!==0&&u<n&&(n=u))}return e.map((a,s)=>s===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function uP(e){let t=0;for(;t<e.length&&(0,bg.isWhiteSpace)(e.charCodeAt(t));)++t;return t}function cP(e){if(e==="")return!0;let t=!0,n=!1,i=!0,r=!1;for(let o=0;o<e.length;++o)switch(e.codePointAt(o)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(t&&!r)return!1;r=!0,t=!0,n=!1;break;case 9:case 32:n||(n=t);break;default:i&&(i=n),t=!1}return!(t||i&&r)}function lP(e,t){let n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=i.length===1,o=i.length>1&&i.slice(1).every(f=>f.length===0||(0,bg.isWhiteSpace)(f.charCodeAt(0))),a=n.endsWith('\\"""'),s=e.endsWith('"')&&!a,u=e.endsWith("\\"),c=s||u,l=!(t!=null&&t.minimize)&&(!r||e.length>70||c||o||a),d="",p=r&&(0,bg.isWhiteSpace)(e.charCodeAt(0));return(l&&!p||o)&&(d+=` `),d+=n,(l||c)&&(d+=` `),'"""'+d+'"""'}});var fi=y(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.TokenKind=void 0;var _g;Eo.TokenKind=_g;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.DOT=".",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(_g||(Eo.TokenKind=_g={}))});var Oo=y(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.Lexer=void 0;Pr.createToken=Ne;Pr.isPunctuatorTokenKind=pP;Pr.printCodePointAt=Dr;Pr.readName=m$;var wt=ho(),d$=kt(),dP=$o(),sn=_o(),W=fi(),$g=class{constructor(t){let n=new d$.Token(W.TokenKind.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==W.TokenKind.EOF)do if(t.next)t=t.next;else{let n=fP(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===W.TokenKind.COMMENT);return t}};Pr.Lexer=$g;function pP(e){return e===W.TokenKind.BANG||e===W.TokenKind.DOLLAR||e===W.TokenKind.AMP||e===W.TokenKind.PAREN_L||e===W.TokenKind.PAREN_R||e===W.TokenKind.DOT||e===W.TokenKind.SPREAD||e===W.TokenKind.COLON||e===W.TokenKind.EQUALS||e===W.TokenKind.AT||e===W.TokenKind.BRACKET_L||e===W.TokenKind.BRACKET_R||e===W.TokenKind.BRACE_L||e===W.TokenKind.PIPE||e===W.TokenKind.BRACE_R}function mi(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function _u(e,t){return p$(e.charCodeAt(t))&&f$(e.charCodeAt(t+1))}function p$(e){return e>=55296&&e<=56319}function f$(e){return e>=56320&&e<=57343}function Dr(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return W.TokenKind.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Ne(e,t,n,i,r){let o=e.line,a=1+n-e.lineStart;return new d$.Token(t,n,i,o,a,r)}function fP(e,t){let n=e.source.body,i=n.length,r=t;for(;r<i;){let o=n.charCodeAt(r);switch(o){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return mP(e,r);case 33:return Ne(e,W.TokenKind.BANG,r,r+1);case 36:return Ne(e,W.TokenKind.DOLLAR,r,r+1);case 38:return Ne(e,W.TokenKind.AMP,r,r+1);case 40:return Ne(e,W.TokenKind.PAREN_L,r,r+1);case 41:return Ne(e,W.TokenKind.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return Ne(e,W.TokenKind.SPREAD,r,r+3);break;case 58:return Ne(e,W.TokenKind.COLON,r,r+1);case 61:return Ne(e,W.TokenKind.EQUALS,r,r+1);case 64:return Ne(e,W.TokenKind.AT,r,r+1);case 91:return Ne(e,W.TokenKind.BRACKET_L,r,r+1);case 93:return Ne(e,W.TokenKind.BRACKET_R,r,r+1);case 123:return Ne(e,W.TokenKind.BRACE_L,r,r+1);case 124:return Ne(e,W.TokenKind.PIPE,r,r+1);case 125:return Ne(e,W.TokenKind.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?_P(e,r):vP(e,r)}if((0,sn.isDigit)(o)||o===45)return gP(e,r,o);if((0,sn.isNameStart)(o))return m$(e,r);throw(0,wt.syntaxError)(e.source,r,o===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:mi(o)||_u(n,r)?`Unexpected character: ${Dr(e,r)}.`:`Invalid character: ${Dr(e,r)}.`)}return Ne(e,W.TokenKind.EOF,i,i)}function mP(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let o=n.charCodeAt(r);if(o===10||o===13)break;if(mi(o))++r;else if(_u(n,r))r+=2;else break}return Ne(e,W.TokenKind.COMMENT,t,r,n.slice(t+1,r))}function gP(e,t,n){let i=e.source.body,r=t,o=n,a=!1;if(o===45&&(o=i.charCodeAt(++r)),o===48){if(o=i.charCodeAt(++r),(0,sn.isDigit)(o))throw(0,wt.syntaxError)(e.source,r,`Invalid number, unexpected digit after 0: ${Dr(e,r)}.`)}else r=Tg(e,r,o),o=i.charCodeAt(r);if(o===46&&(a=!0,o=i.charCodeAt(++r),r=Tg(e,r,o),o=i.charCodeAt(r)),(o===69||o===101)&&(a=!0,o=i.charCodeAt(++r),(o===43||o===45)&&(o=i.charCodeAt(++r)),r=Tg(e,r,o),o=i.charCodeAt(r)),o===46||(0,sn.isNameStart)(o))throw(0,wt.syntaxError)(e.source,r,`Invalid number, expected digit but got: ${Dr(e,r)}.`);return Ne(e,a?W.TokenKind.FLOAT:W.TokenKind.INT,t,r,i.slice(t,r))}function Tg(e,t,n){if(!(0,sn.isDigit)(n))throw(0,wt.syntaxError)(e.source,t,`Invalid number, expected digit but got: ${Dr(e,t)}.`);let i=e.source.body,r=t+1;for(;(0,sn.isDigit)(i.charCodeAt(r));)++r;return r}function vP(e,t){let n=e.source.body,i=n.length,r=t+1,o=r,a="";for(;r<i;){let s=n.charCodeAt(r);if(s===34)return a+=n.slice(o,r),Ne(e,W.TokenKind.STRING,t,r+1,a);if(s===92){a+=n.slice(o,r);let u=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?hP(e,r):yP(e,r):bP(e,r);a+=u.value,r+=u.size,o=r;continue}if(s===10||s===13)break;if(mi(s))++r;else if(_u(n,r))r+=2;else throw(0,wt.syntaxError)(e.source,r,`Invalid character within String: ${Dr(e,r)}.`)}throw(0,wt.syntaxError)(e.source,r,"Unterminated string.")}function hP(e,t){let n=e.source.body,i=0,r=3;for(;r<12;){let o=n.charCodeAt(t+r++);if(o===125){if(r<5||!mi(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|xo(o),i<0)break}throw(0,wt.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function yP(e,t){let n=e.source.body,i=l$(n,t+2);if(mi(i))return{value:String.fromCodePoint(i),size:6};if(p$(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let r=l$(n,t+8);if(f$(r))return{value:String.fromCodePoint(i,r),size:12}}throw(0,wt.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function l$(e,t){return xo(e.charCodeAt(t))<<12|xo(e.charCodeAt(t+1))<<8|xo(e.charCodeAt(t+2))<<4|xo(e.charCodeAt(t+3))}function xo(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function bP(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw(0,wt.syntaxError)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function _P(e,t){let n=e.source.body,i=n.length,r=e.lineStart,o=t+3,a=o,s="",u=[];for(;o<i;){let c=n.charCodeAt(o);if(c===34&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34){s+=n.slice(a,o),u.push(s);let l=Ne(e,W.TokenKind.BLOCK_STRING,t,o+3,(0,dP.dedentBlockStringLines)(u).join(` `));return e.line+=u.length-1,e.lineStart=r,l}if(c===92&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34&&n.charCodeAt(o+3)===34){s+=n.slice(a,o),a=o+1,o+=4;continue}if(c===10||c===13){s+=n.slice(a,o),u.push(s),c===13&&n.charCodeAt(o+1)===10?o+=2:++o,s="",a=o,r=o;continue}if(mi(c))++o;else if(_u(n,o))o+=2;else throw(0,wt.syntaxError)(e.source,o,`Invalid character within String: ${Dr(e,o)}.`)}throw(0,wt.syntaxError)(e.source,o,"Unterminated string.")}function m$(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let o=n.charCodeAt(r);if((0,sn.isNameContinue)(o))++r;else break}return Ne(e,W.TokenKind.NAME,t,r,n.slice(t,r))}});var g$=y(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.SchemaCoordinateLexer=void 0;var TP=ho(),$P=kt(),EP=_o(),jr=Oo(),Ar=fi(),Eg=class{line=1;lineStart=0;constructor(t){let n=new $P.Token(Ar.TokenKind.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n}get[Symbol.toStringTag](){return"SchemaCoordinateLexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==Ar.TokenKind.EOF){let n=xP(this,t.end);t.next=n,n.prev=t,t=n}return t}};Tu.SchemaCoordinateLexer=Eg;function xP(e,t){let n=e.source.body,i=n.length,r=t;if(r<i){let o=n.charCodeAt(r);switch(o){case 46:return(0,jr.createToken)(e,Ar.TokenKind.DOT,r,r+1);case 40:return(0,jr.createToken)(e,Ar.TokenKind.PAREN_L,r,r+1);case 41:return(0,jr.createToken)(e,Ar.TokenKind.PAREN_R,r,r+1);case 58:return(0,jr.createToken)(e,Ar.TokenKind.COLON,r,r+1);case 64:return(0,jr.createToken)(e,Ar.TokenKind.AT,r,r+1)}if((0,EP.isNameStart)(o))return(0,jr.readName)(e,r);throw(0,TP.syntaxError)(e.source,r,`Invalid character: ${(0,jr.printCodePointAt)(e,r)}.`)}return(0,jr.createToken)(e,Ar.TokenKind.EOF,i,i)}});var se=y(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});xg.inspect=IP;var OP=10,v$=2;function IP(e){return $u(e,[])}function $u(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return SP(e,t);default:return String(e)}}function SP(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(NP(e)){let i=e.toJSON();if(i!==e)return typeof i=="string"?i:$u(i,n)}else if(Array.isArray(e))return wP(e,n);return kP(e,n)}function NP(e){return typeof e.toJSON=="function"}function kP(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>v$?"["+DP(e)+"]":"{ "+n.map(([r,o])=>r+": "+$u(o,t)).join(", ")+" }"}function wP(e,t){if(e.length===0)return"[]";if(t.length>v$)return"[Array]";let n=Math.min(OP,e.length),i=e.length-n,r=[];for(let o=0;o<n;++o)r.push($u(e[o],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function DP(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}});var Io=y(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.instanceOf=void 0;var PP=se(),jP=globalThis.process&&process.env.NODE_ENV==="production",AP=jP?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;let r=n.prototype[Symbol.toStringTag],o=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===o){let a=(0,PP.inspect)(t);throw new Error(`Cannot use ${r} "${a}" 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};Eu.instanceOf=AP});var Ou=y(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.Source=void 0;So.isSource=CP;var Og=Xe(),LP=se(),RP=Io(),xu=class{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||(0,Og.devAssert)(!1,`Body must be a string. Received: ${(0,LP.inspect)(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||(0,Og.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,Og.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};So.Source=xu;function CP(e){return(0,RP.instanceOf)(e,xu)}});var un=y(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.Parser=void 0;cr.parse=zP;cr.parseConstValue=qP;cr.parseSchemaCoordinate=GP;cr.parseType=VP;cr.parseValue=MP;var Lr=ho(),No=kt(),FP=pi(),M=ee(),h$=Oo(),UP=g$(),Su=Ou(),N=fi();function zP(e,t){let n=new Rr(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}function MP(e,t){let n=new Rr(e,t);n.expectToken(N.TokenKind.SOF);let i=n.parseValueLiteral(!1);return n.expectToken(N.TokenKind.EOF),i}function qP(e,t){let n=new Rr(e,t);n.expectToken(N.TokenKind.SOF);let i=n.parseConstValueLiteral();return n.expectToken(N.TokenKind.EOF),i}function VP(e,t){let n=new Rr(e,t);n.expectToken(N.TokenKind.SOF);let i=n.parseTypeReference();return n.expectToken(N.TokenKind.EOF),i}function GP(e){let t=(0,Su.isSource)(e)?e:new Su.Source(e),n=new UP.SchemaCoordinateLexer(t),i=new Rr(e,{lexer:n});i.expectToken(N.TokenKind.SOF);let r=i.parseSchemaCoordinate();return i.expectToken(N.TokenKind.EOF),r}var Rr=class{constructor(t,n={}){let{lexer:i,...r}=n;if(i)this._lexer=i;else{let o=(0,Su.isSource)(t)?t:new Su.Source(t);this._lexer=new h$.Lexer(o)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(N.TokenKind.NAME);return this.node(t,{kind:M.Kind.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:M.Kind.DOCUMENT,definitions:this.many(N.TokenKind.SOF,this.parseDefinition,N.TokenKind.EOF)})}parseDefinition(){if(this.peek(N.TokenKind.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===N.TokenKind.BRACE_L)throw(0,Lr.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===N.TokenKind.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()}switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw(0,Lr.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if(n.value==="extend")return this.parseTypeSystemExtension()}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(N.TokenKind.BRACE_L))return this.node(t,{kind:M.Kind.OPERATION_DEFINITION,operation:No.OperationTypeNode.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseDescription(),i=this.parseOperationType(),r;return this.peek(N.TokenKind.NAME)&&(r=this.parseName()),this.node(t,{kind:M.Kind.OPERATION_DEFINITION,operation:i,description:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(N.TokenKind.NAME);switch(t.value){case"query":return No.OperationTypeNode.QUERY;case"mutation":return No.OperationTypeNode.MUTATION;case"subscription":return No.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(N.TokenKind.PAREN_L,this.parseVariableDefinition,N.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:M.Kind.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(N.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(N.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(N.TokenKind.DOLLAR),this.node(t,{kind:M.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:M.Kind.SELECTION_SET,selections:this.many(N.TokenKind.BRACE_L,this.parseSelection,N.TokenKind.BRACE_R)})}parseSelection(){return this.peek(N.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(N.TokenKind.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:M.Kind.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(N.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(N.TokenKind.PAREN_L,n,N.TokenKind.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(N.TokenKind.COLON),this.node(n,{kind:M.Kind.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(N.TokenKind.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(N.TokenKind.NAME)?this.node(t,{kind:M.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:M.Kind.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:M.Kind.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:M.Kind.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case N.TokenKind.BRACKET_L:return this.parseList(t);case N.TokenKind.BRACE_L:return this.parseObject(t);case N.TokenKind.INT:return this.advanceLexer(),this.node(n,{kind:M.Kind.INT,value:n.value});case N.TokenKind.FLOAT:return this.advanceLexer(),this.node(n,{kind:M.Kind.FLOAT,value:n.value});case N.TokenKind.STRING:case N.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case N.TokenKind.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:M.Kind.BOOLEAN,value:!0});case"false":return this.node(n,{kind:M.Kind.BOOLEAN,value:!1});case"null":return this.node(n,{kind:M.Kind.NULL});default:return this.node(n,{kind:M.Kind.ENUM,value:n.value})}case N.TokenKind.DOLLAR:if(t)if(this.expectToken(N.TokenKind.DOLLAR),this._lexer.token.kind===N.TokenKind.NAME){let i=this._lexer.token.value;throw(0,Lr.syntaxError)(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:M.Kind.STRING,value:t.value,block:t.kind===N.TokenKind.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:M.Kind.LIST,values:this.any(N.TokenKind.BRACKET_L,n,N.TokenKind.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:M.Kind.OBJECT,fields:this.any(N.TokenKind.BRACE_L,n,N.TokenKind.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(N.TokenKind.COLON),this.node(n,{kind:M.Kind.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(N.TokenKind.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(N.TokenKind.AT),this.node(n,{kind:M.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(N.TokenKind.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(N.TokenKind.BRACKET_R),n=this.node(t,{kind:M.Kind.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(N.TokenKind.BANG)?this.node(t,{kind:M.Kind.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:M.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(N.TokenKind.STRING)||this.peek(N.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(N.TokenKind.BRACE_L,this.parseOperationTypeDefinition,N.TokenKind.BRACE_R);return this.node(t,{kind:M.Kind.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(N.TokenKind.COLON);let i=this.parseNamedType();return this.node(t,{kind:M.Kind.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:M.Kind.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:M.Kind.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(N.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(N.TokenKind.BRACE_L,this.parseFieldDefinition,N.TokenKind.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(N.TokenKind.COLON);let o=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:M.Kind.FIELD_DEFINITION,description:n,name:i,arguments:r,type:o,directives:a})}parseArgumentDefs(){return this.optionalMany(N.TokenKind.PAREN_L,this.parseInputValueDef,N.TokenKind.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(N.TokenKind.COLON);let r=this.parseTypeReference(),o;this.expectOptionalToken(N.TokenKind.EQUALS)&&(o=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:M.Kind.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:o,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:M.Kind.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:M.Kind.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(N.TokenKind.EQUALS)?this.delimitedMany(N.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:M.Kind.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:o})}parseEnumValuesDefinition(){return this.optionalMany(N.TokenKind.BRACE_L,this.parseEnumValueDefinition,N.TokenKind.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:M.Kind.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw(0,Lr.syntaxError)(this._lexer.source,this._lexer.token.start,`${Iu(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:M.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(N.TokenKind.BRACE_L,this.parseInputValueDef,N.TokenKind.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===N.TokenKind.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(N.TokenKind.BRACE_L,this.parseOperationTypeDefinition,N.TokenKind.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(N.TokenKind.AT);let i=this.parseName(),r=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:M.Kind.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:o,locations:a})}parseDirectiveLocations(){return this.delimitedMany(N.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(FP.DirectiveLocation,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){let t=this._lexer.token,n=this.expectOptionalToken(N.TokenKind.AT),i=this.parseName(),r;!n&&this.expectOptionalToken(N.TokenKind.DOT)&&(r=this.parseName());let o;return(n||r)&&this.expectOptionalToken(N.TokenKind.PAREN_L)&&(o=this.parseName(),this.expectToken(N.TokenKind.COLON),this.expectToken(N.TokenKind.PAREN_R)),n?o?this.node(t,{kind:M.Kind.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:o}):this.node(t,{kind:M.Kind.DIRECTIVE_COORDINATE,name:i}):r?o?this.node(t,{kind:M.Kind.ARGUMENT_COORDINATE,name:i,fieldName:r,argumentName:o}):this.node(t,{kind:M.Kind.MEMBER_COORDINATE,name:i,memberName:r}):this.node(t,{kind:M.Kind.TYPE_COORDINATE,name:i})}node(t,n){return this._options.noLocation!==!0&&(n.loc=new No.Location(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw(0,Lr.syntaxError)(this._lexer.source,n.start,`Expected ${y$(t)}, found ${Iu(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===N.TokenKind.NAME&&n.value===t)this.advanceLexer();else throw(0,Lr.syntaxError)(this._lexer.source,n.start,`Expected "${t}", found ${Iu(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===N.TokenKind.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return(0,Lr.syntaxError)(this._lexer.source,n.start,`Unexpected ${Iu(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==N.TokenKind.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw(0,Lr.syntaxError)(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};cr.Parser=Rr;function Iu(e){let t=e.value;return y$(e.kind)+(t!=null?` "${t}"`:"")}function y$(e){return(0,h$.isPunctuatorTokenKind)(e)?`"${e}"`:e}});var Cr=y(Ig=>{"use strict";Object.defineProperty(Ig,"__esModule",{value:!0});Ig.didYouMean=QP;var KP=5;function QP(e,t){let[n,i]=t?[e,t]:[void 0,e],r=" Did you mean ";n&&(r+=n+" ");let o=i.map(u=>`"${u}"`);switch(o.length){case 0:return"";case 1:return r+o[0]+"?";case 2:return r+o[0]+" or "+o[1]+"?"}let a=o.slice(0,KP),s=a.pop();return r+a.join(", ")+", or "+s+"?"}});var b$=y(Sg=>{"use strict";Object.defineProperty(Sg,"__esModule",{value:!0});Sg.identityFunc=ZP;function ZP(e){return e}});var Fr=y(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.keyMap=BP;function BP(e,t){let n=Object.create(null);for(let i of e)n[t(i)]=i;return n}});var ko=y(kg=>{"use strict";Object.defineProperty(kg,"__esModule",{value:!0});kg.keyValMap=JP;function JP(e,t,n){let i=Object.create(null);for(let r of e)i[t(r)]=n(r);return i}});var Dg=y(wg=>{"use strict";Object.defineProperty(wg,"__esModule",{value:!0});wg.mapValue=YP;function YP(e,t){let n=Object.create(null);for(let i of Object.keys(e))n[i]=t(e[i],i);return n}});var wo=y(jg=>{"use strict";Object.defineProperty(jg,"__esModule",{value:!0});jg.naturalCompare=WP;function WP(e,t){let n=0,i=0;for(;n<e.length&&i<t.length;){let r=e.charCodeAt(n),o=t.charCodeAt(i);if(Nu(r)&&Nu(o)){let a=0;do++n,a=a*10+r-Pg,r=e.charCodeAt(n);while(Nu(r)&&a>0);let s=0;do++i,s=s*10+o-Pg,o=t.charCodeAt(i);while(Nu(o)&&s>0);if(a<s)return-1;if(a>s)return 1}else{if(r<o)return-1;if(r>o)return 1;++n,++i}}return e.length-t.length}var Pg=48,XP=57;function Nu(e){return!isNaN(e)&&Pg<=e&&e<=XP}});var Ur=y(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});Lg.suggestionList=ej;var HP=wo();function ej(e,t){let n=Object.create(null),i=new Ag(e),r=Math.floor(e.length*.4)+1;for(let o of t){let a=i.measure(o,r);a!==void 0&&(n[o]=a)}return Object.keys(n).sort((o,a)=>{let s=n[o]-n[a];return s!==0?s:(0,HP.naturalCompare)(o,a)})}var Ag=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=_$(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let i=t.toLowerCase();if(this._inputLowerCase===i)return 1;let r=_$(i),o=this._inputArray;if(r.length<o.length){let l=r;r=o,o=l}let a=r.length,s=o.length;if(a-s>n)return;let u=this._rows;for(let l=0;l<=s;l++)u[0][l]=l;for(let l=1;l<=a;l++){let d=u[(l-1)%3],p=u[l%3],f=p[0]=l;for(let v=1;v<=s;v++){let _=r[l-1]===o[v-1]?0:1,j=Math.min(d[v]+1,p[v-1]+1,d[v-1]+_);if(l>1&&v>1&&r[l-1]===o[v-2]&&r[l-2]===o[v-1]){let U=u[(l-2)%3][v-2];j=Math.min(j,U+1)}j<f&&(f=j),p[v]=j}if(f>n)return}let c=u[a%3][s];return c<=n?c:void 0}};function _$(e){let t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=e.charCodeAt(i);return n}});var ku=y(Rg=>{"use strict";Object.defineProperty(Rg,"__esModule",{value:!0});Rg.toObjMap=tj;function tj(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,i]of Object.entries(e))t[n]=i;return t}});var T$=y(Cg=>{"use strict";Object.defineProperty(Cg,"__esModule",{value:!0});Cg.printString=rj;function rj(e){return`"${e.replace(nj,ij)}"`}var nj=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function ij(e){return oj[e.charCodeAt(0)]}var oj=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]});var cn=y(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.BREAK=void 0;zr.getEnterLeaveForKind=wu;zr.getVisitFn=lj;zr.visit=uj;zr.visitInParallel=cj;var aj=Xe(),sj=se(),Fg=kt(),$$=ee(),gi=Object.freeze({});zr.BREAK=gi;function uj(e,t,n=Fg.QueryDocumentKeys){let i=new Map;for(let U of Object.values($$.Kind))i.set(U,wu(t,U));let r,o=Array.isArray(e),a=[e],s=-1,u=[],c=e,l,d,p=[],f=[];do{s++;let U=s===a.length,k=U&&u.length!==0;if(U){if(l=f.length===0?void 0:p[p.length-1],c=d,d=f.pop(),k)if(o){c=c.slice();let H=0;for(let[Ie,De]of u){let ft=Ie-H;De===null?(c.splice(ft,1),H++):c[ft]=De}}else{c={...c};for(let[H,Ie]of u)c[H]=Ie}s=r.index,a=r.keys,u=r.edits,o=r.inArray,r=r.prev}else if(d){if(l=o?s:a[s],c=d[l],c==null)continue;p.push(l)}let V;if(!Array.isArray(c)){var v,_;(0,Fg.isNode)(c)||(0,aj.devAssert)(!1,`Invalid AST Node: ${(0,sj.inspect)(c)}.`);let H=U?(v=i.get(c.kind))===null||v===void 0?void 0:v.leave:(_=i.get(c.kind))===null||_===void 0?void 0:_.enter;if(V=H?.call(t,c,l,d,p,f),V===gi)break;if(V===!1){if(!U){p.pop();continue}}else if(V!==void 0&&(u.push([l,V]),!U))if((0,Fg.isNode)(V))c=V;else{p.pop();continue}}if(V===void 0&&k&&u.push([l,c]),U)p.pop();else{var j;r={inArray:o,index:s,keys:a,edits:u,prev:r},o=Array.isArray(c),a=o?c:(j=n[c.kind])!==null&&j!==void 0?j:[],s=-1,u=[],d&&f.push(d),d=c}}while(r!==void 0);return u.length!==0?u[u.length-1][1]:e}function cj(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let i of Object.values($$.Kind)){let r=!1,o=new Array(e.length).fill(void 0),a=new Array(e.length).fill(void 0);for(let u=0;u<e.length;++u){let{enter:c,leave:l}=wu(e[u],i);r||(r=c!=null||l!=null),o[u]=c,a[u]=l}if(!r)continue;let s={enter(...u){let c=u[0];for(let d=0;d<e.length;d++)if(t[d]===null){var l;let p=(l=o[d])===null||l===void 0?void 0:l.apply(e[d],u);if(p===!1)t[d]=c;else if(p===gi)t[d]=gi;else if(p!==void 0)return p}},leave(...u){let c=u[0];for(let d=0;d<e.length;d++)if(t[d]===null){var l;let p=(l=a[d])===null||l===void 0?void 0:l.apply(e[d],u);if(p===gi)t[d]=gi;else if(p!==void 0&&p!==!1)return p}else t[d]===c&&(t[d]=null)}};n[i]=s}return n}function wu(e,t){let n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function lj(e,t,n){let{enter:i,leave:r}=wu(e,t);return n?r:i}});var ct=y(zg=>{"use strict";Object.defineProperty(zg,"__esModule",{value:!0});zg.print=mj;var dj=$o(),pj=T$(),fj=cn();function mj(e){return(0,fj.visit)(e,vj)}var gj=80,vj={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>P(e.definitions,` `)},OperationDefinition:{leave(e){let t=Ug(e.variableDefinitions)?Q(`( `,P(e.variableDefinitions,` `),` )`):Q("(",P(e.variableDefinitions,", "),")"),n=Q("",e.description,` `)+P([e.operation,P(