UNPKG

@open-condo/apollo

Version:

A wrapper over @apollo/client that allows you to use persistent cache from local storage, configure TTL, invalidate cache, and use a single configuration for getServerSideProps, SSR, and CSR

133 lines 332 kB
import*as react from"react";import{createContext,useContext,useEffect,useRef,useState,useMemo}from"react";import*as core from"@apollo/client/core";import{from,ApolloClient}from"@apollo/client/core";import*as client$1 from"@apollo/client";import crypto from"crypto";import*as utilities from"@apollo/client/utilities";import*as http from"@apollo/client/link/http";var __spreadArray=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||((r=r||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Log=function(){function n(e){e=e.debug;this.debug=void 0!==e&&e,this.lines=[]}return n.prototype.emit=function(e,t){e in console&&console[e].apply(console,__spreadArray([n.prefix],t,!1))},n.prototype.tailLogs=function(){var n=this;this.lines.forEach(function(e){var t=e[0],e=e[1];return n.emit(t,e)})},n.prototype.getLogs=function(){return this.lines},n.prototype.write=function(e,t){this.lines=__spreadArray(__spreadArray([],this.lines.slice(1-n.buffer),!0),[[e,t]],!1),!this.debug&&"log"===e||this.emit(e,t)},n.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("log",e)},n.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("warn",e)},n.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("error",e)},n.buffer=30,n.prefix="[apollo-cache-persist]",n}(),Cache=function(){function e(e){var t=e.cache,e=e.serialize,e=void 0===e||e;this.cache=t,this.serialize=e}return e.prototype.extract=function(){var e=this.cache.extract();return e=this.serialize?JSON.stringify(e):e},e.prototype.restore=function(e){null!=(e=this.serialize&&"string"==typeof e?JSON.parse(e):e)&&this.cache.restore(e)},e}(),__awaiter$2=function(e,o,s,c){return new(s=s||Promise)(function(n,t){function r(e){try{a(c.next(e))}catch(e){t(e)}}function i(e){try{a(c.throw(e))}catch(e){t(e)}}function a(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,i)}a((c=c.apply(e,o||[])).next())})},__generator$1=function(r,i){var a,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},l={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function e(n){return function(e){var t=[n,e];if(a)throw new TypeError("Generator is already executing.");for(;c=l&&t[l=0]?0:c;)try{if(a=1,o&&(s=2&t[0]?o.return:t[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,t[1])).done)return s;switch(o=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))c.label=t[1];else if(6===t[0]&&c.label<s[1])c.label=s[1],s=t;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(t)}}t=i.call(r,c)}catch(e){t=[6,e],o=0}finally{a=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Storage=function(){function e(e){var t=e.storage,e=e.key,e=void 0===e?"apollo-cache-persist":e;this.storage=t,this.key=e}return e.prototype.read=function(){return __awaiter$2(this,void 0,void 0,function(){return __generator$1(this,function(e){return[2,this.storage.getItem(this.key)]})})},e.prototype.write=function(t){return __awaiter$2(this,void 0,void 0,function(){return __generator$1(this,function(e){switch(e.label){case 0:return[4,this.storage.setItem(this.key,t)];case 1:return e.sent(),[2]}})})},e.prototype.purge=function(){return __awaiter$2(this,void 0,void 0,function(){return __generator$1(this,function(e){switch(e.label){case 0:return[4,this.storage.removeItem(this.key)];case 1:return e.sent(),[2]}})})},e.prototype.getSize=function(){return __awaiter$2(this,void 0,void 0,function(){var t;return __generator$1(this,function(e){switch(e.label){case 0:return[4,this.storage.getItem(this.key)];case 1:return null==(t=e.sent())?[2,0]:[2,"string"==typeof t?t.length:null]}})})},e}(),__awaiter$1=function(e,o,s,c){return new(s=s||Promise)(function(n,t){function r(e){try{a(c.next(e))}catch(e){t(e)}}function i(e){try{a(c.throw(e))}catch(e){t(e)}}function a(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,i)}a((c=c.apply(e,o||[])).next())})},__generator=function(r,i){var a,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},l={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function e(n){return function(e){var t=[n,e];if(a)throw new TypeError("Generator is already executing.");for(;c=l&&t[l=0]?0:c;)try{if(a=1,o&&(s=2&t[0]?o.return:t[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,t[1])).done)return s;switch(o=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))c.label=t[1];else if(6===t[0]&&c.label<s[1])c.label=s[1],s=t;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(t)}}t=i.call(r,c)}catch(e){t=[6,e],o=0}finally{a=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Persistor=function(){function e(e,t){var n=e.log,r=e.cache,e=e.storage,i=t.maxSize,i=void 0===i?1048576:i,t=t.persistenceMapper;this.log=n,this.cache=r,this.storage=e,this.paused=!1,t&&(this.persistenceMapper=t),i&&(this.maxSize=i)}return e.prototype.persist=function(){return __awaiter$1(this,void 0,void 0,function(){var t,n;return __generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,6,,7]),t=this.cache.extract(),this.paused||!this.persistenceMapper?[3,2]:[4,this.persistenceMapper(t)];case 1:t=e.sent(),e.label=2;case 2:return null!=this.maxSize&&"string"==typeof t&&t.length>this.maxSize&&!this.paused?[4,this.purge()]:[3,4];case 3:return e.sent(),this.paused=!0,[2];case 4:return this.paused?[2]:[4,this.storage.write(t)];case 5:return e.sent(),this.log.info("string"==typeof t?"Persisted cache of size ".concat(t.length," characters"):"Persisted cache"),[3,7];case 6:throw n=e.sent(),this.log.error("Error persisting cache",n),n;case 7:return[2]}})})},e.prototype.restore=function(){return __awaiter$1(this,void 0,void 0,function(){var t,n;return __generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,5,,6]),[4,this.storage.read()];case 1:return null==(t=e.sent())?[3,3]:[4,this.cache.restore(t)];case 2:return e.sent(),this.log.info("string"==typeof t?"Restored cache of size ".concat(t.length," characters"):"Restored cache"),[3,4];case 3:this.log.info("No stored cache to restore"),e.label=4;case 4:return[3,6];case 5:throw n=e.sent(),this.log.error("Error restoring cache",n),n;case 6:return[2]}})})},e.prototype.purge=function(){return __awaiter$1(this,void 0,void 0,function(){var t;return __generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.storage.purge()];case 1:return e.sent(),this.log.info("Purged cache storage"),[3,3];case 2:throw t=e.sent(),this.log.error("Error purging cache storage",t),t;case 3:return[2]}})})},e}(),onCacheWrite=function(e){var c=e.cache;return function(r){var i=c.write,a=c.evict,o=c.modify,s=c.gc;return c.write=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=i.apply(c,e);return r(),n},c.evict=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.apply(c,e);return r(),n},c.modify=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.apply(c,e);return r(),n},c.gc=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=s.apply(c,e);return r(),n},function(){c.write=i,c.evict=a,c.modify=o,c.gc=s}}},onAppBackground=function(e){var t=e.log,n=e.cache;return function(e){return t.warn("Trigger option `background` not available on web; using `write` trigger"),onCacheWrite({cache:n})(e)}},Trigger=function(){function c(e,t){var n=e.log,e=e.persistor,r=this,i=(this.fire=function(){r.debounce?(null!=r.timeout&&clearTimeout(r.timeout),r.timeout=setTimeout(r.persist,r.debounce)):r.persist()},this.persist=function(){r.paused||r.persistor.persist()},c.defaultDebounce),a=t.cache,o=t.debounce,t=t.trigger,s=void 0===t?"write":t;if(s)switch(this.debounce=null!=o?o:i,this.persistor=e,this.paused=!1,s){case"write":this.uninstall=onCacheWrite({cache:a})(this.fire);break;case"background":o&&n.warn("Debounce is not recommended with `background` trigger"),this.debounce=o,this.uninstall=onAppBackground({cache:a,log:n})(this.fire);break;default:if("function"!=typeof s)throw Error("Unrecognized trigger option: ".concat(s));this.uninstall=s(this.fire)}}return c.prototype.pause=function(){this.paused=!0},c.prototype.resume=function(){this.paused=!1},c.prototype.remove=function(){this.uninstall&&(this.uninstall(),this.uninstall=null,this.paused=!0)},c.defaultDebounce=1e3,c}(),CachePersistor=function(){function e(e){if(!e.cache)throw new Error("In order to persist your Apollo Cache, you need to pass in a cache. Please see https://www.apollographql.com/docs/react/basics/caching.html for our default InMemoryCache.");if(!e.storage)throw new Error("In order to persist your Apollo Cache, you need to pass in an underlying storage provider. Please see https://github.com/apollographql/apollo-cache-persist#storage-providers");var t=new Log(e),n=new Cache(e),r=new Storage(e),i=new Persistor({log:t,cache:n,storage:r},e),e=new Trigger({log:t,persistor:i},e);this.log=t,this.cache=n,this.storage=r,this.persistor=i,this.trigger=e}return e.prototype.persist=function(){return this.persistor.persist()},e.prototype.restore=function(){return this.persistor.restore()},e.prototype.purge=function(){return this.persistor.purge()},e.prototype.pause=function(){this.trigger.pause()},e.prototype.resume=function(){this.trigger.resume()},e.prototype.remove=function(){this.trigger.remove()},e.prototype.getLogs=function(e){if(!(e=void 0===e?!1:e))return this.log.getLogs();this.log.tailLogs()},e.prototype.getSize=function(){return this.storage.getSize()},e}(),__extends=function(){var r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),SynchronousPersistor=(!function(n){function e(e){var t=n.call(this,e)||this;return t.storage=new SynchronousStorage(e),t.persistor=new SynchronousPersistor({log:t.log,cache:t.cache,storage:t.storage},e),t}__extends(e,n),e.prototype.restoreSync=function(){this.persistor.restoreSync()}}(CachePersistor),function(i){function e(e,t){var n=e.log,r=e.cache,e=e.storage;return i.call(this,{log:n,cache:r,storage:e},t)||this}return __extends(e,i),e.prototype.restoreSync=function(){this.cache.restore(this.storage.readSync())},e}(Persistor)),SynchronousStorage=function(t){function e(e){return t.call(this,e)||this}return __extends(e,t),e.prototype.readSync=function(){return this.storage.getItem(this.key)},e}(Storage),LocalStorageWrapper=function(){function e(e){this.storage=e}return e.prototype.getItem=function(e){return this.storage.getItem(e)},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.setItem=function(e,t){return null!==t?this.storage.setItem(e,t):this.removeItem(e)},e}();function isSSR(){return"undefined"==typeof window}function isDebug(){return"development"===process.env.NODE_ENV}const APOLLO_STATE_PROP_NAME="__APOLLO_STATE__",APOLLO_PERSISTED_CACHE_KEY="__APOLLO_PERSISTED_CACHE__";function createPersistor(e){return new CachePersistor({cache:e,storage:new LocalStorageWrapper(window.localStorage),debug:isDebug(),key:APOLLO_PERSISTED_CACHE_KEY})}const CachePersistorContext=createContext({});function useCachePersistor(){return useContext(CachePersistorContext)}function __rest$2(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n}function __awaiter(e,t,o,s){return new(o=o||Promise)(function(n,t){function r(e){try{a(s.next(e))}catch(e){t(e)}}function i(e){try{a(s.throw(e))}catch(e){t(e)}}function a(e){var t;e.done?n(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(r,i)}a((s=s.apply(e,[])).next())})}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(n){var t,r;return n.__esModule?n:("function"==typeof(t=n.default)?(r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)}).prototype=t.prototype:r={},Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(n).forEach(function(e){var t=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(r,e,t.get?t:{enumerable:!0,get:function(){return n[e]}})}),r)}var require$$0$2=getAugmentedNamespace(core),require$$1$1=getAugmentedNamespace(http),ReactNativeFile_1=class{constructor({uri:e,name:t,type:n}){this.uri=e,this.name=t,this.type=n}};const ReactNativeFile=ReactNativeFile_1;var isExtractableFile$2=function(e){return"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||e instanceof ReactNativeFile};const defaultIsExtractableFile=isExtractableFile$2;var extractFiles$1=function(e,t="",f=defaultIsExtractableFile){const h=new Map,m=new Map;return{clone:function t(n,e,r){let i=n;if(f(n))i=null,(a=h.get(n))?a.push(e):h.set(n,[e]);else{var a=Array.isArray(n)||"undefined"!=typeof FileList&&n instanceof FileList,o=n&&n.constructor===Object;if(a||o){var s=m.has(n);if(s?i=m.get(n):(i=a?[]:{},m.set(n,i)),!r.has(n)){var c=e?e+".":"",l=new Set(r).add(n);if(a){let e=0;for(const d of n){var u=t(d,c+e++,l);s||i.push(u)}}else for(const y in n){var p=t(n[y],c+y,l);s||(i[y]=p)}}}}return i}(e,t,new Set),files:h}},formDataAppendFile$1=function(e,t,n){e.append(t,n,n.name)},isExtractableFile$1=isExtractableFile$2;const{ApolloLink,Observable}=require$$0$2,{createSignalIfSupported,fallbackHttpConfig,parseAndCheckHttpResponse,rewriteURIForGET,selectHttpOptionsAndBody,selectURI,serializeFetchParameter}=require$$1$1,extractFiles=extractFiles$1,formDataAppendFile=formDataAppendFile$1,isExtractableFile=isExtractableFile$2;var createUploadLink=function({uri:f="/graphql",useGETForQueries:h,isExtractableFile:m=isExtractableFile,FormData:g,formDataAppendFile:v=formDataAppendFile,fetch:T,fetchOptions:e,credentials:t,headers:n,includeExtensions:r}={}){const _={http:{includeExtensions:r},options:e,credentials:t,headers:n};return new ApolloLink(r=>{var e=r.getContext(),{clientAwareness:{name:t,version:i}={},headers:n}=e,e={http:e.http,options:e.fetchOptions,credentials:e.credentials,headers:{...t&&{"apollographql-client-name":t},...i&&{"apollographql-client-version":i},...n}};const{options:a,body:o}=selectHttpOptionsAndBody(r,fallbackHttpConfig,_,e);var{clone:t,files:i}=extractFiles(o,"",m);let s=selectURI(r,f);if(i.size){delete a.headers["content-type"];const u=new(g||FormData),p=(u.append("operations",serializeFetchParameter(t,"Payload")),{});let n=0;i.forEach(e=>{p[++n]=e}),u.append("map",JSON.stringify(p)),n=0,i.forEach((e,t)=>{v(u,++n,t)}),a.body=u}else if(h&&!r.query.definitions.some(e=>"OperationDefinition"===e.kind&&"mutation"===e.operation)&&(a.method="GET"),"GET"===a.method){const{newURI:d,parseError:y}=rewriteURIForGET(s,o);if(y)return new Observable(e=>{e.error(y)});s=d}else a.body=serializeFetchParameter(t,"Payload");const c=createSignalIfSupported()["controller"],l=(c&&(a.signal&&(a.signal.aborted?c.abort():a.signal.addEventListener("abort",()=>{c.abort()},{once:!0})),a.signal=c.signal),T||fetch);return new Observable(t=>{let n;return l(s,a).then(e=>(r.setContext({response:e}),e)).then(parseAndCheckHttpResponse(r)).then(e=>{t.next(e),t.complete()}).catch(e=>{n||(e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e))}),()=>{n=!0,c&&c.abort()}})})},createUploadLink$1=getDefaultExportFromCjs(createUploadLink);function arrayEach$3(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}var _arrayEach=arrayEach$3,freeGlobal$1="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal$1,freeGlobal=_freeGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root$c=freeGlobal||freeSelf||Function("return this")(),_root=root$c,root$b=_root,Symbol$7=_root.Symbol,_Symbol=Symbol$7,Symbol$6=_Symbol,objectProto$h=Object.prototype,hasOwnProperty$g=objectProto$h.hasOwnProperty,nativeObjectToString$1=objectProto$h.toString,symToStringTag$1=Symbol$6?Symbol$6.toStringTag:void 0;function getRawTag$1(e){var t=hasOwnProperty$g.call(e,symToStringTag$1),n=e[symToStringTag$1];try{var r=!(e[symToStringTag$1]=void 0)}catch(e){}var i=nativeObjectToString$1.call(e);return r&&(t?e[symToStringTag$1]=n:delete e[symToStringTag$1]),i}var _getRawTag=getRawTag$1,objectProto$g=Object.prototype,nativeObjectToString=objectProto$g.toString;function objectToString$1(e){return nativeObjectToString.call(e)}var _objectToString=objectToString$1,Symbol$5=_Symbol,getRawTag=_getRawTag,objectToString=objectToString$1,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol?_Symbol.toStringTag:void 0;function baseGetTag$7(e){return null==e?void 0===e?undefinedTag:nullTag:(symToStringTag&&symToStringTag in Object(e)?getRawTag:objectToString)(e)}var _baseGetTag=baseGetTag$7;function isObject$a(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var isObject_1=isObject$a,baseGetTag$6=_baseGetTag,isObject$9=isObject_1,asyncTag="[object AsyncFunction]",funcTag$2="[object Function]",genTag$1="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(e){return!!isObject$9(e)&&((e=baseGetTag$6(e))==funcTag$2||e==genTag$1||e==asyncTag||e==proxyTag)}var isFunction_1$2=isFunction$2,root$a=_root,coreJsData$1=_root["__core-js_shared__"],_coreJsData=coreJsData$1,coreJsData=coreJsData$1,maskSrcKey=function(){var e=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function isMasked$1(e){return!!maskSrcKey&&maskSrcKey in e}var _isMasked=isMasked$1,funcProto$2=Function.prototype,funcToString$2=funcProto$2.toString;function toSource$2(e){if(null!=e){try{return funcToString$2.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var _toSource=toSource$2,isFunction$1=isFunction_1$2,isMasked=_isMasked,isObject$8=isObject_1,toSource$1=_toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$f=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$f=objectProto$f.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$f).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(e){return!(!isObject$8(e)||isMasked(e))&&(isFunction$1(e)?reIsNative:reIsHostCtor).test(toSource$1(e))}var _baseIsNative=baseIsNative$1;function getValue$1(e,t){return null==e?void 0:e[t]}var _getValue=getValue$1,baseIsNative=baseIsNative$1,getValue=getValue$1;function getNative$7(e,t){e=getValue(e,t);return baseIsNative(e)?e:void 0}var _getNative=getNative$7,getNative$6=_getNative,defineProperty$2=function(){try{var e=getNative$6(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),_defineProperty=defineProperty$2,defineProperty$1=_defineProperty;function baseAssignValue$3(e,t,n){"__proto__"==t&&defineProperty$1?defineProperty$1(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var _baseAssignValue=baseAssignValue$3;function identity$5(e){return e}var identity_1=identity$5;function apply$3(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var _apply=apply$3,apply$2=_apply,nativeMax$3=Math.max;function overRest$2(a,o,s){return o=nativeMax$3(void 0===o?a.length-1:o,0),function(){for(var e=arguments,t=-1,n=nativeMax$3(e.length-o,0),r=Array(n);++t<n;)r[t]=e[o+t];for(var t=-1,i=Array(o+1);++t<o;)i[t]=e[t];return i[o]=s(r),apply$2(a,this,i)}}var _overRest=overRest$2;function constant$1(e){return function(){return e}}var constant_1=constant$1,constant=constant$1,defineProperty=_defineProperty,identity$4=identity_1,baseSetToString$1=defineProperty?function(e,t){return defineProperty(e,"toString",{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity_1,_baseSetToString=baseSetToString$1,HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut$2(n){var r=0,i=0;return function(){var e=nativeNow(),t=HOT_SPAN-(e-i);if(i=e,0<t){if(++r>=HOT_COUNT)return arguments[0]}else r=0;return n.apply(void 0,arguments)}}var _shortOut=shortOut$2,baseSetToString=_baseSetToString,shortOut$1=_shortOut,setToString$3=_shortOut(_baseSetToString),_setToString=setToString$3,identity$3=identity_1,overRest$1=_overRest,setToString$2=_setToString;function baseRest$1(e,t){return setToString$2(overRest$1(e,t,identity$3),e+"")}var _baseRest=baseRest$1,getNative$5=_getNative,root$9=_root,WeakMap$3=_getNative(_root,"WeakMap"),_WeakMap=WeakMap$3,WeakMap$2=_WeakMap,metaMap$2=_WeakMap&&new _WeakMap,_metaMap=metaMap$2,identity$2=identity_1,metaMap$1=_metaMap,baseSetData$2=metaMap$1?function(e,t){return metaMap$1.set(e,t),e}:identity_1,_baseSetData=baseSetData$2,isObject$7=isObject_1,objectCreate=Object.create,baseCreate$4=function(){function t(){}return function(e){if(!isObject$7(e))return{};if(objectCreate)return objectCreate(e);t.prototype=e;e=new t;return t.prototype=void 0,e}}(),_baseCreate=baseCreate$4,baseCreate$3=_baseCreate,isObject$6=isObject_1;function createCtor$4(r){return function(){var e=arguments;switch(e.length){case 0:return new r;case 1:return new r(e[0]);case 2:return new r(e[0],e[1]);case 3:return new r(e[0],e[1],e[2]);case 4:return new r(e[0],e[1],e[2],e[3]);case 5:return new r(e[0],e[1],e[2],e[3],e[4]);case 6:return new r(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=baseCreate$3(r.prototype),n=r.apply(t,e);return isObject$6(n)?n:t}}var _createCtor=createCtor$4,createCtor$3=_createCtor,root$8=_root,WRAP_BIND_FLAG$7=1;function createBind$1(t,e,n){var r=e&WRAP_BIND_FLAG$7,i=createCtor$3(t);return function e(){return(this&&this!==root$8&&this instanceof e?i:t).apply(r?n:this,arguments)}}var _createBind=createBind$1,nativeMax$2=Math.max;function composeArgs$2(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,c=t.length,l=nativeMax$2(a-o,0),u=Array(c+l),p=!r;++s<c;)u[s]=t[s];for(;++i<o;)(p||i<a)&&(u[n[i]]=e[i]);for(;l--;)u[s++]=e[i++];return u}var _composeArgs=composeArgs$2,nativeMax$1=Math.max;function composeArgsRight$2(e,t,n,r){for(var i=-1,a=e.length,o=-1,s=n.length,c=-1,l=t.length,u=nativeMax$1(a-s,0),p=Array(u+l),d=!r;++i<u;)p[i]=e[i];for(var y=i;++c<l;)p[y+c]=t[c];for(;++o<s;)(d||i<a)&&(p[y+n[o]]=e[i++]);return p}var _composeArgsRight=composeArgsRight$2;function countHolders$1(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var _countHolders=countHolders$1;function baseLodash$3(){}var _baseLodash=baseLodash$3,baseCreate$2=_baseCreate,baseLodash$2=_baseLodash,MAX_ARRAY_LENGTH$1=4294967295;function LazyWrapper$3(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=MAX_ARRAY_LENGTH$1,this.__views__=[]}LazyWrapper$3.prototype=baseCreate$2(baseLodash$2.prototype);var _LazyWrapper=LazyWrapper$3.prototype.constructor=LazyWrapper$3;function noop$1(){}var noop_1=noop$1,metaMap=_metaMap,noop=noop$1,getData$2=metaMap?function(e){return metaMap.get(e)}:noop$1,_getData=getData$2,realNames$1={},_realNames=realNames$1,realNames=realNames$1,objectProto$e=Object.prototype,hasOwnProperty$e=objectProto$e.hasOwnProperty;function getFuncName$1(e){for(var t=e.name+"",n=realNames[t],r=hasOwnProperty$e.call(realNames,t)?n.length:0;r--;){var i=n[r],a=i.func;if(null==a||a==e)return i.name}return t}var _getFuncName=getFuncName$1,baseCreate$1=_baseCreate,baseLodash$1=_baseLodash;function LodashWrapper$2(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}LodashWrapper$2.prototype=baseCreate$1(baseLodash$1.prototype);var _LodashWrapper=LodashWrapper$2.prototype.constructor=LodashWrapper$2,isArray$f=Array.isArray,isArray_1$1=isArray$f;function isObjectLike$b(e){return null!=e&&"object"==typeof e}var isObjectLike_1=isObjectLike$b;function copyArray$3(e,t){var n=-1,r=e.length;for(t=t||Array(r);++n<r;)t[n]=e[n];return t}var _copyArray=copyArray$3,LazyWrapper$2=_LazyWrapper,LodashWrapper$1=_LodashWrapper,copyArray$2=_copyArray;function wrapperClone$1(e){var t;return e instanceof LazyWrapper$2?e.clone():((t=new LodashWrapper$1(e.__wrapped__,e.__chain__)).__actions__=copyArray$2(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t)}var _wrapperClone=wrapperClone$1,LazyWrapper$1=_LazyWrapper,LodashWrapper=_LodashWrapper,baseLodash=_baseLodash,isArray$e=isArray_1$1,isObjectLike$a=isObjectLike_1,wrapperClone=wrapperClone$1,objectProto$d=Object.prototype,hasOwnProperty$d=objectProto$d.hasOwnProperty;function lodash$1(e){if(isObjectLike$a(e)&&!isArray$e(e)&&!(e instanceof LazyWrapper$1)){if(e instanceof LodashWrapper)return e;if(hasOwnProperty$d.call(e,"__wrapped__"))return wrapperClone(e)}return new LodashWrapper(e)}lodash$1.prototype=baseLodash.prototype;var wrapperLodash=lodash$1.prototype.constructor=lodash$1,LazyWrapper=_LazyWrapper,getData$1=_getData,getFuncName=_getFuncName,lodash=lodash$1;function isLaziable$1(e){var t=getFuncName(e),n=lodash[t];return"function"==typeof n&&t in LazyWrapper.prototype&&(e===n||!!(t=getData$1(n))&&e===t[0])}var _isLaziable=isLaziable$1,baseSetData$1=_baseSetData,shortOut=_shortOut,setData$2=_shortOut(_baseSetData),_setData=setData$2,reWrapDetails=/\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails=/,? & /;function getWrapDetails$1(e){e=e.match(reWrapDetails);return e?e[1].split(reSplitDetails):[]}var _getWrapDetails=getWrapDetails$1,reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function insertWrapDetails$1(e,t){var n,r=t.length;return r?(t[n=r-1]=(1<r?"& ":"")+t[n],t=t.join(2<r?", ":" "),e.replace(reWrapComment,"{\n/* [wrapped with "+t+"] */\n")):e}var _insertWrapDetails=insertWrapDetails$1;function baseFindIndex$1(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var _baseFindIndex=baseFindIndex$1;function baseIsNaN$1(e){return e!=e}var _baseIsNaN=baseIsNaN$1;function strictIndexOf$1(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var _strictIndexOf=strictIndexOf$1,baseFindIndex=baseFindIndex$1,baseIsNaN=baseIsNaN$1,strictIndexOf=strictIndexOf$1;function baseIndexOf$1(e,t,n){return t==t?strictIndexOf(e,t,n):baseFindIndex(e,baseIsNaN,n)}var _baseIndexOf=baseIndexOf$1,baseIndexOf=baseIndexOf$1;function arrayIncludes$1(e,t){return!!(null==e?0:e.length)&&-1<baseIndexOf(e,t,0)}var _arrayIncludes=arrayIncludes$1,arrayEach$2=_arrayEach,arrayIncludes=arrayIncludes$1,WRAP_BIND_FLAG$6=1,WRAP_BIND_KEY_FLAG$4=2,WRAP_CURRY_FLAG$4=8,WRAP_CURRY_RIGHT_FLAG$2=16,WRAP_PARTIAL_FLAG$3=32,WRAP_PARTIAL_RIGHT_FLAG$2=64,WRAP_ARY_FLAG$2=128,WRAP_REARG_FLAG$1=256,WRAP_FLIP_FLAG$1=512,wrapFlags=[["ary",WRAP_ARY_FLAG$2],["bind",WRAP_BIND_FLAG$6],["bindKey",WRAP_BIND_KEY_FLAG$4],["curry",WRAP_CURRY_FLAG$4],["curryRight",WRAP_CURRY_RIGHT_FLAG$2],["flip",WRAP_FLIP_FLAG$1],["partial",WRAP_PARTIAL_FLAG$3],["partialRight",WRAP_PARTIAL_RIGHT_FLAG$2],["rearg",WRAP_REARG_FLAG$1]];function updateWrapDetails$1(n,r){return arrayEach$2(wrapFlags,function(e){var t="_."+e[0];r&e[1]&&!arrayIncludes(n,t)&&n.push(t)}),n.sort()}var _updateWrapDetails=updateWrapDetails$1,getWrapDetails=getWrapDetails$1,insertWrapDetails=insertWrapDetails$1,setToString$1=_setToString,updateWrapDetails=updateWrapDetails$1;function setWrapToString$2(e,t,n){t+="";return setToString$1(e,insertWrapDetails(t,updateWrapDetails(getWrapDetails(t),n)))}var _setWrapToString=setWrapToString$2,isLaziable=_isLaziable,setData$1=_setData,setWrapToString$1=_setWrapToString,WRAP_BIND_FLAG$5=1,WRAP_BIND_KEY_FLAG$3=2,WRAP_CURRY_BOUND_FLAG$1=4,WRAP_CURRY_FLAG$3=8,WRAP_PARTIAL_FLAG$2=32,WRAP_PARTIAL_RIGHT_FLAG$1=64;function createRecurry$2(e,t,n,r,i,a,o,s,c,l){var u=t&WRAP_CURRY_FLAG$3,i=((t=(t|(u?WRAP_PARTIAL_FLAG$2:WRAP_PARTIAL_RIGHT_FLAG$1))&~(u?WRAP_PARTIAL_RIGHT_FLAG$1:WRAP_PARTIAL_FLAG$2))&WRAP_CURRY_BOUND_FLAG$1||(t&=~(WRAP_BIND_FLAG$5|WRAP_BIND_KEY_FLAG$3)),[e,t,i,u?a:void 0,u?o:void 0,u?void 0:a,u?void 0:o,s,c,l]),a=n.apply(void 0,i);return isLaziable(e)&&setData$1(a,i),a.placeholder=r,setWrapToString$1(a,e,t)}var _createRecurry=createRecurry$2;function getHolder$3(e){return e.placeholder}var _getHolder=getHolder$3,MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex$5(e,t){var n=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER$1:t)&&("number"==n||"symbol"!=n&&reIsUint.test(e))&&-1<e&&e%1==0&&e<t}var _isIndex=isIndex$5,copyArray$1=_copyArray,isIndex$4=_isIndex,nativeMin$1=Math.min;function reorder$1(e,t){for(var n=e.length,r=nativeMin$1(t.length,n),i=copyArray$1(e);r--;){var a=t[r];e[r]=isIndex$4(a,n)?i[a]:void 0}return e}var _reorder=reorder$1,PLACEHOLDER$1="__lodash_placeholder__";function replaceHolders$4(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n];o!==t&&o!==PLACEHOLDER$1||(e[n]=PLACEHOLDER$1,a[i++]=n)}return a}var _replaceHolders=replaceHolders$4,composeArgs$1=_composeArgs,composeArgsRight$1=_composeArgsRight,countHolders=_countHolders,createCtor$2=_createCtor,createRecurry$1=_createRecurry,getHolder$2=_getHolder,reorder=reorder$1,replaceHolders$3=_replaceHolders,root$7=_root,WRAP_BIND_FLAG$4=1,WRAP_BIND_KEY_FLAG$2=2,WRAP_CURRY_FLAG$2=8,WRAP_CURRY_RIGHT_FLAG$1=16,WRAP_ARY_FLAG$1=128,WRAP_FLIP_FLAG=512;function createHybrid$2(o,s,c,l,u,p,d,y,f,h){var m=s&WRAP_ARY_FLAG$1,g=s&WRAP_BIND_FLAG$4,v=s&WRAP_BIND_KEY_FLAG$2,T=s&(WRAP_CURRY_FLAG$2|WRAP_CURRY_RIGHT_FLAG$1),_=s&WRAP_FLIP_FLAG,b=v?void 0:createCtor$2(o);return function e(){for(var t,n,r=arguments.length,i=Array(r),a=r;a--;)i[a]=arguments[a];return T&&(t=getHolder$2(e),n=countHolders(i,t)),l&&(i=composeArgs$1(i,l,u,T)),p&&(i=composeArgsRight$1(i,p,d,T)),r-=n,T&&r<h?(n=replaceHolders$3(i,t),createRecurry$1(o,s,createHybrid$2,e.placeholder,c,i,n,y,f,h-r)):(t=g?c:this,n=v?t[o]:o,r=i.length,y?i=reorder(i,y):_&&1<r&&i.reverse(),m&&f<r&&(i.length=f),(n=this&&this!==root$7&&this instanceof e?b||createCtor$2(n):n).apply(t,i))}}var _createHybrid=createHybrid$2,apply$1=_apply,createCtor$1=_createCtor,createHybrid$1=_createHybrid,createRecurry=_createRecurry,getHolder$1=_getHolder,replaceHolders$2=_replaceHolders,root$6=_root;function createCurry$1(a,o,s){var c=createCtor$1(a);return function e(){for(var t=arguments.length,n=Array(t),r=t,i=getHolder$1(e);r--;)n[r]=arguments[r];i=t<3&&n[0]!==i&&n[t-1]!==i?[]:replaceHolders$2(n,i);return(t-=i.length)<s?createRecurry(a,o,createHybrid$1,e.placeholder,void 0,n,i,void 0,void 0,s-t):apply$1(this&&this!==root$6&&this instanceof e?c:a,this,n)}}var _createCurry=createCurry$1,apply=_apply,createCtor=_createCtor,root$5=_root,WRAP_BIND_FLAG$3=1;function createPartial$1(s,e,c,l){var u=e&WRAP_BIND_FLAG$3,p=createCtor(s);return function e(){for(var t=-1,n=arguments.length,r=-1,i=l.length,a=Array(i+n),o=this&&this!==root$5&&this instanceof e?p:s;++r<i;)a[r]=l[r];for(;n--;)a[r++]=arguments[++t];return apply(o,u?c:this,a)}}var _createPartial=createPartial$1,composeArgs=_composeArgs,composeArgsRight=_composeArgsRight,replaceHolders$1=_replaceHolders,PLACEHOLDER="__lodash_placeholder__",WRAP_BIND_FLAG$2=1,WRAP_BIND_KEY_FLAG$1=2,WRAP_CURRY_BOUND_FLAG=4,WRAP_CURRY_FLAG$1=8,WRAP_ARY_FLAG=128,WRAP_REARG_FLAG=256,nativeMin=Math.min;function mergeData$1(e,t){var n,r=e[1],i=t[1],a=r|i,o=i==WRAP_ARY_FLAG&&r==WRAP_CURRY_FLAG$1||i==WRAP_ARY_FLAG&&r==WRAP_REARG_FLAG&&e[7].length<=t[8]||i==(WRAP_ARY_FLAG|WRAP_REARG_FLAG)&&t[7].length<=t[8]&&r==WRAP_CURRY_FLAG$1;return(a<(WRAP_BIND_FLAG$2|WRAP_BIND_KEY_FLAG$1|WRAP_ARY_FLAG)||o)&&(i&WRAP_BIND_FLAG$2&&(e[2]=t[2],a|=r&WRAP_BIND_FLAG$2?0:WRAP_CURRY_BOUND_FLAG),(o=t[3])&&(n=e[3],e[3]=n?composeArgs(n,o,t[4]):o,e[4]=n?replaceHolders$1(e[3],PLACEHOLDER):t[4]),(o=t[5])&&(n=e[5],e[5]=n?composeArgsRight(n,o,t[6]):o,e[6]=n?replaceHolders$1(e[5],PLACEHOLDER):t[6]),(o=t[7])&&(e[7]=o),i&WRAP_ARY_FLAG&&(e[8]=null==e[8]?t[8]:nativeMin(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=a),e}var _mergeData=mergeData$1,reWhitespace=/\s/;function trimmedEndIndex$1(e){for(var t=e.length;t--&&reWhitespace.test(e.charAt(t)););return t}var _trimmedEndIndex=trimmedEndIndex$1,trimmedEndIndex=trimmedEndIndex$1,reTrimStart=/^\s+/;function baseTrim$1(e){return e&&e.slice(0,trimmedEndIndex(e)+1).replace(reTrimStart,"")}var _baseTrim=baseTrim$1,baseGetTag$5=_baseGetTag,isObjectLike$9=isObjectLike_1,symbolTag$3="[object Symbol]";function isSymbol$5(e){return"symbol"==typeof e||isObjectLike$9(e)&&baseGetTag$5(e)==symbolTag$3}var isSymbol_1=isSymbol$5,baseTrim=baseTrim$1,isObject$5=isObject_1,isSymbol$4=isSymbol_1,NAN=NaN,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber$1(e){if("number"==typeof e)return e;if(isSymbol$4(e))return NAN;if(isObject$5(e)&&(t="function"==typeof e.valueOf?e.valueOf():e,e=isObject$5(t)?t+"":t),"string"!=typeof e)return 0===e?e:+e;e=baseTrim(e);var t=reIsBinary.test(e);return t||reIsOctal.test(e)?freeParseInt(e.slice(2),t?2:8):reIsBadHex.test(e)?NAN:+e}var toNumber_1=toNumber$1,toNumber=toNumber$1,INFINITY$2=1/0,MAX_INTEGER=17976931348623157e292;function toFinite$1(e){return e?(e=toNumber(e))===INFINITY$2||e===-INFINITY$2?(e<0?-1:1)*MAX_INTEGER:e==e?e:0:0===e?e:0}var toFinite_1=toFinite$1,toFinite=toFinite$1;function toInteger$2(e){var e=toFinite(e),t=e%1;return e==e?t?e-t:e:0}var toInteger_1=toInteger$2,baseSetData=_baseSetData,createBind=_createBind,createCurry=_createCurry,createHybrid=_createHybrid,createPartial=_createPartial,getData=_getData,mergeData=mergeData$1,setData=_setData,setWrapToString=_setWrapToString,toInteger$1=toInteger_1,FUNC_ERROR_TEXT$1="Expected a function",WRAP_BIND_FLAG$1=1,WRAP_BIND_KEY_FLAG=2,WRAP_CURRY_FLAG=8,WRAP_CURRY_RIGHT_FLAG=16,WRAP_PARTIAL_FLAG$1=32,WRAP_PARTIAL_RIGHT_FLAG=64,nativeMax=Math.max;function createWrap$1(e,t,n,r,i,a,o,s){var c,l,u,p=t&WRAP_BIND_KEY_FLAG;if(p||"function"==typeof e)return(c=r?r.length:0)||(t&=~(WRAP_PARTIAL_FLAG$1|WRAP_PARTIAL_RIGHT_FLAG),r=i=void 0),o=void 0===o?o:nativeMax(toInteger$1(o),0),s=void 0===s?s:toInteger$1(s),c-=i?i.length:0,t&WRAP_PARTIAL_RIGHT_FLAG&&(u=r,l=i,r=i=void 0),u=[e,t,n,r,i,u,l,a,o,s],(l=p?void 0:getData(e))&&mergeData(u,l),e=u[0],t=u[1],n=u[2],r=u[3],i=u[4],!(s=u[9]=void 0===u[9]?p?0:e.length:nativeMax(u[9]-c,0))&&t&(WRAP_CURRY_FLAG|WRAP_CURRY_RIGHT_FLAG)&&(t&=~(WRAP_CURRY_FLAG|WRAP_CURRY_RIGHT_FLAG)),a=t&&t!=WRAP_BIND_FLAG$1?t==WRAP_CURRY_FLAG||t==WRAP_CURRY_RIGHT_FLAG?createCurry(e,t,s):t!=WRAP_PARTIAL_FLAG$1&&t!=(WRAP_BIND_FLAG$1|WRAP_PARTIAL_FLAG$1)||i.length?createHybrid.apply(void 0,u):createPartial(e,t,n,r):createBind(e,t,n),setWrapToString((l?baseSetData:setData)(a,u),e,t);throw new TypeError(FUNC_ERROR_TEXT$1)}var _createWrap=createWrap$1,baseRest=_baseRest,createWrap=createWrap$1,getHolder=_getHolder,replaceHolders=_replaceHolders,WRAP_BIND_FLAG=1,WRAP_PARTIAL_FLAG=32,bind$1=_baseRest(function(e,t,n){var r,i=WRAP_BIND_FLAG;return n.length&&(r=replaceHolders(n,getHolder(bind$1)),i|=WRAP_PARTIAL_FLAG),createWrap(e,i,t,n,r)}),bind_1=(bind$1.placeholder={},bind$1);function arrayPush$3(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var _arrayPush=arrayPush$3,baseGetTag$4=_baseGetTag,isObjectLike$8=isObjectLike_1,argsTag$3="[object Arguments]";function baseIsArguments$1(e){return isObjectLike$8(e)&&baseGetTag$4(e)==argsTag$3}var _baseIsArguments=baseIsArguments$1,baseIsArguments=baseIsArguments$1,isObjectLike$7=isObjectLike_1,objectProto$c=Object.prototype,hasOwnProperty$c=objectProto$c.hasOwnProperty,propertyIsEnumerable$1=objectProto$c.propertyIsEnumerable,isArguments$3=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike$7(e)&&hasOwnProperty$c.call(e,"callee")&&!propertyIsEnumerable$1.call(e,"callee")},isArguments_1=isArguments$3,Symbol$4=_Symbol,isArguments$2=isArguments_1,isArray$d=isArray_1$1,spreadableSymbol=_Symbol?_Symbol.isConcatSpreadable:void 0;function isFlattenable$1(e){return isArray$d(e)||isArguments$2(e)||!!(spreadableSymbol&&e&&e[spreadableSymbol])}var _isFlattenable=isFlattenable$1,arrayPush$2=_arrayPush,isFlattenable=isFlattenable$1;function baseFlatten$1(e,t,n,r,i){var a=-1,o=e.length;for(n=n||isFlattenable,i=i||[];++a<o;){var s=e[a];0<t&&n(s)?1<t?baseFlatten$1(s,t-1,n,r,i):arrayPush$2(i,s):r||(i[i.length]=s)}return i}var _baseFlatten=baseFlatten$1,baseFlatten=baseFlatten$1;function flatten$1(e){return(null==e?0:e.length)?baseFlatten(e,1):[]}var flatten_1=flatten$1,flatten=flatten$1,overRest=_overRest,setToString=_setToString;function flatRest$2(e){return setToString(overRest(e,void 0,flatten),e+"")}var _flatRest=flatRest$2,isSymbol$3=isSymbol_1,INFINITY$1=1/0;function toKey$6(e){var t;return"string"==typeof e||isSymbol$3(e)?e:"0"==(t=e+"")&&1/e==-INFINITY$1?"-0":t}var _toKey=toKey$6,arrayEach$1=_arrayEach,baseAssignValue$2=_baseAssignValue,bind=bind_1,flatRest$1=_flatRest,toKey$5=_toKey,bindAll=_flatRest(function(t,e){return arrayEach$1(e,function(e){e=toKey$5(e),baseAssignValue$2(t,e,bind(t[e],t))}),t}),bindAll_1=bindAll,bindAll$1=getDefaultExportFromCjs(bindAll),isArray$c=isArray_1$1,isSymbol$2=isSymbol_1,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey$3(e,t){var n;return!isArray$c(e)&&(!("number"!=(n=typeof e)&&"symbol"!=n&&"boolean"!=n&&null!=e&&!isSymbol$2(e))||reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var _isKey=isKey$3,getNative$4=_getNative,nativeCreate$4=_getNative(Object,"create"),_nativeCreate=nativeCreate$4,nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{},this.size=0}var _hashClear=hashClear$1;function hashDelete$1(e){e=this.has(e)&&delete this.__data__[e];return this.size-=e?1:0,e}var _hashDelete=hashDelete$1,nativeCreate$2=_nativeCreate,HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$b=Object.prototype,hasOwnProperty$b=objectProto$b.hasOwnProperty;function hashGet$1(e){var t,n=this.__data__;return nativeCreate$2?(t=n[e])===HASH_UNDEFINED$2?void 0:t:hasOwnProperty$b.call(n,e)?n[e]:void 0}var _hashGet=hashGet$1,nativeCreate$1=_nativeCreate,objectProto$a=Object.prototype,hasOwnProperty$a=objectProto$a.hasOwnProperty;function hashHas$1(e){var t=this.__data__;return nativeCreate$1?void 0!==t[e]:hasOwnProperty$a.call(t,e)}var _hashHas=hashHas$1,nativeCreate=_nativeCreate,HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet$1(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=nativeCreate&&void 0===t?HASH_UNDEFINED$1:t,this}var _hashSet=hashSet$1,hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=hashHas$1,hashSet=hashSet$1;function Hash$1(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Hash$1.prototype.clear=hashClear,Hash$1.prototype.delete=hashDelete,Hash$1.prototype.get=hashGet,Hash$1.prototype.has=hashHas,Hash$1.prototype.set=hashSet;var _Hash=Hash$1;function listCacheClear$1(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear$1;function eq$4(e,t){return e===t||e!=e&&t!=t}var eq_1=eq$4,eq$3=eq_1;function assocIndexOf$4(e,t){for(var n=e.length;n--;)if(eq$3(e[n][0],t))return n;return-1}var _assocIndexOf=assocIndexOf$4,assocIndexOf$3=_assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete$1(e){var t=this.__data__,e=assocIndexOf$3(t,e);return!(e<0||(e==t.length-1?t.pop():splice.call(t,e,1),--this.size,0))}var _listCacheDelete=listCacheDelete$1,assocIndexOf$2=_assocIndexOf;function listCacheGet$1(e){var t=this.__data__,e=assocIndexOf$2(t,e);return e<0?void 0:t[e][1]}var _listCacheGet=listCacheGet$1,assocIndexOf$1=_assocIndexOf;function listCacheHas$1(e){return-1<assocIndexOf$1(this.__data__,e)}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(e,t){var n=this.__data__,r=assocIndexOf(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=listCacheDelete$1,listCacheGet=listCacheGet$1,listCacheHas=listCacheHas$1,listCacheSet=listCacheSet$1;function ListCache$4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ListCache$4.prototype.clear=listCacheClear,ListCache$4.prototype.delete=listCacheDelete,ListCache$4.prototype.get=listCacheGet,ListCache$4.prototype.has=listCacheHas,ListCache$4.prototype.set=listCacheSet;var _ListCache=ListCache$4,getNative$3=_getNative,root$4=_root,Map$4=_getNative(_root,"Map"),_Map=Map$4,Hash=_Hash,ListCache$3=_ListCache,Map$3=_Map;function mapCacheClear$1(){this.size=0,this.__data__={hash:new Hash,map:new(Map$3||ListCache$3),string:new Hash}}var _mapCacheClear=mapCacheClear$1;function isKeyable$1(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var _isKeyable=isKeyable$1,isKeyable=isKeyable$1;function getMapData$4(e,t){e=e.__data__;return isKeyable(t)?e["string"==typeof t?"string":"hash"]:e.map}var _getMapData=getMapData$4,getMapData$3=getMapData$4;function mapCacheDelete$1(e){e=getMapData$3(this,e).delete(e);return this.size-=e?1:0,e}var _mapCacheDelete=mapCacheDelete$1,getMapData$2=getMapData$4;function mapCacheGet$1(e){return getMapData$2(this,e).get(e)}var _mapCacheGet=mapCacheGet$1,getMapData$1=getMapData$4;function mapCacheHas$1(e){return getMapData$1(this,e).has(e)}var _mapCacheHas=mapCacheHas$1,getMapData=getMapData$4;function mapCacheSet$1(e,t){var n=getMapData(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var _mapCacheSet=mapCacheSet$1,mapCacheClear=mapCacheClear$1,mapCacheDelete=mapCacheDelete$1,mapCacheGet=mapCacheGet$1,mapCacheHas=mapCacheHas$1,mapCacheSet=mapCacheSet$1;function MapCache$3(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}MapCache$3.prototype.clear=mapCacheClear,MapCache$3.prototype.delete=mapCacheDelete,MapCache$3.prototype.get=mapCacheGet,MapCache$3.prototype.has=mapCacheHas,MapCache$3.prototype.set=mapCacheSet;var _MapCache=MapCache$3,MapCache$2=_MapCache,FUNC_ERROR_TEXT="Expected a function";function memoize$1(r,i){if("function"!=typeof r||null!=i&&"function"!=typeof i)throw new TypeError(FUNC_ERROR_TEXT);function a(){var e=arguments,t=i?i.apply(this,e):e[0],n=a.cache;return n.has(t)?n.get(t):(e=r.apply(this,e),a.cache=n.set(t,e)||n,e)}return a.cache=new(memoize$1.Cache||MapCache$2),a}memoize$1.Cache=MapCache$2;var memoize_1=memoize$1,memoize=memoize$1,MAX_MEMOIZE_SIZE=500;function memoizeCapped$1(e){var e=memoize(e,function(e){return t.size===MAX_MEMOIZE_SIZE&&t.clear(),e}),t=e.cache;return e}var _memoizeCapped=memoizeCapped$1,memoizeCapped=memoizeCapped$1,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath$1=memoizeCapped$1(function(e){var i=[];return 46===e.charCodeAt(0)&&i.push(""),e.replace(rePropName,function(e,t,n,r){i.push(n?r.replace(reEscapeChar,"$1"):t||e)}),i}),_stringToPath=stringToPath$1;function arrayMap$2(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var _arrayMap=arrayMap$2,Symbol$3=_Symbol,arrayMap$1=_arrayMap,isArray$b=isArray_1$1,isSymbol$1=isSymbol_1,INFINITY=1/0,symbolProto$2=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto$2?symbolProto$2.toString:void 0;function baseToString$1(e){var t;return"string"==typeof e?e:isArray$b(e)?arrayMap$1(e,baseToString$1)+"":isSymbol$1(e)?symbolToString?symbolToString.call(e):"":"0"==(t=e+"")&&1/e==-INFINITY?"-0":t}var _baseToString=baseToString$1,baseToString=baseToString$1;function toString$2(e){return null==e?"":baseToString(e)}var toString_1=toString$2,isArray$a=isArray_1$1,isKey$2=_isKey,stringToPath=_stringToPath,toString$1=toString$2;function castPath$4(e,t){return isArray$a(e)?e:isKey$2(e,t)?[e]:stringToPath(toString$1(e))}var _castPath=castPath$4,castPath$3=_castPath,toKey$4=_toKey;function baseGet$4(e,t){for(var n=0,r=(t=castPath$3(t,e)).length;null!=e&&n<r;)e=e[toKey$4(t[n++])];return n&&n==r?e:void 0}var _baseGet=baseGet$4,baseGet$3=_baseGet;function get$1(e,t,n){e=null==e?void 0:baseGet$3(e,t);return void 0===e?n:e}var get_1=get$1,get$2=getDefaultExportFromCjs(get_1),ListCache$2=_ListCache;function stackClear$1(){this.__data__=new ListCache$2,this.size=0}var _stackClear=stackClear$1;function stackDelete$1(e){var t=this.__data__,e=t.delete(e);return this.size=t.size,e}var _stackDelete=stackDelete$1;function stackGet$1(e){return this.__data__.get(e)}var _stackGet=stackGet$1;function stackHas$1(e){return this.__data__.has(e)}var _stackHas=stackHas$1,ListCache$1=_ListCache,Map$2=_Map,MapCache$1=_MapCache,LARGE_ARRAY_SIZE=200;function stackSet$1(e,t){var n=this.__data__;if(n instanceof ListCache$1){var r=n.__data__;if(!Map$2||r.length<LARGE_ARRAY_SIZE-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new MapCache$1(r)}return n.set(e,t),this.size=n.size,this}var _stackSet=stackSet$1,ListCache=_ListCache,stackClear=stackClear$1,stackDelete=stackDelete$1,stackGet=stackGet$1,stackHas=stackHas$1,stackSet=stackSet$1;function Stack$3(e){e=this.__data__=new ListCache(e);this.size=e.size}Stack$3.prototype.clear=stackClear,Stack$3.prototype.delete=stackDelete,Stack$3.prototype.get=stackGet,Stack$3.prototype.has=stackHas,Stack$3.prototype.set=stackSet;var _Stack=Stack$3,HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd$1(e){return this.__data__.set(e,HASH_UNDEFINED),this}var _setCacheAdd=setCacheAdd$1;function setCacheHas$1(e){return this.__data__.has(e)}var _setCacheHas=setCacheHas$1,MapCache=_MapCache,setCacheAdd=setCacheAdd$1,setCacheHas=setCacheHas$1;function SetCache$1(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new MapCache;++t<n;)this.add(e[t])}SetCache$1.prototype.add=SetCache$1.prototype.push=setCacheAdd,SetCache$1.prototype.has=setCacheHas;var _SetCache=SetCache$1;function arraySome$1(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var _arraySome=arraySome$1;function cacheHas$1(e,t){return e.has(t)}var _cacheHas=cacheHas$1,SetCache=SetCache$1,arraySome=arraySome$1,cacheHas=cacheHas$1,COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2;function equalArrays$2(e,t,n,r,i,a){var o=n&COMPARE_PARTIAL_FLAG$5,s=e.length,c=t.length;if(s!=c&&!(o&&s<c))return!1;var c=a.get(e),l=a.get(t);if(c&&l)return c==t&&l==e;var u=-1,p=!0,d=n&COMPARE_UNORDERED_FLAG$3?new SetCache:void 0;for(a.set(e,t),a.set(t,e);++u<s;){var y,f=e[u],h=t[u];if(void 0!==(y=r?o?r(h,f,u,t,e,a):r(f,h,u,e,t,a):y)){if(y)continue;p=!1;break}if(d){if(!arraySome(t,function(e,t){if(!cacheHas(d,t)&&(f===e||i(f,e,n,r,a)))return d.push(t)})){p=!1;break}}else if(f!==h&&!i(f,h,n,r,a)){p=!1;break}}return a.delete(e),a.delete(t),p}var _equalArrays=equalArrays$2,root$3=_root,Uint8Array$3=_root.Uint8Array,_Uint8Array=Uint8Array$3;function mapToArray$1(e){var n=-1,r=Array(e.size);return e.forEach(function(e,t){r[++n]=[t,e]}),r}var _mapToArray=mapToArray$1;function setToArray$1(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var _setToArray=setToArray$1,Symbol$2=_Symbol,Uint8Array$2=_Uint8Array,eq$2=eq_1,equalArrays$1=_equalArrays,mapToArray=mapToArray$1,setToArray=setToArray$1,COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2,boolTag$3="[object Boolean]",dateTag$3="[object Date]",errorTag$2="[object Error]",mapTag$5="[object Map]",numberTag$4="[object Number]",regexpTag$3="[object RegExp]",setTag$5="[object Set]",stringTag$3="[object String]",symbolTag$2="[object Symbol]",arrayBufferTag$3="[object ArrayBuffer]",dataViewTag$4="[object DataView]",symbolProto$1=_Symbol?_Symbol.prototype:void 0,symbolValueOf$1=symbolProto$1?symbolProto$1.valueOf:void 0;function equalByTag$1(e,t,n,r,i,a,o){switch(n){case dataViewTag$4:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag$3:return e.byteLength==t.byteLength&&a(new Uint8Array$2(e),new Uint8Array$2(t))?!0:!1;case boolTag$3:case dateTag$3:case numberTag$4:return eq$2(+e,+t);case errorTag$2:return e.name==t.name&&e.message==t.message;case regexpTag$3:case stringTag$3:return e==t+"";case mapTag$5:var s=mapToArray;case setTag$5:s=s||setToArray;if(e.size!=t.size&&!(r&COMPARE_PARTIAL_FLAG$4))return!1;var c=o.get(e);if(c)return c==t;r|=COMPARE_UNORDERED_FLAG$2,o.set(e,t);c=equalArrays$1(s(e),s(t),r,i,a,o);return o.delete(e),c;case symbolTag$2:if(symbolValueOf$1)return symbolValueOf$1.call(e)==symbolValueOf$1.call(t)}return!1}var _equalByTag=equalByTag$1,arrayPush$1=_arrayPush,isArray$9=isArray_1$1;function baseGetAllKeys$2(e,t,n){t=t(e);return isArray$9(e)?t:arrayPush$1(t,n(e))}var _baseGetAllKeys=baseGetAllKeys$2;function arrayFilter$2(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}var _arrayFilter=arrayFilter$2;function stubArray$2(){return[]}var stubArray_1=stubArray$2,arrayFilter$1=_arrayFilter,stubArray$1=stubArray_1,objectProto$9=Object.prototype,propertyIsEnumerable=objectProto$9.propertyIsEnumerable,nativeGetSymbols$1=Object.getOwnPropertySymbols,getSymbols$3=nativeGetSymbols$1?function(t){return null==t?[]:(t=Object(t),arrayFilter$1(nativeGetSymbols$1(t),function(e){return propertyIsEnumerable.call(t,e)}))}:stubArray$1,_getSymbols=getSymbols$3;function baseTimes$1(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var _baseTimes=baseTimes$1,isBuffer$3={exports:{}};function stubFalse(){return!1}var stubFalse_1=stubFalse,isBufferExports=(isBuffer$3.exports,!function(e,t){var t=t&&!t.nodeType&&t,n=t&&e&&!e.nodeType&&e,n=n&&n.exports===t?_root.Buffer:void 0,t=n?n.isBuffer:void 0;e.exports=t||stubFalse_1}(isBuffer$3,isBuffer$3.exports),isBuffer$3.exports),MAX_SAFE_INTEGER=9007199254740991;function isLength$3(e){return"number"==typeof e&&-1<e&&e%1==0&&e<=MAX_SAFE_INTEGER}var isLength_1=isLength$3,baseGetTag$3=_baseGetTag,isLength$2=isLength_1,isObjectLike$6=isObjectLike_1,argsTag$2="[object Arguments]",arrayTag$2="[object Array]",boolTag$2="[object Boolean]",dateTag$2="[object Date]",errorTag$1="[object Error]",funcTag$1="[object Function]",mapTag$4="[object Map]",numberTag$3="[object Number]",objectTag$4="[object Object]",regexpTag$2="[object RegExp]",setTag$4="[object Set]",stringTag$2="[object String]",weakMapTag$2="[object WeakMap]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$3="[object DataView]",float32Tag$2="[object Float32Array]",float64Tag$2="[object Float64Array]",int8Tag$2="[object Int8Array]",int16Tag$2="[object Int16Array]",int32Tag$2="[object Int32Array]",uint8Tag$2="[object Uint8Array]",uint8ClampedTag$2="[object Uint8ClampedArray]",uint16Tag$2="[object Uint16Array]",uint32Tag$2="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray$1(e){return isObjectLike$6(e)&&isLength$2(e.length)&&!!typedArrayTags[baseGetTag$3(e)]}typedArrayTags[float32Tag$2]=typedArrayTags[float64Tag$2]=typedArrayTags[int8Tag$2]=typedArrayTags[int16Tag$2]=typedArrayTags[int32Tag$2]=typedArrayTags[uint8Tag$2]=typedArrayTags[uint8ClampedTag$2]=typedArrayTags[uint16Tag$2]=typedArrayTags[uint32Tag$2]=!0,typedArrayTags[argsTag$2]=typedArrayTags[arrayTag$2]=typedArrayTags[arrayBufferTag$2]=typedArrayTags[boolTag$2]=typedArrayTags[dataViewTag$3]=typedArrayTags[dateTag$2]=typedArrayTags[errorTag$1]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag$4]=typedArrayTags[numberTag$3]=typedArrayTags[objectTag$4]=typedArrayTags[regexpTag$2]=typedArrayTags[setTag$4]=typedArrayTags[stringTag$2]=typedArrayTags[weakMapTag$2]=!1;var _baseIsTypedArray=baseIsTypedArray$1;function baseUnary$4(t){return function(e){return t(e)}}var _baseUnary=baseUnary$4,_nodeUtil={exports:{}},_nodeUtilExports=(_nodeUtil.exports,!function(e,t){var t=t&&!t.nodeType&&t,n=t&&e&&!e.nodeType&&e,r=n&&n.exports===t&&_freeGlobal.process,t=function(){try{var e=n&&n.require&&n.require("util").types;return e?e:r&&r.binding&&r.binding("util")}catch(e){}}();e.exports=t}(_nodeUtil,_nodeUtil.exports),_nodeUtil.exports),baseIsTypedArray=_baseIsTypedArray,baseUnary$3=_baseUnary,nodeUtil$2=_nodeUtilExports,nodeIsTypedArray=_nodeUtilExports&&_nodeUtilExports.isTypedArray,isTypedArray$2=nodeIsTypedArray?baseUnary$3(nodeIsTypedArray):baseIsTypedArray,isTypedArray_1=isTypedArray$2,baseTimes=_baseTimes,isArguments$1=isArguments_1,isArray$8=isArray_1$1,isBuffer$2=isBufferExports,isIndex$3=_isIndex,isTypedArray$1=isTypedArray_1,objectProto$8=Object.prototype,hasOwnProperty$9=objectProto$8.hasOwnProperty;function arrayLikeKeys$2(e,t){var n,r=isArray$8(e),i=!r&&isArguments$1(e),a=!r&&!i&&isBuffer$2(e),o=!r&&!i&&!a&&isTypedArray$1(e),s=r||i||a||o,c=s?baseTimes(e.length,String):[],l=c.length;for(n in e)!t&&!hasOwnProperty$9.call(e,n)||s&&("length"==n||a&&("offset"==n||"parent"==n)||o&&("buffer"==n||"byteLength"==n||"byteOffset"==n)||isIndex$3(n,l))||c.push(n);return c}var _arrayLikeKeys=arrayLikeKeys$2,objectProto$7=Object.prototype;function isPrototype$3(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$7)}var _isPrototype=isPrototype$3;function overArg$2(t,n){return function(e){return t(n(e))}}var _overArg=overArg$2,overArg$1=_overArg,nativeKeys$1=_overArg(Object.keys,Object),_nativeKeys=nativeKeys$1,isPrototype$2=_isPrototype,nativeKeys=nativeKeys$1,objectProto$6=Object.prototype,hasOwnProperty$8=objectProto$6.hasOwnProperty;function baseKeys$1(e){if(!isPrototype$2(e))return nativeKeys(e);var t,n=[];for(t in Object(e))hasOwnProperty$8.call(e,t)&&"constructor"!=t&&n.push(t);return n}var _baseKeys=baseKeys$1,isFunction=isFunction_1$2,isLength$1=isLength_1;function isArrayLike$5(e){return null!=e&&isLength$1(e.length)&&!isFunction(e)}var isArrayLike_1=isArrayLike$5,arrayLikeKeys$1=_arrayLikeKeys,baseKeys=baseKeys$1,isArrayLike$4=isArrayLike_1;function keys$5(e){return(isArrayLike$4(e)?arrayLikeKeys$1:baseKeys)(e)}var keys_1=keys$5,baseGetAllKeys$1=_baseGetAllKeys,getSymbols$2=_getSymbols,keys$4=keys_1;function getAllKeys$2(e){return baseGetAllKeys$1(e,keys$4,getSymbols$2)}var _getAllKeys=getAllKeys$2,getAllKeys$1=_getAllKeys,COMPARE_PARTIAL_FLAG$3=1,objectProto$5=Object.prototype,hasOwnProperty$7=objectProto$5.hasOwnProperty;function equalObjects$1(e,t,n,r,i,a){var o=n&COMPARE_PARTIAL_FLAG$3,s=getAllKeys$1(e),c=s.length;if(c!=getAllKeys$1(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:hasOwnProperty$7.call(t,u)))return!1}var p=a.get(e),d=a.get(t);if(p&&d)return p==t&&d==e;for(var y=!0,f=(a.set(e,t),a.set(t,e),o);++l<c;){var h,m=e[u=s[l]],g=t[u];if(!(void 0===(h=r?o?r(g,m,u,t,e,a):r(m,g,u,e,t,a):h)?m===g||i(m,g,n,r,a):h)){y=!1;break}f=f||"constructor"==u}return y&&!f&&(p=e.constructor)!=(d=t.constructor)&&"constructor"in e&&"constructor"in t&&!("function"==typeof p&&p instanceof p&&"function"==typeof d&&d instanceof d)&&(y=!1),a.delete(e),a.delete(t),y}var _equalObjects=equalObjects$1,getNative$2=_getNative,root$2=_root,DataView$1=_getNative(_root,"DataView"),_DataView=DataView$1,getNative$1=_getNative,root$1=_root,Promise$2=_getNative(_root,"Promise"),_Promise=Promise$2,getNative=_getNative,root=_root,Set$2=_getNative(_root,"Set"),_Set=Set$2,DataView=_DataView,Map$1=_Map,Promise$1=_Promise,Set$1=Set$2,WeakMap$1=_WeakMap,baseGetTag$2=_baseGetTag,toSource=_toSource,mapTag$3="[object Map]",objectTag$3="[object Object]",promiseTag="[object Promise]",setTag$3="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$2="[object DataView]",dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map$1),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set$1),weakMapCtorString=toSource(WeakMap$1),getTag$4=baseGetTag$2,_getTag=getTag$4=DataView&&getTag$4(new DataView(new ArrayBuffer(1)))!=dataViewTag$2||Map$1&&getTag$4(new Map$1)!=mapTag$3||Promise$1&&getTag$4(Promise$1.resolve())!=promiseTag||Set$1&&getTag$4(new Set$1)!=setTag$3||WeakMap$1&&getTag$4(new WeakMap$1)!=weakMapTag$1?function(e){var t=baseGetTag$2(e),e=t==objectTag$3?e.constructor:void 0,e=e?toSource(e):"";if(e)switch(e){case dataViewCtorString:return dataViewTag$2;case mapCtorString:return mapTag$3;case promiseCtorString:return promiseTag;case setCtorString:return setTag$3;case weakMapCtorString:return weakMapTag$1}return t}:getTag$4,Stack$2=_Stack,equalArrays=_equalArrays,equalByTag=_equalByTag,equalObjects=_equalObjects,getTag$3=_getTag,isArray$7=isArray_1$1,isBuffer$1=isBufferExports,isTypedArray=isTypedArray_1,COMPARE_PARTIAL_FLAG$2=1,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",objectTag$2="[object Object]",objectProto$4=Object.prototype,hasOwnProperty$6=objectProto$4.hasOwnProperty;function baseIsEqualDeep$1(e,t,n,r,i,a){var o=isArray$7(e),s=isArray$7(t),c=o?arrayTag$1:getTag$3(e),s=s?arrayTag$1:getTag$3(t),l=(c=c==argsTag$1?objectTag$2:c)==objectTag$2,u=(s=s==argsTag$1?objectTag$2:s)==objectTag$2,s=c==s;if(s&&isBuffer$1(e)){if(!isBuffer$1(t))return!1;l=!(o=!0)}if(s&&!l)return a=a||new Stack$2,o||isTypedArray(e)?equalArrays(e,t,n,r,i,a):equalByTag(e,t,c,n,r,i,a);if(!(n&COMPARE_PARTIAL_FLAG$2)){o=l&&hasOwnProperty$6.call(e,"__wrapped__"),c=u&&hasOwnProperty$6.call(t,"__wrapped__");if(o||c)return i(o?e.value():e,c?t.value():t,n,r,a=a||new Stack$2)}return s&&(a=a||new Stack$2,equalObjects(e,t,n,r,i,a))}var _baseIsEqualDeep=baseIsEqualDeep$1,baseIsEqualDeep=baseIsEqualDeep$1,isObjectLike$5=isObjectLike_1;function baseIsEqual$3(e,t,n,r,i){return e===t||(null==e||null==t||!isObjectLike$5(e)&&!isObjectLike$5(t)?e!=e&&t!=t:baseIsEqualDeep(e,t,n,r,baseIsEqual$3,i))}var _baseIsEqual=baseIsEqual$3,baseIsEqual$2=_baseIsEqual;function isEqual(e,t){return baseIsEqual$2(e,t)}var isEqual_1=isEqual,isEqual$1=getDefaultExportFromCjs(isEqual);function useEffectOnce(e){useEffect(e,[])}function usePrevious$1(e){const t=useRef();return useEffect(()=>{t.current=e}),t.current}var dist={},cache={},ReactiveVarsCache={},require$$0$1=getAugmentedNamespace(client$1),InvalidationPolicyCache$1=(!function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ReactiveVarsCache=n.makeCachedVar=n.initReactiveVarsCache=n.cachedReactiveVarTypename=void 0;const i=require$$0$1;var r;n.cachedReactiveVarTypename="CachedReactiveVar",n.initReactiveVarsCache=function(e){return r=new t({cache:e})};const a=(0,i.gql)`
  fragment ReadCachedReactiveVarFragment on CachedReactiveVar {
    id
    value
  }
`;n.makeCachedVar=function(e,t){return r.registerCachedVar(e,t)};class t{constructor({cache:e}){this.registeredVars={},this.cache=e}watchReactiveVar(t,n){n.onNextChange(e=>{this.writeCachedVar(t,e),this.watchReactiveVar(t,n)})}registerCachedVar(e,t){var n=this.readCachedVar(e),r=(0,i.makeVar)(null!=n?n:t);return this.registeredVars[e]&&console.warn(`Duplicate cached reactive variable with ID ${e} detected. Multiple cached reactive variables should not share the same ID.`),this.registeredVars[e]={rv:r,defaultValue:t},n||this.writeCachedVar(e,t),this.watchReactiveVar(e,r),r}readCachedVar(e){var e=this.cache.identify({__typename:n.cachedReactiveVarTypename,id:e}),e=this.cache.readFragment({fragment:a,id:e});return null!=(e=null==e?void 0:e.value)?e:null}writeCachedVar(e,t){void 0!==t&&this.cache.writeFragment({id:r.cache.identify({__typename:n.cachedReactiveVarTypename,id:e}),fragment:a,data:{__typename:n.cachedReactiveVarTypename,id:e,value:t}})}reset(){Object.keys(this.registeredVars).forEach(e=>{var{rv:t,defaultValue:n}=this.registeredVars[e];t(null!=(t=this.readCachedVar(e))?t:n)})}}n.ReactiveVarsCache=t}(ReactiveVarsCache),{});function compact(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i}var compact_1$1=compact;function arrayEvery$1(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var _arrayEvery=arrayEvery$1;function createBaseFor$1(c){return function(e,t,n){for(var r=-1,i=Object(e),a=n(e),o=a.length;o--;){var s=a[c?o:++r];if(!1===t(i[s],s,i))break}return e}}var _createBaseFor=createBaseFor$1,createBaseFor=createBaseFor$1,baseFor$1=createBaseFor$1(),_baseFor=baseFor$1,baseFor=baseFor$1,keys$3=keys_1;function baseForOwn$1(e,t){return e&&baseFor(e,t,keys$3)}var _baseForOwn=baseForOwn$1,isArrayLike$3=isArrayLike_1;function createBaseEach$1(a,o){return function(e,t){if(null!=e){if(!isArrayLike$3(e))return a(e,t);for(var n=e.length,r=o?n:-1,i=Object(e);(o?r--:++r<n)&&!1!==t(i[r],r,i););}return e}}var _createBaseEach=createBaseEach$1,baseForOwn=baseForOwn$1,createBaseEach=createBaseEach$1,baseEach$3=createBaseEach$1(baseForOwn$1),_baseEach=baseEach$3,baseEach$2=_baseEach;function baseEvery$1(e,r){var i=!0;return baseEach$2(e,function(e,t,n){return i=!!r(e,t,n)}),i}var _baseEvery=baseEvery$1,Stack$1=_Stack,baseIsEqual$1=_baseIsEqual,COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2;function baseIsMatch$1(e,t,n,r){var i=n.length,a=i,o=!r;if(null==e)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){var c=(s=n[i])[0],l=e[c],u=s[1];if(o&&s[2]){if(void 0===l&&!(c in e))return!1}else{var p,d=new Stack$1;if(!(void 0===(p=r?r(l,u,c,e,t,d):p)?baseIsEqual$1(u,l,COMPARE_PARTIAL_FLAG$1|COMPARE_UNORDERED_FLAG$1,r,d):p))return!1}}return!0}var _baseIsMatch=baseIsMatch$1,isObject$4=isObject_1;function isStrictComparable$2(e){return e==e&&!isObject$4(e)}var _isStrictComparable=isStrictComparable$2,isStrictComparable$1=isStrictComparable$2,keys$2=keys_1;function getMatchData$1(e){for(var t=keys$2(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,isStrictComparable$1(i)]}return t}var _getMatchData=getMatchData$1;function matchesStrictComparable$2(t,n){return function(e){return null!=e&&e[t]===n&&(void 0!==n||t in Object(e))}}var _matchesStrictComparable=matchesStrictComparable$2,baseIsMatch=baseIsMatch$1,getMatchData=getMatchData$1,matchesStrictComparable$1=matchesStrictComparable$2;function baseMatches$1(t){var n=getMatchData(t);return 1==n.length&&n[0][2]?matchesStrictComparable$1(n[0][0],n[0][1]):function(e){return e===t||baseIsMatch(e,t,n)}}var _baseMatches=baseMatches$1;function baseHasIn$1(e,t){return null!=e&&t in Object(e)}var _baseHasIn=baseHasIn$1,castPath$2=_castPath,isArguments=isArguments_1,isArray$6=isArray_1$1,isIndex$2=_isIndex,isLength=isLength_1,toKey$3=_toKey;function hasPath$1(e,t,n){for(var r=-1,i=(t=castPath$2(t,e)).length,a=!1;++r<i;){var o=toKey$3(t[r]);if(!(a=null!=e&&n(e,o)))break;e=e[o]}return a||++r!=i?a:!!(i=null==e?0:e.length)&&isLength(i)&&isIndex$2(o,i)&&(isArray$6(e)||isArguments(e))}var _hasPath=hasPath$1,baseHasIn=baseHasIn$1,hasPath=hasPath$1;function hasIn$2(e,t){return null!=e&&hasPath(e,t,baseHasIn)}var hasIn_1=hasIn$2,baseIsEqual=_baseIsEqual,get=get_1,hasIn$1=hasIn_1,isKey$1=_isKey,isStrictComparable=isStrictComparable$2,matchesStrictComparable=matchesStrictComparable$2,toKey$2=_toKey,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function baseMatchesProperty$1(n,r){return isKey$1(n)&&isStrictComparable(r)?matchesStrictComparable(toKey$2(n),r):function(e){var t=get(e,n);return void 0===t&&t===r?hasIn$1(e,n):baseIsEqual(r,t,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG)}}var _baseMatchesProperty=baseMatchesProperty$1;function baseProperty$1(t){return function(e){return null==e?void 0:e[t]}}var _baseProperty=baseProperty$1,baseGet$2=_baseGet;function basePropertyDeep$1(t){return function(e){return baseGet$2(e,t)}}var _basePropertyDeep=basePropertyDeep$1,baseProperty=baseProperty$1,basePropertyDeep=basePropertyDeep$1,isKey=_isKey,toKey$1=_toKey;function property$1(e){return isKey(e)?baseProperty(toKey$1(e)):basePropertyDeep(e)}var property_1=property$1,baseMatches=baseMatches$1,baseMatchesProperty=baseMatchesProperty$1,identity$1=identity_1,isArray$5=isArray_1$1,property=property$1;function baseIteratee$3(e){return"function"==typeof e?e:null==e?identity$1:"object"==typeof e?isArray$5(e)?baseMatchesProperty(e[0],e[1]):baseMatches(e):property(e)}var _baseIteratee=baseIteratee$3,eq$1=eq_1,isArrayLike$2=isArrayLike_1,isIndex$1=_isIndex,isObject$3=isObject_1;function isIterateeCall$1(e,t,n){var r;return!!isObject$3(n)&&!!("number"==(r=typeof t)?isArrayLike$2(n)&&isIndex$1(t,n.length):"string"==r&&t in n)&&eq$1(n[t],e)}var _isIterateeCall=isIterateeCall$1,arrayEvery=_arrayEvery,baseEvery=baseEvery$1,baseIteratee$2=_baseIteratee,isArray$4=isArray_1$1,isIterateeCall=isIterateeCall$1;function every(e,t,n){var r=isArray$4(e)?arrayEvery:baseEvery;return n&&isIterateeCall(e,t,n)&&(t=void 0),r(e,baseIteratee$2(t))}var every_1$1=every,baseAssignValue$1=_baseAssignValue,eq=eq_1,objectProto$3=Object.prototype,hasOwnProperty$5=objectProto$3.hasOwnProperty;function assignValue$3(e,t,n){var r=e[t];hasOwnProperty$5.call(e,t)&&eq(r,n)&&(void 0!==n||t in e)||baseAssignValue$1(e,t,n)}var _assignValue=assignValue$3,assignValue$2=_assignValue,castPath$1=_castPath,isIndex=_isIndex,isObject$2=isObject_1,toKey=_toKey;function baseSet$2(e,t,n,r){if(isObject$2(e))for(var i=-1,a=(t=castPath$1(t,e)).length,o=a-1,s=e;null!=s&&++i<a;){var c,l=toKey(t[i]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;i!=o&&(c=s[l],void 0===(u=r?r(c,l,s):void 0))&&(u=isObject$2(c)?c:isIndex(t[i+1])?[]:{}),assignValue$2(s,l,u),s=s[l]}return e}var _baseSet=baseSet$2,baseGet$1=_baseGet,baseSet$1=_baseSet,castPath=_castPath;function basePickBy$1(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=baseGet$1(e,o);n(s,o)&&baseSet$1(a,castPath(o,e),s)}return a}var _basePickBy=basePickBy$1,basePickBy=basePickBy$1,hasIn=hasIn_1;function basePick$1(n,e){return basePickBy(n,e,function(e,t){return hasIn(n,t)})}var _basePick=basePick$1,basePick=basePick$1,flatRest=_flatRest,pick=_flatRest(function(e,t){return null==e?{}:basePick(e,t)}),pick_1$1=pick;function baseSlice$1(e,t,n){for(var r=-1,i=e.length,a=((n=i<n?i:n)<0&&(n+=i),i=n<(t=t<0?i<-t?0:i+t:t)?0:n-t>>>0,t>>>=0,Array(i));++r<i;)a[r]=e[r+t];return a}var _baseSlice=baseSlice$1,baseSlice=baseSlice$1,toInteger=toInteger_1;function take(e,t,n){return e&&e.length?(t=n||void 0===t?1:toInteger(t),baseSlice(e,0,t<0?0:t)):[]}var take_1$1=take;function isNil(e){return null==e}var isNil_1$1=isNil,baseEach$1=_baseEach,isArrayLike$1=isArrayLike_1;function baseMap$1(e,r){var i=-1,a=isArrayLike$1(e)?Array(e.length):[];return baseEach$1(e,function(e,t,n){a[++i]=r(e,t,n)}),a}var _baseMap=baseMap$1;function baseSortBy$1(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var _baseSortBy=baseSortBy$1,isSymbol=isSymbol_1;function compareAscending$1(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,a=isSymbol(e),o=void 0!==t,s=null===t,c=t==t,l=isSymbol(t);if(!s&&!l&&!a&&t<e||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}var _compareAscending=compareAscending$1,compareAscending=compareAscending$1;function compareMultiple$1(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=compareAscending(i[r],a[r]);if(c)return s<=r?c:c*("desc"==n[r]?-1:1)}return e.index-t.index}var _compareMultiple=compareMultiple$1,arrayMap=_arrayMap,baseGet=_baseGet,baseIteratee$1=_baseIteratee,baseMap=baseMap$1,baseSortBy=baseSortBy$1,baseUnary$2=_baseUnary,compareMultiple=compareMultiple$1,identity=identity_1,isArray$3=isArray_1$1;function baseOrderBy$1(e,r,n){r=r.length?arrayMap(r,function(t){return isArray$3(t)?function(e){return baseGet(e,1===t.length?t[0]:t)}:t}):[identity];var i=-1,e=(r=arrayMap(r,baseUnary$2(baseIteratee$1)),baseMap(e,function(t,e,n){return{criteria:arrayMap(r,function(e){return e(t)}),index:++i,value:t}}));return baseSortBy(e,function(e,t){return compareMultiple(e,t,n)})}var _baseOrderBy=baseOrderBy$1,baseOrderBy=baseOrderBy$1,isArray$2=isArray_1$1;function orderBy(e,t,n,r){return null==e?[]:(isArray$2(t)||(t=null==t?[]:[t]),isArray$2(n=r?void 0:n)||(n=null==n?[]:[n]),baseOrderBy(e,t,n))}var orderBy_1$1=orderBy,InvalidationPolicyManager$1={},baseGetTag$1=_baseGetTag,isObjectLike$4=isObjectLike_1,numberTag$2="[object Number]";function isNumber(e){return"number"==typeof e||isObjectLike$4(e)&&baseGetTag$1(e)==numberTag$2}var InvalidationPolicyEvent,InvalidationPolicyLifecycleEvent,RenewalPolicy,isNumber_1$1=isNumber,types={},helpers=(Object.defineProperty(types,"__esModule",{value:!0}),types.RenewalPolicy=types.InvalidationPolicyLifecycleEvent=types.InvalidationPolicyEvent=void 0,!function(e){e.Write="Write",e.Evict="Evict",e.Read="Read"}(InvalidationPolicyEvent||(types.InvalidationPolicyEvent=InvalidationPolicyEvent={})),!function(e){e.Write="onWrite",e.Evict="onEvict"}(InvalidationPolicyLifecycleEvent||(types.InvalidationPolicyLifecycleEvent=InvalidationPolicyLifecycleEvent={})),!function(e){e.AccessOnly="access-only",e.AccessAndWrite="access-and-write",e.WriteOnly="write-only",e.None="none"}(RenewalPolicy||(types.RenewalPolicy=RenewalPolicy={})),{}),assignValue$1=_assignValue,baseAssignValue=_baseAssignValue;function copyObject$4(e,t,n,r){for(var i=!n,a=(n=n||{},-1),o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),(i?baseAssignValue:assignValue$1)(n,s,c)}return n}var _copyObject=copyObject$4,copyObject$3=_copyObject,keys$1=keys_1;function baseAssign$1(e,t){return e&&copyObject$3(t,keys$1(t),e)}var _baseAssign=baseAssign$1;function nativeKeysIn$1(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}var _nativeKeysIn=nativeKeysIn$1,isObject$1=isObject_1,isPrototype$1=_isPrototype,nativeKeysIn=nativeKeysIn$1,objectProto$2=Object.prototype,hasOwnProperty$4=objectProto$2.hasOwnProperty;function baseKeysIn$1(e){if(!isObject$1(e))return nativeKeysIn(e);var t,n=isPrototype$1(e),r=[];for(t in e)("constructor"!=t||!n&&hasOwnProperty$4.call(e,t))&&r.push(t);return r}var _baseKeysIn=baseKeysIn$1,arrayLikeKeys=_arrayLikeKeys,baseKeysIn=baseKeysIn$1,isArrayLike=isArrayLike_1;function keysIn$3(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}var keysIn_1=keysIn$3,copyObject$2=_copyObject,keysIn$2=keysIn_1;function baseAssignIn$1(e,t){return e&&copyObject$2(t,keysIn$2(t),e)}var _baseAssignIn=baseAssignIn$1,_cloneBuffer={exports:{}},_cloneBufferExports=(_cloneBuffer.exports,!function(e,t){var t=t&&!t.nodeType&&t,n=t&&e&&!e.nodeType&&e,n=n&&n.exports===t?_root.Buffer:void 0,r=n?n.allocUnsafe:void 0;e.exports=function(e,t){return t?e.slice():(t=e.length,t=r?r(t):new e.constructor(t),e.copy(t),t)}}(_cloneBuffer,_cloneBuffer.exports),_cloneBuffer.exports),copyObject$1=_copyObject,getSymbols$1=_getSymbols;function copySymbols$1(e,t){return copyObject$1(e,getSymbols$1(e),t)}var _copySymbols=copySymbols$1,overArg=_overArg,getPrototype$3=_overArg(Object.getPrototypeOf,Object),_getPrototype=getPrototype$3,arrayPush=_arrayPush,getPrototype$2=_getPrototype,getSymbols=_getSymbols,stubArray=stubArray_1,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbolsIn$2=nativeGetSymbols?function(e){for(var t=[];e;)arrayPush(t,getSymbols(e)),e=getPrototype$2(e);return t}:stubArray,_getSymbolsIn=getSymbolsIn$2,copyObject=_copyObject,getSymbolsIn$1=getSymbolsIn$2;function copySymbolsIn$1(e,t){return copyObject(e,getSymbolsIn$1(e),t)}var _copySymbolsIn=copySymbolsIn$1,baseGetAllKeys=_baseGetAllKeys,getSymbolsIn=getSymbolsIn$2,keysIn$1=keysIn_1;function getAllKeysIn$1(e){return baseGetAllKeys(e,keysIn$1,getSymbolsIn)}var _getAllKeysIn=getAllKeysIn$1,objectProto$1=Object.prototype,hasOwnProperty$3=objectProto$1.hasOwnProperty;function initCloneArray$1(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&hasOwnProperty$3.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var _initCloneArray=initCloneArray$1,Uint8Array$1=_Uint8Array;function cloneArrayBuffer$3(e){var t=new e.constructor(e.byteLength);return new Uint8Array$1(t).set(new Uint8Array$1(e)),t}var _cloneArrayBuffer=cloneArrayBuffer$3,cloneArrayBuffer$2=_cloneArrayBuffer;function cloneDataView$1(e,t){t=t?cloneArrayBuffer$2(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var _cloneDataView=cloneDataView$1,reFlags=/\w*$/;function cloneRegExp$1(e){var t=new e.constructor(e.source,reFlags.exec(e));return t.lastIndex=e.lastIndex,t}var _cloneRegExp=cloneRegExp$1,Symbol$1=_Symbol,symbolProto=_Symbol?_Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function cloneSymbol$1(e){return symbolValueOf?Object(symbolValueOf.call(e)):{}}var _cloneSymbol=cloneSymbol$1,cloneArrayBuffer$1=_cloneArrayBuffer;function cloneTypedArray$1(e,t){t=t?cloneArrayBuffer$1(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var _cloneTypedArray=cloneTypedArray$1,cloneArrayBuffer=_cloneArrayBuffer,cloneDataView=_cloneDataView,cloneRegExp=_cloneRegExp,cloneSymbol=cloneSymbol$1,cloneTypedArray=cloneTypedArray$1,boolTag$1="[object Boolean]",dateTag$1="[object Date]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag$1="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag$1="[object Float32Array]",float64Tag$1="[object Float64Array]",int8Tag$1="[object Int8Array]",int16Tag$1="[object Int16Array]",int32Tag$1="[object Int32Array]",uint8Tag$1="[object Uint8Array]",uint8ClampedTag$1="[object Uint8ClampedArray]",uint16Tag$1="[object Uint16Array]",uint32Tag$1="[object Uint32Array]";function initCloneByTag$1(e,t,n){var r=e.constructor;switch(t){case arrayBufferTag$1:return cloneArrayBuffer(e);case boolTag$1:case dateTag$1:return new r(+e);case dataViewTag$1:return cloneDataView(e,n);case float32Tag$1:case float64Tag$1:case int8Tag$1:case int16Tag$1:case int32Tag$1:case uint8Tag$1:case uint8ClampedTag$1:case uint16Tag$1:case uint32Tag$1:return cloneTypedArray(e,n);case mapTag$2:return new r;case numberTag$1:case stringTag$1:return new r(e);case regexpTag$1:return cloneRegExp(e);case setTag$2:return new r;case symbolTag$1:return cloneSymbol(e)}}var _initCloneByTag=initCloneByTag$1,baseCreate=_baseCreate,getPrototype$1=_getPrototype,isPrototype=_isPrototype;function initCloneObject$1(e){return"function"!=typeof e.constructor||isPrototype(e)?{}:baseCreate(getPrototype$1(e))}var _initCloneObject=initCloneObject$1,getTag$2=_getTag,isObjectLike$3=isObjectLike_1,mapTag$1="[object Map]";function baseIsMap$1(e){return isObjectLike$3(e)&&getTag$2(e)==mapTag$1}var _baseIsMap=baseIsMap$1,baseIsMap=baseIsMap$1,baseUnary$1=_baseUnary,nodeUtil$1=_nodeUtilExports,nodeIsMap=_nodeUtilExports&&_nodeUtilExports.isMap,isMap$1=nodeIsMap?baseUnary$1(nodeIsMap):baseIsMap,isMap_1=isMap$1,getTag$1=_getTag,isObjectLike$2=isObjectLike_1,setTag$1="[object Set]";function baseIsSet$1(e){return isObjectLike$2(e)&&getTag$1(e)==setTag$1}var _baseIsSet=baseIsSet$1,baseIsSet=baseIsSet$1,baseUnary=_baseUnary,nodeUtil=_nodeUtilExports,nodeIsSet=_nodeUtilExports&&_nodeUtilExports.isSet,isSet$1=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,isSet_1=isSet$1,Stack=_Stack,arrayEach=_arrayEach,assignValue=_assignValue,baseAssign=_baseAssign,baseAssignIn=_baseAssignIn,cloneBuffer=_cloneBufferExports,copyArray=_copyArray,copySymbols=_copySymbols,copySymbolsIn=_copySymbolsIn,getAllKeys=_getAllKeys,getAllKeysIn=_getAllKeysIn,getTag=_getTag,initCloneArray=_initCloneArray,initCloneByTag=_initCloneByTag,initCloneObject=_initCloneObject,isArray$1=isArray_1$1,isBuffer=isBufferExports,isMap=isMap_1,isObject=isObject_1,isSet=isSet$1,keys=keys_1,keysIn=keysIn_1,CLONE_DEEP_FLAG$1=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG$1=4,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag$1="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",cloneableTags={};function baseClone$1(n,r,i,e,t,a){var o,s=r&CLONE_DEEP_FLAG$1,c=r&CLONE_FLAT_FLAG,l=r&CLONE_SYMBOLS_FLAG$1;if(void 0===(o=i?t?i(n,e,t,a):i(n):o)){if(!isObject(n))return n;e=isArray$1(n);if(e){if(o=initCloneArray(n),!s)return copyArray(n,o)}else{var u=getTag(n),p=u==funcTag||u==genTag;if(isBuffer(n))return cloneBuffer(n,s);if(u==objectTag$1||u==argsTag||p&&!t){if(o=c||p?{}:initCloneObject(n),!s)return c?copySymbolsIn(n,baseAssignIn(o,n)):copySymbols(n,baseAssign(o,n))}else{if(!cloneableTags[u])return t?n:{};o=initCloneByTag(n,u,s)}}p=(a=a||new Stack).get(n);if(p)return p;a.set(n,o),isSet(n)?n.forEach(function(e){o.add(baseClone$1(e,r,i,e,n,a))}):isMap(n)&&n.forEach(function(e,t){o.set(t,baseClone$1(e,r,i,t,n,a))});var d=e?void 0:(l?c?getAllKeysIn:getAllKeys:c?keysIn:keys)(n);arrayEach(d||n,function(e,t){d&&(e=n[t=e]),assignValue(o,t,baseClone$1(e,r,i,t,n,a))})}return o}cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag$1]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var _baseClone=baseClone$1,baseClone=baseClone$1,CLONE_DEEP_FLAG=1,CLONE_SYMBOLS_FLAG=4;function cloneDeep(e){return baseClone(e,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG)}var cloneDeep_1=cloneDeep,baseGetTag=_baseGetTag,getPrototype=_getPrototype,isObjectLike$1=isObjectLike_1,objectTag="[object Object]",funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$2=objectProto.hasOwnProperty,objectCtorString=funcToString.call(Object);function isPlainObject(e){return!(!isObjectLike$1(e)||baseGetTag(e)!=objectTag)&&(null===(e=getPrototype(e))||"function"==typeof(e=hasOwnProperty$2.call(e,"constructor")&&e.constructor)&&e instanceof e&&funcToString.call(e)==objectCtorString)}var isPlainObject_1$1=isPlainObject;function rng(){return crypto.randomBytes(16)}for(var _nodeId,_clockseq,byteToHex=[],i=0;i<256;++i)byteToHex[i]=(i+256).toString(16).substr(1);function bytesToUuid(e,t){var n=0,r=byteToHex;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[+n]],r[e[15]]].join("")}var _lastMSecs=0,_lastNSecs=0;function v1(e,t,n){var r=t&&n||0,i=t||[],a=(e=e||{}).node||_nodeId,n=void 0!==e.clockseq?e.clockseq:_clockseq,o=(null!=a&&null!=n||(o=e.random||(e.rng||rng)(),null==a&&(a=_nodeId=[1|o[0],o[1],o[2],o[3],o[4],o[5]]),null==n&&(n=_clockseq=16383&(o[6]<<8|o[7]))),void 0!==e.msecs?e.msecs:(new Date).getTime()),s=void 0!==e.nsecs?e.nsecs:_lastNSecs+1,c=o-_lastMSecs+(s-_lastNSecs)/1e4;if(c<0&&void 0===e.clockseq&&(n=n+1&16383),1e4<=(s=(c<0||_lastMSecs<o)&&void 0===e.nsecs?0:s))throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs=o,_clockseq=n;c=(1e4*(268435455&(o+=122192928e5))+(_lastNSecs=s))%4294967296,i[r++]=c>>>24&255,i[r++]=c>>>16&255,i[r++]=c>>>8&255,i[r++]=255&c,e=o/4294967296*1e4&268435455;i[r++]=e>>>8&255,i[r++]=255&e,i[r++]=e>>>24&15|16,i[r++]=e>>>16&255,i[r++]=n>>>8|128,i[r++]=255&n;for(var l=0;l<6;++l)i[r+l]=a[l];return t||bytesToUuid(i)}function uuidToBytes(e){var t=[];return e.replace(/[a-fA-F0-9]{2}/g,function(e){t.push(parseInt(e,16))}),t}function stringToBytes(e){e=unescape(encodeURIComponent(e));for(var t=new Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}const DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function v35(e,s,c){function t(e,t,n,r){var i=n&&r||0;if("string"==typeof e&&(e=stringToBytes(e)),"string"==typeof t&&(t=uuidToBytes(t)),!Array.isArray(e))throw TypeError("value must be an array of bytes");if(!Array.isArray(t)||16!==t.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var a=c(t.concat(e));if(a[6]=15&a[6]|s,a[8]=63&a[8]|128,n)for(var o=0;o<16;++o)n[i+o]=a[o];return n||bytesToUuid(a)}try{t.name=e}catch(e){}return t.DNS=DNS,t.URL=URL,t}function md5(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),crypto.createHash("md5").update(e).digest()}const v3=v35("v3",48,md5);function v4(e,t,n){var r=t&&n||0,i=("string"==typeof e&&(t="binary"===e?new Array(16):null,e=null),(e=e||{}).random||(e.rng||rng)());if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var a=0;a<16;++a)t[r+a]=i[a];return t||bytesToUuid(i)}function sha1(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),crypto.createHash("sha1").update(e).digest()}const v5=v35("v5",80,sha1);var esmNode=Object.freeze({__proto__:null,v1:v1,v3:v3,v4:v4,v5:v5}),require$$3$1=getAugmentedNamespace(esmNode),__rest$1=(!function(n){var e=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.generateFragmentFieldName=n.fieldNameFromStoreName=n.TypeOrFieldNameRegExp=n.maybeDeepClone=n.makeEntityId=n.isQuery=void 0;const t=e(cloneDeep_1),r=e(compact_1$1),i=e(isPlainObject_1$1),a=require$$3$1;function o(e){return"ROOT_QUERY"===e||"ROOT_MUTATION"===e}n.isQuery=o,n.makeEntityId=function(e,t){return o(e)?(0,r.default)([e,t]).join("."):e};n.maybeDeepClone=e=>(0,i.default)(e)&&Object.isFrozen(e)?(0,t.default)(e):e,n.TypeOrFieldNameRegExp=/^[_a-z][_0-9a-z]*/i,n.fieldNameFromStoreName=function(e){var t=e.match(n.TypeOrFieldNameRegExp);return t?t[0]:e},n.generateFragmentFieldName=function({fragmentName:e}={}){return"-fragment-"+(null!=e?e:(0,a.v4)())}}(helpers),commonjsGlobal&&commonjsGlobal.__rest||function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n}),__importDefault$8=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(InvalidationPolicyManager$1,"__esModule",{value:!0});const isNumber_1=__importDefault$8(isNumber_1$1),types_1$2=types,helpers_1$6=helpers,core_1$4=require$$0$2,types_2=types;class InvalidationPolicyManager{constructor(e){this.config=e,this.policyActionStorage={};const{readField:t,evict:n,modify:r}=this.config["cacheOperations"];this.mutedCacheOperations={readField:t,evict:e=>n(Object.assign(Object.assign({},e),{broadcast:!1})),modify:e=>r(Object.assign(Object.assign({},e),{broadcast:!1}))},this.activePolicyEvents=this.activateInitialPolicyEvents()}activateInitialPolicyEvents(){var e=this.config["policies"];const{types:n={},timeToLive:t}=e;return Object.keys(n).reduce((e,t)=>{t=n[t];return e[types_1$2.InvalidationPolicyEvent.Read]=e[types_1$2.InvalidationPolicyEvent.Read]||!!t.timeToLive,e[types_1$2.InvalidationPolicyEvent.Write]=e[types_1$2.InvalidationPolicyEvent.Write]||!!t[types_1$2.InvalidationPolicyLifecycleEvent.Write],e[types_1$2.InvalidationPolicyEvent.Evict]=e[types_1$2.InvalidationPolicyEvent.Evict]||!!t[types_1$2.InvalidationPolicyLifecycleEvent.Evict],e},{[types_1$2.InvalidationPolicyEvent.Read]:!!t,[types_1$2.InvalidationPolicyEvent.Write]:!1,[types_1$2.InvalidationPolicyEvent.Evict]:!1})}getPolicy(e){var t;return(null==(t=null==(t=this.config.policies)?void 0:t.types)?void 0:t[e])||null}getPolicyActionStorage(e){return this.policyActionStorage[e]||(this.policyActionStorage[e]={}),this.policyActionStorage[e]}getTypePolicyForEvent(e,t){e=this.getPolicy(e);return e?e[types_1$2.InvalidationPolicyLifecycleEvent[t]]:null}runPolicyEvent(n,r,a){const o=this.config["entityTypeMap"],s=this["mutedCacheOperations"],c=this.getTypePolicyForEvent(n,r);if(c){let e,t={};var i;"object"==typeof c?(r=c["__default"],i=__rest$1(c,["__default"]),e=r,t=i):e=c,e&&e(s,Object.assign({storage:this.getPolicyActionStorage(n+"__default")},a)),Object.keys(t).forEach(e=>{var t=null!=(t=o.readEntitiesByType(e))?t:{};const i=c[e];Object.values(t).forEach(e=>{const{dataId:t,fieldName:n,storeFieldNames:r}=e;r?Object.keys(r.entries).forEach(e=>{i(s,Object.assign({id:t,fieldName:n,storeFieldName:e,variables:r.entries[e].variables,args:r.entries[e].args,ref:(0,core_1$4.makeReference)(t),storage:this.getPolicyActionStorage(e)},a))}):i(s,Object.assign({id:t,storage:this.getPolicyActionStorage(t),ref:(0,core_1$4.makeReference)(t)},a))})})}}getRenewalPolicyForType(e){var t,n=this.config["policies"];return null!=(t=null!=(e=null==(t=null==(t=n.types)?void 0:t[e])?void 0:t.renewalPolicy)?e:n.renewalPolicy)?t:types_2.RenewalPolicy.WriteOnly}runWritePolicy(e,t){return this.runPolicyEvent(e,types_1$2.InvalidationPolicyEvent.Write,t)}runEvictPolicy(e,t){return this.runPolicyEvent(e,types_1$2.InvalidationPolicyEvent.Evict,t)}runReadPolicy({typename:e,dataId:t,fieldName:n,storeFieldName:r,reportOnly:i=!1}){var{cacheOperations:a,entityTypeMap:o,policies:s}=this.config,n=(0,helpers_1$6.makeEntityId)(t,n),o=o.readEntityById(n);if(!o)return!1;let c;if(r&&o.storeFieldNames){n=o.storeFieldNames.entries[r];if(!n)return!1;c=n.cacheTime}else c=o.cacheTime;o=(null==(n=this.getPolicy(e))?void 0:n.timeToLive)||s.timeToLive;return!!((0,isNumber_1.default)(c)&&o&&Date.now()>c+o)&&(i||a.evict({id:t,fieldName:r,broadcast:!1}),!0)}activatePolicies(...e){e.forEach(e=>this.activePolicyEvents[e]=!0)}deactivatePolicies(...e){e.forEach(e=>this.activePolicyEvents[e]=!1)}isPolicyEventActive(e){return this.activePolicyEvents[e]}}InvalidationPolicyManager$1.default=InvalidationPolicyManager;var entityStore={},EntityStoreWatcher$1={},utils$2={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.collectionEntityIdForType=t.cacheExtensionsCollectionTypename=void 0,t.cacheExtensionsCollectionTypename="CacheExtensionsCollectionEntity",t.collectionEntityIdForType=function(e){return t.cacheExtensionsCollectionTypename+":"+e}}(utils$2),Object.defineProperty(EntityStoreWatcher$1,"__esModule",{value:!0});const helpers_1$5=helpers,utils_1$5=utils$2;class EntityStoreWatcher{constructor(e){this.config=e,this.delete=(e,t,n)=>{var{entityStore:r,entityTypeMap:i,policies:a}=this.config,r=this.storeFunctions.delete.call(r,e,t,n),o=i.readEntityById((0,helpers_1$5.makeEntityId)(e,t)),a=t&&n?a.getStoreFieldName({typename:o?o.typename:void 0,fieldName:t,args:n}):void 0;return i.evict(e,a||t),r},this.merge=(n,r)=>{const{entityStore:e,entityTypeMap:i}=this.config;var t;return(0,helpers_1$5.isQuery)(n)?Object.keys(r).filter(e=>"__typename"!==e).forEach(e=>{var t=r[e],t=null==t?void 0:t.__typename;t?i.write(t,n,e):(t=this.config.policies.rootTypenamesById[n],i.write(t,n,e))}):(t=r.__typename,n&&t&&t!==utils_1$5.cacheExtensionsCollectionTypename&&(this.config.updateCollectionField(t,n),i.write(t,n))),this.storeFunctions.merge.call(e,n,r)},this.clear=()=>{var{config:{entityStore:e,entityTypeMap:t},storeFunctions:n}=this;t.clear(),n.clear.call(e)},this.replace=e=>{var{config:{entityStore:t,entityTypeMap:n,reactiveVarsCache:r},storeFunctions:{replace:i}}=this,a=null==e?void 0:e.invalidation;e&&a?(delete e.invalidation,n.restore(a.entitiesById),this.pause(),i.call(t,e),r.reset(),this.watch()):(i.call(t,e),r.reset())};var{clear:e,delete:t,merge:n,replace:r}=this.config["entityStore"];this.storeFunctions={clear:e,delete:t,merge:n,replace:r},this.watch()}watch(){var e=this.config["entityStore"];e.clear=this.clear,e.delete=this.delete,e.merge=this.merge,e.replace=this.replace}pause(){var e=this.config["entityStore"],{clear:t,delete:n,merge:r,replace:i}=this.storeFunctions;e.clear=t,e.delete=n,e.merge=r,e.replace=i}}EntityStoreWatcher$1.default=EntityStoreWatcher;var EntityTypeMap$1={},baseSet=_baseSet;function set(e,t,n){return null==e?e:baseSet(e,t,n)}var set_1$1=set,__importDefault$7=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(EntityTypeMap$1,"__esModule",{value:!0});const set_1=__importDefault$7(set_1$1),helpers_1$4=helpers;class EntityTypeMap{constructor(){this.entitiesByType={},this.entitiesById={}}write(t,n,r,i,a){var o=r?(0,helpers_1$4.fieldNameFromStoreName)(r):void 0,s=(0,helpers_1$4.makeEntityId)(n,o),e=this.readEntityById(s);if(e)(0,helpers_1$4.isQuery)(n)&&r&&((c=e.storeFieldNames.entries[r])?(c.variables=i,c.args=a):(e.storeFieldNames.entries[r]={variables:i,args:a},e.storeFieldNames.__size++));else{let e;var c=Date.now();e=(0,helpers_1$4.isQuery)(n)&&r?{dataId:n,typename:t,fieldName:o,storeFieldNames:{__size:1,entries:{[r]:{variables:i,args:a,cacheTime:c}}}}:{dataId:n,typename:t,cacheTime:c},(0,set_1.default)(this.entitiesByType,[t,s],e),this.entitiesById[s]=e}}evict(e,t){var n=t?(0,helpers_1$4.fieldNameFromStoreName)(t):null,e=(0,helpers_1$4.makeEntityId)(e,n),r=this.readEntityById(e);r&&(t&&n!==t?(n=null==(n=this.entitiesByType[r.typename][e])?void 0:n.storeFieldNames)&&(1===n.__size?(delete this.entitiesByType[r.typename][e],delete this.entitiesById[e]):(n.__size--,delete n.entries[t])):(delete this.entitiesByType[r.typename][e],delete this.entitiesById[e]))}readEntitiesByType(e){return this.entitiesByType[e]||null}readEntityById(e){return this.entitiesById[e]||null}renewEntity(e,t){var n,r=t?(0,helpers_1$4.fieldNameFromStoreName)(t):void 0,r=this.entitiesById[(0,helpers_1$4.makeEntityId)(e,r)];r&&(n=Date.now(),(0,helpers_1$4.isQuery)(e)&&t?(e=r.storeFieldNames.entries[t])&&(e.cacheTime=n):r.cacheTime=n)}restore(n){this.entitiesById=n,Object.keys(n).forEach(e=>{var t=n[e];this.entitiesByType[t.typename]||(this.entitiesByType[t.typename]={}),this.entitiesByType[t.typename][e]=t})}extract(){var{entitiesById:e,entitiesByType:t}=this;return{entitiesById:e,entitiesByType:t}}clear(){this.entitiesById={},this.entitiesByType={}}}EntityTypeMap$1.default=EntityTypeMap,function(e){var t=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=(Object.defineProperty(e,"__esModule",{value:!0}),e.EntityTypeMap=e.EntityStoreWatcher=void 0,EntityStoreWatcher$1),r=(Object.defineProperty(e,"EntityStoreWatcher",{enumerable:!0,get:function(){return t(n).default}}),EntityTypeMap$1);Object.defineProperty(e,"EntityTypeMap",{enumerable:!0,get:function(){return t(r).default}})}(entityStore);var ReadResultStatus,CacheResultProcessor$1={},require$$3=getAugmentedNamespace(utilities),__importDefault$6=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(CacheResultProcessor$1,"__esModule",{value:!0}),CacheResultProcessor$1.CacheResultProcessor=CacheResultProcessor$1.ReadResultStatus=void 0;const core_1$3=require$$0$2,isPlainObject_1=__importDefault$6(isPlainObject_1$1),isArray_1=__importDefault$6(isArray_1$1),utilities_1=require$$3,helpers_1$3=helpers,types_1$1=types;!function(e){e[e.Evicted=0]="Evicted",e[e.Incomplete=1]="Incomplete",e[e.Complete=2]="Complete"}(ReadResultStatus||(CacheResultProcessor$1.ReadResultStatus=ReadResultStatus={}));class CacheResultProcessor{constructor(e){this.config=e}getFieldsForQuery(e){var t=(0,utilities_1.getOperationDefinition)(e.query);const n=(0,utilities_1.createFragmentMap)((0,utilities_1.getFragmentDefinitions)(e.query));return t.selectionSet.selections.reduce((e,t)=>{return(0,utilities_1.isField)(t)?e.push(t):(t=null==(t=null==(t=(0,utilities_1.getFragmentFromSelection)(t,n))?void 0:t.selectionSet)?void 0:t.selections)&&e.push(...t),e},[])}processReadSubResult(e,t){var{cache:n,invalidationPolicyManager:r,entityTypeMap:i}=this.config;const a=null==t?e:e[t];if((0,isPlainObject_1.default)(a)){var o=a["__typename"],s=Object.keys(a).reduce((e,t)=>this.processReadSubResult(a,t)===ReadResultStatus.Complete,!0);if(o){n=n.identify(a);if(n){var c=r.getRenewalPolicyForType(o),c=(c!==types_1$1.RenewalPolicy.AccessAndWrite&&c!==types_1$1.RenewalPolicy.AccessOnly||i.renewEntity(n),r.runReadPolicy({typename:o,dataId:n}));if(c)return(0,isPlainObject_1.default)(e)&&t&&delete e[t],ReadResultStatus.Evicted}}return s?ReadResultStatus.Complete:ReadResultStatus.Incomplete}if((0,isArray_1.default)(a)){let n=ReadResultStatus.Complete;const l=a.map((e,t)=>{t=this.processReadSubResult(a,t);return t<n&&(n=t),t});return n===ReadResultStatus.Evicted&&t&&(e[t]=a.filter((e,t)=>l[t]!==ReadResultStatus.Evicted)),n===ReadResultStatus.Complete?ReadResultStatus.Complete:ReadResultStatus.Incomplete}return ReadResultStatus.Complete}processReadResult(c,e){const{cache:l,entityTypeMap:u,invalidationPolicyManager:p}=this.config,{rootId:d="ROOT_QUERY"}=e;if((0,isPlainObject_1.default)(c)){if((0,helpers_1$3.isQuery)(d)){const y=e["variables"];e=this.getFieldsForQuery(e).reduce((e,t)=>{var n=t.name.value,r=(0,utilities_1.resultKeyNameFromField)(t),i=this.processReadSubResult(c,r),a=null==(a=u.readEntityById((0,helpers_1$3.makeEntityId)(d,n)))?void 0:a.typename;if(a){var o=l.policies.getStoreFieldName({typename:a,fieldName:n,field:t,variables:y}),s=l.policies.rootTypenamesById[d],s=l.policies.getStoreFieldName({typename:s,fieldName:n,field:t,variables:y}),t=p.getRenewalPolicyForType(a),t=(t!==types_1$1.RenewalPolicy.AccessAndWrite&&t!==types_1$1.RenewalPolicy.AccessOnly||(u.renewEntity(d,o),u.renewEntity(d,s)),p.runReadPolicy({typename:a,dataId:d,fieldName:n,storeFieldName:o})),o=p.runReadPolicy({typename:a,dataId:d,fieldName:n,storeFieldName:s});if(t||o)return delete c[r],!1}return e&&i===ReadResultStatus.Complete},!0);return(0,utilities_1.maybeDeepFreeze)(c),e?ReadResultStatus.Complete:ReadResultStatus.Incomplete}return(0,utilities_1.maybeDeepFreeze)(c),this.processReadSubResult(c)}return ReadResultStatus.Complete}processWriteSubResult(t){var e,n,{cache:r,invalidationPolicyManager:i,entityTypeMap:a}=this.config;(0,isPlainObject_1.default)(t)?(e=t["__typename"],Object.keys(t).forEach(e=>this.processWriteSubResult(t[e])),e&&(r=r.identify(t))&&((n=i.getRenewalPolicyForType(e))!==types_1$1.RenewalPolicy.WriteOnly&&n!==types_1$1.RenewalPolicy.AccessAndWrite||a.renewEntity(r),i.runWritePolicy(e,{parent:{id:r,ref:(0,core_1$3.makeReference)(r)}}))):(0,isArray_1.default)(t)&&t.forEach(e=>this.processWriteSubResult(e))}processWriteResult(e){var t;const{dataId:s,variables:c,result:n}=e,{entityTypeMap:l,cache:u,invalidationPolicyManager:p}=this.config;(0,isPlainObject_1.default)(n)&&this.processWriteSubResult(n),s&&(0,helpers_1$3.isQuery)(s)&&(0,isPlainObject_1.default)(n)?this.getFieldsForQuery(e).forEach(e=>{var t,n,r,i,a=e.name.value,o=null==(o=l.readEntityById((0,helpers_1$3.makeEntityId)(s,a)))?void 0:o.typename;o&&(t=u.policies.getStoreFieldName({typename:o,field:e,fieldName:a,variables:c}),n=(0,utilities_1.argumentsObjectFromField)(e,c),r=null!==c&&void 0!==c?c:null!==n?{}:void 0,i=u.policies.rootTypenamesById[s],i=u.policies.getStoreFieldName({typename:i,fieldName:a,field:e,variables:c}),l.write(o,s,t,r,n),l.write(o,s,i,r,n),(e=p.getRenewalPolicyForType(o))!==types_1$1.RenewalPolicy.WriteOnly&&e!==types_1$1.RenewalPolicy.AccessAndWrite||(l.renewEntity(s,t),l.renewEntity(s,i)),p.runWritePolicy(o,{parent:{id:s,fieldName:a,storeFieldName:t,ref:(0,core_1$3.makeReference)(s),variables:r,args:n}}))}):s&&(e=null==(e=l.readEntityById((0,helpers_1$3.makeEntityId)(s)))?void 0:e.typename)&&((t=p.getRenewalPolicyForType(e))!==types_1$1.RenewalPolicy.WriteOnly&&t!==types_1$1.RenewalPolicy.AccessAndWrite||l.renewEntity(s),p.runWritePolicy(e,{parent:{id:s,ref:(0,core_1$3.makeReference)(s),variables:c}}))}}CacheResultProcessor$1.CacheResultProcessor=CacheResultProcessor;var __rest=commonjsGlobal&&commonjsGlobal.__rest||function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n},__importDefault$5=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(InvalidationPolicyCache$1,"__esModule",{value:!0});const core_1$2=require$$0$2,compact_1=__importDefault$5(compact_1$1),every_1=__importDefault$5(every_1$1),pick_1=__importDefault$5(pick_1$1),take_1=__importDefault$5(take_1$1),isNil_1=__importDefault$5(isNil_1$1),isFunction_1$1=__importDefault$5(isFunction_1$2),orderBy_1=__importDefault$5(orderBy_1$1),InvalidationPolicyManager_1$1=__importDefault$5(InvalidationPolicyManager$1),entity_store_1$1=entityStore,helpers_1$2=helpers,CacheResultProcessor_1$1=CacheResultProcessor$1,types_1=types,utils_1$4=utils$2,ReactiveVarsCache_1=ReactiveVarsCache;class InvalidationPolicyCache extends core_1$2.InMemoryCache{constructor(e={}){var{invalidationPolicies:t={},enableCollections:n=!1}=e;super(__rest(e,["invalidationPolicies","enableCollections"])),this.pendingCollectionUpdates={},this.enableCollections=n,this.invalidationPolicies=t,this.isBroadcasting=!1,this.isInitialized=!0,this.reactiveVarsCache=(0,ReactiveVarsCache_1.initReactiveVarsCache)(this),this.reinitialize()}reinitialize(){this.entityStoreRoot=this.data,this.entityTypeMap=new entity_store_1$1.EntityTypeMap,this.entityStoreWatcher=new entity_store_1$1.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new InvalidationPolicyManager_1$1.default({policies:this.invalidationPolicies,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:(...e)=>this.evict(...e),modify:(...e)=>this.modify(...e),readField:(...e)=>this.readField(...e)}}),this.cacheResultProcessor=new CacheResultProcessor_1$1.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this}),this.reactiveVarsCache.reset()}init(){super.init(),this.isInitialized&&this.reinitialize()}readField(e,t){if(e)return void 0===(t="string"==typeof e?{fieldName:e,from:t}:e).from&&(t.from={__ref:"ROOT_QUERY"}),this.policies.readField(t,{store:this.entityStoreRoot})}broadcastWatches(e){this.isBroadcasting=!0,super.broadcastWatches(e),this.isBroadcasting=!1}get _hasPendingCollectionUpdates(){return 0<Object.keys(this.pendingCollectionUpdates).length}isOperatingOnRootData(){return this.data===this.entityStoreRoot}modify(e){var t=super.modify(e);if(!this.invalidationPolicyManager.isPolicyEventActive(types_1.InvalidationPolicyEvent.Write)||!t)return t;const{id:r="ROOT_QUERY",fields:n}=e;if((0,helpers_1$2.isQuery)(r))Object.keys(n).forEach(e=>{var t=(0,helpers_1$2.fieldNameFromStoreName)(e),n=null==(n=this.entityTypeMap.readEntityById((0,helpers_1$2.makeEntityId)(r,t)))?void 0:n.typename;n&&this.invalidationPolicyManager.runWritePolicy(n,{parent:{id:r,fieldName:t,storeFieldName:e,ref:(0,core_1$2.makeReference)(r)}})});else{var i=null==(i=this.entityTypeMap.readEntityById(r))?void 0:i.typename;if(!i)return t;this.invalidationPolicyManager.runWritePolicy(i,{parent:{id:r,ref:(0,core_1$2.makeReference)(r)}})}return e.broadcast&&this.broadcastWatches(),t}write(e){var t=super.write(e);return(this.invalidationPolicyManager.isPolicyEventActive(types_1.InvalidationPolicyEvent.Write)||this.invalidationPolicyManager.isPolicyEventActive(types_1.InvalidationPolicyEvent.Read))&&this.isOperatingOnRootData()&&(this.cacheResultProcessor.processWriteResult(e),e.broadcast)&&this.broadcastWatches(),t}evictWhere(e){var{__typename:e,filter:t}=e,e=this.readReferenceWhere({__typename:e,filter:t});return e.forEach(e=>this.evict({id:e.__ref,broadcast:!1})),this.broadcastWatches(),e}evict(e){var t,n,{fieldName:r,args:i}=e;let a=e["id"];if(!a){if(Object.prototype.hasOwnProperty.call(e,"id"))return!1;a="ROOT_QUERY"}return this.invalidationPolicyManager.isPolicyEventActive(types_1.InvalidationPolicyEvent.Evict)&&(t=(null!=(t=this.entityTypeMap.readEntityById((0,helpers_1$2.makeEntityId)(a,r)))?t:{})["typename"],t)&&(n=(0,helpers_1$2.isQuery)(a)&&r?this.policies.getStoreFieldName({typename:t,fieldName:r,args:i}):void 0,this.invalidationPolicyManager.runEvictPolicy(t,{parent:{id:a,fieldName:r,storeFieldName:n,variables:i,ref:(0,core_1$2.makeReference)(a)}})),super.evict(e)}_updatePendingCollection(e){const a=this.pendingCollectionUpdates[e];a&&(this.modify({broadcast:!1,id:e,fields:{data:(e,{canRead:t})=>{let r=!1;const n=e.reduce((e,t)=>{var n=t["__ref"];return!r&&e[n]&&(r=!0),e[n]=t,e},{});var i=Object.values(a).filter(e=>!n[e.__ref]&&t(e));return r||0!==i.length?[...Object.values(n),...i]:e}}}),delete this.pendingCollectionUpdates[e])}_updatePendingCollections(){this._hasPendingCollectionUpdates&&(Object.keys(this.pendingCollectionUpdates).forEach(e=>{this._updatePendingCollection(e)}),this.broadcastWatches())}updateCollectionField(e,t){var n;this.enableCollections&&(n=(0,utils_1$4.collectionEntityIdForType)(e),this.readField("id",(0,core_1$2.makeReference)(n))||this.writeFragment({id:n,fragment:(0,core_1$2.gql)`
          fragment InitializeCollectionEntity on CacheExtensionsCollectionEntity {
            data
            id
          }
        `,data:{__typename:utils_1$4.cacheExtensionsCollectionTypename,id:e,data:[]}}),this.entityTypeMap.readEntityById(t)||(this._hasPendingCollectionUpdates||setTimeout(()=>this._updatePendingCollections(),0),this.pendingCollectionUpdates[n]||(this.pendingCollectionUpdates[n]={}),this.pendingCollectionUpdates[n][t])||(this.pendingCollectionUpdates[n][t]=(0,core_1$2.makeReference)(t)))}_expire(a=!1){const o=this.entityTypeMap.extract()["entitiesById"],s=[];return Object.keys(o).forEach(e=>{const{storeFieldNames:t,dataId:n,fieldName:r,typename:i}=o[e];(0,helpers_1$2.isQuery)(n)&&t?Object.keys(t.entries).forEach(e=>{this.invalidationPolicyManager.runReadPolicy({typename:i,dataId:n,fieldName:r,storeFieldName:e,reportOnly:a})&&s.push((0,helpers_1$2.makeEntityId)(n,e))}):this.invalidationPolicyManager.runReadPolicy({typename:i,dataId:n,fieldName:r,reportOnly:a})&&s.push((0,helpers_1$2.makeEntityId)(n))}),0<s.length&&this.broadcastWatches(),s}expire(){return this._expire(!1)}expiredEntities(){return this._expire(!0)}activatePolicyEvents(...e){0<e.length?this.invalidationPolicyManager.activatePolicies(...e):this.invalidationPolicyManager.activatePolicies(types_1.InvalidationPolicyEvent.Read,types_1.InvalidationPolicyEvent.Write,types_1.InvalidationPolicyEvent.Evict)}deactivatePolicyEvents(...e){0<e.length?this.invalidationPolicyManager.deactivatePolicies(...e):this.invalidationPolicyManager.deactivatePolicies(types_1.InvalidationPolicyEvent.Read,types_1.InvalidationPolicyEvent.Write,types_1.InvalidationPolicyEvent.Evict)}activePolicyEvents(){return[types_1.InvalidationPolicyEvent.Read,types_1.InvalidationPolicyEvent.Write,types_1.InvalidationPolicyEvent.Evict].filter(e=>this.invalidationPolicyManager.isPolicyEventActive(e))}read(e){var t,n=super.read(e);return!this.invalidationPolicyManager.isPolicyEventActive(types_1.InvalidationPolicyEvent.Read)||(t=(0,helpers_1$2.maybeDeepClone)(n),(e=this.cacheResultProcessor.processReadResult(t,e))===CacheResultProcessor_1$1.ReadResultStatus.Complete)?n:(this.broadcastWatches(),e===CacheResultProcessor_1$1.ReadResultStatus.Evicted?null:t)}diff(e){var t,n=super.diff(e);return this.invalidationPolicyManager.isPolicyEventActive(types_1.InvalidationPolicyEvent.Read)&&!this.isBroadcasting&&(t=n["result"],t=(0,helpers_1$2.maybeDeepClone)(t),(e=this.cacheResultProcessor.processReadResult(t,e))!==CacheResultProcessor_1$1.ReadResultStatus.Complete)&&(this.broadcastWatches(),n.complete=!1,n.result=e===CacheResultProcessor_1$1.ReadResultStatus.Evicted?void 0:t),n}extract(e=!1,t=!0){this._hasPendingCollectionUpdates&&this._updatePendingCollections();e=super.extract(e);return t&&(e.invalidation=(0,pick_1.default)(this.entityTypeMap.extract(),"entitiesById")),e}readFragmentWhere(e){const{fragment:t,filter:n,limit:r,orderBy:i}=e,a=__rest(e,["fragment","filter","limit","orderBy"]);e=t.definitions[0].typeCondition.name.value,e=this.readReferenceWhere({__typename:e,filter:n,limit:r,orderBy:i}).map(e=>this.readFragment(Object.assign(Object.assign({},a),{fragment:t,id:e.__ref})));return(0,compact_1.default)(e)}readReferenceWhere(e){const{__typename:t,filter:n,limit:r,orderBy:i}=e;e=(0,utils_1$4.collectionEntityIdForType)(t);this.pendingCollectionUpdates[e]&&this._updatePendingCollection(e);let a=this.readField("data",(0,core_1$2.makeReference)(e));if(!a)return[];const o=this.readField.bind(this);if(n&&(a=a.filter(t=>{var e;return(0,isFunction_1$1.default)(n)?n(t,o):(e=Object.keys(n).map(e=>{return n[e]===this.readField(e,t)}),(0,every_1.default)(e,Boolean))})),i){const{field:s,descending:c}=i;a=(0,orderBy_1.default)(a,e=>o(s,e),[c?"desc":"asc"])}return(0,isNil_1.default)(r)?a:(0,take_1.default)(a,r)}writeFragmentWhere(t){const n=t["update"],e=__rest(t,["update"]);this.readFragmentWhere(e).forEach(e=>{this.writeFragment({id:this.identify(e),fragment:t.fragment,data:n(e),broadcast:!1})}),this.broadcastWatches()}}InvalidationPolicyCache$1.default=InvalidationPolicyCache,function(e){var t=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=(Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidationPolicyCache=e.makeCachedVar=void 0,ReactiveVarsCache),r=(Object.defineProperty(e,"makeCachedVar",{enumerable:!0,get:function(){return n.makeCachedVar}}),InvalidationPolicyCache$1);Object.defineProperty(e,"InvalidationPolicyCache",{enumerable:!0,get:function(){return t(r).default}})}(cache);var OperationTypeNode,DirectiveLocation,Kind,TokenKind,TypeKind,BreakingChangeType,DangerousChangeType,client={},ApolloExtensionsClient$1={},utils$1={};const version="16.11.0",versionInfo=Object.freeze({major:16,minor:11,patch:0,preReleaseTag:null});function devAssert(e,t){if(!Boolean(e))throw new Error(t)}function isPromise(e){return"function"==typeof(null==e?void 0:e.then)}function isObjectLike(e){return"object"==typeof e&&null!==e}function invariant(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}const LineRegExp=/\r\n|[\n\r]/g;function getLocation(e,t){let n=0,r=1;for(const i of e.body.matchAll(LineRegExp)){if("number"!=typeof i.index&&invariant(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function printLocation(e){return printSourceLocation(e.source,getLocation(e.source,e.start))}function printSourceLocation(e,t){var n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,a=t.line+a,n=1===t.line?n:0,t=t.column+n,n=e.name+`:${a}:${t}
`,e=r.split(/\r\n|[\n\r]/g),o=e[i];if(120<o.length){var r=Math.floor(t/80),s=t%80,c=[];for(let e=0;e<o.length;e+=80)c.push(o.slice(e,e+80));return n+printPrefixedLines([[a+" |",c[0]],...c.slice(1,r+1).map(e=>["|",e]),["|","^".padStart(s)],["|",c[r+1]]])}return n+printPrefixedLines([[a-1+" |",e[i-1]],[a+" |",o],["|","^".padStart(t)],[a+1+" |",e[1+i]]])}function printPrefixedLines(e){e=e.filter(([,e])=>void 0!==e);const n=Math.max(...e.map(([e])=>e.length));return e.map(([e,t])=>e.padStart(n)+(t?" "+t:"")).join("\n")}function toNormalizedOptions(e){var t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class GraphQLError extends Error{constructor(e,...t){const{nodes:n,source:r,positions:i,path:a,originalError:o,extensions:s}=toNormalizedOptions(t);super(e),this.name="GraphQLError",this.path=null!=a?a:void 0,this.originalError=null!=o?o:void 0,this.nodes=undefinedIfEmpty(Array.isArray(n)?n:n?[n]:void 0);var e=undefinedIfEmpty(null==(t=this.nodes)?void 0:t.map(e=>e.loc).filter(e=>null!=e)),t=(this.source=null!==r&&void 0!==r?r:null==e||null==(t=e[0])?void 0:t.source,this.positions=null!=i?i:null==e?void 0:e.map(e=>e.start),this.locations=i&&r?i.map(e=>getLocation(r,e)):null==e?void 0:e.map(e=>getLocation(e.source,e.start)),!isObjectLike(null==o?void 0:o.extensions)||null==o?void 0:o.extensions);this.extensions=null!=(e=null!=s?s:t)?e:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=o&&o.stack?Object.defineProperty(this,"stack",{value:o.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+printLocation(t.loc));else if(this.source&&this.locations)for(const n of this.locations)e+="\n\n"+printSourceLocation(this.source,n);return e}toJSON(){var e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&0<Object.keys(this.extensions).length&&(e.extensions=this.extensions),e}}function undefinedIfEmpty(e){return void 0===e||0===e.length?void 0:e}function printError(e){return e.toString()}function formatError(e){return e.toJSON()}function syntaxError(e,t,n){return new GraphQLError("Syntax Error: "+n,{source:e,positions:[t]})}class Location{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Token{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}}}const QueryDocumentKeys={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["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:["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"]},kindValues=new Set(Object.keys(QueryDocumentKeys));function isNode(e){e=null==e?void 0:e.kind;return"string"==typeof e&&kindValues.has(e)}function isWhiteSpace(e){return 9===e||32===e}function isDigit$1(e){return 48<=e&&e<=57}function isLetter(e){return 97<=e&&e<=122||65<=e&&e<=90}function isNameStart(e){return isLetter(e)||95===e}function isNameContinue(e){return isLetter(e)||isDigit$1(e)||95===e}function dedentBlockStringLines(t){var e;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let e=0;e<t.length;++e){var a=t[e],o=leadingWhitespace(a);o!==a.length&&(r=null!=(a=r)?a:e,0!==(i=e)&&o<n)&&(n=o)}return t.map((e,t)=>0===t?e:e.slice(n)).slice(null!=(e=r)?e:0,i+1)}function leadingWhitespace(e){let t=0;for(;t<e.length&&isWhiteSpace(e.charCodeAt(t));)++t;return t}function isPrintableAsBlockString(t){if(""===t)return!0;let n=!0,r=!1,i=!0,a=!1;for(let e=0;e<t.length;++e)switch(t.codePointAt(e)){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:case 13:return!1;case 10:if(n&&!a)return!1;a=!0,n=!0,r=!1;break;case 9:case 32:r=r||n;break;default:i=i&&r,n=!1}return!(n||i&&a)}function printBlockString(e,t){var n=e.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=1===r.length,r=1<r.length&&r.slice(1).every(e=>0===e.length||isWhiteSpace(e.charCodeAt(0))),a=n.endsWith('\\"""'),o=e.endsWith('"')&&!a,s=e.endsWith("\\"),o=o||s,s=!(null!=t&&t.minimize)&&(!i||70<e.length||o||r||a);let c="";t=i&&isWhiteSpace(e.charCodeAt(0));return(s&&!t||r)&&(c+="\n"),c+=n,(s||o)&&(c+="\n"),'"""'+c+'"""'}!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(OperationTypeNode=OperationTypeNode||{}),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"}(DirectiveLocation=DirectiveLocation||{}),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"}(Kind=Kind||{}),function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",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"}(TokenKind=TokenKind||{});class Lexer{constructor(e){var t=new Token(TokenKind.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!==TokenKind.EOF)do{var t;e=e.next||(t=readNextToken(this,e.end),(e.next=t).prev=e,t)}while(e.kind===TokenKind.COMMENT);return e}}function isPunctuatorTokenKind(e){return e===TokenKind.BANG||e===TokenKind.DOLLAR||e===TokenKind.AMP||e===TokenKind.PAREN_L||e===TokenKind.PAREN_R||e===TokenKind.SPREAD||e===TokenKind.COLON||e===TokenKind.EQUALS||e===TokenKind.AT||e===TokenKind.BRACKET_L||e===TokenKind.BRACKET_R||e===TokenKind.BRACE_L||e===TokenKind.PIPE||e===TokenKind.BRACE_R}function isUnicodeScalarValue(e){return 0<=e&&e<=55295||57344<=e&&e<=1114111}function isSupplementaryCodePoint(e,t){return isLeadingSurrogate(e.charCodeAt(t))&&isTrailingSurrogate(e.charCodeAt(t+1))}function isLeadingSurrogate(e){return 55296<=e&&e<=56319}function isTrailingSurrogate(e){return 56320<=e&&e<=57343}function printCodePointAt(e,t){e=e.source.body.codePointAt(t);return void 0===e?TokenKind.EOF:32<=e&&e<=126?'"'===(t=String.fromCodePoint(e))?"'\"'":`"${t}"`:"U+"+e.toString(16).toUpperCase().padStart(4,"0")}function createToken(e,t,n,r,i){var a=e.line,e=1+n-e.lineStart;return new Token(t,n,r,a,e,i)}function readNextToken(e,t){var n=e.source.body,r=n.length;let i=t;for(;i<r;){var a=n.charCodeAt(i);switch(a){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===n.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return readComment(e,i);case 33:return createToken(e,TokenKind.BANG,i,i+1);case 36:return createToken(e,TokenKind.DOLLAR,i,i+1);case 38:return createToken(e,TokenKind.AMP,i,i+1);case 40:return createToken(e,TokenKind.PAREN_L,i,i+1);case 41:return createToken(e,TokenKind.PAREN_R,i,i+1);case 46:if(46===n.charCodeAt(i+1)&&46===n.charCodeAt(i+2))return createToken(e,TokenKind.SPREAD,i,i+3);break;case 58:return createToken(e,TokenKind.COLON,i,i+1);case 61:return createToken(e,TokenKind.EQUALS,i,i+1);case 64:return createToken(e,TokenKind.AT,i,i+1);case 91:return createToken(e,TokenKind.BRACKET_L,i,i+1);case 93:return createToken(e,TokenKind.BRACKET_R,i,i+1);case 123:return createToken(e,TokenKind.BRACE_L,i,i+1);case 124:return createToken(e,TokenKind.PIPE,i,i+1);case 125:return createToken(e,TokenKind.BRACE_R,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?readBlockString(e,i):readString(e,i)}if(isDigit$1(a)||45===a)return readNumber(e,i,a);if(isNameStart(a))return readName(e,i);throw syntaxError(e.source,i,39===a?"Unexpected single quote character ('), did you mean to use a double quote (\")?":isUnicodeScalarValue(a)||isSupplementaryCodePoint(n,i)?`Unexpected character: ${printCodePointAt(e,i)}.`:`Invalid character: ${printCodePointAt(e,i)}.`)}return createToken(e,TokenKind.EOF,r,r)}function readComment(e,t){var n=e.source.body,r=n.length;let i=t+1;for(;i<r;){var a=n.charCodeAt(i);if(10===a||13===a)break;if(isUnicodeScalarValue(a))++i;else{if(!isSupplementaryCodePoint(n,i))break;i+=2}}return createToken(e,TokenKind.COMMENT,t,i,n.slice(t+1,i))}function readNumber(e,t,n){var r=e.source.body;let i=t,a=n,o=!1;if(48===(a=45===a?r.charCodeAt(++i):a)){if(isDigit$1(a=r.charCodeAt(++i)))throw syntaxError(e.source,i,`Invalid number, unexpected digit after 0: ${printCodePointAt(e,i)}.`)}else i=readDigits(e,i,a),a=r.charCodeAt(i);if(46===a&&(o=!0,a=r.charCodeAt(++i),i=readDigits(e,i,a),a=r.charCodeAt(i)),69!==a&&101!==a||(o=!0,43!==(a=r.charCodeAt(++i))&&45!==a||(a=r.charCodeAt(++i)),i=readDigits(e,i,a),a=r.charCodeAt(i)),46===a||isNameStart(a))throw syntaxError(e.source,i,`Invalid number, expected digit but got: ${printCodePointAt(e,i)}.`);return createToken(e,o?TokenKind.FLOAT:TokenKind.INT,t,i,r.slice(t,i))}function readDigits(e,t,n){if(!isDigit$1(n))throw syntaxError(e.source,t,`Invalid number, expected digit but got: ${printCodePointAt(e,t)}.`);var r=e.source.body;let i=t+1;for(;isDigit$1(r.charCodeAt(i));)++i;return i}function readString(e,t){var n=e.source.body,r=n.length;let i=t+1,a=i,o="";for(;i<r;){var s=n.charCodeAt(i);if(34===s)return o+=n.slice(a,i),createToken(e,TokenKind.STRING,t,i+1,o);if(92===s){o+=n.slice(a,i);var c=(117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?readEscapedUnicodeVariableWidth:readEscapedUnicodeFixedWidth:readEscapedCharacter)(e,i);o+=c.value,i+=c.size,a=i}else{if(10===s||13===s)break;if(isUnicodeScalarValue(s))++i;else{if(!isSupplementaryCodePoint(n,i))throw syntaxError(e.source,i,`Invalid character within String: ${printCodePointAt(e,i)}.`);i+=2}}}throw syntaxError(e.source,i,"Unterminated string.")}function readEscapedUnicodeVariableWidth(e,t){var n=e.source.body;let r=0,i=3;for(;i<12;){var a=n.charCodeAt(t+i++);if(125===a){if(i<5||!isUnicodeScalarValue(r))break;return{value:String.fromCodePoint(r),size:i}}if((r=r<<4|readHexDigit(a))<0)break}throw syntaxError(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function readEscapedUnicodeFixedWidth(e,t){var n=e.source.body,r=read16BitHexCode(n,t+2);if(isUnicodeScalarValue(r))return{value:String.fromCodePoint(r),size:6};if(isLeadingSurrogate(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){var i=read16BitHexCode(n,t+8);if(isTrailingSurrogate(i))return{value:String.fromCodePoint(r,i),size:12}}throw syntaxError(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function read16BitHexCode(e,t){return readHexDigit(e.charCodeAt(t))<<12|readHexDigit(e.charCodeAt(t+1))<<8|readHexDigit(e.charCodeAt(t+2))<<4|readHexDigit(e.charCodeAt(t+3))}function readHexDigit(e){return 48<=e&&e<=57?e-48:65<=e&&e<=70?e-55:97<=e&&e<=102?e-87:-1}function readEscapedCharacter(e,t){var n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw syntaxError(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function readBlockString(e,t){var n=e.source.body,r=n.length;let i=e.lineStart,a=t+3,o=a,s="";for(var c=[];a<r;){var l,u=n.charCodeAt(a);if(34===u&&34===n.charCodeAt(a+1)&&34===n.charCodeAt(a+2))return s+=n.slice(o,a),c.push(s),l=createToken(e,TokenKind.BLOCK_STRING,t,a+3,dedentBlockStringLines(c).join("\n")),e.line+=c.length-1,e.lineStart=i,l;if(92===u&&34===n.charCodeAt(a+1)&&34===n.charCodeAt(a+2)&&34===n.charCodeAt(a+3))s+=n.slice(o,a),o=a+1,a+=4;else if(10===u||13===u)s+=n.slice(o,a),c.push(s),13===u&&10===n.charCodeAt(a+1)?a+=2:++a,s="",o=a,i=a;else if(isUnicodeScalarValue(u))++a;else{if(!isSupplementaryCodePoint(n,a))throw syntaxError(e.source,a,`Invalid character within String: ${printCodePointAt(e,a)}.`);a+=2}}throw syntaxError(e.source,a,"Unterminated string.")}function readName(e,t){var n=e.source.body,r=n.length;let i=t+1;for(;i<r;){if(!isNameContinue(n.charCodeAt(i)))break;++i}return createToken(e,TokenKind.NAME,t,i,n.slice(t,i))}const MAX_ARRAY_LENGTH=10,MAX_RECURSIVE_DEPTH=2;function inspect(e){return formatValue(e,[])}function formatValue(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return formatObjectValue(e,t);default:return String(e)}}function formatObjectValue(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";t=[...t,e];if(isJSONable(e)){var n=e.toJSON();if(n!==e)return"string"==typeof n?n:formatValue(n,t)}else if(Array.isArray(e))return formatArray(e,t);return formatObject(e,t)}function isJSONable(e){return"function"==typeof e.toJSON}function formatObject(e,n){var t=Object.entries(e);return 0===t.length?"{}":n.length>MAX_RECURSIVE_DEPTH?"["+getObjectTag(e)+"]":"{ "+t.map(([e,t])=>e+": "+formatValue(t,n)).join(", ")+" }"}function formatArray(t,n){if(0===t.length)return"[]";if(n.length>MAX_RECURSIVE_DEPTH)return"[Array]";var r=Math.min(MAX_ARRAY_LENGTH,t.length),e=t.length-r,i=[];for(let e=0;e<r;++e)i.push(formatValue(t[e],n));return 1==e?i.push("... 1 more item"):1<e&&i.push(`... ${e} more items`),"["+i.join(", ")+"]"}function getObjectTag(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){e=e.constructor.name;if("string"==typeof e&&""!==e)return e}return t}const isProduction=globalThis.process&&"production"===process.env.NODE_ENV,instanceOf=isProduction?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var n,t=t.prototype[Symbol.toStringTag];if(t===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null==(n=e.constructor)?void 0:n.name))throw n=inspect(e),new Error(`Cannot use ${t} "${n}" from another module or realm.

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

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

Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.`)}return!1};class Source{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"!=typeof e&&devAssert(!1,`Body must be a string. Received: ${inspect(e)}.`),this.body=e,this.name=t,this.locationOffset=n,0<this.locationOffset.line||devAssert(!1,"line in locationOffset is 1-indexed and must be positive."),0<this.locationOffset.column||devAssert(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function isSource(e){return instanceOf(e,Source)}function parse$1(e,t){e=new Parser(e,t),t=e.parseDocument();return Object.defineProperty(t,"tokenCount",{enumerable:!1,value:e.tokenCount}),t}function parseValue(e,t){e=new Parser(e,t),e.expectToken(TokenKind.SOF),t=e.parseValueLiteral(!1);return e.expectToken(TokenKind.EOF),t}function parseConstValue(e,t){e=new Parser(e,t),e.expectToken(TokenKind.SOF),t=e.parseConstValueLiteral();return e.expectToken(TokenKind.EOF),t}function parseType(e,t){e=new Parser(e,t),e.expectToken(TokenKind.SOF),t=e.parseTypeReference();return e.expectToken(TokenKind.EOF),t}class Parser{constructor(e,t={}){e=isSource(e)?e:new Source(e);this._lexer=new Lexer(e),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){var e=this.expectToken(TokenKind.NAME);return this.node(e,{kind:Kind.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Kind.DOCUMENT,definitions:this.many(TokenKind.SOF,this.parseDefinition,TokenKind.EOF)})}parseDefinition(){if(this.peek(TokenKind.BRACE_L))return this.parseOperationDefinition();var e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===TokenKind.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()}if(e)throw syntaxError(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){var e=this._lexer.token;if(this.peek(TokenKind.BRACE_L))return this.node(e,{kind:Kind.OPERATION_DEFINITION,operation:OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});var t=this.parseOperationType();let n;return this.peek(TokenKind.NAME)&&(n=this.parseName()),this.node(e,{kind:Kind.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){var e=this.expectToken(TokenKind.NAME);switch(e.value){case"query":return OperationTypeNode.QUERY;case"mutation":return OperationTypeNode.MUTATION;case"subscription":return OperationTypeNode.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(TokenKind.PAREN_L,this.parseVariableDefinition,TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){var e=this._lexer.token;return this.expectToken(TokenKind.DOLLAR),this.node(e,{kind:Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Kind.SELECTION_SET,selections:this.many(TokenKind.BRACE_L,this.parseSelection,TokenKind.BRACE_R)})}parseSelection(){return this.peek(TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){var e=this._lexer.token,t=this.parseName();let n,r;return r=this.expectOptionalToken(TokenKind.COLON)?(n=t,this.parseName()):t,this.node(e,{kind:Kind.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){e=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(TokenKind.PAREN_L,e,TokenKind.PAREN_R)}parseArgument(e=!1){var t=this._lexer.token,n=this.parseName();return this.expectToken(TokenKind.COLON),this.node(t,{kind:Kind.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){var e=this._lexer.token,t=(this.expectToken(TokenKind.SPREAD),this.expectOptionalKeyword("on"));return!t&&this.peek(TokenKind.NAME)?this.node(e,{kind:Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:Kind.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){var e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){var t,n=this._lexer.token;switch(n.kind){case TokenKind.BRACKET_L:return this.parseList(e);case TokenKind.BRACE_L:return this.parseObject(e);case TokenKind.INT:return this.advanceLexer(),this.node(n,{kind:Kind.INT,value:n.value});case TokenKind.FLOAT:return this.advanceLexer(),this.node(n,{kind:Kind.FLOAT,value:n.value});case TokenKind.STRING:case TokenKind.BLOCK_STRING:return this.parseStringLiteral();case TokenKind.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:Kind.BOOLEAN,value:!0});case"false":return this.node(n,{kind:Kind.BOOLEAN,value:!1});case"null":return this.node(n,{kind:Kind.NULL});default:return this.node(n,{kind:Kind.ENUM,value:n.value})}case TokenKind.DOLLAR:if(e)throw this.expectToken(TokenKind.DOLLAR),this._lexer.token.kind===TokenKind.NAME?(t=this._lexer.token.value,syntaxError(this._lexer.source,n.start,`Unexpected variable "$${t}" in constant value.`)):this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){var e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:Kind.STRING,value:e.value,block:e.kind===TokenKind.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:Kind.LIST,values:this.any(TokenKind.BRACKET_L,()=>this.parseValueLiteral(e),TokenKind.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:Kind.OBJECT,fields:this.any(TokenKind.BRACE_L,()=>this.parseObjectField(e),TokenKind.BRACE_R)})}parseObjectField(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(TokenKind.COLON),this.node(t,{kind:Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){for(var t=[];this.peek(TokenKind.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){var t=this._lexer.token;return this.expectToken(TokenKind.AT),this.node(t,{kind:Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){var e,t=this._lexer.token;let n;return n=this.expectOptionalToken(TokenKind.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(TokenKind.BRACKET_R),this.node(t,{kind:Kind.LIST_TYPE,type:e})):this.parseNamedType(),this.expectOptionalToken(TokenKind.BANG)?this.node(t,{kind:Kind.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(TokenKind.STRING)||this.peek(TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=(this.expectKeyword("schema"),this.parseConstDirectives()),r=this.many(TokenKind.BRACE_L,this.parseOperationTypeDefinition,TokenKind.BRACE_R);return this.node(e,{kind:Kind.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){var e=this._lexer.token,t=this.parseOperationType(),n=(this.expectToken(TokenKind.COLON),this.parseNamedType());return this.node(e,{kind:Kind.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=(this.expectKeyword("scalar"),this.parseName()),r=this.parseConstDirectives();return this.node(e,{kind:Kind.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=(this.expectKeyword("type"),this.parseName()),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:Kind.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(TokenKind.BRACE_L,this.parseFieldDefinition,TokenKind.BRACE_R)}parseFieldDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs(),i=(this.expectToken(TokenKind.COLON),this.parseTypeReference()),a=this.parseConstDirectives();return this.node(e,{kind:Kind.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(TokenKind.PAREN_L,this.parseInputValueDef,TokenKind.PAREN_R)}parseInputValueDef(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=(this.expectToken(TokenKind.COLON),this.parseTypeReference());let i;this.expectOptionalToken(TokenKind.EQUALS)&&(i=this.parseConstValueLiteral());var a=this.parseConstDirectives();return this.node(e,{kind:Kind.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:a})}parseInterfaceTypeDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=(this.expectKeyword("interface"),this.parseName()),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:Kind.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=(this.expectKeyword("union"),this.parseName()),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:Kind.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(TokenKind.EQUALS)?this.delimitedMany(TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=(this.expectKeyword("enum"),this.parseName()),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:Kind.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(TokenKind.BRACE_L,this.parseEnumValueDefinition,TokenKind.BRACE_R)}parseEnumValueDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:Kind.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw syntaxError(this._lexer.source,this._lexer.token.start,getTokenDesc(this._lexer.token)+" is reserved and cannot be used for an enum value.");return this.parseName()}parseInputObjectTypeDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=(this.expectKeyword("input"),this.parseName()),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(TokenKind.BRACE_L,this.parseInputValueDef,TokenKind.BRACE_R)}parseTypeSystemExtension(){var e=this._lexer.lookahead();if(e.kind===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)}parseSchemaExtension(){var e=this._lexer.token,t=(this.expectKeyword("extend"),this.expectKeyword("schema"),this.parseConstDirectives()),n=this.optionalMany(TokenKind.BRACE_L,this.parseOperationTypeDefinition,TokenKind.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:Kind.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){var e=this._lexer.token,t=(this.expectKeyword("extend"),this.expectKeyword("scalar"),this.parseName()),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:Kind.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){var e=this._lexer.token,t=(this.expectKeyword("extend"),this.expectKeyword("type"),this.parseName()),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){var e=this._lexer.token,t=(this.expectKeyword("extend"),this.expectKeyword("interface"),this.parseName()),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Kind.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){var e=this._lexer.token,t=(this.expectKeyword("extend"),this.expectKeyword("union"),this.parseName()),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Kind.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){var e=this._lexer.token,t=(this.expectKeyword("extend"),this.expectKeyword("enum"),this.parseName()),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Kind.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){var e=this._lexer.token,t=(this.expectKeyword("extend"),this.expectKeyword("input"),this.parseName()),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){var e=this._lexer.token,t=this.parseDescription(),n=(this.expectKeyword("directive"),this.expectToken(TokenKind.AT),this.parseName()),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable"),a=(this.expectKeyword("on"),this.parseDirectiveLocations());return this.node(e,{kind:Kind.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:a})}parseDirectiveLocations(){return this.delimitedMany(TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){var e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(DirectiveLocation,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){var t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw syntaxError(this._lexer.source,t.start,`Expected ${getTokenKindDesc(e)}, found ${getTokenDesc(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){var t=this._lexer.token;if(t.kind!==TokenKind.NAME||t.value!==e)throw syntaxError(this._lexer.source,t.start,`Expected "${e}", found ${getTokenDesc(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){var t=this._lexer.token;return t.kind===TokenKind.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){e=null!=e?e:this._lexer.token;return syntaxError(this._lexer.source,e.start,`Unexpected ${getTokenDesc(e)}.`)}any(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){for(var r=[];r.push(t.call(this)),!this.expectOptionalToken(n););return r}return[]}many(e,t,n){this.expectToken(e);for(var r=[];r.push(t.call(this)),!this.expectOptionalToken(n););return r}delimitedMany(e,t){this.expectOptionalToken(e);for(var n=[];n.push(t.call(this)),this.expectOptionalToken(e););return n}advanceLexer(){var e=this._options["maxTokens"],t=this._lexer.advance();if(t.kind!==TokenKind.EOF&&(++this._tokenCounter,void 0!==e)&&this._tokenCounter>e)throw syntaxError(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function getTokenDesc(e){var t=e.value;return getTokenKindDesc(e.kind)+(null!=t?` "${t}"`:"")}function getTokenKindDesc(e){return isPunctuatorTokenKind(e)?`"${e}"`:e}const MAX_SUGGESTIONS=5;function didYouMean(e,t){var[t,e]=t?[e,t]:[void 0,e];let n=" Did you mean ";t&&(n+=t+" ");var r=e.map(e=>`"${e}"`);switch(r.length){case 0:return"";case 1:return n+r[0]+"?";case 2:return n+r[0]+" or "+r[1]+"?"}t=r.slice(0,MAX_SUGGESTIONS),e=t.pop();return n+t.join(", ")+", or "+e+"?"}function identityFunc(e){return e}function keyMap(e,t){var n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function keyValMap(e,t,n){var r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function mapValue(e,t){var n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function naturalCompare(i,a){let o=0,s=0;for(;o<i.length&&s<a.length;){let n=i.charCodeAt(o),r=a.charCodeAt(s);if(isDigit(n)&&isDigit(r)){let e=0;for(;++o,e=10*e+n-DIGIT_0,isDigit(n=i.charCodeAt(o))&&0<e;);let t=0;for(;++s,t=10*t+r-DIGIT_0,isDigit(r=a.charCodeAt(s))&&0<t;);if(e<t)return-1;if(e>t)return 1}else{if(n<r)return-1;if(n>r)return 1;++o,++s}}return i.length-a.length}const DIGIT_0=48,DIGIT_9=57;function isDigit(e){return!isNaN(e)&&DIGIT_0<=e&&e<=DIGIT_9}function suggestionList(e,t){const r=Object.create(null);var n=new LexicalDistance(e),i=Math.floor(.4*e.length)+1;for(const o of t){var a=n.measure(o,i);void 0!==a&&(r[o]=a)}return Object.keys(r).sort((e,t)=>{var n=r[e]-r[t];return 0!=n?n:naturalCompare(e,t)})}class LexicalDistance{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=stringToArray(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;var e=e.toLowerCase();if(this._inputLowerCase===e)return 1;let i=stringToArray(e),a=this._inputArray;i.length<a.length&&(e=i,i=a,a=e);var n=i.length,o=a.length;if(!(t<n-o)){var s=this._rows;for(let e=0;e<=o;e++)s[0][e]=e;for(let r=1;r<=n;r++){var c=s[(r-1)%3],l=s[r%3];let n=l[0]=r;for(let t=1;t<=o;t++){var u=i[r-1]===a[t-1]?0:1;let e=Math.min(c[t]+1,l[t-1]+1,c[t-1]+u);1<r&&1<t&&i[r-1]===a[t-2]&&i[r-2]===a[t-1]&&(u=s[(r-2)%3][t-2],e=Math.min(e,u+1)),e<n&&(n=e),l[t]=e}if(n>t)return}e=s[n%3][o];return e<=t?e:void 0}}}function stringToArray(t){var n=t.length,r=new Array(n);for(let e=0;e<n;++e)r[e]=t.charCodeAt(e);return r}function toObjMap(e){if(null==e)return Object.create(null);if(null===Object.getPrototypeOf(e))return e;var t,n,r=Object.create(null);for([t,n]of Object.entries(e))r[t]=n;return r}function printString(e){return`"${e.replace(escapedRegExp,escapedReplacer)}"`}const escapedRegExp=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function escapedReplacer(e){return escapeSequences[e.charCodeAt(0)]}const escapeSequences=["\\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"],BREAK=Object.freeze({});function visit(e,t,n=QueryDocumentKeys){var r=new Map;for(const E of Object.values(Kind))r.set(E,getEnterLeaveForKind(t,E));let i=void 0,a=Array.isArray(e),o=[e],s=-1,c=[],l=e,u=void 0,p=void 0;var d=[],y=[];do{var f=++s===o.length,h=f&&0!==c.length;if(f){if(u=0===y.length?void 0:d[d.length-1],l=p,p=y.pop(),h)if(a){l=l.slice();let e=0;for(var[m,g]of c){m=m-e;null===g?(l.splice(m,1),e++):l[m]=g}}else{l={...l};for(var[v,T]of c)l[v]=T}s=i.index,o=i.keys,c=i.edits,a=i.inArray,i=i.prev}else if(p){if(u=a?s:o[s],null===(l=p[u])||void 0===l)continue;d.push(u)}let e;if(!Array.isArray(l)){isNode(l)||devAssert(!1,`Invalid AST Node: ${inspect(l)}.`);var _,b=f?null==(_=r.get(l.kind))?void 0:_.leave:null==(_=r.get(l.kind))?void 0:_.enter;if((e=null==b?void 0:b.call(t,l,u,p,d,y))===BREAK)break;if(!1===e){if(!f){d.pop();continue}}else if(void 0!==e&&(c.push([u,e]),!f)){if(!isNode(e)){d.pop();continue}l=e}}void 0===e&&h&&c.push([u,l]),f?d.pop():(i={inArray:a,index:s,keys:o,edits:c,prev:i},a=Array.isArray(l),o=a?l:null!=(b=n[l.kind])?b:[],s=-1,c=[],p&&y.push(p),p=l)}while(void 0!==i);return 0!==c.length?c[c.length-1][1]:e}function visitInParallel(i){const a=new Array(i.length).fill(null);var e=Object.create(null);for(const o of Object.values(Kind)){let t=!1;const s=new Array(i.length).fill(void 0),c=new Array(i.length).fill(void 0);for(let e=0;e<i.length;++e){var{enter:n,leave:r}=getEnterLeaveForKind(i[e],o);t=t||null!=n||null!=r,s[e]=n,c[e]=r}t&&(e[o]={enter(...t){var n=t[0];for(let e=0;e<i.length;e++)if(null===a[e]){var r=null==(r=s[e])?void 0:r.apply(i[e],t);if(!1===r)a[e]=n;else if(r===BREAK)a[e]=BREAK;else if(void 0!==r)return r}},leave(...t){var n=t[0];for(let e=0;e<i.length;e++)if(null===a[e]){var r=null==(r=c[e])?void 0:r.apply(i[e],t);if(r===BREAK)a[e]=BREAK;else if(void 0!==r&&!1!==r)return r}else a[e]===n&&(a[e]=null)}})}return e}function getEnterLeaveForKind(e,t){t=e[t];return"object"==typeof t?t:"function"==typeof t?{enter:t,leave:void 0}:{enter:e.enter,leave:e.leave}}function getVisitFn(e,t,n){var{enter:e,leave:t}=getEnterLeaveForKind(e,t);return n?t:e}function print(e){return visit(e,printDocASTReducer)}const MAX_LINE_LENGTH=80,printDocASTReducer={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>join(e.definitions,"\n\n")},OperationDefinition:{leave(e){var t=wrap("(",join(e.variableDefinitions,", "),")"),t=join([e.operation,join([e.name,t]),join(e.directives," ")]," ");return("query"===t?"":t+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+wrap(" = ",n)+wrap(" ",join(r," "))},SelectionSet:{leave:({selections:e})=>block(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){e=wrap("",e,": ")+t;let a=e+wrap("(",join(n,", "),")");return a.length>MAX_LINE_LENGTH&&(a=e+wrap("(\n",indent(join(n,"\n")),"\n)")),join([a,join(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+wrap(" ",join(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>join(["...",wrap("on ",e),join(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${wrap("(",join(n,", "),")")} `+`on ${t} `+wrap("",join(r," ")," ")+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>(t?printBlockString:printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+join(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+join(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+wrap("(",join(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>wrap("",e,"\n")+join(["schema",join(t," "),block(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>wrap("",e,"\n")+join(["scalar",t,join(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>wrap("",e,"\n")+join(["type",t,wrap("implements ",join(n," & ")),join(r," "),block(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>wrap("",e,"\n")+t+(hasMultilineItems(n)?wrap("(\n",indent(join(n,"\n")),"\n)"):wrap("(",join(n,", "),")"))+": "+r+wrap(" ",join(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>wrap("",e,"\n")+join([t+": "+n,wrap("= ",r),join(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>wrap("",e,"\n")+join(["interface",t,wrap("implements ",join(n," & ")),join(r," "),block(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>wrap("",e,"\n")+join(["union",t,join(n," "),wrap("= ",join(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>wrap("",e,"\n")+join(["enum",t,join(n," "),block(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>wrap("",e,"\n")+join([t,join(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>wrap("",e,"\n")+join(["input",t,join(n," "),block(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>wrap("",e,"\n")+"directive @"+t+(hasMultilineItems(n)?wrap("(\n",indent(join(n,"\n")),"\n)"):wrap("(",join(n,", "),")"))+(r?" repeatable":"")+" on "+join(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>join(["extend schema",join(e," "),block(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>join(["extend scalar",e,join(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>join(["extend type",e,wrap("implements ",join(t," & ")),join(n," "),block(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>join(["extend interface",e,wrap("implements ",join(t," & ")),join(n," "),block(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>join(["extend union",e,join(t," "),wrap("= ",join(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>join(["extend enum",e,join(t," "),block(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>join(["extend input",e,join(t," "),block(n)]," ")}};function join(e,t=""){return null!=(e=null==e?void 0:e.filter(e=>e).join(t))?e:""}function block(e){return wrap("{\n",indent(join(e,"\n")),"\n}")}function wrap(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function indent(e){return wrap("  ",e.replace(/\n/g,"\n  "))}function hasMultilineItems(e){return null!=(e=null==e?void 0:e.some(e=>e.includes("\n")))&&e}function valueFromASTUntyped(e,t){switch(e.kind){case Kind.NULL:return null;case Kind.INT:return parseInt(e.value,10);case Kind.FLOAT:return parseFloat(e.value);case Kind.STRING:case Kind.ENUM:case Kind.BOOLEAN:return e.value;case Kind.LIST:return e.values.map(e=>valueFromASTUntyped(e,t));case Kind.OBJECT:return keyValMap(e.fields,e=>e.name.value,e=>valueFromASTUntyped(e.value,t));case Kind.VARIABLE:return null==t?void 0:t[e.name.value]}}function assertName(t){if(null==t&&devAssert(!1,"Must provide name."),"string"!=typeof t&&devAssert(!1,"Expected name to be a string."),0===t.length)throw new GraphQLError("Expected name to be a non-empty string.");for(let e=1;e<t.length;++e)if(!isNameContinue(t.charCodeAt(e)))throw new GraphQLError(`Names must only contain [_a-zA-Z0-9] but "${t}" does not.`);if(isNameStart(t.charCodeAt(0)))return t;throw new GraphQLError(`Names must start with [_a-zA-Z] but "${t}" does not.`)}function assertEnumValueName(e){if("true"===e||"false"===e||"null"===e)throw new GraphQLError("Enum values cannot be named: "+e);return assertName(e)}function isType(e){return isScalarType(e)||isObjectType(e)||isInterfaceType(e)||isUnionType(e)||isEnumType(e)||isInputObjectType(e)||isListType(e)||isNonNullType(e)}function assertType(e){if(isType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL type.`)}function isScalarType(e){return instanceOf(e,GraphQLScalarType)}function assertScalarType(e){if(isScalarType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL Scalar type.`)}function isObjectType(e){return instanceOf(e,GraphQLObjectType)}function assertObjectType(e){if(isObjectType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL Object type.`)}function isInterfaceType(e){return instanceOf(e,GraphQLInterfaceType)}function assertInterfaceType(e){if(isInterfaceType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL Interface type.`)}function isUnionType(e){return instanceOf(e,GraphQLUnionType)}function assertUnionType(e){if(isUnionType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL Union type.`)}function isEnumType(e){return instanceOf(e,GraphQLEnumType)}function assertEnumType(e){if(isEnumType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL Enum type.`)}function isInputObjectType(e){return instanceOf(e,GraphQLInputObjectType)}function assertInputObjectType(e){if(isInputObjectType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL Input Object type.`)}function isListType(e){return instanceOf(e,GraphQLList)}function assertListType(e){if(isListType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL List type.`)}function isNonNullType(e){return instanceOf(e,GraphQLNonNull)}function assertNonNullType(e){if(isNonNullType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL Non-Null type.`)}function isInputType(e){return isScalarType(e)||isEnumType(e)||isInputObjectType(e)||isWrappingType(e)&&isInputType(e.ofType)}function assertInputType(e){if(isInputType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL input type.`)}function isOutputType(e){return isScalarType(e)||isObjectType(e)||isInterfaceType(e)||isUnionType(e)||isEnumType(e)||isWrappingType(e)&&isOutputType(e.ofType)}function assertOutputType(e){if(isOutputType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL output type.`)}function isLeafType(e){return isScalarType(e)||isEnumType(e)}function assertLeafType(e){if(isLeafType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL leaf type.`)}function isCompositeType(e){return isObjectType(e)||isInterfaceType(e)||isUnionType(e)}function assertCompositeType(e){if(isCompositeType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL composite type.`)}function isAbstractType(e){return isInterfaceType(e)||isUnionType(e)}function assertAbstractType(e){if(isAbstractType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL abstract type.`)}class GraphQLList{constructor(e){isType(e)||devAssert(!1,`Expected ${inspect(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class GraphQLNonNull{constructor(e){isNullableType(e)||devAssert(!1,`Expected ${inspect(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function isWrappingType(e){return isListType(e)||isNonNullType(e)}function assertWrappingType(e){if(isWrappingType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL wrapping type.`)}function isNullableType(e){return isType(e)&&!isNonNullType(e)}function assertNullableType(e){if(isNullableType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL nullable type.`)}function getNullableType(e){if(e)return isNonNullType(e)?e.ofType:e}function isNamedType(e){return isScalarType(e)||isObjectType(e)||isInterfaceType(e)||isUnionType(e)||isEnumType(e)||isInputObjectType(e)}function assertNamedType(e){if(isNamedType(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL named type.`)}function getNamedType(t){if(t){let e=t;for(;isWrappingType(e);)e=e.ofType;return e}}function resolveReadonlyArrayThunk(e){return"function"==typeof e?e():e}function resolveObjMapThunk(e){return"function"==typeof e?e():e}class GraphQLScalarType{constructor(e){var t;const n=null!=(t=e.parseValue)?t:identityFunc;this.name=assertName(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=null!=(t=e.serialize)?t:identityFunc,this.parseValue=n,this.parseLiteral=null!=(t=e.parseLiteral)?t:(e,t)=>n(valueFromASTUntyped(e,t)),this.extensions=toObjMap(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],null!=e.specifiedByURL&&"string"!=typeof e.specifiedByURL&&devAssert(!1,this.name+' must provide "specifiedByURL" as a string, '+`but got: ${inspect(e.specifiedByURL)}.`),null!=e.serialize&&"function"!=typeof e.serialize&&devAssert(!1,this.name+' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.'),!e.parseLiteral||"function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||devAssert(!1,this.name+' must provide both "parseValue" and "parseLiteral" functions.')}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(e){var t;this.name=assertName(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=toObjMap(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=()=>defineFieldMap(e),this._interfaces=()=>defineInterfaces(e),null!=e.isTypeOf&&"function"!=typeof e.isTypeOf&&devAssert(!1,this.name+' must provide "isTypeOf" as a function, '+`but got: ${inspect(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:fieldsToFieldsConfig(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function defineInterfaces(e){var t=resolveReadonlyArrayThunk(null!=(t=e.interfaces)?t:[]);return Array.isArray(t)||devAssert(!1,e.name+" interfaces must be an Array or a function which returns an Array."),t}function defineFieldMap(r){var e=resolveObjMapThunk(r.fields);return isPlainObj(e)||devAssert(!1,r.name+" fields must be an object with field names as keys or a function which returns such an object."),mapValue(e,(e,t)=>{isPlainObj(e)||devAssert(!1,r.name+`.${t} field config must be an object.`),null!=e.resolve&&"function"!=typeof e.resolve&&devAssert(!1,r.name+`.${t} field resolver must be a function if `+`provided, but got: ${inspect(e.resolve)}.`);var n=null!=(n=e.args)?n:{};return isPlainObj(n)||devAssert(!1,r.name+`.${t} args must be an object with argument names as keys.`),{name:assertName(t),description:e.description,type:e.type,args:defineArguments(n),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:toObjMap(e.extensions),astNode:e.astNode}})}function defineArguments(e){return Object.entries(e).map(([e,t])=>({name:assertName(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:toObjMap(t.extensions),astNode:t.astNode}))}function isPlainObj(e){return isObjectLike(e)&&!Array.isArray(e)}function fieldsToFieldsConfig(e){return mapValue(e,e=>({description:e.description,type:e.type,args:argsToArgsConfig(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function argsToArgsConfig(e){return keyValMap(e,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function isRequiredArgument(e){return isNonNullType(e.type)&&void 0===e.defaultValue}class GraphQLInterfaceType{constructor(e){var t;this.name=assertName(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=toObjMap(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=defineFieldMap.bind(void 0,e),this._interfaces=defineInterfaces.bind(void 0,e),null!=e.resolveType&&"function"!=typeof e.resolveType&&devAssert(!1,this.name+' must provide "resolveType" as a function, '+`but got: ${inspect(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:fieldsToFieldsConfig(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(e){var t;this.name=assertName(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=toObjMap(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._types=defineTypes.bind(void 0,e),null!=e.resolveType&&"function"!=typeof e.resolveType&&devAssert(!1,this.name+' must provide "resolveType" as a function, '+`but got: ${inspect(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function defineTypes(e){var t=resolveReadonlyArrayThunk(e.types);return Array.isArray(t)||devAssert(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}class GraphQLEnumType{constructor(e){var t;this.name=assertName(e.name),this.description=e.description,this.extensions=toObjMap(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._values="function"==typeof e.values?e.values:defineEnumValues(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=defineEnumValues(this.name,this._values())),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=keyMap(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));var t=this._valueLookup.get(e);if(void 0===t)throw new GraphQLError(`Enum "${this.name}" cannot represent value: `+inspect(e));return t.name}parseValue(e){if("string"!=typeof e)throw t=inspect(e),new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${t}.`+didYouMeanEnumValue(this,t));var t=this.getValue(e);if(null==t)throw new GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+didYouMeanEnumValue(this,e));return t.value}parseLiteral(e,t){if(e.kind!==Kind.ENUM)throw r=print(e),new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${r}.`+didYouMeanEnumValue(this,r),{nodes:e});var n,r=this.getValue(e.value);if(null==r)throw n=print(e),new GraphQLError(`Value "${n}" does not exist in "${this.name}" enum.`+didYouMeanEnumValue(this,n),{nodes:e});return r.value}toConfig(){var e=keyValMap(this.getValues(),e=>e.name,e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function didYouMeanEnumValue(e,t){return didYouMean("the enum value",suggestionList(t,e.getValues().map(e=>e.name)))}function defineEnumValues(n,e){return isPlainObj(e)||devAssert(!1,n+" values must be an object with value names as keys."),Object.entries(e).map(([e,t])=>(isPlainObj(t)||devAssert(!1,n+`.${e} must refer to an object with a "value" key `+`representing an internal value but got: ${inspect(t)}.`),{name:assertEnumValueName(e),description:t.description,value:void 0!==t.value?t.value:e,deprecationReason:t.deprecationReason,extensions:toObjMap(t.extensions),astNode:t.astNode}))}class GraphQLInputObjectType{constructor(e){var t;this.name=assertName(e.name),this.description=e.description,this.extensions=toObjMap(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this.isOneOf=null!=(t=e.isOneOf)&&t,this._fields=defineInputFieldMap.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){var e=mapValue(this.getFields(),e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function defineInputFieldMap(n){var e=resolveObjMapThunk(n.fields);return isPlainObj(e)||devAssert(!1,n.name+" fields must be an object with field names as keys or a function which returns such an object."),mapValue(e,(e,t)=>("resolve"in e&&devAssert(!1,n.name+`.${t} field has a resolve property, but Input Types cannot define resolvers.`),{name:assertName(t),description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:toObjMap(e.extensions),astNode:e.astNode}))}function isRequiredInputField(e){return isNonNullType(e.type)&&void 0===e.defaultValue}function isEqualType(e,t){return e===t||(isNonNullType(e)&&isNonNullType(t)||!(!isListType(e)||!isListType(t)))&&isEqualType(e.ofType,t.ofType)}function isTypeSubTypeOf(e,t,n){return t===n||(isNonNullType(n)?!!isNonNullType(t)&&isTypeSubTypeOf(e,t.ofType,n.ofType):isNonNullType(t)?isTypeSubTypeOf(e,t.ofType,n):isListType(n)?!!isListType(t)&&isTypeSubTypeOf(e,t.ofType,n.ofType):!isListType(t)&&isAbstractType(n)&&(isInterfaceType(t)||isObjectType(t))&&e.isSubType(n,t))}function doTypesOverlap(t,e,n){return e===n||(isAbstractType(e)?isAbstractType(n)?t.getPossibleTypes(e).some(e=>t.isSubType(n,e)):t.isSubType(e,n):!!isAbstractType(n)&&t.isSubType(n,e))}const GRAPHQL_MAX_INT=2147483647,GRAPHQL_MIN_INT=-2147483648,GraphQLInt=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){e=serializeObject(e);if("boolean"==typeof e)return e?1:0;let t=e;if("number"!=typeof(t="string"==typeof e&&""!==e?Number(e):t)||!Number.isInteger(t))throw new GraphQLError("Int cannot represent non-integer value: "+inspect(e));if(t>GRAPHQL_MAX_INT||t<GRAPHQL_MIN_INT)throw new GraphQLError("Int cannot represent non 32-bit signed integer value: "+inspect(e));return t},parseValue(e){if("number"!=typeof e||!Number.isInteger(e))throw new GraphQLError("Int cannot represent non-integer value: "+inspect(e));if(e>GRAPHQL_MAX_INT||e<GRAPHQL_MIN_INT)throw new GraphQLError("Int cannot represent non 32-bit signed integer value: "+e);return e},parseLiteral(e){if(e.kind!==Kind.INT)throw new GraphQLError("Int cannot represent non-integer value: "+print(e),{nodes:e});var t=parseInt(e.value,10);if(t>GRAPHQL_MAX_INT||t<GRAPHQL_MIN_INT)throw new GraphQLError("Int cannot represent non 32-bit signed integer value: "+e.value,{nodes:e});return t}}),GraphQLFloat=new GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){e=serializeObject(e);if("boolean"==typeof e)return e?1:0;let t=e;if("number"==typeof(t="string"==typeof e&&""!==e?Number(e):t)&&Number.isFinite(t))return t;throw new GraphQLError("Float cannot represent non numeric value: "+inspect(e))},parseValue(e){if("number"==typeof e&&Number.isFinite(e))return e;throw new GraphQLError("Float cannot represent non numeric value: "+inspect(e))},parseLiteral(e){if(e.kind!==Kind.FLOAT&&e.kind!==Kind.INT)throw new GraphQLError("Float cannot represent non numeric value: "+print(e),e);return parseFloat(e.value)}}),GraphQLString=new GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){var t=serializeObject(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new GraphQLError("String cannot represent value: "+inspect(e))},parseValue(e){if("string"!=typeof e)throw new GraphQLError("String cannot represent a non string value: "+inspect(e));return e},parseLiteral(e){if(e.kind!==Kind.STRING)throw new GraphQLError("String cannot represent a non string value: "+print(e),{nodes:e});return e.value}}),GraphQLBoolean=new GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){e=serializeObject(e);if("boolean"==typeof e)return e;if(Number.isFinite(e))return 0!==e;throw new GraphQLError("Boolean cannot represent a non boolean value: "+inspect(e))},parseValue(e){if("boolean"!=typeof e)throw new GraphQLError("Boolean cannot represent a non boolean value: "+inspect(e));return e},parseLiteral(e){if(e.kind!==Kind.BOOLEAN)throw new GraphQLError("Boolean cannot represent a non boolean value: "+print(e),{nodes:e});return e.value}}),GraphQLID=new GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){var t=serializeObject(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new GraphQLError("ID cannot represent value: "+inspect(e))},parseValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new GraphQLError("ID cannot represent value: "+inspect(e))},parseLiteral(e){if(e.kind!==Kind.STRING&&e.kind!==Kind.INT)throw new GraphQLError("ID cannot represent a non-string and non-integer value: "+print(e),{nodes:e});return e.value}}),specifiedScalarTypes=Object.freeze([GraphQLString,GraphQLInt,GraphQLFloat,GraphQLBoolean,GraphQLID]);function isSpecifiedScalarType(t){return specifiedScalarTypes.some(({name:e})=>t.name===e)}function serializeObject(e){if(isObjectLike(e)){if("function"==typeof e.valueOf){var t=e.valueOf();if(!isObjectLike(t))return t}if("function"==typeof e.toJSON)return e.toJSON()}return e}function isDirective(e){return instanceOf(e,GraphQLDirective)}function assertDirective(e){if(isDirective(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL directive.`)}class GraphQLDirective{constructor(e){this.name=assertName(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!=(t=e.isRepeatable)&&t,this.extensions=toObjMap(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||devAssert(!1,`@${e.name} locations must be an Array.`);var t=null!=(t=e.args)?t:{};isObjectLike(t)&&!Array.isArray(t)||devAssert(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=defineArguments(t)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:argsToArgsConfig(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const GraphQLIncludeDirective=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[DirectiveLocation.FIELD,DirectiveLocation.FRAGMENT_SPREAD,DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(GraphQLBoolean),description:"Included when true."}}}),GraphQLSkipDirective=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[DirectiveLocation.FIELD,DirectiveLocation.FRAGMENT_SPREAD,DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(GraphQLBoolean),description:"Skipped when true."}}}),DEFAULT_DEPRECATION_REASON="No longer supported",GraphQLDeprecatedDirective=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[DirectiveLocation.FIELD_DEFINITION,DirectiveLocation.ARGUMENT_DEFINITION,DirectiveLocation.INPUT_FIELD_DEFINITION,DirectiveLocation.ENUM_VALUE],args:{reason:{type:GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:DEFAULT_DEPRECATION_REASON}}}),GraphQLSpecifiedByDirective=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[DirectiveLocation.SCALAR],args:{url:{type:new GraphQLNonNull(GraphQLString),description:"The URL that specifies the behavior of this scalar."}}}),GraphQLOneOfDirective=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[DirectiveLocation.INPUT_OBJECT],args:{}}),specifiedDirectives=Object.freeze([GraphQLIncludeDirective,GraphQLSkipDirective,GraphQLDeprecatedDirective,GraphQLSpecifiedByDirective,GraphQLOneOfDirective]);function isSpecifiedDirective(t){return specifiedDirectives.some(({name:e})=>e===t.name)}function isIterableObject(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}function astFromValue(e,t){if(isNonNullType(t))return(null==(c=astFromValue(e,t.ofType))?void 0:c.kind)===Kind.NULL?null:c;if(null===e)return{kind:Kind.NULL};if(void 0===e)return null;if(isListType(t)){var n=t.ofType;if(isIterableObject(e)){var r=[];for(const l of e){var i=astFromValue(l,n);null!=i&&r.push(i)}return{kind:Kind.LIST,values:r}}return astFromValue(e,n)}if(isInputObjectType(t)){if(!isObjectLike(e))return null;var a=[];for(const u of Object.values(t.getFields())){var o=astFromValue(e[u.name],u.type);o&&a.push({kind:Kind.OBJECT_FIELD,name:{kind:Kind.NAME,value:u.name},value:o})}return{kind:Kind.OBJECT,fields:a}}if(isLeafType(t)){var s,c=t.serialize(e);if(null==c)return null;if("boolean"==typeof c)return{kind:Kind.BOOLEAN,value:c};if("number"==typeof c&&Number.isFinite(c))return s=String(c),integerStringRegExp.test(s)?{kind:Kind.INT,value:s}:{kind:Kind.FLOAT,value:s};if("string"==typeof c)return isEnumType(t)?{kind:Kind.ENUM,value:c}:t===GraphQLID&&integerStringRegExp.test(c)?{kind:Kind.INT,value:c}:{kind:Kind.STRING,value:c};throw new TypeError(`Cannot convert value to AST: ${inspect(c)}.`)}invariant(!1,"Unexpected input type: "+inspect(t))}const integerStringRegExp=/^-?(?:0|[1-9][0-9]*)$/,__Schema=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(__Type),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:__Type,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:__Type,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Directive))),resolve:e=>e.getDirectives()}})}),__Directive=new GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:e=>e.name},description:{type:GraphQLString,resolve:e=>e.description},isRepeatable:{type:new GraphQLNonNull(GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__DirectiveLocation))),resolve:e=>e.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(e=>null==e.deprecationReason)}}})}),__DirectiveLocation=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),__Type=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(__TypeKind),resolve(e){return isScalarType(e)?TypeKind.SCALAR:isObjectType(e)?TypeKind.OBJECT:isInterfaceType(e)?TypeKind.INTERFACE:isUnionType(e)?TypeKind.UNION:isEnumType(e)?TypeKind.ENUM:isInputObjectType(e)?TypeKind.INPUT_OBJECT:isListType(e)?TypeKind.LIST:isNonNullType(e)?TypeKind.NON_NULL:void invariant(!1,`Unexpected type: "${inspect(e)}".`)}},name:{type:GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(__Field)),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(isObjectType(e)||isInterfaceType(e))return e=Object.values(e.getFields()),t?e:e.filter(e=>null==e.deprecationReason)}},interfaces:{type:new GraphQLList(new GraphQLNonNull(__Type)),resolve(e){if(isObjectType(e)||isInterfaceType(e))return e.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(__Type)),resolve(e,t,n,{schema:r}){if(isAbstractType(e))return r.getPossibleTypes(e)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(__EnumValue)),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(isEnumType(e))return e=e.getValues(),t?e:e.filter(e=>null==e.deprecationReason)}},inputFields:{type:new GraphQLList(new GraphQLNonNull(__InputValue)),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(isInputObjectType(e))return e=Object.values(e.getFields()),t?e:e.filter(e=>null==e.deprecationReason)}},ofType:{type:__Type,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:GraphQLBoolean,resolve:e=>{if(isInputObjectType(e))return e.isOneOf}}})}),__Field=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:e=>e.name},description:{type:GraphQLString,resolve:e=>e.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(e=>null==e.deprecationReason)}},type:{type:new GraphQLNonNull(__Type),resolve:e=>e.type},isDeprecated:{type:new GraphQLNonNull(GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:GraphQLString,resolve:e=>e.deprecationReason}})}),__InputValue=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:e=>e.name},description:{type:GraphQLString,resolve:e=>e.description},type:{type:new GraphQLNonNull(__Type),resolve:e=>e.type},defaultValue:{type:GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){var{type:e,defaultValue:t}=e,t=astFromValue(t,e);return t?print(t):null}},isDeprecated:{type:new GraphQLNonNull(GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:GraphQLString,resolve:e=>e.deprecationReason}})}),__EnumValue=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:e=>e.name},description:{type:GraphQLString,resolve:e=>e.description},isDeprecated:{type:new GraphQLNonNull(GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:GraphQLString,resolve:e=>e.deprecationReason}})}),__TypeKind=(!function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"}(TypeKind=TypeKind||{}),new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:TypeKind.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:TypeKind.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:TypeKind.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:TypeKind.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:TypeKind.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:TypeKind.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:TypeKind.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:TypeKind.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}})),SchemaMetaFieldDef={name:"__schema",type:new GraphQLNonNull(__Schema),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},TypeMetaFieldDef={name:"__type",type:__Type,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new GraphQLNonNull(GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},TypeNameMetaFieldDef={name:"__typename",type:new GraphQLNonNull(GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},introspectionTypes=Object.freeze([__Schema,__Directive,__DirectiveLocation,__Type,__Field,__InputValue,__EnumValue,__TypeKind]);function isIntrospectionType(t){return introspectionTypes.some(({name:e})=>t.name===e)}function isSchema(e){return instanceOf(e,GraphQLSchema)}function assertSchema(e){if(isSchema(e))return e;throw new Error(`Expected ${inspect(e)} to be a GraphQL schema.`)}class GraphQLSchema{constructor(e){this.__validationErrors=!0===e.assumeValid?[]:void 0,isObjectLike(e)||devAssert(!1,"Must provide configuration object."),e.types&&!Array.isArray(e.types)&&devAssert(!1,`"types" must be Array if provided but got: ${inspect(e.types)}.`),e.directives&&!Array.isArray(e.directives)&&devAssert(!1,'"directives" must be Array if provided but got: '+inspect(e.directives)+"."),this.description=e.description,this.extensions=toObjMap(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=null!=(t=e.directives)?t:specifiedDirectives;var t,n=new Set(e.types);if(null!=e.types)for(const i of e.types)n.delete(i),collectReferencedTypes(i,n);null!=this._queryType&&collectReferencedTypes(this._queryType,n),null!=this._mutationType&&collectReferencedTypes(this._mutationType,n),null!=this._subscriptionType&&collectReferencedTypes(this._subscriptionType,n);for(const a of this._directives)if(isDirective(a))for(const o of a.args)collectReferencedTypes(o.type,n);collectReferencedTypes(__Schema,n),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const s of n)if(null!=s){var r=s.name;if(r||devAssert(!1,"One of the provided types for building the Schema is missing a name."),void 0!==this._typeMap[r])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${r}".`);if(isInterfaceType(this._typeMap[r]=s)){for(const c of s.getInterfaces())if(isInterfaceType(c)){let e=this._implementationsMap[c.name];(e=void 0===e?this._implementationsMap[c.name]={objects:[],interfaces:[]}:e).interfaces.push(s)}}else if(isObjectType(s))for(const l of s.getInterfaces())if(isInterfaceType(l)){let e=this._implementationsMap[l.name];(e=void 0===e?this._implementationsMap[l.name]={objects:[],interfaces:[]}:e).objects.push(s)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case OperationTypeNode.QUERY:return this.getQueryType();case OperationTypeNode.MUTATION:return this.getMutationType();case OperationTypeNode.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return isUnionType(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){e=this._implementationsMap[e.name];return null!=e?e:{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap[e.name];if(void 0===n){if(n=Object.create(null),isUnionType(e))for(const i of e.getTypes())n[i.name]=!0;else{var r=this.getImplementations(e);for(const a of r.objects)n[a.name]=!0;for(const o of r.interfaces)n[o.name]=!0}this._subTypeMap[e.name]=n}return void 0!==n[t.name]}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(e=>e.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function collectReferencedTypes(e,t){e=getNamedType(e);if(!t.has(e))if(t.add(e),isUnionType(e))for(const n of e.getTypes())collectReferencedTypes(n,t);else if(isObjectType(e)||isInterfaceType(e)){for(const r of e.getInterfaces())collectReferencedTypes(r,t);for(const i of Object.values(e.getFields())){collectReferencedTypes(i.type,t);for(const a of i.args)collectReferencedTypes(a.type,t)}}else if(isInputObjectType(e))for(const o of Object.values(e.getFields()))collectReferencedTypes(o.type,t);return t}function validateSchema(e){var t;return assertSchema(e),e.__validationErrors||(validateRootTypes(t=new SchemaValidationContext(e)),validateDirectives(t),validateTypes(t),t=t.getErrors(),e.__validationErrors=t)}function assertValidSchema(e){e=validateSchema(e);if(0!==e.length)throw new Error(e.map(e=>e.message).join("\n\n"))}class SchemaValidationContext{constructor(e){this._errors=[],this.schema=e}reportError(e,t){t=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new GraphQLError(e,{nodes:t}))}getErrors(){return this._errors}}function validateRootTypes(e){var t=e.schema,n=t.getQueryType(),r=(n?isObjectType(n)||e.reportError(`Query root type must be Object type, it cannot be ${inspect(n)}.`,null!=(r=getOperationTypeNode(t,OperationTypeNode.QUERY))?r:n.astNode):e.reportError("Query root type must be provided.",t.astNode),t.getMutationType()),n=(r&&!isObjectType(r)&&e.reportError("Mutation root type must be Object type if provided, it cannot be "+inspect(r)+".",null!=(n=getOperationTypeNode(t,OperationTypeNode.MUTATION))?n:r.astNode),t.getSubscriptionType());n&&!isObjectType(n)&&e.reportError("Subscription root type must be Object type if provided, it cannot be "+inspect(n)+".",null!=(r=getOperationTypeNode(t,OperationTypeNode.SUBSCRIPTION))?r:n.astNode)}function getOperationTypeNode(e,t){return null==(e=[e.astNode,...e.extensionASTNodes].flatMap(e=>{return null!=(e=null==e?void 0:e.operationTypes)?e:[]}).find(e=>e.operation===t))?void 0:e.type}function validateDirectives(e){for(const n of e.schema.getDirectives())if(isDirective(n)){validateName(e,n),0===n.locations.length&&e.reportError(`Directive @${n.name} must include 1 or more locations.`,n.astNode);for(const r of n.args){var t;validateName(e,r),isInputType(r.type)||e.reportError(`The type of @${n.name}(${r.name}:) must be Input Type `+`but got: ${inspect(r.type)}.`,r.astNode),isRequiredArgument(r)&&null!=r.deprecationReason&&e.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[getDeprecatedDirectiveNode(r.astNode),null==(t=r.astNode)?void 0:t.type])}}else e.reportError(`Expected directive but got: ${inspect(n)}.`,null===n||void 0===n?void 0:n.astNode)}function validateName(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function validateTypes(e){var t=createInputObjectCircularRefsValidator(e),n=e.schema.getTypeMap();for(const r of Object.values(n))isNamedType(r)?(isIntrospectionType(r)||validateName(e,r),isObjectType(r)||isInterfaceType(r)?(validateFields(e,r),validateInterfaces(e,r)):isUnionType(r)?validateUnionMembers(e,r):isEnumType(r)?validateEnumValues(e,r):isInputObjectType(r)&&(validateInputFields(e,r),t(r))):e.reportError(`Expected GraphQL named type but got: ${inspect(r)}.`,r.astNode)}function validateFields(e,t){var n,r=Object.values(t.getFields());0===r.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const o of r){validateName(e,o),isOutputType(o.type)||e.reportError(`The type of ${t.name}.${o.name} must be Output Type `+`but got: ${inspect(o.type)}.`,null==(n=o.astNode)?void 0:n.type);for(const s of o.args){var i,a=s.name;validateName(e,s),isInputType(s.type)||e.reportError(`The type of ${t.name}.${o.name}(${a}:) must be Input `+`Type but got: ${inspect(s.type)}.`,null==(i=s.astNode)?void 0:i.type),isRequiredArgument(s)&&null!=s.deprecationReason&&e.reportError(`Required argument ${t.name}.${o.name}(${a}:) cannot be deprecated.`,[getDeprecatedDirectiveNode(s.astNode),null==(i=s.astNode)?void 0:i.type])}}}function validateInterfaces(e,t){var n=Object.create(null);for(const r of t.getInterfaces())isInterfaceType(r)?t===r?e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,getAllImplementsInterfaceNodes(t,r)):n[r.name]?e.reportError(`Type ${t.name} can only implement ${r.name} once.`,getAllImplementsInterfaceNodes(t,r)):(n[r.name]=!0,validateTypeImplementsAncestors(e,t,r),validateTypeImplementsInterface(e,t,r)):e.reportError(`Type ${inspect(t)} must only implement Interface types, `+`it cannot implement ${inspect(r)}.`,getAllImplementsInterfaceNodes(t,r))}function validateTypeImplementsInterface(e,t,n){var r=t.getFields();for(const l of Object.values(n.getFields())){var i,a=l.name,o=r[a];if(o){isTypeSubTypeOf(e.schema,o.type,l.type)||e.reportError(`Interface field ${n.name}.${a} expects type `+`${inspect(l.type)} but ${t.name}.${a} `+`is type ${inspect(o.type)}.`,[null==(i=l.astNode)?void 0:i.type,null==(i=o.astNode)?void 0:i.type]);for(const u of l.args){const p=u.name;var s,c=o.args.find(e=>e.name===p);c?isEqualType(u.type,c.type)||e.reportError(`Interface field argument ${n.name}.${a}(${p}:) `+`expects type ${inspect(u.type)} but `+`${t.name}.${a}(${p}:) is type `+inspect(c.type)+".",[null==(s=u.astNode)?void 0:s.type,null==(s=c.astNode)?void 0:s.type]):e.reportError(`Interface field argument ${n.name}.${a}(${p}:) expected but ${t.name}.${a} does not provide it.`,[u.astNode,o.astNode])}for(const d of o.args){const y=d.name;!l.args.find(e=>e.name===y)&&isRequiredArgument(d)&&e.reportError(`Object field ${t.name}.${a} includes required argument ${y} that is missing from the Interface field ${n.name}.${a}.`,[d.astNode,l.astNode])}}else e.reportError(`Interface field ${n.name}.${a} expected but ${t.name} does not provide it.`,[l.astNode,t.astNode,...t.extensionASTNodes])}}function validateTypeImplementsAncestors(e,t,n){var r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...getAllImplementsInterfaceNodes(n,i),...getAllImplementsInterfaceNodes(t,n)])}function validateUnionMembers(e,t){var n=t.getTypes(),r=(0===n.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]),Object.create(null));for(const i of n)r[i.name]?e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,getUnionMemberTypeNodes(t,i.name)):(r[i.name]=!0,isObjectType(i)||e.reportError(`Union type ${t.name} can only include Object types, `+`it cannot include ${inspect(i)}.`,getUnionMemberTypeNodes(t,String(i))))}function validateEnumValues(e,t){var n=t.getValues();0===n.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)validateName(e,r)}function validateInputFields(e,t){var n,r=Object.values(t.getFields());0===r.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const i of r)validateName(e,i),isInputType(i.type)||e.reportError(`The type of ${t.name}.${i.name} must be Input Type `+`but got: ${inspect(i.type)}.`,null==(n=i.astNode)?void 0:n.type),isRequiredInputField(i)&&null!=i.deprecationReason&&e.reportError(`Required input field ${t.name}.${i.name} cannot be deprecated.`,[getDeprecatedDirectiveNode(i.astNode),null==(n=i.astNode)?void 0:n.type]),t.isOneOf&&validateOneOfInputObjectField(t,i,e)}function validateOneOfInputObjectField(e,t,n){var r;isNonNullType(t.type)&&n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,null==(r=t.astNode)?void 0:r.type),void 0!==t.defaultValue&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}function createInputObjectCircularRefsValidator(c){const l=Object.create(null),u=[],p=Object.create(null);return function e(t){if(l[t.name])return;l[t.name]=!0;p[t.name]=u.length;const n=Object.values(t.getFields());for(const r of n)if(isNonNullType(r.type)&&isInputObjectType(r.type.ofType)){const i=r.type.ofType,a=p[i.name];if(u.push(r),void 0===a)e(i);else{const o=u.slice(a),s=o.map(e=>e.name).join(".");c.reportError(`Cannot reference Input Object "${i.name}" within itself through a series of non-null fields: "${s}".`,o.map(e=>e.astNode))}u.pop()}p[t.name]=void 0}}function getAllImplementsInterfaceNodes(e,t){var{astNode:e,extensionASTNodes:n}=e;return(null!=e?[e,...n]:n).flatMap(e=>{return null!=(e=e.interfaces)?e:[]}).filter(e=>e.name.value===t.name)}function getUnionMemberTypeNodes(e,t){var{astNode:e,extensionASTNodes:n}=e;return(null!=e?[e,...n]:n).flatMap(e=>{return null!=(e=e.types)?e:[]}).filter(e=>e.name.value===t)}function getDeprecatedDirectiveNode(e){return null==e||null==(e=e.directives)?void 0:e.find(e=>e.name.value===GraphQLDeprecatedDirective.name)}function typeFromAST(e,t){switch(t.kind){case Kind.LIST_TYPE:var n=typeFromAST(e,t.type);return n&&new GraphQLList(n);case Kind.NON_NULL_TYPE:n=typeFromAST(e,t.type);return n&&new GraphQLNonNull(n);case Kind.NAMED_TYPE:return e.getType(t.name.value)}}class TypeInfo{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=n?n:getFieldDef$1,t&&(isInputType(t)&&this._inputTypeStack.push(t),isCompositeType(t)&&this._parentTypeStack.push(t),isOutputType(t))&&this._typeStack.push(t)}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(0<this._typeStack.length)return this._typeStack[this._typeStack.length-1]}getParentType(){if(0<this._parentTypeStack.length)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(0<this._inputTypeStack.length)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(1<this._inputTypeStack.length)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(0<this._fieldDefStack.length)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(0<this._defaultValueStack.length)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(n){var r=this._schema;switch(n.kind){case Kind.SELECTION_SET:var i=getNamedType(this.getType());this._parentTypeStack.push(isCompositeType(i)?i:void 0);break;case Kind.FIELD:{var i=this.getParentType();let e,t;i&&(e=this._getFieldDef(r,i,n))&&(t=e.type),this._fieldDefStack.push(e),this._typeStack.push(isOutputType(t)?t:void 0);break}case Kind.DIRECTIVE:this._directive=r.getDirective(n.name.value);break;case Kind.OPERATION_DEFINITION:i=r.getRootType(n.operation);this._typeStack.push(isObjectType(i)?i:void 0);break;case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:i=n.typeCondition,i=i?typeFromAST(r,i):getNamedType(this.getType());this._typeStack.push(isOutputType(i)?i:void 0);break;case Kind.VARIABLE_DEFINITION:i=typeFromAST(r,n.type);this._inputTypeStack.push(isInputType(i)?i:void 0);break;case Kind.ARGUMENT:{let e,t;i=null!=(i=this.getDirective())?i:this.getFieldDef();i&&(e=i.args.find(e=>e.name===n.name.value))&&(t=e.type),this._argument=e,this._defaultValueStack.push(e?e.defaultValue:void 0),this._inputTypeStack.push(isInputType(t)?t:void 0);break}case Kind.LIST:i=getNullableType(this.getInputType()),i=isListType(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push(isInputType(i)?i:void 0);break;case Kind.OBJECT_FIELD:{i=getNamedType(this.getInputType());let e,t;isInputObjectType(i)&&(t=i.getFields()[n.name.value])&&(e=t.type),this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(isInputType(e)?e:void 0);break}case Kind.ENUM:{i=getNamedType(this.getInputType());let e;isEnumType(i)&&(e=i.getValue(n.value)),this._enumValue=e;break}}}leave(e){switch(e.kind){case Kind.SELECTION_SET:this._parentTypeStack.pop();break;case Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case Kind.DIRECTIVE:this._directive=null;break;case Kind.OPERATION_DEFINITION:case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Kind.LIST:case Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Kind.ENUM:this._enumValue=null}}}function getFieldDef$1(e,t,n){n=n.name.value;return n===SchemaMetaFieldDef.name&&e.getQueryType()===t?SchemaMetaFieldDef:n===TypeMetaFieldDef.name&&e.getQueryType()===t?TypeMetaFieldDef:n===TypeNameMetaFieldDef.name&&isCompositeType(t)?TypeNameMetaFieldDef:isObjectType(t)||isInterfaceType(t)?t.getFields()[n]:void 0}function visitWithTypeInfo(i,a){return{enter(...e){var t=e[0],n=(i.enter(t),getEnterLeaveForKind(a,t.kind).enter);if(n)return void 0!==(n=n.apply(a,e))&&(i.leave(t),isNode(n))&&i.enter(n),n},leave(...e){var t=e[0],n=getEnterLeaveForKind(a,t.kind).leave;let r;return n&&(r=n.apply(a,e)),i.leave(t),r}}}function isDefinitionNode(e){return isExecutableDefinitionNode(e)||isTypeSystemDefinitionNode(e)||isTypeSystemExtensionNode(e)}function isExecutableDefinitionNode(e){return e.kind===Kind.OPERATION_DEFINITION||e.kind===Kind.FRAGMENT_DEFINITION}function isSelectionNode(e){return e.kind===Kind.FIELD||e.kind===Kind.FRAGMENT_SPREAD||e.kind===Kind.INLINE_FRAGMENT}function isValueNode(e){return e.kind===Kind.VARIABLE||e.kind===Kind.INT||e.kind===Kind.FLOAT||e.kind===Kind.STRING||e.kind===Kind.BOOLEAN||e.kind===Kind.NULL||e.kind===Kind.ENUM||e.kind===Kind.LIST||e.kind===Kind.OBJECT}function isConstValueNode(e){return isValueNode(e)&&(e.kind===Kind.LIST?e.values.some(isConstValueNode):e.kind===Kind.OBJECT?e.fields.some(e=>isConstValueNode(e.value)):e.kind!==Kind.VARIABLE)}function isTypeNode(e){return e.kind===Kind.NAMED_TYPE||e.kind===Kind.LIST_TYPE||e.kind===Kind.NON_NULL_TYPE}function isTypeSystemDefinitionNode(e){return e.kind===Kind.SCHEMA_DEFINITION||isTypeDefinitionNode(e)||e.kind===Kind.DIRECTIVE_DEFINITION}function isTypeDefinitionNode(e){return e.kind===Kind.SCALAR_TYPE_DEFINITION||e.kind===Kind.OBJECT_TYPE_DEFINITION||e.kind===Kind.INTERFACE_TYPE_DEFINITION||e.kind===Kind.UNION_TYPE_DEFINITION||e.kind===Kind.ENUM_TYPE_DEFINITION||e.kind===Kind.INPUT_OBJECT_TYPE_DEFINITION}function isTypeSystemExtensionNode(e){return e.kind===Kind.SCHEMA_EXTENSION||isTypeExtensionNode(e)}function isTypeExtensionNode(e){return e.kind===Kind.SCALAR_TYPE_EXTENSION||e.kind===Kind.OBJECT_TYPE_EXTENSION||e.kind===Kind.INTERFACE_TYPE_EXTENSION||e.kind===Kind.UNION_TYPE_EXTENSION||e.kind===Kind.ENUM_TYPE_EXTENSION||e.kind===Kind.INPUT_OBJECT_TYPE_EXTENSION}function ExecutableDefinitionsRule(r){return{Document(e){for(const n of e.definitions){var t;isExecutableDefinitionNode(n)||(t=n.kind===Kind.SCHEMA_DEFINITION||n.kind===Kind.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"',r.reportError(new GraphQLError(`The ${t} definition is not executable.`,{nodes:n})))}return!1}}}function FieldsOnCorrectTypeRule(a){return{Field(t){var n=a.getParentType();if(n&&!a.getFieldDef()){var r=a.getSchema(),i=t.name.value;let e=didYouMean("to use an inline fragment on",getSuggestedTypeNames(r,n,i));""===e&&(e=didYouMean(getSuggestedFieldNames(n,i))),a.reportError(new GraphQLError(`Cannot query field "${i}" on type "${n.name}".`+e,{nodes:t}))}}}}function getSuggestedTypeNames(r,e,t){if(!isAbstractType(e))return[];var n,i=new Set;const a=Object.create(null);for(const o of r.getPossibleTypes(e))if(o.getFields()[t]){i.add(o),a[o.name]=1;for(const s of o.getInterfaces())s.getFields()[t]&&(i.add(s),a[s.name]=(null!=(n=a[s.name])?n:0)+1)}return[...i].sort((e,t)=>{var n=a[t.name]-a[e.name];return 0!=n?n:isInterfaceType(e)&&r.isSubType(e,t)?-1:isInterfaceType(t)&&r.isSubType(t,e)?1:naturalCompare(e.name,t.name)}).map(e=>e.name)}function getSuggestedFieldNames(e,t){return isObjectType(e)||isInterfaceType(e)?suggestionList(t,Object.keys(e.getFields())):[]}function FragmentsOnCompositeTypesRule(n){return{InlineFragment(e){var t,e=e.typeCondition;e&&(t=typeFromAST(n.getSchema(),e))&&!isCompositeType(t)&&(t=print(e),n.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:e})))},FragmentDefinition(e){var t=typeFromAST(n.getSchema(),e.typeCondition);t&&!isCompositeType(t)&&(t=print(e.typeCondition),n.reportError(new GraphQLError(`Fragment "${e.name.value}" cannot condition on non composite type "${t}".`,{nodes:e.typeCondition})))}}}function KnownArgumentNamesRule(a){return{...KnownArgumentNamesOnDirectivesRule(a),Argument(e){var t,n=a.getArgument(),r=a.getFieldDef(),i=a.getParentType();!n&&r&&i&&(t=suggestionList(n=e.name.value,r.args.map(e=>e.name)),a.reportError(new GraphQLError(`Unknown argument "${n}" on field "${i.name}.${r.name}".`+didYouMean(t),{nodes:e})))}}}function KnownArgumentNamesOnDirectivesRule(o){const s=Object.create(null);var e,t=o.getSchema();for(const n of t?t.getDirectives():specifiedDirectives)s[n.name]=n.args.map(e=>e.name);for(const r of o.getDocument().definitions)r.kind===Kind.DIRECTIVE_DEFINITION&&(e=null!=(e=r.arguments)?e:[],s[r.name.value]=e.map(e=>e.name.value));return{Directive(e){var t=e.name.value,n=s[t];if(e.arguments&&n)for(const a of e.arguments){var r,i=a.name.value;n.includes(i)||(r=suggestionList(i,n),o.reportError(new GraphQLError(`Unknown argument "${i}" on directive "@${t}".`+didYouMean(r),{nodes:a})))}return!1}}}function KnownDirectivesRule(s){const c=Object.create(null);var e=s.getSchema();for(const t of e?e.getDirectives():specifiedDirectives)c[t.name]=t.locations;for(const n of s.getDocument().definitions)n.kind===Kind.DIRECTIVE_DEFINITION&&(c[n.name.value]=n.locations.map(e=>e.value));return{Directive(e,t,n,r,i){var a=e.name.value,o=c[a];o?(i=getDirectiveLocationForASTPath(i))&&!o.includes(i)&&s.reportError(new GraphQLError(`Directive "@${a}" may not be used on ${i}.`,{nodes:e})):s.reportError(new GraphQLError(`Unknown directive "@${a}".`,{nodes:e}))}}}function getDirectiveLocationForASTPath(e){var t=e[e.length-1];switch("kind"in t||invariant(!1),t.kind){case Kind.OPERATION_DEFINITION:return getDirectiveLocationForOperation(t.operation);case Kind.FIELD:return DirectiveLocation.FIELD;case Kind.FRAGMENT_SPREAD:return DirectiveLocation.FRAGMENT_SPREAD;case Kind.INLINE_FRAGMENT:return DirectiveLocation.INLINE_FRAGMENT;case Kind.FRAGMENT_DEFINITION:return DirectiveLocation.FRAGMENT_DEFINITION;case Kind.VARIABLE_DEFINITION:return DirectiveLocation.VARIABLE_DEFINITION;case Kind.SCHEMA_DEFINITION:case Kind.SCHEMA_EXTENSION:return DirectiveLocation.SCHEMA;case Kind.SCALAR_TYPE_DEFINITION:case Kind.SCALAR_TYPE_EXTENSION:return DirectiveLocation.SCALAR;case Kind.OBJECT_TYPE_DEFINITION:case Kind.OBJECT_TYPE_EXTENSION:return DirectiveLocation.OBJECT;case Kind.FIELD_DEFINITION:return DirectiveLocation.FIELD_DEFINITION;case Kind.INTERFACE_TYPE_DEFINITION:case Kind.INTERFACE_TYPE_EXTENSION:return DirectiveLocation.INTERFACE;case Kind.UNION_TYPE_DEFINITION:case Kind.UNION_TYPE_EXTENSION:return DirectiveLocation.UNION;case Kind.ENUM_TYPE_DEFINITION:case Kind.ENUM_TYPE_EXTENSION:return DirectiveLocation.ENUM;case Kind.ENUM_VALUE_DEFINITION:return DirectiveLocation.ENUM_VALUE;case Kind.INPUT_OBJECT_TYPE_DEFINITION:case Kind.INPUT_OBJECT_TYPE_EXTENSION:return DirectiveLocation.INPUT_OBJECT;case Kind.INPUT_VALUE_DEFINITION:var n=e[e.length-3];return"kind"in n||invariant(!1),n.kind===Kind.INPUT_OBJECT_TYPE_DEFINITION?DirectiveLocation.INPUT_FIELD_DEFINITION:DirectiveLocation.ARGUMENT_DEFINITION;default:invariant(!1,"Unexpected kind: "+inspect(t.kind))}}function getDirectiveLocationForOperation(e){switch(e){case OperationTypeNode.QUERY:return DirectiveLocation.QUERY;case OperationTypeNode.MUTATION:return DirectiveLocation.MUTATION;case OperationTypeNode.SUBSCRIPTION:return DirectiveLocation.SUBSCRIPTION}}function KnownFragmentNamesRule(n){return{FragmentSpread(e){var t=e.name.value;n.getFragment(t)||n.reportError(new GraphQLError(`Unknown fragment "${t}".`,{nodes:e.name}))}}}function KnownTypeNamesRule(o){var e=o.getSchema();const s=e?e.getTypeMap():Object.create(null),c=Object.create(null);for(const t of o.getDocument().definitions)isTypeDefinitionNode(t)&&(c[t.name.value]=!0);const l=[...Object.keys(s),...Object.keys(c)];return{NamedType(e,t,n,r,i){var a=e.name.value;s[a]||c[a]||(n=null!=(i=null!=(i=i[2])?i:n)&&isSDLNode(i))&&standardTypeNames.includes(a)||(i=suggestionList(a,n?standardTypeNames.concat(l):l),o.reportError(new GraphQLError(`Unknown type "${a}".`+didYouMean(i),{nodes:e})))}}}const standardTypeNames=[...specifiedScalarTypes,...introspectionTypes].map(e=>e.name);function isSDLNode(e){return"kind"in e&&(isTypeSystemDefinitionNode(e)||isTypeSystemExtensionNode(e))}function LoneAnonymousOperationRule(t){let n=0;return{Document(e){n=e.definitions.filter(e=>e.kind===Kind.OPERATION_DEFINITION).length},OperationDefinition(e){!e.name&&1<n&&t.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:e}))}}}function LoneSchemaDefinitionRule(t){var e,n=t.getSchema();const r=null!=(e=null!=(e=null!=(e=null==n?void 0:n.astNode)?e:null==n?void 0:n.getQueryType())?e:null==n?void 0:n.getMutationType())?e:null==n?void 0:n.getSubscriptionType();let i=0;return{SchemaDefinition(e){r?t.reportError(new GraphQLError("Cannot define a new schema within a schema extension.",{nodes:e})):(0<i&&t.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:e})),++i)}}}const MAX_LISTS_DEPTH=3;function MaxIntrospectionDepthRule(s){return{Field(e){if(("__schema"===e.name.value||"__type"===e.name.value)&&function e(t,n=Object.create(null),r=0){if(t.kind===Kind.FRAGMENT_SPREAD){var i=t.name.value;if(!0===n[i])return!1;var a=s.getFragment(i);if(!a)return!1;try{return n[i]=!0,e(a,n,r)}finally{n[i]=void 0}}if(t.kind===Kind.FIELD&&("fields"===t.name.value||"interfaces"===t.name.value||"possibleTypes"===t.name.value||"inputFields"===t.name.value)&&++r>=MAX_LISTS_DEPTH)return!0;if("selectionSet"in t&&t.selectionSet)for(const o of t.selectionSet.selections)if(e(o,n,r))return!0;return!1}(e))return s.reportError(new GraphQLError("Maximum introspection depth exceeded",{nodes:[e]})),!1}}}function NoFragmentCyclesRule(u){const p=Object.create(null),d=[],y=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(e){return function e(t){if(p[t.name.value])return;const n=t.name.value;p[n]=!0;const r=u.getFragmentSpreads(t.selectionSet);if(0===r.length)return;y[n]=d.length;for(const i of r){const a=i.name.value,o=y[a];if(d.push(i),void 0===o){const s=u.getFragment(a);s&&e(s)}else{const c=d.slice(o),l=c.slice(0,-1).map(e=>'"'+e.name.value+'"').join(", ");u.reportError(new GraphQLError(`Cannot spread fragment "${a}" within itself`+(""!==l?` via ${l}.`:"."),{nodes:c}))}d.pop()}y[n]=void 0}(e),!1}}}function NoUndefinedVariablesRule(r){let i=Object.create(null);return{OperationDefinition:{enter(){i=Object.create(null)},leave(e){var t;for({node:t}of r.getRecursiveVariableUsages(e)){var n=t.name.value;!0!==i[n]&&r.reportError(new GraphQLError(e.name?`Variable "$${n}" is not defined by operation "${e.name.value}".`:`Variable "$${n}" is not defined.`,{nodes:[t,e]}))}}},VariableDefinition(e){i[e.variable.name.value]=!0}}}function NoUnusedFragmentsRule(a){const o=[],s=[];return{OperationDefinition(e){return o.push(e),!1},FragmentDefinition(e){return s.push(e),!1},Document:{leave(){var e=Object.create(null);for(const n of o)for(const r of a.getRecursivelyReferencedFragments(n))e[r.name.value]=!0;for(const i of s){var t=i.name.value;!0!==e[t]&&a.reportError(new GraphQLError(`Fragment "${t}" is never used.`,{nodes:i}))}}}}}function NoUnusedVariablesRule(a){let o=[];return{OperationDefinition:{enter(){o=[]},leave(e){var t,n=Object.create(null);for({node:t}of a.getRecursiveVariableUsages(e))n[t.name.value]=!0;for(const i of o){var r=i.variable.name.value;!0!==n[r]&&a.reportError(new GraphQLError(e.name?`Variable "$${r}" is never used in operation "${e.name.value}".`:`Variable "$${r}" is never used.`,{nodes:i}))}}},VariableDefinition(e){o.push(e)}}}function sortValueNode(e){switch(e.kind){case Kind.OBJECT:return{...e,fields:sortFields(e.fields)};case Kind.LIST:return{...e,values:e.values.map(sortValueNode)};case Kind.INT:case Kind.FLOAT:case Kind.STRING:case Kind.BOOLEAN:case Kind.NULL:case Kind.ENUM:case Kind.VARIABLE:return e}}function sortFields(e){return e.map(e=>({...e,value:sortValueNode(e.value)})).sort((e,t)=>naturalCompare(e.name.value,t.name.value))}function reasonMessage(e){return Array.isArray(e)?e.map(([e,t])=>`subfields "${e}" conflict because `+reasonMessage(t)).join(" and "):e}function OverlappingFieldsCanBeMergedRule(o){const s=new OrderedPairSet,c=new PairSet,l=new Map;return{SelectionSet(e){var t,n,r,i;for([[t,n],r,i]of findConflictsWithinSelectionSet(o,l,s,c,o.getParentType(),e)){var a=reasonMessage(n);o.reportError(new GraphQLError(`Fields "${t}" conflict because ${a}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:r.concat(i)}))}}}}function findConflictsWithinSelectionSet(n,r,i,a,e,t){var o=[],[s,c]=getFieldsAndFragmentNames(n,r,e,t);if(collectConflictsWithin(n,o,r,i,a,s),0!==c.length)for(let t=0;t<c.length;t++){collectConflictsBetweenFieldsAndFragment(n,o,r,i,a,!1,s,c[t]);for(let e=t+1;e<c.length;e++)collectConflictsBetweenFragments(n,o,r,i,a,!1,c[t],c[e])}return o}function collectConflictsBetweenFieldsAndFragment(e,t,n,r,i,a,o,s){if(!r.has(o,s,a)){r.add(o,s,a);s=e.getFragment(s);if(s){var[s,c]=getReferencedFieldsAndFragmentNames(e,n,s);if(o!==s){collectConflictsBetween(e,t,n,r,i,a,o,s);for(const l of c)collectConflictsBetweenFieldsAndFragment(e,t,n,r,i,a,o,l)}}}}function collectConflictsBetweenFragments(e,t,n,r,i,a,o,s){if(o!==s&&!i.has(o,s,a)){i.add(o,s,a);var c=e.getFragment(o),l=e.getFragment(s);if(c&&l){var[c,u]=getReferencedFieldsAndFragmentNames(e,n,c),[l,p]=getReferencedFieldsAndFragmentNames(e,n,l);collectConflictsBetween(e,t,n,r,i,a,c,l);for(const d of p)collectConflictsBetweenFragments(e,t,n,r,i,a,o,d);for(const y of u)collectConflictsBetweenFragments(e,t,n,r,i,a,y,s)}}}function findConflictsBetweenSubSelectionSets(e,t,n,r,i,a,o,s,c){var l=[],[u,a]=getFieldsAndFragmentNames(e,t,a,o),[p,d]=getFieldsAndFragmentNames(e,t,s,c);collectConflictsBetween(e,l,t,n,r,i,u,p);for(const y of d)collectConflictsBetweenFieldsAndFragment(e,l,t,n,r,i,u,y);for(const f of a)collectConflictsBetweenFieldsAndFragment(e,l,t,n,r,i,p,f);for(const h of a)for(const m of d)collectConflictsBetweenFragments(e,l,t,n,r,i,h,m);return l}function collectConflictsWithin(n,r,i,a,o,e){for(var[s,c]of Object.entries(e))if(1<c.length)for(let t=0;t<c.length;t++)for(let e=t+1;e<c.length;e++){var l=findConflict(n,i,a,o,!1,s,c[t],c[e]);l&&r.push(l)}}function collectConflictsBetween(e,t,n,r,i,a,o,s){for(var[c,l]of Object.entries(o)){var u=s[c];if(u)for(const d of l)for(const y of u){var p=findConflict(e,n,r,i,a,c,d,y);p&&t.push(p)}}}function findConflict(e,t,n,r,i,a,o,s){var[o,c,l]=o,[s,u,p]=s,i=i||o!==s&&isObjectType(o)&&isObjectType(s);if(!i){o=c.name.value,s=u.name.value;if(o!==s)return[[a,`"${o}" and "${s}" are different fields`],[c],[u]];if(!sameArguments(c,u))return[[a,"they have differing arguments"],[c],[u]]}o=null==l?void 0:l.type,s=null==p?void 0:p.type;return o&&s&&doTypesConflict(o,s)?[[a,`they return conflicting types "${inspect(o)}" and "${inspect(s)}"`],[c],[u]]:(l=c.selectionSet,p=u.selectionSet,l&&p?subfieldConflicts(findConflictsBetweenSubSelectionSets(e,t,n,r,i,getNamedType(o),l,getNamedType(s),p),a,c,u):void 0)}function sameArguments(e,t){e=e.arguments,t=t.arguments;if(void 0===e||0===e.length)return void 0===t||0===t.length;if(void 0===t||0===t.length)return!1;if(e.length!==t.length)return!1;const n=new Map(t.map(({name:e,value:t})=>[e.value,t]));return e.every(e=>{var t=e.value,e=n.get(e.name.value);return void 0!==e&&stringifyValue$1(t)===stringifyValue$1(e)})}function stringifyValue$1(e){return print(sortValueNode(e))}function doTypesConflict(e,t){return isListType(e)?!isListType(t)||doTypesConflict(e.ofType,t.ofType):!!isListType(t)||(isNonNullType(e)?!isNonNullType(t)||doTypesConflict(e.ofType,t.ofType):!!isNonNullType(t)||!(!isLeafType(e)&&!isLeafType(t))&&e!==t)}function getFieldsAndFragmentNames(e,t,n,r){var i=t.get(r);return i||(_collectFieldsAndFragmentNames(e,n,r,i=Object.create(null),e=Object.create(null)),n=[i,Object.keys(e)],t.set(r,n),n)}function getReferencedFieldsAndFragmentNames(e,t,n){var r=t.get(n.selectionSet);return r||(r=typeFromAST(e.getSchema(),n.typeCondition),getFieldsAndFragmentNames(e,t,r,n.selectionSet))}function _collectFieldsAndFragmentNames(e,t,n,r,i){for(const s of n.selections)switch(s.kind){case Kind.FIELD:{var a=s.name.value;let e;(isObjectType(t)||isInterfaceType(t))&&(e=t.getFields()[a]);a=s.alias?s.alias.value:a;r[a]||(r[a]=[]),r[a].push([t,s,e]);break}case Kind.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case Kind.INLINE_FRAGMENT:var a=s.typeCondition,o=a?typeFromAST(e.getSchema(),a):t;_collectFieldsAndFragmentNames(e,o,s.selectionSet,r,i)}}function subfieldConflicts(e,t,n,r){if(0<e.length)return[[t,e.map(([e])=>e)],[n,...e.map(([,e])=>e).flat()],[r,...e.map(([,,e])=>e).flat()]]}class OrderedPairSet{constructor(){this._data=new Map}has(e,t,n){e=null==(e=this._data.get(e))?void 0:e.get(t);return void 0!==e&&(!!n||n===e)}add(e,t,n){var r=this._data.get(e);void 0===r?this._data.set(e,new Map([[t,n]])):r.set(t,n)}}class PairSet{constructor(){this._orderedPairSet=new OrderedPairSet}has(e,t,n){return e<t?this._orderedPairSet.has(e,t,n):this._orderedPairSet.has(t,e,n)}add(e,t,n){e<t?this._orderedPairSet.add(e,t,n):this._orderedPairSet.add(t,e,n)}}function PossibleFragmentSpreadsRule(i){return{InlineFragment(e){var t=i.getType(),n=i.getParentType();isCompositeType(t)&&isCompositeType(n)&&!doTypesOverlap(i.getSchema(),t,n)&&(n=inspect(n),t=inspect(t),i.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${n}" can never be of type "${t}".`,{nodes:e})))},FragmentSpread(e){var t=e.name.value,n=getFragmentType(i,t),r=i.getParentType();n&&r&&!doTypesOverlap(i.getSchema(),n,r)&&(r=inspect(r),n=inspect(n),i.reportError(new GraphQLError(`Fragment "${t}" cannot be spread here as objects of type "${r}" can never be of type "${n}".`,{nodes:e})))}}}function getFragmentType(e,t){t=e.getFragment(t);if(t){e=typeFromAST(e.getSchema(),t.typeCondition);if(isCompositeType(e))return e}}function PossibleTypeExtensionsRule(a){const o=a.getSchema(),s=Object.create(null);for(const t of a.getDocument().definitions)isTypeDefinitionNode(t)&&(s[t.name.value]=t);return{ScalarTypeExtension:e,ObjectTypeExtension:e,InterfaceTypeExtension:e,UnionTypeExtension:e,EnumTypeExtension:e,InputObjectTypeExtension:e};function e(e){var t=e.name.value,n=s[t],r=null===o||void 0===o?void 0:o.getType(t);let i;n?i=defKindToExtKind[n.kind]:r&&(i=typeToExtKind(r)),i?i!==e.kind&&(r=extensionKindToTypeName(e.kind),a.reportError(new GraphQLError(`Cannot extend non-${r} type "${t}".`,{nodes:n?[n,e]:e}))):(r=suggestionList(t,Object.keys({...s,...null===o||void 0===o?void 0:o.getTypeMap()})),a.reportError(new GraphQLError(`Cannot extend type "${t}" because it is not defined.`+didYouMean(r),{nodes:e.name})))}}const defKindToExtKind={[Kind.SCALAR_TYPE_DEFINITION]:Kind.SCALAR_TYPE_EXTENSION,[Kind.OBJECT_TYPE_DEFINITION]:Kind.OBJECT_TYPE_EXTENSION,[Kind.INTERFACE_TYPE_DEFINITION]:Kind.INTERFACE_TYPE_EXTENSION,[Kind.UNION_TYPE_DEFINITION]:Kind.UNION_TYPE_EXTENSION,[Kind.ENUM_TYPE_DEFINITION]:Kind.ENUM_TYPE_EXTENSION,[Kind.INPUT_OBJECT_TYPE_DEFINITION]:Kind.INPUT_OBJECT_TYPE_EXTENSION};function typeToExtKind(e){return isScalarType(e)?Kind.SCALAR_TYPE_EXTENSION:isObjectType(e)?Kind.OBJECT_TYPE_EXTENSION:isInterfaceType(e)?Kind.INTERFACE_TYPE_EXTENSION:isUnionType(e)?Kind.UNION_TYPE_EXTENSION:isEnumType(e)?Kind.ENUM_TYPE_EXTENSION:isInputObjectType(e)?Kind.INPUT_OBJECT_TYPE_EXTENSION:void invariant(!1,"Unexpected type: "+inspect(e))}function extensionKindToTypeName(e){switch(e){case Kind.SCALAR_TYPE_EXTENSION:return"scalar";case Kind.OBJECT_TYPE_EXTENSION:return"object";case Kind.INTERFACE_TYPE_EXTENSION:return"interface";case Kind.UNION_TYPE_EXTENSION:return"union";case Kind.ENUM_TYPE_EXTENSION:return"enum";case Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:invariant(!1,"Unexpected kind: "+inspect(e))}}function ProvidedRequiredArgumentsRule(o){return{...ProvidedRequiredArgumentsOnDirectivesRule(o),Field:{leave(e){var t,n=o.getFieldDef();if(!n)return!1;var r,i=new Set(null==(t=e.arguments)?void 0:t.map(e=>e.name.value));for(const a of n.args)!i.has(a.name)&&isRequiredArgument(a)&&(r=inspect(a.type),o.reportError(new GraphQLError(`Field "${n.name}" argument "${a.name}" of type "${r}" is required, but it was not provided.`,{nodes:e})))}}}}function ProvidedRequiredArgumentsOnDirectivesRule(c){const l=Object.create(null);var e,t=c.getSchema();for(const n of null!=(t=null==t?void 0:t.getDirectives())?t:specifiedDirectives)l[n.name]=keyMap(n.args.filter(isRequiredArgument),e=>e.name);for(const r of c.getDocument().definitions)r.kind===Kind.DIRECTIVE_DEFINITION&&(e=null!=(e=r.arguments)?e:[],l[r.name.value]=keyMap(e.filter(isRequiredArgumentNode),e=>e.name.value));return{Directive:{leave(e){var t=e.name.value,n=l[t];if(n){var r,i,a,o=null!=(o=e.arguments)?o:[],s=new Set(o.map(e=>e.name.value));for([r,i]of Object.entries(n))s.has(r)||(a=(isType(i.type)?inspect:print)(i.type),c.reportError(new GraphQLError(`Directive "@${t}" argument "${r}" of type "${a}" is required, but it was not provided.`,{nodes:e})))}}}}}function isRequiredArgumentNode(e){return e.type.kind===Kind.NON_NULL_TYPE&&null==e.defaultValue}function ScalarLeafsRule(a){return{Field(e){var t,n,r=a.getType(),i=e.selectionSet;r&&(isLeafType(getNamedType(r))?i&&(n=e.name.value,t=inspect(r),a.reportError(new GraphQLError(`Field "${n}" must not have a selection since type "${t}" has no subfields.`,{nodes:i}))):i?0===i.selections.length&&(n=e.name.value,t=inspect(r),a.reportError(new GraphQLError(`Field "${n}" of type "${t}" must have at least one field selected.`,{nodes:e}))):(i=e.name.value,n=inspect(r),a.reportError(new GraphQLError(`Field "${i}" of type "${n}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:e}))))}}}function printPathArray(e){return e.map(e=>"number"==typeof e?"["+e.toString()+"]":"."+e).join("")}function addPath(e,t,n){return{prev:e,key:t,typename:n}}function pathToArray(e){var t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function coerceInputValue(e,t,n=defaultOnError){return coerceInputValueImpl(e,t,n,void 0)}function defaultOnError(e,t,n){let r="Invalid value "+inspect(t);throw 0<e.length&&(r+=` at "value${printPathArray(e)}"`),n.message=r+": "+n.message,n}function coerceInputValueImpl(t,n,r,i){if(isNonNullType(n))return null!=t?coerceInputValueImpl(t,n.ofType,r,i):void r(pathToArray(i),t,new GraphQLError(`Expected non-nullable type "${inspect(n)}" not to be null.`));if(null==t)return null;if(isListType(n)){const p=n.ofType;return isIterableObject(t)?Array.from(t,(e,t)=>{t=addPath(i,t,void 0);return coerceInputValueImpl(e,p,r,t)}):[coerceInputValueImpl(t,p,r,i)]}if(isInputObjectType(n)){if(!isObjectLike(t)||Array.isArray(t))return void r(pathToArray(i),t,new GraphQLError(`Expected type "${n.name}" to be an object.`));var e,a,o,s={},c=n.getFields();for(const d of Object.values(c)){var l,u=t[d.name];void 0===u?void 0!==d.defaultValue?s[d.name]=d.defaultValue:isNonNullType(d.type)&&(l=inspect(d.type),r(pathToArray(i),t,new GraphQLError(`Field "${d.name}" of required type "${l}" was not provided.`))):s[d.name]=coerceInputValueImpl(u,d.type,r,addPath(i,d.name,n.name))}for(const y of Object.keys(t))c[y]||(e=suggestionList(y,Object.keys(n.getFields())),r(pathToArray(i),t,new GraphQLError(`Field "${y}" is not defined by type "${n.name}".`+didYouMean(e))));return n.isOneOf&&(1!==(a=Object.keys(s)).length&&r(pathToArray(i),t,new GraphQLError(`Exactly one key must be specified for OneOf type "${n.name}".`)),null===(o=s[a=a[0]]))&&r(pathToArray(i).concat(a),o,new GraphQLError(`Field "${a}" must be non-null.`)),s}if(isLeafType(n)){let e;try{e=n.parseValue(t)}catch(e){return void(e instanceof GraphQLError?r(pathToArray(i),t,e):r(pathToArray(i),t,new GraphQLError(`Expected type "${n.name}". `+e.message,{originalError:e})))}return void 0===e&&r(pathToArray(i),t,new GraphQLError(`Expected type "${n.name}".`)),e}invariant(!1,"Unexpected input type: "+inspect(n))}function valueFromAST(t,n,r){if(t){if(t.kind===Kind.VARIABLE)return o=t.name.value,null==r||void 0===r[o]||null===(o=r[o])&&isNonNullType(n)?void 0:o;if(isNonNullType(n))return t.kind===Kind.NULL?void 0:valueFromAST(t,n.ofType,r);if(t.kind===Kind.NULL)return null;if(isListType(n)){var e=n.ofType;if(t.kind===Kind.LIST){var i=[];for(const u of t.values)if(isMissingVariable(u,r)){if(isNonNullType(e))return;i.push(null)}else{var a=valueFromAST(u,e,r);if(void 0===a)return;i.push(a)}return i}var o=valueFromAST(t,e,r);return void 0===o?void 0:[o]}if(isInputObjectType(n)){if(t.kind!==Kind.OBJECT)return;var s=Object.create(null),c=keyMap(t.fields,e=>e.name.value);for(const p of Object.values(n.getFields())){var l=c[p.name];if(!l||isMissingVariable(l.value,r)){if(void 0!==p.defaultValue)s[p.name]=p.defaultValue;else if(isNonNullType(p.type))return}else{l=valueFromAST(l.value,p.type,r);if(void 0===l)return;s[p.name]=l}}if(n.isOneOf){o=Object.keys(s);if(1!==o.length)return;if(null===s[o[0]])return}return s}if(isLeafType(n)){let e;try{e=n.parseLiteral(t,r)}catch(e){return}return void 0===e?void 0:e}invariant(!1,"Unexpected input type: "+inspect(n))}}function isMissingVariable(e,t){return e.kind===Kind.VARIABLE&&(null==t||void 0===t[e.name.value])}function getVariableValues(e,t,n,r){const i=[],a=null==r?void 0:r.maxErrors;try{var o=coerceVariableValues(e,t,n,e=>{if(null!=a&&i.length>=a)throw new GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");i.push(e)});if(0===i.length)return{coerced:o}}catch(e){i.push(e)}return{errors:i}}function coerceVariableValues(e,t,n,i){var r={};for(const c of t){const l=c.variable.name.value;var a,o,s=typeFromAST(e,c.type);isInputType(s)?hasOwnProperty$1(n,l)?null===(o=n[l])&&isNonNullType(s)?(a=inspect(s),i(new GraphQLError(`Variable "$${l}" of non-null type "${a}" must not be null.`,{nodes:c}))):r[l]=coerceInputValue(o,s,(e,t,n)=>{let r=`Variable "$${l}" got invalid value `+inspect(t);0<e.length&&(r+=` at "${l}${printPathArray(e)}"`),i(new GraphQLError(r+"; "+n.message,{nodes:c,originalError:n}))}):c.defaultValue?r[l]=valueFromAST(c.defaultValue,s):isNonNullType(s)&&(a=inspect(s),i(new GraphQLError(`Variable "$${l}" of required type "${a}" was not provided.`,{nodes:c}))):(o=print(c.type),i(new GraphQLError(`Variable "$${l}" expected value of type "${o}" which cannot be used as an input type.`,{nodes:c.type})))}return r}function getArgumentValues(e,t,n){var r,i={},a=keyMap(null!=(r=t.arguments)?r:[],e=>e.name.value);for(const u of e.args){var o=u.name,s=u.type,c=a[o];if(c){c=c.value;let e=c.kind===Kind.NULL;if(c.kind===Kind.VARIABLE){var l=c.name.value;if(null==n||!hasOwnProperty$1(n,l)){if(void 0!==u.defaultValue)i[o]=u.defaultValue;else if(isNonNullType(s))throw new GraphQLError(`Argument "${o}" of required type "${inspect(s)}" `+`was provided the variable "$${l}" which was not provided a runtime value.`,{nodes:c});continue}e=null==n[l]}if(e&&isNonNullType(s))throw new GraphQLError(`Argument "${o}" of non-null type "${inspect(s)}" `+"must not be null.",{nodes:c});l=valueFromAST(c,s,n);if(void 0===l)throw new GraphQLError(`Argument "${o}" has invalid value ${print(c)}.`,{nodes:c});i[o]=l}else if(void 0!==u.defaultValue)i[o]=u.defaultValue;else if(isNonNullType(s))throw new GraphQLError(`Argument "${o}" of required type "${inspect(s)}" `+"was not provided.",{nodes:t})}return i}function getDirectiveValues(t,e,n){e=null==(e=e.directives)?void 0:e.find(e=>e.name.value===t.name);if(e)return getArgumentValues(t,e,n)}function hasOwnProperty$1(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function collectFields(e,t,n,r,i){var a=new Map;return collectFieldsImpl(e,t,n,r,i,a,new Set),a}function collectSubfields$1(e,t,n,r,i){var a=new Map,o=new Set;for(const s of i)s.selectionSet&&collectFieldsImpl(e,t,n,r,s.selectionSet,a,o);return a}function collectFieldsImpl(e,t,n,r,i,a,o){for(const l of i.selections)switch(l.kind){case Kind.FIELD:shouldIncludeNode(n,l)&&(s=getFieldEntryKey(l),void 0!==(c=a.get(s))?c.push(l):a.set(s,[l]));break;case Kind.INLINE_FRAGMENT:shouldIncludeNode(n,l)&&doesFragmentConditionMatch(e,l,r)&&collectFieldsImpl(e,t,n,r,l.selectionSet,a,o);break;case Kind.FRAGMENT_SPREAD:var s,c=l.name.value;!o.has(c)&&shouldIncludeNode(n,l)&&(o.add(c),(s=t[c])&&doesFragmentConditionMatch(e,s,r))&&collectFieldsImpl(e,t,n,r,s.selectionSet,a,o)}}function shouldIncludeNode(e,t){var n=getDirectiveValues(GraphQLSkipDirective,t,e);return!0!==(null==n?void 0:n.if)&&!1!==(null==(n=getDirectiveValues(GraphQLIncludeDirective,t,e))?void 0:n.if)}function doesFragmentConditionMatch(e,t,n){var t=t.typeCondition;return!t||(t=typeFromAST(e,t))===n||!!isAbstractType(t)&&e.isSubType(t,n)}function getFieldEntryKey(e){return(e.alias||e.name).value}function SingleFieldSubscriptionsRule(l){return{OperationDefinition(e){if("subscription"===e.operation){var t=l.getSchema(),n=t.getSubscriptionType();if(n){var r=e.name?e.name.value:null,i=Object.create(null),a=l.getDocument(),o=Object.create(null);for(const s of a.definitions)s.kind===Kind.FRAGMENT_DEFINITION&&(o[s.name.value]=s);a=collectFields(t,o,i,n,e.selectionSet);1<a.size&&(t=[...a.values()].slice(1).flat(),l.reportError(new GraphQLError(null!=r?`Subscription "${r}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t})));for(const c of a.values())c[0].name.value.startsWith("__")&&l.reportError(new GraphQLError(null!=r?`Subscription "${r}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:c}))}}}}}function groupBy(e,t){var n=new Map;for(const a of e){var r=t(a),i=n.get(r);void 0===i?n.set(r,[a]):i.push(a)}return n}function UniqueArgumentDefinitionNamesRule(i){return{DirectiveDefinition(e){var t=null!=(t=e.arguments)?t:[];return a("@"+e.name.value,t)},InterfaceTypeDefinition:e,InterfaceTypeExtension:e,ObjectTypeDefinition:e,ObjectTypeExtension:e};function e(e){var t,n=e.name.value;for(const r of null!=(e=e.fields)?e:[])a(n+"."+r.name.value,null!=(t=r.arguments)?t:[]);return!1}function a(e,t){var n,r;for([n,r]of groupBy(t,e=>e.name.value))1<r.length&&i.reportError(new GraphQLError(`Argument "${e}(${n}:)" can only be defined once.`,{nodes:r.map(e=>e.name)}));return!1}}function UniqueArgumentNamesRule(r){return{Field:e,Directive:e};function e(e){var t,n;for([t,n]of groupBy(null!=(e=e.arguments)?e:[],e=>e.name.value))1<n.length&&r.reportError(new GraphQLError(`There can be only one argument named "${t}".`,{nodes:n.map(e=>e.name)}))}}function UniqueDirectiveNamesRule(n){const r=Object.create(null),i=n.getSchema();return{DirectiveDefinition(e){var t=e.name.value;if(null===i||void 0===i||!i.getDirective(t))return r[t]?n.reportError(new GraphQLError(`There can be only one directive named "@${t}".`,{nodes:[r[t],e.name]})):r[t]=e.name,!1;n.reportError(new GraphQLError(`Directive "@${t}" already exists in the schema. It cannot be redefined.`,{nodes:e.name}))}}}function UniqueDirectivesPerLocationRule(a){const o=Object.create(null);var e=a.getSchema();for(const t of e?e.getDirectives():specifiedDirectives)o[t.name]=!t.isRepeatable;for(const n of a.getDocument().definitions)n.kind===Kind.DIRECTIVE_DEFINITION&&(o[n.name.value]=!n.repeatable);const s=Object.create(null),c=Object.create(null);return{enter(t){if("directives"in t&&t.directives){let e;var n;t.kind===Kind.SCHEMA_DEFINITION||t.kind===Kind.SCHEMA_EXTENSION?e=s:isTypeDefinitionNode(t)||isTypeExtensionNode(t)?(n=t.name.value,void 0===(e=c[n])&&(c[n]=e=Object.create(null))):e=Object.create(null);for(const i of t.directives){var r=i.name.value;o[r]&&(e[r]?a.reportError(new GraphQLError(`The directive "@${r}" can only be used once at this location.`,{nodes:[e[r],i]})):e[r]=i)}}}}}function UniqueEnumValueNamesRule(o){var e=o.getSchema();const s=e?e.getTypeMap():Object.create(null),c=Object.create(null);return{EnumTypeDefinition:t,EnumTypeExtension:t};function t(e){var t=e.name.value,e=(c[t]||(c[t]=Object.create(null)),null!=(e=e.values)?e:[]),n=c[t];for(const a of e){var r=a.name.value,i=s[t];isEnumType(i)&&i.getValue(r)?o.reportError(new GraphQLError(`Enum value "${t}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:a.name})):n[r]?o.reportError(new GraphQLError(`Enum value "${t}.${r}" can only be defined once.`,{nodes:[n[r],a.name]})):n[r]=a.name}return!1}}function UniqueFieldDefinitionNamesRule(a){var e=a.getSchema();const o=e?e.getTypeMap():Object.create(null),s=Object.create(null);return{InputObjectTypeDefinition:t,InputObjectTypeExtension:t,InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){var t=e.name.value,e=(s[t]||(s[t]=Object.create(null)),null!=(e=e.fields)?e:[]),n=s[t];for(const i of e){var r=i.name.value;hasField(o[t],r)?a.reportError(new GraphQLError(`Field "${t}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:i.name})):n[r]?a.reportError(new GraphQLError(`Field "${t}.${r}" can only be defined once.`,{nodes:[n[r],i.name]})):n[r]=i.name}return!1}}function hasField(e,t){return!!(isObjectType(e)||isInterfaceType(e)||isInputObjectType(e))&&null!=e.getFields()[t]}function UniqueFragmentNamesRule(n){const r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(e){var t=e.name.value;return r[t]?n.reportError(new GraphQLError(`There can be only one fragment named "${t}".`,{nodes:[r[t],e.name]})):r[t]=e.name,!1}}}function UniqueInputFieldNamesRule(n){const t=[];let r=Object.create(null);return{ObjectValue:{enter(){t.push(r),r=Object.create(null)},leave(){var e=t.pop();e||invariant(!1),r=e}},ObjectField(e){var t=e.name.value;r[t]?n.reportError(new GraphQLError(`There can be only one input field named "${t}".`,{nodes:[r[t],e.name]})):r[t]=e.name}}}function UniqueOperationNamesRule(t){const n=Object.create(null);return{OperationDefinition(e){e=e.name;return e&&(n[e.value]?t.reportError(new GraphQLError(`There can be only one operation named "${e.value}".`,{nodes:[n[e.value],e]})):n[e.value]=e),!1},FragmentDefinition:()=>!1}}function UniqueOperationTypesRule(i){var e=i.getSchema();const a=Object.create(null),o=e?{query:e.getQueryType(),mutation:e.getMutationType(),subscription:e.getSubscriptionType()}:{};return{SchemaDefinition:t,SchemaExtension:t};function t(e){for(const r of null!=(e=e.operationTypes)?e:[]){var t=r.operation,n=a[t];o[t]?i.reportError(new GraphQLError(`Type for ${t} already defined in the schema. It cannot be redefined.`,{nodes:r})):n?i.reportError(new GraphQLError(`There can be only one ${t} type in schema.`,{nodes:[n,r]})):a[t]=r}return!1}}function UniqueTypeNamesRule(n){const r=Object.create(null),i=n.getSchema();return{ScalarTypeDefinition:e,ObjectTypeDefinition:e,InterfaceTypeDefinition:e,UnionTypeDefinition:e,EnumTypeDefinition:e,InputObjectTypeDefinition:e};function e(e){var t=e.name.value;if(null===i||void 0===i||!i.getType(t))return r[t]?n.reportError(new GraphQLError(`There can be only one type named "${t}".`,{nodes:[r[t],e.name]})):r[t]=e.name,!1;n.reportError(new GraphQLError(`Type "${t}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:e.name}))}}function UniqueVariableNamesRule(r){return{OperationDefinition(e){var t,n;for([t,n]of groupBy(null!=(e=e.variableDefinitions)?e:[],e=>e.variable.name.value))1<n.length&&r.reportError(new GraphQLError(`There can be only one variable named "$${t}".`,{nodes:n.map(e=>e.variable.name)}))}}}function ValuesOfCorrectTypeRule(a){let o={};return{OperationDefinition:{enter(){o={}}},VariableDefinition(e){o[e.variable.name.value]=e},ListValue(e){if(!isListType(getNullableType(a.getParentInputType())))return isValidValueNode(a,e),!1},ObjectValue(e){var t=getNamedType(a.getInputType());if(!isInputObjectType(t))return isValidValueNode(a,e),!1;var n,r=keyMap(e.fields,e=>e.name.value);for(const i of Object.values(t.getFields()))!r[i.name]&&isRequiredInputField(i)&&(n=inspect(i.type),a.reportError(new GraphQLError(`Field "${t.name}.${i.name}" of required type "${n}" was not provided.`,{nodes:e})));t.isOneOf&&validateOneOfInputObject(a,e,t,r,o)},ObjectField(e){var t,n=getNamedType(a.getParentInputType());!a.getInputType()&&isInputObjectType(n)&&(t=suggestionList(e.name.value,Object.keys(n.getFields())),a.reportError(new GraphQLError(`Field "${e.name.value}" is not defined by type "${n.name}".`+didYouMean(t),{nodes:e})))},NullValue(e){var t=a.getInputType();isNonNullType(t)&&a.reportError(new GraphQLError(`Expected value of type "${inspect(t)}", found ${print(e)}.`,{nodes:e}))},EnumValue:e=>isValidValueNode(a,e),IntValue:e=>isValidValueNode(a,e),FloatValue:e=>isValidValueNode(a,e),StringValue:e=>isValidValueNode(a,e),BooleanValue:e=>isValidValueNode(a,e)}}function isValidValueNode(t,n){var r=t.getInputType();if(r){var e,i=getNamedType(r);if(isLeafType(i))try{void 0===i.parseLiteral(n,void 0)&&(e=inspect(r),t.reportError(new GraphQLError(`Expected value of type "${e}", found ${print(n)}.`,{nodes:n})))}catch(e){i=inspect(r);e instanceof GraphQLError?t.reportError(e):t.reportError(new GraphQLError(`Expected value of type "${i}", found ${print(n)}; `+e.message,{nodes:n,originalError:e}))}else e=inspect(r),t.reportError(new GraphQLError(`Expected value of type "${e}", found ${print(n)}.`,{nodes:n}))}}function validateOneOfInputObject(e,t,n,r,i){var a,o,s=Object.keys(r);1!==s.length?e.reportError(new GraphQLError(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]})):(o=!(r=null==(r=r[s[0]])?void 0:r.value)||r.kind===Kind.NULL,a=(null==r?void 0:r.kind)===Kind.VARIABLE,o?e.reportError(new GraphQLError(`Field "${n.name}.${s[0]}" must be non-null.`,{nodes:[t]})):a&&i[o=r.name.value].type.kind!==Kind.NON_NULL_TYPE&&e.reportError(new GraphQLError(`Variable "${o}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[t]})))}function VariablesAreInputTypesRule(r){return{VariableDefinition(e){var t,n=typeFromAST(r.getSchema(),e.type);void 0===n||isInputType(n)||(n=e.variable.name.value,t=print(e.type),r.reportError(new GraphQLError(`Variable "$${n}" cannot be non-input type "${t}".`,{nodes:e.type})))}}}function VariablesInAllowedPositionRule(u){let p=Object.create(null);return{OperationDefinition:{enter(){p=Object.create(null)},leave(e){var t,n,r,i;for({node:t,type:n,defaultValue:r,parentType:i}of u.getRecursiveVariableUsages(e)){var a,o,s,c=t.name.value,l=p[c];l&&n&&((a=typeFromAST(o=u.getSchema(),l.type))&&!allowedVariableUsage(o,a,l.defaultValue,n,r)&&(o=inspect(a),s=inspect(n),u.reportError(new GraphQLError(`Variable "$${c}" of type "${o}" used in position expecting type "${s}".`,{nodes:[l,t]}))),isInputObjectType(i))&&i.isOneOf&&isNullableType(a)&&u.reportError(new GraphQLError(`Variable "$${c}" is of type "${a}" but must be non-nullable to be used for OneOf Input Object "${i}".`,{nodes:[l,t]}))}}},VariableDefinition(e){p[e.variable.name.value]=e}}}function allowedVariableUsage(e,t,n,r,i){return isNonNullType(r)&&!isNonNullType(t)?(null!=n&&n.kind!==Kind.NULL||void 0!==i)&&isTypeSubTypeOf(e,t,r.ofType):isTypeSubTypeOf(e,t,r)}const recommendedRules=Object.freeze([MaxIntrospectionDepthRule]),specifiedRules=Object.freeze([ExecutableDefinitionsRule,UniqueOperationNamesRule,LoneAnonymousOperationRule,SingleFieldSubscriptionsRule,KnownTypeNamesRule,FragmentsOnCompositeTypesRule,VariablesAreInputTypesRule,ScalarLeafsRule,FieldsOnCorrectTypeRule,UniqueFragmentNamesRule,KnownFragmentNamesRule,NoUnusedFragmentsRule,PossibleFragmentSpreadsRule,NoFragmentCyclesRule,UniqueVariableNamesRule,NoUndefinedVariablesRule,NoUnusedVariablesRule,KnownDirectivesRule,UniqueDirectivesPerLocationRule,KnownArgumentNamesRule,UniqueArgumentNamesRule,ValuesOfCorrectTypeRule,ProvidedRequiredArgumentsRule,VariablesInAllowedPositionRule,OverlappingFieldsCanBeMergedRule,UniqueInputFieldNamesRule,...recommendedRules]),specifiedSDLRules=Object.freeze([LoneSchemaDefinitionRule,UniqueOperationTypesRule,UniqueTypeNamesRule,UniqueEnumValueNamesRule,UniqueFieldDefinitionNamesRule,UniqueArgumentDefinitionNamesRule,UniqueDirectiveNamesRule,KnownTypeNamesRule,KnownDirectivesRule,UniqueDirectivesPerLocationRule,PossibleTypeExtensionsRule,KnownArgumentNamesOnDirectivesRule,UniqueArgumentNamesRule,UniqueInputFieldNamesRule,ProvidedRequiredArgumentsOnDirectivesRule]);class ASTValidationContext{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const n of this.getDocument().definitions)n.kind===Kind.FRAGMENT_DEFINITION&&(t[n.name.value]=n);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];for(var n,r=[e];n=r.pop();)for(const i of n.selections)i.kind===Kind.FRAGMENT_SPREAD?t.push(i):i.selectionSet&&r.push(i.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];for(var n,r=Object.create(null),i=[e.selectionSet];n=i.pop();)for(const o of this.getFragmentSpreads(n)){var a=o.name.value;!0!==r[a]&&(r[a]=!0,a=this.getFragment(a))&&(t.push(a),i.push(a.selectionSet))}this._recursivelyReferencedFragments.set(e,t)}return t}}class SDLValidationContext extends ASTValidationContext{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new TypeInfo(this._schema);visit(e,visitWithTypeInfo(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue(),parentType:r.getParentInputType()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function validate(e,t,n=specifiedRules,r,i=new TypeInfo(e)){const a=null!=(r=null==r?void 0:r.maxErrors)?r:100,o=(t||devAssert(!1,"Must provide document."),assertValidSchema(e),Object.freeze({})),s=[],c=new ValidationContext(e,t,i,e=>{if(s.length>=a)throw s.push(new GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),o;s.push(e)});r=visitInParallel(n.map(e=>e(c)));try{visit(t,visitWithTypeInfo(i,r))}catch(e){if(e!==o)throw e}return s}function validateSDL(e,t,n=specifiedSDLRules){const r=[],i=new SDLValidationContext(e,t,e=>{r.push(e)});return visit(e,visitInParallel(n.map(e=>e(i)))),r}function assertValidSDL(e){e=validateSDL(e);if(0!==e.length)throw new Error(e.map(e=>e.message).join("\n\n"))}function assertValidSDLExtension(e,t){e=validateSDL(e,t);if(0!==e.length)throw new Error(e.map(e=>e.message).join("\n\n"))}function memoize3(o){let s;return function(e,t,n){let r=(s=void 0===s?new WeakMap:s).get(e),i=(void 0===r&&(r=new WeakMap,s.set(e,r)),r.get(t)),a=(void 0===i&&(i=new WeakMap,r.set(t,i)),i.get(n));return void 0===a&&(a=o(e,t,n),i.set(n,a)),a}}function promiseForObject(i){return Promise.all(Object.values(i)).then(e=>{var t,n,r=Object.create(null);for([t,n]of Object.keys(i).entries())r[n]=e[t];return r})}function promiseReduce(e,t,n){let r=n;for(const i of e)r=isPromise(r)?r.then(e=>t(e,i)):t(r,i);return r}function toError(e){return e instanceof Error?e:new NonErrorThrown(e)}class NonErrorThrown extends Error{constructor(e){super("Unexpected error value: "+inspect(e)),this.name="NonErrorThrown",this.thrownValue=e}}function locatedError(e,t,n){var r,e=toError(e);return isLocatedGraphQLError(e)?e:new GraphQLError(e.message,{nodes:null!=(r=e.nodes)?r:t,source:e.source,positions:e.positions,path:n,originalError:e})}function isLocatedGraphQLError(e){return Array.isArray(e.path)}const collectSubfields=memoize3((e,t,n)=>collectSubfields$1(e.schema,e.fragments,e.variableValues,t,n));function execute(e){arguments.length<2||devAssert(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");var{schema:t,document:n,variableValues:r,rootValue:i}=e;assertValidExecutionArguments(t,n,r);const a=buildExecutionContext(e);if(!("schema"in a))return{errors:a};try{var o=a["operation"],s=executeOperation(a,o,i);return isPromise(s)?s.then(e=>buildResponse(e,a.errors),e=>(a.errors.push(e),buildResponse(null,a.errors))):buildResponse(s,a.errors)}catch(e){return a.errors.push(e),buildResponse(null,a.errors)}}function executeSync(e){e=execute(e);if(isPromise(e))throw new Error("GraphQL execution failed to complete synchronously.");return e}function buildResponse(e,t){return 0===t.length?{data:e}:{errors:t,data:e}}function assertValidExecutionArguments(e,t,n){t||devAssert(!1,"Must provide document."),assertValidSchema(e),null==n||isObjectLike(n)||devAssert(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function buildExecutionContext(e){var t,{schema:e,document:n,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:s,typeResolver:c,subscribeFieldResolver:l,options:u}=e;let p;var d=Object.create(null);for(const y of n.definitions)switch(y.kind){case Kind.OPERATION_DEFINITION:if(null==o){if(void 0!==p)return[new GraphQLError("Must provide operation name if query contains multiple operations.")];p=y}else(null==(t=y.name)?void 0:t.value)===o&&(p=y);break;case Kind.FRAGMENT_DEFINITION:d[y.name.value]=y}return p?(a=getVariableValues(e,null!=(n=p.variableDefinitions)?n:[],null!=a?a:{},{maxErrors:null!=(n=null==u?void 0:u.maxCoercionErrors)?n:50})).errors||{schema:e,fragments:d,rootValue:r,contextValue:i,operation:p,variableValues:a.coerced,fieldResolver:null!=s?s:defaultFieldResolver,typeResolver:null!=c?c:defaultTypeResolver,subscribeFieldResolver:null!=l?l:defaultFieldResolver,errors:[]}:null!=o?[new GraphQLError(`Unknown operation named "${o}".`)]:[new GraphQLError("Must provide an operation.")]}function executeOperation(e,t,n){var r=e.schema.getRootType(t.operation);if(null==r)throw new GraphQLError(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});var i=collectFields(e.schema,e.fragments,e.variableValues,r,t.selectionSet);switch(t.operation){case OperationTypeNode.QUERY:return executeFields(e,r,n,void 0,i);case OperationTypeNode.MUTATION:return executeFieldsSerially(e,r,n,void 0,i);case OperationTypeNode.SUBSCRIPTION:return executeFields(e,r,n,void 0,i)}}function executeFieldsSerially(i,a,o,s,e){return promiseReduce(e.entries(),(t,[n,e])=>{var r=addPath(s,n,a.name),e=executeField(i,a,o,e,r);if(void 0!==e){if(isPromise(e))return e.then(e=>(t[n]=e,t));t[n]=e}return t},Object.create(null))}function executeFields(e,t,n,r,i){var a=Object.create(null);let o=!1;try{for(var[s,c]of i.entries()){var l=addPath(r,s,t.name),u=executeField(e,t,n,c,l);void 0!==u&&isPromise(a[s]=u)&&(o=!0)}}catch(e){if(o)return promiseForObject(a).finally(()=>{throw e});throw e}return o?promiseForObject(a):a}function executeField(t,e,n,r,i){var a=getFieldDef(t.schema,e,r[0]);if(a){const c=a.type;var o=null!=(o=a.resolve)?o:t.fieldResolver;const l=buildResolveInfo(t,a,r,e,i);try{var s=o(n,getArgumentValues(a,r[0],t.variableValues),t.contextValue,l);let e;return e=isPromise(s)?s.then(e=>completeValue(t,c,r,l,i,e)):completeValue(t,c,r,l,i,s),isPromise(e)?e.then(void 0,e=>{return handleFieldError(locatedError(e,r,pathToArray(i)),c,t)}):e}catch(e){return handleFieldError(locatedError(e,r,pathToArray(i)),c,t)}}}function buildResolveInfo(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function handleFieldError(e,t,n){if(isNonNullType(t))throw e;return n.errors.push(e),null}function completeValue(e,t,n,r,i,a){if(a instanceof Error)throw a;if(isNonNullType(t)){var o=completeValue(e,t.ofType,n,r,i,a);if(null===o)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return o}return null==a?null:isListType(t)?completeListValue(e,t,n,r,i,a):isLeafType(t)?completeLeafValue(t,a):isAbstractType(t)?completeAbstractValue(e,t,n,r,i,a):isObjectType(t)?completeObjectValue(e,t,n,r,i,a):void invariant(!1,"Cannot complete value of unexpected output type: "+inspect(t))}function completeListValue(r,e,i,a,o,t){if(!isIterableObject(t))throw new GraphQLError(`Expected Iterable, but did not find one for field "${a.parentType.name}.${a.fieldName}".`);const s=e.ofType;let c=!1;e=Array.from(t,(t,e)=>{const n=addPath(o,e,void 0);try{let e;return e=isPromise(t)?t.then(e=>completeValue(r,s,i,a,n,e)):completeValue(r,s,i,a,n,t),isPromise(e)?(c=!0,e.then(void 0,e=>{return handleFieldError(locatedError(e,i,pathToArray(n)),s,r)})):e}catch(e){return handleFieldError(locatedError(e,i,pathToArray(n)),s,r)}});return c?Promise.all(e):e}function completeLeafValue(e,t){var n=e.serialize(t);if(null==n)throw new Error(`Expected \`${inspect(e)}.serialize(${inspect(t)})\` to `+"return non-nullable value, returned: "+inspect(n));return n}function completeAbstractValue(t,n,r,i,a,o){var e=null!=(e=n.resolveType)?e:t.typeResolver,s=t.contextValue,e=e(o,s,i,n);return isPromise(e)?e.then(e=>completeObjectValue(t,ensureValidRuntimeType(e,t,n,r,i,o),r,i,a,o)):completeObjectValue(t,ensureValidRuntimeType(e,t,n,r,i,o),r,i,a,o)}function ensureValidRuntimeType(e,t,n,r,i,a){if(null==e)throw new GraphQLError(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if(isObjectType(e))throw new GraphQLError("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if("string"!=typeof e)throw new GraphQLError(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with `+`value ${inspect(a)}, received "${inspect(e)}".`);i=t.schema.getType(e);if(null==i)throw new GraphQLError(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!isObjectType(i))throw new GraphQLError(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(t.schema.isSubType(n,i))return i;throw new GraphQLError(`Runtime Object type "${i.name}" is not a possible type for "${n.name}".`,{nodes:r})}function completeObjectValue(t,n,r,e,i,a){const o=collectSubfields(t,n,r);if(n.isTypeOf){e=n.isTypeOf(a,t.contextValue,e);if(isPromise(e))return e.then(e=>{if(e)return executeFields(t,n,a,i,o);throw invalidReturnTypeError(n,a,r)});if(!e)throw invalidReturnTypeError(n,a,r)}return executeFields(t,n,a,i,o)}function invalidReturnTypeError(e,t,n){return new GraphQLError(`Expected value of type "${e.name}" but got: ${inspect(t)}.`,{nodes:n})}const defaultTypeResolver=function(t,n,r,e){if(isObjectLike(t)&&"string"==typeof t.__typename)return t.__typename;const i=r.schema.getPossibleTypes(e);var a=[];for(let e=0;e<i.length;e++){var o=i[e];if(o.isTypeOf){var s=o.isTypeOf(t,n,r);if(isPromise(s))a[e]=s;else if(s)return o.name}}return a.length?Promise.all(a).then(t=>{for(let e=0;e<t.length;e++)if(t[e])return i[e].name}):void 0},defaultFieldResolver=function(e,t,n,r){var i;if(isObjectLike(e)||"function"==typeof e)return"function"==typeof(i=e[r.fieldName])?e[r.fieldName](t,n,r):i};function getFieldDef(e,t,n){n=n.name.value;return n===SchemaMetaFieldDef.name&&e.getQueryType()===t?SchemaMetaFieldDef:n===TypeMetaFieldDef.name&&e.getQueryType()===t?TypeMetaFieldDef:n===TypeNameMetaFieldDef.name?TypeNameMetaFieldDef:t.getFields()[n]}function graphql$1(t){return new Promise(e=>e(graphqlImpl(t)))}function graphqlSync(e){e=graphqlImpl(e);if(isPromise(e))throw new Error("GraphQL execution failed to complete synchronously.");return e}function graphqlImpl(e){arguments.length<2||devAssert(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");var{schema:t,source:n,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:s,typeResolver:c}=e,l=validateSchema(t);if(0<l.length)return{errors:l};let u;try{u=parse$1(n)}catch(e){return{errors:[e]}}l=validate(t,u);return 0<l.length?{errors:l}:execute({schema:t,document:u,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:s,typeResolver:c})}function isAsyncIterable(e){return"function"==typeof(null==e?void 0:e[Symbol.asyncIterator])}function mapAsyncIterator(e,t){const n=e[Symbol.asyncIterator]();async function r(e){if(e.done)return e;try{return{value:await t(e.value),done:!1}}catch(e){if("function"==typeof n.return)try{await n.return()}catch(e){}throw e}}return{async next(){return r(await n.next())},async return(){return"function"==typeof n.return?r(await n.return()):{value:void 0,done:!0}},async throw(e){if("function"==typeof n.throw)return r(await n.throw(e));throw e},[Symbol.asyncIterator](){return this}}}async function subscribe(t){arguments.length<2||devAssert(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");var e=await createSourceEventStream(t);return isAsyncIterable(e)?mapAsyncIterator(e,e=>execute({...t,rootValue:e})):e}function toNormalizedArgs(e){var t=e[0];return t&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}async function createSourceEventStream(...e){var e=toNormalizedArgs(e),{schema:t,document:n,variableValues:r}=e,t=(assertValidExecutionArguments(t,n,r),buildExecutionContext(e));if(!("schema"in t))return{errors:t};try{var i=await executeSubscription(t);if(isAsyncIterable(i))return i;throw new Error("Subscription field must return Async Iterable. "+`Received: ${inspect(i)}.`)}catch(e){if(e instanceof GraphQLError)return{errors:[e]};throw e}}async function executeSubscription(e){var{schema:t,fragments:n,operation:r,variableValues:i,rootValue:a}=e,o=t.getSubscriptionType();if(null==o)throw new GraphQLError("Schema is not configured to execute subscription operation.",{nodes:r});var[n,r]=[...collectFields(t,n,i,o,r.selectionSet).entries()][0],t=getFieldDef(t,o,r[0]);if(!t)throw s=r[0].name.value,new GraphQLError(`The subscription field "${s}" is not defined.`,{nodes:r});var s=addPath(void 0,n,o.name),n=buildResolveInfo(e,t,r,o,s);try{var c,l=getArgumentValues(t,r[0],i),u=e.contextValue,p=await(null!=(c=t.subscribe)?c:e.subscribeFieldResolver)(a,l,u,n);if(p instanceof Error)throw p;return p}catch(e){throw locatedError(e,r,pathToArray(s))}}function NoDeprecatedCustomRule(a){return{Field(e){var t,n=a.getFieldDef(),r=null==n?void 0:n.deprecationReason;n&&null!=r&&(null==(t=a.getParentType())&&invariant(!1),a.reportError(new GraphQLError(`The field ${t.name}.${n.name} is deprecated. `+r,{nodes:e})))},Argument(e){var t,n,r=a.getArgument(),i=null==r?void 0:r.deprecationReason;r&&null!=i&&(null!=(t=a.getDirective())?a.reportError(new GraphQLError(`Directive "@${t.name}" argument "${r.name}" is deprecated. `+i,{nodes:e})):(t=a.getParentType(),n=a.getFieldDef(),null!=t&&null!=n||invariant(!1),a.reportError(new GraphQLError(`Field "${t.name}.${n.name}" argument "${r.name}" is deprecated. `+i,{nodes:e}))))},ObjectField(e){var t,n,r=getNamedType(a.getParentInputType());isInputObjectType(r)&&null!=(n=null==(t=r.getFields()[e.name.value])?void 0:t.deprecationReason)&&a.reportError(new GraphQLError(`The input field ${r.name}.${t.name} is deprecated. `+n,{nodes:e}))},EnumValue(e){var t,n=a.getEnumValue(),r=null==n?void 0:n.deprecationReason;n&&null!=r&&(null==(t=getNamedType(a.getInputType()))&&invariant(!1),a.reportError(new GraphQLError(`The enum value "${t.name}.${n.name}" is deprecated. `+r,{nodes:e})))}}}function NoSchemaIntrospectionCustomRule(n){return{Field(e){var t=getNamedType(n.getType());t&&isIntrospectionType(t)&&n.reportError(new GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${e.name.value}".`,{nodes:e}))}}}function getIntrospectionQuery(e){const t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e};var e=t.descriptions?"description":"",n=t.specifiedByUrl?"specifiedByURL":"",r=t.directiveIsRepeatable?"isRepeatable":"",i=t.schemaDescription?e:"";function a(e){return t.inputValueDeprecation?e:""}var o=t.oneOf?"isOneOf":"";return`
    query IntrospectionQuery {
      __schema {
        ${i}
        queryType { name kind }
        mutationType { name kind }
        subscriptionType { name kind }
        types {
          ...FullType
        }
        directives {
          name
          ${e}
          ${r}
          locations
          args${a("(includeDeprecated: true)")} {
            ...InputValue
          }
        }
      }
    }

    fragment FullType on __Type {
      kind
      name
      ${e}
      ${n}
      ${o}
      fields(includeDeprecated: true) {
        name
        ${e}
        args${a("(includeDeprecated: true)")} {
          ...InputValue
        }
        type {
          ...TypeRef
        }
        isDeprecated
        deprecationReason
      }
      inputFields${a("(includeDeprecated: true)")} {
        ...InputValue
      }
      interfaces {
        ...TypeRef
      }
      enumValues(includeDeprecated: true) {
        name
        ${e}
        isDeprecated
        deprecationReason
      }
      possibleTypes {
        ...TypeRef
      }
    }

    fragment InputValue on __InputValue {
      name
      ${e}
      type { ...TypeRef }
      defaultValue
      ${a("isDeprecated")}
      ${a("deprecationReason")}
    }

    fragment TypeRef on __Type {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
              ofType {
                kind
                name
                ofType {
                  kind
                  name
                  ofType {
                    kind
                    name
                    ofType {
                      kind
                      name
                      ofType {
                        kind
                        name
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  `}function getOperationAST(e,t){let n=null;for(const i of e.definitions){var r;if(i.kind===Kind.OPERATION_DEFINITION)if(null==t){if(n)return null;n=i}else if((null==(r=i.name)?void 0:r.value)===t)return i}return n}function getOperationRootType(e,t){if("query"===t.operation){var n=e.getQueryType();if(n)return n;throw new GraphQLError("Schema does not define the required query root type.",{nodes:t})}if("mutation"===t.operation){n=e.getMutationType();if(n)return n;throw new GraphQLError("Schema is not configured for mutations.",{nodes:t})}if("subscription"!==t.operation)throw new GraphQLError("Can only have query, mutation and subscription operations.",{nodes:t});n=e.getSubscriptionType();if(n)return n;throw new GraphQLError("Schema is not configured for subscriptions.",{nodes:t})}function introspectionFromSchema(e,t){e=executeSync({schema:e,document:parse$1(getIntrospectionQuery({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,oneOf:!0,...t}))});return!e.errors&&e.data||invariant(!1),e.data}function buildClientSchema(e,t){isObjectLike(e)&&isObjectLike(e.__schema)||devAssert(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${inspect(e)}.`);e=e.__schema;const n=keyValMap(e.types,e=>e.name,e=>{var t=e;if(null!=t&&null!=t.name&&null!=t.kind)switch(t.kind){case TypeKind.SCALAR:return function(e){return new GraphQLScalarType({name:e.name,description:e.description,specifiedByURL:e.specifiedByURL})}(t);case TypeKind.OBJECT:return function(e){return new GraphQLObjectType({name:e.name,description:e.description,interfaces:()=>p(e),fields:()=>d(e)})}(t);case TypeKind.INTERFACE:return function(e){return new GraphQLInterfaceType({name:e.name,description:e.description,interfaces:()=>p(e),fields:()=>d(e)})}(t);case TypeKind.UNION:return function(e){if(e.possibleTypes)return new GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(l)});{var t=inspect(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}}(t);case TypeKind.ENUM:return function(e){if(e.enumValues)return new GraphQLEnumType({name:e.name,description:e.description,values:keyValMap(e.enumValues,e=>e.name,e=>({description:e.description,deprecationReason:e.deprecationReason}))});{e=inspect(e);throw new Error(`Introspection result missing enumValues: ${e}.`)}}(t);case TypeKind.INPUT_OBJECT:return function(e){if(e.inputFields)return new GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>f(e.inputFields),isOneOf:e.isOneOf});{var t=inspect(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}}(t)}e=inspect(t);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${e}.`)});for(const m of[...specifiedScalarTypes,...introspectionTypes])n[m.name]&&(n[m.name]=m);var r=e.queryType?l(e.queryType):null,i=e.mutationType?l(e.mutationType):null,a=e.subscriptionType?l(e.subscriptionType):null,o=e.directives?e.directives.map(function(e){if(!e.args)throw t=inspect(e),new Error(`Introspection result missing directive args: ${t}.`);if(e.locations)return new GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:f(e.args)});{var t=inspect(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}}):[];return new GraphQLSchema({description:e.description,query:r,mutation:i,subscription:a,types:Object.values(n),directives:o,assumeValid:null==t?void 0:t.assumeValid});function s(e){if(e.kind===TypeKind.LIST){var t=e.ofType;if(t)return new GraphQLList(s(t))}else{if(e.kind!==TypeKind.NON_NULL)return c(e);t=e.ofType;if(t)return e=s(t),new GraphQLNonNull(assertNullableType(e))}throw new Error("Decorated type deeper than introspection query.")}function c(e){var t=e.name;if(!t)throw new Error(`Unknown type reference: ${inspect(e)}.`);e=n[t];if(e)return e;throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`)}function l(e){return assertObjectType(c(e))}function u(e){return assertInterfaceType(c(e))}function p(e){if(null===e.interfaces&&e.kind===TypeKind.INTERFACE)return[];if(e.interfaces)return e.interfaces.map(u);throw e=inspect(e),new Error(`Introspection result missing interfaces: ${e}.`)}function d(e){if(e.fields)return keyValMap(e.fields,e=>e.name,y);throw new Error(`Introspection result missing fields: ${inspect(e)}.`)}function y(e){var t,n=s(e.type);if(!isOutputType(n))throw t=inspect(n),new Error(`Introspection must provide output type for fields, but received: ${t}.`);if(e.args)return{description:e.description,deprecationReason:e.deprecationReason,type:n,args:f(e.args)};throw t=inspect(e),new Error(`Introspection result missing field args: ${t}.`)}function f(e){return keyValMap(e,e=>e.name,h)}function h(e){var t,n=s(e.type);if(isInputType(n))return t=null!=e.defaultValue?valueFromAST(parseValue(e.defaultValue),n):void 0,{description:e.description,type:n,defaultValue:t,deprecationReason:e.deprecationReason};throw t=inspect(n),new Error(`Introspection must provide input type for arguments, but received: ${t}.`)}}function extendSchema(e,t,n){assertSchema(e),null!=t&&t.kind===Kind.DOCUMENT||devAssert(!1,"Must provide valid Document AST."),!0!==(null==n?void 0:n.assumeValid)&&!0!==(null==n?void 0:n.assumeValidSDL)&&assertValidSDLExtension(t,e);var r=e.toConfig(),t=extendSchemaImpl(r,t,n);return r===t?e:new GraphQLSchema(t)}function extendSchemaImpl(e,t,n){var r,i=[];const u=Object.create(null);var a=[];let o;var s,c,l=[];for(const A of t.definitions)A.kind===Kind.SCHEMA_DEFINITION?o=A:A.kind===Kind.SCHEMA_EXTENSION?l.push(A):isTypeDefinitionNode(A)?i.push(A):isTypeExtensionNode(A)?(s=A.name.value,c=u[s],u[s]=c?c.concat([A]):[A]):A.kind===Kind.DIRECTIVE_DEFINITION&&a.push(A);if(0===Object.keys(u).length&&0===i.length&&0===a.length&&0===l.length&&null==o)return e;const p=Object.create(null);for(const O of e.types)p[O.name]=function(e){if(isIntrospectionType(e)||isSpecifiedScalarType(e))return e;if(isScalarType(e))return function(e){var t;var e=e.toConfig(),n=null!=(n=u[e.name])?n:[];let r=e.specifiedByURL;for(const i of n)r=null!=(t=getSpecifiedByURL(i))?t:r;return new GraphQLScalarType({...e,specifiedByURL:r,extensionASTNodes:e.extensionASTNodes.concat(n)})}(e);if(isObjectType(e))return function(e){var t;const n=e.toConfig(),r=null!=(t=u[n.name])?t:[];return new GraphQLObjectType({...n,interfaces:()=>[...e.getInterfaces().map(f),...N(r)],fields:()=>({...mapValue(n.fields,h),..._(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(e);if(isInterfaceType(e))return function(e){var t;const n=e.toConfig(),r=null!=(t=u[n.name])?t:[];return new GraphQLInterfaceType({...n,interfaces:()=>[...e.getInterfaces().map(f),...N(r)],fields:()=>({...mapValue(n.fields,h),..._(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(e);if(isUnionType(e))return function(e){var t;const n=e.toConfig(),r=null!=(t=u[n.name])?t:[];return new GraphQLUnionType({...n,types:()=>[...e.getTypes().map(f),...I(r)],extensionASTNodes:n.extensionASTNodes.concat(r)})}(e);if(isEnumType(e))return function(e){var t=e.toConfig(),e=null!=(e=u[e.name])?e:[];return new GraphQLEnumType({...t,values:{...t.values,...$(e)},extensionASTNodes:t.extensionASTNodes.concat(e)})}(e);if(isInputObjectType(e))return function(e){const t=e.toConfig(),n=null!=(e=u[t.name])?e:[];return new GraphQLInputObjectType({...t,fields:()=>({...mapValue(t.fields,e=>({...e,type:y(e.type)})),...E(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}(e);invariant(!1,"Unexpected type: "+inspect(e))}(O);for(const S of i){var d=S.name.value;p[d]=null!=(d=stdTypeMap[d])?d:function(e){var t,n;var r=e.name.value,i=null!=(t=u[r])?t:[];switch(e.kind){case Kind.OBJECT_TYPE_DEFINITION:{const o=[e,...i];return new GraphQLObjectType({name:r,description:null==(a=e.description)?void 0:a.value,interfaces:()=>N(o),fields:()=>_(o),astNode:e,extensionASTNodes:i})}case Kind.INTERFACE_TYPE_DEFINITION:{const s=[e,...i];return new GraphQLInterfaceType({name:r,description:null==(a=e.description)?void 0:a.value,interfaces:()=>N(s),fields:()=>_(s),astNode:e,extensionASTNodes:i})}case Kind.ENUM_TYPE_DEFINITION:var a=[e,...i];return new GraphQLEnumType({name:r,description:null==(n=e.description)?void 0:n.value,values:$(a),astNode:e,extensionASTNodes:i});case Kind.UNION_TYPE_DEFINITION:{const c=[e,...i];return new GraphQLUnionType({name:r,description:null==(n=e.description)?void 0:n.value,types:()=>I(c),astNode:e,extensionASTNodes:i})}case Kind.SCALAR_TYPE_DEFINITION:return new GraphQLScalarType({name:r,description:null==(a=e.description)?void 0:a.value,specifiedByURL:getSpecifiedByURL(e),astNode:e,extensionASTNodes:i});case Kind.INPUT_OBJECT_TYPE_DEFINITION:{const l=[e,...i];return new GraphQLInputObjectType({name:r,description:null==(n=e.description)?void 0:n.value,fields:()=>E(l),astNode:e,extensionASTNodes:i,isOneOf:isOneOf(e)})}}}(S)}var t={query:e.query&&f(e.query),mutation:e.mutation&&f(e.mutation),subscription:e.subscription&&f(e.subscription),...o&&g([o]),...g(l)};return{description:null==(r=o)||null==(r=r.description)?void 0:r.value,...t,types:Object.values(p),directives:[...e.directives.map(function(e){e=e.toConfig();return new GraphQLDirective({...e,args:mapValue(e.args,m)})}),...a.map(function(e){var t;return new GraphQLDirective({name:e.name.value,description:null==(t=e.description)?void 0:t.value,locations:e.locations.map(({value:e})=>e),isRepeatable:e.repeatable,args:b(e.arguments),astNode:e})})],extensions:Object.create(null),astNode:null!=(r=o)?r:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(l),assumeValid:null!=(t=null==n?void 0:n.assumeValid)&&t};function y(e){return isListType(e)?new GraphQLList(y(e.ofType)):isNonNullType(e)?new GraphQLNonNull(y(e.ofType)):f(e)}function f(e){return p[e.name]}function h(e){return{...e,type:y(e.type),args:e.args&&mapValue(e.args,m)}}function m(e){return{...e,type:y(e.type)}}function g(e){var t,n={};for(const r of e)for(const i of null!=(t=r.operationTypes)?t:[])n[i.operation]=v(i.type);return n}function v(e){var e=e.name.value,t=null!=(t=stdTypeMap[e])?t:p[e];if(void 0===t)throw new Error(`Unknown type: "${e}".`);return t}function T(e){return e.kind===Kind.LIST_TYPE?new GraphQLList(T(e.type)):e.kind===Kind.NON_NULL_TYPE?new GraphQLNonNull(T(e.type)):v(e)}function _(e){var t,n,r=Object.create(null);for(const i of e)for(const a of null!=(t=i.fields)?t:[])r[a.name.value]={type:T(a.type),description:null==(n=a.description)?void 0:n.value,args:b(a.arguments),deprecationReason:getDeprecationReason(a),astNode:a};return r}function b(e){var e=null!=e?e:[],t=Object.create(null);for(const i of e){var n,r=T(i.type);t[i.name.value]={type:r,description:null==(n=i.description)?void 0:n.value,defaultValue:valueFromAST(i.defaultValue,r),deprecationReason:getDeprecationReason(i),astNode:i}}return t}function E(e){var t,n=Object.create(null);for(const a of e)for(const o of null!=(t=a.fields)?t:[]){var r,i=T(o.type);n[o.name.value]={type:i,description:null==(r=o.description)?void 0:r.value,defaultValue:valueFromAST(o.defaultValue,i),deprecationReason:getDeprecationReason(o),astNode:o}}return n}function $(e){var t,n,r=Object.create(null);for(const i of e)for(const a of null!=(t=i.values)?t:[])r[a.name.value]={description:null==(n=a.description)?void 0:n.value,deprecationReason:getDeprecationReason(a),astNode:a};return r}function N(e){return e.flatMap(e=>{return null!=(e=null==(e=e.interfaces)?void 0:e.map(v))?e:[]})}function I(e){return e.flatMap(e=>{return null!=(e=null==(e=e.types)?void 0:e.map(v))?e:[]})}}const stdTypeMap=keyMap([...specifiedScalarTypes,...introspectionTypes],e=>e.name);function getDeprecationReason(e){e=getDirectiveValues(GraphQLDeprecatedDirective,e);return null==e?void 0:e.reason}function getSpecifiedByURL(e){e=getDirectiveValues(GraphQLSpecifiedByDirective,e);return null==e?void 0:e.url}function isOneOf(e){return Boolean(getDirectiveValues(GraphQLOneOfDirective,e))}function buildASTSchema(e,t){null!=e&&e.kind===Kind.DOCUMENT||devAssert(!1,"Must provide valid Document AST."),!0!==(null==t?void 0:t.assumeValid)&&!0!==(null==t?void 0:t.assumeValidSDL)&&assertValidSDL(e);const n=extendSchemaImpl({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const r of n.types)switch(r.name){case"Query":n.query=r;break;case"Mutation":n.mutation=r;break;case"Subscription":n.subscription=r}e=[...n.directives,...specifiedDirectives.filter(t=>n.directives.every(e=>e.name!==t.name))];return new GraphQLSchema({...n,directives:e})}function buildSchema(e,t){return buildASTSchema(parse$1(e,{noLocation:null==t?void 0:t.noLocation,allowLegacyFragmentVariables:null==t?void 0:t.allowLegacyFragmentVariables}),{assumeValidSDL:null==t?void 0:t.assumeValidSDL,assumeValid:null==t?void 0:t.assumeValid})}function lexicographicSortSchema(e){e=e.toConfig();const t=keyValMap(sortByName(e.types),e=>e.name,function(e){if(isScalarType(e)||isIntrospectionType(e))return e;if(isObjectType(e)){const n=e.toConfig();return new GraphQLObjectType({...n,interfaces:()=>c(n.interfaces),fields:()=>s(n.fields)})}if(isInterfaceType(e)){const r=e.toConfig();return new GraphQLInterfaceType({...r,interfaces:()=>c(r.interfaces),fields:()=>s(r.fields)})}if(isUnionType(e)){const i=e.toConfig();return new GraphQLUnionType({...i,types:()=>c(i.types)})}{var t;if(isEnumType(e))return t=e.toConfig(),new GraphQLEnumType({...t,values:sortObjMap(t.values,e=>e)})}if(isInputObjectType(e)){const a=e.toConfig();return new GraphQLInputObjectType({...a,fields:()=>{return sortObjMap(a.fields,e=>({...e,type:o(e.type)}))}})}invariant(!1,"Unexpected type: "+inspect(e))});return new GraphQLSchema({...e,types:Object.values(t),directives:sortByName(e.directives).map(function(e){e=e.toConfig();return new GraphQLDirective({...e,locations:sortBy(e.locations,e=>e),args:i(e.args)})}),query:r(e.query),mutation:r(e.mutation),subscription:r(e.subscription)});function o(e){return isListType(e)?new GraphQLList(o(e.ofType)):isNonNullType(e)?new GraphQLNonNull(o(e.ofType)):n(e)}function n(e){return t[e.name]}function r(e){return e&&n(e)}function i(e){return sortObjMap(e,e=>({...e,type:o(e.type)}))}function s(e){return sortObjMap(e,e=>({...e,type:o(e.type),args:e.args&&i(e.args)}))}function c(e){return sortByName(e).map(n)}}function sortObjMap(e,t){var n=Object.create(null);for(const r of Object.keys(e).sort(naturalCompare))n[r]=t(e[r]);return n}function sortByName(e){return sortBy(e,e=>e.name)}function sortBy(e,n){return e.slice().sort((e,t)=>{return naturalCompare(n(e),n(t))})}function printSchema(e){return printFilteredSchema(e,e=>!isSpecifiedDirective(e),isDefinedType)}function printIntrospectionSchema(e){return printFilteredSchema(e,isSpecifiedDirective,isIntrospectionType)}function isDefinedType(e){return!isSpecifiedScalarType(e)&&!isIntrospectionType(e)}function printFilteredSchema(e,t,n){t=e.getDirectives().filter(t),n=Object.values(e.getTypeMap()).filter(n);return[printSchemaDefinition(e),...t.map(e=>printDirective(e)),...n.map(e=>printType(e))].filter(Boolean).join("\n\n")}function printSchemaDefinition(e){var t,n;if(null!=e.description||!isSchemaOfCommonNames(e))return t=[],(n=e.getQueryType())&&t.push("  query: "+n.name),(n=e.getMutationType())&&t.push("  mutation: "+n.name),(n=e.getSubscriptionType())&&t.push("  subscription: "+n.name),printDescription(e)+`schema {
${t.join("\n")}
}`}function isSchemaOfCommonNames(e){var t=e.getQueryType();return!(t&&"Query"!==t.name||(t=e.getMutationType())&&"Mutation"!==t.name||(t=e.getSubscriptionType())&&"Subscription"!==t.name)}function printType(e){return isScalarType(e)?printScalar(e):isObjectType(e)?printObject(e):isInterfaceType(e)?printInterface(e):isUnionType(e)?printUnion(e):isEnumType(e)?printEnum(e):isInputObjectType(e)?printInputObject(e):void invariant(!1,"Unexpected type: "+inspect(e))}function printScalar(e){return printDescription(e)+("scalar "+e.name)+printSpecifiedByURL(e)}function printImplementedInterfaces(e){e=e.getInterfaces();return e.length?" implements "+e.map(e=>e.name).join(" & "):""}function printObject(e){return printDescription(e)+("type "+e.name)+printImplementedInterfaces(e)+printFields(e)}function printInterface(e){return printDescription(e)+("interface "+e.name)+printImplementedInterfaces(e)+printFields(e)}function printUnion(e){var t=e.getTypes(),t=t.length?" = "+t.join(" | "):"";return printDescription(e)+"union "+e.name+t}function printEnum(e){var t=e.getValues().map((e,t)=>printDescription(e,"  ",!t)+"  "+e.name+printDeprecated(e.deprecationReason));return printDescription(e)+("enum "+e.name)+printBlock(t)}function printInputObject(e){var t=Object.values(e.getFields()).map((e,t)=>printDescription(e,"  ",!t)+"  "+printInputValue(e));return printDescription(e)+("input "+e.name)+(e.isOneOf?" @oneOf":"")+printBlock(t)}function printFields(e){return printBlock(Object.values(e.getFields()).map((e,t)=>printDescription(e,"  ",!t)+"  "+e.name+printArgs(e.args,"  ")+": "+String(e.type)+printDeprecated(e.deprecationReason)))}function printBlock(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function printArgs(e,n=""){return 0===e.length?"":e.every(e=>!e.description)?"("+e.map(printInputValue).join(", ")+")":"(\n"+e.map((e,t)=>printDescription(e,"  "+n,!t)+"  "+n+printInputValue(e)).join("\n")+"\n"+n+")"}function printInputValue(e){var t=astFromValue(e.defaultValue,e.type);let n=e.name+": "+String(e.type);return t&&(n+=" = "+print(t)),n+printDeprecated(e.deprecationReason)}function printDirective(e){return printDescription(e)+"directive @"+e.name+printArgs(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function printDeprecated(e){return null==e?"":e!==DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${print({kind:Kind.STRING,value:e})})`:" @deprecated"}function printSpecifiedByURL(e){return null==e.specifiedByURL?"":` @specifiedBy(url: ${print({kind:Kind.STRING,value:e.specifiedByURL})})`}function printDescription(e,t="",n=!0){e=e.description;return null==e?"":(t&&!n?"\n"+t:t)+print({kind:Kind.STRING,value:e,block:isPrintableAsBlockString(e)}).replace(/\n/g,"\n"+t)+"\n"}function concatAST(e){var t=[];for(const n of e)t.push(...n.definitions);return{kind:Kind.DOCUMENT,definitions:t}}function separateOperations(e){var t=[],n=Object.create(null);for(const i of e.definitions)switch(i.kind){case Kind.OPERATION_DEFINITION:t.push(i);break;case Kind.FRAGMENT_DEFINITION:n[i.name.value]=collectDependencies(i.selectionSet)}var r=Object.create(null);for(const a of t){const o=new Set;for(const s of collectDependencies(a.selectionSet))collectTransitiveDependencies(o,n,s);r[a.name?a.name.value:""]={kind:Kind.DOCUMENT,definitions:e.definitions.filter(e=>e===a||e.kind===Kind.FRAGMENT_DEFINITION&&o.has(e.name.value))}}return r}function collectTransitiveDependencies(e,t,n){if(!e.has(n)){e.add(n);n=t[n];if(void 0!==n)for(const r of n)collectTransitiveDependencies(e,t,r)}}function collectDependencies(e){const t=[];return visit(e,{FragmentSpread(e){t.push(e.name.value)}}),t}function stripIgnoredCharacters(e){var e=isSource(e)?e:new Source(e),t=e.body,n=new Lexer(e);let r="",i=!1;for(;n.advance().kind!==TokenKind.EOF;){var a=n.token,o=a.kind,s=!isPunctuatorTokenKind(a.kind),c=(!i||!s&&a.kind!==TokenKind.SPREAD||(r+=" "),t.slice(a.start,a.end));o===TokenKind.BLOCK_STRING?r+=printBlockString(a.value,{minimize:!0}):r+=c,i=s}return r}function assertValidName(e){var t=isValidNameError(e);if(t)throw t;return e}function isValidNameError(e){if("string"!=typeof e&&devAssert(!1,"Expected name to be a string."),e.startsWith("__"))return new GraphQLError(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{assertName(e)}catch(e){return e}}function findBreakingChanges(e,t){return findSchemaChanges(e,t).filter(e=>e.type in BreakingChangeType)}function findDangerousChanges(e,t){return findSchemaChanges(e,t).filter(e=>e.type in DangerousChangeType)}function findSchemaChanges(e,t){return[...findTypeChanges(e,t),...findDirectiveChanges(e,t)]}function findDirectiveChanges(e,t){var n,r,i=[],e=diff(e.getDirectives(),t.getDirectives());for(const o of e.removed)i.push({type:BreakingChangeType.DIRECTIVE_REMOVED,description:o.name+" was removed."});for([n,r]of e.persisted){var a=diff(n.args,r.args);for(const s of a.added)isRequiredArgument(s)&&i.push({type:BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${s.name} on directive ${n.name} was added.`});for(const c of a.removed)i.push({type:BreakingChangeType.DIRECTIVE_ARG_REMOVED,description:`${c.name} was removed from ${n.name}.`});n.isRepeatable&&!r.isRepeatable&&i.push({type:BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${n.name}.`});for(const l of n.locations)r.locations.includes(l)||i.push({type:BreakingChangeType.DIRECTIVE_LOCATION_REMOVED,description:`${l} was removed from ${n.name}.`})}return i}function findTypeChanges(e,t){var n,r,i=[],e=diff(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(const a of e.removed)i.push({type:BreakingChangeType.TYPE_REMOVED,description:isSpecifiedScalarType(a)?`Standard scalar ${a.name} was removed because it is not referenced anymore.`:a.name+" was removed."});for([n,r]of e.persisted)isEnumType(n)&&isEnumType(r)?i.push(...findEnumTypeChanges(n,r)):isUnionType(n)&&isUnionType(r)?i.push(...findUnionTypeChanges(n,r)):isInputObjectType(n)&&isInputObjectType(r)?i.push(...findInputObjectTypeChanges(n,r)):isObjectType(n)&&isObjectType(r)||isInterfaceType(n)&&isInterfaceType(r)?i.push(...findFieldChanges(n,r),...findImplementedInterfacesChanges(n,r)):n.constructor!==r.constructor&&i.push({type:BreakingChangeType.TYPE_CHANGED_KIND,description:n.name+" changed from "+`${typeKindName(n)} to ${typeKindName(r)}.`});return i}function findInputObjectTypeChanges(e,t){var n,r,i=[],t=diff(Object.values(e.getFields()),Object.values(t.getFields()));for(const a of t.added)isRequiredInputField(a)?i.push({type:BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${a.name} on input type ${e.name} was added.`}):i.push({type:DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${a.name} on input type ${e.name} was added.`});for(const o of t.removed)i.push({type:BreakingChangeType.FIELD_REMOVED,description:`${e.name}.${o.name} was removed.`});for([n,r]of t.persisted)isChangeSafeForInputObjectFieldOrFieldArg(n.type,r.type)||i.push({type:BreakingChangeType.FIELD_CHANGED_KIND,description:`${e.name}.${n.name} changed type from `+`${String(n.type)} to ${String(r.type)}.`});return i}function findUnionTypeChanges(e,t){var n=[],t=diff(e.getTypes(),t.getTypes());for(const r of t.added)n.push({type:DangerousChangeType.TYPE_ADDED_TO_UNION,description:`${r.name} was added to union type ${e.name}.`});for(const i of t.removed)n.push({type:BreakingChangeType.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${e.name}.`});return n}function findEnumTypeChanges(e,t){var n=[],t=diff(e.getValues(),t.getValues());for(const r of t.added)n.push({type:DangerousChangeType.VALUE_ADDED_TO_ENUM,description:`${r.name} was added to enum type ${e.name}.`});for(const i of t.removed)n.push({type:BreakingChangeType.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${e.name}.`});return n}function findImplementedInterfacesChanges(e,t){var n=[],t=diff(e.getInterfaces(),t.getInterfaces());for(const r of t.added)n.push({type:DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED,description:`${r.name} added to interfaces implemented by ${e.name}.`});for(const i of t.removed)n.push({type:BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${i.name}.`});return n}function findFieldChanges(e,t){var n,r,i=[],t=diff(Object.values(e.getFields()),Object.values(t.getFields()));for(const a of t.removed)i.push({type:BreakingChangeType.FIELD_REMOVED,description:`${e.name}.${a.name} was removed.`});for([n,r]of t.persisted)i.push(...findArgChanges(e,n,r)),isChangeSafeForObjectOrInterfaceField(n.type,r.type)||i.push({type:BreakingChangeType.FIELD_CHANGED_KIND,description:`${e.name}.${n.name} changed type from `+`${String(n.type)} to ${String(r.type)}.`});return i}function findArgChanges(e,t,n){var r,i,a,o,s=[],n=diff(t.args,n.args);for(const c of n.removed)s.push({type:BreakingChangeType.ARG_REMOVED,description:`${e.name}.${t.name} arg ${c.name} was removed.`});for([r,i]of n.persisted)isChangeSafeForInputObjectFieldOrFieldArg(r.type,i.type)?void 0!==r.defaultValue&&(void 0===i.defaultValue?s.push({type:DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${r.name} defaultValue was removed.`}):(a=stringifyValue(r.defaultValue,r.type))!==(o=stringifyValue(i.defaultValue,i.type))&&s.push({type:DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${r.name} has changed defaultValue from ${a} to ${o}.`})):s.push({type:BreakingChangeType.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${r.name} has changed type from `+`${String(r.type)} to ${String(i.type)}.`});for(const l of n.added)isRequiredArgument(l)?s.push({type:BreakingChangeType.REQUIRED_ARG_ADDED,description:`A required arg ${l.name} on ${e.name}.${t.name} was added.`}):s.push({type:DangerousChangeType.OPTIONAL_ARG_ADDED,description:`An optional arg ${l.name} on ${e.name}.${t.name} was added.`});return s}function isChangeSafeForObjectOrInterfaceField(e,t){return isListType(e)?isListType(t)&&isChangeSafeForObjectOrInterfaceField(e.ofType,t.ofType)||isNonNullType(t)&&isChangeSafeForObjectOrInterfaceField(e,t.ofType):isNonNullType(e)?isNonNullType(t)&&isChangeSafeForObjectOrInterfaceField(e.ofType,t.ofType):isNamedType(t)&&e.name===t.name||isNonNullType(t)&&isChangeSafeForObjectOrInterfaceField(e,t.ofType)}function isChangeSafeForInputObjectFieldOrFieldArg(e,t){return isListType(e)?isListType(t)&&isChangeSafeForInputObjectFieldOrFieldArg(e.ofType,t.ofType):isNonNullType(e)?isNonNullType(t)&&isChangeSafeForInputObjectFieldOrFieldArg(e.ofType,t.ofType)||!isNonNullType(t)&&isChangeSafeForInputObjectFieldOrFieldArg(e.ofType,t):isNamedType(t)&&e.name===t.name}function typeKindName(e){return isScalarType(e)?"a Scalar type":isObjectType(e)?"an Object type":isInterfaceType(e)?"an Interface type":isUnionType(e)?"a Union type":isEnumType(e)?"an Enum type":isInputObjectType(e)?"an Input type":void invariant(!1,"Unexpected type: "+inspect(e))}function stringifyValue(e,t){e=astFromValue(e,t);return null==e&&invariant(!1),print(sortValueNode(e))}function diff(e,t){var n=[],r=[],i=[],a=keyMap(e,({name:e})=>e),o=keyMap(t,({name:e})=>e);for(const c of e){var s=o[c.name];void 0===s?r.push(c):i.push([c,s])}for(const l of t)void 0===a[l.name]&&n.push(l);return{added:n,persisted:i,removed:r}}!function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"}(BreakingChangeType=BreakingChangeType||{}),function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"}(DangerousChangeType=DangerousChangeType||{});var graphql=Object.freeze({__proto__:null,BREAK:BREAK,get BreakingChangeType(){return BreakingChangeType},DEFAULT_DEPRECATION_REASON:DEFAULT_DEPRECATION_REASON,get DangerousChangeType(){return DangerousChangeType},get DirectiveLocation(){return DirectiveLocation},ExecutableDefinitionsRule:ExecutableDefinitionsRule,FieldsOnCorrectTypeRule:FieldsOnCorrectTypeRule,FragmentsOnCompositeTypesRule:FragmentsOnCompositeTypesRule,GRAPHQL_MAX_INT:GRAPHQL_MAX_INT,GRAPHQL_MIN_INT:GRAPHQL_MIN_INT,GraphQLBoolean:GraphQLBoolean,GraphQLDeprecatedDirective:GraphQLDeprecatedDirective,GraphQLDirective:GraphQLDirective,GraphQLEnumType:GraphQLEnumType,GraphQLError:GraphQLError,GraphQLFloat:GraphQLFloat,GraphQLID:GraphQLID,GraphQLIncludeDirective:GraphQLIncludeDirective,GraphQLInputObjectType:GraphQLInputObjectType,GraphQLInt:GraphQLInt,GraphQLInterfaceType:GraphQLInterfaceType,GraphQLList:GraphQLList,GraphQLNonNull:GraphQLNonNull,GraphQLObjectType:GraphQLObjectType,GraphQLOneOfDirective:GraphQLOneOfDirective,GraphQLScalarType:GraphQLScalarType,GraphQLSchema:GraphQLSchema,GraphQLSkipDirective:GraphQLSkipDirective,GraphQLSpecifiedByDirective:GraphQLSpecifiedByDirective,GraphQLString:GraphQLString,GraphQLUnionType:GraphQLUnionType,get Kind(){return Kind},KnownArgumentNamesRule:KnownArgumentNamesRule,KnownDirectivesRule:KnownDirectivesRule,KnownFragmentNamesRule:KnownFragmentNamesRule,KnownTypeNamesRule:KnownTypeNamesRule,Lexer:Lexer,Location:Location,LoneAnonymousOperationRule:LoneAnonymousOperationRule,LoneSchemaDefinitionRule:LoneSchemaDefinitionRule,MaxIntrospectionDepthRule:MaxIntrospectionDepthRule,NoDeprecatedCustomRule:NoDeprecatedCustomRule,NoFragmentCyclesRule:NoFragmentCyclesRule,NoSchemaIntrospectionCustomRule:NoSchemaIntrospectionCustomRule,NoUndefinedVariablesRule:NoUndefinedVariablesRule,NoUnusedFragmentsRule:NoUnusedFragmentsRule,NoUnusedVariablesRule:NoUnusedVariablesRule,get OperationTypeNode(){return OperationTypeNode},OverlappingFieldsCanBeMergedRule:OverlappingFieldsCanBeMergedRule,PossibleFragmentSpreadsRule:PossibleFragmentSpreadsRule,PossibleTypeExtensionsRule:PossibleTypeExtensionsRule,ProvidedRequiredArgumentsRule:ProvidedRequiredArgumentsRule,ScalarLeafsRule:ScalarLeafsRule,SchemaMetaFieldDef:SchemaMetaFieldDef,SingleFieldSubscriptionsRule:SingleFieldSubscriptionsRule,Source:Source,Token:Token,get TokenKind(){return TokenKind},TypeInfo:TypeInfo,get TypeKind(){return TypeKind},TypeMetaFieldDef:TypeMetaFieldDef,TypeNameMetaFieldDef:TypeNameMetaFieldDef,UniqueArgumentDefinitionNamesRule:UniqueArgumentDefinitionNamesRule,UniqueArgumentNamesRule:UniqueArgumentNamesRule,UniqueDirectiveNamesRule:UniqueDirectiveNamesRule,UniqueDirectivesPerLocationRule:UniqueDirectivesPerLocationRule,UniqueEnumValueNamesRule:UniqueEnumValueNamesRule,UniqueFieldDefinitionNamesRule:UniqueFieldDefinitionNamesRule,UniqueFragmentNamesRule:UniqueFragmentNamesRule,UniqueInputFieldNamesRule:UniqueInputFieldNamesRule,UniqueOperationNamesRule:UniqueOperationNamesRule,UniqueOperationTypesRule:UniqueOperationTypesRule,UniqueTypeNamesRule:UniqueTypeNamesRule,UniqueVariableNamesRule:UniqueVariableNamesRule,ValidationContext:ValidationContext,ValuesOfCorrectTypeRule:ValuesOfCorrectTypeRule,VariablesAreInputTypesRule:VariablesAreInputTypesRule,VariablesInAllowedPositionRule:VariablesInAllowedPositionRule,__Directive:__Directive,__DirectiveLocation:__DirectiveLocation,__EnumValue:__EnumValue,__Field:__Field,__InputValue:__InputValue,__Schema:__Schema,__Type:__Type,__TypeKind:__TypeKind,assertAbstractType:assertAbstractType,assertCompositeType:assertCompositeType,assertDirective:assertDirective,assertEnumType:assertEnumType,assertEnumValueName:assertEnumValueName,assertInputObjectType:assertInputObjectType,assertInputType:assertInputType,assertInterfaceType:assertInterfaceType,assertLeafType:assertLeafType,assertListType:assertListType,assertName:assertName,assertNamedType:assertNamedType,assertNonNullType:assertNonNullType,assertNullableType:assertNullableType,assertObjectType:assertObjectType,assertOutputType:assertOutputType,assertScalarType:assertScalarType,assertSchema:assertSchema,assertType:assertType,assertUnionType:assertUnionType,assertValidName:assertValidName,assertValidSchema:assertValidSchema,assertWrappingType:assertWrappingType,astFromValue:astFromValue,buildASTSchema:buildASTSchema,buildClientSchema:buildClientSchema,buildSchema:buildSchema,coerceInputValue:coerceInputValue,concatAST:concatAST,createSourceEventStream:createSourceEventStream,defaultFieldResolver:defaultFieldResolver,defaultTypeResolver:defaultTypeResolver,doTypesOverlap:doTypesOverlap,execute:execute,executeSync:executeSync,extendSchema:extendSchema,findBreakingChanges:findBreakingChanges,findDangerousChanges:findDangerousChanges,formatError:formatError,getArgumentValues:getArgumentValues,getDirectiveValues:getDirectiveValues,getEnterLeaveForKind:getEnterLeaveForKind,getIntrospectionQuery:getIntrospectionQuery,getLocation:getLocation,getNamedType:getNamedType,getNullableType:getNullableType,getOperationAST:getOperationAST,getOperationRootType:getOperationRootType,getVariableValues:getVariableValues,getVisitFn:getVisitFn,graphql:graphql$1,graphqlSync:graphqlSync,introspectionFromSchema:introspectionFromSchema,introspectionTypes:introspectionTypes,isAbstractType:isAbstractType,isCompositeType:isCompositeType,isConstValueNode:isConstValueNode,isDefinitionNode:isDefinitionNode,isDirective:isDirective,isEnumType:isEnumType,isEqualType:isEqualType,isExecutableDefinitionNode:isExecutableDefinitionNode,isInputObjectType:isInputObjectType,isInputType:isInputType,isInterfaceType:isInterfaceType,isIntrospectionType:isIntrospectionType,isLeafType:isLeafType,isListType:isListType,isNamedType:isNamedType,isNonNullType:isNonNullType,isNullableType:isNullableType,isObjectType:isObjectType,isOutputType:isOutputType,isRequiredArgument:isRequiredArgument,isRequiredInputField:isRequiredInputField,isScalarType:isScalarType,isSchema:isSchema,isSelectionNode:isSelectionNode,isSpecifiedDirective:isSpecifiedDirective,isSpecifiedScalarType:isSpecifiedScalarType,isType:isType,isTypeDefinitionNode:isTypeDefinitionNode,isTypeExtensionNode:isTypeExtensionNode,isTypeNode:isTypeNode,isTypeSubTypeOf:isTypeSubTypeOf,isTypeSystemDefinitionNode:isTypeSystemDefinitionNode,isTypeSystemExtensionNode:isTypeSystemExtensionNode,isUnionType:isUnionType,isValidNameError:isValidNameError,isValueNode:isValueNode,isWrappingType:isWrappingType,lexicographicSortSchema:lexicographicSortSchema,locatedError:locatedError,parse:parse$1,parseConstValue:parseConstValue,parseType:parseType,parseValue:parseValue,print:print,printError:printError,printIntrospectionSchema:printIntrospectionSchema,printLocation:printLocation,printSchema:printSchema,printSourceLocation:printSourceLocation,printType:printType,recommendedRules:recommendedRules,resolveObjMapThunk:resolveObjMapThunk,resolveReadonlyArrayThunk:resolveReadonlyArrayThunk,responsePathAsArray:pathToArray,separateOperations:separateOperations,specifiedDirectives:specifiedDirectives,specifiedRules:specifiedRules,specifiedScalarTypes:specifiedScalarTypes,stripIgnoredCharacters:stripIgnoredCharacters,subscribe:subscribe,syntaxError:syntaxError,typeFromAST:typeFromAST,validate:validate,validateSchema:validateSchema,valueFromAST:valueFromAST,valueFromASTUntyped:valueFromASTUntyped,version:version,versionInfo:versionInfo,visit:visit,visitInParallel:visitInParallel,visitWithTypeInfo:visitWithTypeInfo}),require$$0=getAugmentedNamespace(graphql);Object.defineProperty(utils$1,"__esModule",{value:!0}),utils$1.buildWatchFragmentWhereQuery=utils$1.buildWatchFragmentQuery=void 0;const graphql_1=require$$0,core_1$1=require$$0$2;function _generateQueryFromFragment({fieldName:e,fragmentDefinition:t}){return{kind:graphql_1.Kind.DOCUMENT,definitions:[{directives:[],variableDefinitions:[],kind:graphql_1.Kind.OPERATION_DEFINITION,operation:graphql_1.OperationTypeNode.QUERY,selectionSet:{kind:graphql_1.Kind.SELECTION_SET,selections:[{arguments:[],kind:graphql_1.Kind.FIELD,name:{kind:graphql_1.Kind.NAME,value:e},directives:[{arguments:[],kind:graphql_1.Kind.DIRECTIVE,name:{kind:graphql_1.Kind.NAME,value:"client"}}],selectionSet:t.selectionSet}]}}]}}function buildWatchFragmentQuery(e){const{fragment:t,id:n,policies:r,fieldName:i}=e;e=_generateQueryFromFragment({fragmentDefinition:t.definitions[0],fieldName:i});return r.getFieldPolicy("Query",i)||r.addTypePolicies({Query:{fields:{[i]:{read(e){return(0,core_1$1.makeReference)(n)}}}}}),e}function buildWatchFragmentWhereQuery(e){const{fragment:t,filterVar:n,limitVar:r,orderByVar:i,policies:a,cache:o,fieldName:s}=e;e=t.definitions[0];const c=e.typeCondition.name.value;e=_generateQueryFromFragment({fragmentDefinition:e,fieldName:s});return a.getFieldPolicy("Query",s)||a.addTypePolicies({Query:{fields:{[s]:{read(e){return o.readReferenceWhere({__typename:c,filter:n(),limit:r(),orderBy:i()})}}}}}),e}utils$1.buildWatchFragmentQuery=buildWatchFragmentQuery,utils$1.buildWatchFragmentWhereQuery=buildWatchFragmentWhereQuery,Object.defineProperty(ApolloExtensionsClient$1,"__esModule",{value:!0});const core_1=require$$0$2,utils_1$3=utils$1,helpers_1$1=helpers;class ApolloExtensionsClient extends core_1.ApolloClient{constructor(e){super(e),this.policies=this.cache.policies}watchQueryForField(e,i){e=this.watchQuery({fetchPolicy:"cache-only",query:e});const a=e.subscribe.bind(e);return e.subscribe=(e,...t)=>{const n=(e="object"!=typeof e?{next:e,error:t[0],complete:t[1]}:e).next;e.next=e=>{n&&n(null==(e=null==e?void 0:e.data)?void 0:e[i])};t=a(e);const r=t.unsubscribe.bind(t);return t.unsubscribe=()=>{delete this.cache.policies.typePolicies.Query.fields[i],r()},t},e}watchFragment(e){var t=(0,helpers_1$1.generateFragmentFieldName)(),e=(0,utils_1$3.buildWatchFragmentQuery)(Object.assign(Object.assign({},e),{fieldName:t,policies:this.policies}));return this.watchQueryForField(e,t)}watchFragmentWhere(e){var t=(0,helpers_1$1.generateFragmentFieldName)(),n=(0,core_1.makeVar)(e.filter),r=(0,core_1.makeVar)(e.limit),i=(0,core_1.makeVar)(e.orderBy),e=(0,utils_1$3.buildWatchFragmentWhereQuery)(Object.assign(Object.assign({},e),{fieldName:t,filterVar:n,limitVar:r,orderByVar:i,cache:this.cache,policies:this.policies}));return this.watchQueryForField(e,t)}}ApolloExtensionsClient$1.default=ApolloExtensionsClient,function(e){var t=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=(Object.defineProperty(e,"__esModule",{value:!0}),e.ApolloExtensionsClient=void 0,ApolloExtensionsClient$1);Object.defineProperty(e,"ApolloExtensionsClient",{enumerable:!0,get:function(){return t(n).default}})}(client);var hooks={},useFragment$1={},require$$1=getAugmentedNamespace(react),utils={},__importDefault$4=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(utils,"__esModule",{value:!0}),utils.usePrevious=utils.useOnce=void 0;const react_1$3=require$$1,isFunction_1=__importDefault$4(isFunction_1$2);function useOnce(e){var t=(0,react_1$3.useRef)(),n=(0,react_1$3.useRef)(!1);return n.current||((0,isFunction_1.default)(e)?t.current=e():t.current=e,n.current=!0),t.current}utils.useOnce=useOnce;const usePrevious=e=>{const t=(0,react_1$3.useRef)(null);return(0,react_1$3.useEffect)(()=>{t.current=e}),t.current};utils.usePrevious=usePrevious;var useFragmentTypePolicyFieldName$1={};Object.defineProperty(useFragmentTypePolicyFieldName$1,"__esModule",{value:!0}),useFragmentTypePolicyFieldName$1.useFragmentTypePolicyFieldName=void 0;const client_1$3=require$$0$1,react_1$2=require$$1,helpers_1=helpers,utils_1$2=utils,useFragmentTypePolicyFieldName=({fragmentName:e}={})=>{var t=(0,react_1$2.useMemo)(()=>(0,helpers_1.generateFragmentFieldName)({fragmentName:e}),[e]);const n=(0,utils_1$2.usePrevious)(t),r=(0,client_1$3.useApolloClient)();return(0,react_1$2.useEffect)(()=>()=>{delete r.cache.policies.typePolicies.Query.fields[n]},[t,n]),t};useFragmentTypePolicyFieldName$1.useFragmentTypePolicyFieldName=useFragmentTypePolicyFieldName;var useGetQueryDataByFieldName$1={};Object.defineProperty(useGetQueryDataByFieldName$1,"__esModule",{value:!0}),useGetQueryDataByFieldName$1.useGetQueryDataByFieldName=void 0;const client_1$2=require$$0$1,useGetQueryDataByFieldName=(e,t,n)=>{var e=(0,client_1$2.useQuery)(e,{fetchPolicy:"cache-only",returnPartialData:null==n?void 0:n.returnPartialData});return{data:null!=(e=null==(n=null==e?void 0:e.data)?void 0:n[t])?e:null}},client_1$1=(useGetQueryDataByFieldName$1.useGetQueryDataByFieldName=useGetQueryDataByFieldName,Object.defineProperty(useFragment$1,"__esModule",{value:!0}),require$$0$1),react_1$1=require$$1,utils_1$1=utils,utils_2=utils$1,useFragmentTypePolicyFieldName_1$1=useFragmentTypePolicyFieldName$1,useGetQueryDataByFieldName_1$1=useGetQueryDataByFieldName$1;function useFragment(e,t){var n=(0,react_1$1.useContext)((0,client_1$1.getApolloContext)()).client;const r=null==n?void 0:n.cache,i=(0,useFragmentTypePolicyFieldName_1$1.useFragmentTypePolicyFieldName)();n=(0,utils_1$1.useOnce)(()=>(0,utils_2.buildWatchFragmentQuery)({fragment:e,fieldName:i,id:t.id,policies:r.policies}));return(0,useGetQueryDataByFieldName_1$1.useGetQueryDataByFieldName)(n,i,t)}useFragment$1.default=useFragment;var useFragmentWhere$1={};const{toString,hasOwnProperty}=Object.prototype,fnToStr=Function.prototype.toString,previousComparisons=new Map;function equal(e,t){try{return check(e,t)}finally{previousComparisons.clear()}}function check(t,n){if(t===n)return!0;var e=toString.call(t),r=toString.call(n);if(e===r)switch(e){case"[object Array]":if(t.length!==n.length)return!1;case"[object Object]":if(!previouslyCompared(t,n)){var i=definedKeys(t),a=definedKeys(n),o=i.length;if(o!==a.length)return!1;for(let e=0;e<o;++e)if(!hasOwnProperty.call(n,i[e]))return!1;for(let e=0;e<o;++e){var s=i[e];if(!check(t[s],n[s]))return!1}}return!0;case"[object Error]":return t.name===n.name&&t.message===n.message;case"[object Number]":if(t!=t)return n!=n;case"[object Boolean]":case"[object Date]":return+t==+n;case"[object RegExp]":case"[object String]":return t==""+n;case"[object Map]":case"[object Set]":if(t.size!==n.size)return!1;if(!previouslyCompared(t,n))for(var c=t.entries(),l="[object Map]"===e;;){var u=c.next();if(u.done)break;var[u,p]=u.value;if(!n.has(u))return!1;if(l&&!check(p,n.get(u)))return!1}return!0;case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),n=new Uint8Array(n);case"[object DataView]":{let e=t.byteLength;if(e===n.byteLength)for(;e--&&t[e]===n[e];);return-1===e}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":a=fnToStr.call(t);return a!==fnToStr.call(n)?!1:!endsWith(a,nativeCodeSuffix)}return!1}function definedKeys(e){return Object.keys(e).filter(isDefinedKey,e)}function isDefinedKey(e){return void 0!==this[e]}const nativeCodeSuffix="{ [native code] }";function endsWith(e,t){var n=e.length-t.length;return 0<=n&&e.indexOf(t,n)===n}function previouslyCompared(e,t){let n=previousComparisons.get(e);if(n){if(n.has(t))return!0}else previousComparisons.set(e,n=new Set);return n.add(t),!1}var lib$1=Object.freeze({__proto__:null,default:equal,equal:equal}),require$$5=getAugmentedNamespace(lib$1);Object.defineProperty(useFragmentWhere$1,"__esModule",{value:!0});const client_1=require$$0$1,react_1=require$$1,utils_1=utils$1,useFragmentTypePolicyFieldName_1=useFragmentTypePolicyFieldName$1,useGetQueryDataByFieldName_1=useGetQueryDataByFieldName$1,client_2=require$$0$1,equality_1=require$$5;function useFragmentWhere(e,t){const n=null==t?void 0:t.filter,r=(0,react_1.useRef)((0,client_2.makeVar)(n)).current,i=null==t?void 0:t.limit,a=(0,react_1.useRef)((0,client_2.makeVar)(i)).current,o=null==t?void 0:t.orderBy,s=(0,react_1.useRef)((0,client_2.makeVar)(o)).current;var c=(0,react_1.useContext)((0,client_1.getApolloContext)()).client;const l=null==c?void 0:c.cache,u=(0,useFragmentTypePolicyFieldName_1.useFragmentTypePolicyFieldName)({fragmentName:null==t?void 0:t.fragmentName});var c=(0,react_1.useRef)([]),p=((0,react_1.useEffect)(()=>{("function"!=typeof n||n===r())&&(0,equality_1.equal)(n,r())||r(n)},[n]),(0,react_1.useEffect)(()=>{i!==a()&&a(i)},[i]),(0,react_1.useEffect)(()=>{("function"!=typeof o||o===s())&&(0,equality_1.equal)(o,s())||s(o)},[o]),(0,react_1.useMemo)(()=>(0,utils_1.buildWatchFragmentWhereQuery)({filter:n,filterVar:r,limitVar:a,orderByVar:s,fragment:e,fieldName:u,cache:l,policies:l.policies}),[u])),p=(0,useGetQueryDataByFieldName_1.useGetQueryDataByFieldName)(p,u,t);return Object.assign(Object.assign({},p),{data:null!=(t=p.data)?t:c.current})}useFragmentWhere$1.default=useFragmentWhere,function(e){var t=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=(Object.defineProperty(e,"__esModule",{value:!0}),e.useFragmentWhere=e.useFragment=void 0,useFragment$1),r=(Object.defineProperty(e,"useFragment",{enumerable:!0,get:function(){return t(n).default}}),useFragmentWhere$1);Object.defineProperty(e,"useFragmentWhere",{enumerable:!0,get:function(){return t(r).default}})}(hooks);var AuditType,audit={},InvalidationPolicyCacheAuditor$1={},InvalidationPolicyManagerAuditor$1={},__importDefault$3=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(InvalidationPolicyManagerAuditor$1,"__esModule",{value:!0}),InvalidationPolicyManagerAuditor$1.AuditType=void 0;const InvalidationPolicyManager_1=__importDefault$3(InvalidationPolicyManager$1);!function(e){e.Read="Read",e.Write="Write",e.Evict="Evict"}(AuditType||(InvalidationPolicyManagerAuditor$1.AuditType=AuditType={}));class InvalidationPolicyManagerAuditor extends InvalidationPolicyManager_1.default{constructor(e){super(e),this.auditLog=e.auditLog}runReadPolicy({typename:e,dataId:t,fieldName:n,storeFieldName:r,reportOnly:i=!1}){return this.auditLog.log("Running read policy",AuditType.Read,"InvalidationPolicyManager",{storeFieldName:r,typename:e,dataId:t,fieldName:n}),super.runReadPolicy({typename:e,dataId:t,fieldName:n,storeFieldName:r,reportOnly:i})}runWritePolicy(e,t){return this.auditLog.log("Running write policy",AuditType.Write,"InvalidationPolicyManager",Object.assign({typeName:e},t)),super.runWritePolicy(e,t)}runEvictPolicy(e,t){return this.auditLog.log("Running evict policy",AuditType.Write,"InvalidationPolicyManager",Object.assign({typeName:e},t)),super.runEvictPolicy(e,t)}}InvalidationPolicyManagerAuditor$1.default=InvalidationPolicyManagerAuditor;var EntityTypeMapAuditorEvent,EntityTypeMapAuditor={},__importDefault$2=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(EntityTypeMapAuditor,"__esModule",{value:!0});const EntityTypeMap_1=__importDefault$2(EntityTypeMap$1);!function(e){e.Write="Write",e.Evict="Evict"}(EntityTypeMapAuditorEvent=EntityTypeMapAuditorEvent||{});class EntityTypeMapAudtior extends EntityTypeMap_1.default{constructor(e){super(),this.auditLog=e.auditLog}write(e,t,n,r){return this.auditLog.log("Writing to type map",EntityTypeMapAuditorEvent.Write,"EntityTypeMap",{typename:e,dataId:t,storeFieldName:n,variables:r}),super.write(e,t,n,r)}evict(e,t){return this.auditLog.log("Evicting from type map",EntityTypeMapAuditorEvent.Evict,"EntityTypeMap",{dataId:e,storeFieldName:t}),super.evict(e,t)}}EntityTypeMapAuditor.default=EntityTypeMapAudtior;var AuditLog$1={},baseEach=_baseEach;function baseFilter$1(e,r){var i=[];return baseEach(e,function(e,t,n){r(e,t,n)&&i.push(e)}),i}var _baseFilter=baseFilter$1,arrayFilter=_arrayFilter,baseFilter=baseFilter$1,baseIteratee=_baseIteratee,isArray=isArray_1$1;function filter(e,t){return(isArray(e)?arrayFilter:baseFilter)(e,baseIteratee(t))}var filter_1$1=filter,__importDefault$1=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(AuditLog$1,"__esModule",{value:!0});const filter_1=__importDefault$1(filter_1$1);class AuditLog{constructor(){this._log=[]}log(e,t,n,r){t={time:Date.now(),type:t,event:e,meta:r,group:n};this._log.push(t)}getLog(e){return(0,filter_1.default)(this._log,e)}printLog(e){this.getLog(e).forEach(this.printLogEntry)}printLogEntry(e){console.log("%c event: "+e.event,"color: green"),console.group(),console.log("type: "+e.type),console.log("time: "+e.time),console.log("meta: "+JSON.stringify(null!=(e=e.meta)?e:{})),console.groupEnd()}}AuditLog$1.default=AuditLog;var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(InvalidationPolicyCacheAuditor$1,"__esModule",{value:!0});const InvalidationPolicyCache_1=__importDefault(InvalidationPolicyCache$1),CacheResultProcessor_1=CacheResultProcessor$1,InvalidationPolicyManagerAuditor_1=__importDefault(InvalidationPolicyManagerAuditor$1),EntityTypeMapAuditor_1=__importDefault(EntityTypeMapAuditor),AuditLog_1=__importDefault(AuditLog$1),entity_store_1=entityStore;class InvalidationPolicyCacheAuditor extends InvalidationPolicyCache_1.default{constructor(e){super(e),this.auditLog=new AuditLog_1.default;var{invalidationPolicies:e={}}=e;this.entityTypeMap=new EntityTypeMapAuditor_1.default({auditLog:this.auditLog}),new entity_store_1.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new InvalidationPolicyManagerAuditor_1.default({auditLog:this.auditLog,policies:e,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:this.evict.bind(this),modify:this.modify.bind(this),readField:this.readField.bind(this)}}),this.cacheResultProcessor=new CacheResultProcessor_1.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this})}}InvalidationPolicyCacheAuditor$1.default=InvalidationPolicyCacheAuditor,function(e){var t=commonjsGlobal&&commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n=(Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidationPolicyCacheAuditor=void 0,InvalidationPolicyCacheAuditor$1);Object.defineProperty(e,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return t(n).default}})}(audit),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RenewalPolicy=e.InvalidationPolicyEvent=e.InvalidationPolicyCacheAuditor=e.useFragmentWhere=e.useFragment=e.ApolloExtensionsClient=e.makeCachedVar=e.InvalidationPolicyCache=void 0;var t=cache,n=(Object.defineProperty(e,"InvalidationPolicyCache",{enumerable:!0,get:function(){return t.InvalidationPolicyCache}}),Object.defineProperty(e,"makeCachedVar",{enumerable:!0,get:function(){return t.makeCachedVar}}),client),r=(Object.defineProperty(e,"ApolloExtensionsClient",{enumerable:!0,get:function(){return n.ApolloExtensionsClient}}),hooks),i=(Object.defineProperty(e,"useFragment",{enumerable:!0,get:function(){return r.useFragment}}),Object.defineProperty(e,"useFragmentWhere",{enumerable:!0,get:function(){return r.useFragmentWhere}}),audit),a=(Object.defineProperty(e,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return i.InvalidationPolicyCacheAuditor}}),types);Object.defineProperty(e,"InvalidationPolicyEvent",{enumerable:!0,get:function(){return a.InvalidationPolicyEvent}}),Object.defineProperty(e,"RenewalPolicy",{enumerable:!0,get:function(){return a.RenewalPolicy}})}(dist);var isMergeableObject=function(e){return isNonNullObject(e)&&!isSpecial(e)};function isNonNullObject(e){return!!e&&"object"==typeof e}function isSpecial(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||isReactElement(e)}var canUseSymbol="function"==typeof Symbol&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(e){return e.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(e){return Array.isArray(e)?[]:{}}function cloneUnlessOtherwiseSpecified(e,t){return!1!==t.clone&&t.isMergeableObject(e)?deepmerge(emptyTarget(e),e,t):e}function defaultArrayMerge(e,t,n){return e.concat(t).map(function(e){return cloneUnlessOtherwiseSpecified(e,n)})}function getMergeFunction(e,t){return t.customMerge&&"function"==typeof(t=t.customMerge(e))?t:deepmerge}function getEnumerableOwnPropertySymbols(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function getKeys(e){return Object.keys(e).concat(getEnumerableOwnPropertySymbols(e))}function propertyIsOnObject(e,t){try{return t in e}catch(e){return!1}}function propertyIsUnsafe(e,t){return propertyIsOnObject(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function mergeObject(t,n,r){var i={};return r.isMergeableObject(t)&&getKeys(t).forEach(function(e){i[e]=cloneUnlessOtherwiseSpecified(t[e],r)}),getKeys(n).forEach(function(e){propertyIsUnsafe(t,e)||(propertyIsOnObject(t,e)&&r.isMergeableObject(n[e])?i[e]=getMergeFunction(e,r)(t[e],n[e],r):i[e]=cloneUnlessOtherwiseSpecified(n[e],r))}),i}function deepmerge(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||defaultArrayMerge,n.isMergeableObject=n.isMergeableObject||isMergeableObject,n.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):mergeObject(e,t,n):cloneUnlessOtherwiseSpecified(t,n)}deepmerge.all=function(e,n){if(Array.isArray(e))return e.reduce(function(e,t){return deepmerge(e,t,n)},{});throw new Error("first argument should be an array")};var deepmerge_1=deepmerge,cjs=deepmerge,merge=getDefaultExportFromCjs(deepmerge);const DEFAULT_IDENTITY_PATH=["ROOT_QUERY","authenticatedUser","__ref"];class InvalidationCache extends dist.InvalidationPolicyCache{constructor(e){super(e),this.cacheIdentityKey=DEFAULT_IDENTITY_PATH,null!=e&&e.cacheIdentityKey&&(this.cacheIdentityKey=e.cacheIdentityKey)}}function createApolloCache(e){return new InvalidationCache(e)}function mergeCaches(e,t){return merge(e,t,{arrayMerge:(e,n)=>[...n,...e.filter(t=>n.every(e=>!isEqual$1(t,e)))]})}function addCacheToClient(e,t,n){var r;t&&(r=e.cache.extract(),t=mergeCaches(n.overrideClient?r:t,n.overrideClient?t:r),e.cache.restore(t),n.broadcast)&&e.cache.modify({fields:{}})}function createApolloClient(e){var t=e.middlewares||[],n=createUploadLink$1({uri:"string"==typeof e.uri?e.uri:e.uri(),headers:e.headers,credentials:"include",fetchOptions:{mode:"cors"}}),t=from([...t,n]);return new ApolloClient({ssrMode:isSSR(),link:t,cache:createApolloCache(e.cacheConfig)})}function extractApolloState(e,t){return null!=t&&t.props&&(t.props[APOLLO_STATE_PROP_NAME]=e.cache.extract()),t}class ApolloHelper{constructor(e){var t=e["cacheConfig"],e=__rest$2(e,["cacheConfig"]);this._initialApolloOptions=e,this._cacheConfig=t,bindAll$1(this,"_getCacheConfig","initializeApollo","generateUseApolloHook")}_getCacheConfig(e){return this._cacheConfig?this._cacheConfig({skipOnRead:void 0===e||e}):void 0}initializeApollo(e){var e=e||{},t=e["networkOnly"],e=__rest$2(e,["networkOnly"]),t=this._getCacheConfig(t),e=Object.assign(Object.assign(Object.assign({},this._initialApolloOptions),e),{cacheConfig:t});return isSSR()?createApolloClient(e):(this._apolloClient||(this._apolloClient=createApolloClient(e)),this._apolloClient)}generateUseApolloHook(){const o=this.initializeApollo,s=this._getCacheConfig;return function(e){const[t,i]=useState(),n=e[APOLLO_STATE_PROP_NAME],r=usePrevious$1(n),a=useMemo(()=>{var e=o({networkOnly:!1});return n&&!isEqual$1(n,r)&&(addCacheToClient(e,n,{overrideClient:!0,broadcast:!0}),t)&&t.persist(),e},[t,r,n]);return useEffectOnce(()=>{!function(){__awaiter(this,void 0,void 0,function*(){var e=createApolloCache(s(!1)),t=createPersistor(e),n=(yield t.restore(),e.cacheIdentityKey),r=get$2(e.extract(),n,null),n=get$2(a.cache.extract(),n,null),n=(n&&isEqual$1(n,r)||(yield t.purge(),yield e.reset()),addCacheToClient(a,e.extract(),{broadcast:!0,overrideClient:!1}),createPersistor(a.cache));i(n)})}()}),{client:a,cachePersistor:t}}}}var lib={},cookie={},__toString=(cookie.parse=parse,cookie.serialize=serialize,Object.prototype.toString),fieldContentRegExp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function parse(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},r=(t||{}).decode||decode,i=0;i<e.length;){var a=e.indexOf("=",i);if(-1===a)break;var o=e.indexOf(";",i);if(-1===o)o=e.length;else if(o<a){i=e.lastIndexOf(";",a-1)+1;continue}var s=e.slice(i,a).trim();void 0===n[s]&&(34===(a=e.slice(a+1,o).trim()).charCodeAt(0)&&(a=a.slice(1,-1)),n[s]=tryDecode(a,r)),i=o+1}return n}function serialize(e,t,n){var n=n||{},r=n.encode||encode;if("function"!=typeof r)throw new TypeError("option encode is invalid");if(!fieldContentRegExp.test(e))throw new TypeError("argument name is invalid");r=r(t);if(r&&!fieldContentRegExp.test(r))throw new TypeError("argument val is invalid");var i=e+"="+r;if(null!=n.maxAge){t=+n.maxAge;if(isNaN(t)||!isFinite(t))throw new TypeError("option maxAge is invalid");i+="; Max-Age="+Math.floor(t)}if(n.domain){if(!fieldContentRegExp.test(n.domain))throw new TypeError("option domain is invalid");i+="; Domain="+n.domain}if(n.path){if(!fieldContentRegExp.test(n.path))throw new TypeError("option path is invalid");i+="; Path="+n.path}if(n.expires){e=n.expires;if(!isDate(e)||isNaN(e.valueOf()))throw new TypeError("option expires is invalid");i+="; Expires="+e.toUTCString()}if(n.httpOnly&&(i+="; HttpOnly"),n.secure&&(i+="; Secure"),n.partitioned&&(i+="; Partitioned"),n.priority)switch("string"==typeof n.priority?n.priority.toLowerCase():n.priority){case"low":i+="; Priority=Low";break;case"medium":i+="; Priority=Medium";break;case"high":i+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i}function decode(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function encode(e){return encodeURIComponent(e)}function isDate(e){return"[object Date]"===__toString.call(e)||e instanceof Date}function tryDecode(t,e){try{return e(t)}catch(e){return t}}function nonNull(e){return null!=e}function hasRef(e){return"object"==typeof e&&null!==e&&"__ref"in e&&"string"==typeof e.__ref}function hasBrokenRefs(e,t){return e.some(e=>{return!!hasRef(e)&&(e=e.__ref)&&!(e in t)})}!function(n){function p(){return"undefined"!=typeof window}function d(e){return!(null==e||!e.req)&&"cookies"in e.req&&t(null==e?void 0:e.req.cookies)||!(null==e||!e.res)&&"cookies"in e.res&&t(null==e?void 0:e.res.cookies)||!(null==e||!e.cookies)&&t(e.cookies())}function c(e){var n={};return e.getAll().forEach(function(e){var t=e.name,e=e.value;n[t]=e}),n}function y(t){try{return"string"==typeof t?t:JSON.stringify(t)}catch(e){return t}}var f=commonjsGlobal&&commonjsGlobal.__assign||function(){return(f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},h=commonjsGlobal&&commonjsGlobal.__rest||function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n},m=(Object.defineProperty(n,"__esModule",{value:!0}),n.hasCookie=n.deleteCookie=n.setCookie=n.getCookie=n.getCookies=void 0,cookie),t=function(e){return!!e&&"getAll"in e&&"set"in e&&"function"==typeof e.getAll&&"function"==typeof e.set};n.getCookies=function(e){if(d(e)){if(null!=e&&e.req)return c(e.req.cookies);if(null!=e&&e.cookies)return c(e.cookies())}var t;if(e&&(t=e.req),!p())return t&&t.cookies?t.cookies:t&&t.headers.cookie?(0,m.parse)(t.headers.cookie):{};for(var n={},r=document.cookie?document.cookie.split("; "):[],i=0,a=r.length;i<a;i++){var o=r[i].split("="),s=o.slice(1).join("=");n[o[0]]=s}return n},n.getCookie=function(e,t){t=(0,n.getCookies)(t)[e];if(void 0!==t)return(e=t)&&e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)},n.setCookie=function(e,t,n){var r,i,a,o,s,c,l,u;d(n)?(r=n.req,i=n.res,c=n.cookies,l=h(n,["req","res","cookies"]),l=f({name:e,value:y(t)},l),r&&r.cookies.set(l),i&&i.cookies.set(l),c&&c().set(l)):(n&&(a=r=n.req,o=i=n.res,s=h(n,["req","res"])),c=(0,m.serialize)(e,y(t),f({path:"/"},s)),p()?document.cookie=c:o&&a&&(l=o.getHeader("Set-Cookie"),Array.isArray(l)||(l=l?[String(l)]:[]),o.setHeader("Set-Cookie",l.concat(c)),a&&a.cookies&&(u=a.cookies,""===t?delete u[e]:u[e]=y(t)),a)&&a.headers&&a.headers.cookie&&(u=(0,m.parse)(a.headers.cookie),""===t?delete u[e]:u[e]=y(t),a.headers.cookie=Object.entries(u).reduce(function(e,t){return e.concat("".concat(t[0],"=").concat(t[1],";"))},"")))},n.deleteCookie=function(e,t){return(0,n.setCookie)(e,"",f(f({},t),{maxAge:-1}))};n.hasCookie=function(e,t){return!!e&&(0,n.getCookies)(t).hasOwnProperty(e)}}(lib);class ListHelper{constructor(e){this.skipArgName="skip",this.firstArgName="first",this.skipCacheOnRead=!1,null!=e&&e.skipArgName&&(this.skipArgName=e.skipArgName),null!=e&&e.firstArgName&&(this.firstArgName=e.firstArgName),null!=e&&e.cacheOptions.skipOnRead&&(this.skipCacheOnRead=e.cacheOptions.skipOnRead),bindAll$1(this,"_readPage","_readAll","_networkOnlyRead","getReadFunction","mergeLists")}_readPage(e,t){var n=(null==(n=null==t?void 0:t.args)?void 0:n[this.skipArgName])||0,r=(null==(r=null==t?void 0:t.args)?void 0:r[this.firstArgName])||0;if(e&&!(e.length<n+r)){e=e.slice(n,n+r).filter(nonNull),n=t.cache.extract();if(!hasBrokenRefs(e,n))return e}}_readAll(e,t){if(e){t=t.cache.extract(),e=e.filter(nonNull);if(!hasBrokenRefs(e,t))return e}}_networkOnlyRead(){}getReadFunction(e){return this.skipCacheOnRead?this._networkOnlyRead:"paginate"===e?this._readPage:this._readAll}mergeLists(e,t,n){var r=e?e.slice(0):[],i=(null==(e=null==n?void 0:n.args)?void 0:e[this.skipArgName])||0,a=(null==(e=null==n?void 0:n.args)?void 0:e[this.firstArgName])||0;r.length<i+a&&(r.length=i+a);for(let e=0;e<Math.max(t.length,a);e++)r[i+e]=e<t.length?t[e]:null;return r}}export{ApolloHelper,CachePersistorContext,ListHelper,extractApolloState,useCachePersistor};
//# sourceMappingURL=index.js.map