massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / prettier / esm / parser-graphql.mjs
1 var e=function(e,t){const n=new SyntaxError(e+" ("+t.start.line+":"+t.start.column+")");return n.loc=t,n};var t=function(){let e;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(const[t,i]of n.entries())try{return{result:i()}}catch(n){0===t&&(e=n)}return{error:e}};var n={hasPragma:function(e){return/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/.test(e)},insertPragma:function(e){return"# @format\n\n"+e}};var i={locStart:function(e){return"number"==typeof e.start?e.start:e.loc&&e.loc.start},locEnd:function(e){return"number"==typeof e.end?e.end:e.loc&&e.loc.end}},r={},o={};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e){return"object"==a(e)&&null!==e};var s={};Object.defineProperty(s,"__esModule",{value:!0}),s.SYMBOL_TO_STRING_TAG=s.SYMBOL_ASYNC_ITERATOR=s.SYMBOL_ITERATOR=void 0;var c="function"==typeof Symbol&&null!=Symbol.iterator?Symbol.iterator:"@@iterator";s.SYMBOL_ITERATOR=c;var u="function"==typeof Symbol&&null!=Symbol.asyncIterator?Symbol.asyncIterator:"@@asyncIterator";s.SYMBOL_ASYNC_ITERATOR=u;var l="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";s.SYMBOL_TO_STRING_TAG=l;var p={};Object.defineProperty(p,"__esModule",{value:!0}),p.getLocation=function(e,t){var n,i=/\r\n|[\n\r]/g,r=1,o=t+1;for(;(n=i.exec(e.body))&&n.index<t;)r+=1,o=t+1-(n.index+n[0].length);return{line:r,column:o}};var d={};Object.defineProperty(d,"__esModule",{value:!0}),d.printLocation=function(e){return f(e.source,(0,h.getLocation)(e.source,e.start))},d.printSourceLocation=f;var h=p;function f(e,t){var n=e.locationOffset.column-1,i=v(n)+e.body,r=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?n:0,c=t.column+s,u="".concat(e.name,":").concat(a,":").concat(c,"\n"),l=i.split(/\r\n|[\n\r]/g),p=l[r];if(p.length>120){for(var d=Math.floor(c/80),h=c%80,f=[],E=0;E<p.length;E+=80)f.push(p.slice(E,E+80));return u+T([["".concat(a),f[0]]].concat(f.slice(1,d+1).map((function(e){return["",e]})),[[" ",v(h-1)+"^"],["",f[d+1]]]))}return u+T([["".concat(a-1),l[r-1]],["".concat(a),p],["",v(c-1)+"^"],["".concat(a+1),l[r+1]]])}function T(e){var t=e.filter((function(e){return e[0],void 0!==e[1]})),n=Math.max.apply(Math,t.map((function(e){return e[0].length})));return t.map((function(e){var t,i=e[0],r=e[1];return v(n-(t=i).length)+t+(r?" | "+r:" |")})).join("\n")}function v(e){return Array(e+1).join(" ")}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.printError=R,r.GraphQLError=void 0;var k,N=(k=o)&&k.__esModule?k:{default:k},y=s,_=p,I=d;function O(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function m(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?A(e):t}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e){var t="function"==typeof Map?new Map:void 0;return x=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return K(e,arguments,b(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),S(i,e)},x(e)}function K(e,t,n){return K=D()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&S(r,n.prototype),r},K.apply(null,arguments)}function D(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function S(e,t){return S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},S(e,t)}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}var L=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(s,x(Error));var t,n,i,r,o,a=(t=s,n=D(),function(){var e,i=b(t);if(n){var r=b(this).constructor;e=Reflect.construct(i,arguments,r)}else e=i.apply(this,arguments);return m(this,e)});function s(e,t,n,i,r,o,c){var u,l,p,d,h;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),h=a.call(this,e);var f,T=Array.isArray(t)?0!==t.length?t:void 0:t?[t]:void 0,v=n;!v&&T&&(v=null===(f=T[0].loc)||void 0===f?void 0:f.source);var E,k=i;!k&&T&&(k=T.reduce((function(e,t){return t.loc&&e.push(t.loc.start),e}),[])),k&&0===k.length&&(k=void 0),i&&n?E=i.map((function(e){return(0,_.getLocation)(n,e)})):T&&(E=T.reduce((function(e,t){return t.loc&&e.push((0,_.getLocation)(t.loc.source,t.loc.start)),e}),[]));var y=c;if(null==y&&null!=o){var I=o.extensions;(0,N.default)(I)&&(y=I)}return Object.defineProperties(A(h),{name:{value:"GraphQLError"},message:{value:e,enumerable:!0,writable:!0},locations:{value:null!==(u=E)&&void 0!==u?u:void 0,enumerable:null!=E},path:{value:null!=r?r:void 0,enumerable:null!=r},nodes:{value:null!=T?T:void 0},source:{value:null!==(l=v)&&void 0!==l?l:void 0},positions:{value:null!==(p=k)&&void 0!==p?p:void 0},originalError:{value:o},extensions:{value:null!==(d=y)&&void 0!==d?d:void 0,enumerable:null!=y}}),null!=o&&o.stack?(Object.defineProperty(A(h),"stack",{value:o.stack,writable:!0,configurable:!0}),m(h)):(Error.captureStackTrace?Error.captureStackTrace(A(h),s):Object.defineProperty(A(h),"stack",{value:Error().stack,writable:!0,configurable:!0}),h)}return i=s,(r=[{key:"toString",value:function(){return R(this)}},{key:y.SYMBOL_TO_STRING_TAG,get:function(){return"Object"}}])&&O(i.prototype,r),o&&O(i,o),s}();function R(e){var t=e.message;if(e.nodes)for(var n=0,i=e.nodes;n<i.length;n++){var r=i[n];r.loc&&(t+="\n\n"+(0,I.printLocation)(r.loc))}else if(e.source&&e.locations)for(var o=0,a=e.locations;o<a.length;o++){var s=a[o];t+="\n\n"+(0,I.printSourceLocation)(e.source,s)}return t}r.GraphQLError=L;var g={},C={};Object.defineProperty(C,"__esModule",{value:!0}),C.syntaxError=function(e,t,n){return new w.GraphQLError("Syntax Error: ".concat(n),void 0,e,[t])};var w=r;var F={};Object.defineProperty(F,"__esModule",{value:!0}),F.Kind=void 0;var M=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});F.Kind=M;var P={},B={},U={};Object.defineProperty(U,"__esModule",{value:!0}),U.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")};var j={};Object.defineProperty(j,"__esModule",{value:!0}),j.default=void 0;var V="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;j.default=V,Object.defineProperty(B,"__esModule",{value:!0}),B.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,G.default)(0),e.prototype.inspect=t,Y.default&&(e.prototype[Y.default]=t)};var G=J(U),Y=J(j);function J(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(P,"__esModule",{value:!0}),P.isNode=function(e){return null!=e&&"string"==typeof e.kind},P.Token=P.Location=void 0;var Q=function(e){return e&&e.__esModule?e:{default:e}}(B);var X=function(){function e(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();P.Location=X,(0,Q.default)(X);var q=function(){function e(e,t,n,i,r,o,a){this.kind=e,this.start=t,this.end=n,this.line=i,this.column=r,this.value=a,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();P.Token=q,(0,Q.default)(q);var H={};Object.defineProperty(H,"__esModule",{value:!0}),H.TokenKind=void 0;var z=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});H.TokenKind=z;var $={},W={};Object.defineProperty(W,"__esModule",{value:!0}),W.default=function(e){return te(e,[])};var Z=function(e){return e&&e.__esModule?e:{default:e}}(j);function ee(e){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(e)}function te(e,t){switch(ee(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),i=function(e){var t=e[String(Z.default)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==i){var r=i.call(e);if(r!==e)return"string"==typeof r?r:te(r,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var n=Math.min(10,e.length),i=e.length-n,r=[],o=0;o<n;++o)r.push(te(e[o],t));1===i?r.push("... 1 more item"):i>1&&r.push("... ".concat(i," more items"));return"["+r.join(", ")+"]"}(e,n);return function(e,t){var n=Object.keys(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}(e)+"]";var i=n.map((function(n){return n+": "+te(e[n],t)}));return"{ "+i.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}var ne={};Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=function(e,t){if(!Boolean(e))throw new Error(t)};var ie={};Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=void 0,function(e){e&&e.__esModule}(W);ie.default=function(e,t){return e instanceof t},Object.defineProperty($,"__esModule",{value:!0}),$.isSource=function(e){return(0,se.default)(e,le)},$.Source=void 0;var re=s,oe=ce(W),ae=ce(ne),se=ce(ie);function ce(e){return e&&e.__esModule?e:{default:e}}function ue(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var le=function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||(0,ae.default)(0,"Body must be a string. Received: ".concat((0,oe.default)(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||(0,ae.default)(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,ae.default)(0,"column in locationOffset is 1-indexed and must be positive.")}var t,n,i;return t=e,(n=[{key:re.SYMBOL_TO_STRING_TAG,get:function(){return"Source"}}])&&ue(t.prototype,n),i&&ue(t,i),e}();$.Source=le;var pe={};Object.defineProperty(pe,"__esModule",{value:!0}),pe.DirectiveLocation=void 0;var de=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});pe.DirectiveLocation=de;var he={},fe={};function Te(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}function ve(e){for(var t,n=!0,i=!0,r=0,o=null,a=0;a<e.length;++a)switch(e.charCodeAt(a)){case 13:10===e.charCodeAt(a+1)&&++a;case 10:n=!1,i=!0,r=0;break;case 9:case 32:++r;break;default:i&&!n&&(null===o||r<o)&&(o=r),i=!1}return null!==(t=o)&&void 0!==t?t:0}Object.defineProperty(fe,"__esModule",{value:!0}),fe.dedentBlockStringValue=function(e){var t=e.split(/\r\n|[\n\r]/g),n=ve(e);if(0!==n)for(var i=1;i<t.length;i++)t[i]=t[i].slice(n);var r=0;for(;r<t.length&&Te(t[r]);)++r;var o=t.length;for(;o>r&&Te(t[o-1]);)--o;return t.slice(r,o).join("\n")},fe.getBlockStringIndentation=ve,fe.printBlockString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=-1===e.indexOf("\n"),r=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],a="\\"===e[e.length-1],s=!i||o||a||n,c="";!s||i&&r||(c+="\n"+t);c+=t?e.replace(/\n/g,"\n"+t):e,s&&(c+="\n");return'"""'+c.replace(/"""/g,'\\"""')+'"""'},Object.defineProperty(he,"__esModule",{value:!0}),he.isPunctuatorTokenKind=function(e){return e===Ne.TokenKind.BANG||e===Ne.TokenKind.DOLLAR||e===Ne.TokenKind.AMP||e===Ne.TokenKind.PAREN_L||e===Ne.TokenKind.PAREN_R||e===Ne.TokenKind.SPREAD||e===Ne.TokenKind.COLON||e===Ne.TokenKind.EQUALS||e===Ne.TokenKind.AT||e===Ne.TokenKind.BRACKET_L||e===Ne.TokenKind.BRACKET_R||e===Ne.TokenKind.BRACE_L||e===Ne.TokenKind.PIPE||e===Ne.TokenKind.BRACE_R},he.Lexer=void 0;var Ee=C,ke=P,Ne=H,ye=fe,_e=function(){function e(e){var t=new ke.Token(Ne.TokenKind.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==Ne.TokenKind.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=Oe(this,e)}while(e.kind===Ne.TokenKind.COMMENT);return e},e}();function Ie(e){return isNaN(e)?Ne.TokenKind.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function Oe(e,t){for(var n=e.source,i=n.body,r=i.length,o=t.end;o<r;){var a=i.charCodeAt(o),s=e.line,c=1+o-e.lineStart;switch(a){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===i.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 33:return new ke.Token(Ne.TokenKind.BANG,o,o+1,s,c,t);case 35:return Ae(n,o,s,c,t);case 36:return new ke.Token(Ne.TokenKind.DOLLAR,o,o+1,s,c,t);case 38:return new ke.Token(Ne.TokenKind.AMP,o,o+1,s,c,t);case 40:return new ke.Token(Ne.TokenKind.PAREN_L,o,o+1,s,c,t);case 41:return new ke.Token(Ne.TokenKind.PAREN_R,o,o+1,s,c,t);case 46:if(46===i.charCodeAt(o+1)&&46===i.charCodeAt(o+2))return new ke.Token(Ne.TokenKind.SPREAD,o,o+3,s,c,t);break;case 58:return new ke.Token(Ne.TokenKind.COLON,o,o+1,s,c,t);case 61:return new ke.Token(Ne.TokenKind.EQUALS,o,o+1,s,c,t);case 64:return new ke.Token(Ne.TokenKind.AT,o,o+1,s,c,t);case 91:return new ke.Token(Ne.TokenKind.BRACKET_L,o,o+1,s,c,t);case 93:return new ke.Token(Ne.TokenKind.BRACKET_R,o,o+1,s,c,t);case 123:return new ke.Token(Ne.TokenKind.BRACE_L,o,o+1,s,c,t);case 124:return new ke.Token(Ne.TokenKind.PIPE,o,o+1,s,c,t);case 125:return new ke.Token(Ne.TokenKind.BRACE_R,o,o+1,s,c,t);case 34:return 34===i.charCodeAt(o+1)&&34===i.charCodeAt(o+2)?Se(n,o,s,c,t,e):De(n,o,s,c,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return xe(n,o,a,s,c,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return Le(n,o,s,c,t)}throw(0,Ee.syntaxError)(n,o,me(a))}var u=e.line,l=1+o-e.lineStart;return new ke.Token(Ne.TokenKind.EOF,r,r,u,l,t)}function me(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(Ie(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(Ie(e),".")}function Ae(e,t,n,i,r){var o,a=e.body,s=t;do{o=a.charCodeAt(++s)}while(!isNaN(o)&&(o>31||9===o));return new ke.Token(Ne.TokenKind.COMMENT,t,s,n,i,r,a.slice(t+1,s))}function xe(e,t,n,i,r,o){var a=e.body,s=n,c=t,u=!1;if(45===s&&(s=a.charCodeAt(++c)),48===s){if((s=a.charCodeAt(++c))>=48&&s<=57)throw(0,Ee.syntaxError)(e,c,"Invalid number, unexpected digit after 0: ".concat(Ie(s),"."))}else c=Ke(e,c,s),s=a.charCodeAt(c);if(46===s&&(u=!0,s=a.charCodeAt(++c),c=Ke(e,c,s),s=a.charCodeAt(c)),69!==s&&101!==s||(u=!0,43!==(s=a.charCodeAt(++c))&&45!==s||(s=a.charCodeAt(++c)),c=Ke(e,c,s),s=a.charCodeAt(c)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw(0,Ee.syntaxError)(e,c,"Invalid number, expected digit but got: ".concat(Ie(s),"."));return new ke.Token(u?Ne.TokenKind.FLOAT:Ne.TokenKind.INT,t,c,i,r,o,a.slice(t,c))}function Ke(e,t,n){var i=e.body,r=t,o=n;if(o>=48&&o<=57){do{o=i.charCodeAt(++r)}while(o>=48&&o<=57);return r}throw(0,Ee.syntaxError)(e,r,"Invalid number, expected digit but got: ".concat(Ie(o),"."))}function De(e,t,n,i,r){for(var o,a,s,c,u=e.body,l=t+1,p=l,d=0,h="";l<u.length&&!isNaN(d=u.charCodeAt(l))&&10!==d&&13!==d;){if(34===d)return h+=u.slice(p,l),new ke.Token(Ne.TokenKind.STRING,t,l+1,n,i,r,h);if(d<32&&9!==d)throw(0,Ee.syntaxError)(e,l,"Invalid character within String: ".concat(Ie(d),"."));if(++l,92===d){switch(h+=u.slice(p,l-1),d=u.charCodeAt(l)){case 34:h+='"';break;case 47:h+="/";break;case 92:h+="\\";break;case 98:h+="\b";break;case 102:h+="\f";break;case 110:h+="\n";break;case 114:h+="\r";break;case 116:h+="\t";break;case 117:var f=(o=u.charCodeAt(l+1),a=u.charCodeAt(l+2),s=u.charCodeAt(l+3),c=u.charCodeAt(l+4),be(o)<<12|be(a)<<8|be(s)<<4|be(c));if(f<0){var T=u.slice(l+1,l+5);throw(0,Ee.syntaxError)(e,l,"Invalid character escape sequence: \\u".concat(T,"."))}h+=String.fromCharCode(f),l+=4;break;default:throw(0,Ee.syntaxError)(e,l,"Invalid character escape sequence: \\".concat(String.fromCharCode(d),"."))}p=++l}}throw(0,Ee.syntaxError)(e,l,"Unterminated string.")}function Se(e,t,n,i,r,o){for(var a=e.body,s=t+3,c=s,u=0,l="";s<a.length&&!isNaN(u=a.charCodeAt(s));){if(34===u&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2))return l+=a.slice(c,s),new ke.Token(Ne.TokenKind.BLOCK_STRING,t,s+3,n,i,r,(0,ye.dedentBlockStringValue)(l));if(u<32&&9!==u&&10!==u&&13!==u)throw(0,Ee.syntaxError)(e,s,"Invalid character within String: ".concat(Ie(u),"."));10===u?(++s,++o.line,o.lineStart=s):13===u?(10===a.charCodeAt(s+1)?s+=2:++s,++o.line,o.lineStart=s):92===u&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2)&&34===a.charCodeAt(s+3)?(l+=a.slice(c,s)+'"""',c=s+=4):++s}throw(0,Ee.syntaxError)(e,s,"Unterminated string.")}function be(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Le(e,t,n,i,r){for(var o=e.body,a=o.length,s=t+1,c=0;s!==a&&!isNaN(c=o.charCodeAt(s))&&(95===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++s;return new ke.Token(Ne.TokenKind.NAME,t,s,n,i,r,o.slice(t,s))}he.Lexer=_e,Object.defineProperty(g,"__esModule",{value:!0}),g.parse=function(e,t){return new Be(e,t).parseDocument()},g.parseValue=function(e,t){var n=new Be(e,t);n.expectToken(we.TokenKind.SOF);var i=n.parseValueLiteral(!1);return n.expectToken(we.TokenKind.EOF),i},g.parseType=function(e,t){var n=new Be(e,t);n.expectToken(we.TokenKind.SOF);var i=n.parseTypeReference();return n.expectToken(we.TokenKind.EOF),i},g.Parser=void 0;var Re=C,ge=F,Ce=P,we=H,Fe=$,Me=pe,Pe=he;var Be=function(){function e(e,t){var n=(0,Fe.isSource)(e)?e:new Fe.Source(e);this._lexer=new Pe.Lexer(n),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(we.TokenKind.NAME);return{kind:ge.Kind.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:ge.Kind.DOCUMENT,definitions:this.many(we.TokenKind.SOF,this.parseDefinition,we.TokenKind.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(we.TokenKind.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(we.TokenKind.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(we.TokenKind.BRACE_L))return{kind:ge.Kind.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,n=this.parseOperationType();return this.peek(we.TokenKind.NAME)&&(t=this.parseName()),{kind:ge.Kind.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(we.TokenKind.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(we.TokenKind.PAREN_L,this.parseVariableDefinition,we.TokenKind.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:ge.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(we.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(we.TokenKind.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(we.TokenKind.DOLLAR),{kind:ge.Kind.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:ge.Kind.SELECTION_SET,selections:this.many(we.TokenKind.BRACE_L,this.parseSelection,we.TokenKind.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(we.TokenKind.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,i=this.parseName();return this.expectOptionalToken(we.TokenKind.COLON)?(e=i,t=this.parseName()):t=i,{kind:ge.Kind.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(we.TokenKind.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(we.TokenKind.PAREN_L,t,we.TokenKind.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(we.TokenKind.COLON),{kind:ge.Kind.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:ge.Kind.ARGUMENT,name:this.parseName(),value:(this.expectToken(we.TokenKind.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(we.TokenKind.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(we.TokenKind.NAME)?{kind:ge.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:ge.Kind.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:ge.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:ge.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case we.TokenKind.BRACKET_L:return this.parseList(e);case we.TokenKind.BRACE_L:return this.parseObject(e);case we.TokenKind.INT:return this._lexer.advance(),{kind:ge.Kind.INT,value:t.value,loc:this.loc(t)};case we.TokenKind.FLOAT:return this._lexer.advance(),{kind:ge.Kind.FLOAT,value:t.value,loc:this.loc(t)};case we.TokenKind.STRING:case we.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case we.TokenKind.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:ge.Kind.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:ge.Kind.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:ge.Kind.NULL,loc:this.loc(t)};default:return{kind:ge.Kind.ENUM,value:t.value,loc:this.loc(t)}}case we.TokenKind.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:ge.Kind.STRING,value:e.value,block:e.kind===we.TokenKind.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token;return{kind:ge.Kind.LIST,values:this.any(we.TokenKind.BRACKET_L,(function(){return t.parseValueLiteral(e)}),we.TokenKind.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token;return{kind:ge.Kind.OBJECT,fields:this.any(we.TokenKind.BRACE_L,(function(){return t.parseObjectField(e)}),we.TokenKind.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(we.TokenKind.COLON),{kind:ge.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(we.TokenKind.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(we.TokenKind.AT),{kind:ge.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(we.TokenKind.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(we.TokenKind.BRACKET_R),e={kind:ge.Kind.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(we.TokenKind.BANG)?{kind:ge.Kind.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:ge.Kind.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===we.TokenKind.NAME)switch(e.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()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(we.TokenKind.STRING)||this.peek(we.TokenKind.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var n=this.parseDirectives(!0),i=this.many(we.TokenKind.BRACE_L,this.parseOperationTypeDefinition,we.TokenKind.BRACE_R);return{kind:ge.Kind.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(we.TokenKind.COLON);var n=this.parseNamedType();return{kind:ge.Kind.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),i=this.parseDirectives(!0);return{kind:ge.Kind.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:i,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:ge.Kind.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:o,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(we.TokenKind.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(we.TokenKind.AMP)||this.peek(we.TokenKind.NAME));return t}return this.delimitedMany(we.TokenKind.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(we.TokenKind.BRACE_L)&&this._lexer.lookahead().kind===we.TokenKind.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(we.TokenKind.BRACE_L,this.parseFieldDefinition,we.TokenKind.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(we.TokenKind.COLON);var r=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:ge.Kind.FIELD_DEFINITION,description:t,name:n,arguments:i,type:r,directives:o,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(we.TokenKind.PAREN_L,this.parseInputValueDef,we.TokenKind.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(we.TokenKind.COLON);var i,r=this.parseTypeReference();this.expectOptionalToken(we.TokenKind.EQUALS)&&(i=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:ge.Kind.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:ge.Kind.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:o,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),i=this.parseDirectives(!0),r=this.parseUnionMemberTypes();return{kind:ge.Kind.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:r,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(we.TokenKind.EQUALS)?this.delimitedMany(we.TokenKind.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),i=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();return{kind:ge.Kind.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:r,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(we.TokenKind.BRACE_L,this.parseEnumValueDefinition,we.TokenKind.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),i=this.parseDirectives(!0);return{kind:ge.Kind.ENUM_VALUE_DEFINITION,description:t,name:n,directives:i,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),i=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();return{kind:ge.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,fields:r,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(we.TokenKind.BRACE_L,this.parseInputValueDef,we.TokenKind.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===we.TokenKind.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)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(we.TokenKind.BRACE_L,this.parseOperationTypeDefinition,we.TokenKind.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:ge.Kind.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:ge.Kind.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return{kind:ge.Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return{kind:ge.Kind.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();if(0===n.length&&0===i.length)throw this.unexpected();return{kind:ge.Kind.UNION_TYPE_EXTENSION,name:t,directives:n,types:i,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return{kind:ge.Kind.ENUM_TYPE_EXTENSION,name:t,directives:n,values:i,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return{kind:ge.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(we.TokenKind.AT);var n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:ge.Kind.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:r,locations:o,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(we.TokenKind.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==Me.DirectiveLocation[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new Ce.Location(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw(0,Re.syntaxError)(this._lexer.source,t.start,"Expected ".concat(je(e),", found ").concat(Ue(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==we.TokenKind.NAME||t.value!==e)throw(0,Re.syntaxError)(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(Ue(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===we.TokenKind.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return(0,Re.syntaxError)(this._lexer.source,t.start,"Unexpected ".concat(Ue(t),"."))},t.any=function(e,t,n){this.expectToken(e);for(var i=[];!this.expectOptionalToken(n);)i.push(t.call(this));return i},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var i=[];do{i.push(t.call(this))}while(!this.expectOptionalToken(n));return i}return[]},t.many=function(e,t,n){this.expectToken(e);var i=[];do{i.push(t.call(this))}while(!this.expectOptionalToken(n));return i},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n},e}();function Ue(e){var t=e.value;return je(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function je(e){return(0,Pe.isPunctuatorTokenKind)(e)?'"'.concat(e,'"'):e}g.Parser=Be;const Ve=e,Ge=t,{hasPragma:Ye}=n,{locStart:Je,locEnd:Qe}=i;function Xe(e){if(e&&"object"==typeof e){delete e.startToken,delete e.endToken,delete e.prev,delete e.next;for(const t in e)Xe(e[t])}return e}const qe={allowLegacySDLImplementsInterfaces:!1,experimentalFragmentVariables:!0};var He={parsers:{graphql:{parse:function(e){const{parse:t}=g,{result:n,error:i}=Ge((()=>t(e,Object.assign({},qe))),(()=>t(e,Object.assign(Object.assign({},qe),{},{allowLegacySDLImplementsInterfaces:!0}))));if(!n)throw function(e){const{GraphQLError:t}=r;if(e instanceof t){const{message:t,locations:[n]}=e;return Ve(t,{start:n})}return e}(i);return n.comments=function(e){const t=[],{startToken:n}=e.loc;let{next:i}=n;for(;"<EOF>"!==i.kind;)"Comment"===i.kind&&(Object.assign(i,{column:i.column-1}),t.push(i)),i=i.next;return t}(n),Xe(n),n},astFormat:"graphql",hasPragma:Ye,locStart:Je,locEnd:Qe}}};export{He as default};