1import{r as e}from"./rolldown-runtime-C_s2cVnS.js";var t=class e extends Error{response;request;constructor(t,n){let r=`${e.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(r),Object.setPrototypeOf(this,e.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e)}static extractMessage(e){return e.errors?.[0]?.message??`GraphQL Error (Code: ${String(e.status)})`}},n=e=>e.toUpperCase(),r=e=>typeof e==`function`?e():e,i=(e,t)=>e.map((e,n)=>[e,t[n]]),a=e=>{let t={};return e instanceof Headers?t=o(e):Array.isArray(e)?e.forEach(([e,n])=>{e&&n!==void 0&&(t[e]=n)}):e&&(t=e),t},o=e=>{let t={};return e.forEach((e,n)=>{t[n]=e}),t},s=e=>{try{let t=e();return l(t)?t.catch(e=>c(e)):t}catch(e){return c(e)}},c=e=>e instanceof Error?e:Error(String(e)),l=e=>typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`&&`catch`in e&&typeof e.catch==`function`&&`finally`in e&&typeof e.finally==`function`,u=e=>{throw Error(`Unhandled case: ${String(e)}`)},d=e=>typeof e==`object`&&!!e&&!Array.isArray(e),f=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0},p=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0},m=10,h=2;function g(e){return _(e,[])}function _(e,t){switch(typeof e){case`string`:return JSON.stringify(e);case`function`:return e.name?`[function ${e.name}]`:`[function]`;case`object`:return ee(e,t);default:return String(e)}}function ee(e,t){if(e===null)return`null`;if(t.includes(e))return`[Circular]`;let n=[...t,e];if(te(e)){let t=e.toJSON();if(t!==e)return typeof t==`string`?t:_(t,n)}else if(Array.isArray(e))return re(e,n);return ne(e,n)}function te(e){return typeof e.toJSON==`function`}function ne(e,t){let n=Object.entries(e);return n.length===0?`{}`:t.length>h?`[`+ie(e)+`]`:`{ `+n.map(([e,n])=>e+`: `+_(n,t)).join(`, `)+` }`}function re(e,t){if(e.length===0)return`[]`;if(t.length>h)return`[Array]`;let n=Math.min(m,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(_(e[r],t));return r===1?i.push(`... 1 more item`):r>1&&i.push(`... ${r} more items`),`[`+i.join(`, `)+`]`}function ie(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,``).replace(/]$/,``);if(t===`Object`&&typeof e.constructor==`function`){let t=e.constructor.name;if(typeof t==`string`&&t!==``)return t}return t}function ae(e,t){return e?.__kind===t}var oe=ae;function se(e){return typeof e==`object`&&!!e}function ce(e,t){if(!e)throw Error(t??`Unexpected invariant triggered.`)}var le=/\r\n|[\n\r]/g;function v(e,t){let n=0,r=1;for(let i of e.body.matchAll(le)){if(typeof i.index!=`number`&&ce(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function ue(e){return de(e.source,v(e.source,e.start))}function de(e,t){let n=e.locationOffset.column-1,r=``.padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=t.line===1?n:0,c=t.column+s,l=`${e.name}:${o}:${c}\n`,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){let e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<d.length;e+=80)n.push(d.slice(e,e+80));return l+fe([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>[`|`,e]),[`|`,`^`.padStart(t)],[`|`,n[e+1]]])}return l+fe([[`${o-1} |`,u[i-1]],[`${o} |`,d],[`|`,`^`.padStart(c)],[`${o+1} |`,u[i+1]]])}function fe(e){let t=e.filter(([e,t])=>t!==void 0),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?` `+t:``)).join(` 2`)}var pe=class e extends Error{constructor(t,n={}){let{nodes:r,source:i,positions:a,path:o,originalError:s,cause:c,extensions:l}=n,u=`cause`in n;super(t,u||s!=null?{cause:u?c:s}:void 0),this.name=`GraphQLError`,this.path=o??void 0;let d=s??(c instanceof Error?c:void 0);this.originalError=d,this.nodes=me(Array.isArray(r)?r:r?[r]:void 0);let f=me(this.nodes?.map(e=>e.loc).filter(e=>e!=null));this.source=i??f?.[0]?.source,this.positions=a??f?.map(e=>e.start),this.locations=a&&i?a.map(e=>v(i,e)):f?.map(e=>v(e.source,e.start));let p=se(d?.extensions)?d.extensions:void 0;this.extensions=l??p??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}}
2),s?.stack==null?Error.captureStackTrace==null?Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0}):Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:s.stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return`GraphQLError`}toString(){let e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+=` 3 4`+ue(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+=` 5 6`+de(this.source,t);return e}toJSON(){let e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function me(e){return e===void 0||e.length===0?void 0:e}var he=class{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return`Location`}toJSON(){return{start:this.start,end:this.end}}},ge=class{constructor(e,t,n,r,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,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}}},_e={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`],FragmentArgument:[`name`,`value`],FragmentSpread:[`name`,`arguments`,`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`,`directives`,`locations`],SchemaExtension:[`directives`,`operationTypes`],DirectiveExtension:[`name`,`directives`],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`]},ve=new Set(Object.keys(_e));function ye(e){let t=e?.kind;return typeof t==`string`&&ve.has(t)}var y={QUERY:`query`,MUTATION:`mutation`,SUBSCRIPTION:`subscription`},be=e({ARGUMENT:()=>Ee,ARGUMENT_COORDINATE:()=>at,BOOLEAN:()=>D,DIRECTIVE:()=>Ne,DIRECTIVE_ARGUMENT_COORDINATE:()=>st,DIRECTIVE_COORDINATE:()=>ot,DIRECTIVE_DEFINITION:()=>Je,DIRECTIVE_EXTENSION:()=>Xe,DOCUMENT:()=>Se,ENUM:()=>ke,ENUM_TYPE_DEFINITION:()=>Ge,ENUM_TYPE_EXTENSION:()=>tt,ENUM_VALUE_DEFINITION:()=>Ke,FIELD:()=>Te,FIELD_DEFINITION:()=>Ve,FLOAT:()=>T,FRAGMENT_ARGUMENT:()=>De,FRAGMENT_DEFINITION:()=>S,FRAGMENT_SPREAD:()=>x,INLINE_FRAGMENT:()=>Oe,INPUT_OBJECT_TYPE_DEFINITION:()=>qe,INPUT_OBJECT_TYPE_EXTENSION:()=>nt,INPUT_VALUE_DEFINITION:()=>He,INT:()=>w,INTERFACE_TYPE_DEFINITION:()=>Ue,INTERFACE_TYPE_EXTENSION:()=>$e,LIST:()=>Ae,LIST_TYPE:()=>Fe,MEMBER_COORDINATE:()=>it,NAME:()=>xe,NAMED_TYPE:()=>Pe,NON_NULL_TYPE:()=>Ie,NULL:()=>O,OBJECT:()=>je,OBJECT_FIELD:()=>Me,OBJECT_TYPE_DEFINITION:()=>Be,OBJECT_TYPE_EXTENSION:()=>Qe,OPERATION_DEFINITION:()=>b,OPERATION_TYPE_DEFINITION:()=>Re,SCALAR_TYPE_DEFINITION:()=>ze,SCALAR_TYPE_EXTENSION:()=>Ze,SCHEMA_DEFINITION:()=>Le,SCHEMA_EXTENSION:()=>Ye,SELECTION_SET:()=>we,STRING:()=>E,TYPE_COORDINATE:()=>rt,UNION_TYPE_DEFINITION:()=>We,UNION_TYPE_EXTENSION:()=>et,VARIABLE:()=>C,VARIABLE_DEFINITION:()=>Ce}),xe=`Name`,Se=`Document`,b=`OperationDefinition`,Ce=`VariableDefinition`,we=`SelectionSet`,Te=`Field`,Ee=`Argument`,De=`FragmentArgument`,x=`FragmentSpread`,Oe=`InlineFragment`,S=`FragmentDefinition`,C=`Variable`,w=`IntValue`,T=`FloatValue`,E=`StringValue`,D=`BooleanValue`,O=`NullValue`,ke=`EnumValue`,Ae=`ListValue`,je=`ObjectValue`,Me=`ObjectField`,Ne=`Directive`,Pe=`NamedType`,Fe=`ListType`,Ie=`NonNullType`,Le=`SchemaDefinition`,Re=`OperationTypeDefinition`,ze=`ScalarTypeDefinition`,Be=`ObjectTypeDefinition`,Ve=`FieldDefinition`,He=`InputValueDefinition`,Ue=`InterfaceTypeDefinition`,We=`UnionTypeDefinition`,Ge=`EnumTypeDefinition`,Ke=`EnumValueDefinition`,qe=`InputObjectTypeDefinition`,Je=`DirectiveDefinition`,Ye=`SchemaExtension`,Xe=`DirectiveExtension`,Ze=`ScalarTypeExtension`,Qe=`ObjectTypeExtension`,$e=`InterfaceTypeExtension`,et=`UnionTypeExtension`,tt=`EnumTypeExtension`,nt=`InputObjectTypeExtension`,rt=`TypeCoordinate`,it=`MemberCoordinate`,at=`ArgumentCoordinate`,ot=`DirectiveCoordinate`,st=`DirectiveArgumentCoordinate`;function k(e,t){if(!e)throw Error(t)}function A(e){return e===9||e===32}function j(e){return e>=48&&e<=57}function ct(e){return e>=97&&e<=122||e>=65&&e<=90}function lt(e){return ct(e)||e===95}function ut(e){return ct(e)||j(e)||e===95}function dt(e){let t=2**53-1,n=null,r=-1;for(let i=0;i<e.length;++i){let a=e[i],o=ft(a);o!==a.length&&(n??=i,r=i,i!==0&&o<t&&(t=o))}return e.map((e,n)=>n===0?e:e.slice(t)).slice(n??0,r+1)}function ft(e){let t=0;for(;t<e.length&&A(e.charCodeAt(t));)++t;return t}function pt(e,t){let n=e.replaceAll(`"""`,`\\"""`),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,a=r.length>1&&r.slice(1).every(e=>e.length===0||A(e.charCodeAt(0))),o=n.endsWith(`\\"""`),s=e.endsWith(`"`)&&!o,c=e.endsWith(`\\`),l=s||c,u=!t?.minimize&&(!i||e.length>70||l||a||o),d=``,f=i&&A(e.charCodeAt(0));return(u&&!f||a)&&(d+=` 7`),d+=n,(u||l)&&(d+=` 8`),`"""`+d+`"""`}function mt(e){return`"${e.replace(ht,gt)}"`}var ht=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function gt(e){return _t[e.charCodeAt(0)]}var _t=`\\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`.split(`.`),vt=Object.freeze({});function yt(e,t,n=_e){let r=new Map;for(let e of Object.values(be))r.set(e,bt(t,e));let i,a=Array.isArray(e),o=[e],s=-1,c=[],l=e,u,d,f=[],p=[];do{s++;let e=s===o.length,m=e&&c.length!==0;if(e){if(u=p.length===0?void 0:f[f.length-1],l=d,d=p.pop(),m){if(a){l=l.slice();let e=0;for(let[t,n]of c){let r=t-e;n===null?(l.splice(r,1),e++):l[r]=n}}else{l={...l};for(let[e,t]of c)l[e]=t}}s=i.index,o=i.keys,c=i.edits,a=i.inArray,i=i.prev}else if(d!=null){if(u=a?s:o[s],l=d[u],l==null)continue;f.push(u)}let h;
8if(!Array.isArray(l)){if(ye(l)||k(!1,`Invalid AST Node: ${g(l)}.`),h=(e?r.get(l.kind)?.leave:r.get(l.kind)?.enter)?.call(t,l,u,d,f,p),h===vt)break;if(h===!1){if(!e){f.pop();continue}}else if(h!==void 0&&(c.push([u,h]),!e)){if(ye(h))l=h;else{f.pop();continue}}}h===void 0&&m&&c.push([u,l]),e?f.pop():(i={inArray:a,index:s,keys:o,edits:c,prev:i},a=Array.isArray(l),o=a?l:n[l.kind]??[],s=-1,c=[],d!=null&&p.push(d),d=l)}while(i!==void 0);return c.length===0?e:c.at(-1)[1]}function bt(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 xt(e){return yt(e,St)}var M=80,St={Name:{leave:e=>e.value},Variable:{leave:e=>`$`+e.name},Document:{leave:e=>N(e.definitions,` 9 10`)},OperationDefinition:{leave(e){let t=L(e.variableDefinitions)?F(`( 11`,N(e.variableDefinitions,` 12`),` 13)`):F(`(`,N(e.variableDefinitions,`, `),`)`),n=F(``,e.description,` 14`)+N([e.operation,N([e.name,t]),N(e.directives,` `)],` `);return(n===`query`?``:n+` `)+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>F(``,i,` 15`)+e+`: `+t+F(` = `,n)+F(` `,N(r,` `))},SelectionSet:{leave:({selections:e})=>P(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){return N([Ct(N([F(``,e,`: `),t],``),n),F(` `,N(r,` `)),F(` `,i)])}},Argument:{leave:({name:e,value:t})=>e+`: `+t},FragmentArgument:{leave:({name:e,value:t})=>e+`: `+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>Ct(`...`+e,t)+F(` `,N(n,` `))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>N([`...`,F(`on `,e),N(t,` `),n],` `)},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:a})=>F(``,a,` 16`)+`fragment ${e}${F(`(`,N(n,`, `),`)`)} on ${t} ${F(``,N(r,` `),` `)}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t===!0?pt(e):mt(e)},BooleanValue:{leave:({value:e})=>e?`true`:`false`},NullValue:{leave:()=>`null`},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{let t=`[`+N(e,`, `)+`]`;return t.length>M?`[ 17`+I(N(e,` 18`))+` 19]`:t}},ObjectValue:{leave:({fields:e})=>{let t=`{ `+N(e,`, `)+` }`;return t.length>M?P(e):t}},ObjectField:{leave:({name:e,value:t})=>e+`: `+t},Directive:{leave:({name:e,arguments:t})=>`@`+e+F(`(`,N(t,`, `),`)`)},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>`[`+e+`]`},NonNullType:{leave:({type:e})=>e+`!`},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>F(``,e,` 20`)+N([`schema`,N(t,` `),P(n)],` `)},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+`: `+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>F(``,e,` 21`)+N([`scalar`,t,N(n,` `)],` `)},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>F(``,e,` 22`)+N([`type`,t,F(`implements `,N(n,` & `)),N(r,` `),P(i)],` `)},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>F(``,e,` 23`)+t+(L(n)?F(`( 24`,I(N(n,` 25`)),` 26)`):F(`(`,N(n,`, `),`)`))+`: `+r+F(` `,N(i,` `))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>F(``,e,` 27`)+N([t+`: `+n,F(`= `,r),N(i,` `)],` `)},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>F(``,e,` 28`)+N([`interface`,t,F(`implements `,N(n,` & `)),N(r,` `),P(i)],` `)},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>F(``,e,` 29`)+N([`union`,t,N(n,` `),F(`= `,N(r,` | `))],` `)},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>F(``,e,` 30`)+N([`enum`,t,N(n,` `),P(r)],` `)},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>F(``,e,` 31`)+N([t,N(n,` `)],` `)},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>F(``,e,` 32`)+N([`input`,t,N(n,` `),P(r)],` `)},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:a})=>F(``,e,` 33`)+`directive @`+t+(L(n)?F(`( 34`,I(N(n,` 35`)),` 36)`):F(`(`,N(n,`, `),`)`))+F(` `,N(r,` `))+(i?` repeatable`:``)+` on `+N(a,` | `)},SchemaExtension:{leave:({directives:e,operationTypes:t})=>N([`extend schema`,N(e,` `),P(t)],` `)},ScalarTypeExtension:{leave:({name:e,directives:t})=>N([`extend scalar`,e,N(t,` `)],` `)},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>N([`extend type`,e,F(`implements `,N(t,` & `)),N(n,` `),P(r)],` `)},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>N([`extend interface`,e,F(`implements `,N(t,` & `)),N(n,` `),P(r)],` `)},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>N([`extend union`,e,N(t,` `),F(`= `,N(n,` | `))],` `)},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>N([`extend enum`,e,N(t,` `),P(n)],` `)},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>N([`extend input`,e,N(t,` `),P(n)],` `)},DirectiveExtension:{leave:({name:e,directives:t})=>N([`extend directive @`+e,N(t,` `)],` `)},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>N([e,F(`.`,t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>N([e,F(`.`,t),F(`(`,n,`:)`)])},DirectiveCoordinate:{leave:({name:e})=>N([`@`,e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>N([`@`,e,F(`(`,t,`:)`)])}};function N(e,t=``){return e?.filter(e=>e!==void 0&&e!==``).join(t)??``}function P(e){return F(`{ 37`,I(N(e,` 38`)),` 39}`)}function F(e,t,n=``){return t!=null&&t!==``?e+t+n:``}function I(e){return F(` `,e.replaceAll(` 40`,` 41 `))}function L(e){return e?.some(e=>e.includes(` 42`))??!1}function Ct(e,t){let n=e+F(`(`,N(t,`, `),`)`);return n.length>M&&(n=e+F(`( 43`,I(N(t,` 44`)),` 45)`)),n}var wt={QUERY:`QUERY`,MUTATION:`MUTATION`,SUBSCRIPTION:`SUBSCRIPTION`,FIELD:`FIELD`,FRAGMENT_DEFINITION:`FRAGMENT_DEFINITION`,FRAGMENT_SPREAD:`FRAGMENT_SPREAD`,INLINE_FRAGMENT:`INLINE_FRAGMENT`,VARIABLE_DEFINITION:`VARIABLE_DEFINITION`,FRAGMENT_VARIABLE_DEFINITION:`FRAGMENT_VARIABLE_DEFINITION`,SCHEMA:`SCHEMA`,SCALAR:`SCALAR`,OBJECT:`OBJECT`,FIELD_DEFINITION:`FIELD_DEFINITION`,ARGUMENT_DEFINITION:`ARGUMENT_DEFINITION`,INTERFACE:`INTERFACE`,UNION:`UNION`,ENUM:`
45ENUM`,ENUM_VALUE:`ENUM_VALUE`,INPUT_OBJECT:`INPUT_OBJECT`,INPUT_FIELD_DEFINITION:`INPUT_FIELD_DEFINITION`,DIRECTIVE_DEFINITION:`DIRECTIVE_DEFINITION`};function R(e,t,n){return new pe(`Syntax Error: ${n}`,{source:e,positions:[t]})}function Tt(){let e;try{let t=globalThis.process;typeof t?.getBuiltinModule==`function`&&(e=t.getBuiltinModule(`node:diagnostics_channel`))}catch{}return e}var z=Tt(),Et=z?.tracingChannel(`graphql:parse`);z?.tracingChannel(`graphql:validate`),z?.tracingChannel(`graphql:execute`),z?.tracingChannel(`graphql:execute:variableCoercion`),z?.tracingChannel(`graphql:execute:rootSelectionSet`),z?.tracingChannel(`graphql:subscribe`),z?.tracingChannel(`graphql:resolve`);var Dt=[`start`,`end`,`asyncStart`,`asyncEnd`,`error`];function Ot(e){if(e==null)return!1;let t=e.hasSubscribers;if(t!==void 0)return t;for(let t of Dt)if(e[t].hasSubscribers)return!0;return!1}var B={SOF:`<SOF>`,EOF:`<EOF>`,BANG:`!`,DOLLAR:`$`,AMP:`&`,PAREN_L:`(`,PAREN_R:`)`,DOT:`.`,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`},kt=class{constructor(e){let t=new ge(B.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return`Lexer`}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==B.EOF)do if(e.next)e=e.next;else{let t=Nt(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===B.COMMENT);return e}};function At(e){return e===B.BANG||e===B.DOLLAR||e===B.AMP||e===B.PAREN_L||e===B.PAREN_R||e===B.DOT||e===B.SPREAD||e===B.COLON||e===B.EQUALS||e===B.AT||e===B.BRACKET_L||e===B.BRACKET_R||e===B.BRACE_L||e===B.PIPE||e===B.BRACE_R}function V(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function H(e,t){return jt(e.charCodeAt(t))&&Mt(e.charCodeAt(t+1))}function jt(e){return e>=55296&&e<=56319}function Mt(e){return e>=56320&&e<=57343}function U(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return B.EOF;if(n>=32&&n<=126){let e=String.fromCodePoint(n);return e===`"`?`'"'`:`"${e}"`}return`U+`+n.toString(16).toUpperCase().padStart(4,`0`)}function W(e,t,n,r,i){let a=e.line;return new ge(t,n,r,a,1+n-e.lineStart,i)}function Nt(e,t){let n=e.source.body,r=n.length,i=t;for(;i<r;){let t=n.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return Pt(e,i);case 33:return W(e,B.BANG,i,i+1);case 36:return W(e,B.DOLLAR,i,i+1);case 38:return W(e,B.AMP,i,i+1);case 40:return W(e,B.PAREN_L,i,i+1);case 41:return W(e,B.PAREN_R,i,i+1);case 46:{let t=n.charCodeAt(i+1);if(t===46&&n.charCodeAt(i+2)===46)return W(e,B.SPREAD,i,i+3);if(t===46)throw R(e.source,i,`Unexpected "..", did you mean "..."?`);if(j(t)){let n=e.source.body.slice(i+1,G(e,i+1,t));throw R(e.source,i,`Invalid number, expected digit before ".", did you mean "0.${n}"?`)}break}case 58:return W(e,B.COLON,i,i+1);case 61:return W(e,B.EQUALS,i,i+1);case 64:return W(e,B.AT,i,i+1);case 91:return W(e,B.BRACKET_L,i,i+1);case 93:return W(e,B.BRACKET_R,i,i+1);case 123:return W(e,B.BRACE_L,i,i+1);case 124:return W(e,B.PIPE,i,i+1);case 125:return W(e,B.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?Vt(e,i):It(e,i)}if(j(t)||t===45)return Ft(e,i,t);if(lt(t))return Ht(e,i);throw R(e.source,i,t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:V(t)||H(n,i)?`Unexpected character: ${U(e,i)}.`:`Invalid character: ${U(e,i)}.`)}return W(e,B.EOF,r,r)}function Pt(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r;){let e=n.charCodeAt(i);if(e===10||e===13)break;if(V(e))++i;else if(H(n,i))i+=2;else break}return W(e,B.COMMENT,t,i,n.slice(t+1,i))}function Ft(e,t,n){let r=e.source.body,i=t,a=n,o=!1;if(a===45&&(a=r.charCodeAt(++i)),a===48){if(a=r.charCodeAt(++i),j(a))throw R(e.source,i,`Invalid number, unexpected digit after 0: ${U(e,i)}.`)}else i=G(e,i,a),a=r.charCodeAt(i);if(a===46&&(o=!0,a=r.charCodeAt(++i),i=G(e,i,a),a=r.charCodeAt(i)),(a===69||a===101)&&(o=!0,a=r.charCodeAt(++i),(a===43||a===45)&&(a=r.charCodeAt(++i)),i=G(e,i,a),a=r.charCodeAt(i)),a===46||lt(a))throw R(e.source,i,`Invalid number, expected digit but got: ${U(e,i)}.`);return W(e,o?B.FLOAT:B.INT,t,i,r.slice(t,i))}function G(e,t,n){if(!j(n))throw R(e.source,t,`Invalid number, expected digit but got: ${U(e,t)}.`);let r=e.source.body,i=t+1;for(;j(r.charCodeAt(i));)++i;return i}function It(e,t){let n=e.source.body,r=n.length,i=t+1,a=i,o=``;for(;i<r;){let r=n.charCodeAt(i);if(r===34)return o+=n.slice(a,i),W(e,B.STRING,t,i+1,o);if(r===92){o+=n.slice(a,i);
45let t=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?Lt(e,i):Rt(e,i):Bt(e,i);o+=t.value,i+=t.size,a=i;continue}if(r===10||r===13)break;if(V(r))++i;else if(H(n,i))i+=2;else throw R(e.source,i,`Invalid character within String: ${U(e,i)}.`)}throw R(e.source,i,`Unterminated string.`)}function Lt(e,t){let n=e.source.body,r=0,i=3;for(;i<12;){let e=n.charCodeAt(t+i++);if(e===125){if(i<5||!V(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|K(e),r<0)break}throw R(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Rt(e,t){let n=e.source.body,r=zt(n,t+2);if(V(r))return{value:String.fromCodePoint(r),size:6};if(jt(r)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let e=zt(n,t+8);if(Mt(e))return{value:String.fromCodePoint(r,e),size:12}}throw R(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function zt(e,t){return K(e.charCodeAt(t))<<12|K(e.charCodeAt(t+1))<<8|K(e.charCodeAt(t+2))<<4|K(e.charCodeAt(t+3))}function K(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Bt(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:` 46`,size:2};case 114:return{value:`\r`,size:2};case 116:return{value:` `,size:2}}throw R(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Vt(e,t){let n=e.source.body,r=n.length,i=e.lineStart,a=t+3,o=a,s=``,c=[];for(;a<r;){let r=n.charCodeAt(a);if(r===34&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34){s+=n.slice(o,a),c.push(s);let r=W(e,B.BLOCK_STRING,t,a+3,dt(c).join(` 47`));return e.line+=c.length-1,e.lineStart=i,r}if(r===92&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34&&n.charCodeAt(a+3)===34){s+=n.slice(o,a),o=a+1,a+=4;continue}if(r===10||r===13){s+=n.slice(o,a),c.push(s),r===13&&n.charCodeAt(a+1)===10?a+=2:++a,s=``,o=a,i=a;continue}if(V(r))++a;else if(H(n,a))a+=2;else throw R(e.source,a,`Invalid character within String: ${U(e,a)}.`)}throw R(e.source,a,`Unterminated string.`)}function Ht(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r&&ut(n.charCodeAt(i));)++i;return W(e,B.NAME,t,i,n.slice(t,i))}var Ut=Symbol(`Source`),Wt=class{constructor(e,t=`GraphQL request`,n={line:1,column:1}){this.__kind=Ut,this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||k(!1,`line in locationOffset is 1-indexed and must be positive.`),this.locationOffset.column>0||k(!1,`column in locationOffset is 1-indexed and must be positive.`)}get[Symbol.toStringTag](){return`Source`}};function Gt(e){return oe(e,Ut,Wt)}function Kt(e,t){return Ot(Et)?Et.traceSync(()=>qt(e,t),{source:e}):qt(e,t)}function qt(e,t){let n=new Jt(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}var Jt=class{constructor(e,t={}){let{lexer:n,...r}=t;if(n)this._lexer=n;else{let t=Gt(e)?e:new Wt(e);this._lexer=new kt(t)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(B.NAME);return this.node(e,{kind:xe,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Se,definitions:this.many(B.SOF,this.parseDefinition,B.EOF)})}parseDefinition(){if(this.peek(B.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===B.BRACE_L)throw R(this._lexer.source,this._lexer.token.start,`Unexpected description, descriptions are not supported on shorthand queries.`);if(t.kind===B.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 R(this._lexer.source,this._lexer.token.start,`Unexpected description, only GraphQL definitions supp
47ort descriptions.`);if(t.value===`extend`)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(B.BRACE_L))return this.node(e,{kind:b,operation:y.QUERY,description:void 0,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});let t=this.parseDescription(),n=this.parseOperationType(),r;return this.peek(B.NAME)&&(r=this.parseName()),this.node(e,{kind:b,operation:n,description:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(B.NAME);switch(e.value){case`query`:return y.QUERY;case`mutation`:return y.MUTATION;case`subscription`:return y.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(B.PAREN_L,this.parseVariableDefinition,B.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Ce,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(B.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(B.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(B.DOLLAR),this.node(e,{kind:C,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:we,selections:this.many(B.BRACE_L,this.parseSelection,B.BRACE_R)})}parseSelection(){return this.peek(B.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e=this._lexer.token,t=this.parseName(),n,r;return this.expectOptionalToken(B.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:Te,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(B.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(B.PAREN_L,t,B.PAREN_R)}parseFragmentArguments(){let e=this.parseFragmentArgument;return this.optionalMany(B.PAREN_L,e,B.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,n=this.parseName();return this.expectToken(B.COLON),this.node(t,{kind:Ee,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){let e=this._lexer.token,t=this.parseName();return this.expectToken(B.COLON),this.node(e,{kind:De,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){let e=this._lexer.token;this.expectToken(B.SPREAD);let t=this.expectOptionalKeyword(`on`);if(!t&&this.peek(B.NAME)){let t=this.parseFragmentName();return this.peek(B.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(e,{kind:x,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:x,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:Oe,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token,t=this.parseDescription();return this.expectKeyword(`fragment`),this._options.experimentalFragmentArguments===!0?this.node(e,{kind:S,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:S,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword(`on`),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value===`on`)throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case B.BRACKET_L:return this.parseList(e);case B.BRACE_L:return this.parseObject(e);case B.INT:return this.advanceLexer(),this.node(t,{kind:w,value:t.value});case B.FLOAT:return this.advanceLexer(),this.node(t,{kind:T,value:t.value});case B.STRING:case B.BLOCK_STRING:return this.parseStringLiteral();case B.NAME:switch(this.advanceLexer(),t.value){case`true`:return this.node(t,{kind:D,value:!0});case`false`:return this.node(t,{kind:D,value:!1});case`null`:return this.node(t,{kind:O});default:return this.node(t,{kind:ke,value:t.value})}case B.DOLLAR:if(e){if(this.expectToken(B.DOLLAR),this._lexer.token.kind===B.NAME){let e=this._lexer.token.value;throw R(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:E,value:e.value,block:e.kind===B.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:Ae,values:this.any(B.BRACKET_L,()=>this.parseValueLiteral(e),B.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:je,fields:this.any(B.BRACE_L,()=>this.parseObjectField(e),B.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,n=this.parseName();return this.expectToken(B.COLON),this.node(t,{kind:Me,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(B.AT);)t.push(this.parseDirective(e));if(t.length)return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(B.AT),this.node(t,{kind:Ne,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e=this._lexer.token,t;if(this.expectOptionalToken(B.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(B.BRACKET_R),t=this.node(e,{kind:Fe,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(B.BANG)?this.node(e,{kind:Ie,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Pe,name:this.parseName()})}peekDescription(){return this.peek(B.STRING)||this.peek(B.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`schema`);let n=this.parseConstDirectives(),r=this.many(B.BRACE_L,this.parseOperationTypeDefinition,B.BRACE_R);return this.node(e,{kind:Le,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(B.COLON);let n=this.parseNamedType();return this.node(e,{kind:Re,operation:t,type:n})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`scalar`);let n=this.parseName(),r=this.parseConstDirectives();
47return this.node(e,{kind:ze,description:t,name:n,directives:r})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`type`);let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:Be,description:t,name:n,interfaces:r,directives:i,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword(`implements`)?this.delimitedMany(B.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(B.BRACE_L,this.parseFieldDefinition,B.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(B.COLON);let i=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:Ve,description:t,name:n,arguments:r,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(B.PAREN_L,this.parseInputValueDef,B.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(B.COLON);let r=this.parseTypeReference(),i;this.expectOptionalToken(B.EQUALS)&&(i=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(e,{kind:He,description:t,name:n,type:r,defaultValue:i,directives:a})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`interface`);let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:Ue,description:t,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`union`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:We,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(B.EQUALS)?this.delimitedMany(B.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`enum`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:Ge,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(B.BRACE_L,this.parseEnumValueDefinition,B.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:Ke,description:t,name:n,directives:r})}parseEnumValueName(){if(this._lexer.token.value===`true`||this._lexer.token.value===`false`||this._lexer.token.value===`null`)throw R(this._lexer.source,this._lexer.token.start,`${q(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`input`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:qe,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(B.BRACE_L,this.parseInputValueDef,B.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===B.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();case`directive`:return this.parseDirectiveExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`schema`);let t=this.parseConstDirectives(),n=this.optionalMany(B.BRACE_L,this.parseOperationTypeDefinition,B.BRACE_R);if(t===void 0&&n===void 0)throw this.unexpected();return this.node(e,{kind:Ye,directives:t,operationTypes:n})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`scalar`);let t=this.parseName(),n=this.parseConstDirectives();if(n===void 0)throw this.unexpected();return this.node(e,{kind:Ze,name:t,directives:n})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`type`);let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n===void 0&&r===void 0&&i===void 0)throw this.unexpected();return this.node(e,{kind:Qe,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`interface`);let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n===void 0&&r===void 0&&i===void 0)throw this.unexpected();return this.node(e,{kind:$e,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`union`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(n===void 0&&r===void 0)throw this.unexpected();return this.node(e,{kind:et,name:t,directives:n,types:r})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`enum`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(n===void 0&&r===void 0)throw this.unexpected();return this.node(e,{kind:tt,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`input`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(n===void 0&&r===void 0)throw this.unexpected();return this.node(e,{kind:nt,name:t,directives:n,fields:r})}parseDirectiveExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`directive`),this.expectToken(B.AT);let t=this.parseName(),n=this.parseConstDirectives();if(n===void 0)throw this.unexpected();return this.node(e,{kind:Xe,name:t,directives:n})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`directive`),this.expectToken(B.AT);let n=this.parseName(),r=this.parseArgumentDefs(),i=this.parseConstDirectives(),a=this.expectOptionalKeyword(`repeatable`);this.expectKeyword(`on`);let o=this.parseDirectiveLocations();return this.node(e,{kind:Je,description:t,name:n,arguments:r,directives:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(B.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.hasOwn(wt,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){let e=this._lexer.token,t=this.expectOptionalToken(B.AT),n=this.parseName(),r;!t&&this.expectOptionalToken(B.DOT)&&(r=this.parseName());let i;return(t||r)&&this.expectOptionalToken(B.PAREN_L)&&(i=this.parseName(),this.expectToken(B.COLON),this.expectToken(B.PAREN_R)),t?i?this.node(e,{kind:st,name:n,argumentName:i}):this.node(e,{kind:ot,name:n}):r?i?this.node(e,{kind:at,name:n,fieldName:r,argumentName:i}):this.node(e,{kind:it,name:n,memberName:r}):this.node(e,{kind:rt,name:n})}node(e,t){return this._options.noLocation!==!0&&(t.loc=new he(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw R(this._lexer.source,t.start,`Expected ${Yt(e)}, found ${q(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){let t=this._lexer.token;if(t.kind===B.NAME&&t.value===e)this.advanceLexer();else throw R(this._lexer.source,t.start,`Expected "${e}", found ${q(t)}.`)}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===B.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){let t=e??this._lexer.token;return R(this._lexer.source,t.start,`Unexpected ${q(t)}.`)}any(e,t,n){this.expectToken(e);let r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){let e=[];do e.push(t.call(this));while(!this.expectOptionalToken(n));return e}}many(e,t,n){this.expectToken(e);let r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);let n=[];do n.push(t.call(this));while(this.expectOptionalToken(e));return n}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==B.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw R(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}};function q(e){let t=e.value;return Yt(e.kind)+(t==null?``:` "${t}"`)}function Yt(e){return At(e)?`"${e}"`:e}var Xt=`Accept`,J=`Content-Type`,Y=`application/json`,Zt=`application/graphql-response+json`,Qt=e=>e.replace(/([\s,]|#[^\n\r]+)+/g,` `).trim(),$t=e=>{let t=e.toLowerCase();return t.includes(Zt)||t.includes(Y)},en=e=>{try{if(Array.isArray(e))return{_tag:`Batch`,executionResults:e.map(tn)};if(d(e))return{_tag:`Single`,executionResult:tn(e)};throw Error(`Invalid execution result: result is not object or array. \nGot:\n${String(e)}`)}catch(e){return e}},tn=e=>{if(typeof e!=`object`||!e)throw Error(`Invalid execution result: result is not object`);let t,n,r;if(`errors`in e){if(!d(e.errors)&&!Array.isArray(e.errors))throw Error(`Invalid execution result: errors is not plain object OR array`);t=e.errors}if(`data`in e){if(!d(e.data)&&e.data!==null)throw Error(`Invalid execution result: data is not plain object`);n=e.data}if(`extensions`in e){if(!d(e.extensions))throw Error(`Invalid execution result: extensions is not plain object`);r=e.extensions}return{data:n,errors:t,extensions:r}},nn=e=>e._tag===`Batch`?e.executionResults.some(rn):rn(e.executionResult),rn=e=>Array.isArray(e.errors)?e.errors.length>0:!!e.errors,an=e=>typeof e==`object`&&!!e&&`kind`in e&&e.kind===`OperationDefinition`,on=e=>{let t,n=e.definitions.filter(an);return n.length===1&&(t=n[0].name?.value),t},sn=e=>{let t=!1,n=e.definitions.filter(an);return n.length===1&&(t=n[0].operation===`mutation`),t},X=(e,t)=>{let n=typeof e==`string`||`kind`in e?e:String(e),r=typeof n==`string`?n:xt(n),i=!1,a;if(t)return{expression:r,isMutation:i,operationName:a};let o=s(()=>typeof n==`string`?Kt(n):n);return o instanceof Error?{expression:r,isMutation:i,operationName:a}:(a=on(o),i=sn(o),{expression:r,operationName:a,isMutation:i})},Z=JSON,Q=async e=>{let r={...e,method:e.request._tag===`Single`?e.request.document.isMutation?`POST`:n(e.method??`post`):e.request.hasMutations?`POST`:n(e.method??`post`),fetchOptions:{...e.fetchOptions,errorPolicy:e.fetchOptions.errorPolicy??`none`}},i=await ln(r.method)(r),a=await i.text(),o;try{o=cn(a,i.headers.get(J),e.fetchOptions.jsonSerializer??Z)}catch(e){o=e}let s={status:i.status,headers:i.headers,body:a};if(!i.ok)return o instanceof Error?new t({...s},{query:e.request._tag===`Single`?e.request.document.expression:e.request.query,variables:e.request.variables}):new t(o._tag===`Batch`?{...o.executionResults,...s}:{...o.executionResult,...s},{query:e.request._tag===`Single`?e.request.document.expression:e.request.query,variables:e.request.variables});if(o instanceof Error)throw o;if(nn(o)&&r.fetchOptions.errorPolicy===`none`)return new t(o._tag===`Batch`?{...o.executionResults,...s}:{...o.executionResult,...s},{query:e.request._tag===`Single`?e.request.document.expression:e.request.query,variables:e.request.variables});switch(o._tag){case`Single`:return{...s,...$(r)(o.executionResult)};case`Batch`:return{...s,data:o.executionResults.map($(r))};default:u(o)}},$=e=>t=>({extensions:t.extensions,data:t.data,errors:e.fetchOptions.errorPolicy===`all`?t.errors:void 0}),cn=(e,t,n)=>t&&$t(t)?en(n.parse(e)):en(e),ln=e=>async t=>{let n=new Headers(t.headers),r=null,i;n.has(Xt)||n.set(Xt,[Zt,Y].join(`, `)),e===`POST`?(i=(t.fetchOptions.jsonSerializer??Z).stringify(un(t)),typeof i==`string`&&!n.has(J)&&n.set(J,Y)):r=dn(t);let a={method:e,headers:n,body:i,...t.fetchOptions},o=new URL(t.url),s=a;if(t.middleware){let{url:e,...n}=await Promise.resolve(t.middleware({...a,url:t.url,operationName:t.request._tag===`Single`?t.request.document.operationName:void 0,variables:t.request.variables}));o=new URL(e),s=n}return r&&r.forEach((e,t)=>{o.searchParams.append(t,e)}),await(t.fetch??fetch)(o,s)},un=e=>{switch(e.request._tag){case`Single`:return{query:e.request.document.expression,variables:e.request.variables,operationName:e.request.document.operationName};case`Batch`:return i(e.request.query,e.request.variables??[]).map(([e,t])=>({query:e,variables:t}));default:throw u(e.request)}},dn=e=>{let t=e.fetchOptions.jsonSerializer??Z,n=new URLSearchParams;switch(e.request._tag){case`Single`:return n.append(`query`,Qt(e.request.document.expression)),e.request.variables&&n.append(`variables`,t.stringify(e.request.variables)),e.request.document.operationName&&n.append(`operationName`,e.request.document.operationName),n;case`Batch`:{let r=e.request.variables?.map(e=>t.stringify(e))??[],a=i(e.request.query.map(Qt),r).map(([e,t])=>({query:e,variables:t}));return n.append(`query`,t.stringify(a)),n}default:throw u(e.request)}},fn=class{url;requestConfig;constructor(e,t={}){this.url=e,this.requestConfig=t}rawRequest=async(...e)=>{let[t,n,i]=e,o=p(t,n,i),{headers:s,fetch:c=globalThis.fetch,method:l=`POST`,requestMiddleware:u,responseMiddleware:d,excludeOperationName:f,...m}=this.requestConfig,{url:h}=this;o.signal!==void 0&&(m.signal=o.signal);let g=X(o.query,f),_=await Q({url:h,request:{_tag:`Single`,document:g,variables:o.variables},headers:{...a(r(s)),...a(o.requestHeaders)},fetch:c,method:l,fetchOptions:m,middleware:u});if(d&&await d(_,{operationName:g.operationName,variables:n,url:this.url}),_ instanceof Error)throw _;return _};async request(e,...t){let[n,i]=t,o=mn(e,n,i),{headers:s,fetch:c=globalThis.fetch,method:l=`POST`,requestMiddleware:u,responseMiddleware:d,excludeOperationName:f,...p}=this.requestConfig,{url:m}=this;o.signal!==void 0&&(p.signal=o.signal);let h=X(o.document,f),g=await Q({url:m,request:{_tag:`Single`,document:h,variables:o.variables},headers:{...a(r(s)),...a(o.requestHeaders)},fetch:c,method:l,fetchOptions:p,middleware:u});if(d&&await d(g,{operationName:h.operationName,variables:o.variables,url:this.url}),g instanceof Error)throw g;return g.data}async batchRequests(e,t){let n=f(e,t),{headers:i,excludeOperationName:o,...s}=this.requestConfig;n.signal!==void 0&&(s.signal=n.signal);let c=n.documents.map(({document:e})=>X(e,o)),l=c.map(({expression:e})=>e),u=c.some(({isMutation:e})=>e),d=n.documents.map(({variables:e})=>e),p=await Q({url:this.url,request:{_tag:`Batch`,operationName:void 0,query:l,hasMutations:u,variables:d},headers:{...a(r(i)),...a(n.requestHeaders)},fetch:this.requestConfig.fetch??globalThis.fetch,method:this.requestConfig.method||`POST`,fetchOptions:s,middleware:this.requestConfig.requestMiddleware});if(this.requestConfig.responseMiddleware&&await this.requestConfig.responseMiddleware(p,{operationName:void 0,variables:d,url:this.url}),p instanceof Error)throw p;return p.data}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,t){let{headers:n}=this.requestConfig;return n?n[e]=t:this.requestConfig.headers={[e]:t},this}setEndpoint(e){return this.url=e,this}};async function pn(e,t,...n){let r=hn(e,t,...n);return new fn(r.url).request({...r})}var mn=(e,t,n)=>e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0},hn=(e,t,...n)=>{let[r,i]=n;return typeof e==`string`?{url:e,document:t,variables:r,requestHeaders:i,signal:void 0}:e},gn=(e,...t)=>e.reduce((e,n,r)=>`${e}${n}${r in t?String(t[r]):``}`,``);export{pn as n,gn as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.