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

13 lines 261 kB
"use strict";var e=require("react"),t=require("@apollo/client/core"),n=require("@apollo/client"),r=require("crypto"),i=require("@apollo/client/utilities"),o=require("@apollo/client/link/http");function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var s,c=a(e),u=a(t),l=a(n),p=a(i),d=a(o),f=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},h=function(){function e(e){var t=e.debug,n=void 0!==t&&t;this.debug=n,this.lines=[]}return e.prototype.emit=function(t,n){if(t in console){var r=e.prefix;console[t].apply(console,f([r],n,!1))}},e.prototype.tailLogs=function(){var e=this;this.lines.forEach(function(t){var n=t[0],r=t[1];return e.emit(n,r)})},e.prototype.getLogs=function(){return this.lines},e.prototype.write=function(t,n){var r=e.buffer;this.lines=f(f([],this.lines.slice(1-r),!0),[[t,n]],!1),(this.debug||"log"!==t)&&this.emit(t,n)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("log",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("warn",e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("error",e)},e.buffer=30,e.prefix="[apollo-cache-persist]",e}(),y=function(){function e(e){var t=e.cache,n=e.serialize,r=void 0===n||n;this.cache=t,this.serialize=r}return e.prototype.extract=function(){var e=this.cache.extract();return this.serialize&&(e=JSON.stringify(e)),e},e.prototype.restore=function(e){this.serialize&&"string"==typeof e&&(e=JSON.parse(e)),null!=e&&this.cache.restore(e)},e}(),v=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},m=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},g=function(){function e(e){var t=e.storage,n=e.key,r=void 0===n?"apollo-cache-persist":n;this.storage=t,this.key=r}return e.prototype.read=function(){return v(this,void 0,void 0,function(){return m(this,function(e){return[2,this.storage.getItem(this.key)]})})},e.prototype.write=function(e){return v(this,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:return[4,this.storage.setItem(this.key,e)];case 1:return t.sent(),[2]}})})},e.prototype.purge=function(){return v(this,void 0,void 0,function(){return m(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 v(this,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,this.storage.getItem(this.key)];case 1:return null==(e=t.sent())?[2,0]:[2,"string"==typeof e?e.length:null]}})})},e}(),E=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},T=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},b=function(){function e(e,t){var n=e.log,r=e.cache,i=e.storage,o=t.maxSize,a=void 0===o?1048576:o,s=t.persistenceMapper;this.log=n,this.cache=r,this.storage=i,this.paused=!1,s&&(this.persistenceMapper=s),a&&(this.maxSize=a)}return e.prototype.persist=function(){return E(this,void 0,void 0,function(){var e,t;return T(this,function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),e=this.cache.extract(),this.paused||!this.persistenceMapper?[3,2]:[4,this.persistenceMapper(e)];case 1:e=n.sent(),n.label=2;case 2:return null!=this.maxSize&&"string"==typeof e&&e.length>this.maxSize&&!this.paused?[4,this.purge()]:[3,4];case 3:return n.sent(),this.paused=!0,[2];case 4:return this.paused?[2]:[4,this.storage.write(e)];case 5:return n.sent(),this.log.info("string"==typeof e?"Persisted cache of size ".concat(e.length," characters"):"Persisted cache"),[3,7];case 6:throw t=n.sent(),this.log.error("Error persisting cache",t),t;case 7:return[2]}})})},e.prototype.restore=function(){return E(this,void 0,void 0,function(){var e,t;return T(this,function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,this.storage.read()];case 1:return null==(e=n.sent())?[3,3]:[4,this.cache.restore(e)];case 2:return n.sent(),this.log.info("string"==typeof e?"Restored cache of size ".concat(e.length," characters"):"Restored cache"),[3,4];case 3:this.log.info("No stored cache to restore"),n.label=4;case 4:return[3,6];case 5:throw t=n.sent(),this.log.error("Error restoring cache",t),t;case 6:return[2]}})})},e.prototype.purge=function(){return E(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.storage.purge()];case 1:return t.sent(),this.log.info("Purged cache storage"),[3,3];case 2:throw e=t.sent(),this.log.error("Error purging cache storage",e),e;case 3:return[2]}})})},e}(),_=function(e){var t=e.cache;return function(e){var n=t.write,r=t.evict,i=t.modify,o=t.gc;return t.write=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=n.apply(t,r);return e(),o},t.evict=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=r.apply(t,n);return e(),o},t.modify=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=i.apply(t,n);return e(),o},t.gc=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=o.apply(t,n);return e(),i},function(){t.write=n,t.evict=r,t.modify=i,t.gc=o}}},N=function(){function e(t,n){var r=t.log,i=t.persistor,o=this;this.fire=function(){o.debounce?(null!=o.timeout&&clearTimeout(o.timeout),o.timeout=setTimeout(o.persist,o.debounce)):o.persist()},this.persist=function(){o.paused||o.persistor.persist()};var a=e.defaultDebounce,s=n.cache,c=n.debounce,u=n.trigger,l=void 0===u?"write":u;if(l)switch(this.debounce=null!=c?c:a,this.persistor=i,this.paused=!1,l){case"write":this.uninstall=_({cache:s})(this.fire);break;case"background":c&&r.warn("Debounce is not recommended with `background` trigger"),this.debounce=c,this.uninstall=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"),_({cache:n})(e)}}({cache:s,log:r})(this.fire);break;default:if("function"!=typeof l)throw Error("Unrecognized trigger option: ".concat(l));this.uninstall=l(this.fire)}}return e.prototype.pause=function(){this.paused=!0},e.prototype.resume=function(){this.paused=!1},e.prototype.remove=function(){this.uninstall&&(this.uninstall(),this.uninstall=null,this.paused=!0)},e.defaultDebounce=1e3,e}(),I=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 h(e),n=new y(e),r=new g(e),i=new b({log:t,cache:n,storage:r},e),o=new N({log:t,persistor:i},e);this.log=t,this.cache=n,this.storage=r,this.persistor=i,this.trigger=o}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(void 0===e&&(e=!1),!e)return this.log.getLogs();this.log.tailLogs()},e.prototype.getSize=function(){return this.storage.getSize()},e}(),O=(s=function(e,t){return s=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])},s(e,t)},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}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});!function(e){function t(t){var n=e.call(this,t)||this;return n.storage=new A(t),n.persistor=new w({log:n.log,cache:n.cache,storage:n.storage},t),n}O(t,e),t.prototype.restoreSync=function(){this.persistor.restoreSync()}}(I);var w=function(e){function t(t,n){var r=t.log,i=t.cache,o=t.storage;return e.call(this,{log:r,cache:i,storage:o},n)||this}return O(t,e),t.prototype.restoreSync=function(){this.cache.restore(this.storage.readSync())},t}(b),A=function(e){function t(t){return e.call(this,t)||this}return O(t,e),t.prototype.readSync=function(){return this.storage.getItem(this.key)},t}(g),S=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 D(){return"undefined"==typeof window}const R="__APOLLO_STATE__";function F(e){return new I({cache:e,storage:new S(window.localStorage),debug:"development"===process.env.NODE_ENV,key:"__APOLLO_PERSISTED_CACHE__"})}const k=e.createContext({});function x(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function j(e,t,n,r){return new(n||(n=Promise))(function(t,i){function o(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(e){e(r)})).then(o,a)}s((r=r.apply(e,[])).next())})}var C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function P(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function L(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var $=L(u),M=L(d);const V=class{constructor({uri:e,name:t,type:n}){this.uri=e,this.name=t,this.type=n}};var U=function(e){return"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||e instanceof V};const B=U;var G=U;const{ApolloLink:Q,Observable:Y}=$,{createSignalIfSupported:q,fallbackHttpConfig:z,parseAndCheckHttpResponse:W,rewriteURIForGET:J,selectHttpOptionsAndBody:K,selectURI:X,serializeFetchParameter:H}=M,Z=function(e,t="",n=B){const r=new Map,i=new Map;return{clone:function e(t,o,a){let s=t;if(n(t)){s=null;const e=r.get(t);e?e.push(o):r.set(t,[o])}else{const n=Array.isArray(t)||"undefined"!=typeof FileList&&t instanceof FileList,r=t&&t.constructor===Object;if(n||r){const r=i.has(t);if(r?s=i.get(t):(s=n?[]:{},i.set(t,s)),!a.has(t)){const i=o?`${o}.`:"",c=new Set(a).add(t);if(n){let n=0;for(const o of t){const t=e(o,i+n++,c);r||s.push(t)}}else for(const n in t){const o=e(t[n],i+n,c);r||(s[n]=o)}}}}return s}(e,t,new Set),files:r}},ee=function(e,t,n){e.append(t,n,n.name)},te=G;var ne=function({uri:e="/graphql",useGETForQueries:t,isExtractableFile:n=te,FormData:r,formDataAppendFile:i=ee,fetch:o,fetchOptions:a,credentials:s,headers:c,includeExtensions:u}={}){const l={http:{includeExtensions:u},options:a,credentials:s,headers:c};return new Q(a=>{const s=a.getContext(),{clientAwareness:{name:c,version:u}={},headers:p}=s,d={http:s.http,options:s.fetchOptions,credentials:s.credentials,headers:{...c&&{"apollographql-client-name":c},...u&&{"apollographql-client-version":u},...p}},{options:f,body:h}=K(a,z,l,d),{clone:y,files:v}=Z(h,"",n);let m=X(a,e);if(v.size){delete f.headers["content-type"];const e=new(r||FormData);e.append("operations",H(y,"Payload"));const t={};let n=0;v.forEach(e=>{t[++n]=e}),e.append("map",JSON.stringify(t)),n=0,v.forEach((t,r)=>{i(e,++n,r)}),f.body=e}else if(t&&!a.query.definitions.some(e=>"OperationDefinition"===e.kind&&"mutation"===e.operation)&&(f.method="GET"),"GET"===f.method){const{newURI:e,parseError:t}=J(m,h);if(t)return new Y(e=>{e.error(t)});m=e}else f.body=H(y,"Payload");const{controller:g}=q();g&&(f.signal&&(f.signal.aborted?g.abort():f.signal.addEventListener("abort",()=>{g.abort()},{once:!0})),f.signal=g.signal);const E=o||fetch;return new Y(e=>{let t;return E(m,f).then(e=>(a.setContext({response:e}),e)).then(W(a)).then(t=>{e.next(t),e.complete()}).catch(n=>{t||(n.result&&n.result.errors&&n.result.data&&e.next(n.result),e.error(n))}),()=>{t=!0,g&&g.abort()}})})},re=P(ne);var ie=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},oe="object"==typeof C&&C&&C.Object===Object&&C,ae=oe,se="object"==typeof self&&self&&self.Object===Object&&self,ce=ae||se||Function("return this")(),ue=ce.Symbol,le=ue,pe=Object.prototype,de=pe.hasOwnProperty,fe=pe.toString,he=le?le.toStringTag:void 0;var ye=function(e){var t=de.call(e,he),n=e[he];try{e[he]=void 0;var r=!0}catch(e){}var i=fe.call(e);return r&&(t?e[he]=n:delete e[he]),i},ve=Object.prototype.toString;var me=ye,ge=function(e){return ve.call(e)},Ee=ue?ue.toStringTag:void 0;var Te=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ee&&Ee in Object(e)?me(e):ge(e)};var be=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},_e=Te,Ne=be;var Ie,Oe=function(e){if(!Ne(e))return!1;var t=_e(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},we=ce["__core-js_shared__"],Ae=(Ie=/[^.]+$/.exec(we&&we.keys&&we.keys.IE_PROTO||""))?"Symbol(src)_1."+Ie:"";var Se=function(e){return!!Ae&&Ae in e},De=Function.prototype.toString;var Re=function(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Fe=Oe,ke=Se,xe=be,je=Re,Ce=/^\[object .+?Constructor\]$/,Pe=Function.prototype,Le=Object.prototype,$e=Pe.toString,Me=Le.hasOwnProperty,Ve=RegExp("^"+$e.call(Me).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ue=function(e){return!(!xe(e)||ke(e))&&(Fe(e)?Ve:Ce).test(je(e))},Be=function(e,t){return null==e?void 0:e[t]};var Ge=function(e,t){var n=Be(e,t);return Ue(n)?n:void 0},Qe=Ge,Ye=function(){try{var e=Qe(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),qe=Ye;var ze=function(e,t,n){"__proto__"==t&&qe?qe(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var We=function(e){return e};var Je=function(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)},Ke=Je,Xe=Math.max;var He=function(e,t,n){return t=Xe(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=Xe(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),Ke(e,this,s)}};var Ze=function(e){return function(){return e}},et=Ye,tt=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Ze(t),writable:!0})}:We,nt=Date.now;var rt=function(e){var t=0,n=0;return function(){var r=nt(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},it=rt(tt),ot=We,at=He,st=it;var ct=function(e,t){return st(at(e,t,ot),e+"")},ut=Ge(ce,"WeakMap"),lt=ut&&new ut,pt=lt,dt=pt?function(e,t){return pt.set(e,t),e}:We,ft=be,ht=Object.create,yt=function(){function e(){}return function(t){if(!ft(t))return{};if(ht)return ht(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),vt=yt,mt=be;var gt=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=vt(e.prototype),r=e.apply(n,t);return mt(r)?r:n}},Et=gt,Tt=ce;var bt=function(e,t,n){var r=1&t,i=Et(e);return function t(){return(this&&this!==Tt&&this instanceof t?i:e).apply(r?n:this,arguments)}},_t=Math.max;var Nt=function(e,t,n,r){for(var i=-1,o=e.length,a=n.length,s=-1,c=t.length,u=_t(o-a,0),l=Array(c+u),p=!r;++s<c;)l[s]=t[s];for(;++i<a;)(p||i<o)&&(l[n[i]]=e[i]);for(;u--;)l[s++]=e[i++];return l},It=Math.max;var Ot=function(e,t,n,r){for(var i=-1,o=e.length,a=-1,s=n.length,c=-1,u=t.length,l=It(o-s,0),p=Array(l+u),d=!r;++i<l;)p[i]=e[i];for(var f=i;++c<u;)p[f+c]=t[c];for(;++a<s;)(d||i<o)&&(p[f+n[a]]=e[i++]);return p};var wt=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r};var At=function(){},St=yt,Dt=At;function Rt(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}Rt.prototype=St(Dt.prototype),Rt.prototype.constructor=Rt;var Ft=Rt;var kt=lt,xt=kt?function(e){return kt.get(e)}:function(){},jt={},Ct=Object.prototype.hasOwnProperty;var Pt=function(e){for(var t=e.name+"",n=jt[t],r=Ct.call(jt,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t},Lt=yt,$t=At;function Mt(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}Mt.prototype=Lt($t.prototype),Mt.prototype.constructor=Mt;var Vt=Mt,Ut=Array.isArray;var Bt=function(e){return null!=e&&"object"==typeof e};var Gt=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},Qt=Ft,Yt=Vt,qt=Gt;var zt=Ft,Wt=Vt,Jt=At,Kt=Ut,Xt=Bt,Ht=function(e){if(e instanceof Qt)return e.clone();var t=new Yt(e.__wrapped__,e.__chain__);return t.__actions__=qt(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t},Zt=Object.prototype.hasOwnProperty;function en(e){if(Xt(e)&&!Kt(e)&&!(e instanceof zt)){if(e instanceof Wt)return e;if(Zt.call(e,"__wrapped__"))return Ht(e)}return new Wt(e)}en.prototype=Jt.prototype,en.prototype.constructor=en;var tn=Ft,nn=xt,rn=Pt,on=en;var an=function(e){var t=rn(e),n=on[t];if("function"!=typeof n||!(t in tn.prototype))return!1;if(e===n)return!0;var r=nn(n);return!!r&&e===r[0]},sn=rt(dt),cn=/\{\n\/\* \[wrapped with (.+)\] \*/,un=/,? & /;var ln=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;var pn=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1},dn=function(e){return e!=e},fn=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1};var hn=function(e,t,n){return t==t?fn(e,t,n):pn(e,dn,n)};var yn=ie,vn=function(e,t){return!!(null==e?0:e.length)&&hn(e,t,0)>-1},mn=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];var gn=function(e){var t=e.match(cn);return t?t[1].split(un):[]},En=function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ln,"{\n/* [wrapped with "+t+"] */\n")},Tn=it,bn=function(e,t){return yn(mn,function(n){var r="_."+n[0];t&n[1]&&!vn(e,r)&&e.push(r)}),e.sort()};var _n=function(e,t,n){var r=t+"";return Tn(e,En(r,bn(gn(r),n)))},Nn=an,In=sn,On=_n;var wn=function(e,t,n,r,i,o,a,s,c,u){var l=8&t;t|=l?32:64,4&(t&=~(l?64:32))||(t&=-4);var p=[e,t,i,l?o:void 0,l?a:void 0,l?void 0:o,l?void 0:a,s,c,u],d=n.apply(void 0,p);return Nn(e)&&In(d,p),d.placeholder=r,On(d,e,t)};var An=function(e){return e.placeholder},Sn=/^(?:0|[1-9]\d*)$/;var Dn=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Sn.test(e))&&e>-1&&e%1==0&&e<t},Rn=Gt,Fn=Dn,kn=Math.min;var xn="__lodash_placeholder__";var jn=function(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==xn||(e[n]=xn,o[i++]=n)}return o},Cn=Nt,Pn=Ot,Ln=wt,$n=gt,Mn=wn,Vn=An,Un=function(e,t){for(var n=e.length,r=kn(t.length,n),i=Rn(e);r--;){var o=t[r];e[r]=Fn(o,n)?i[o]:void 0}return e},Bn=jn,Gn=ce;var Qn=function e(t,n,r,i,o,a,s,c,u,l){var p=128&n,d=1&n,f=2&n,h=24&n,y=512&n,v=f?void 0:$n(t);return function m(){for(var g=arguments.length,E=Array(g),T=g;T--;)E[T]=arguments[T];if(h)var b=Vn(m),_=Ln(E,b);if(i&&(E=Cn(E,i,o,h)),a&&(E=Pn(E,a,s,h)),g-=_,h&&g<l){var N=Bn(E,b);return Mn(t,n,e,m.placeholder,r,E,N,c,u,l-g)}var I=d?r:this,O=f?I[t]:t;return g=E.length,c?E=Un(E,c):y&&g>1&&E.reverse(),p&&u<g&&(E.length=u),this&&this!==Gn&&this instanceof m&&(O=v||$n(O)),O.apply(I,E)}},Yn=Je,qn=gt,zn=Qn,Wn=wn,Jn=An,Kn=jn,Xn=ce;var Hn=function(e,t,n){var r=qn(e);return function i(){for(var o=arguments.length,a=Array(o),s=o,c=Jn(i);s--;)a[s]=arguments[s];var u=o<3&&a[0]!==c&&a[o-1]!==c?[]:Kn(a,c);return(o-=u.length)<n?Wn(e,t,zn,i.placeholder,void 0,a,u,void 0,void 0,n-o):Yn(this&&this!==Xn&&this instanceof i?r:e,this,a)}},Zn=Je,er=gt,tr=ce;var nr=function(e,t,n,r){var i=1&t,o=er(e);return function t(){for(var a=-1,s=arguments.length,c=-1,u=r.length,l=Array(u+s),p=this&&this!==tr&&this instanceof t?o:e;++c<u;)l[c]=r[c];for(;s--;)l[c++]=arguments[++a];return Zn(p,i?n:this,l)}},rr=Nt,ir=Ot,or=jn,ar="__lodash_placeholder__",sr=128,cr=Math.min;var ur=/\s/;var lr=function(e){for(var t=e.length;t--&&ur.test(e.charAt(t)););return t},pr=/^\s+/;var dr=Te,fr=Bt;var hr=function(e){return"symbol"==typeof e||fr(e)&&"[object Symbol]"==dr(e)},yr=function(e){return e?e.slice(0,lr(e)+1).replace(pr,""):e},vr=be,mr=hr,gr=/^[-+]0x[0-9a-f]+$/i,Er=/^0b[01]+$/i,Tr=/^0o[0-7]+$/i,br=parseInt;var _r=function(e){if("number"==typeof e)return e;if(mr(e))return NaN;if(vr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=vr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=yr(e);var n=Er.test(e);return n||Tr.test(e)?br(e.slice(2),n?2:8):gr.test(e)?NaN:+e},Nr=1/0;var Ir=function(e){return e?(e=_r(e))===Nr||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var Or=function(e){var t=Ir(e),n=t%1;return t==t?n?t-n:t:0},wr=dt,Ar=bt,Sr=Hn,Dr=Qn,Rr=nr,Fr=xt,kr=function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=r==sr&&8==n||r==sr&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var s=t[3];if(s){var c=e[3];e[3]=c?rr(c,s,t[4]):s,e[4]=c?or(e[3],ar):t[4]}return(s=t[5])&&(c=e[5],e[5]=c?ir(c,s,t[6]):s,e[6]=c?or(e[5],ar):t[6]),(s=t[7])&&(e[7]=s),r&sr&&(e[8]=null==e[8]?t[8]:cr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e},xr=sn,jr=_n,Cr=Or,Pr=Math.max;var Lr=function(e,t,n,r,i,o,a,s){var c=2&t;if(!c&&"function"!=typeof e)throw new TypeError("Expected a function");var u=r?r.length:0;if(u||(t&=-97,r=i=void 0),a=void 0===a?a:Pr(Cr(a),0),s=void 0===s?s:Cr(s),u-=i?i.length:0,64&t){var l=r,p=i;r=i=void 0}var d=c?void 0:Fr(e),f=[e,t,n,r,i,l,p,o,a,s];if(d&&kr(f,d),e=f[0],t=f[1],n=f[2],r=f[3],i=f[4],!(s=f[9]=void 0===f[9]?c?0:e.length:Pr(f[9]-u,0))&&24&t&&(t&=-25),t&&1!=t)h=8==t||16==t?Sr(e,t,s):32!=t&&33!=t||i.length?Dr.apply(void 0,f):Rr(e,t,n,r);else var h=Ar(e,t,n);return jr((d?wr:xr)(h,f),e,t)},$r=An,Mr=jn,Vr=ct(function(e,t,n){var r=1;if(n.length){var i=Mr(n,$r(Vr));r|=32}return Lr(e,r,t,n,i)});Vr.placeholder={};var Ur=Vr;var Br=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},Gr=Te,Qr=Bt;var Yr=function(e){return Qr(e)&&"[object Arguments]"==Gr(e)},qr=Bt,zr=Object.prototype,Wr=zr.hasOwnProperty,Jr=zr.propertyIsEnumerable,Kr=Yr(function(){return arguments}())?Yr:function(e){return qr(e)&&Wr.call(e,"callee")&&!Jr.call(e,"callee")},Xr=Kr,Hr=Ut,Zr=ue?ue.isConcatSpreadable:void 0;var ei=Br,ti=function(e){return Hr(e)||Xr(e)||!!(Zr&&e&&e[Zr])};var ni=function e(t,n,r,i,o){var a=-1,s=t.length;for(r||(r=ti),o||(o=[]);++a<s;){var c=t[a];n>0&&r(c)?n>1?e(c,n-1,r,i,o):ei(o,c):i||(o[o.length]=c)}return o},ri=ni;var ii=function(e){return(null==e?0:e.length)?ri(e,1):[]},oi=He,ai=it;var si=function(e){return ai(oi(e,void 0,ii),e+"")},ci=hr;var ui=function(e){if("string"==typeof e||ci(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},li=ie,pi=ze,di=Ur,fi=ui,hi=P(si(function(e,t){return li(t,function(t){t=fi(t),pi(e,t,di(e[t],e))}),e})),yi=Ut,vi=hr,mi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gi=/^\w*$/;var Ei=function(e,t){if(yi(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!vi(e))||(gi.test(e)||!mi.test(e)||null!=t&&e in Object(t))},Ti=Ge(Object,"create"),bi=Ti;var _i=function(){this.__data__=bi?bi(null):{},this.size=0};var Ni=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ii=Ti,Oi=Object.prototype.hasOwnProperty;var wi=function(e){var t=this.__data__;if(Ii){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Oi.call(t,e)?t[e]:void 0},Ai=Ti,Si=Object.prototype.hasOwnProperty;var Di=Ti;var Ri=_i,Fi=Ni,ki=wi,xi=function(e){var t=this.__data__;return Ai?void 0!==t[e]:Si.call(t,e)},ji=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Di&&void 0===t?"__lodash_hash_undefined__":t,this};function Ci(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])}}Ci.prototype.clear=Ri,Ci.prototype.delete=Fi,Ci.prototype.get=ki,Ci.prototype.has=xi,Ci.prototype.set=ji;var Pi=Ci;var Li=function(){this.__data__=[],this.size=0};var $i=function(e,t){return e===t||e!=e&&t!=t},Mi=$i;var Vi=function(e,t){for(var n=e.length;n--;)if(Mi(e[n][0],t))return n;return-1},Ui=Vi,Bi=Array.prototype.splice;var Gi=Vi;var Qi=Vi;var Yi=Vi;var qi=Li,zi=function(e){var t=this.__data__,n=Ui(t,e);return!(n<0)&&(n==t.length-1?t.pop():Bi.call(t,n,1),--this.size,!0)},Wi=function(e){var t=this.__data__,n=Gi(t,e);return n<0?void 0:t[n][1]},Ji=function(e){return Qi(this.__data__,e)>-1},Ki=function(e,t){var n=this.__data__,r=Yi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Xi(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])}}Xi.prototype.clear=qi,Xi.prototype.delete=zi,Xi.prototype.get=Wi,Xi.prototype.has=Ji,Xi.prototype.set=Ki;var Hi=Xi,Zi=Ge(ce,"Map"),eo=Pi,to=Hi,no=Zi;var ro=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var io=function(e,t){var n=e.__data__;return ro(t)?n["string"==typeof t?"string":"hash"]:n.map},oo=io;var ao=io;var so=io;var co=io;var uo=function(){this.size=0,this.__data__={hash:new eo,map:new(no||to),string:new eo}},lo=function(e){var t=oo(this,e).delete(e);return this.size-=t?1:0,t},po=function(e){return ao(this,e).get(e)},fo=function(e){return so(this,e).has(e)},ho=function(e,t){var n=co(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function yo(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])}}yo.prototype.clear=uo,yo.prototype.delete=lo,yo.prototype.get=po,yo.prototype.has=fo,yo.prototype.set=ho;var vo=yo,mo=vo;function go(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(go.Cache||mo),n}go.Cache=mo;var Eo=go;var To=function(e){var t=Eo(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t},bo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_o=/\\(\\)?/g,No=To(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(bo,function(e,n,r,i){t.push(r?i.replace(_o,"$1"):n||e)}),t});var Io=function(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},Oo=Io,wo=Ut,Ao=hr,So=ue?ue.prototype:void 0,Do=So?So.toString:void 0;var Ro=function e(t){if("string"==typeof t)return t;if(wo(t))return Oo(t,e)+"";if(Ao(t))return Do?Do.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},Fo=Ro;var ko=Ut,xo=Ei,jo=No,Co=function(e){return null==e?"":Fo(e)};var Po=function(e,t){return ko(e)?e:xo(e,t)?[e]:jo(Co(e))},Lo=Po,$o=ui;var Mo=function(e,t){for(var n=0,r=(t=Lo(t,e)).length;null!=e&&n<r;)e=e[$o(t[n++])];return n&&n==r?e:void 0},Vo=Mo;var Uo=function(e,t,n){var r=null==e?void 0:Vo(e,t);return void 0===r?n:r},Bo=P(Uo),Go=Hi;var Qo=Hi,Yo=Zi,qo=vo;var zo=Hi,Wo=function(){this.__data__=new Go,this.size=0},Jo=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ko=function(e){return this.__data__.get(e)},Xo=function(e){return this.__data__.has(e)},Ho=function(e,t){var n=this.__data__;if(n instanceof Qo){var r=n.__data__;if(!Yo||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qo(r)}return n.set(e,t),this.size=n.size,this};function Zo(e){var t=this.__data__=new zo(e);this.size=t.size}Zo.prototype.clear=Wo,Zo.prototype.delete=Jo,Zo.prototype.get=Ko,Zo.prototype.has=Xo,Zo.prototype.set=Ho;var ea=Zo;var ta=vo,na=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ra=function(e){return this.__data__.has(e)};function ia(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ta;++t<n;)this.add(e[t])}ia.prototype.add=ia.prototype.push=na,ia.prototype.has=ra;var oa=function(e,t){return e.has(t)},aa=ia,sa=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},ca=oa;var ua=function(e,t,n,r,i,o){var a=1&n,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var u=o.get(e),l=o.get(t);if(u&&l)return u==t&&l==e;var p=-1,d=!0,f=2&n?new aa:void 0;for(o.set(e,t),o.set(t,e);++p<s;){var h=e[p],y=t[p];if(r)var v=a?r(y,h,p,t,e,o):r(h,y,p,e,t,o);if(void 0!==v){if(v)continue;d=!1;break}if(f){if(!sa(t,function(e,t){if(!ca(f,t)&&(h===e||i(h,e,n,r,o)))return f.push(t)})){d=!1;break}}else if(h!==y&&!i(h,y,n,r,o)){d=!1;break}}return o.delete(e),o.delete(t),d},la=ce.Uint8Array;var pa=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},da=la,fa=$i,ha=ua,ya=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n},va=pa,ma=ue?ue.prototype:void 0,ga=ma?ma.valueOf:void 0;var Ea=function(e,t,n,r,i,o,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new da(e),new da(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return fa(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=ya;case"[object Set]":var c=1&r;if(s||(s=va),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var l=ha(s(e),s(t),r,i,o,a);return a.delete(e),l;case"[object Symbol]":if(ga)return ga.call(e)==ga.call(t)}return!1},Ta=Br,ba=Ut;var _a=function(e,t,n){var r=t(e);return ba(e)?r:Ta(r,n(e))};var Na=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o};var Ia=function(){return[]},Oa=Na,wa=Ia,Aa=Object.prototype.propertyIsEnumerable,Sa=Object.getOwnPropertySymbols,Da=Sa?function(e){return null==e?[]:(e=Object(e),Oa(Sa(e),function(t){return Aa.call(e,t)}))}:wa;var Ra=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},Fa={exports:{}};var ka=function(){return!1};!function(e,t){var n=ce,r=ka,i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;e.exports=s}(Fa,Fa.exports);var xa=Fa.exports;var ja=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ca=Te,Pa=ja,La=Bt,$a={};$a["[object Float32Array]"]=$a["[object Float64Array]"]=$a["[object Int8Array]"]=$a["[object Int16Array]"]=$a["[object Int32Array]"]=$a["[object Uint8Array]"]=$a["[object Uint8ClampedArray]"]=$a["[object Uint16Array]"]=$a["[object Uint32Array]"]=!0,$a["[object Arguments]"]=$a["[object Array]"]=$a["[object ArrayBuffer]"]=$a["[object Boolean]"]=$a["[object DataView]"]=$a["[object Date]"]=$a["[object Error]"]=$a["[object Function]"]=$a["[object Map]"]=$a["[object Number]"]=$a["[object Object]"]=$a["[object RegExp]"]=$a["[object Set]"]=$a["[object String]"]=$a["[object WeakMap]"]=!1;var Ma=function(e){return La(e)&&Pa(e.length)&&!!$a[Ca(e)]};var Va=function(e){return function(t){return e(t)}},Ua={exports:{}};!function(e,t){var n=oe,r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r&&n.process,a=function(){try{var e=i&&i.require&&i.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}(Ua,Ua.exports);var Ba=Ua.exports,Ga=Ma,Qa=Va,Ya=Ba&&Ba.isTypedArray,qa=Ya?Qa(Ya):Ga,za=Ra,Wa=Kr,Ja=Ut,Ka=xa,Xa=Dn,Ha=qa,Za=Object.prototype.hasOwnProperty;var es=function(e,t){var n=Ja(e),r=!n&&Wa(e),i=!n&&!r&&Ka(e),o=!n&&!r&&!i&&Ha(e),a=n||r||i||o,s=a?za(e.length,String):[],c=s.length;for(var u in e)!t&&!Za.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Xa(u,c))||s.push(u);return s},ts=Object.prototype;var ns=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ts)};var rs=function(e,t){return function(n){return e(t(n))}},is=rs(Object.keys,Object),os=ns,as=is,ss=Object.prototype.hasOwnProperty;var cs=Oe,us=ja;var ls=function(e){return null!=e&&us(e.length)&&!cs(e)},ps=es,ds=function(e){if(!os(e))return as(e);var t=[];for(var n in Object(e))ss.call(e,n)&&"constructor"!=n&&t.push(n);return t},fs=ls;var hs=function(e){return fs(e)?ps(e):ds(e)},ys=_a,vs=Da,ms=hs;var gs=function(e){return ys(e,ms,vs)},Es=gs,Ts=Object.prototype.hasOwnProperty;var bs=function(e,t,n,r,i,o){var a=1&n,s=Es(e),c=s.length;if(c!=Es(t).length&&!a)return!1;for(var u=c;u--;){var l=s[u];if(!(a?l in t:Ts.call(t,l)))return!1}var p=o.get(e),d=o.get(t);if(p&&d)return p==t&&d==e;var f=!0;o.set(e,t),o.set(t,e);for(var h=a;++u<c;){var y=e[l=s[u]],v=t[l];if(r)var m=a?r(v,y,l,t,e,o):r(y,v,l,e,t,o);if(!(void 0===m?y===v||i(y,v,n,r,o):m)){f=!1;break}h||(h="constructor"==l)}if(f&&!h){var g=e.constructor,E=t.constructor;g==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof E&&E instanceof E||(f=!1)}return o.delete(e),o.delete(t),f},_s=Ge(ce,"DataView"),Ns=Zi,Is=Ge(ce,"Promise"),Os=Ge(ce,"Set"),ws=ut,As=Te,Ss=Re,Ds="[object Map]",Rs="[object Promise]",Fs="[object Set]",ks="[object WeakMap]",xs="[object DataView]",js=Ss(_s),Cs=Ss(Ns),Ps=Ss(Is),Ls=Ss(Os),$s=Ss(ws),Ms=As;(_s&&Ms(new _s(new ArrayBuffer(1)))!=xs||Ns&&Ms(new Ns)!=Ds||Is&&Ms(Is.resolve())!=Rs||Os&&Ms(new Os)!=Fs||ws&&Ms(new ws)!=ks)&&(Ms=function(e){var t=As(e),n="[object Object]"==t?e.constructor:void 0,r=n?Ss(n):"";if(r)switch(r){case js:return xs;case Cs:return Ds;case Ps:return Rs;case Ls:return Fs;case $s:return ks}return t});var Vs=Ms,Us=ea,Bs=ua,Gs=Ea,Qs=bs,Ys=Vs,qs=Ut,zs=xa,Ws=qa,Js="[object Arguments]",Ks="[object Array]",Xs="[object Object]",Hs=Object.prototype.hasOwnProperty;var Zs=function(e,t,n,r,i,o){var a=qs(e),s=qs(t),c=a?Ks:Ys(e),u=s?Ks:Ys(t),l=(c=c==Js?Xs:c)==Xs,p=(u=u==Js?Xs:u)==Xs,d=c==u;if(d&&zs(e)){if(!zs(t))return!1;a=!0,l=!1}if(d&&!l)return o||(o=new Us),a||Ws(e)?Bs(e,t,n,r,i,o):Gs(e,t,c,n,r,i,o);if(!(1&n)){var f=l&&Hs.call(e,"__wrapped__"),h=p&&Hs.call(t,"__wrapped__");if(f||h){var y=f?e.value():e,v=h?t.value():t;return o||(o=new Us),i(y,v,n,r,o)}}return!!d&&(o||(o=new Us),Qs(e,t,n,r,i,o))},ec=Bt;var tc=function e(t,n,r,i,o){return t===n||(null==t||null==n||!ec(t)&&!ec(n)?t!=t&&n!=n:Zs(t,n,r,i,e,o))},nc=tc;var rc=P(function(e,t){return nc(e,t)});var ic={},oc={},ac={},sc=L(l);!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReactiveVarsCache=e.makeCachedVar=e.initReactiveVarsCache=e.cachedReactiveVarTypename=void 0;const t=sc;var n;e.cachedReactiveVarTypename="CachedReactiveVar",e.initReactiveVarsCache=function(e){return n=new i({cache:e})};const r=t.gql`
  fragment ReadCachedReactiveVarFragment on CachedReactiveVar {
    id
    value
  }
`;e.makeCachedVar=function(e,t){return n.registerCachedVar(e,t)};class i{constructor({cache:e}){this.registeredVars={},this.cache=e}watchReactiveVar(e,t){t.onNextChange(n=>{this.writeCachedVar(e,n),this.watchReactiveVar(e,t)})}registerCachedVar(e,n){const r=this.readCachedVar(e),i=(0,t.makeVar)(null!=r?r:n);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:i,defaultValue:n},r||this.writeCachedVar(e,n),this.watchReactiveVar(e,i),i}readCachedVar(t){var n;const i=this.cache.identify({__typename:e.cachedReactiveVarTypename,id:t}),o=this.cache.readFragment({fragment:r,id:i});return null!==(n=null==o?void 0:o.value)&&void 0!==n?n:null}writeCachedVar(t,i){void 0!==i&&this.cache.writeFragment({id:n.cache.identify({__typename:e.cachedReactiveVarTypename,id:t}),fragment:r,data:{__typename:e.cachedReactiveVarTypename,id:t,value:i}})}reset(){Object.keys(this.registeredVars).forEach(e=>{var t;const{rv:n,defaultValue:r}=this.registeredVars[e];n(null!==(t=this.readCachedVar(e))&&void 0!==t?t:r)})}}e.ReactiveVarsCache=i}(ac);var cc={};var uc=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i};var lc=function(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 pc=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var c=a[e?s:++i];if(!1===n(o[c],c,o))break}return t}}(),dc=hs;var fc=ls;var hc=function(e,t){return function(n,r){if(null==n)return n;if(!fc(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}(function(e,t){return e&&pc(e,t,dc)}),yc=hc;var vc=ea,mc=tc;var gc=be;var Ec=function(e){return e==e&&!gc(e)},Tc=Ec,bc=hs;var _c=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}},Nc=function(e,t,n,r){var i=n.length,o=i,a=!r;if(null==e)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){var c=(s=n[i])[0],u=e[c],l=s[1];if(a&&s[2]){if(void 0===u&&!(c in e))return!1}else{var p=new vc;if(r)var d=r(u,l,c,e,t,p);if(!(void 0===d?mc(l,u,3,r,p):d))return!1}}return!0},Ic=function(e){for(var t=bc(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Tc(i)]}return t},Oc=_c;var wc=Po,Ac=Kr,Sc=Ut,Dc=Dn,Rc=ja,Fc=ui;var kc=function(e,t){return null!=e&&t in Object(e)},xc=function(e,t,n){for(var r=-1,i=(t=wc(t,e)).length,o=!1;++r<i;){var a=Fc(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Rc(i)&&Dc(a,i)&&(Sc(e)||Ac(e))};var jc=function(e,t){return null!=e&&xc(e,t,kc)},Cc=tc,Pc=Uo,Lc=jc,$c=Ei,Mc=Ec,Vc=_c,Uc=ui;var Bc=Mo;var Gc=function(e){return function(t){return null==t?void 0:t[e]}},Qc=function(e){return function(t){return Bc(t,e)}},Yc=Ei,qc=ui;var zc=function(e){var t=Ic(e);return 1==t.length&&t[0][2]?Oc(t[0][0],t[0][1]):function(n){return n===e||Nc(n,e,t)}},Wc=function(e,t){return $c(e)&&Mc(t)?Vc(Uc(e),t):function(n){var r=Pc(n,e);return void 0===r&&r===t?Lc(n,e):Cc(t,r,3)}},Jc=We,Kc=Ut,Xc=function(e){return Yc(e)?Gc(qc(e)):Qc(e)};var Hc=function(e){return"function"==typeof e?e:null==e?Jc:"object"==typeof e?Kc(e)?Wc(e[0],e[1]):zc(e):Xc(e)},Zc=$i,eu=ls,tu=Dn,nu=be;var ru=lc,iu=function(e,t){var n=!0;return yc(e,function(e,r,i){return n=!!t(e,r,i)}),n},ou=Hc,au=Ut,su=function(e,t,n){if(!nu(n))return!1;var r=typeof t;return!!("number"==r?eu(n)&&tu(t,n.length):"string"==r&&t in n)&&Zc(n[t],e)};var cu=function(e,t,n){var r=au(e)?ru:iu;return n&&su(e,t,n)&&(t=void 0),r(e,ou(t))},uu=ze,lu=$i,pu=Object.prototype.hasOwnProperty;var du=function(e,t,n){var r=e[t];pu.call(e,t)&&lu(r,n)&&(void 0!==n||t in e)||uu(e,t,n)},fu=du,hu=Po,yu=Dn,vu=be,mu=ui;var gu=function(e,t,n,r){if(!vu(e))return e;for(var i=-1,o=(t=hu(t,e)).length,a=o-1,s=e;null!=s&&++i<o;){var c=mu(t[i]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=a){var l=s[c];void 0===(u=r?r(l,c,s):void 0)&&(u=vu(l)?l:yu(t[i+1])?[]:{})}fu(s,c,u),s=s[c]}return e},Eu=Mo,Tu=gu,bu=Po;var _u=function(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Eu(e,a);n(s,a)&&Tu(o,bu(a,e),s)}return o},Nu=jc;var Iu=function(e,t){return _u(e,t,function(t,n){return Nu(e,n)})},Ou=si(function(e,t){return null==e?{}:Iu(e,t)});var wu=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o},Au=Or;var Su=function(e,t,n){return e&&e.length?(t=n||void 0===t?1:Au(t),wu(e,0,t<0?0:t)):[]};var Du=function(e){return null==e},Ru=hc,Fu=ls;var ku=hr;var xu=function(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=ku(e),a=void 0!==t,s=null===t,c=t==t,u=ku(t);if(!s&&!u&&!o&&e>t||o&&a&&c&&!s&&!u||r&&a&&c||!n&&c||!i)return 1;if(!r&&!o&&!u&&e<t||u&&n&&i&&!r&&!o||s&&n&&i||!a&&i||!c)return-1}return 0};var ju=Io,Cu=Mo,Pu=Hc,Lu=function(e,t){var n=-1,r=Fu(e)?Array(e.length):[];return Ru(e,function(e,i,o){r[++n]=t(e,i,o)}),r},$u=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e},Mu=Va,Vu=function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;++r<a;){var c=xu(i[r],o[r]);if(c)return r>=s?c:c*("desc"==n[r]?-1:1)}return e.index-t.index},Uu=We,Bu=Ut;var Gu=function(e,t,n){t=t.length?ju(t,function(e){return Bu(e)?function(t){return Cu(t,1===e.length?e[0]:e)}:e}):[Uu];var r=-1;t=ju(t,Mu(Pu));var i=Lu(e,function(e,n,i){return{criteria:ju(t,function(t){return t(e)}),index:++r,value:e}});return $u(i,function(e,t){return Vu(e,t,n)})},Qu=Ut;var Yu=function(e,t,n,r){return null==e?[]:(Qu(t)||(t=null==t?[]:[t]),Qu(n=r?void 0:n)||(n=null==n?[]:[n]),Gu(e,t,n))},qu={},zu=Te,Wu=Bt;var Ju,Ku,Xu,Hu=function(e){return"number"==typeof e||Wu(e)&&"[object Number]"==zu(e)},Zu={};Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.RenewalPolicy=Zu.InvalidationPolicyLifecycleEvent=Zu.InvalidationPolicyEvent=void 0,function(e){e.Write="Write",e.Evict="Evict",e.Read="Read"}(Ju||(Zu.InvalidationPolicyEvent=Ju={})),function(e){e.Write="onWrite",e.Evict="onEvict"}(Ku||(Zu.InvalidationPolicyLifecycleEvent=Ku={})),function(e){e.AccessOnly="access-only",e.AccessAndWrite="access-and-write",e.WriteOnly="write-only",e.None="none"}(Xu||(Zu.RenewalPolicy=Xu={}));var el={},tl=du,nl=ze;var rl=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],c=r?r(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),i?nl(n,s,c):tl(n,s,c)}return n},il=rl,ol=hs;var al=function(e,t){return e&&il(t,ol(t),e)};var sl=be,cl=ns,ul=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},ll=Object.prototype.hasOwnProperty;var pl=es,dl=function(e){if(!sl(e))return ul(e);var t=cl(e),n=[];for(var r in e)("constructor"!=r||!t&&ll.call(e,r))&&n.push(r);return n},fl=ls;var hl=function(e){return fl(e)?pl(e,!0):dl(e)},yl=rl,vl=hl;var ml=function(e,t){return e&&yl(t,vl(t),e)},gl={exports:{}};!function(e,t){var n=ce,r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r?n.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}(gl,gl.exports);var El=gl.exports,Tl=rl,bl=Da;var _l=function(e,t){return Tl(e,bl(e),t)},Nl=rs(Object.getPrototypeOf,Object),Il=Br,Ol=Nl,wl=Da,Al=Ia,Sl=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Il(t,wl(e)),e=Ol(e);return t}:Al,Dl=rl,Rl=Sl;var Fl=function(e,t){return Dl(e,Rl(e),t)},kl=_a,xl=Sl,jl=hl;var Cl=function(e){return kl(e,jl,xl)},Pl=Object.prototype.hasOwnProperty;var Ll=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Pl.call(e,"index")&&(n.index=e.index,n.input=e.input),n},$l=la;var Ml=function(e){var t=new e.constructor(e.byteLength);return new $l(t).set(new $l(e)),t},Vl=Ml;var Ul=function(e,t){var n=t?Vl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Bl=/\w*$/;var Gl=function(e){var t=new e.constructor(e.source,Bl.exec(e));return t.lastIndex=e.lastIndex,t},Ql=ue?ue.prototype:void 0,Yl=Ql?Ql.valueOf:void 0;var ql=Ml;var zl=Ml,Wl=Ul,Jl=Gl,Kl=function(e){return Yl?Object(Yl.call(e)):{}},Xl=function(e,t){var n=t?ql(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var Hl=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return zl(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Wl(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Xl(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return Jl(e);case"[object Symbol]":return Kl(e)}},Zl=yt,ep=Nl,tp=ns;var np=function(e){return"function"!=typeof e.constructor||tp(e)?{}:Zl(ep(e))},rp=Vs,ip=Bt;var op=function(e){return ip(e)&&"[object Map]"==rp(e)},ap=Va,sp=Ba&&Ba.isMap,cp=sp?ap(sp):op,up=Vs,lp=Bt;var pp=function(e){return lp(e)&&"[object Set]"==up(e)},dp=Va,fp=Ba&&Ba.isSet,hp=fp?dp(fp):pp,yp=ea,vp=ie,mp=du,gp=al,Ep=ml,Tp=El,bp=Gt,_p=_l,Np=Fl,Ip=gs,Op=Cl,wp=Vs,Ap=Ll,Sp=Hl,Dp=np,Rp=Ut,Fp=xa,kp=cp,xp=be,jp=hp,Cp=hs,Pp=hl,Lp="[object Arguments]",$p="[object Function]",Mp="[object Object]",Vp={};Vp[Lp]=Vp["[object Array]"]=Vp["[object ArrayBuffer]"]=Vp["[object DataView]"]=Vp["[object Boolean]"]=Vp["[object Date]"]=Vp["[object Float32Array]"]=Vp["[object Float64Array]"]=Vp["[object Int8Array]"]=Vp["[object Int16Array]"]=Vp["[object Int32Array]"]=Vp["[object Map]"]=Vp["[object Number]"]=Vp[Mp]=Vp["[object RegExp]"]=Vp["[object Set]"]=Vp["[object String]"]=Vp["[object Symbol]"]=Vp["[object Uint8Array]"]=Vp["[object Uint8ClampedArray]"]=Vp["[object Uint16Array]"]=Vp["[object Uint32Array]"]=!0,Vp["[object Error]"]=Vp[$p]=Vp["[object WeakMap]"]=!1;var Up=function e(t,n,r,i,o,a){var s,c=1&n,u=2&n,l=4&n;if(r&&(s=o?r(t,i,o,a):r(t)),void 0!==s)return s;if(!xp(t))return t;var p=Rp(t);if(p){if(s=Ap(t),!c)return bp(t,s)}else{var d=wp(t),f=d==$p||"[object GeneratorFunction]"==d;if(Fp(t))return Tp(t,c);if(d==Mp||d==Lp||f&&!o){if(s=u||f?{}:Dp(t),!c)return u?Np(t,Ep(s,t)):_p(t,gp(s,t))}else{if(!Vp[d])return o?t:{};s=Sp(t,d,c)}}a||(a=new yp);var h=a.get(t);if(h)return h;a.set(t,s),jp(t)?t.forEach(function(i){s.add(e(i,n,r,i,t,a))}):kp(t)&&t.forEach(function(i,o){s.set(o,e(i,n,r,o,t,a))});var y=p?void 0:(l?u?Op:Ip:u?Pp:Cp)(t);return vp(y||t,function(i,o){y&&(i=t[o=i]),mp(s,o,e(i,n,r,o,t,a))}),s},Bp=Up;var Gp=function(e){return Bp(e,5)},Qp=Te,Yp=Nl,qp=Bt,zp=Function.prototype,Wp=Object.prototype,Jp=zp.toString,Kp=Wp.hasOwnProperty,Xp=Jp.call(Object);var Hp=function(e){if(!qp(e)||"[object Object]"!=Qp(e))return!1;var t=Yp(e);if(null===t)return!0;var n=Kp.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Jp.call(n)==Xp};function Zp(){return r.randomBytes(16)}for(var ed,td,nd=[],rd=0;rd<256;++rd)nd[rd]=(rd+256).toString(16).substr(1);function id(e,t){var n=0,r=nd;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[n++]]].join("")}var od=0,ad=0;function sd(e,t,n){var r=function(e,r,i,o){var a=i&&o||0;if("string"==typeof e&&(e=function(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}(e)),"string"==typeof r&&(r=function(e){var t=[];return e.replace(/[a-fA-F0-9]{2}/g,function(e){t.push(parseInt(e,16))}),t}(r)),!Array.isArray(e))throw TypeError("value must be an array of bytes");if(!Array.isArray(r)||16!==r.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var s=n(r.concat(e));if(s[6]=15&s[6]|t,s[8]=63&s[8]|128,i)for(var c=0;c<16;++c)i[a+c]=s[c];return i||id(s)};try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}const cd=sd("v3",48,function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),r.createHash("md5").update(e).digest()});const ud=sd("v5",80,function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),r.createHash("sha1").update(e).digest()});var ld=Object.freeze({__proto__:null,v1:function(e,t,n){var r=t&&n||0,i=t||[],o=(e=e||{}).node||ed,a=void 0!==e.clockseq?e.clockseq:td;if(null==o||null==a){var s=e.random||(e.rng||Zp)();null==o&&(o=ed=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==a&&(a=td=16383&(s[6]<<8|s[7]))}var c=void 0!==e.msecs?e.msecs:(new Date).getTime(),u=void 0!==e.nsecs?e.nsecs:ad+1,l=c-od+(u-ad)/1e4;if(l<0&&void 0===e.clockseq&&(a=a+1&16383),(l<0||c>od)&&void 0===e.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");od=c,ad=u,td=a;var p=(1e4*(268435455&(c+=122192928e5))+u)%4294967296;i[r++]=p>>>24&255,i[r++]=p>>>16&255,i[r++]=p>>>8&255,i[r++]=255&p;var d=c/4294967296*1e4&268435455;i[r++]=d>>>8&255,i[r++]=255&d,i[r++]=d>>>24&15|16,i[r++]=d>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(var f=0;f<6;++f)i[r+f]=o[f];return t||id(i)},v3:cd,v4:function(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||Zp)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||id(i)},v5:ud}),pd=L(ld);!function(e){var t=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.generateFragmentFieldName=e.fieldNameFromStoreName=e.TypeOrFieldNameRegExp=e.maybeDeepClone=e.makeEntityId=e.isQuery=void 0;const n=t(Gp),r=t(uc),i=t(Hp),o=pd;function a(e){return"ROOT_QUERY"===e||"ROOT_MUTATION"===e}e.isQuery=a,e.makeEntityId=function(e,t){return a(e)?(0,r.default)([e,t]).join("."):e};e.maybeDeepClone=e=>(0,i.default)(e)&&Object.isFrozen(e)?(0,n.default)(e):e,e.TypeOrFieldNameRegExp=/^[_a-z][_0-9a-z]*/i,e.fieldNameFromStoreName=function(t){var n=t.match(e.TypeOrFieldNameRegExp);return n?n[0]:t},e.generateFragmentFieldName=function({fragmentName:e}={}){return`-fragment-${null!=e?e:(0,o.v4)()}`}}(el);var dd=C&&C.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},fd=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qu,"__esModule",{value:!0});const hd=fd(Hu),yd=Zu,vd=el,md=$,gd=Zu;qu.default=class{constructor(e){this.config=e,this.policyActionStorage={};const{cacheOperations:{readField:t,evict:n,modify:r}}=this.config;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(){const{policies:e}=this.config,{types:t={},timeToLive:n}=e;return Object.keys(t).reduce((e,n)=>{const r=t[n];return e[yd.InvalidationPolicyEvent.Read]=e[yd.InvalidationPolicyEvent.Read]||!!r.timeToLive,e[yd.InvalidationPolicyEvent.Write]=e[yd.InvalidationPolicyEvent.Write]||!!r[yd.InvalidationPolicyLifecycleEvent.Write],e[yd.InvalidationPolicyEvent.Evict]=e[yd.InvalidationPolicyEvent.Evict]||!!r[yd.InvalidationPolicyLifecycleEvent.Evict],e},{[yd.InvalidationPolicyEvent.Read]:!!n,[yd.InvalidationPolicyEvent.Write]:!1,[yd.InvalidationPolicyEvent.Evict]:!1})}getPolicy(e){var t,n;return(null===(n=null===(t=this.config.policies)||void 0===t?void 0:t.types)||void 0===n?void 0:n[e])||null}getPolicyActionStorage(e){return this.policyActionStorage[e]||(this.policyActionStorage[e]={}),this.policyActionStorage[e]}getTypePolicyForEvent(e,t){const n=this.getPolicy(e);return n?n[yd.InvalidationPolicyLifecycleEvent[t]]:null}runPolicyEvent(e,t,n){const{entityTypeMap:r}=this.config,{mutedCacheOperations:i}=this,o=this.getTypePolicyForEvent(e,t);if(!o)return;let a,s={};if("object"==typeof o){let{__default:e}=o;a=e,s=dd(o,["__default"])}else a=o;a&&a(i,Object.assign({storage:this.getPolicyActionStorage(`${e}__default`)},n)),Object.keys(s).forEach(e=>{var t;const a=null!==(t=r.readEntitiesByType(e))&&void 0!==t?t:{},s=o[e];Object.values(a).forEach(e=>{const{dataId:t,fieldName:r,storeFieldNames:o}=e;o?Object.keys(o.entries).forEach(e=>{s(i,Object.assign({id:t,fieldName:r,storeFieldName:e,variables:o.entries[e].variables,args:o.entries[e].args,ref:(0,md.makeReference)(t),storage:this.getPolicyActionStorage(e)},n))}):s(i,Object.assign({id:t,storage:this.getPolicyActionStorage(t),ref:(0,md.makeReference)(t)},n))})})}getRenewalPolicyForType(e){var t,n,r,i;const{policies:o}=this.config;return null!==(i=null!==(r=null===(n=null===(t=o.types)||void 0===t?void 0:t[e])||void 0===n?void 0:n.renewalPolicy)&&void 0!==r?r:o.renewalPolicy)&&void 0!==i?i:gd.RenewalPolicy.WriteOnly}runWritePolicy(e,t){return this.runPolicyEvent(e,yd.InvalidationPolicyEvent.Write,t)}runEvictPolicy(e,t){return this.runPolicyEvent(e,yd.InvalidationPolicyEvent.Evict,t)}runReadPolicy({typename:e,dataId:t,fieldName:n,storeFieldName:r,reportOnly:i=!1}){var o;const{cacheOperations:a,entityTypeMap:s,policies:c}=this.config,u=(0,vd.makeEntityId)(t,n),l=s.readEntityById(u);if(!l)return!1;let p;if(r&&l.storeFieldNames){const e=l.storeFieldNames.entries[r];if(!e)return!1;p=e.cacheTime}else p=l.cacheTime;const d=(null===(o=this.getPolicy(e))||void 0===o?void 0:o.timeToLive)||c.timeToLive;return!!((0,hd.default)(p)&&d&&Date.now()>p+d)&&(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]}};var Ed,Td={},bd={},_d={};Ed=_d,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.collectionEntityIdForType=Ed.cacheExtensionsCollectionTypename=void 0,Ed.cacheExtensionsCollectionTypename="CacheExtensionsCollectionEntity",Ed.collectionEntityIdForType=function(e){return`${Ed.cacheExtensionsCollectionTypename}:${e}`},Object.defineProperty(bd,"__esModule",{value:!0});const Nd=el,Id=_d;bd.default=class{constructor(e){this.config=e,this.delete=(e,t,n)=>{const{entityStore:r,entityTypeMap:i,policies:o}=this.config,a=this.storeFunctions.delete.call(r,e,t,n),s=i.readEntityById((0,Nd.makeEntityId)(e,t)),c=t&&n?o.getStoreFieldName({typename:s?s.typename:void 0,fieldName:t,args:n}):void 0;return i.evict(e,c||t),a},this.merge=(e,t)=>{const{entityStore:n,entityTypeMap:r}=this.config;if((0,Nd.isQuery)(e))Object.keys(t).filter(e=>"__typename"!==e).forEach(n=>{const i=t[n],o=null==i?void 0:i.__typename;if(o)r.write(o,e,n);else{const t=this.config.policies.rootTypenamesById[e];r.write(t,e,n)}});else{const n=t.__typename;e&&n&&n!==Id.cacheExtensionsCollectionTypename&&(this.config.updateCollectionField(n,e),r.write(n,e))}return this.storeFunctions.merge.call(n,e,t)},this.clear=()=>{const{config:{entityStore:e,entityTypeMap:t},storeFunctions:n}=this;t.clear(),n.clear.call(e)},this.replace=e=>{const{config:{entityStore:t,entityTypeMap:n,reactiveVarsCache:r},storeFunctions:{replace:i}}=this,o=null==e?void 0:e.invalidation;if(!e||!o)return i.call(t,e),void r.reset();delete e.invalidation,n.restore(o.entitiesById),this.pause(),i.call(t,e),r.reset(),this.watch()};const{entityStore:{clear:t,delete:n,merge:r,replace:i}}=this.config;this.storeFunctions={clear:t,delete:n,merge:r,replace:i},this.watch()}watch(){const{entityStore:e}=this.config;e.clear=this.clear,e.delete=this.delete,e.merge=this.merge,e.replace=this.replace}pause(){const{entityStore:e}=this.config,{clear:t,delete:n,merge:r,replace:i}=this.storeFunctions;e.clear=t,e.delete=n,e.merge=r,e.replace=i}};var Od={},wd=gu;var Ad=function(e,t,n){return null==e?e:wd(e,t,n)},Sd=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Od,"__esModule",{value:!0});const Dd=Sd(Ad),Rd=el;Od.default=class{constructor(){this.entitiesByType={},this.entitiesById={}}write(e,t,n,r,i){const o=n?(0,Rd.fieldNameFromStoreName)(n):void 0,a=(0,Rd.makeEntityId)(t,o),s=this.readEntityById(a);if(s){if((0,Rd.isQuery)(t)&&n){const e=s.storeFieldNames.entries[n];e?(e.variables=r,e.args=i):(s.storeFieldNames.entries[n]={variables:r,args:i},s.storeFieldNames.__size++)}}else{let s;const c=Date.now();s=(0,Rd.isQuery)(t)&&n?{dataId:t,typename:e,fieldName:o,storeFieldNames:{__size:1,entries:{[n]:{variables:r,args:i,cacheTime:c}}}}:{dataId:t,typename:e,cacheTime:c},(0,Dd.default)(this.entitiesByType,[e,a],s),this.entitiesById[a]=s}}evict(e,t){var n;const r=t?(0,Rd.fieldNameFromStoreName)(t):null,i=(0,Rd.makeEntityId)(e,r),o=this.readEntityById(i);if(o)if(t&&r!==t){const e=null===(n=this.entitiesByType[o.typename][i])||void 0===n?void 0:n.storeFieldNames;e&&(1===e.__size?(delete this.entitiesByType[o.typename][i],delete this.entitiesById[i]):(e.__size--,delete e.entries[t]))}else delete this.entitiesByType[o.typename][i],delete this.entitiesById[i]}readEntitiesByType(e){return this.entitiesByType[e]||null}readEntityById(e){return this.entitiesById[e]||null}renewEntity(e,t){const n=t?(0,Rd.fieldNameFromStoreName)(t):void 0,r=this.entitiesById[(0,Rd.makeEntityId)(e,n)];if(r){const n=Date.now();if((0,Rd.isQuery)(e)&&t){const e=r.storeFieldNames.entries[t];e&&(e.cacheTime=n)}else r.cacheTime=n}}restore(e){this.entitiesById=e,Object.keys(e).forEach(t=>{const n=e[t];this.entitiesByType[n.typename]||(this.entitiesByType[n.typename]={}),this.entitiesByType[n.typename][t]=n})}extract(){const{entitiesById:e,entitiesByType:t}=this;return{entitiesById:e,entitiesByType:t}}clear(){this.entitiesById={},this.entitiesByType={}}},function(e){var t=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.EntityTypeMap=e.EntityStoreWatcher=void 0;var n=bd;Object.defineProperty(e,"EntityStoreWatcher",{enumerable:!0,get:function(){return t(n).default}});var r=Od;Object.defineProperty(e,"EntityTypeMap",{enumerable:!0,get:function(){return t(r).default}})}(Td);var Fd={},kd=L(p),xd=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fd,"__esModule",{value:!0}),Fd.CacheResultProcessor=Fd.ReadResultStatus=void 0;const jd=$,Cd=xd(Hp),Pd=xd(Ut),Ld=kd,$d=el,Md=Zu;var Vd;!function(e){e[e.Evicted=0]="Evicted",e[e.Incomplete=1]="Incomplete",e[e.Complete=2]="Complete"}(Vd||(Fd.ReadResultStatus=Vd={}));Fd.CacheResultProcessor=class{constructor(e){this.config=e}getFieldsForQuery(e){const t=(0,Ld.getOperationDefinition)(e.query),n=(0,Ld.createFragmentMap)((0,Ld.getFragmentDefinitions)(e.query));return t.selectionSet.selections.reduce((e,t)=>{var r,i;if((0,Ld.isField)(t))return e.push(t),e;const o=null===(i=null===(r=(0,Ld.getFragmentFromSelection)(t,n))||void 0===r?void 0:r.selectionSet)||void 0===i?void 0:i.selections;return o&&e.push(...o),e},[])}processReadSubResult(e,t){const{cache:n,invalidationPolicyManager:r,entityTypeMap:i}=this.config,o=null==t?e:e[t];if((0,Cd.default)(o)){const{__typename:a}=o,s=Object.keys(o).reduce((e,t)=>this.processReadSubResult(o,t)===Vd.Complete,!0);if(a){const s=n.identify(o);if(s){const n=r.getRenewalPolicyForType(a);n!==Md.RenewalPolicy.AccessAndWrite&&n!==Md.RenewalPolicy.AccessOnly||i.renewEntity(s);if(r.runReadPolicy({typename:a,dataId:s}))return(0,Cd.default)(e)&&t&&delete e[t],Vd.Evicted}}return s?Vd.Complete:Vd.Incomplete}if((0,Pd.default)(o)){let n=Vd.Complete;const r=o.map((e,t)=>{const r=this.processReadSubResult(o,t);return r<n&&(n=r),r});return n===Vd.Evicted&&t&&(e[t]=o.filter((e,t)=>r[t]!==Vd.Evicted)),n===Vd.Complete?Vd.Complete:Vd.Incomplete}return Vd.Complete}processReadResult(e,t){const{cache:n,entityTypeMap:r,invalidationPolicyManager:i}=this.config,{rootId:o="ROOT_QUERY"}=t;if((0,Cd.default)(e)){if((0,$d.isQuery)(o)){const{variables:a}=t,s=this.getFieldsForQuery(t).reduce((t,s)=>{var c;const u=s.name.value,l=(0,Ld.resultKeyNameFromField)(s),p=this.processReadSubResult(e,l),d=null===(c=r.readEntityById((0,$d.makeEntityId)(o,u)))||void 0===c?void 0:c.typename;if(d){const t=n.policies.getStoreFieldName({typename:d,fieldName:u,field:s,variables:a}),c=n.policies.rootTypenamesById[o],p=n.policies.getStoreFieldName({typename:c,fieldName:u,field:s,variables:a}),f=i.getRenewalPolicyForType(d);f!==Md.RenewalPolicy.AccessAndWrite&&f!==Md.RenewalPolicy.AccessOnly||(r.renewEntity(o,t),r.renewEntity(o,p));const h=i.runReadPolicy({typename:d,dataId:o,fieldName:u,storeFieldName:t}),y=i.runReadPolicy({typename:d,dataId:o,fieldName:u,storeFieldName:p});if(h||y)return delete e[l],!1}return t&&p===Vd.Complete},!0);return(0,Ld.maybeDeepFreeze)(e),s?Vd.Complete:Vd.Incomplete}return(0,Ld.maybeDeepFreeze)(e),this.processReadSubResult(e)}return Vd.Complete}processWriteSubResult(e){const{cache:t,invalidationPolicyManager:n,entityTypeMap:r}=this.config;if((0,Cd.default)(e)){const{__typename:i}=e;if(Object.keys(e).forEach(t=>this.processWriteSubResult(e[t])),i){const o=t.identify(e);if(o){const e=n.getRenewalPolicyForType(i);e!==Md.RenewalPolicy.WriteOnly&&e!==Md.RenewalPolicy.AccessAndWrite||r.renewEntity(o),n.runWritePolicy(i,{parent:{id:o,ref:(0,jd.makeReference)(o)}})}}}else(0,Pd.default)(e)&&e.forEach(e=>this.processWriteSubResult(e))}processWriteResult(e){var t;const{dataId:n,variables:r,result:i}=e,{entityTypeMap:o,cache:a,invalidationPolicyManager:s}=this.config;if((0,Cd.default)(i)&&this.processWriteSubResult(i),n&&(0,$d.isQuery)(n)&&(0,Cd.default)(i))this.getFieldsForQuery(e).forEach(e=>{var t;const i=e.name.value,c=null===(t=o.readEntityById((0,$d.makeEntityId)(n,i)))||void 0===t?void 0:t.typename;if(c){const t=a.policies.getStoreFieldName({typename:c,field:e,fieldName:i,variables:r}),u=(0,Ld.argumentsObjectFromField)(e,r),l=null!=r?r:null!==u?{}:void 0,p=a.policies.rootTypenamesById[n],d=a.policies.getStoreFieldName({typename:p,fieldName:i,field:e,variables:r});o.write(c,n,t,l,u),o.write(c,n,d,l,u);const f=s.getRenewalPolicyForType(c);f!==Md.RenewalPolicy.WriteOnly&&f!==Md.RenewalPolicy.AccessAndWrite||(o.renewEntity(n,t),o.renewEntity(n,d)),s.runWritePolicy(c,{parent:{id:n,fieldName:i,storeFieldName:t,ref:(0,jd.makeReference)(n),variables:l,args:u}})}});else if(n){const e=null===(t=o.readEntityById((0,$d.makeEntityId)(n)))||void 0===t?void 0:t.typename;if(e){const t=s.getRenewalPolicyForType(e);t!==Md.RenewalPolicy.WriteOnly&&t!==Md.RenewalPolicy.AccessAndWrite||o.renewEntity(n),s.runWritePolicy(e,{parent:{id:n,ref:(0,jd.makeReference)(n),variables:r}})}}}};var Ud=C&&C.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},Bd=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cc,"__esModule",{value:!0});const Gd=$,Qd=Bd(uc),Yd=Bd(cu),qd=Bd(Ou),zd=Bd(Su),Wd=Bd(Du),Jd=Bd(Oe),Kd=Bd(Yu),Xd=Bd(qu),Hd=Td,Zd=el,ef=Fd,tf=Zu,nf=_d,rf=ac;class of extends Gd.InMemoryCache{constructor(e={}){const{invalidationPolicies:t={},enableCollections:n=!1}=e;super(Ud(e,["invalidationPolicies","enableCollections"])),this.pendingCollectionUpdates={},this.enableCollections=n,this.invalidationPolicies=t,this.isBroadcasting=!1,this.isInitialized=!0,this.reactiveVarsCache=(0,rf.initReactiveVarsCache)(this),this.reinitialize()}reinitialize(){this.entityStoreRoot=this.data,this.entityTypeMap=new Hd.EntityTypeMap,this.entityStoreWatcher=new Hd.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new Xd.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 ef.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;const n="string"==typeof e?{fieldName:e,from:t}:e;return void 0===n.from&&(n.from={__ref:"ROOT_QUERY"}),this.policies.readField(n,{store:this.entityStoreRoot})}broadcastWatches(e){this.isBroadcasting=!0,super.broadcastWatches(e),this.isBroadcasting=!1}get _hasPendingCollectionUpdates(){return Object.keys(this.pendingCollectionUpdates).length>0}isOperatingOnRootData(){return this.data===this.entityStoreRoot}modify(e){var t;const n=super.modify(e);if(!this.invalidationPolicyManager.isPolicyEventActive(tf.InvalidationPolicyEvent.Write)||!n)return n;const{id:r="ROOT_QUERY",fields:i}=e;if((0,Zd.isQuery)(r))Object.keys(i).forEach(e=>{var t;const n=(0,Zd.fieldNameFromStoreName)(e),i=null===(t=this.entityTypeMap.readEntityById((0,Zd.makeEntityId)(r,n)))||void 0===t?void 0:t.typename;i&&this.invalidationPolicyManager.runWritePolicy(i,{parent:{id:r,fieldName:n,storeFieldName:e,ref:(0,Gd.makeReference)(r)}})});else{const e=null===(t=this.entityTypeMap.readEntityById(r))||void 0===t?void 0:t.typename;if(!e)return n;this.invalidationPolicyManager.runWritePolicy(e,{parent:{id:r,ref:(0,Gd.makeReference)(r)}})}return e.broadcast&&this.broadcastWatches(),n}write(e){const t=super.write(e);return(this.invalidationPolicyManager.isPolicyEventActive(tf.InvalidationPolicyEvent.Write)||this.invalidationPolicyManager.isPolicyEventActive(tf.InvalidationPolicyEvent.Read))&&this.isOperatingOnRootData()?(this.cacheResultProcessor.processWriteResult(e),e.broadcast&&this.broadcastWatches(),t):t}evictWhere(e){const{__typename:t,filter:n}=e,r=this.readReferenceWhere({__typename:t,filter:n});return r.forEach(e=>this.evict({id:e.__ref,broadcast:!1})),this.broadcastWatches(),r}evict(e){var t;const{fieldName:n,args:r}=e;let{id:i}=e;if(!i){if(Object.prototype.hasOwnProperty.call(e,"id"))return!1;i="ROOT_QUERY"}if(this.invalidationPolicyManager.isPolicyEventActive(tf.InvalidationPolicyEvent.Evict)){const{typename:e}=null!==(t=this.entityTypeMap.readEntityById((0,Zd.makeEntityId)(i,n)))&&void 0!==t?t:{};if(e){const t=(0,Zd.isQuery)(i)&&n?this.policies.getStoreFieldName({typename:e,fieldName:n,args:r}):void 0;this.invalidationPolicyManager.runEvictPolicy(e,{parent:{id:i,fieldName:n,storeFieldName:t,variables:r,ref:(0,Gd.makeReference)(i)}})}}return super.evict(e)}_updatePendingCollection(e){const t=this.pendingCollectionUpdates[e];t&&(this.modify({broadcast:!1,id:e,fields:{data:(e,{canRead:n})=>{let r=!1;const i=e.reduce((e,t)=>{const{__ref:n}=t;return!r&&e[n]&&(r=!0),e[n]=t,e},{}),o=Object.values(t).filter(e=>!i[e.__ref]&&n(e));return r||0!==o.length?[...Object.values(i),...o]:e}}}),delete this.pendingCollectionUpdates[e])}_updatePendingCollections(){this._hasPendingCollectionUpdates&&(Object.keys(this.pendingCollectionUpdates).forEach(e=>{this._updatePendingCollection(e)}),this.broadcastWatches())}updateCollectionField(e,t){if(!this.enableCollections)return;const n=(0,nf.collectionEntityIdForType)(e);!!this.readField("id",(0,Gd.makeReference)(n))||this.writeFragment({id:n,fragment:Gd.gql`
          fragment InitializeCollectionEntity on CacheExtensionsCollectionEntity {
            data
            id
          }
        `,data:{__typename:nf.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,Gd.makeReference)(t)))}_expire(e=!1){const{entitiesById:t}=this.entityTypeMap.extract(),n=[];return Object.keys(t).forEach(r=>{const i=t[r],{storeFieldNames:o,dataId:a,fieldName:s,typename:c}=i;if((0,Zd.isQuery)(a)&&o)Object.keys(o.entries).forEach(t=>{this.invalidationPolicyManager.runReadPolicy({typename:c,dataId:a,fieldName:s,storeFieldName:t,reportOnly:e})&&n.push((0,Zd.makeEntityId)(a,t))});else{this.invalidationPolicyManager.runReadPolicy({typename:c,dataId:a,fieldName:s,reportOnly:e})&&n.push((0,Zd.makeEntityId)(a))}}),n.length>0&&this.broadcastWatches(),n}expire(){return this._expire(!1)}expiredEntities(){return this._expire(!0)}activatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.activatePolicies(...e):this.invalidationPolicyManager.activatePolicies(tf.InvalidationPolicyEvent.Read,tf.InvalidationPolicyEvent.Write,tf.InvalidationPolicyEvent.Evict)}deactivatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.deactivatePolicies(...e):this.invalidationPolicyManager.deactivatePolicies(tf.InvalidationPolicyEvent.Read,tf.InvalidationPolicyEvent.Write,tf.InvalidationPolicyEvent.Evict)}activePolicyEvents(){return[tf.InvalidationPolicyEvent.Read,tf.InvalidationPolicyEvent.Write,tf.InvalidationPolicyEvent.Evict].filter(e=>this.invalidationPolicyManager.isPolicyEventActive(e))}read(e){const t=super.read(e);if(!this.invalidationPolicyManager.isPolicyEventActive(tf.InvalidationPolicyEvent.Read))return t;const n=(0,Zd.maybeDeepClone)(t),r=this.cacheResultProcessor.processReadResult(n,e);return r===ef.ReadResultStatus.Complete?t:(this.broadcastWatches(),r===ef.ReadResultStatus.Evicted?null:n)}diff(e){const t=super.diff(e);if(!this.invalidationPolicyManager.isPolicyEventActive(tf.InvalidationPolicyEvent.Read)||this.isBroadcasting)return t;const{result:n}=t,r=(0,Zd.maybeDeepClone)(n),i=this.cacheResultProcessor.processReadResult(r,e);return i===ef.ReadResultStatus.Complete||(this.broadcastWatches(),t.complete=!1,t.result=i===ef.ReadResultStatus.Evicted?void 0:r),t}extract(e=!1,t=!0){this._hasPendingCollectionUpdates&&this._updatePendingCollections();const n=super.extract(e);return t&&(n.invalidation=(0,qd.default)(this.entityTypeMap.extract(),"entitiesById")),n}readFragmentWhere(e){const{fragment:t,filter:n,limit:r,orderBy:i}=e,o=Ud(e,["fragment","filter","limit","orderBy"]),a=t.definitions[0].typeCondition.name.value,s=this.readReferenceWhere({__typename:a,filter:n,limit:r,orderBy:i}).map(e=>this.readFragment(Object.assign(Object.assign({},o),{fragment:t,id:e.__ref})));return(0,Qd.default)(s)}readReferenceWhere(e){const{__typename:t,filter:n,limit:r,orderBy:i}=e,o=(0,nf.collectionEntityIdForType)(t);this.pendingCollectionUpdates[o]&&this._updatePendingCollection(o);let a=this.readField("data",(0,Gd.makeReference)(o));if(!a)return[];const s=this.readField.bind(this);if(n&&(a=a.filter(e=>{if((0,Jd.default)(n))return n(e,s);const t=Object.keys(n).map(t=>n[t]===this.readField(t,e));return(0,Yd.default)(t,Boolean)})),i){const{field:e,descending:t}=i;a=(0,Kd.default)(a,t=>s(e,t),[t?"desc":"asc"])}return(0,Wd.default)(r)?a:(0,zd.default)(a,r)}writeFragmentWhere(e){const{update:t}=e,n=Ud(e,["update"]);this.readFragmentWhere(n).forEach(n=>{this.writeFragment({id:this.identify(n),fragment:e.fragment,data:t(n),broadcast:!1})}),this.broadcastWatches()}}cc.default=of,function(e){var t=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidationPolicyCache=e.makeCachedVar=void 0;var n=ac;Object.defineProperty(e,"makeCachedVar",{enumerable:!0,get:function(){return n.makeCachedVar}});var r=cc;Object.defineProperty(e,"InvalidationPolicyCache",{enumerable:!0,get:function(){return t(r).default}})}(oc);var af={},sf={},cf={};const uf=Object.freeze({major:16,minor:11,patch:0,preReleaseTag:null});function lf(e,t){if(!Boolean(e))throw new Error(t)}function pf(e){return"function"==typeof(null==e?void 0:e.then)}function df(e){return"object"==typeof e&&null!==e}function ff(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}const hf=/\r\n|[\n\r]/g;function yf(e,t){let n=0,r=1;for(const i of e.body.matchAll(hf)){if("number"==typeof i.index||ff(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function vf(e){return mf(e.source,yf(e.source,e.start))}function mf(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?n:0,c=t.column+s,u=`${e.name}:${a}:${c}\n`,l=r.split(/\r\n|[\n\r]/g),p=l[i];if(p.length>120){const e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<p.length;e+=80)n.push(p.slice(e,e+80));return u+gf([[`${a} |`,n[0]],...n.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return u+gf([[a-1+" |",l[i-1]],[`${a} |`,p],["|","^".padStart(c)],[`${a+1} |`,l[i+1]]])}function gf(e){const t=e.filter(([e,t])=>void 0!==t),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?" "+t:"")).join("\n")}class Ef extends Error{constructor(e,...t){var n,r,i;const{nodes:o,source:a,positions:s,path:c,originalError:u,extensions:l}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=c?c:void 0,this.originalError=null!=u?u:void 0,this.nodes=Tf(Array.isArray(o)?o:o?[o]:void 0);const p=Tf(null===(n=this.nodes)||void 0===n?void 0:n.map(e=>e.loc).filter(e=>null!=e));this.source=null!=a?a:null==p||null===(r=p[0])||void 0===r?void 0:r.source,this.positions=null!=s?s:null==p?void 0:p.map(e=>e.start),this.locations=s&&a?s.map(e=>yf(a,e)):null==p?void 0:p.map(e=>yf(e.source,e.start));const d=df(null==u?void 0:u.extensions)?null==u?void 0:u.extensions:void 0;this.extensions=null!==(i=null!=l?l:d)&&void 0!==i?i: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!=u&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Ef):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"+vf(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+mf(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function Tf(e){return void 0===e||0===e.length?void 0:e}function bf(e,t,n){return new Ef(`Syntax Error: ${n}`,{source:e,positions:[t]})}class _f{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 Nf{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,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 If={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"]},Of=new Set(Object.keys(If));function wf(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&Of.has(t)}var Af,Sf,Df,Rf;function Ff(e){return 9===e||32===e}function kf(e){return e>=48&&e<=57}function xf(e){return e>=97&&e<=122||e>=65&&e<=90}function jf(e){return xf(e)||95===e}function Cf(e){return xf(e)||kf(e)||95===e}function Pf(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let t=0;t<e.length;++t){var o;const a=e[t],s=Lf(a);s!==a.length&&(r=null!==(o=r)&&void 0!==o?o:t,i=t,0!==t&&s<n&&(n=s))}return e.map((e,t)=>0===t?e:e.slice(n)).slice(null!==(t=r)&&void 0!==t?t:0,i+1)}function Lf(e){let t=0;for(;t<e.length&&Ff(e.charCodeAt(t));)++t;return t}function $f(e){if(""===e)return!0;let t=!0,n=!1,r=!0,i=!1;for(let o=0;o<e.length;++o)switch(e.codePointAt(o)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:case 13:return!1;case 10:if(t&&!i)return!1;i=!0,t=!0,n=!1;break;case 9:case 32:n||(n=t);break;default:r&&(r=n),t=!1}return!t&&(!r||!i)}function Mf(e,t){const n=e.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=1===r.length,o=r.length>1&&r.slice(1).every(e=>0===e.length||Ff(e.charCodeAt(0))),a=n.endsWith('\\"""'),s=e.endsWith('"')&&!a,c=e.endsWith("\\"),u=s||c,l=!(null!=t&&t.minimize)&&(!i||e.length>70||u||o||a);let p="";const d=i&&Ff(e.charCodeAt(0));return(l&&!d||o)&&(p+="\n"),p+=n,(l||u)&&(p+="\n"),'"""'+p+'"""'}!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(Af||(Af={})),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"}(Sf||(Sf={})),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"}(Df||(Df={})),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"}(Rf||(Rf={}));class Vf{constructor(e){const t=new Nf(Rf.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==Rf.EOF)do{if(e.next)e=e.next;else{const t=Wf(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Rf.COMMENT);return e}}function Uf(e){return e===Rf.BANG||e===Rf.DOLLAR||e===Rf.AMP||e===Rf.PAREN_L||e===Rf.PAREN_R||e===Rf.SPREAD||e===Rf.COLON||e===Rf.EQUALS||e===Rf.AT||e===Rf.BRACKET_L||e===Rf.BRACKET_R||e===Rf.BRACE_L||e===Rf.PIPE||e===Rf.BRACE_R}function Bf(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Gf(e,t){return Qf(e.charCodeAt(t))&&Yf(e.charCodeAt(t+1))}function Qf(e){return e>=55296&&e<=56319}function Yf(e){return e>=56320&&e<=57343}function qf(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return Rf.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function zf(e,t,n,r,i){const o=e.line,a=1+n-e.lineStart;return new Nf(t,n,r,o,a,i)}function Wf(e,t){const n=e.source.body,r=n.length;let i=t;for(;i<r;){const t=n.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===n.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return Jf(e,i);case 33:return zf(e,Rf.BANG,i,i+1);case 36:return zf(e,Rf.DOLLAR,i,i+1);case 38:return zf(e,Rf.AMP,i,i+1);case 40:return zf(e,Rf.PAREN_L,i,i+1);case 41:return zf(e,Rf.PAREN_R,i,i+1);case 46:if(46===n.charCodeAt(i+1)&&46===n.charCodeAt(i+2))return zf(e,Rf.SPREAD,i,i+3);break;case 58:return zf(e,Rf.COLON,i,i+1);case 61:return zf(e,Rf.EQUALS,i,i+1);case 64:return zf(e,Rf.AT,i,i+1);case 91:return zf(e,Rf.BRACKET_L,i,i+1);case 93:return zf(e,Rf.BRACKET_R,i,i+1);case 123:return zf(e,Rf.BRACE_L,i,i+1);case 124:return zf(e,Rf.PIPE,i,i+1);case 125:return zf(e,Rf.BRACE_R,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?ih(e,i):Hf(e,i)}if(kf(t)||45===t)return Kf(e,i,t);if(jf(t))return oh(e,i);throw bf(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Bf(t)||Gf(n,i)?`Unexpected character: ${qf(e,i)}.`:`Invalid character: ${qf(e,i)}.`)}return zf(e,Rf.EOF,r,r)}function Jf(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const e=n.charCodeAt(i);if(10===e||13===e)break;if(Bf(e))++i;else{if(!Gf(n,i))break;i+=2}}return zf(e,Rf.COMMENT,t,i,n.slice(t+1,i))}function Kf(e,t,n){const r=e.source.body;let i=t,o=n,a=!1;if(45===o&&(o=r.charCodeAt(++i)),48===o){if(o=r.charCodeAt(++i),kf(o))throw bf(e.source,i,`Invalid number, unexpected digit after 0: ${qf(e,i)}.`)}else i=Xf(e,i,o),o=r.charCodeAt(i);if(46===o&&(a=!0,o=r.charCodeAt(++i),i=Xf(e,i,o),o=r.charCodeAt(i)),69!==o&&101!==o||(a=!0,o=r.charCodeAt(++i),43!==o&&45!==o||(o=r.charCodeAt(++i)),i=Xf(e,i,o),o=r.charCodeAt(i)),46===o||jf(o))throw bf(e.source,i,`Invalid number, expected digit but got: ${qf(e,i)}.`);return zf(e,a?Rf.FLOAT:Rf.INT,t,i,r.slice(t,i))}function Xf(e,t,n){if(!kf(n))throw bf(e.source,t,`Invalid number, expected digit but got: ${qf(e,t)}.`);const r=e.source.body;let i=t+1;for(;kf(r.charCodeAt(i));)++i;return i}function Hf(e,t){const n=e.source.body,r=n.length;let i=t+1,o=i,a="";for(;i<r;){const r=n.charCodeAt(i);if(34===r)return a+=n.slice(o,i),zf(e,Rf.STRING,t,i+1,a);if(92===r){a+=n.slice(o,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?Zf(e,i):eh(e,i):rh(e,i);a+=t.value,i+=t.size,o=i;continue}if(10===r||13===r)break;if(Bf(r))++i;else{if(!Gf(n,i))throw bf(e.source,i,`Invalid character within String: ${qf(e,i)}.`);i+=2}}throw bf(e.source,i,"Unterminated string.")}function Zf(e,t){const n=e.source.body;let r=0,i=3;for(;i<12;){const e=n.charCodeAt(t+i++);if(125===e){if(i<5||!Bf(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|nh(e),r<0)break}throw bf(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function eh(e,t){const n=e.source.body,r=th(n,t+2);if(Bf(r))return{value:String.fromCodePoint(r),size:6};if(Qf(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=th(n,t+8);if(Yf(e))return{value:String.fromCodePoint(r,e),size:12}}throw bf(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function th(e,t){return nh(e.charCodeAt(t))<<12|nh(e.charCodeAt(t+1))<<8|nh(e.charCodeAt(t+2))<<4|nh(e.charCodeAt(t+3))}function nh(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function rh(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw bf(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function ih(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,a=o,s="";const c=[];for(;o<r;){const r=n.charCodeAt(o);if(34===r&&34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)){s+=n.slice(a,o),c.push(s);const r=zf(e,Rf.BLOCK_STRING,t,o+3,Pf(c).join("\n"));return e.line+=c.length-1,e.lineStart=i,r}if(92!==r||34!==n.charCodeAt(o+1)||34!==n.charCodeAt(o+2)||34!==n.charCodeAt(o+3))if(10!==r&&13!==r)if(Bf(r))++o;else{if(!Gf(n,o))throw bf(e.source,o,`Invalid character within String: ${qf(e,o)}.`);o+=2}else s+=n.slice(a,o),c.push(s),13===r&&10===n.charCodeAt(o+1)?o+=2:++o,s="",a=o,i=o;else s+=n.slice(a,o),a=o+1,o+=4}throw bf(e.source,o,"Unterminated string.")}function oh(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){if(!Cf(n.charCodeAt(i)))break;++i}return zf(e,Rf.NAME,t,i,n.slice(t,i))}function ah(e){return sh(e,[])}function sh(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:sh(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(sh(e[r],t));1===r?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map(([e,n])=>e+": "+sh(n,t));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const ch=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var n;const r=t.prototype[Symbol.toStringTag];if(r===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(n=e.constructor)||void 0===n?void 0:n.name)){const t=ah(e);throw new Error(`Cannot use ${r} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class uh{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||lf(!1,`Body must be a string. Received: ${ah(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||lf(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||lf(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function lh(e){return ch(e,uh)}function ph(e,t){const n=new fh(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}function dh(e,t){const n=new fh(e,t);n.expectToken(Rf.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(Rf.EOF),r}class fh{constructor(e,t={}){const n=lh(e)?e:new uh(e);this._lexer=new Vf(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(Rf.NAME);return this.node(e,{kind:Df.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Df.DOCUMENT,definitions:this.many(Rf.SOF,this.parseDefinition,Rf.EOF)})}parseDefinition(){if(this.peek(Rf.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===Rf.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 bf(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(){const e=this._lexer.token;if(this.peek(Rf.BRACE_L))return this.node(e,{kind:Df.OPERATION_DEFINITION,operation:Af.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(Rf.NAME)&&(n=this.parseName()),this.node(e,{kind:Df.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Rf.NAME);switch(e.value){case"query":return Af.QUERY;case"mutation":return Af.MUTATION;case"subscription":return Af.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Rf.PAREN_L,this.parseVariableDefinition,Rf.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Df.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Rf.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Rf.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Rf.DOLLAR),this.node(e,{kind:Df.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Df.SELECTION_SET,selections:this.many(Rf.BRACE_L,this.parseSelection,Rf.BRACE_R)})}parseSelection(){return this.peek(Rf.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Rf.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:Df.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Rf.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Rf.PAREN_L,t,Rf.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Rf.COLON),this.node(t,{kind:Df.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Rf.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(Rf.NAME)?this.node(e,{kind:Df.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:Df.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:Df.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:Df.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){const t=this._lexer.token;switch(t.kind){case Rf.BRACKET_L:return this.parseList(e);case Rf.BRACE_L:return this.parseObject(e);case Rf.INT:return this.advanceLexer(),this.node(t,{kind:Df.INT,value:t.value});case Rf.FLOAT:return this.advanceLexer(),this.node(t,{kind:Df.FLOAT,value:t.value});case Rf.STRING:case Rf.BLOCK_STRING:return this.parseStringLiteral();case Rf.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:Df.BOOLEAN,value:!0});case"false":return this.node(t,{kind:Df.BOOLEAN,value:!1});case"null":return this.node(t,{kind:Df.NULL});default:return this.node(t,{kind:Df.ENUM,value:t.value})}case Rf.DOLLAR:if(e){if(this.expectToken(Rf.DOLLAR),this._lexer.token.kind===Rf.NAME){const e=this._lexer.token.value;throw bf(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:Df.STRING,value:e.value,block:e.kind===Rf.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:Df.LIST,values:this.any(Rf.BRACKET_L,()=>this.parseValueLiteral(e),Rf.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:Df.OBJECT,fields:this.any(Rf.BRACE_L,()=>this.parseObjectField(e),Rf.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Rf.COLON),this.node(t,{kind:Df.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Rf.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Rf.AT),this.node(t,{kind:Df.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Rf.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(Rf.BRACKET_R),t=this.node(e,{kind:Df.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(Rf.BANG)?this.node(e,{kind:Df.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Df.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Rf.STRING)||this.peek(Rf.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(Rf.BRACE_L,this.parseOperationTypeDefinition,Rf.BRACE_R);return this.node(e,{kind:Df.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Rf.COLON);const n=this.parseNamedType();return this.node(e,{kind:Df.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:Df.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Df.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Rf.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Rf.BRACE_L,this.parseFieldDefinition,Rf.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Rf.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:Df.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(Rf.PAREN_L,this.parseInputValueDef,Rf.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Rf.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(Rf.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:Df.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Df.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:Df.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Rf.EQUALS)?this.delimitedMany(Rf.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:Df.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Rf.BRACE_L,this.parseEnumValueDefinition,Rf.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:Df.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 bf(this._lexer.source,this._lexer.token.start,`${hh(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Df.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Rf.BRACE_L,this.parseInputValueDef,Rf.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Rf.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(Rf.BRACE_L,this.parseOperationTypeDefinition,Rf.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:Df.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:Df.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:Df.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=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:Df.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Df.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Df.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:Df.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Rf.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:Df.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Rf.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(Sf,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new _f(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw bf(this._lexer.source,t.start,`Expected ${yh(e)}, found ${hh(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==Rf.NAME||t.value!==e)throw bf(this._lexer.source,t.start,`Expected "${e}", found ${hh(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===Rf.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return bf(this._lexer.source,t.start,`Unexpected ${hh(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==Rf.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw bf(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function hh(e){const t=e.value;return yh(e.kind)+(null!=t?` "${t}"`:"")}function yh(e){return Uf(e)?`"${e}"`:e}function vh(e,t){const[n,r]=t?[e,t]:[void 0,e];let i=" Did you mean ";n&&(i+=n+" ");const o=r.map(e=>`"${e}"`);switch(o.length){case 0:return"";case 1:return i+o[0]+"?";case 2:return i+o[0]+" or "+o[1]+"?"}const a=o.slice(0,5),s=a.pop();return i+a.join(", ")+", or "+s+"?"}function mh(e){return e}function gh(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function Eh(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function Th(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function bh(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e.charCodeAt(n),o=t.charCodeAt(r);if(Ih(i)&&Ih(o)){let a=0;do{++n,a=10*a+i-_h,i=e.charCodeAt(n)}while(Ih(i)&&a>0);let s=0;do{++r,s=10*s+o-_h,o=t.charCodeAt(r)}while(Ih(o)&&s>0);if(a<s)return-1;if(a>s)return 1}else{if(i<o)return-1;if(i>o)return 1;++n,++r}}return e.length-t.length}const _h=48,Nh=57;function Ih(e){return!isNaN(e)&&_h<=e&&e<=Nh}function Oh(e,t){const n=Object.create(null),r=new wh(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort((e,t)=>{const r=n[e]-n[t];return 0!==r?r:bh(e,t)})}class wh{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=Ah(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;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=Ah(n),i=this._inputArray;if(r.length<i.length){const e=r;r=i,i=e}const o=r.length,a=i.length;if(o-a>t)return;const s=this._rows;for(let e=0;e<=a;e++)s[0][e]=e;for(let e=1;e<=o;e++){const n=s[(e-1)%3],o=s[e%3];let c=o[0]=e;for(let t=1;t<=a;t++){const a=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+a);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=s[(e-2)%3][t-2];u=Math.min(u,n+1)}u<c&&(c=u),o[t]=u}if(c>t)return}const c=s[o%3][a];return c<=t?c:void 0}}function Ah(e){const t=e.length,n=new Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}function Sh(e){if(null==e)return Object.create(null);if(null===Object.getPrototypeOf(e))return e;const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]=r;return t}const Dh=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Rh(e){return Fh[e.charCodeAt(0)]}const Fh=["\\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"],kh=Object.freeze({});function xh(e,t,n=If){const r=new Map;for(const e of Object.values(Df))r.set(e,Ch(t,e));let i,o,a,s=Array.isArray(e),c=[e],u=-1,l=[],p=e;const d=[],f=[];do{u++;const e=u===c.length,m=e&&0!==l.length;if(e){if(o=0===f.length?void 0:d[d.length-1],p=a,a=f.pop(),m)if(s){p=p.slice();let e=0;for(const[t,n]of l){const r=t-e;null===n?(p.splice(r,1),e++):p[r]=n}}else{p={...p};for(const[e,t]of l)p[e]=t}u=i.index,c=i.keys,l=i.edits,s=i.inArray,i=i.prev}else if(a){if(o=s?u:c[u],p=a[o],null==p)continue;d.push(o)}let g;if(!Array.isArray(p)){var h,y;wf(p)||lf(!1,`Invalid AST Node: ${ah(p)}.`);const n=e?null===(h=r.get(p.kind))||void 0===h?void 0:h.leave:null===(y=r.get(p.kind))||void 0===y?void 0:y.enter;if(g=null==n?void 0:n.call(t,p,o,a,d,f),g===kh)break;if(!1===g){if(!e){d.pop();continue}}else if(void 0!==g&&(l.push([o,g]),!e)){if(!wf(g)){d.pop();continue}p=g}}var v;if(void 0===g&&m&&l.push([o,p]),e)d.pop();else i={inArray:s,index:u,keys:c,edits:l,prev:i},s=Array.isArray(p),c=s?p:null!==(v=n[p.kind])&&void 0!==v?v:[],u=-1,l=[],a&&f.push(a),a=p}while(void 0!==i);return 0!==l.length?l[l.length-1][1]:e}function jh(e){const t=new Array(e.length).fill(null),n=Object.create(null);for(const r of Object.values(Df)){let i=!1;const o=new Array(e.length).fill(void 0),a=new Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){const{enter:n,leave:s}=Ch(e[t],r);i||(i=null!=n||null!=s),o[t]=n,a[t]=s}if(!i)continue;const s={enter(...n){const r=n[0];for(let a=0;a<e.length;a++)if(null===t[a]){var i;const s=null===(i=o[a])||void 0===i?void 0:i.apply(e[a],n);if(!1===s)t[a]=r;else if(s===kh)t[a]=kh;else if(void 0!==s)return s}},leave(...n){const r=n[0];for(let o=0;o<e.length;o++)if(null===t[o]){var i;const r=null===(i=a[o])||void 0===i?void 0:i.apply(e[o],n);if(r===kh)t[o]=kh;else if(void 0!==r&&!1!==r)return r}else t[o]===r&&(t[o]=null)}};n[r]=s}return n}function Ch(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function Ph(e){return xh(e,Lh)}const Lh={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>$h(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=Vh("(",$h(e.variableDefinitions,", "),")"),n=$h([e.operation,$h([e.name,t]),$h(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Vh(" = ",n)+Vh(" ",$h(r," "))},SelectionSet:{leave:({selections:e})=>Mh(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=Vh("",e,": ")+t;let a=o+Vh("(",$h(n,", "),")");return a.length>80&&(a=o+Vh("(\n",Uh($h(n,"\n")),"\n)")),$h([a,$h(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Vh(" ",$h(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>$h(["...",Vh("on ",e),$h(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Vh("(",$h(n,", "),")")} on ${t} ${Vh("",$h(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Mf(e):`"${e.replace(Dh,Rh)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+$h(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+$h(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Vh("(",$h(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Vh("",e,"\n")+$h(["schema",$h(t," "),Mh(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Vh("",e,"\n")+$h(["scalar",t,$h(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Vh("",e,"\n")+$h(["type",t,Vh("implements ",$h(n," & ")),$h(r," "),Mh(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Vh("",e,"\n")+t+(Bh(n)?Vh("(\n",Uh($h(n,"\n")),"\n)"):Vh("(",$h(n,", "),")"))+": "+r+Vh(" ",$h(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Vh("",e,"\n")+$h([t+": "+n,Vh("= ",r),$h(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Vh("",e,"\n")+$h(["interface",t,Vh("implements ",$h(n," & ")),$h(r," "),Mh(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Vh("",e,"\n")+$h(["union",t,$h(n," "),Vh("= ",$h(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Vh("",e,"\n")+$h(["enum",t,$h(n," "),Mh(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Vh("",e,"\n")+$h([t,$h(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Vh("",e,"\n")+$h(["input",t,$h(n," "),Mh(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>Vh("",e,"\n")+"directive @"+t+(Bh(n)?Vh("(\n",Uh($h(n,"\n")),"\n)"):Vh("(",$h(n,", "),")"))+(r?" repeatable":"")+" on "+$h(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>$h(["extend schema",$h(e," "),Mh(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>$h(["extend scalar",e,$h(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>$h(["extend type",e,Vh("implements ",$h(t," & ")),$h(n," "),Mh(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>$h(["extend interface",e,Vh("implements ",$h(t," & ")),$h(n," "),Mh(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>$h(["extend union",e,$h(t," "),Vh("= ",$h(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>$h(["extend enum",e,$h(t," "),Mh(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>$h(["extend input",e,$h(t," "),Mh(n)]," ")}};function $h(e,t=""){var n;return null!==(n=null==e?void 0:e.filter(e=>e).join(t))&&void 0!==n?n:""}function Mh(e){return Vh("{\n",Uh($h(e,"\n")),"\n}")}function Vh(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Uh(e){return Vh("  ",e.replace(/\n/g,"\n  "))}function Bh(e){var t;return null!==(t=null==e?void 0:e.some(e=>e.includes("\n")))&&void 0!==t&&t}function Gh(e,t){switch(e.kind){case Df.NULL:return null;case Df.INT:return parseInt(e.value,10);case Df.FLOAT:return parseFloat(e.value);case Df.STRING:case Df.ENUM:case Df.BOOLEAN:return e.value;case Df.LIST:return e.values.map(e=>Gh(e,t));case Df.OBJECT:return Eh(e.fields,e=>e.name.value,e=>Gh(e.value,t));case Df.VARIABLE:return null==t?void 0:t[e.name.value]}}function Qh(e){if(null!=e||lf(!1,"Must provide name."),"string"==typeof e||lf(!1,"Expected name to be a string."),0===e.length)throw new Ef("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!Cf(e.charCodeAt(t)))throw new Ef(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!jf(e.charCodeAt(0)))throw new Ef(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function Yh(e){if("true"===e||"false"===e||"null"===e)throw new Ef(`Enum values cannot be named: ${e}`);return Qh(e)}function qh(e){return zh(e)||Wh(e)||Kh(e)||Hh(e)||Zh(e)||ey(e)||ty(e)||ny(e)}function zh(e){return ch(e,gy)}function Wh(e){return ch(e,Ey)}function Jh(e){if(!Wh(e))throw new Error(`Expected ${ah(e)} to be a GraphQL Object type.`);return e}function Kh(e){return ch(e,Ay)}function Xh(e){if(!Kh(e))throw new Error(`Expected ${ah(e)} to be a GraphQL Interface type.`);return e}function Hh(e){return ch(e,Sy)}function Zh(e){return ch(e,Ry)}function ey(e){return ch(e,xy)}function ty(e){return ch(e,cy)}function ny(e){return ch(e,uy)}function ry(e){return zh(e)||Zh(e)||ey(e)||ly(e)&&ry(e.ofType)}function iy(e){return zh(e)||Wh(e)||Kh(e)||Hh(e)||Zh(e)||ly(e)&&iy(e.ofType)}function oy(e){return zh(e)||Zh(e)}function ay(e){return Wh(e)||Kh(e)||Hh(e)}function sy(e){return Kh(e)||Hh(e)}class cy{constructor(e){qh(e)||lf(!1,`Expected ${ah(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class uy{constructor(e){py(e)||lf(!1,`Expected ${ah(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 ly(e){return ty(e)||ny(e)}function py(e){return qh(e)&&!ny(e)}function dy(e){if(!py(e))throw new Error(`Expected ${ah(e)} to be a GraphQL nullable type.`);return e}function fy(e){if(e)return ny(e)?e.ofType:e}function hy(e){return zh(e)||Wh(e)||Kh(e)||Hh(e)||Zh(e)||ey(e)}function yy(e){if(e){let t=e;for(;ly(t);)t=t.ofType;return t}}function vy(e){return"function"==typeof e?e():e}function my(e){return"function"==typeof e?e():e}class gy{constructor(e){var t,n,r,i;const o=null!==(t=e.parseValue)&&void 0!==t?t:mh;this.name=Qh(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=null!==(n=e.serialize)&&void 0!==n?n:mh,this.parseValue=o,this.parseLiteral=null!==(r=e.parseLiteral)&&void 0!==r?r:(e,t)=>o(Gh(e,t)),this.extensions=Sh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(i=e.extensionASTNodes)&&void 0!==i?i:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||lf(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${ah(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||lf(!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||lf(!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 Ey{constructor(e){var t;this.name=Qh(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=Sh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=()=>by(e),this._interfaces=()=>Ty(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||lf(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${ah(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:Iy(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Ty(e){var t;const n=vy(null!==(t=e.interfaces)&&void 0!==t?t:[]);return Array.isArray(n)||lf(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function by(e){const t=my(e.fields);return Ny(t)||lf(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Th(t,(t,n)=>{var r;Ny(t)||lf(!1,`${e.name}.${n} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||lf(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${ah(t.resolve)}.`);const i=null!==(r=t.args)&&void 0!==r?r:{};return Ny(i)||lf(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:Qh(n),description:t.description,type:t.type,args:_y(i),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:Sh(t.extensions),astNode:t.astNode}})}function _y(e){return Object.entries(e).map(([e,t])=>({name:Qh(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:Sh(t.extensions),astNode:t.astNode}))}function Ny(e){return df(e)&&!Array.isArray(e)}function Iy(e){return Th(e,e=>({description:e.description,type:e.type,args:Oy(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function Oy(e){return Eh(e,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function wy(e){return ny(e.type)&&void 0===e.defaultValue}class Ay{constructor(e){var t;this.name=Qh(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Sh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=by.bind(void 0,e),this._interfaces=Ty.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||lf(!1,`${this.name} must provide "resolveType" as a function, but got: ${ah(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:Iy(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Sy{constructor(e){var t;this.name=Qh(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Sh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._types=Dy.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||lf(!1,`${this.name} must provide "resolveType" as a function, but got: ${ah(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 Dy(e){const t=vy(e.types);return Array.isArray(t)||lf(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}class Ry{constructor(e){var t;this.name=Qh(e.name),this.description=e.description,this.extensions=Sh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._values="function"==typeof e.values?e.values:ky(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=ky(this.name,this._values())),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=gh(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));const t=this._valueLookup.get(e);if(void 0===t)throw new Ef(`Enum "${this.name}" cannot represent value: ${ah(e)}`);return t.name}parseValue(e){if("string"!=typeof e){const t=ah(e);throw new Ef(`Enum "${this.name}" cannot represent non-string value: ${t}.`+Fy(this,t))}const t=this.getValue(e);if(null==t)throw new Ef(`Value "${e}" does not exist in "${this.name}" enum.`+Fy(this,e));return t.value}parseLiteral(e,t){if(e.kind!==Df.ENUM){const t=Ph(e);throw new Ef(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+Fy(this,t),{nodes:e})}const n=this.getValue(e.value);if(null==n){const t=Ph(e);throw new Ef(`Value "${t}" does not exist in "${this.name}" enum.`+Fy(this,t),{nodes:e})}return n.value}toConfig(){const e=Eh(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 Fy(e,t){return vh("the enum value",Oh(t,e.getValues().map(e=>e.name)))}function ky(e,t){return Ny(t)||lf(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([t,n])=>(Ny(n)||lf(!1,`${e}.${t} must refer to an object with a "value" key representing an internal value but got: ${ah(n)}.`),{name:Yh(t),description:n.description,value:void 0!==n.value?n.value:t,deprecationReason:n.deprecationReason,extensions:Sh(n.extensions),astNode:n.astNode}))}class xy{constructor(e){var t,n;this.name=Qh(e.name),this.description=e.description,this.extensions=Sh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this.isOneOf=null!==(n=e.isOneOf)&&void 0!==n&&n,this._fields=jy.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=Th(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 jy(e){const t=my(e.fields);return Ny(t)||lf(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Th(t,(t,n)=>(!("resolve"in t)||lf(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:Qh(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:Sh(t.extensions),astNode:t.astNode}))}function Cy(e){return ny(e.type)&&void 0===e.defaultValue}function Py(e,t){return e===t||(ny(e)&&ny(t)||!(!ty(e)||!ty(t)))&&Py(e.ofType,t.ofType)}function Ly(e,t,n){return t===n||(ny(n)?!!ny(t)&&Ly(e,t.ofType,n.ofType):ny(t)?Ly(e,t.ofType,n):ty(n)?!!ty(t)&&Ly(e,t.ofType,n.ofType):!ty(t)&&(sy(n)&&(Kh(t)||Wh(t))&&e.isSubType(n,t)))}function $y(e,t,n){return t===n||(sy(t)?sy(n)?e.getPossibleTypes(t).some(t=>e.isSubType(n,t)):e.isSubType(t,n):!!sy(n)&&e.isSubType(n,t))}const My=2147483647,Vy=-2147483648,Uy=new gy({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){const t=Wy(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new Ef(`Int cannot represent non-integer value: ${ah(t)}`);if(n>My||n<Vy)throw new Ef("Int cannot represent non 32-bit signed integer value: "+ah(t));return n},parseValue(e){if("number"!=typeof e||!Number.isInteger(e))throw new Ef(`Int cannot represent non-integer value: ${ah(e)}`);if(e>My||e<Vy)throw new Ef(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==Df.INT)throw new Ef(`Int cannot represent non-integer value: ${Ph(e)}`,{nodes:e});const t=parseInt(e.value,10);if(t>My||t<Vy)throw new Ef(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),By=new gy({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){const t=Wy(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isFinite(n))throw new Ef(`Float cannot represent non numeric value: ${ah(t)}`);return n},parseValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new Ef(`Float cannot represent non numeric value: ${ah(e)}`);return e},parseLiteral(e){if(e.kind!==Df.FLOAT&&e.kind!==Df.INT)throw new Ef(`Float cannot represent non numeric value: ${Ph(e)}`,e);return parseFloat(e.value)}}),Gy=new gy({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){const t=Wy(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 Ef(`String cannot represent value: ${ah(e)}`)},parseValue(e){if("string"!=typeof e)throw new Ef(`String cannot represent a non string value: ${ah(e)}`);return e},parseLiteral(e){if(e.kind!==Df.STRING)throw new Ef(`String cannot represent a non string value: ${Ph(e)}`,{nodes:e});return e.value}}),Qy=new gy({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){const t=Wy(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new Ef(`Boolean cannot represent a non boolean value: ${ah(t)}`)},parseValue(e){if("boolean"!=typeof e)throw new Ef(`Boolean cannot represent a non boolean value: ${ah(e)}`);return e},parseLiteral(e){if(e.kind!==Df.BOOLEAN)throw new Ef(`Boolean cannot represent a non boolean value: ${Ph(e)}`,{nodes:e});return e.value}}),Yy=new gy({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){const t=Wy(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new Ef(`ID cannot represent value: ${ah(e)}`)},parseValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new Ef(`ID cannot represent value: ${ah(e)}`)},parseLiteral(e){if(e.kind!==Df.STRING&&e.kind!==Df.INT)throw new Ef("ID cannot represent a non-string and non-integer value: "+Ph(e),{nodes:e});return e.value}}),qy=Object.freeze([Gy,Uy,By,Qy,Yy]);function zy(e){return qy.some(({name:t})=>e.name===t)}function Wy(e){if(df(e)){if("function"==typeof e.valueOf){const t=e.valueOf();if(!df(t))return t}if("function"==typeof e.toJSON)return e.toJSON()}return e}function Jy(e){return ch(e,Ky)}class Ky{constructor(e){var t,n;this.name=Qh(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!==(t=e.isRepeatable)&&void 0!==t&&t,this.extensions=Sh(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||lf(!1,`@${e.name} locations must be an Array.`);const r=null!==(n=e.args)&&void 0!==n?n:{};df(r)&&!Array.isArray(r)||lf(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=_y(r)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Oy(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const Xy=new Ky({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[Sf.FIELD,Sf.FRAGMENT_SPREAD,Sf.INLINE_FRAGMENT],args:{if:{type:new uy(Qy),description:"Included when true."}}}),Hy=new Ky({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[Sf.FIELD,Sf.FRAGMENT_SPREAD,Sf.INLINE_FRAGMENT],args:{if:{type:new uy(Qy),description:"Skipped when true."}}}),Zy="No longer supported",ev=new Ky({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[Sf.FIELD_DEFINITION,Sf.ARGUMENT_DEFINITION,Sf.INPUT_FIELD_DEFINITION,Sf.ENUM_VALUE],args:{reason:{type:Gy,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:Zy}}}),tv=new Ky({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[Sf.SCALAR],args:{url:{type:new uy(Gy),description:"The URL that specifies the behavior of this scalar."}}}),nv=new Ky({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[Sf.INPUT_OBJECT],args:{}}),rv=Object.freeze([Xy,Hy,ev,tv,nv]);function iv(e){return rv.some(({name:t})=>t===e.name)}function ov(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}function av(e,t){if(ny(t)){const n=av(e,t.ofType);return(null==n?void 0:n.kind)===Df.NULL?null:n}if(null===e)return{kind:Df.NULL};if(void 0===e)return null;if(ty(t)){const n=t.ofType;if(ov(e)){const t=[];for(const r of e){const e=av(r,n);null!=e&&t.push(e)}return{kind:Df.LIST,values:t}}return av(e,n)}if(ey(t)){if(!df(e))return null;const n=[];for(const r of Object.values(t.getFields())){const t=av(e[r.name],r.type);t&&n.push({kind:Df.OBJECT_FIELD,name:{kind:Df.NAME,value:r.name},value:t})}return{kind:Df.OBJECT,fields:n}}if(oy(t)){const n=t.serialize(e);if(null==n)return null;if("boolean"==typeof n)return{kind:Df.BOOLEAN,value:n};if("number"==typeof n&&Number.isFinite(n)){const e=String(n);return sv.test(e)?{kind:Df.INT,value:e}:{kind:Df.FLOAT,value:e}}if("string"==typeof n)return Zh(t)?{kind:Df.ENUM,value:n}:t===Yy&&sv.test(n)?{kind:Df.INT,value:n}:{kind:Df.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${ah(n)}.`)}ff(!1,"Unexpected input type: "+ah(t))}const sv=/^-?(?:0|[1-9][0-9]*)$/,cv=new Ey({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:Gy,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new uy(new cy(new uy(pv))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new uy(pv),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:pv,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:pv,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new uy(new cy(new uy(uv))),resolve:e=>e.getDirectives()}})}),uv=new Ey({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 uy(Gy),resolve:e=>e.name},description:{type:Gy,resolve:e=>e.description},isRepeatable:{type:new uy(Qy),resolve:e=>e.isRepeatable},locations:{type:new uy(new cy(new uy(lv))),resolve:e=>e.locations},args:{type:new uy(new cy(new uy(fv))),args:{includeDeprecated:{type:Qy,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)}})}),lv=new Ry({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:Sf.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:Sf.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:Sf.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:Sf.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:Sf.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:Sf.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:Sf.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:Sf.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:Sf.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:Sf.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:Sf.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:Sf.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:Sf.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:Sf.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:Sf.UNION,description:"Location adjacent to a union definition."},ENUM:{value:Sf.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:Sf.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:Sf.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:Sf.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),pv=new Ey({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 uy(vv),resolve:e=>zh(e)?yv.SCALAR:Wh(e)?yv.OBJECT:Kh(e)?yv.INTERFACE:Hh(e)?yv.UNION:Zh(e)?yv.ENUM:ey(e)?yv.INPUT_OBJECT:ty(e)?yv.LIST:ny(e)?yv.NON_NULL:void ff(!1,`Unexpected type: "${ah(e)}".`)},name:{type:Gy,resolve:e=>"name"in e?e.name:void 0},description:{type:Gy,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:Gy,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new cy(new uy(dv)),args:{includeDeprecated:{type:Qy,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Wh(e)||Kh(e)){const n=Object.values(e.getFields());return t?n:n.filter(e=>null==e.deprecationReason)}}},interfaces:{type:new cy(new uy(pv)),resolve(e){if(Wh(e)||Kh(e))return e.getInterfaces()}},possibleTypes:{type:new cy(new uy(pv)),resolve(e,t,n,{schema:r}){if(sy(e))return r.getPossibleTypes(e)}},enumValues:{type:new cy(new uy(hv)),args:{includeDeprecated:{type:Qy,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Zh(e)){const n=e.getValues();return t?n:n.filter(e=>null==e.deprecationReason)}}},inputFields:{type:new cy(new uy(fv)),args:{includeDeprecated:{type:Qy,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(ey(e)){const n=Object.values(e.getFields());return t?n:n.filter(e=>null==e.deprecationReason)}}},ofType:{type:pv,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:Qy,resolve:e=>{if(ey(e))return e.isOneOf}}})}),dv=new Ey({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 uy(Gy),resolve:e=>e.name},description:{type:Gy,resolve:e=>e.description},args:{type:new uy(new cy(new uy(fv))),args:{includeDeprecated:{type:Qy,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)},type:{type:new uy(pv),resolve:e=>e.type},isDeprecated:{type:new uy(Qy),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:Gy,resolve:e=>e.deprecationReason}})}),fv=new Ey({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 uy(Gy),resolve:e=>e.name},description:{type:Gy,resolve:e=>e.description},type:{type:new uy(pv),resolve:e=>e.type},defaultValue:{type:Gy,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,r=av(n,t);return r?Ph(r):null}},isDeprecated:{type:new uy(Qy),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:Gy,resolve:e=>e.deprecationReason}})}),hv=new Ey({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 uy(Gy),resolve:e=>e.name},description:{type:Gy,resolve:e=>e.description},isDeprecated:{type:new uy(Qy),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:Gy,resolve:e=>e.deprecationReason}})});var yv;!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"}(yv||(yv={}));const vv=new Ry({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:yv.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:yv.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:yv.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:yv.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:yv.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:yv.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:yv.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:yv.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),mv={name:"__schema",type:new uy(cv),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},gv={name:"__type",type:pv,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new uy(Gy),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},Ev={name:"__typename",type:new uy(Gy),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},Tv=Object.freeze([cv,uv,lv,pv,dv,fv,hv,vv]);function bv(e){return Tv.some(({name:t})=>e.name===t)}function _v(e){return ch(e,Iv)}function Nv(e){if(!_v(e))throw new Error(`Expected ${ah(e)} to be a GraphQL schema.`);return e}class Iv{constructor(e){var t,n;this.__validationErrors=!0===e.assumeValid?[]:void 0,df(e)||lf(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||lf(!1,`"types" must be Array if provided but got: ${ah(e.types)}.`),!e.directives||Array.isArray(e.directives)||lf(!1,`"directives" must be Array if provided but got: ${ah(e.directives)}.`),this.description=e.description,this.extensions=Sh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=null!==(n=e.directives)&&void 0!==n?n:rv;const r=new Set(e.types);if(null!=e.types)for(const t of e.types)r.delete(t),Ov(t,r);null!=this._queryType&&Ov(this._queryType,r),null!=this._mutationType&&Ov(this._mutationType,r),null!=this._subscriptionType&&Ov(this._subscriptionType,r);for(const e of this._directives)if(Jy(e))for(const t of e.args)Ov(t.type,r);Ov(cv,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const e of r){if(null==e)continue;const t=e.name;if(t||lf(!1,"One of the provided types for building the Schema is missing a name."),void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Kh(e)){for(const t of e.getInterfaces())if(Kh(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(Wh(e))for(const t of e.getInterfaces())if(Kh(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case Af.QUERY:return this.getQueryType();case Af.MUTATION:return this.getMutationType();case Af.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return Hh(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){const t=this._implementationsMap[e.name];return null!=t?t:{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap[e.name];if(void 0===n){if(n=Object.create(null),Hh(e))for(const t of e.getTypes())n[t.name]=!0;else{const t=this.getImplementations(e);for(const e of t.objects)n[e.name]=!0;for(const e of t.interfaces)n[e.name]=!0}this._subTypeMap[e.name]=n}return void 0!==n[t.name]}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}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 Ov(e,t){const n=yy(e);if(!t.has(n))if(t.add(n),Hh(n))for(const e of n.getTypes())Ov(e,t);else if(Wh(n)||Kh(n)){for(const e of n.getInterfaces())Ov(e,t);for(const e of Object.values(n.getFields())){Ov(e.type,t);for(const n of e.args)Ov(n.type,t)}}else if(ey(n))for(const e of Object.values(n.getFields()))Ov(e.type,t);return t}function wv(e){if(Nv(e),e.__validationErrors)return e.__validationErrors;const t=new Sv(e);!function(e){const t=e.schema,n=t.getQueryType();if(n){if(!Wh(n)){var r;e.reportError(`Query root type must be Object type, it cannot be ${ah(n)}.`,null!==(r=Dv(t,Af.QUERY))&&void 0!==r?r:n.astNode)}}else e.reportError("Query root type must be provided.",t.astNode);const i=t.getMutationType();var o;i&&!Wh(i)&&e.reportError(`Mutation root type must be Object type if provided, it cannot be ${ah(i)}.`,null!==(o=Dv(t,Af.MUTATION))&&void 0!==o?o:i.astNode);const a=t.getSubscriptionType();var s;a&&!Wh(a)&&e.reportError(`Subscription root type must be Object type if provided, it cannot be ${ah(a)}.`,null!==(s=Dv(t,Af.SUBSCRIPTION))&&void 0!==s?s:a.astNode)}(t),function(e){for(const n of e.schema.getDirectives())if(Jy(n)){Rv(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;if(Rv(e,r),ry(r.type)||e.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${ah(r.type)}.`,r.astNode),wy(r)&&null!=r.deprecationReason)e.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[Uv(r.astNode),null===(t=r.astNode)||void 0===t?void 0:t.type])}}else e.reportError(`Expected directive but got: ${ah(n)}.`,null==n?void 0:n.astNode)}(t),function(e){const t=function(e){const t=Object.create(null),n=[],r=Object.create(null);return i;function i(o){if(t[o.name])return;t[o.name]=!0,r[o.name]=n.length;const a=Object.values(o.getFields());for(const t of a)if(ny(t.type)&&ey(t.type.ofType)){const o=t.type.ofType,a=r[o.name];if(n.push(t),void 0===a)i(o);else{const t=n.slice(a),r=t.map(e=>e.name).join(".");e.reportError(`Cannot reference Input Object "${o.name}" within itself through a series of non-null fields: "${r}".`,t.map(e=>e.astNode))}n.pop()}r[o.name]=void 0}}(e),n=e.schema.getTypeMap();for(const r of Object.values(n))hy(r)?(bv(r)||Rv(e,r),Wh(r)||Kh(r)?(Fv(e,r),kv(e,r)):Hh(r)?Cv(e,r):Zh(r)?Pv(e,r):ey(r)&&(Lv(e,r),t(r))):e.reportError(`Expected GraphQL named type but got: ${ah(r)}.`,r.astNode)}(t);const n=t.getErrors();return e.__validationErrors=n,n}function Av(e){const t=wv(e);if(0!==t.length)throw new Error(t.map(e=>e.message).join("\n\n"))}class Sv{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new Ef(e,{nodes:n}))}getErrors(){return this._errors}}function Dv(e,t){var n;return null===(n=[e.astNode,...e.extensionASTNodes].flatMap(e=>{var t;return null!==(t=null==e?void 0:e.operationTypes)&&void 0!==t?t:[]}).find(e=>e.operation===t))||void 0===n?void 0:n.type}function Rv(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Fv(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const a of n){var r;if(Rv(e,a),!iy(a.type))e.reportError(`The type of ${t.name}.${a.name} must be Output Type but got: ${ah(a.type)}.`,null===(r=a.astNode)||void 0===r?void 0:r.type);for(const n of a.args){const r=n.name;var i,o;if(Rv(e,n),!ry(n.type))e.reportError(`The type of ${t.name}.${a.name}(${r}:) must be Input Type but got: ${ah(n.type)}.`,null===(i=n.astNode)||void 0===i?void 0:i.type);if(wy(n)&&null!=n.deprecationReason)e.reportError(`Required argument ${t.name}.${a.name}(${r}:) cannot be deprecated.`,[Uv(n.astNode),null===(o=n.astNode)||void 0===o?void 0:o.type])}}}function kv(e,t){const n=Object.create(null);for(const r of t.getInterfaces())Kh(r)?t!==r?n[r.name]?e.reportError(`Type ${t.name} can only implement ${r.name} once.`,Mv(t,r)):(n[r.name]=!0,jv(e,t,r),xv(e,t,r)):e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,Mv(t,r)):e.reportError(`Type ${ah(t)} must only implement Interface types, it cannot implement ${ah(r)}.`,Mv(t,r))}function xv(e,t,n){const r=t.getFields();for(const c of Object.values(n.getFields())){const u=c.name,l=r[u];if(l){var i,o;if(!Ly(e.schema,l.type,c.type))e.reportError(`Interface field ${n.name}.${u} expects type ${ah(c.type)} but ${t.name}.${u} is type ${ah(l.type)}.`,[null===(i=c.astNode)||void 0===i?void 0:i.type,null===(o=l.astNode)||void 0===o?void 0:o.type]);for(const r of c.args){const i=r.name,o=l.args.find(e=>e.name===i);var a,s;if(o){if(!Py(r.type,o.type))e.reportError(`Interface field argument ${n.name}.${u}(${i}:) expects type ${ah(r.type)} but ${t.name}.${u}(${i}:) is type ${ah(o.type)}.`,[null===(a=r.astNode)||void 0===a?void 0:a.type,null===(s=o.astNode)||void 0===s?void 0:s.type])}else e.reportError(`Interface field argument ${n.name}.${u}(${i}:) expected but ${t.name}.${u} does not provide it.`,[r.astNode,l.astNode])}for(const r of l.args){const i=r.name;!c.args.find(e=>e.name===i)&&wy(r)&&e.reportError(`Object field ${t.name}.${u} includes required argument ${i} that is missing from the Interface field ${n.name}.${u}.`,[r.astNode,c.astNode])}}else e.reportError(`Interface field ${n.name}.${u} expected but ${t.name} does not provide it.`,[c.astNode,t.astNode,...t.extensionASTNodes])}}function jv(e,t,n){const 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}.`,[...Mv(n,i),...Mv(t,n)])}function Cv(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=Object.create(null);for(const i of n)r[i.name]?e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,Vv(t,i.name)):(r[i.name]=!0,Wh(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${ah(i)}.`,Vv(t,String(i))))}function Pv(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)Rv(e,t)}function Lv(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const o of n){var r,i;if(Rv(e,o),!ry(o.type))e.reportError(`The type of ${t.name}.${o.name} must be Input Type but got: ${ah(o.type)}.`,null===(r=o.astNode)||void 0===r?void 0:r.type);if(Cy(o)&&null!=o.deprecationReason)e.reportError(`Required input field ${t.name}.${o.name} cannot be deprecated.`,[Uv(o.astNode),null===(i=o.astNode)||void 0===i?void 0:i.type]);t.isOneOf&&$v(t,o,e)}}function $v(e,t,n){var r;ny(t.type)&&n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,null===(r=t.astNode)||void 0===r?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 Mv(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap(e=>{var t;return null!==(t=e.interfaces)&&void 0!==t?t:[]}).filter(e=>e.name.value===t.name)}function Vv(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap(e=>{var t;return null!==(t=e.types)&&void 0!==t?t:[]}).filter(e=>e.name.value===t)}function Uv(e){var t;return null==e||null===(t=e.directives)||void 0===t?void 0:t.find(e=>e.name.value===ev.name)}function Bv(e,t){switch(t.kind){case Df.LIST_TYPE:{const n=Bv(e,t.type);return n&&new cy(n)}case Df.NON_NULL_TYPE:{const n=Bv(e,t.type);return n&&new uy(n)}case Df.NAMED_TYPE:return e.getType(t.name.value)}}class Gv{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:Qv,t&&(ry(t)&&this._inputTypeStack.push(t),ay(t)&&this._parentTypeStack.push(t),iy(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case Df.SELECTION_SET:{const e=yy(this.getType());this._parentTypeStack.push(ay(e)?e:void 0);break}case Df.FIELD:{const n=this.getParentType();let r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(iy(i)?i:void 0);break}case Df.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case Df.OPERATION_DEFINITION:{const n=t.getRootType(e.operation);this._typeStack.push(Wh(n)?n:void 0);break}case Df.INLINE_FRAGMENT:case Df.FRAGMENT_DEFINITION:{const n=e.typeCondition,r=n?Bv(t,n):yy(this.getType());this._typeStack.push(iy(r)?r:void 0);break}case Df.VARIABLE_DEFINITION:{const n=Bv(t,e.type);this._inputTypeStack.push(ry(n)?n:void 0);break}case Df.ARGUMENT:{var n;let t,r;const i=null!==(n=this.getDirective())&&void 0!==n?n:this.getFieldDef();i&&(t=i.args.find(t=>t.name===e.name.value),t&&(r=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(ry(r)?r:void 0);break}case Df.LIST:{const e=fy(this.getInputType()),t=ty(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(ry(t)?t:void 0);break}case Df.OBJECT_FIELD:{const t=yy(this.getInputType());let n,r;ey(t)&&(r=t.getFields()[e.name.value],r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(ry(n)?n:void 0);break}case Df.ENUM:{const t=yy(this.getInputType());let n;Zh(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case Df.SELECTION_SET:this._parentTypeStack.pop();break;case Df.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case Df.DIRECTIVE:this._directive=null;break;case Df.OPERATION_DEFINITION:case Df.INLINE_FRAGMENT:case Df.FRAGMENT_DEFINITION:this._typeStack.pop();break;case Df.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case Df.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Df.LIST:case Df.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Df.ENUM:this._enumValue=null}}}function Qv(e,t,n){const r=n.name.value;return r===mv.name&&e.getQueryType()===t?mv:r===gv.name&&e.getQueryType()===t?gv:r===Ev.name&&ay(t)?Ev:Wh(t)||Kh(t)?t.getFields()[r]:void 0}function Yv(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=Ch(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),wf(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=Ch(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function qv(e){return e.kind===Df.OPERATION_DEFINITION||e.kind===Df.FRAGMENT_DEFINITION}function zv(e){return e.kind===Df.VARIABLE||e.kind===Df.INT||e.kind===Df.FLOAT||e.kind===Df.STRING||e.kind===Df.BOOLEAN||e.kind===Df.NULL||e.kind===Df.ENUM||e.kind===Df.LIST||e.kind===Df.OBJECT}function Wv(e){return e.kind===Df.SCHEMA_DEFINITION||Jv(e)||e.kind===Df.DIRECTIVE_DEFINITION}function Jv(e){return e.kind===Df.SCALAR_TYPE_DEFINITION||e.kind===Df.OBJECT_TYPE_DEFINITION||e.kind===Df.INTERFACE_TYPE_DEFINITION||e.kind===Df.UNION_TYPE_DEFINITION||e.kind===Df.ENUM_TYPE_DEFINITION||e.kind===Df.INPUT_OBJECT_TYPE_DEFINITION}function Kv(e){return e.kind===Df.SCHEMA_EXTENSION||Xv(e)}function Xv(e){return e.kind===Df.SCALAR_TYPE_EXTENSION||e.kind===Df.OBJECT_TYPE_EXTENSION||e.kind===Df.INTERFACE_TYPE_EXTENSION||e.kind===Df.UNION_TYPE_EXTENSION||e.kind===Df.ENUM_TYPE_EXTENSION||e.kind===Df.INPUT_OBJECT_TYPE_EXTENSION}function Hv(e){return{Document(t){for(const n of t.definitions)if(!qv(n)){const t=n.kind===Df.SCHEMA_DEFINITION||n.kind===Df.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new Ef(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}}function Zv(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=vh("to use an inline fragment on",function(e,t,n){if(!sy(t))return[];const r=new Set,i=Object.create(null);for(const a of e.getPossibleTypes(t))if(a.getFields()[n]){r.add(a),i[a.name]=1;for(const e of a.getInterfaces()){var o;e.getFields()[n]&&(r.add(e),i[e.name]=(null!==(o=i[e.name])&&void 0!==o?o:0)+1)}}return[...r].sort((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:Kh(t)&&e.isSubType(t,n)?-1:Kh(n)&&e.isSubType(n,t)?1:bh(t.name,n.name)}).map(e=>e.name)}(r,n,i));""===o&&(o=vh(function(e,t){if(Wh(e)||Kh(e)){return Oh(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new Ef(`Cannot query field "${i}" on type "${n.name}".`+o,{nodes:t}))}}}}}function em(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=Bv(e.getSchema(),n);if(t&&!ay(t)){const t=Ph(n);e.reportError(new Ef(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=Bv(e.getSchema(),t.typeCondition);if(n&&!ay(n)){const n=Ph(t.typeCondition);e.reportError(new Ef(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}}function tm(e){return{...nm(e),Argument(t){const n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){const n=t.name.value,o=Oh(n,r.args.map(e=>e.name));e.reportError(new Ef(`Unknown argument "${n}" on field "${i.name}.${r.name}".`+vh(o),{nodes:t}))}}}}function nm(e){const t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():rv;for(const e of r)t[e.name]=e.args.map(e=>e.name);const i=e.getDocument().definitions;for(const e of i)if(e.kind===Df.DIRECTIVE_DEFINITION){var o;const n=null!==(o=e.arguments)&&void 0!==o?o:[];t[e.name.value]=n.map(e=>e.name.value)}return{Directive(n){const r=n.name.value,i=t[r];if(n.arguments&&i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=Oh(n,i);e.reportError(new Ef(`Unknown argument "${n}" on directive "@${r}".`+vh(o),{nodes:t}))}}return!1}}}function rm(e){const t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():rv;for(const e of r)t[e.name]=e.locations;const i=e.getDocument().definitions;for(const e of i)e.kind===Df.DIRECTIVE_DEFINITION&&(t[e.name.value]=e.locations.map(e=>e.value));return{Directive(n,r,i,o,a){const s=n.name.value,c=t[s];if(!c)return void e.reportError(new Ef(`Unknown directive "@${s}".`,{nodes:n}));const u=function(e){const t=e[e.length-1];switch("kind"in t||ff(!1),t.kind){case Df.OPERATION_DEFINITION:return function(e){switch(e){case Af.QUERY:return Sf.QUERY;case Af.MUTATION:return Sf.MUTATION;case Af.SUBSCRIPTION:return Sf.SUBSCRIPTION}}(t.operation);case Df.FIELD:return Sf.FIELD;case Df.FRAGMENT_SPREAD:return Sf.FRAGMENT_SPREAD;case Df.INLINE_FRAGMENT:return Sf.INLINE_FRAGMENT;case Df.FRAGMENT_DEFINITION:return Sf.FRAGMENT_DEFINITION;case Df.VARIABLE_DEFINITION:return Sf.VARIABLE_DEFINITION;case Df.SCHEMA_DEFINITION:case Df.SCHEMA_EXTENSION:return Sf.SCHEMA;case Df.SCALAR_TYPE_DEFINITION:case Df.SCALAR_TYPE_EXTENSION:return Sf.SCALAR;case Df.OBJECT_TYPE_DEFINITION:case Df.OBJECT_TYPE_EXTENSION:return Sf.OBJECT;case Df.FIELD_DEFINITION:return Sf.FIELD_DEFINITION;case Df.INTERFACE_TYPE_DEFINITION:case Df.INTERFACE_TYPE_EXTENSION:return Sf.INTERFACE;case Df.UNION_TYPE_DEFINITION:case Df.UNION_TYPE_EXTENSION:return Sf.UNION;case Df.ENUM_TYPE_DEFINITION:case Df.ENUM_TYPE_EXTENSION:return Sf.ENUM;case Df.ENUM_VALUE_DEFINITION:return Sf.ENUM_VALUE;case Df.INPUT_OBJECT_TYPE_DEFINITION:case Df.INPUT_OBJECT_TYPE_EXTENSION:return Sf.INPUT_OBJECT;case Df.INPUT_VALUE_DEFINITION:{const t=e[e.length-3];return"kind"in t||ff(!1),t.kind===Df.INPUT_OBJECT_TYPE_DEFINITION?Sf.INPUT_FIELD_DEFINITION:Sf.ARGUMENT_DEFINITION}default:ff(!1,"Unexpected kind: "+ah(t.kind))}}(a);u&&!c.includes(u)&&e.reportError(new Ef(`Directive "@${s}" may not be used on ${u}.`,{nodes:n}))}}}function im(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new Ef(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function om(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(const t of e.getDocument().definitions)Jv(t)&&(r[t.name.value]=!0);const i=[...Object.keys(n),...Object.keys(r)];return{NamedType(t,o,a,s,c){const u=t.name.value;if(!n[u]&&!r[u]){var l;const n=null!==(l=c[2])&&void 0!==l?l:a,r=null!=n&&("kind"in(p=n)&&(Wv(p)||Kv(p)));if(r&&am.includes(u))return;const o=Oh(u,r?am.concat(i):i);e.reportError(new Ef(`Unknown type "${u}".`+vh(o),{nodes:t}))}var p}}}const am=[...qy,...Tv].map(e=>e.name);function sm(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===Df.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new Ef("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function cm(e){var t,n,r;const i=e.getSchema(),o=null!==(t=null!==(n=null!==(r=null==i?void 0:i.astNode)&&void 0!==r?r:null==i?void 0:i.getQueryType())&&void 0!==n?n:null==i?void 0:i.getMutationType())&&void 0!==t?t:null==i?void 0:i.getSubscriptionType();let a=0;return{SchemaDefinition(t){o?e.reportError(new Ef("Cannot define a new schema within a schema extension.",{nodes:t})):(a>0&&e.reportError(new Ef("Must provide only one schema definition.",{nodes:t})),++a)}}}function um(e){function t(n,r=Object.create(null),i=0){if(n.kind===Df.FRAGMENT_SPREAD){const o=n.name.value;if(!0===r[o])return!1;const a=e.getFragment(o);if(!a)return!1;try{return r[o]=!0,t(a,r,i)}finally{r[o]=void 0}}if(n.kind===Df.FIELD&&("fields"===n.name.value||"interfaces"===n.name.value||"possibleTypes"===n.name.value||"inputFields"===n.name.value)&&++i>=3)return!0;if("selectionSet"in n&&n.selectionSet)for(const e of n.selectionSet.selections)if(t(e,r,i))return!0;return!1}return{Field(n){if(("__schema"===n.name.value||"__type"===n.name.value)&&t(n))return e.reportError(new Ef("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function lm(e){const t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t[o.name.value])return;const a=o.name.value;t[a]=!0;const s=e.getFragmentSpreads(o.selectionSet);if(0!==s.length){r[a]=n.length;for(const t of s){const o=t.name.value,a=r[o];if(n.push(t),void 0===a){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(a),r=t.slice(0,-1).map(e=>'"'+e.name.value+'"').join(", ");e.reportError(new Ef(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[a]=void 0}}}function pm(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:i}of r){const r=i.name.value;!0!==t[r]&&e.reportError(new Ef(n.name?`Variable "$${r}" is not defined by operation "${n.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}}function dm(e){const t=[],n=[];return{OperationDefinition:e=>(t.push(e),!1),FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){const r=Object.create(null);for(const n of t)for(const t of e.getRecursivelyReferencedFragments(n))r[t.name.value]=!0;for(const t of n){const n=t.name.value;!0!==r[n]&&e.reportError(new Ef(`Fragment "${n}" is never used.`,{nodes:t}))}}}}}function fm(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){const r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(const{node:e}of i)r[e.name.value]=!0;for(const i of t){const t=i.variable.name.value;!0!==r[t]&&e.reportError(new Ef(n.name?`Variable "$${t}" is never used in operation "${n.name.value}".`:`Variable "$${t}" is never used.`,{nodes:i}))}}},VariableDefinition(e){t.push(e)}}}function hm(e){switch(e.kind){case Df.OBJECT:return{...e,fields:(t=e.fields,t.map(e=>({...e,value:hm(e.value)})).sort((e,t)=>bh(e.name.value,t.name.value)))};case Df.LIST:return{...e,values:e.values.map(hm)};case Df.INT:case Df.FLOAT:case Df.STRING:case Df.BOOLEAN:case Df.NULL:case Df.ENUM:case Df.VARIABLE:return e}var t}function ym(e){return Array.isArray(e)?e.map(([e,t])=>`subfields "${e}" conflict because `+ym(t)).join(" and "):e}function vm(e){const t=new wm,n=new Am,r=new Map;return{SelectionSet(i){const o=function(e,t,n,r,i,o){const a=[],[s,c]=Nm(e,t,i,o);if(function(e,t,n,r,i,o){for(const[a,s]of Object.entries(o))if(s.length>1)for(let o=0;o<s.length;o++)for(let c=o+1;c<s.length;c++){const u=Tm(e,n,r,i,!1,a,s[o],s[c]);u&&t.push(u)}}(e,a,t,n,r,s),0!==c.length)for(let i=0;i<c.length;i++){mm(e,a,t,n,r,!1,s,c[i]);for(let o=i+1;o<c.length;o++)gm(e,a,t,n,r,!1,c[i],c[o])}return a}(e,r,t,n,e.getParentType(),i);for(const[[t,n],r,i]of o){const o=ym(n);e.reportError(new Ef(`Fields "${t}" conflict because ${o}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:r.concat(i)}))}}}}function mm(e,t,n,r,i,o,a,s){if(r.has(a,s,o))return;r.add(a,s,o);const c=e.getFragment(s);if(!c)return;const[u,l]=Im(e,n,c);if(a!==u){Em(e,t,n,r,i,o,a,u);for(const s of l)mm(e,t,n,r,i,o,a,s)}}function gm(e,t,n,r,i,o,a,s){if(a===s)return;if(i.has(a,s,o))return;i.add(a,s,o);const c=e.getFragment(a),u=e.getFragment(s);if(!c||!u)return;const[l,p]=Im(e,n,c),[d,f]=Im(e,n,u);Em(e,t,n,r,i,o,l,d);for(const s of f)gm(e,t,n,r,i,o,a,s);for(const a of p)gm(e,t,n,r,i,o,a,s)}function Em(e,t,n,r,i,o,a,s){for(const[c,u]of Object.entries(a)){const a=s[c];if(a)for(const s of u)for(const u of a){const a=Tm(e,n,r,i,o,c,s,u);a&&t.push(a)}}}function Tm(e,t,n,r,i,o,a,s){const[c,u,l]=a,[p,d,f]=s,h=i||c!==p&&Wh(c)&&Wh(p);if(!h){const e=u.name.value,t=d.name.value;if(e!==t)return[[o,`"${e}" and "${t}" are different fields`],[u],[d]];if(!function(e,t){const n=e.arguments,r=t.arguments;if(void 0===n||0===n.length)return void 0===r||0===r.length;if(void 0===r||0===r.length)return!1;if(n.length!==r.length)return!1;const i=new Map(r.map(({name:e,value:t})=>[e.value,t]));return n.every(e=>{const t=e.value,n=i.get(e.name.value);return void 0!==n&&bm(t)===bm(n)})}(u,d))return[[o,"they have differing arguments"],[u],[d]]}const y=null==l?void 0:l.type,v=null==f?void 0:f.type;if(y&&v&&_m(y,v))return[[o,`they return conflicting types "${ah(y)}" and "${ah(v)}"`],[u],[d]];const m=u.selectionSet,g=d.selectionSet;if(m&&g){const i=function(e,t,n,r,i,o,a,s,c){const u=[],[l,p]=Nm(e,t,o,a),[d,f]=Nm(e,t,s,c);Em(e,u,t,n,r,i,l,d);for(const o of f)mm(e,u,t,n,r,i,l,o);for(const o of p)mm(e,u,t,n,r,i,d,o);for(const o of p)for(const a of f)gm(e,u,t,n,r,i,o,a);return u}(e,t,n,r,h,yy(y),m,yy(v),g);return function(e,t,n,r){if(e.length>0)return[[t,e.map(([e])=>e)],[n,...e.map(([,e])=>e).flat()],[r,...e.map(([,,e])=>e).flat()]]}(i,o,u,d)}}function bm(e){return Ph(hm(e))}function _m(e,t){return ty(e)?!ty(t)||_m(e.ofType,t.ofType):!!ty(t)||(ny(e)?!ny(t)||_m(e.ofType,t.ofType):!!ny(t)||!(!oy(e)&&!oy(t))&&e!==t)}function Nm(e,t,n,r){const i=t.get(r);if(i)return i;const o=Object.create(null),a=Object.create(null);Om(e,n,r,o,a);const s=[o,Object.keys(a)];return t.set(r,s),s}function Im(e,t,n){const r=t.get(n.selectionSet);if(r)return r;const i=Bv(e.getSchema(),n.typeCondition);return Nm(e,t,i,n.selectionSet)}function Om(e,t,n,r,i){for(const o of n.selections)switch(o.kind){case Df.FIELD:{const e=o.name.value;let n;(Wh(t)||Kh(t))&&(n=t.getFields()[e]);const i=o.alias?o.alias.value:e;r[i]||(r[i]=[]),r[i].push([t,o,n]);break}case Df.FRAGMENT_SPREAD:i[o.name.value]=!0;break;case Df.INLINE_FRAGMENT:{const n=o.typeCondition,a=n?Bv(e.getSchema(),n):t;Om(e,a,o.selectionSet,r,i);break}}}class wm{constructor(){this._data=new Map}has(e,t,n){var r;const i=null===(r=this._data.get(e))||void 0===r?void 0:r.get(t);return void 0!==i&&(!!n||n===i)}add(e,t,n){const r=this._data.get(e);void 0===r?this._data.set(e,new Map([[t,n]])):r.set(t,n)}}class Am{constructor(){this._orderedPairSet=new wm}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 Sm(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(ay(n)&&ay(r)&&!$y(e.getSchema(),n,r)){const i=ah(r),o=ah(n);e.reportError(new Ef(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=Bv(e.getSchema(),n.typeCondition);if(ay(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!$y(e.getSchema(),r,i)){const o=ah(i),a=ah(r);e.reportError(new Ef(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${a}".`,{nodes:t}))}}}}function Dm(e){const t=e.getSchema(),n=Object.create(null);for(const t of e.getDocument().definitions)Jv(t)&&(n[t.name.value]=t);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(r){const i=r.name.value,o=n[i],a=null==t?void 0:t.getType(i);let s;if(o?s=Rm[o.kind]:a&&(s=function(e){if(zh(e))return Df.SCALAR_TYPE_EXTENSION;if(Wh(e))return Df.OBJECT_TYPE_EXTENSION;if(Kh(e))return Df.INTERFACE_TYPE_EXTENSION;if(Hh(e))return Df.UNION_TYPE_EXTENSION;if(Zh(e))return Df.ENUM_TYPE_EXTENSION;if(ey(e))return Df.INPUT_OBJECT_TYPE_EXTENSION;ff(!1,"Unexpected type: "+ah(e))}(a)),s){if(s!==r.kind){const t=function(e){switch(e){case Df.SCALAR_TYPE_EXTENSION:return"scalar";case Df.OBJECT_TYPE_EXTENSION:return"object";case Df.INTERFACE_TYPE_EXTENSION:return"interface";case Df.UNION_TYPE_EXTENSION:return"union";case Df.ENUM_TYPE_EXTENSION:return"enum";case Df.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:ff(!1,"Unexpected kind: "+ah(e))}}(r.kind);e.reportError(new Ef(`Cannot extend non-${t} type "${i}".`,{nodes:o?[o,r]:r}))}}else{const o=Oh(i,Object.keys({...n,...null==t?void 0:t.getTypeMap()}));e.reportError(new Ef(`Cannot extend type "${i}" because it is not defined.`+vh(o),{nodes:r.name}))}}}const Rm={[Df.SCALAR_TYPE_DEFINITION]:Df.SCALAR_TYPE_EXTENSION,[Df.OBJECT_TYPE_DEFINITION]:Df.OBJECT_TYPE_EXTENSION,[Df.INTERFACE_TYPE_DEFINITION]:Df.INTERFACE_TYPE_EXTENSION,[Df.UNION_TYPE_DEFINITION]:Df.UNION_TYPE_EXTENSION,[Df.ENUM_TYPE_DEFINITION]:Df.ENUM_TYPE_EXTENSION,[Df.INPUT_OBJECT_TYPE_DEFINITION]:Df.INPUT_OBJECT_TYPE_EXTENSION};function Fm(e){return{...km(e),Field:{leave(t){var n;const r=e.getFieldDef();if(!r)return!1;const i=new Set(null===(n=t.arguments)||void 0===n?void 0:n.map(e=>e.name.value));for(const n of r.args)if(!i.has(n.name)&&wy(n)){const i=ah(n.type);e.reportError(new Ef(`Field "${r.name}" argument "${n.name}" of type "${i}" is required, but it was not provided.`,{nodes:t}))}}}}}function km(e){var t;const n=Object.create(null),r=e.getSchema(),i=null!==(t=null==r?void 0:r.getDirectives())&&void 0!==t?t:rv;for(const e of i)n[e.name]=gh(e.args.filter(wy),e=>e.name);const o=e.getDocument().definitions;for(const e of o)if(e.kind===Df.DIRECTIVE_DEFINITION){var a;const t=null!==(a=e.arguments)&&void 0!==a?a:[];n[e.name.value]=gh(t.filter(xm),e=>e.name.value)}return{Directive:{leave(t){const r=t.name.value,i=n[r];if(i){var o;const n=null!==(o=t.arguments)&&void 0!==o?o:[],a=new Set(n.map(e=>e.name.value));for(const[n,o]of Object.entries(i))if(!a.has(n)){const i=qh(o.type)?ah(o.type):Ph(o.type);e.reportError(new Ef(`Directive "@${r}" argument "${n}" of type "${i}" is required, but it was not provided.`,{nodes:t}))}}}}}}function xm(e){return e.type.kind===Df.NON_NULL_TYPE&&null==e.defaultValue}function jm(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(oy(yy(n))){if(r){const i=t.name.value,o=ah(n);e.reportError(new Ef(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(r){if(0===r.selections.length){const r=t.name.value,i=ah(n);e.reportError(new Ef(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}else{const r=t.name.value,i=ah(n);e.reportError(new Ef(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}}function Cm(e){return e.map(e=>"number"==typeof e?"["+e.toString()+"]":"."+e).join("")}function Pm(e,t,n){return{prev:e,key:t,typename:n}}function Lm(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function $m(e,t,n=Mm){return Vm(e,t,n,void 0)}function Mm(e,t,n){let r="Invalid value "+ah(t);throw e.length>0&&(r+=` at "value${Cm(e)}"`),n.message=r+": "+n.message,n}function Vm(e,t,n,r){if(ny(t))return null!=e?Vm(e,t.ofType,n,r):void n(Lm(r),e,new Ef(`Expected non-nullable type "${ah(t)}" not to be null.`));if(null==e)return null;if(ty(t)){const i=t.ofType;return ov(e)?Array.from(e,(e,t)=>{const o=Pm(r,t,void 0);return Vm(e,i,n,o)}):[Vm(e,i,n,r)]}if(ey(t)){if(!df(e)||Array.isArray(e))return void n(Lm(r),e,new Ef(`Expected type "${t.name}" to be an object.`));const i={},o=t.getFields();for(const a of Object.values(o)){const o=e[a.name];if(void 0!==o)i[a.name]=Vm(o,a.type,n,Pm(r,a.name,t.name));else if(void 0!==a.defaultValue)i[a.name]=a.defaultValue;else if(ny(a.type)){const t=ah(a.type);n(Lm(r),e,new Ef(`Field "${a.name}" of required type "${t}" was not provided.`))}}for(const i of Object.keys(e))if(!o[i]){const o=Oh(i,Object.keys(t.getFields()));n(Lm(r),e,new Ef(`Field "${i}" is not defined by type "${t.name}".`+vh(o)))}if(t.isOneOf){const o=Object.keys(i);1!==o.length&&n(Lm(r),e,new Ef(`Exactly one key must be specified for OneOf type "${t.name}".`));const a=o[0],s=i[a];null===s&&n(Lm(r).concat(a),s,new Ef(`Field "${a}" must be non-null.`))}return i}if(oy(t)){let i;try{i=t.parseValue(e)}catch(i){return void n(Lm(r),e,i instanceof Ef?i:new Ef(`Expected type "${t.name}". `+i.message,{originalError:i}))}return void 0===i&&n(Lm(r),e,new Ef(`Expected type "${t.name}".`)),i}ff(!1,"Unexpected input type: "+ah(t))}function Um(e,t,n){if(e){if(e.kind===Df.VARIABLE){const r=e.name.value;if(null==n||void 0===n[r])return;const i=n[r];if(null===i&&ny(t))return;return i}if(ny(t)){if(e.kind===Df.NULL)return;return Um(e,t.ofType,n)}if(e.kind===Df.NULL)return null;if(ty(t)){const r=t.ofType;if(e.kind===Df.LIST){const t=[];for(const i of e.values)if(Bm(i,n)){if(ny(r))return;t.push(null)}else{const e=Um(i,r,n);if(void 0===e)return;t.push(e)}return t}const i=Um(e,r,n);if(void 0===i)return;return[i]}if(ey(t)){if(e.kind!==Df.OBJECT)return;const r=Object.create(null),i=gh(e.fields,e=>e.name.value);for(const e of Object.values(t.getFields())){const t=i[e.name];if(!t||Bm(t.value,n)){if(void 0!==e.defaultValue)r[e.name]=e.defaultValue;else if(ny(e.type))return;continue}const o=Um(t.value,e.type,n);if(void 0===o)return;r[e.name]=o}if(t.isOneOf){const e=Object.keys(r);if(1!==e.length)return;if(null===r[e[0]])return}return r}if(oy(t)){let r;try{r=t.parseLiteral(e,n)}catch(e){return}if(void 0===r)return;return r}ff(!1,"Unexpected input type: "+ah(t))}}function Bm(e,t){return e.kind===Df.VARIABLE&&(null==t||void 0===t[e.name.value])}function Gm(e,t,n,r){const i=[],o=null==r?void 0:r.maxErrors;try{const r=function(e,t,n,r){const i={};for(const o of t){const t=o.variable.name.value,a=Bv(e,o.type);if(!ry(a)){const e=Ph(o.type);r(new Ef(`Variable "$${t}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:o.type}));continue}if(!qm(n,t)){if(o.defaultValue)i[t]=Um(o.defaultValue,a);else if(ny(a)){const e=ah(a);r(new Ef(`Variable "$${t}" of required type "${e}" was not provided.`,{nodes:o}))}continue}const s=n[t];if(null===s&&ny(a)){const e=ah(a);r(new Ef(`Variable "$${t}" of non-null type "${e}" must not be null.`,{nodes:o}));continue}i[t]=$m(s,a,(e,n,i)=>{let a=`Variable "$${t}" got invalid value `+ah(n);e.length>0&&(a+=` at "${t}${Cm(e)}"`),r(new Ef(a+"; "+i.message,{nodes:o,originalError:i}))})}return i}(e,t,n,e=>{if(null!=o&&i.length>=o)throw new Ef("Too many errors processing variables, error limit reached. Execution aborted.");i.push(e)});if(0===i.length)return{coerced:r}}catch(e){i.push(e)}return{errors:i}}function Qm(e,t,n){var r;const i={},o=gh(null!==(r=t.arguments)&&void 0!==r?r:[],e=>e.name.value);for(const r of e.args){const e=r.name,a=r.type,s=o[e];if(!s){if(void 0!==r.defaultValue)i[e]=r.defaultValue;else if(ny(a))throw new Ef(`Argument "${e}" of required type "${ah(a)}" was not provided.`,{nodes:t});continue}const c=s.value;let u=c.kind===Df.NULL;if(c.kind===Df.VARIABLE){const t=c.name.value;if(null==n||!qm(n,t)){if(void 0!==r.defaultValue)i[e]=r.defaultValue;else if(ny(a))throw new Ef(`Argument "${e}" of required type "${ah(a)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:c});continue}u=null==n[t]}if(u&&ny(a))throw new Ef(`Argument "${e}" of non-null type "${ah(a)}" must not be null.`,{nodes:c});const l=Um(c,a,n);if(void 0===l)throw new Ef(`Argument "${e}" has invalid value ${Ph(c)}.`,{nodes:c});i[e]=l}return i}function Ym(e,t,n){var r;const i=null===(r=t.directives)||void 0===r?void 0:r.find(t=>t.name.value===e.name);if(i)return Qm(e,i,n)}function qm(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function zm(e,t,n,r,i){const o=new Map;return Wm(e,t,n,r,i,o,new Set),o}function Wm(e,t,n,r,i,o,a){for(const s of i.selections)switch(s.kind){case Df.FIELD:{if(!Jm(n,s))continue;const e=Xm(s),t=o.get(e);void 0!==t?t.push(s):o.set(e,[s]);break}case Df.INLINE_FRAGMENT:if(!Jm(n,s)||!Km(e,s,r))continue;Wm(e,t,n,r,s.selectionSet,o,a);break;case Df.FRAGMENT_SPREAD:{const i=s.name.value;if(a.has(i)||!Jm(n,s))continue;a.add(i);const c=t[i];if(!c||!Km(e,c,r))continue;Wm(e,t,n,r,c.selectionSet,o,a);break}}}function Jm(e,t){const n=Ym(Hy,t,e);if(!0===(null==n?void 0:n.if))return!1;const r=Ym(Xy,t,e);return!1!==(null==r?void 0:r.if)}function Km(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=Bv(e,r);return i===n||!!sy(i)&&e.isSubType(i,n)}function Xm(e){return e.alias?e.alias.value:e.name.value}function Hm(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),a=e.getDocument(),s=Object.create(null);for(const e of a.definitions)e.kind===Df.FRAGMENT_DEFINITION&&(s[e.name.value]=e);const c=zm(n,s,o,r,t.selectionSet);if(c.size>1){const t=[...c.values()].slice(1).flat();e.reportError(new Ef(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){t[0].name.value.startsWith("__")&&e.reportError(new Ef(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}}}function Zm(e,t){const n=new Map;for(const r of e){const e=t(r),i=n.get(e);void 0===i?n.set(e,[r]):i.push(r)}return n}function eg(e){return{DirectiveDefinition(e){var t;const r=null!==(t=e.arguments)&&void 0!==t?t:[];return n(`@${e.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){var t;const r=e.name.value,i=null!==(t=e.fields)&&void 0!==t?t:[];for(const e of i){var o;n(`${r}.${e.name.value}`,null!==(o=e.arguments)&&void 0!==o?o:[])}return!1}function n(t,n){const r=Zm(n,e=>e.name.value);for(const[n,i]of r)i.length>1&&e.reportError(new Ef(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map(e=>e.name)}));return!1}}function tg(e){return{Field:t,Directive:t};function t(t){var n;const r=Zm(null!==(n=t.arguments)&&void 0!==n?n:[],e=>e.name.value);for(const[t,n]of r)n.length>1&&e.reportError(new Ef(`There can be only one argument named "${t}".`,{nodes:n.map(e=>e.name)}))}}function ng(e){const t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(null==n||!n.getDirective(i))return t[i]?e.reportError(new Ef(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1;e.reportError(new Ef(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}))}}}function rg(e){const t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():rv;for(const e of r)t[e.name]=!e.isRepeatable;const i=e.getDocument().definitions;for(const e of i)e.kind===Df.DIRECTIVE_DEFINITION&&(t[e.name.value]=!e.repeatable);const o=Object.create(null),a=Object.create(null);return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===Df.SCHEMA_DEFINITION||n.kind===Df.SCHEMA_EXTENSION)r=o;else if(Jv(n)||Xv(n)){const e=n.name.value;r=a[e],void 0===r&&(a[e]=r=Object.create(null))}else r=Object.create(null);for(const i of n.directives){const n=i.name.value;t[n]&&(r[n]?e.reportError(new Ef(`The directive "@${n}" can only be used once at this location.`,{nodes:[r[n],i]})):r[n]=i)}}}}function ig(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){var i;const o=t.name.value;r[o]||(r[o]=Object.create(null));const a=null!==(i=t.values)&&void 0!==i?i:[],s=r[o];for(const t of a){const r=t.name.value,i=n[o];Zh(i)&&i.getValue(r)?e.reportError(new Ef(`Enum value "${o}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):s[r]?e.reportError(new Ef(`Enum value "${o}.${r}" can only be defined once.`,{nodes:[s[r],t.name]})):s[r]=t.name}return!1}}function og(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){var i;const o=t.name.value;r[o]||(r[o]=Object.create(null));const a=null!==(i=t.fields)&&void 0!==i?i:[],s=r[o];for(const t of a){const r=t.name.value;ag(n[o],r)?e.reportError(new Ef(`Field "${o}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):s[r]?e.reportError(new Ef(`Field "${o}.${r}" can only be defined once.`,{nodes:[s[r],t.name]})):s[r]=t.name}return!1}}function ag(e,t){return!!(Wh(e)||Kh(e)||ey(e))&&null!=e.getFields()[t]}function sg(e){const t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value;return t[r]?e.reportError(new Ef(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}}function cg(e){const t=[];let n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){const e=t.pop();e||ff(!1),n=e}},ObjectField(t){const r=t.name.value;n[r]?e.reportError(new Ef(`There can be only one input field named "${r}".`,{nodes:[n[r],t.name]})):n[r]=t.name}}}function ug(e){const t=Object.create(null);return{OperationDefinition(n){const r=n.name;return r&&(t[r.value]?e.reportError(new Ef(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}function lg(e){const t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){var i;const o=null!==(i=t.operationTypes)&&void 0!==i?i:[];for(const t of o){const i=t.operation,o=n[i];r[i]?e.reportError(new Ef(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new Ef(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n[i]=t}return!1}}function pg(e){const t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(null==n||!n.getType(i))return t[i]?e.reportError(new Ef(`There can be only one type named "${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1;e.reportError(new Ef(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}))}}function dg(e){return{OperationDefinition(t){var n;const r=Zm(null!==(n=t.variableDefinitions)&&void 0!==n?n:[],e=>e.variable.name.value);for(const[t,n]of r)n.length>1&&e.reportError(new Ef(`There can be only one variable named "$${t}".`,{nodes:n.map(e=>e.variable.name)}))}}}function fg(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(e){t[e.variable.name.value]=e},ListValue(t){if(!ty(fy(e.getParentInputType())))return hg(e,t),!1},ObjectValue(n){const r=yy(e.getInputType());if(!ey(r))return hg(e,n),!1;const i=gh(n.fields,e=>e.name.value);for(const t of Object.values(r.getFields())){if(!i[t.name]&&Cy(t)){const i=ah(t.type);e.reportError(new Ef(`Field "${r.name}.${t.name}" of required type "${i}" was not provided.`,{nodes:n}))}}r.isOneOf&&function(e,t,n,r,i){var o;const a=Object.keys(r),s=1!==a.length;if(s)return void e.reportError(new Ef(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));const c=null===(o=r[a[0]])||void 0===o?void 0:o.value,u=!c||c.kind===Df.NULL,l=(null==c?void 0:c.kind)===Df.VARIABLE;if(u)return void e.reportError(new Ef(`Field "${n.name}.${a[0]}" must be non-null.`,{nodes:[t]}));if(l){const r=c.name.value;i[r].type.kind!==Df.NON_NULL_TYPE&&e.reportError(new Ef(`Variable "${r}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[t]}))}}(e,n,r,i,t)},ObjectField(t){const n=yy(e.getParentInputType());if(!e.getInputType()&&ey(n)){const r=Oh(t.name.value,Object.keys(n.getFields()));e.reportError(new Ef(`Field "${t.name.value}" is not defined by type "${n.name}".`+vh(r),{nodes:t}))}},NullValue(t){const n=e.getInputType();ny(n)&&e.reportError(new Ef(`Expected value of type "${ah(n)}", found ${Ph(t)}.`,{nodes:t}))},EnumValue:t=>hg(e,t),IntValue:t=>hg(e,t),FloatValue:t=>hg(e,t),StringValue:t=>hg(e,t),BooleanValue:t=>hg(e,t)}}function hg(e,t){const n=e.getInputType();if(!n)return;const r=yy(n);if(!oy(r)){const r=ah(n);return void e.reportError(new Ef(`Expected value of type "${r}", found ${Ph(t)}.`,{nodes:t}))}try{if(void 0===r.parseLiteral(t,void 0)){const r=ah(n);e.reportError(new Ef(`Expected value of type "${r}", found ${Ph(t)}.`,{nodes:t}))}}catch(r){const i=ah(n);r instanceof Ef?e.reportError(r):e.reportError(new Ef(`Expected value of type "${i}", found ${Ph(t)}; `+r.message,{nodes:t,originalError:r}))}}function yg(e){return{VariableDefinition(t){const n=Bv(e.getSchema(),t.type);if(void 0!==n&&!ry(n)){const n=t.variable.name.value,r=Ph(t.type);e.reportError(new Ef(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}}function vg(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,defaultValue:o,parentType:a}of r){const r=n.name.value,s=t[r];if(s&&i){const t=e.getSchema(),c=Bv(t,s.type);if(c&&!mg(t,c,s.defaultValue,i,o)){const t=ah(c),o=ah(i);e.reportError(new Ef(`Variable "$${r}" of type "${t}" used in position expecting type "${o}".`,{nodes:[s,n]}))}ey(a)&&a.isOneOf&&py(c)&&e.reportError(new Ef(`Variable "$${r}" is of type "${c}" but must be non-nullable to be used for OneOf Input Object "${a}".`,{nodes:[s,n]}))}}}},VariableDefinition(e){t[e.variable.name.value]=e}}}function mg(e,t,n,r,i){if(ny(r)&&!ny(t)){if(!(null!=n&&n.kind!==Df.NULL)&&!(void 0!==i))return!1;return Ly(e,t,r.ofType)}return Ly(e,t,r)}const gg=Object.freeze([um]),Eg=Object.freeze([Hv,ug,sm,Hm,om,em,yg,jm,Zv,sg,im,dm,Sm,lm,dg,pm,fm,rm,rg,tm,tg,fg,Fm,vg,vm,cg,...gg]),Tg=Object.freeze([cm,lg,pg,ig,og,eg,ng,om,rm,rg,Dm,nm,tg,cg,km]);class bg{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 e of this.getDocument().definitions)e.kind===Df.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===Df.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=Object.create(null),r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!0!==n[i]){n[i]=!0;const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class _g extends bg{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class Ng extends bg{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 Gv(this._schema);xh(e,Yv(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 Ig(e,t,n=Eg,r,i=new Gv(e)){var o;const a=null!==(o=null==r?void 0:r.maxErrors)&&void 0!==o?o:100;t||lf(!1,"Must provide document."),Av(e);const s=Object.freeze({}),c=[],u=new Ng(e,t,i,e=>{if(c.length>=a)throw c.push(new Ef("Too many validation errors, error limit reached. Validation aborted.")),s;c.push(e)}),l=jh(n.map(e=>e(u)));try{xh(t,Yv(i,l))}catch(e){if(e!==s)throw e}return c}function Og(e,t,n=Tg){const r=[],i=new _g(e,t,e=>{r.push(e)});return xh(e,jh(n.map(e=>e(i)))),r}function wg(e){return Promise.all(Object.values(e)).then(t=>{const n=Object.create(null);for(const[r,i]of Object.keys(e).entries())n[i]=t[r];return n})}class Ag extends Error{constructor(e){super("Unexpected error value: "+ah(e)),this.name="NonErrorThrown",this.thrownValue=e}}function Sg(e,t,n){var r;const i=(o=e)instanceof Error?o:new Ag(o);var o,a;return a=i,Array.isArray(a.path)?i:new Ef(i.message,{nodes:null!==(r=i.nodes)&&void 0!==r?r:t,source:i.source,positions:i.positions,path:n,originalError:i})}const Dg=function(e){let t;return function(n,r,i){void 0===t&&(t=new WeakMap);let o=t.get(n);void 0===o&&(o=new WeakMap,t.set(n,o));let a=o.get(r);void 0===a&&(a=new WeakMap,o.set(r,a));let s=a.get(i);return void 0===s&&(s=e(n,r,i),a.set(i,s)),s}}((e,t,n)=>function(e,t,n,r,i){const o=new Map,a=new Set;for(const s of i)s.selectionSet&&Wm(e,t,n,r,s.selectionSet,o,a);return o}(e.schema,e.fragments,e.variableValues,t,n));function Rg(e){arguments.length<2||lf(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,document:n,variableValues:r,rootValue:i}=e;xg(t,n,r);const o=jg(e);if(!("schema"in o))return{errors:o};try{const{operation:e}=o,t=function(e,t,n){const r=e.schema.getRootType(t.operation);if(null==r)throw new Ef(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});const i=zm(e.schema,e.fragments,e.variableValues,r,t.selectionSet),o=void 0;switch(t.operation){case Af.QUERY:return Cg(e,r,n,o,i);case Af.MUTATION:return function(e,t,n,r,i){return function(e,t,n){let r=n;for(const n of e)r=pf(r)?r.then(e=>t(e,n)):t(r,n);return r}(i.entries(),(i,[o,a])=>{const s=Pm(r,o,t.name),c=Pg(e,t,n,a,s);return void 0===c?i:pf(c)?c.then(e=>(i[o]=e,i)):(i[o]=c,i)},Object.create(null))}(e,r,n,o,i);case Af.SUBSCRIPTION:return Cg(e,r,n,o,i)}}(o,e,i);return pf(t)?t.then(e=>kg(e,o.errors),e=>(o.errors.push(e),kg(null,o.errors))):kg(t,o.errors)}catch(e){return o.errors.push(e),kg(null,o.errors)}}function Fg(e){const t=Rg(e);if(pf(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function kg(e,t){return 0===t.length?{data:e}:{errors:t,data:e}}function xg(e,t,n){t||lf(!1,"Must provide document."),Av(e),null==n||df(n)||lf(!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 jg(e){var t,n,r;const{schema:i,document:o,rootValue:a,contextValue:s,variableValues:c,operationName:u,fieldResolver:l,typeResolver:p,subscribeFieldResolver:d,options:f}=e;let h;const y=Object.create(null);for(const e of o.definitions)switch(e.kind){case Df.OPERATION_DEFINITION:if(null==u){if(void 0!==h)return[new Ef("Must provide operation name if query contains multiple operations.")];h=e}else(null===(t=e.name)||void 0===t?void 0:t.value)===u&&(h=e);break;case Df.FRAGMENT_DEFINITION:y[e.name.value]=e}if(!h)return null!=u?[new Ef(`Unknown operation named "${u}".`)]:[new Ef("Must provide an operation.")];const v=Gm(i,null!==(n=h.variableDefinitions)&&void 0!==n?n:[],null!=c?c:{},{maxErrors:null!==(r=null==f?void 0:f.maxCoercionErrors)&&void 0!==r?r:50});return v.errors?v.errors:{schema:i,fragments:y,rootValue:a,contextValue:s,operation:h,variableValues:v.coerced,fieldResolver:null!=l?l:Qg,typeResolver:null!=p?p:Gg,subscribeFieldResolver:null!=d?d:Qg,errors:[]}}function Cg(e,t,n,r,i){const o=Object.create(null);let a=!1;try{for(const[s,c]of i.entries()){const i=Pg(e,t,n,c,Pm(r,s,t.name));void 0!==i&&(o[s]=i,pf(i)&&(a=!0))}}catch(e){if(a)return wg(o).finally(()=>{throw e});throw e}return a?wg(o):o}function Pg(e,t,n,r,i){var o;const a=Yg(e.schema,t,r[0]);if(!a)return;const s=a.type,c=null!==(o=a.resolve)&&void 0!==o?o:e.fieldResolver,u=Lg(e,a,r,t,i);try{const t=Qm(a,r[0],e.variableValues),o=c(n,t,e.contextValue,u);let l;return l=pf(o)?o.then(t=>Mg(e,s,r,u,i,t)):Mg(e,s,r,u,i,o),pf(l)?l.then(void 0,t=>$g(Sg(t,r,Lm(i)),s,e)):l}catch(t){return $g(Sg(t,r,Lm(i)),s,e)}}function Lg(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 $g(e,t,n){if(ny(t))throw e;return n.errors.push(e),null}function Mg(e,t,n,r,i,o){if(o instanceof Error)throw o;if(ny(t)){const a=Mg(e,t.ofType,n,r,i,o);if(null===a)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return a}return null==o?null:ty(t)?function(e,t,n,r,i,o){if(!ov(o))throw new Ef(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);const a=t.ofType;let s=!1;const c=Array.from(o,(t,o)=>{const c=Pm(i,o,void 0);try{let i;return i=pf(t)?t.then(t=>Mg(e,a,n,r,c,t)):Mg(e,a,n,r,c,t),pf(i)?(s=!0,i.then(void 0,t=>$g(Sg(t,n,Lm(c)),a,e))):i}catch(t){return $g(Sg(t,n,Lm(c)),a,e)}});return s?Promise.all(c):c}(e,t,n,r,i,o):oy(t)?function(e,t){const n=e.serialize(t);if(null==n)throw new Error(`Expected \`${ah(e)}.serialize(${ah(t)})\` to return non-nullable value, returned: ${ah(n)}`);return n}(t,o):sy(t)?function(e,t,n,r,i,o){var a;const s=null!==(a=t.resolveType)&&void 0!==a?a:e.typeResolver,c=e.contextValue,u=s(o,c,r,t);if(pf(u))return u.then(a=>Ug(e,Vg(a,e,t,n,r,o),n,r,i,o));return Ug(e,Vg(u,e,t,n,r,o),n,r,i,o)}(e,t,n,r,i,o):Wh(t)?Ug(e,t,n,r,i,o):void ff(!1,"Cannot complete value of unexpected output type: "+ah(t))}function Vg(e,t,n,r,i,o){if(null==e)throw new Ef(`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(Wh(e))throw new Ef("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 Ef(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${ah(o)}, received "${ah(e)}".`);const a=t.schema.getType(e);if(null==a)throw new Ef(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!Wh(a))throw new Ef(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,a))throw new Ef(`Runtime Object type "${a.name}" is not a possible type for "${n.name}".`,{nodes:r});return a}function Ug(e,t,n,r,i,o){const a=Dg(e,t,n);if(t.isTypeOf){const s=t.isTypeOf(o,e.contextValue,r);if(pf(s))return s.then(r=>{if(!r)throw Bg(t,o,n);return Cg(e,t,o,i,a)});if(!s)throw Bg(t,o,n)}return Cg(e,t,o,i,a)}function Bg(e,t,n){return new Ef(`Expected value of type "${e.name}" but got: ${ah(t)}.`,{nodes:n})}const Gg=function(e,t,n,r){if(df(e)&&"string"==typeof e.__typename)return e.__typename;const i=n.schema.getPossibleTypes(r),o=[];for(let r=0;r<i.length;r++){const a=i[r];if(a.isTypeOf){const i=a.isTypeOf(e,t,n);if(pf(i))o[r]=i;else if(i)return a.name}}return o.length?Promise.all(o).then(e=>{for(let t=0;t<e.length;t++)if(e[t])return i[t].name}):void 0},Qg=function(e,t,n,r){if(df(e)||"function"==typeof e){const i=e[r.fieldName];return"function"==typeof i?e[r.fieldName](t,n,r):i}};function Yg(e,t,n){const r=n.name.value;return r===mv.name&&e.getQueryType()===t?mv:r===gv.name&&e.getQueryType()===t?gv:r===Ev.name?Ev:t.getFields()[r]}function qg(e){arguments.length<2||lf(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,source:n,rootValue:r,contextValue:i,variableValues:o,operationName:a,fieldResolver:s,typeResolver:c}=e,u=wv(t);if(u.length>0)return{errors:u};let l;try{l=ph(n)}catch(e){return{errors:[e]}}const p=Ig(t,l);return p.length>0?{errors:p}:Rg({schema:t,document:l,rootValue:r,contextValue:i,variableValues:o,operationName:a,fieldResolver:s,typeResolver:c})}function zg(e){return"function"==typeof(null==e?void 0:e[Symbol.asyncIterator])}async function Wg(...e){const t=function(e){const 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]}}(e),{schema:n,document:r,variableValues:i}=t;xg(n,r,i);const o=jg(t);if(!("schema"in o))return{errors:o};try{const e=await async function(e){const{schema:t,fragments:n,operation:r,variableValues:i,rootValue:o}=e,a=t.getSubscriptionType();if(null==a)throw new Ef("Schema is not configured to execute subscription operation.",{nodes:r});const s=zm(t,n,i,a,r.selectionSet),[c,u]=[...s.entries()][0],l=Yg(t,a,u[0]);if(!l){const e=u[0].name.value;throw new Ef(`The subscription field "${e}" is not defined.`,{nodes:u})}const p=Pm(void 0,c,a.name),d=Lg(e,l,u,a,p);try{var f;const t=Qm(l,u[0],i),n=e.contextValue,r=null!==(f=l.subscribe)&&void 0!==f?f:e.subscribeFieldResolver,a=await r(o,t,n,d);if(a instanceof Error)throw a;return a}catch(e){throw Sg(e,u,Lm(p))}}(o);if(!zg(e))throw new Error(`Subscription field must return Async Iterable. Received: ${ah(e)}.`);return e}catch(e){if(e instanceof Ef)return{errors:[e]};throw e}}function Jg(e){const t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e},n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?n:"";function a(e){return t.inputValueDeprecation?e:""}const s=t.oneOf?"isOneOf":"";return`\n    query IntrospectionQuery {\n      __schema {\n        ${o}\n        queryType { name kind }\n        mutationType { name kind }\n        subscriptionType { name kind }\n        types {\n          ...FullType\n        }\n        directives {\n          name\n          ${n}\n          ${i}\n          locations\n          args${a("(includeDeprecated: true)")} {\n            ...InputValue\n          }\n        }\n      }\n    }\n\n    fragment FullType on __Type {\n      kind\n      name\n      ${n}\n      ${r}\n      ${s}\n      fields(includeDeprecated: true) {\n        name\n        ${n}\n        args${a("(includeDeprecated: true)")} {\n          ...InputValue\n        }\n        type {\n          ...TypeRef\n        }\n        isDeprecated\n        deprecationReason\n      }\n      inputFields${a("(includeDeprecated: true)")} {\n        ...InputValue\n      }\n      interfaces {\n        ...TypeRef\n      }\n      enumValues(includeDeprecated: true) {\n        name\n        ${n}\n        isDeprecated\n        deprecationReason\n      }\n      possibleTypes {\n        ...TypeRef\n      }\n    }\n\n    fragment InputValue on __InputValue {\n      name\n      ${n}\n      type { ...TypeRef }\n      defaultValue\n      ${a("isDeprecated")}\n      ${a("deprecationReason")}\n    }\n\n    fragment TypeRef on __Type {\n      kind\n      name\n      ofType {\n        kind\n        name\n        ofType {\n          kind\n          name\n          ofType {\n            kind\n            name\n            ofType {\n              kind\n              name\n              ofType {\n                kind\n                name\n                ofType {\n                  kind\n                  name\n                  ofType {\n                    kind\n                    name\n                    ofType {\n                      kind\n                      name\n                      ofType {\n                        kind\n                        name\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  `}function Kg(e,t,n){var r,i,o,a;const s=[],c=Object.create(null),u=[];let l;const p=[];for(const e of t.definitions)if(e.kind===Df.SCHEMA_DEFINITION)l=e;else if(e.kind===Df.SCHEMA_EXTENSION)p.push(e);else if(Jv(e))s.push(e);else if(Xv(e)){const t=e.name.value,n=c[t];c[t]=n?n.concat([e]):[e]}else e.kind===Df.DIRECTIVE_DEFINITION&&u.push(e);if(0===Object.keys(c).length&&0===s.length&&0===u.length&&0===p.length&&null==l)return e;const d=Object.create(null);for(const t of e.types)d[t.name]=m(t);for(const e of s){var f;const t=e.name.value;d[t]=null!==(f=Xg[t])&&void 0!==f?f:D(e)}const h={query:e.query&&v(e.query),mutation:e.mutation&&v(e.mutation),subscription:e.subscription&&v(e.subscription),...l&&T([l]),...T(p)};return{description:null===(r=l)||void 0===r||null===(i=r.description)||void 0===i?void 0:i.value,...h,types:Object.values(d),directives:[...e.directives.map(function(e){const t=e.toConfig();return new Ky({...t,args:Th(t.args,E)})}),...u.map(function(e){var t;return new Ky({name:e.name.value,description:null===(t=e.description)||void 0===t?void 0:t.value,locations:e.locations.map(({value:e})=>e),isRepeatable:e.repeatable,args:I(e.arguments),astNode:e})})],extensions:Object.create(null),astNode:null!==(o=l)&&void 0!==o?o:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(p),assumeValid:null!==(a=null==n?void 0:n.assumeValid)&&void 0!==a&&a};function y(e){return ty(e)?new cy(y(e.ofType)):ny(e)?new uy(y(e.ofType)):v(e)}function v(e){return d[e.name]}function m(e){return bv(e)||zy(e)?e:zh(e)?function(e){var t;const n=e.toConfig(),r=null!==(t=c[n.name])&&void 0!==t?t:[];let i=n.specifiedByURL;for(const e of r){var o;i=null!==(o=Zg(e))&&void 0!==o?o:i}return new gy({...n,specifiedByURL:i,extensionASTNodes:n.extensionASTNodes.concat(r)})}(e):Wh(e)?function(e){var t;const n=e.toConfig(),r=null!==(t=c[n.name])&&void 0!==t?t:[];return new Ey({...n,interfaces:()=>[...e.getInterfaces().map(v),...A(r)],fields:()=>({...Th(n.fields,g),...N(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(e):Kh(e)?function(e){var t;const n=e.toConfig(),r=null!==(t=c[n.name])&&void 0!==t?t:[];return new Ay({...n,interfaces:()=>[...e.getInterfaces().map(v),...A(r)],fields:()=>({...Th(n.fields,g),...N(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(e):Hh(e)?function(e){var t;const n=e.toConfig(),r=null!==(t=c[n.name])&&void 0!==t?t:[];return new Sy({...n,types:()=>[...e.getTypes().map(v),...S(r)],extensionASTNodes:n.extensionASTNodes.concat(r)})}(e):Zh(e)?function(e){var t;const n=e.toConfig(),r=null!==(t=c[e.name])&&void 0!==t?t:[];return new Ry({...n,values:{...n.values,...w(r)},extensionASTNodes:n.extensionASTNodes.concat(r)})}(e):ey(e)?function(e){var t;const n=e.toConfig(),r=null!==(t=c[n.name])&&void 0!==t?t:[];return new xy({...n,fields:()=>({...Th(n.fields,e=>({...e,type:y(e.type)})),...O(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(e):void ff(!1,"Unexpected type: "+ah(e))}function g(e){return{...e,type:y(e.type),args:e.args&&Th(e.args,E)}}function E(e){return{...e,type:y(e.type)}}function T(e){const t={};for(const r of e){var n;const e=null!==(n=r.operationTypes)&&void 0!==n?n:[];for(const n of e)t[n.operation]=b(n.type)}return t}function b(e){var t;const n=e.name.value,r=null!==(t=Xg[n])&&void 0!==t?t:d[n];if(void 0===r)throw new Error(`Unknown type: "${n}".`);return r}function _(e){return e.kind===Df.LIST_TYPE?new cy(_(e.type)):e.kind===Df.NON_NULL_TYPE?new uy(_(e.type)):b(e)}function N(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.fields)&&void 0!==n?n:[];for(const n of e){var r;t[n.name.value]={type:_(n.type),description:null===(r=n.description)||void 0===r?void 0:r.value,args:I(n.arguments),deprecationReason:Hg(n),astNode:n}}}return t}function I(e){const t=null!=e?e:[],n=Object.create(null);for(const e of t){var r;const t=_(e.type);n[e.name.value]={type:t,description:null===(r=e.description)||void 0===r?void 0:r.value,defaultValue:Um(e.defaultValue,t),deprecationReason:Hg(e),astNode:e}}return n}function O(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.fields)&&void 0!==n?n:[];for(const n of e){var r;const e=_(n.type);t[n.name.value]={type:e,description:null===(r=n.description)||void 0===r?void 0:r.value,defaultValue:Um(n.defaultValue,e),deprecationReason:Hg(n),astNode:n}}}return t}function w(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.values)&&void 0!==n?n:[];for(const n of e){var r;t[n.name.value]={description:null===(r=n.description)||void 0===r?void 0:r.value,deprecationReason:Hg(n),astNode:n}}}return t}function A(e){return e.flatMap(e=>{var t,n;return null!==(t=null===(n=e.interfaces)||void 0===n?void 0:n.map(b))&&void 0!==t?t:[]})}function S(e){return e.flatMap(e=>{var t,n;return null!==(t=null===(n=e.types)||void 0===n?void 0:n.map(b))&&void 0!==t?t:[]})}function D(e){var t;const n=e.name.value,r=null!==(t=c[n])&&void 0!==t?t:[];switch(e.kind){case Df.OBJECT_TYPE_DEFINITION:{var i;const t=[e,...r];return new Ey({name:n,description:null===(i=e.description)||void 0===i?void 0:i.value,interfaces:()=>A(t),fields:()=>N(t),astNode:e,extensionASTNodes:r})}case Df.INTERFACE_TYPE_DEFINITION:{var o;const t=[e,...r];return new Ay({name:n,description:null===(o=e.description)||void 0===o?void 0:o.value,interfaces:()=>A(t),fields:()=>N(t),astNode:e,extensionASTNodes:r})}case Df.ENUM_TYPE_DEFINITION:{var a;const t=[e,...r];return new Ry({name:n,description:null===(a=e.description)||void 0===a?void 0:a.value,values:w(t),astNode:e,extensionASTNodes:r})}case Df.UNION_TYPE_DEFINITION:{var s;const t=[e,...r];return new Sy({name:n,description:null===(s=e.description)||void 0===s?void 0:s.value,types:()=>S(t),astNode:e,extensionASTNodes:r})}case Df.SCALAR_TYPE_DEFINITION:var u;return new gy({name:n,description:null===(u=e.description)||void 0===u?void 0:u.value,specifiedByURL:Zg(e),astNode:e,extensionASTNodes:r});case Df.INPUT_OBJECT_TYPE_DEFINITION:{var l;const t=[e,...r];return new xy({name:n,description:null===(l=e.description)||void 0===l?void 0:l.value,fields:()=>O(t),astNode:e,extensionASTNodes:r,isOneOf:(p=e,Boolean(Ym(nv,p)))})}}var p}}const Xg=gh([...qy,...Tv],e=>e.name);function Hg(e){const t=Ym(ev,e);return null==t?void 0:t.reason}function Zg(e){const t=Ym(tv,e);return null==t?void 0:t.url}function eE(e,t){null!=e&&e.kind===Df.DOCUMENT||lf(!1,"Must provide valid Document AST."),!0!==(null==t?void 0:t.assumeValid)&&!0!==(null==t?void 0:t.assumeValidSDL)&&function(e){const t=Og(e);if(0!==t.length)throw new Error(t.map(e=>e.message).join("\n\n"))}(e);const n=Kg({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...rv.filter(e=>n.directives.every(t=>t.name!==e.name))];return new Iv({...n,directives:r})}function tE(e,t){const n=Object.create(null);for(const r of Object.keys(e).sort(bh))n[r]=t(e[r]);return n}function nE(e){return rE(e,e=>e.name)}function rE(e,t){return e.slice().sort((e,n)=>bh(t(e),t(n)))}function iE(e){return!zy(e)&&!bv(e)}function oE(e,t,n){const r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[aE(e),...r.map(e=>function(e){return hE(e)+"directive @"+e.name+pE(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e)),...i.map(e=>sE(e))].filter(Boolean).join("\n\n")}function aE(e){if(null==e.description&&function(e){const t=e.getQueryType();if(t&&"Query"!==t.name)return!1;const n=e.getMutationType();if(n&&"Mutation"!==n.name)return!1;const r=e.getSubscriptionType();if(r&&"Subscription"!==r.name)return!1;return!0}(e))return;const t=[],n=e.getQueryType();n&&t.push(`  query: ${n.name}`);const r=e.getMutationType();r&&t.push(`  mutation: ${r.name}`);const i=e.getSubscriptionType();return i&&t.push(`  subscription: ${i.name}`),hE(e)+`schema {\n${t.join("\n")}\n}`}function sE(e){return zh(e)?function(e){return hE(e)+`scalar ${e.name}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${Ph({kind:Df.STRING,value:e.specifiedByURL})})`}(e)}(e):Wh(e)?function(e){return hE(e)+`type ${e.name}`+cE(e)+uE(e)}(e):Kh(e)?function(e){return hE(e)+`interface ${e.name}`+cE(e)+uE(e)}(e):Hh(e)?function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return hE(e)+"union "+e.name+n}(e):Zh(e)?function(e){const t=e.getValues().map((e,t)=>hE(e,"  ",!t)+"  "+e.name+fE(e.deprecationReason));return hE(e)+`enum ${e.name}`+lE(t)}(e):ey(e)?function(e){const t=Object.values(e.getFields()).map((e,t)=>hE(e,"  ",!t)+"  "+dE(e));return hE(e)+`input ${e.name}`+(e.isOneOf?" @oneOf":"")+lE(t)}(e):void ff(!1,"Unexpected type: "+ah(e))}function cE(e){const t=e.getInterfaces();return t.length?" implements "+t.map(e=>e.name).join(" & "):""}function uE(e){const t=Object.values(e.getFields()).map((e,t)=>hE(e,"  ",!t)+"  "+e.name+pE(e.args,"  ")+": "+String(e.type)+fE(e.deprecationReason));return lE(t)}function lE(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function pE(e,t=""){return 0===e.length?"":e.every(e=>!e.description)?"("+e.map(dE).join(", ")+")":"(\n"+e.map((e,n)=>hE(e,"  "+t,!n)+"  "+t+dE(e)).join("\n")+"\n"+t+")"}function dE(e){const t=av(e.defaultValue,e.type);let n=e.name+": "+String(e.type);return t&&(n+=` = ${Ph(t)}`),n+fE(e.deprecationReason)}function fE(e){if(null==e)return"";if(e!==Zy){return` @deprecated(reason: ${Ph({kind:Df.STRING,value:e})})`}return" @deprecated"}function hE(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+Ph({kind:Df.STRING,value:r,block:$f(r)}).replace(/\n/g,"\n"+t)+"\n"}function yE(e,t,n){if(!e.has(n)){e.add(n);const r=t[n];if(void 0!==r)for(const n of r)yE(e,t,n)}}function vE(e){const t=[];return xh(e,{FragmentSpread(e){t.push(e.name.value)}}),t}function mE(e){if("string"==typeof e||lf(!1,"Expected name to be a string."),e.startsWith("__"))return new Ef(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{Qh(e)}catch(e){return e}}var gE,EE;function TE(e,t){return[..._E(e,t),...bE(e,t)]}function bE(e,t){const n=[],r=xE(e.getDirectives(),t.getDirectives());for(const e of r.removed)n.push({type:gE.DIRECTIVE_REMOVED,description:`${e.name} was removed.`});for(const[e,t]of r.persisted){const r=xE(e.args,t.args);for(const t of r.added)wy(t)&&n.push({type:gE.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${t.name} on directive ${e.name} was added.`});for(const t of r.removed)n.push({type:gE.DIRECTIVE_ARG_REMOVED,description:`${t.name} was removed from ${e.name}.`});e.isRepeatable&&!t.isRepeatable&&n.push({type:gE.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${e.name}.`});for(const r of e.locations)t.locations.includes(r)||n.push({type:gE.DIRECTIVE_LOCATION_REMOVED,description:`${r} was removed from ${e.name}.`})}return n}function _E(e,t){const n=[],r=xE(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(const e of r.removed)n.push({type:gE.TYPE_REMOVED,description:zy(e)?`Standard scalar ${e.name} was removed because it is not referenced anymore.`:`${e.name} was removed.`});for(const[e,t]of r.persisted)Zh(e)&&Zh(t)?n.push(...OE(e,t)):Hh(e)&&Hh(t)?n.push(...IE(e,t)):ey(e)&&ey(t)?n.push(...NE(e,t)):Wh(e)&&Wh(t)||Kh(e)&&Kh(t)?n.push(...AE(e,t),...wE(e,t)):e.constructor!==t.constructor&&n.push({type:gE.TYPE_CHANGED_KIND,description:`${e.name} changed from ${FE(e)} to ${FE(t)}.`});return n}function NE(e,t){const n=[],r=xE(Object.values(e.getFields()),Object.values(t.getFields()));for(const t of r.added)Cy(t)?n.push({type:gE.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${t.name} on input type ${e.name} was added.`}):n.push({type:EE.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${t.name} on input type ${e.name} was added.`});for(const t of r.removed)n.push({type:gE.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(const[t,i]of r.persisted){RE(t.type,i.type)||n.push({type:gE.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`})}return n}function IE(e,t){const n=[],r=xE(e.getTypes(),t.getTypes());for(const t of r.added)n.push({type:EE.TYPE_ADDED_TO_UNION,description:`${t.name} was added to union type ${e.name}.`});for(const t of r.removed)n.push({type:gE.TYPE_REMOVED_FROM_UNION,description:`${t.name} was removed from union type ${e.name}.`});return n}function OE(e,t){const n=[],r=xE(e.getValues(),t.getValues());for(const t of r.added)n.push({type:EE.VALUE_ADDED_TO_ENUM,description:`${t.name} was added to enum type ${e.name}.`});for(const t of r.removed)n.push({type:gE.VALUE_REMOVED_FROM_ENUM,description:`${t.name} was removed from enum type ${e.name}.`});return n}function wE(e,t){const n=[],r=xE(e.getInterfaces(),t.getInterfaces());for(const t of r.added)n.push({type:EE.IMPLEMENTED_INTERFACE_ADDED,description:`${t.name} added to interfaces implemented by ${e.name}.`});for(const t of r.removed)n.push({type:gE.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${t.name}.`});return n}function AE(e,t){const n=[],r=xE(Object.values(e.getFields()),Object.values(t.getFields()));for(const t of r.removed)n.push({type:gE.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(const[t,i]of r.persisted){n.push(...SE(e,t,i));DE(t.type,i.type)||n.push({type:gE.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`})}return n}function SE(e,t,n){const r=[],i=xE(t.args,n.args);for(const n of i.removed)r.push({type:gE.ARG_REMOVED,description:`${e.name}.${t.name} arg ${n.name} was removed.`});for(const[n,o]of i.persisted){if(RE(n.type,o.type)){if(void 0!==n.defaultValue)if(void 0===o.defaultValue)r.push({type:EE.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} defaultValue was removed.`});else{const i=kE(n.defaultValue,n.type),a=kE(o.defaultValue,o.type);i!==a&&r.push({type:EE.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} has changed defaultValue from ${i} to ${a}.`})}}else r.push({type:gE.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${n.name} has changed type from ${String(n.type)} to ${String(o.type)}.`})}for(const n of i.added)wy(n)?r.push({type:gE.REQUIRED_ARG_ADDED,description:`A required arg ${n.name} on ${e.name}.${t.name} was added.`}):r.push({type:EE.OPTIONAL_ARG_ADDED,description:`An optional arg ${n.name} on ${e.name}.${t.name} was added.`});return r}function DE(e,t){return ty(e)?ty(t)&&DE(e.ofType,t.ofType)||ny(t)&&DE(e,t.ofType):ny(e)?ny(t)&&DE(e.ofType,t.ofType):hy(t)&&e.name===t.name||ny(t)&&DE(e,t.ofType)}function RE(e,t){return ty(e)?ty(t)&&RE(e.ofType,t.ofType):ny(e)?ny(t)&&RE(e.ofType,t.ofType)||!ny(t)&&RE(e.ofType,t):hy(t)&&e.name===t.name}function FE(e){return zh(e)?"a Scalar type":Wh(e)?"an Object type":Kh(e)?"an Interface type":Hh(e)?"a Union type":Zh(e)?"an Enum type":ey(e)?"an Input type":void ff(!1,"Unexpected type: "+ah(e))}function kE(e,t){const n=av(e,t);return null!=n||ff(!1),Ph(hm(n))}function xE(e,t){const n=[],r=[],i=[],o=gh(e,({name:e})=>e),a=gh(t,({name:e})=>e);for(const t of e){const e=a[t.name];void 0===e?r.push(t):i.push([t,e])}for(const e of t)void 0===o[e.name]&&n.push(e);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"}(gE||(gE={})),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"}(EE||(EE={}));var jE=Object.freeze({__proto__:null,BREAK:kh,get BreakingChangeType(){return gE},DEFAULT_DEPRECATION_REASON:Zy,get DangerousChangeType(){return EE},get DirectiveLocation(){return Sf},ExecutableDefinitionsRule:Hv,FieldsOnCorrectTypeRule:Zv,FragmentsOnCompositeTypesRule:em,GRAPHQL_MAX_INT:My,GRAPHQL_MIN_INT:Vy,GraphQLBoolean:Qy,GraphQLDeprecatedDirective:ev,GraphQLDirective:Ky,GraphQLEnumType:Ry,GraphQLError:Ef,GraphQLFloat:By,GraphQLID:Yy,GraphQLIncludeDirective:Xy,GraphQLInputObjectType:xy,GraphQLInt:Uy,GraphQLInterfaceType:Ay,GraphQLList:cy,GraphQLNonNull:uy,GraphQLObjectType:Ey,GraphQLOneOfDirective:nv,GraphQLScalarType:gy,GraphQLSchema:Iv,GraphQLSkipDirective:Hy,GraphQLSpecifiedByDirective:tv,GraphQLString:Gy,GraphQLUnionType:Sy,get Kind(){return Df},KnownArgumentNamesRule:tm,KnownDirectivesRule:rm,KnownFragmentNamesRule:im,KnownTypeNamesRule:om,Lexer:Vf,Location:_f,LoneAnonymousOperationRule:sm,LoneSchemaDefinitionRule:cm,MaxIntrospectionDepthRule:um,NoDeprecatedCustomRule:function(e){return{Field(t){const n=e.getFieldDef(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){const i=e.getParentType();null!=i||ff(!1),e.reportError(new Ef(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){const n=e.getArgument(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){const i=e.getDirective();if(null!=i)e.reportError(new Ef(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}));else{const i=e.getParentType(),o=e.getFieldDef();null!=i&&null!=o||ff(!1),e.reportError(new Ef(`Field "${i.name}.${o.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){const n=yy(e.getParentInputType());if(ey(n)){const r=n.getFields()[t.name.value],i=null==r?void 0:r.deprecationReason;null!=i&&e.reportError(new Ef(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){const n=e.getEnumValue(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){const i=yy(e.getInputType());null!=i||ff(!1),e.reportError(new Ef(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:t}))}}}},NoFragmentCyclesRule:lm,NoSchemaIntrospectionCustomRule:function(e){return{Field(t){const n=yy(e.getType());n&&bv(n)&&e.reportError(new Ef(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}},NoUndefinedVariablesRule:pm,NoUnusedFragmentsRule:dm,NoUnusedVariablesRule:fm,get OperationTypeNode(){return Af},OverlappingFieldsCanBeMergedRule:vm,PossibleFragmentSpreadsRule:Sm,PossibleTypeExtensionsRule:Dm,ProvidedRequiredArgumentsRule:Fm,ScalarLeafsRule:jm,SchemaMetaFieldDef:mv,SingleFieldSubscriptionsRule:Hm,Source:uh,Token:Nf,get TokenKind(){return Rf},TypeInfo:Gv,get TypeKind(){return yv},TypeMetaFieldDef:gv,TypeNameMetaFieldDef:Ev,UniqueArgumentDefinitionNamesRule:eg,UniqueArgumentNamesRule:tg,UniqueDirectiveNamesRule:ng,UniqueDirectivesPerLocationRule:rg,UniqueEnumValueNamesRule:ig,UniqueFieldDefinitionNamesRule:og,UniqueFragmentNamesRule:sg,UniqueInputFieldNamesRule:cg,UniqueOperationNamesRule:ug,UniqueOperationTypesRule:lg,UniqueTypeNamesRule:pg,UniqueVariableNamesRule:dg,ValidationContext:Ng,ValuesOfCorrectTypeRule:fg,VariablesAreInputTypesRule:yg,VariablesInAllowedPositionRule:vg,__Directive:uv,__DirectiveLocation:lv,__EnumValue:hv,__Field:dv,__InputValue:fv,__Schema:cv,__Type:pv,__TypeKind:vv,assertAbstractType:function(e){if(!sy(e))throw new Error(`Expected ${ah(e)} to be a GraphQL abstract type.`);return e},assertCompositeType:function(e){if(!ay(e))throw new Error(`Expected ${ah(e)} to be a GraphQL composite type.`);return e},assertDirective:function(e){if(!Jy(e))throw new Error(`Expected ${ah(e)} to be a GraphQL directive.`);return e},assertEnumType:function(e){if(!Zh(e))throw new Error(`Expected ${ah(e)} to be a GraphQL Enum type.`);return e},assertEnumValueName:Yh,assertInputObjectType:function(e){if(!ey(e))throw new Error(`Expected ${ah(e)} to be a GraphQL Input Object type.`);return e},assertInputType:function(e){if(!ry(e))throw new Error(`Expected ${ah(e)} to be a GraphQL input type.`);return e},assertInterfaceType:Xh,assertLeafType:function(e){if(!oy(e))throw new Error(`Expected ${ah(e)} to be a GraphQL leaf type.`);return e},assertListType:function(e){if(!ty(e))throw new Error(`Expected ${ah(e)} to be a GraphQL List type.`);return e},assertName:Qh,assertNamedType:function(e){if(!hy(e))throw new Error(`Expected ${ah(e)} to be a GraphQL named type.`);return e},assertNonNullType:function(e){if(!ny(e))throw new Error(`Expected ${ah(e)} to be a GraphQL Non-Null type.`);return e},assertNullableType:dy,assertObjectType:Jh,assertOutputType:function(e){if(!iy(e))throw new Error(`Expected ${ah(e)} to be a GraphQL output type.`);return e},assertScalarType:function(e){if(!zh(e))throw new Error(`Expected ${ah(e)} to be a GraphQL Scalar type.`);return e},assertSchema:Nv,assertType:function(e){if(!qh(e))throw new Error(`Expected ${ah(e)} to be a GraphQL type.`);return e},assertUnionType:function(e){if(!Hh(e))throw new Error(`Expected ${ah(e)} to be a GraphQL Union type.`);return e},assertValidName:function(e){const t=mE(e);if(t)throw t;return e},assertValidSchema:Av,assertWrappingType:function(e){if(!ly(e))throw new Error(`Expected ${ah(e)} to be a GraphQL wrapping type.`);return e},astFromValue:av,buildASTSchema:eE,buildClientSchema:function(e,t){df(e)&&df(e.__schema)||lf(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${ah(e)}.`);const n=e.__schema,r=Eh(n.types,e=>e.name,e=>function(e){if(null!=e&&null!=e.name&&null!=e.kind)switch(e.kind){case yv.SCALAR:return new gy({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case yv.OBJECT:return new Ey({name:(n=e).name,description:n.description,interfaces:()=>d(n),fields:()=>f(n)});case yv.INTERFACE:return new Ay({name:(t=e).name,description:t.description,interfaces:()=>d(t),fields:()=>f(t)});case yv.UNION:return function(e){if(!e.possibleTypes){const t=ah(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new Sy({name:e.name,description:e.description,types:()=>e.possibleTypes.map(l)})}(e);case yv.ENUM:return function(e){if(!e.enumValues){const t=ah(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new Ry({name:e.name,description:e.description,values:Eh(e.enumValues,e=>e.name,e=>({description:e.description,deprecationReason:e.deprecationReason}))})}(e);case yv.INPUT_OBJECT:return function(e){if(!e.inputFields){const t=ah(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new xy({name:e.name,description:e.description,fields:()=>y(e.inputFields),isOneOf:e.isOneOf})}(e)}var t;var n;var r;const i=ah(e);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${i}.`)}(e));for(const e of[...qy,...Tv])r[e.name]&&(r[e.name]=e);const i=n.queryType?l(n.queryType):null,o=n.mutationType?l(n.mutationType):null,a=n.subscriptionType?l(n.subscriptionType):null,s=n.directives?n.directives.map(function(e){if(!e.args){const t=ah(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(!e.locations){const t=ah(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new Ky({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:y(e.args)})}):[];return new Iv({description:n.description,query:i,mutation:o,subscription:a,types:Object.values(r),directives:s,assumeValid:null==t?void 0:t.assumeValid});function c(e){if(e.kind===yv.LIST){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");return new cy(c(t))}if(e.kind===yv.NON_NULL){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");const n=c(t);return new uy(dy(n))}return u(e)}function u(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${ah(e)}.`);const n=r[t];if(!n)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.`);return n}function l(e){return Jh(u(e))}function p(e){return Xh(u(e))}function d(e){if(null===e.interfaces&&e.kind===yv.INTERFACE)return[];if(!e.interfaces){const t=ah(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(p)}function f(e){if(!e.fields)throw new Error(`Introspection result missing fields: ${ah(e)}.`);return Eh(e.fields,e=>e.name,h)}function h(e){const t=c(e.type);if(!iy(t)){const e=ah(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(!e.args){const t=ah(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:y(e.args)}}function y(e){return Eh(e,e=>e.name,v)}function v(e){const t=c(e.type);if(!ry(t)){const e=ah(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}const n=null!=e.defaultValue?Um(dh(e.defaultValue),t):void 0;return{description:e.description,type:t,defaultValue:n,deprecationReason:e.deprecationReason}}},buildSchema:function(e,t){return eE(ph(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})},coerceInputValue:$m,concatAST:function(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:Df.DOCUMENT,definitions:t}},createSourceEventStream:Wg,defaultFieldResolver:Qg,defaultTypeResolver:Gg,doTypesOverlap:$y,execute:Rg,executeSync:Fg,extendSchema:function(e,t,n){Nv(e),null!=t&&t.kind===Df.DOCUMENT||lf(!1,"Must provide valid Document AST."),!0!==(null==n?void 0:n.assumeValid)&&!0!==(null==n?void 0:n.assumeValidSDL)&&function(e,t){const n=Og(e,t);if(0!==n.length)throw new Error(n.map(e=>e.message).join("\n\n"))}(t,e);const r=e.toConfig(),i=Kg(r,t,n);return r===i?e:new Iv(i)},findBreakingChanges:function(e,t){return TE(e,t).filter(e=>e.type in gE)},findDangerousChanges:function(e,t){return TE(e,t).filter(e=>e.type in EE)},formatError:function(e){return e.toJSON()},getArgumentValues:Qm,getDirectiveValues:Ym,getEnterLeaveForKind:Ch,getIntrospectionQuery:Jg,getLocation:yf,getNamedType:yy,getNullableType:fy,getOperationAST:function(e,t){let n=null;for(const i of e.definitions){var r;if(i.kind===Df.OPERATION_DEFINITION)if(null==t){if(n)return null;n=i}else if((null===(r=i.name)||void 0===r?void 0:r.value)===t)return i}return n},getOperationRootType:function(e,t){if("query"===t.operation){const n=e.getQueryType();if(!n)throw new Ef("Schema does not define the required query root type.",{nodes:t});return n}if("mutation"===t.operation){const n=e.getMutationType();if(!n)throw new Ef("Schema is not configured for mutations.",{nodes:t});return n}if("subscription"===t.operation){const n=e.getSubscriptionType();if(!n)throw new Ef("Schema is not configured for subscriptions.",{nodes:t});return n}throw new Ef("Can only have query, mutation and subscription operations.",{nodes:t})},getVariableValues:Gm,getVisitFn:function(e,t,n){const{enter:r,leave:i}=Ch(e,t);return n?i:r},graphql:function(e){return new Promise(t=>t(qg(e)))},graphqlSync:function(e){const t=qg(e);if(pf(t))throw new Error("GraphQL execution failed to complete synchronously.");return t},introspectionFromSchema:function(e,t){const n=Fg({schema:e,document:ph(Jg({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,oneOf:!0,...t}))});return!n.errors&&n.data||ff(!1),n.data},introspectionTypes:Tv,isAbstractType:sy,isCompositeType:ay,isConstValueNode:function e(t){return zv(t)&&(t.kind===Df.LIST?t.values.some(e):t.kind===Df.OBJECT?t.fields.some(t=>e(t.value)):t.kind!==Df.VARIABLE)},isDefinitionNode:function(e){return qv(e)||Wv(e)||Kv(e)},isDirective:Jy,isEnumType:Zh,isEqualType:Py,isExecutableDefinitionNode:qv,isInputObjectType:ey,isInputType:ry,isInterfaceType:Kh,isIntrospectionType:bv,isLeafType:oy,isListType:ty,isNamedType:hy,isNonNullType:ny,isNullableType:py,isObjectType:Wh,isOutputType:iy,isRequiredArgument:wy,isRequiredInputField:Cy,isScalarType:zh,isSchema:_v,isSelectionNode:function(e){return e.kind===Df.FIELD||e.kind===Df.FRAGMENT_SPREAD||e.kind===Df.INLINE_FRAGMENT},isSpecifiedDirective:iv,isSpecifiedScalarType:zy,isType:qh,isTypeDefinitionNode:Jv,isTypeExtensionNode:Xv,isTypeNode:function(e){return e.kind===Df.NAMED_TYPE||e.kind===Df.LIST_TYPE||e.kind===Df.NON_NULL_TYPE},isTypeSubTypeOf:Ly,isTypeSystemDefinitionNode:Wv,isTypeSystemExtensionNode:Kv,isUnionType:Hh,isValidNameError:mE,isValueNode:zv,isWrappingType:ly,lexicographicSortSchema:function(e){const t=e.toConfig(),n=Eh(nE(t.types),e=>e.name,function(e){if(zh(e)||bv(e))return e;if(Wh(e)){const t=e.toConfig();return new Ey({...t,interfaces:()=>c(t.interfaces),fields:()=>s(t.fields)})}if(Kh(e)){const t=e.toConfig();return new Ay({...t,interfaces:()=>c(t.interfaces),fields:()=>s(t.fields)})}if(Hh(e)){const t=e.toConfig();return new Sy({...t,types:()=>c(t.types)})}if(Zh(e)){const t=e.toConfig();return new Ry({...t,values:tE(t.values,e=>e)})}if(ey(e)){const t=e.toConfig();return new xy({...t,fields:()=>tE(t.fields,e=>({...e,type:r(e.type)}))})}ff(!1,"Unexpected type: "+ah(e))});return new Iv({...t,types:Object.values(n),directives:nE(t.directives).map(function(e){const t=e.toConfig();return new Ky({...t,locations:rE(t.locations,e=>e),args:a(t.args)})}),query:o(t.query),mutation:o(t.mutation),subscription:o(t.subscription)});function r(e){return ty(e)?new cy(r(e.ofType)):ny(e)?new uy(r(e.ofType)):i(e)}function i(e){return n[e.name]}function o(e){return e&&i(e)}function a(e){return tE(e,e=>({...e,type:r(e.type)}))}function s(e){return tE(e,e=>({...e,type:r(e.type),args:e.args&&a(e.args)}))}function c(e){return nE(e).map(i)}},locatedError:Sg,parse:ph,parseConstValue:function(e,t){const n=new fh(e,t);n.expectToken(Rf.SOF);const r=n.parseConstValueLiteral();return n.expectToken(Rf.EOF),r},parseType:function(e,t){const n=new fh(e,t);n.expectToken(Rf.SOF);const r=n.parseTypeReference();return n.expectToken(Rf.EOF),r},parseValue:dh,print:Ph,printError:function(e){return e.toString()},printIntrospectionSchema:function(e){return oE(e,iv,bv)},printLocation:vf,printSchema:function(e){return oE(e,e=>!iv(e),iE)},printSourceLocation:mf,printType:sE,recommendedRules:gg,resolveObjMapThunk:my,resolveReadonlyArrayThunk:vy,responsePathAsArray:Lm,separateOperations:function(e){const t=[],n=Object.create(null);for(const r of e.definitions)switch(r.kind){case Df.OPERATION_DEFINITION:t.push(r);break;case Df.FRAGMENT_DEFINITION:n[r.name.value]=vE(r.selectionSet)}const r=Object.create(null);for(const i of t){const t=new Set;for(const e of vE(i.selectionSet))yE(t,n,e);r[i.name?i.name.value:""]={kind:Df.DOCUMENT,definitions:e.definitions.filter(e=>e===i||e.kind===Df.FRAGMENT_DEFINITION&&t.has(e.name.value))}}return r},specifiedDirectives:rv,specifiedRules:Eg,specifiedScalarTypes:qy,stripIgnoredCharacters:function(e){const t=lh(e)?e:new uh(e),n=t.body,r=new Vf(t);let i="",o=!1;for(;r.advance().kind!==Rf.EOF;){const e=r.token,t=e.kind,a=!Uf(e.kind);o&&(a||e.kind===Rf.SPREAD)&&(i+=" ");const s=n.slice(e.start,e.end);t===Rf.BLOCK_STRING?i+=Mf(e.value,{minimize:!0}):i+=s,o=a}return i},subscribe:async function(e){arguments.length<2||lf(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const t=await Wg(e);return zg(t)?function(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{next:async()=>r(await n.next()),return:async()=>"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}}}(t,t=>Rg({...e,rootValue:t})):t},syntaxError:bf,typeFromAST:Bv,validate:Ig,validateSchema:wv,valueFromAST:Um,valueFromASTUntyped:Gh,version:"16.11.0",versionInfo:uf,visit:xh,visitInParallel:jh,visitWithTypeInfo:Yv}),CE=L(jE);Object.defineProperty(cf,"__esModule",{value:!0}),cf.buildWatchFragmentWhereQuery=cf.buildWatchFragmentQuery=void 0;const PE=CE,LE=$;function $E({fieldName:e,fragmentDefinition:t}){return{kind:PE.Kind.DOCUMENT,definitions:[{directives:[],variableDefinitions:[],kind:PE.Kind.OPERATION_DEFINITION,operation:PE.OperationTypeNode.QUERY,selectionSet:{kind:PE.Kind.SELECTION_SET,selections:[{arguments:[],kind:PE.Kind.FIELD,name:{kind:PE.Kind.NAME,value:e},directives:[{arguments:[],kind:PE.Kind.DIRECTIVE,name:{kind:PE.Kind.NAME,value:"client"}}],selectionSet:t.selectionSet}]}}]}}cf.buildWatchFragmentQuery=function(e){const{fragment:t,id:n,policies:r,fieldName:i}=e,o=$E({fragmentDefinition:t.definitions[0],fieldName:i});return r.getFieldPolicy("Query",i)||r.addTypePolicies({Query:{fields:{[i]:{read:e=>(0,LE.makeReference)(n)}}}}),o},cf.buildWatchFragmentWhereQuery=function(e){const{fragment:t,filterVar:n,limitVar:r,orderByVar:i,policies:o,cache:a,fieldName:s}=e,c=t.definitions[0],u=c.typeCondition.name.value,l=$E({fragmentDefinition:c,fieldName:s});return o.getFieldPolicy("Query",s)||o.addTypePolicies({Query:{fields:{[s]:{read:e=>a.readReferenceWhere({__typename:u,filter:n(),limit:r(),orderBy:i()})}}}}),l},Object.defineProperty(sf,"__esModule",{value:!0});const ME=$,VE=cf,UE=el;class BE extends ME.ApolloClient{constructor(e){super(e),this.policies=this.cache.policies}watchQueryForField(e,t){const n=this.watchQuery({fetchPolicy:"cache-only",query:e}),r=n.subscribe.bind(n);return n.subscribe=(e,...n)=>{"object"!=typeof e&&(e={next:e,error:n[0],complete:n[1]});const i=e.next;e.next=e=>{var n;i&&i(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n[t])};const o=r(e),a=o.unsubscribe.bind(o);return o.unsubscribe=()=>{delete this.cache.policies.typePolicies.Query.fields[t],a()},o},n}watchFragment(e){const t=(0,UE.generateFragmentFieldName)(),n=(0,VE.buildWatchFragmentQuery)(Object.assign(Object.assign({},e),{fieldName:t,policies:this.policies}));return this.watchQueryForField(n,t)}watchFragmentWhere(e){const t=(0,UE.generateFragmentFieldName)(),n=(0,ME.makeVar)(e.filter),r=(0,ME.makeVar)(e.limit),i=(0,ME.makeVar)(e.orderBy),o=(0,VE.buildWatchFragmentWhereQuery)(Object.assign(Object.assign({},e),{fieldName:t,filterVar:n,limitVar:r,orderByVar:i,cache:this.cache,policies:this.policies}));return this.watchQueryForField(o,t)}}sf.default=BE,function(e){var t=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.ApolloExtensionsClient=void 0;var n=sf;Object.defineProperty(e,"ApolloExtensionsClient",{enumerable:!0,get:function(){return t(n).default}})}(af);var GE={},QE={},YE=L(c),qE={},zE=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qE,"__esModule",{value:!0}),qE.usePrevious=qE.useOnce=void 0;const WE=YE,JE=zE(Oe);qE.useOnce=function(e){const t=(0,WE.useRef)(),n=(0,WE.useRef)(!1);return n.current||((0,JE.default)(e)?t.current=e():t.current=e,n.current=!0),t.current};qE.usePrevious=e=>{const t=(0,WE.useRef)(null);return(0,WE.useEffect)(()=>{t.current=e}),t.current};var KE={};Object.defineProperty(KE,"__esModule",{value:!0}),KE.useFragmentTypePolicyFieldName=void 0;const XE=sc,HE=YE,ZE=el,eT=qE;KE.useFragmentTypePolicyFieldName=({fragmentName:e}={})=>{const t=(0,HE.useMemo)(()=>(0,ZE.generateFragmentFieldName)({fragmentName:e}),[e]),n=(0,eT.usePrevious)(t),r=(0,XE.useApolloClient)();return(0,HE.useEffect)(()=>()=>{delete r.cache.policies.typePolicies.Query.fields[n]},[t,n]),t};var tT={};Object.defineProperty(tT,"__esModule",{value:!0}),tT.useGetQueryDataByFieldName=void 0;const nT=sc;tT.useGetQueryDataByFieldName=(e,t,n)=>{var r,i;const o=(0,nT.useQuery)(e,{fetchPolicy:"cache-only",returnPartialData:null==n?void 0:n.returnPartialData});return{data:null!==(i=null===(r=null==o?void 0:o.data)||void 0===r?void 0:r[t])&&void 0!==i?i:null}},Object.defineProperty(QE,"__esModule",{value:!0});const rT=sc,iT=YE,oT=qE,aT=cf,sT=KE,cT=tT;QE.default=function(e,t){const n=(0,iT.useContext)((0,rT.getApolloContext)()).client,r=null==n?void 0:n.cache,i=(0,sT.useFragmentTypePolicyFieldName)(),o=(0,oT.useOnce)(()=>(0,aT.buildWatchFragmentQuery)({fragment:e,fieldName:i,id:t.id,policies:r.policies}));return(0,cT.useGetQueryDataByFieldName)(o,i,t)};var uT={};const{toString:lT,hasOwnProperty:pT}=Object.prototype,dT=Function.prototype.toString,fT=new Map;function hT(e,t){try{return yT(e,t)}finally{fT.clear()}}function yT(e,t){if(e===t)return!0;const n=lT.call(e);if(n!==lT.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(ET(e,t))return!0;const n=vT(e),r=vT(t),i=n.length;if(i!==r.length)return!1;for(let e=0;e<i;++e)if(!pT.call(t,n[e]))return!1;for(let r=0;r<i;++r){const i=n[r];if(!yT(e[i],t[i]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e===+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(ET(e,t))return!0;const r=e.entries(),i="[object Map]"===n;for(;;){const e=r.next();if(e.done)break;const[n,o]=e.value;if(!t.has(n))return!1;if(i&&!yT(o,t.get(n)))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]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let n=e.byteLength;if(n===t.byteLength)for(;n--&&e[n]===t[n];);return-1===n}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const n=dT.call(e);return n===dT.call(t)&&!function(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(n,gT)}}return!1}function vT(e){return Object.keys(e).filter(mT,e)}function mT(e){return void 0!==this[e]}const gT="{ [native code] }";function ET(e,t){let n=fT.get(e);if(n){if(n.has(t))return!0}else fT.set(e,n=new Set);return n.add(t),!1}var TT=L(Object.freeze({__proto__:null,default:hT,equal:hT}));Object.defineProperty(uT,"__esModule",{value:!0});const bT=sc,_T=YE,NT=cf,IT=KE,OT=tT,wT=sc,AT=TT;uT.default=function(e,t){var n;const r=null==t?void 0:t.filter,i=(0,_T.useRef)((0,wT.makeVar)(r)).current,o=null==t?void 0:t.limit,a=(0,_T.useRef)((0,wT.makeVar)(o)).current,s=null==t?void 0:t.orderBy,c=(0,_T.useRef)((0,wT.makeVar)(s)).current,u=(0,_T.useContext)((0,bT.getApolloContext)()).client,l=null==u?void 0:u.cache,p=(0,IT.useFragmentTypePolicyFieldName)({fragmentName:null==t?void 0:t.fragmentName}),d=(0,_T.useRef)([]);(0,_T.useEffect)(()=>{("function"==typeof r&&r!==i()||!(0,AT.equal)(r,i()))&&i(r)},[r]),(0,_T.useEffect)(()=>{o!==a()&&a(o)},[o]),(0,_T.useEffect)(()=>{("function"==typeof s&&s!==c()||!(0,AT.equal)(s,c()))&&c(s)},[s]);const f=(0,_T.useMemo)(()=>(0,NT.buildWatchFragmentWhereQuery)({filter:r,filterVar:i,limitVar:a,orderByVar:c,fragment:e,fieldName:p,cache:l,policies:l.policies}),[p]),h=(0,OT.useGetQueryDataByFieldName)(f,p,t);return Object.assign(Object.assign({},h),{data:null!==(n=h.data)&&void 0!==n?n:d.current})},function(e){var t=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.useFragmentWhere=e.useFragment=void 0;var n=QE;Object.defineProperty(e,"useFragment",{enumerable:!0,get:function(){return t(n).default}});var r=uT;Object.defineProperty(e,"useFragmentWhere",{enumerable:!0,get:function(){return t(r).default}})}(GE);var ST={},DT={},RT={},FT=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(RT,"__esModule",{value:!0}),RT.AuditType=void 0;const kT=FT(qu);var xT;!function(e){e.Read="Read",e.Write="Write",e.Evict="Evict"}(xT||(RT.AuditType=xT={}));class jT extends kT.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",xT.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",xT.Write,"InvalidationPolicyManager",Object.assign({typeName:e},t)),super.runWritePolicy(e,t)}runEvictPolicy(e,t){return this.auditLog.log("Running evict policy",xT.Write,"InvalidationPolicyManager",Object.assign({typeName:e},t)),super.runEvictPolicy(e,t)}}RT.default=jT;var CT={},PT=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(CT,"__esModule",{value:!0});const LT=PT(Od);var $T;!function(e){e.Write="Write",e.Evict="Evict"}($T||($T={}));class MT extends LT.default{constructor(e){super(),this.auditLog=e.auditLog}write(e,t,n,r){return this.auditLog.log("Writing to type map",$T.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",$T.Evict,"EntityTypeMap",{dataId:e,storeFieldName:t}),super.evict(e,t)}}CT.default=MT;var VT={},UT=hc;var BT=Na,GT=function(e,t){var n=[];return UT(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n},QT=Hc,YT=Ut;var qT=function(e,t){return(YT(e)?BT:GT)(e,QT(t))},zT=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(VT,"__esModule",{value:!0});const WT=zT(qT);VT.default=class{constructor(){this._log=[]}log(e,t,n,r){const i={time:Date.now(),type:t,event:e,meta:r,group:n};this._log.push(i)}getLog(e){return(0,WT.default)(this._log,e)}printLog(e){this.getLog(e).forEach(this.printLogEntry)}printLogEntry(e){var t;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!==(t=e.meta)&&void 0!==t?t:{})}`),console.groupEnd()}};var JT=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(DT,"__esModule",{value:!0});const KT=JT(cc),XT=Fd,HT=JT(RT),ZT=JT(CT),eb=JT(VT),tb=Td;class nb extends KT.default{constructor(e){super(e),this.auditLog=new eb.default;const{invalidationPolicies:t={}}=e;this.entityTypeMap=new ZT.default({auditLog:this.auditLog}),new tb.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new HT.default({auditLog:this.auditLog,policies:t,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:this.evict.bind(this),modify:this.modify.bind(this),readField:this.readField.bind(this)}}),this.cacheResultProcessor=new XT.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this})}}DT.default=nb,function(e){var t=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidationPolicyCacheAuditor=void 0;var n=DT;Object.defineProperty(e,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return t(n).default}})}(ST),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=oc;Object.defineProperty(e,"InvalidationPolicyCache",{enumerable:!0,get:function(){return t.InvalidationPolicyCache}}),Object.defineProperty(e,"makeCachedVar",{enumerable:!0,get:function(){return t.makeCachedVar}});var n=af;Object.defineProperty(e,"ApolloExtensionsClient",{enumerable:!0,get:function(){return n.ApolloExtensionsClient}});var r=GE;Object.defineProperty(e,"useFragment",{enumerable:!0,get:function(){return r.useFragment}}),Object.defineProperty(e,"useFragmentWhere",{enumerable:!0,get:function(){return r.useFragmentWhere}});var i=ST;Object.defineProperty(e,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return i.InvalidationPolicyCacheAuditor}});var o=Zu;Object.defineProperty(e,"InvalidationPolicyEvent",{enumerable:!0,get:function(){return o.InvalidationPolicyEvent}}),Object.defineProperty(e,"RenewalPolicy",{enumerable:!0,get:function(){return o.RenewalPolicy}})}(ic);var rb=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===ib}(e)}(e)};var ib="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function ob(e,t){return!1!==t.clone&&t.isMergeableObject(e)?lb((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function ab(e,t,n){return e.concat(t).map(function(e){return ob(e,n)})}function sb(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function cb(e,t){try{return t in e}catch(e){return!1}}function ub(e,t,n){var r={};return n.isMergeableObject(e)&&sb(e).forEach(function(t){r[t]=ob(e[t],n)}),sb(t).forEach(function(i){(function(e,t){return cb(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(cb(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return lb;var n=t.customMerge(e);return"function"==typeof n?n:lb}(i,n)(e[i],t[i],n):r[i]=ob(t[i],n))}),r}function lb(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||ab,n.isMergeableObject=n.isMergeableObject||rb,n.cloneUnlessOtherwiseSpecified=ob;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):ub(e,t,n):ob(t,n)}lb.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return lb(e,n,t)},{})};var pb=P(lb);const db=["ROOT_QUERY","authenticatedUser","__ref"];class fb extends ic.InvalidationPolicyCache{constructor(e){super(e),this.cacheIdentityKey=db,(null==e?void 0:e.cacheIdentityKey)&&(this.cacheIdentityKey=e.cacheIdentityKey)}}function hb(e){return new fb(e)}function yb(e,t,n){if(!t)return;const r=e.cache.extract(),i=function(e,t){return pb(e,t,{arrayMerge:(e,t)=>[...t,...e.filter(e=>t.every(t=>!rc(e,t)))]})}(n.overrideClient?r:t,n.overrideClient?t:r);e.cache.restore(i),n.broadcast&&e.cache.modify({fields:{}})}function vb(e){const n=e.middlewares||[],r=re({uri:"string"==typeof e.uri?e.uri:e.uri(),headers:e.headers,credentials:"include",fetchOptions:{mode:"cors"}}),i=t.from([...n,r]);return new t.ApolloClient({ssrMode:D(),link:i,cache:hb(e.cacheConfig),defaultContext:e.defaultContext})}function mb(e){return null!=e}function gb(e,t){return e.some(e=>{if(function(e){return"object"==typeof e&&null!==e&&"__ref"in e&&"string"==typeof e.__ref}(e)){const n=e.__ref;return n&&!(n in t)}return!1})}exports.ApolloHelper=class{constructor(e){const{cacheConfig:t}=e,n=x(e,["cacheConfig"]);this._initialApolloOptions=n,this._cacheConfig=t,hi(this,"_getCacheConfig","initializeApollo","generateUseApolloHook")}_getCacheConfig(e){const t={skipOnRead:void 0===e||e};return this._cacheConfig?this._cacheConfig(t):void 0}initializeApollo(e){const t=e||{},{networkOnly:n}=t,r=x(t,["networkOnly"]),i=this._getCacheConfig(n),o=Object.assign(Object.assign(Object.assign({},this._initialApolloOptions),r),{cacheConfig:i});return D()?vb(o):(this._apolloClient||(this._apolloClient=vb(o)),this._apolloClient)}generateUseApolloHook(){const t=this.initializeApollo,n=this._getCacheConfig;return function(r){const[i,o]=e.useState(),a=r[R],s=function(t){const n=e.useRef();return e.useEffect(()=>{n.current=t}),n.current}(a),c=e.useMemo(()=>{const e=t({networkOnly:!1});return a&&!rc(a,s)&&(yb(e,a,{overrideClient:!0,broadcast:!0}),i&&i.persist()),e},[i,s,a]);var u;return u=()=>{!function(){j(this,0,void 0,function*(){const e=hb(n(!1)),t=F(e);yield t.restore();const r=e.cacheIdentityKey,i=Bo(e.extract(),r,null),a=Bo(c.cache.extract(),r,null);a&&rc(a,i)||(yield t.purge(),yield e.reset()),yb(c,e.extract(),{broadcast:!0,overrideClient:!1});const s=F(c.cache);o(s)})}()},e.useEffect(u,[]),{client:c,cachePersistor:i}}}},exports.CachePersistorContext=k,exports.ListHelper=class{constructor(e){this.skipArgName="skip",this.firstArgName="first",this.skipCacheOnRead=!1,(null==e?void 0:e.skipArgName)&&(this.skipArgName=e.skipArgName),(null==e?void 0:e.firstArgName)&&(this.firstArgName=e.firstArgName),(null==e?void 0:e.cacheOptions.skipOnRead)&&(this.skipCacheOnRead=e.cacheOptions.skipOnRead),hi(this,"_readPage","_readAll","_networkOnlyRead","getReadFunction","mergeLists")}_readPage(e,t){var n,r;const i=(null===(n=null==t?void 0:t.args)||void 0===n?void 0:n[this.skipArgName])||0,o=(null===(r=null==t?void 0:t.args)||void 0===r?void 0:r[this.firstArgName])||0;if(!e||e.length<i+o)return;const a=e.slice(i,i+o).filter(mb);return gb(a,t.cache.extract())?void 0:a}_readAll(e,t){if(!e)return;const n=t.cache.extract(),r=e.filter(mb);return gb(r,n)?void 0:r}_networkOnlyRead(){}getReadFunction(e){return this.skipCacheOnRead?this._networkOnlyRead:"paginate"===e?this._readPage:this._readAll}mergeLists(e,t,n){var r,i;const o=e?e.slice(0):[],a=(null===(r=null==n?void 0:n.args)||void 0===r?void 0:r[this.skipArgName])||0,s=(null===(i=null==n?void 0:n.args)||void 0===i?void 0:i[this.firstArgName])||0;o.length<a+s&&(o.length=a+s);for(let e=0;e<Math.max(t.length,s);e++)o[a+e]=e<t.length?t[e]:null;return o}},exports.extractApolloState=function(e,t){return(null==t?void 0:t.props)&&(t.props[R]=e.cache.extract()),t},exports.useCachePersistor=function(){return e.useContext(k)};
//# sourceMappingURL=index.js.map