@plurid/plurid-react-server 0.0.0-0 → 0.0.0-11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/distribution/data/constants/general/index.d.ts +34 -0
  2. package/distribution/data/constants/index.d.ts +1 -29
  3. package/distribution/data/constants/{stiller.d.ts → stiller/index.d.ts} +1 -1
  4. package/distribution/data/interfaces/{external.d.ts → external/index.d.ts} +39 -28
  5. package/distribution/data/interfaces/{internal.d.ts → internal/index.d.ts} +18 -20
  6. package/distribution/data/templates/index.d.ts +1 -0
  7. package/distribution/index.d.ts +3 -2
  8. package/distribution/index.es.js +974 -8790
  9. package/distribution/index.js +1017 -8815
  10. package/distribution/objects/ContentGenerator/index.d.ts +4 -2
  11. package/distribution/objects/LiveServer/index.d.ts +13 -0
  12. package/distribution/objects/Renderer/index.d.ts +7 -8
  13. package/distribution/objects/Renderer/{template.d.ts → template/index.d.ts} +1 -1
  14. package/distribution/objects/Server/index.d.ts +20 -6
  15. package/distribution/objects/Stiller/{__specs__/index.d.ts → __tests__/index.test.d.ts} +0 -0
  16. package/distribution/objects/Stiller/index.d.ts +2 -1
  17. package/distribution/objects/StillsGenerator/index.d.ts +1 -1
  18. package/distribution/objects/StillsManager/index.d.ts +1 -1
  19. package/distribution/utilities/pttp/index.d.ts +6 -0
  20. package/distribution/utilities/{template.d.ts → template/index.d.ts} +3 -2
  21. package/distribution/utilities/{wrapping.d.ts → wrapping/index.d.ts} +2 -4
  22. package/package.json +71 -58
  23. package/distribution/index.es.js.map +0 -1
  24. package/distribution/index.js.map +0 -1
  25. package/distribution/index.min.js +0 -2
  26. package/distribution/index.min.js.map +0 -1
  27. package/distribution/objects/PluridsResponder/index.d.ts +0 -42
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("fs"),t=require("path"),r=require("express"),n=require("compression"),i=require("open"),o=require("styled-components"),s=require("@plurid/plurid-engine"),a=require("@plurid/plurid-react"),u=require("react"),c=require("react-dom/server"),l=require("react-helmet-async"),p=require("child_process"),f=require("detect-port"),h=require("@plurid/plurid-functions"),d=require("puppeteer"),v=require("fast-json-stable-stringify"),y=require("zen-observable"),m=require("graphql-tag");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function g(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var w=b(e),O=b(t),S=b(r),E=b(n),k=b(i),x=b(u),D=b(f),N=b(d),P=b(v),q=b(y),_=b(m),R=function(e,t){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function j(e,t){function r(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var M=function(){return(M=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function Q(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function C(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function T(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function F(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function A(e){return this instanceof A?(this.v=e,this):new A(e)}function V(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.push([e,t,r,n])>1||a(e,t)}))})}function a(e,t){try{(r=i[e](t)).value instanceof A?Promise.resolve(r.value.v).then(u,c):l(o[0][2],r)}catch(e){l(o[0][3],e)}var r}function u(e){a("next",e)}function c(e){a("throw",e)}function l(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}const I={waitUntil:"networkidle0",timeout:3e4,ignore:[]},L=process.env.PORT?parseInt(process.env.PORT):8080,z="Plurid Server",B=!1,$=!0,W=!1,U="build",J="stills",G="/gateway",Y="production"===process.env.ENV_MODE,H=(process.env.ENV_MODE,e=>e.replace(/(?:\r\n|\r|\n)/g," ").replace(/ +/g," ")),K=H("\n<!DOCTYPE html>\n<html>\n <head>\n <title>\n Not Found\n </title>\n </head>\n <body>\n <h1>\n Not Found\n </h1>\n </body>\n</html>\n");class X{constructor(e){const{htmlLanguage:t,htmlAttributes:r,head:n,defaultStyle:i,styles:o,headScripts:s,vendorScriptSource:a,mainScriptSource:u,bodyAttributes:c,content:l,root:p,windowSizerScript:f,defaultPreloadedReduxState:h,reduxState:d,defaultPreloadedPluridMetastate:v,pluridMetastate:y,bodyScripts:m}=e,{gradientBackground:b,gradientForeground:g}=(e=>{var t;const r={gradientBackground:"hsl(220, 10%, 32%)",gradientForeground:"hsl(220, 10%, 18%)"};try{const n=JSON.parse(e),i=null===(t=null==n?void 0:n.themes)||void 0===t?void 0:t.general;if(!i)return r;return{gradientBackground:"dark"===i.type?i.backgroundColorTertiary:i.backgroundColorPrimary,gradientForeground:"dark"===i.type?i.backgroundColorPrimary:i.backgroundColorTertiary}}catch(e){return r}})(d),w=`\n body {\n background: radial-gradient(ellipse at center, ${b} 0%, ${g} 100%);\n height: 100%;\n margin: 0;\n }\n `;this.htmlLanguage=t||"en",this.htmlAttributes=(e=>{if(!e)return"";let t="";for(const[r,n]of Object.entries(e))t+=`${r}="${n}"`;return t})(r)||"",this.head=n||"",this.defaultStyle=null!=i?i:w,this.styles=o,this.headScripts=null!=s?s:"",this.vendorScriptSource=a||"/vendor.js",this.mainScriptSource=u||"/index.js",this.bodyAttributes=c||"",this.root=p||"root",this.content=(e=>e.replace(/="client\//g,'="/'))(l)||"",this.windowSizerScript=null!=f?f:"\n/** PLURID WINDOW SIZER */\nconst pluridRoots = document.querySelectorAll('[data-plurid-entity=\"PluridRoots\"]');\npluridRoots.forEach(pluridRoot => {\n pluridRoot.style.width = window.innerWidth + 'px';\n pluridRoot.style.height = window.innerHeight + 'px';\n});\n",this.defaultPreloadedReduxState=h||"__PRELOADED_REDUX_STATE__",this.reduxState=d.replace(/</g,"\\u003c")||"{}",this.defaultPreloadedPluridMetastate=v||"__PRELOADED_PLURID_METASTATE__",this.pluridMetastate=y||"{}",this.bodyScripts=null!=m?m:""}html(){return(e=>{const{htmlLanguage:t,htmlAttributes:r,head:n,defaultStyle:i,styles:o,headScripts:s,vendorScriptSource:a,mainScriptSource:u,bodyAttributes:c,root:l,content:p,windowSizerScript:f,defaultPreloadedReduxState:h,reduxState:d,defaultPreloadedPluridMetastate:v,pluridMetastate:y,bodyScripts:m}=e;return H(`\n<!DOCTYPE html>\n<html lang="${t}" ${r}>\n <head>\n ${n}\n\n ${i&&`<style>\n ${i}\n </style>`}\n\n ${o}\n\n ${s}\n\n <script src="${a}"><\/script>\n <script defer src="${u}"><\/script>\n </head>\n <body ${c}>\n <div id="${l}">${p}</div>\n\n <script>\n ${f}\n <\/script>\n <script>\n window.${h} = ${d};\n window.${v} = ${y};\n <\/script>\n\n ${m}\n </body>\n</html>\n `)})({htmlLanguage:this.htmlLanguage,htmlAttributes:this.htmlAttributes,head:this.head,defaultStyle:this.defaultStyle,styles:this.styles,headScripts:this.headScripts,vendorScriptSource:this.vendorScriptSource,mainScriptSource:this.mainScriptSource,bodyAttributes:this.bodyAttributes,root:this.root,content:this.content,windowSizerScript:this.windowSizerScript,defaultPreloadedReduxState:this.defaultPreloadedReduxState,reduxState:this.reduxState,defaultPreloadedPluridMetastate:this.defaultPreloadedPluridMetastate,pluridMetastate:this.pluridMetastate,bodyScripts:this.bodyScripts})}}const Z=(e,t,r)=>class extends x.default.Component{constructor(e){super(e)}render(){return x.default.createElement(e,Object.assign({},r),x.default.createElement(t,null))}};class ee{constructor(e){this.data=e}render(){var e,t;return C(this,void 0,void 0,(function*(){const{pluridMetastate:r,matchedRoute:n,routes:i,exterior:s,shell:u,gateway:p,gatewayEndpoint:f,gatewayQuery:h,servicesData:d,helmet:v,services:y,stylesheet:m,preserveResult:b}=this.data;let g;b&&(g=null===(e=b.providers)||void 0===e?void 0:e.redux);const w=null==d?void 0:d.reduxStore,O=null!==(t=null!=g?g:null==d?void 0:d.reduxStoreValue)&&void 0!==t?t:{},S=null==d?void 0:d.apolloClient;let E=Z(l.HelmetProvider,(()=>x.default.createElement(a.PluridProvider,{metastate:r},x.default.createElement(a.PluridRouterStatic,{path:n.pathname,routes:i,exterior:s,shell:u,gateway:p,gatewayEndpoint:f,gatewayQuery:h}))),{context:v});const k=yield this.importProviders();for(const e of y)switch(e){case"Redux":E=Z(k.ReduxProvider,E,{store:w(O),context:null==d?void 0:d.reduxContext});break;case"Apollo":E=Z(k.ApolloProvider,E,{client:S});break;case"Stripe":E=Z(k.StripeProvider,E,{stripe:null})}return c.renderToString(x.default.createElement(o.StyleSheetManager,{sheet:m.instance},x.default.createElement(E,null)))}))}importProviders(){return C(this,void 0,void 0,(function*(){let e,t,r;for(const n of this.data.services)switch(n){case"Redux":e=(yield Promise.resolve().then((function(){return g(require("react-redux"))}))).Provider;break;case"Apollo":r=(yield Promise.resolve().then((function(){return wi}))).ApolloProvider;break;case"Stripe":t=(yield Promise.resolve().then((function(){return g(require("react-stripe-elements"))}))).StripeProvider}return{ReduxProvider:e,ApolloProvider:r,StripeProvider:t}}))}}class te{constructor(){this.plurids=new Map,this.findPlurids()}search(e){if(e)return""}findPlurids(){}}class re{constructor(e){this.stills=new Map,this.options=e,this.findStills()}get(e){const t=this.stills.get(e);if(t)return t.html}findStills(){return C(this,void 0,void 0,(function*(){const{buildDirectory:t,stillsDirectory:r}=this.options,n=`${t}/${r}`,i=O.default.join(process.cwd(),n);if(e.existsSync(i))try{const t=O.default.join(i,"metadata.json"),r=yield e.promises.readFile(t,"utf-8"),n=JSON.parse(r);if(!Array.isArray(n))return;for(const t of n){const r=O.default.join(i,t.name),n=yield e.promises.readFile(r,"utf-8"),o=JSON.parse(n);o&&this.stills.set(o.route,o)}}catch(e){if("none"!==this.options.debug&&!this.options.quiet){const t="Plurid Server Error: Could not read stills.";"error"===this.options.debug?console.error(t,e):console.log(t)}return}}))}}const{default:ne,URLRouter:ie}=s.router;class oe{constructor(e){const{routes:t,preserves:r,helmet:n,styles:i,middleware:o,exterior:s,shell:a,services:u,servicesData:c,options:l,template:p}=e;this.routes=t,this.preserves=r,this.helmet=n,this.styles=i||[],this.middleware=o||[],this.exterior=s,this.shell=a,this.services=u||[],this.servicesData=c,this.options=this.handleOptions(l),this.template=p,this.serverApplication=S.default(),this.port=L,this.configureServer(),this.computeApplication(),process.addListener("SIGINT",(()=>{this.stop(),process.exit(0)}))}static analysis(e){return{routes:e.routes,options:e.options}}start(e=this.port){this.port=e;const t=`http://localhost:${e}`;return this.options.quiet||console.info(`\n\t${this.options.serverName} Started on Port ${e}: ${t}\n`),this.server=this.serverApplication.listen(e),this.open(t),this.server}stop(){this.options.quiet||console.info(`\n\t${this.options.serverName} Closed on Port ${this.port}\n`),this.server&&this.server.close()}handle(){return{post:(e,...t)=>(this.serverApplication.post(e,...t),this.serverApplication),patch:(e,...t)=>(this.serverApplication.patch(e,...t),this.serverApplication),put:(e,...t)=>(this.serverApplication.put(e,...t),this.serverApplication),delete:(e,...t)=>(this.serverApplication.delete(e,...t),this.serverApplication)}}instance(){return this.serverApplication}computeApplication(){this.loadMiddleware();const e=this.routes.map((e=>{const{value:t,parameters:r}=e;return{value:t,parameters:r}})),t=new ie(e),r=new re(this.options),n=new ne(this.routes);new te;this.serverApplication.get("*",((e,i,o)=>C(this,void 0,void 0,(function*(){var s,a,u;const c=e.path;for(const e of this.options.ignore){if(c===e)return void o();if(e.includes("/*")){const t=e.replace("/*","");if(c.startsWith(t))return void o()}}const l=t.match(e.originalUrl);let p,f,h,d;if(null==l?void 0:l.target){const e=this.preserves.find((e=>"*"===e.serve)),t=e||this.preserves.find((e=>e.serve===l.target));t&&(p=t.onServe,f=t.afterServe,h=t.onError)}if(p&&l){const t={request:e,response:i,context:{contextualizers:void 0,path:e.originalUrl,match:l}};try{if(d=yield p(t),d&&d.responded)return}catch(e){if(h){const r=yield h(e,t);if(r){if(r.responded)return;if(!r.depreserve)return}}}}const{gatewayEndpoint:v}=this.options;if(c===v){const t={path:{value:v},pathname:v,parameters:{},query:{__gatewayQuery:e.originalUrl},fragments:{texts:[],elements:[]},route:v};return this.renderer=yield this.renderApplication(t,d),void i.send(null===(s=this.renderer)||void 0===s?void 0:s.html())}let y;d&&(y=d.redirect);const m=y||c,b=n.match(m);if(!b){const e=r.get("/not-found");if(e)return void i.status(404).send(e);const t=n.match("/not-found");return t?(this.renderer=yield this.renderApplication(t,d),void i.send(null===(a=this.renderer)||void 0===a?void 0:a.html())):void i.status(404).send(K)}this.renderer=yield this.renderApplication(b,d),i.send(null===(u=this.renderer)||void 0===u?void 0:u.html())}))))}renderApplication(e,t){var r,n,i,o,s,u,c,l,p,f,h,d,v,y,m,b,g;return C(this,void 0,void 0,(function*(){const w=a.serverComputeMetastate(e,this.routes),{content:O,styles:S}=yield this.getContentAndStyles(e,w,t),E=S+this.styles.reduce(((e,t)=>e+t),""),{helmet:k}=this.helmet,x=`\n ${k.meta.toString()}\n ${k.title.toString()}\n ${k.base.toString()}\n ${k.link.toString()}\n ${k.style.toString()}\n ${k.noscript.toString()}\n ${k.script.toString()}\n `,D=(k.htmlAttributes.toString(),k.bodyAttributes.toString());let N;t&&(N=null===(r=t.providers)||void 0===r?void 0:r.redux);const P=(null===(n=this.servicesData)||void 0===n?void 0:n.reduxStore)?JSON.stringify(null===(i=this.servicesData)||void 0===i?void 0:i.reduxStore(null!==(s=null!=N?N:null===(o=this.servicesData)||void 0===o?void 0:o.reduxStoreValue)&&void 0!==s?s:{}).getState()):"",q=((null===(u=this.template)||void 0===u?void 0:u.headScripts)||"")+"\n"+((null===(c=this.servicesData)||void 0===c?void 0:c.stripeScript)||"");return new X({htmlLanguage:null===(l=this.template)||void 0===l?void 0:l.htmlLanguage,htmlAttributes:null===(p=this.template)||void 0===p?void 0:p.htmlAttributes,head:x,defaultStyle:null===(f=this.template)||void 0===f?void 0:f.defaultStyle,styles:E,headScripts:q,vendorScriptSource:null===(h=this.template)||void 0===h?void 0:h.vendorScriptSource,mainScriptSource:null===(d=this.template)||void 0===d?void 0:d.mainScriptSource,bodyAttributes:D,content:O,root:null===(v=this.template)||void 0===v?void 0:v.root,windowSizerScript:null===(y=this.template)||void 0===y?void 0:y.windowSizerScript,defaultPreloadedReduxState:null===(m=this.template)||void 0===m?void 0:m.defaultPreloadedReduxState,reduxState:P,defaultPreloadedPluridMetastate:null===(b=this.template)||void 0===b?void 0:b.defaultPreloadedPluridMetastate,pluridMetastate:JSON.stringify(w),bodyScripts:null===(g=this.template)||void 0===g?void 0:g.bodyScripts})}))}getContentAndStyles(e,t,r){return C(this,void 0,void 0,(function*(){const n=new o.ServerStyleSheet;let i="",s="";try{const o="/gateway"===e.pathname,a=e.query.__gatewayQuery,{gatewayEndpoint:u}=this.options,c=new ee({services:this.services,servicesData:this.servicesData,stylesheet:n,exterior:this.exterior,shell:this.shell,helmet:this.helmet,matchedRoute:e,routes:this.routes,pluridMetastate:t,gateway:o,gatewayEndpoint:u,gatewayQuery:a,preserveResult:r});i=yield c.render(),s=n.getStyleTags()}catch(e){if("none"!==this.options.debug&&!this.options.quiet){const t=`${this.options.serverName} Error: Something went wrong in getContentAndStyles().`;"error"===this.options.debug?console.error(t,e):console.log(t)}return{content:"",styles:""}}finally{n.seal()}return{content:i,styles:s}}))}handleOptions(e){var t,r;return{serverName:(null==e?void 0:e.serverName)||z,quiet:(null==e?void 0:e.quiet)||B,debug:(null==e?void 0:e.debug)||Y?"error":"info",compression:null!==(t=null==e?void 0:e.compression)&&void 0!==t?t:$,open:null!==(r=null==e?void 0:e.open)&&void 0!==r?r:W,buildDirectory:(null==e?void 0:e.buildDirectory)||U,gatewayEndpoint:(null==e?void 0:e.gatewayEndpoint)||G,staticCache:(null==e?void 0:e.staticCache)||0,ignore:(null==e?void 0:e.ignore)||[],stillsDirectory:(null==e?void 0:e.stillsDirectory)||J,stiller:(null==e?void 0:e.stiller)||I}}configureServer(){const e=O.default.join(this.options.buildDirectory,"./client");this.serverApplication.disable("x-powered-by"),this.options.compression&&(this.serverApplication.use(E.default()),this.serverApplication.get("/vendor.js",((t,r,n)=>{r.setHeader("Content-Type","application/javascript");const i=w.default.existsSync(O.default.join(e,"vendor.js.br")),o=t.header("Accept-Encoding");if((null==o?void 0:o.includes("br"))&&i)return t.url+=".br",r.set("Content-Encoding","br"),void n();n()}))),this.serverApplication.use(S.default.static(e,{maxAge:this.options.staticCache}))}loadMiddleware(){for(const e of this.middleware)this.serverApplication.use(((t,r,n)=>e(t,r,n)))}open(e){try{if("false"===process.env.PLURID_OPEN)return;this.options.open&&k.default(e)}catch(e){return}}}const se=(e,t,r)=>C(void 0,void 0,void 0,(function*(){const n=Date.now(),i=yield N.default.launch({defaultViewport:{width:1366,height:768},headless:!0,args:0==process.getuid()?["--no-sandbox"]:void 0}),o=yield i.newPage();try{const n=e+t;yield o.goto(n,{waitUntil:r.waitUntil,timeout:r.timeout})}catch(e){throw new Error(`${t} timed out.`)}const s=(e=>e.replace("width: 1366px; height: 768px;","width: 0px; height: 0px;"))(yield o.content());yield i.close();const a=Date.now()-n;return console.info(`\tStilled '${t}' in ${(a/1e3).toFixed(2)} seconds.`),{route:t,html:s,stilltime:a}}));class ae{constructor(e){const{host:t,routes:r,configuration:n}=e;this.host=t,this.routes=r,this.configuration=n}still(){return V(this,arguments,(function*(){for(const e of this.routes)yield yield A(yield A(se(this.host,e,this.configuration)))}))}}!function(e){function t(){var t=this||self;t.globalThis=t,delete e.prototype._T_}"object"!=typeof globalThis&&(this?t():(e.defineProperty(e.prototype,"_T_",{configurable:!0,get:t}),_T_))}(Object);var ue=globalThis,ce=Object.setPrototypeOf,le=void 0===ce?function(e,t){return e.__proto__=t,e}:ce,pe=function(e){function t(r){void 0===r&&(r="Invariant Violation");var n=e.call(this,"number"==typeof r?"Invariant Violation: "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name="Invariant Violation",le(n,t.prototype),n}return j(t,e),t}(Error);function fe(e,t){if(!e)throw new pe(t)}var he=["log","warn","error","silent"],de=he.indexOf("log");function ve(e){return function(){if(he.indexOf(e)>=de)return console[e].apply(console,arguments)}}function ye(e){var t=he[de];return de=Math.max(0,he.indexOf(e)),t}!function(e){e.log=ve("log"),e.warn=ve("warn"),e.error=ve("error")}(fe||(fe={}));var me=ue.process||{env:{}};if(!ue.process)try{Object.defineProperty(ue,"process",{value:me})}catch(e){}var be="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function ge(e){var t=e.prototype.toJSON;"function"==typeof t||function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,be&&(e.prototype[be]=t)}function we(e){return null!=e&&"string"==typeof e.kind}function Oe(e){return(Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}ge(function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}()),ge(function(){function e(e,t,r,n,i,o,s){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=s,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}());function Se(e){return Ee(e,[])}function Ee(e,t){switch(Oe(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(be)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==n){var i=n.call(e);if(i!==e)return"string"==typeof i?i:Ee(i,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],o=0;o<r;++o)i.push(Ee(e[o],t));1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+Ee(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}var ke={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"]},xe=Object.freeze({});function De(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ke,n=void 0,i=Array.isArray(e),o=[e],s=-1,a=[],u=void 0,c=void 0,l=void 0,p=[],f=[],h=e;do{var d=++s===o.length,v=d&&0!==a.length;if(d){if(c=0===f.length?void 0:p[p.length-1],u=l,l=f.pop(),v){if(i)u=u.slice();else{for(var y={},m=0,b=Object.keys(u);m<b.length;m++){var g=b[m];y[g]=u[g]}u=y}for(var w=0,O=0;O<a.length;O++){var S=a[O][0],E=a[O][1];i&&(S-=w),i&&null===E?(u.splice(S,1),w++):u[S]=E}}s=n.index,o=n.keys,a=n.edits,i=n.inArray,n=n.prev}else{if(c=l?i?s:o[s]:void 0,null==(u=l?l[c]:h))continue;l&&p.push(c)}var k,x=void 0;if(!Array.isArray(u)){if(!we(u))throw new Error("Invalid AST Node: ".concat(Se(u),"."));var D=Ne(t,u.kind,d);if(D){if((x=D.call(t,u,c,l,p,f))===xe)break;if(!1===x){if(!d){p.pop();continue}}else if(void 0!==x&&(a.push([c,x]),!d)){if(!we(x)){p.pop();continue}u=x}}}if(void 0===x&&v&&a.push([c,u]),d)p.pop();else n={inArray:i,index:s,keys:o,edits:a,prev:n},o=(i=Array.isArray(u))?u:null!==(k=r[u.kind])&&void 0!==k?k:[],s=-1,a=[],l&&f.push(l),l=u}while(void 0!==n);return 0!==a.length&&(h=a[a.length-1][1]),h}function Ne(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var o=r?e.leave:e.enter;if(o){if("function"==typeof o)return o;var s=o[t];if("function"==typeof s)return s}}}function Pe(e){return De(e,{leave:qe})}var qe={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return Re(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=Me("(",Re(e.variableDefinitions,", "),")"),i=Re(e.directives," "),o=e.selectionSet;return r||i||n||"query"!==t?Re([t,Re([r,n]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+Me(" = ",n)+Me(" ",Re(i," "))},SelectionSet:function(e){return je(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,o=e.selectionSet,s=Me("",t,": ")+r,a=s+Me("(",Re(n,", "),")");return a.length>80&&(a=s+Me("(\n",Qe(Re(n,"\n")),"\n)")),Re([a,Re(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+Me(" ",Re(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return Re(["...",Me("on ",t),Re(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(Me("(",Re(n,", "),")")," ")+"on ".concat(r," ").concat(Me("",Re(i," ")," "))+o},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],s="\\"===e[e.length-1],a=!n||o||s||r,u="";return!a||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,a&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+Re(e.values,", ")+"]"},ObjectValue:function(e){return"{"+Re(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+Me("(",Re(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:_e((function(e){var t=e.directives,r=e.operationTypes;return Re(["schema",Re(t," "),je(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:_e((function(e){return Re(["scalar",e.name,Re(e.directives," ")]," ")})),ObjectTypeDefinition:_e((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return Re(["type",t,Me("implements ",Re(r," & ")),Re(n," "),je(i)]," ")})),FieldDefinition:_e((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(Te(r)?Me("(\n",Qe(Re(r,"\n")),"\n)"):Me("(",Re(r,", "),")"))+": "+n+Me(" ",Re(i," "))})),InputValueDefinition:_e((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return Re([t+": "+r,Me("= ",n),Re(i," ")]," ")})),InterfaceTypeDefinition:_e((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return Re(["interface",t,Me("implements ",Re(r," & ")),Re(n," "),je(i)]," ")})),UnionTypeDefinition:_e((function(e){var t=e.name,r=e.directives,n=e.types;return Re(["union",t,Re(r," "),n&&0!==n.length?"= "+Re(n," | "):""]," ")})),EnumTypeDefinition:_e((function(e){var t=e.name,r=e.directives,n=e.values;return Re(["enum",t,Re(r," "),je(n)]," ")})),EnumValueDefinition:_e((function(e){return Re([e.name,Re(e.directives," ")]," ")})),InputObjectTypeDefinition:_e((function(e){var t=e.name,r=e.directives,n=e.fields;return Re(["input",t,Re(r," "),je(n)]," ")})),DirectiveDefinition:_e((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(Te(r)?Me("(\n",Qe(Re(r,"\n")),"\n)"):Me("(",Re(r,", "),")"))+(n?" repeatable":"")+" on "+Re(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return Re(["extend schema",Re(t," "),je(r)]," ")},ScalarTypeExtension:function(e){return Re(["extend scalar",e.name,Re(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return Re(["extend type",t,Me("implements ",Re(r," & ")),Re(n," "),je(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return Re(["extend interface",t,Me("implements ",Re(r," & ")),Re(n," "),je(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return Re(["extend union",t,Re(r," "),n&&0!==n.length?"= "+Re(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return Re(["extend enum",t,Re(r," "),je(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return Re(["extend input",t,Re(r," "),je(n)]," ")}};function _e(e){return function(t){return Re([t.description,e(t)],"\n")}}function Re(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function je(e){return Me("{\n",Qe(Re(e,"\n")),"\n}")}function Me(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+r:""}function Qe(e){return Me(" ",e.replace(/\n/g,"\n "))}function Ce(e){return-1!==e.indexOf("\n")}function Te(e){return null!=e&&e.some(Ce)}function Fe(e,t){var r=e.directives;return!r||!r.length||function(e){var t=[];e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var r=e.arguments,n=e.name.value;"production"===process.env.NODE_ENV?fe(r&&1===r.length,39):fe(r&&1===r.length,"Incorrect number of arguments for the @"+n+" directive.");var i=r[0];"production"===process.env.NODE_ENV?fe(i.name&&"if"===i.name.value,40):fe(i.name&&"if"===i.name.value,"Invalid argument for the @"+n+" directive.");var o=i.value;"production"===process.env.NODE_ENV?fe(o&&("Variable"===o.kind||"BooleanValue"===o.kind),41):fe(o&&("Variable"===o.kind||"BooleanValue"===o.kind),"Argument for the @"+n+" directive must be a variable or a boolean value."),t.push({directive:e,ifArgument:i})}}));return t}(r).every((function(e){var r=e.directive,n=e.ifArgument,i=!1;return"Variable"===n.value.kind?(i=t&&t[n.value.name.value],"production"===process.env.NODE_ENV?fe(void 0!==i,38):fe(void 0!==i,"Invalid variable referenced in @"+r.name.value+" directive.")):i=n.value.value,"skip"===r.name.value?!i:i}))}function Ae(e,t){return function(e){var t=[];return De(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function Ve(e){return e&&Ae(["client"],e)&&Ae(["export"],e)}function Ie(e,t){var r=t,n=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw"production"===process.env.NODE_ENV?new pe(42):new pe("Found a "+e.operation+" operation"+(e.name?" named '"+e.name.value+"'":"")+". No operations are allowed when using a fragment as a query. Only fragments are allowed.");"FragmentDefinition"===e.kind&&n.push(e)})),void 0===r&&("production"===process.env.NODE_ENV?fe(1===n.length,43):fe(1===n.length,"Found "+n.length+" fragments. `fragmentName` must be provided when there is not exactly 1 fragment."),r=n[0].name.value),M(M({},e),{definitions:F([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function Le(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function ze(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=t&&t[e.name.value];return"production"===process.env.NODE_ENV?fe(r,44):fe(r,"No fragment named "+e.name.value+"."),r;default:return null}}function Be(e){return{__ref:String(e)}}function $e(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function We(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var i={};r.fields.map((function(e){return We(i,e.name,e.value,n)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return We(r,t,e,n),r[t.value]}));else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw"production"===process.env.NODE_ENV?new pe(53):new pe('The inline argument "'+t.value+'" of kind "'+r.kind+'"is not supported. Use variables instead of inline arguments to overcome this limitation.');e[t.value]=null}}var Ue=["connection","include","skip","client","rest","export"];function Je(e,t,r){if(t&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),r.connection.key+"("+JSON.stringify(i)+")"}return r.connection.key}var o=e;if(t){var s=P.default(t);o+="("+s+")"}return r&&Object.keys(r).forEach((function(e){-1===Ue.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?o+="@"+e+"("+JSON.stringify(r[e])+")":o+="@"+e)})),o}function Ge(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return We(r,n,i,t)})),r}return null}function Ye(e){return e.alias?e.alias.value:e.name.value}function He(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n<i.length;n++){var o=i[n];if(Ke(o)){if("__typename"===o.name.value)return e[Ye(o)]}else{var s=He(e,ze(o,r).selectionSet,r);if("string"==typeof s)return s}}}function Ke(e){return"Field"===e.kind}function Xe(e){return"InlineFragment"===e.kind}function Ze(e){"production"===process.env.NODE_ENV?fe(e&&"Document"===e.kind,45):fe(e&&"Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql');var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw"production"===process.env.NODE_ENV?new pe(46):new pe('Schema type definitions not allowed in queries. Found: "'+e.kind+'"');return e}));return"production"===process.env.NODE_ENV?fe(t.length<=1,47):fe(t.length<=1,"Ambiguous GraphQL document: contains "+t.length+" operations"),e}function et(e){return Ze(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function tt(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function rt(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function nt(e){var t;Ze(e);for(var r=0,n=e.definitions;r<n.length;r++){var i=n[r];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw"production"===process.env.NODE_ENV?new pe(52):new pe("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.")}function it(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach((function(e){e.defaultValue&&We(t,e.variable.name,e.defaultValue)})),t}function ot(e,t,r){var n=0;return e.forEach((function(r,i){t.call(this,r,i,e)&&(e[n++]=r)}),r),e.length=n,e}var st={kind:"Field",name:{kind:"Name",value:"__typename"}};function at(e,t){return e.selectionSet.selections.every((function(e){return"FragmentSpread"===e.kind&&at(t[e.name.value],t)}))}function ut(e){return at(et(e)||function(e){"production"===process.env.NODE_ENV?fe("Document"===e.kind,49):fe("Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'),"production"===process.env.NODE_ENV?fe(e.definitions.length<=1,50):fe(e.definitions.length<=1,"Fragment must have exactly one definition.");var t=e.definitions[0];return"production"===process.env.NODE_ENV?fe("FragmentDefinition"===t.kind,51):fe("FragmentDefinition"===t.kind,"Must be a fragment definition."),t}(e),Le(rt(e)))?null:e}function ct(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function lt(e,t){var r=Object.create(null),n=[],i=Object.create(null),o=[],s=ut(De(t,{Variable:{enter:function(e,t,n){"VariableDefinition"!==n.kind&&(r[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&(e.some((function(e){return e.remove}))&&t.directives&&t.directives.some(ct(e))))return t.arguments&&t.arguments.forEach((function(e){"Variable"===e.value.kind&&n.push({name:e.value.name.value})})),t.selectionSet&&ht(t.selectionSet).forEach((function(e){o.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){i[e.name.value]=!0}},Directive:{enter:function(t){if(ct(e)(t))return null}}}));return s&&ot(n,(function(e){return!!e.name&&!r[e.name]})).length&&(s=function(e,t){var r=function(e){return function(t){return e.some((function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))}))}}(e);return ut(De(t,{OperationDefinition:{enter:function(t){return M(M({},t),{variableDefinitions:t.variableDefinitions?t.variableDefinitions.filter((function(t){return!e.some((function(e){return e.name===t.variable.name.value}))})):[]})}},Field:{enter:function(t){if(e.some((function(e){return e.remove}))){var n=0;if(t.arguments&&t.arguments.forEach((function(e){r(e)&&(n+=1)})),1===n)return null}}},Argument:{enter:function(e){if(r(e))return null}}}))}(n,s)),s&&ot(o,(function(e){return!!e.name&&!i[e.name]})).length&&(s=function(e,t){function r(t){if(e.some((function(e){return e.name===t.name.value})))return null}return ut(De(t,{FragmentSpread:{enter:r},FragmentDefinition:{enter:r}}))}(o,s)),s}function pt(e){return De(Ze(e),{SelectionSet:{enter:function(e,t,r){if(!r||"OperationDefinition"!==r.kind){var n=e.selections;if(n)if(!n.some((function(e){return Ke(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=r;if(!(Ke(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return M(M({},e),{selections:F(n,[st])})}}}}})}pt.added=function(e){return e===st};var ft={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||"production"===process.env.NODE_ENV||fe.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}};function ht(e){var t=[];return e.selections.forEach((function(e){(Ke(e)||Xe(e))&&e.selectionSet?ht(e.selectionSet).forEach((function(e){return t.push(e)})):"FragmentSpread"===e.kind&&t.push(e)})),t}function dt(e){return"query"===nt(e).operation?e:De(e,{OperationDefinition:{enter:function(e){return M(M({},e),{operation:"query"})}}})}var vt=Object.prototype.hasOwnProperty;function yt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return mt(e)}function mt(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new wt,i=1;i<r;++i)t=n.merge(t,e[i]);return t}function bt(e){return null!==e&&"object"==typeof e}var gt=function(e,t,r){return this.merge(e[r],t[r])},wt=function(){function e(e){void 0===e&&(e=gt),this.reconciler=e,this.isObject=bt,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var r=this,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return bt(t)&&bt(e)?(Object.keys(t).forEach((function(i){if(vt.call(e,i)){var o=e[i];if(t[i]!==o){var s=r.reconciler.apply(r,F([e,t,i],n));s!==o&&((e=r.shallowCopyForMerge(e))[i]=s)}}else(e=r.shallowCopyForMerge(e))[i]=t[i]})),e):t},e.prototype.shallowCopyForMerge=function(e){return bt(e)&&!this.pastCopies.has(e)&&(e=Array.isArray(e)?e.slice(0):M({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e)),e},e}();!function(e){var t,r=e.Symbol;if("function"==typeof r)if(r.observable)t=r.observable;else{t=r.for("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch(e){}}else t="@@observable"}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")());q.default.prototype["@@observable"]=function(){return this};var Ot=Object.prototype.toString;function St(e){return Et(e)}function Et(e,t){switch(Ot.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach((function(e,n){r[n]=Et(e,t)})),r;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach((function(r){n[r]=Et(e[r],t)})),n;default:return e}}function kt(e){return("undefined"!=typeof process&&process.env.NODE_ENV?process.env.NODE_ENV:"development")===e}function xt(e){return null!==e&&"object"==typeof e}function Dt(e){var t,r;return"production"===process.env.NODE_ENV||!0!==kt("development")&&!0!==kt("test")||(t=e,(r=new Set([t])).forEach((function(e){xt(e)&&(Object.isFrozen(e)||Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){xt(e[t])&&r.add(e[t])})))}))),e}function Nt(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function Pt(e,t,r){return new q.default((function(n){var i=n.next,o=n.error,s=n.complete,a=0,u=!1;function c(e,t){return e?function(t){++a,new Promise((function(r){return r(e(t))})).then((function(e){--a,i&&i.call(n,e),u&&l.complete()}),(function(e){--a,o&&o.call(n,e)}))}:function(e){return t&&t.call(n,e)}}var l={next:c(t,i),error:c(r,o),complete:function(){u=!0,a||s&&s.call(n)}},p=e.subscribe(l);return function(){return p.unsubscribe()}}))}function qt(e){return e&&"function"==typeof e.then}var _t=function(e){function t(t){var r=e.call(this,(function(e){return r.addObserver(e),function(){return r.removeObserver(e)}}))||this;return r.observers=new Set,r.addCount=0,r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),r.handlers={next:function(e){null!==r.sub&&(r.latest=["next",e],Nt(r.observers,"next",e))},error:function(e){var t=r.sub;null!==t&&(t&&Promise.resolve().then((function(){return t.unsubscribe()})),r.sub=null,r.latest=["error",e],r.reject(e),Nt(r.observers,"error",e))},complete:function(){if(null!==r.sub){var e=r.sources.shift();e?qt(e)?e.then((function(e){return r.sub=e.subscribe(r.handlers)})):r.sub=e.subscribe(r.handlers):(r.sub=null,r.latest&&"next"===r.latest[0]?r.resolve(r.latest[1]):r.resolve(),Nt(r.observers,"complete"))}}},r.cancel=function(e){r.reject(e),r.sources=[],r.handlers.complete()},r.promise.catch((function(e){})),qt(t)?t.then((function(e){return r.start(e)}),r.handlers.error):r.start(t),r}return j(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],r=e[t];r&&r.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e),++this.addCount)},t.prototype.removeObserver=function(e,t){this.observers.delete(e)&&--this.addCount<1&&!t&&this.handlers.error(new Error("Observable cancelled prematurely"))},t.prototype.cleanup=function(e){var t=this,r=!1,n=function(){r||(r=!0,t.observers.delete(i),e())},i={next:n,error:n,complete:n},o=this.addCount;this.addObserver(i),this.addCount=o},t}(q.default);function Rt(e){return Array.isArray(e)&&e.length>0}function jt(e){return e.errors&&e.errors.length>0||!1}"function"==typeof Symbol&&Symbol.species&&Object.defineProperty(_t,Symbol.species,{value:q.default});var Mt="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product);function Qt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];void 0!==n&&(r[t]=n)}))})),r}function Ct(e){return new q.default((function(t){t.error(e)}))}var Tt=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function Ft(e,t){return t?t(e):q.default.of()}function At(e){return"function"==typeof e?new Lt(e):e}function Vt(e){return e.request.length<=1}var It=function(e){function t(t,r){var n=e.call(this,t)||this;return n.link=r,n}return j(t,e),t}(Error),Lt=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return q.default.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(At).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,r,n){var i=At(r),o=At(n||new e(Ft));return Vt(i)&&Vt(o)?new e((function(e){return t(e)?i.request(e)||q.default.of():o.request(e)||q.default.of()})):new e((function(e,r){return t(e)?i.request(e,r)||q.default.of():o.request(e,r)||q.default.of()}))},e.execute=function(e,t){return e.request(function(e,t){var r=M({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){r=M(M({},r),"function"==typeof e?e(r):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return M({},r)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?tt(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw"production"===process.env.NODE_ENV?new pe(26):new pe("illegal argument: "+i)}return e}(t))))||q.default.of()},e.concat=function(t,r){var n=At(t);if(Vt(n))return"production"===process.env.NODE_ENV||fe.warn(new It("You are calling concat on a terminating link, which will have no effect",n)),n;var i=At(r);return Vt(i)?new e((function(e){return n.request(e,(function(e){return i.request(e)||q.default.of()}))||q.default.of()})):new e((function(e,t){return n.request(e,(function(e){return i.request(e,t)||q.default.of()}))||q.default.of()}))},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(Ft)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw"production"===process.env.NODE_ENV?new pe(21):new pe("request is not implemented")},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),zt=Lt.empty,Bt=Lt.from,$t=Lt.split,Wt=Lt.concat,Ut=Lt.execute,Jt=Object.prototype.hasOwnProperty;function Gt(e){return function(t){return t.text().then((function(e){try{return JSON.parse(e)}catch(n){var r=n;throw r.name="ServerParseError",r.response=t,r.statusCode=t.status,r.bodyText=e,r}})).then((function(r){return t.status>=300&&Tt(t,r,"Response not successful: Received status code "+t.status),Array.isArray(r)||Jt.call(r,"data")||Jt.call(r,"errors")||Tt(t,r,"Server response was missing for query '"+(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName)+"'."),r}))}}var Yt=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n="production"===process.env.NODE_ENV?new pe(23):new pe("Network request failed. "+t+" is not serializable: "+e.message);throw n.parseError=e,n}return r},Ht={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},Kt=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=M(M({},t.options),{headers:t.headers,credentials:t.credentials}),o=t.http||{};r.forEach((function(e){i=M(M(M({},i),e.options),{headers:M(M({},i.headers),e.headers)}),e.credentials&&(i.credentials=e.credentials),o=M(M({},o),e.http)}));var s=e.operationName,a=e.extensions,u=e.variables,c=e.query,l={operationName:s,variables:u};return o.includeExtensions&&(l.extensions=a),o.includeQuery&&(l.query=Pe(c)),{options:i,body:l}},Xt=function(e){if(!e&&"undefined"==typeof fetch)throw"production"===process.env.NODE_ENV?new pe(22):new pe("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n ")},Zt=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}},er=function(e,t){var r=e.getContext().uri;return r||("function"==typeof t?t(e):t||"/graphql")};function tr(e,t){var r=[],n=function(e,t){r.push(e+"="+encodeURIComponent(t))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=Yt(t.variables,"Variables map")}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var o=void 0;try{o=Yt(t.extensions,"Extensions map")}catch(e){return{parseError:e}}n("extensions",o)}var s="",a=e,u=e.indexOf("#");-1!==u&&(s=e.substr(u),a=e.substr(0,u));var c=-1===a.indexOf("?")?"?":"&";return{newURI:a+c+r.join("&")+s}}var rr=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,n=e.fetch,i=e.includeExtensions,o=e.useGETForQueries,s=e.includeUnusedVariables,a=void 0!==s&&s,u=Q(e,["uri","fetch","includeExtensions","useGETForQueries","includeUnusedVariables"]);Xt(n),n||(n=fetch);var c={http:{includeExtensions:i},options:u.fetchOptions,credentials:u.credentials,headers:u.headers};return new Lt((function(e){var t=er(e,r),i=e.getContext(),s={};if(i.clientAwareness){var u=i.clientAwareness,l=u.name,p=u.version;l&&(s["apollographql-client-name"]=l),p&&(s["apollographql-client-version"]=p)}var f,h=M(M({},s),i.headers),d={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:h},v=Kt(e,Ht,c,d),y=v.options,m=v.body;if(m.variables&&!a){var b=new Set(Object.keys(m.variables));De(e.query,{Variable:function(e,t,r){r&&"VariableDefinition"!==r.kind&&b.delete(e.name.value)}}),b.size&&(m.variables=M({},m.variables),b.forEach((function(e){delete m.variables[e]})))}if(!y.signal){var g=Zt(),w=g.controller,O=g.signal;(f=w)&&(y.signal=O)}if(o&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(y.method="GET"),"GET"===y.method){var S=tr(t,m),E=S.newURI,k=S.parseError;if(k)return Ct(k);t=E}else try{y.body=Yt(m,"Payload")}catch(k){return Ct(k)}return new q.default((function(r){return n(t,y).then((function(t){return e.setContext({response:t}),t})).then(Gt(e)).then((function(e){return r.next(e),r.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&r.next(e.result),r.error(e))})),function(){f&&f.abort()}}))}))},nr=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,rr(t).request)||this;return r.options=t,r}return j(t,e),t}(Lt),ir=Object.prototype,or=ir.toString,sr=ir.hasOwnProperty,ar=Function.prototype.toString,ur=new Map;function cr(e,t){try{return lr(e,t)}finally{ur.clear()}}function lr(e,t){if(e===t)return!0;var r,n,i,o=or.call(e);if(o!==or.call(t))return!1;switch(o){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(dr(e,t))return!0;var s=pr(e),a=pr(t),u=s.length;if(u!==a.length)return!1;for(var c=0;c<u;++c)if(!sr.call(t,s[c]))return!1;for(c=0;c<u;++c){var l=s[c];if(!lr(e[l],t[l]))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(dr(e,t))return!0;for(var p=e.entries(),f="[object Map]"===o;;){var h=p.next();if(h.done)break;var d=h.value,v=d[0],y=d[1];if(!t.has(v))return!1;if(f&&!lr(y,t.get(v)))return!1}return!0;case"[object Function]":var m=ar.call(e);return m===ar.call(t)&&(n=hr,!((i=(r=m).length-n.length)>=0&&r.indexOf(n,i)===i))}return!1}function pr(e){return Object.keys(e).filter(fr,e)}function fr(e){return void 0!==this[e]}var hr="{ [native code] }";function dr(e,t){var r=ur.get(e);if(r){if(r.has(t))return!0}else ur.set(e,r=new Set);return r.add(t),!1}function vr(e){return e.hasOwnProperty("graphQLErrors")}var yr,mr=function(e){function t(r){var n,i,o=r.graphQLErrors,s=r.networkError,a=r.errorMessage,u=r.extraInfo,c=e.call(this,a)||this;return c.graphQLErrors=o||[],c.networkError=s||null,c.message=a||(i="",Rt((n=c).graphQLErrors)&&n.graphQLErrors.forEach((function(e){var t=e?e.message:"Error message not found.";i+=t+"\n"})),n.networkError&&(i+=n.networkError.message+"\n"),i=i.replace(/\n$/,"")),c.extraInfo=u,c.__proto__=t.prototype,c}return j(t,e),t}(Error);function br(e){return!!e&&e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(yr||(yr={}));var gr=function(){function e(e,t,r,n){this.observer=e,this.options=t,this.fetch=r,this.shouldFetch=n}return e.prototype.reobserve=function(e,t){e?this.updateOptions(e):this.updatePolling();var r=this.fetch(this.options,t);return this.concast&&this.concast.removeObserver(this.observer,!0),r.addObserver(this.observer),(this.concast=r).promise},e.prototype.updateOptions=function(e){return Object.assign(this.options,Qt(e)),this.updatePolling(),this},e.prototype.stop=function(){this.concast&&(this.concast.removeObserver(this.observer),delete this.concast),this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),this.options.pollInterval=0,this.updatePolling())},e.prototype.updatePolling=function(){var e=this,t=this.pollingInfo,r=this.options.pollInterval;if(r){if((!t||t.interval!==r)&&("production"===process.env.NODE_ENV?fe(r,20):fe(r,"Attempted to start a polling query without a polling interval."),!1!==this.shouldFetch)){(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(e.shouldFetch&&e.shouldFetch()?e.reobserve({fetchPolicy:"network-only",nextFetchPolicy:e.options.fetchPolicy||"cache-first"},yr.poll).then(i,i):i())},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)},e}(),wr=!1,Or=function(e){function t(t){var r=t.queryManager,n=t.queryInfo,i=t.options,o=e.call(this,(function(e){return o.onSubscribe(e)}))||this;o.observers=new Set,o.subscriptions=new Set,o.observer={next:function(e){(o.lastError||o.isDifferentFromLastResult(e))&&(o.updateLastResult(e),Nt(o.observers,"next",e))},error:function(e){o.updateLastResult(M(M({},o.lastResult),{error:e,errors:e.graphQLErrors,networkStatus:yr.error,loading:!1})),Nt(o.observers,"error",o.lastError=e)}},o.isTornDown=!1,o.options=i,o.queryId=r.generateQueryId();var s=et(i.query);return o.queryName=s&&s.name&&s.name.value,o.queryManager=r,o.queryInfo=n,o}return j(t,e),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.lastResult,r=this.queryInfo.networkStatus||t&&t.networkStatus||yr.ready,n=M(M({},t),{loading:br(r),networkStatus:r});if(this.isTornDown)return n;var i=this.options.fetchPolicy,o=void 0===i?"cache-first":i;if("no-cache"===o||"network-only"===o)delete n.partial;else if(!n.data||!this.queryManager.transform(this.options.query).hasForcedResolvers){var s=this.queryInfo.getDiff();n.data=s.complete||this.options.returnPartialData?s.result:void 0,s.complete?(n.networkStatus!==yr.loading||"cache-first"!==o&&"cache-only"!==o||(n.networkStatus=yr.ready,n.loading=!1),delete n.partial):n.partial=!0}return e&&this.updateLastResult(n),n},t.prototype.isDifferentFromLastResult=function(e){return!cr(this.lastResultSnapshot,e)},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t={pollInterval:0},r=this.options.fetchPolicy;return"no-cache"!==r&&"cache-and-network"!==r&&(t.fetchPolicy="network-only",t.nextFetchPolicy=r||"cache-first"),e&&!cr(this.options.variables,e)&&(t.variables=this.options.variables=M(M({},this.options.variables),e)),this.newReobserver(!1).reobserve(t,yr.refetch)},t.prototype.fetchMore=function(e){var t=this,r=M(M({},e.query?e:M(M(M({},this.options),e),{variables:M(M({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),n=this.queryManager.generateQueryId();return r.notifyOnNetworkStatusChange&&(this.queryInfo.networkStatus=yr.fetchMore,this.observe()),this.queryManager.fetchQuery(n,r,yr.fetchMore).then((function(n){var i=n.data,o=e.updateQuery;return o?("production"===process.env.NODE_ENV||wr||("production"===process.env.NODE_ENV||fe.warn("The updateQuery callback for fetchMore is deprecated, and will be removed\nin the next major version of Apollo Client.\n\nPlease convert updateQuery functions to field policies with appropriate\nread and merge functions, or use/adapt a helper function (such as\nconcatPagination, offsetLimitPagination, or relayStylePagination) from\n@apollo/client/utilities.\n\nThe field policy system handles pagination more effectively than a\nhand-written updateQuery function, and you only need to define the policy\nonce, rather than every time you call fetchMore."),wr=!0),t.updateQuery((function(e){return o(e,{fetchMoreResult:i,variables:r.variables})}))):t.queryManager.cache.writeQuery({query:r.query,variables:r.variables,data:i}),n})).finally((function(){t.queryManager.stopQuery(n),t.reobserve()}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError?e.onError(t):"production"===process.env.NODE_ENV||fe.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){if(cr(this.variables,e))return this.observers.size?this.result():Promise.resolve();if(this.options.variables=e,!this.observers.size)return Promise.resolve();var t=this.options.fetchPolicy,r=void 0===t?"cache-first":t,n={fetchPolicy:r,variables:e};return"cache-first"!==r&&"no-cache"!==r&&"network-only"!==r&&(n.fetchPolicy="cache-and-network",n.nextFetchPolicy=r),this.reobserve(n,yr.setVariables)},t.prototype.updateQuery=function(e){var t,r=this.queryManager,n=e(r.cache.diff({query:this.options.query,variables:this.variables,previousResult:null===(t=this.lastResult)||void 0===t?void 0:t.data,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(r.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),r.broadcastQueries())},t.prototype.startPolling=function(e){this.getReobserver().updateOptions({pollInterval:e})},t.prototype.stopPolling=function(){this.reobserver&&this.reobserver.updateOptions({pollInterval:0})},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:St(e),Rt(e.errors)||delete this.lastError,t},t.prototype.onSubscribe=function(e){var t=this;if(e===this.observer)return function(){};try{var r=e._subscription._observer;r&&!r.error&&(r.error=Sr)}catch(e){}var n=!this.observers.size;return this.observers.add(e),this.lastError?e.error&&e.error(this.lastError):this.lastResult&&e.next&&e.next(this.lastResult),n&&this.reobserve().catch((function(e){})),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.getReobserver=function(){return this.reobserver||(this.reobserver=this.newReobserver(!0))},t.prototype.newReobserver=function(e){var t=this,r=this.queryManager,n=this.queryId;return r.setObservableQuery(this),new gr(this.observer,e?this.options:M({},this.options),(function(e,i){return r.setObservableQuery(t),r.fetchQueryObservable(n,e,i)}),!r.ssrMode&&function(){return!br(t.queryInfo.networkStatus)})},t.prototype.reobserve=function(e,t){return this.isTornDown=!1,this.getReobserver().reobserve(e,t)},t.prototype.observe=function(){this.observer.next(this.getCurrentResult(!1))},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.reobserver&&(this.reobserver.stop(),delete this.reobserver),delete this.options.context,this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(q.default);function Sr(e){"production"===process.env.NODE_ENV||fe.error("Unhandled error",e.message,e.stack)}var Er=null,kr={},xr=1,Dr=Array,Nr=Dr["@wry/context:Slot"]||function(){var e=function(){function e(){this.id=["slot",xr++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=Er;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===kr)break;return e!==Er&&(Er.slots[this.id]=t),!0}return Er&&(Er.slots[this.id]=kr),!1},e.prototype.getValue=function(){if(this.hasValue())return Er.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,o=((i={__proto__:null})[this.id]=e,i),s=Er;Er={parent:s,slots:o};try{return t.apply(n,r)}finally{Er=s}},e.bind=function(e){var t=Er;return function(){var r=Er;try{return Er=t,e.apply(this,arguments)}finally{Er=r}}},e.noContext=function(e,t,r){if(!Er)return e.apply(r,t);var n=Er;try{return Er=null,e.apply(r,t)}finally{Er=n}},e}();try{Object.defineProperty(Dr,"@wry/context:Slot",{value:Dr["@wry/context:Slot"]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();Nr.bind,Nr.noContext;function Pr(){}var qr=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=Pr),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getEntry(e);return t&&t.value},e.prototype.getEntry=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getEntry(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),_r=new Nr;function Rr(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var jr=[];function Mr(e,t){if(!e)throw new Error(t||"assertion failure")}function Qr(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var Cr=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!Fr(this))return this.value[0]},e.prototype.recompute=function(e){return Mr(!this.recomputing,"already recomputing"),function(e){var t=_r.getValue();if(t)e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Fr(e)?Ir(t,e):Lr(t,e)}(this),Fr(this)?function(e,t){Br(e),_r.withValue(e,Tr,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{Rr(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,Fr(e))return;Vr(e)}(e);return Qr(e.value)}(this,e):Qr(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Ar(this),Br(this),Rr(this))},e.prototype.dispose=function(){var e=this;Br(this),Rr(this),this.parents.forEach((function(t){t.setDirty(),$r(t,e)}))},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=jr.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(this.deps.forEach((function(t){return t.delete(e)})),this.deps.clear(),jr.push(this.deps),this.deps=null)},e.count=0,e}();function Tr(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function Fr(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Ar(e){e.parents.forEach((function(t){return Ir(t,e)}))}function Vr(e){e.parents.forEach((function(t){return Lr(t,e)}))}function Ir(e,t){if(Mr(e.childValues.has(t)),Mr(Fr(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=jr.pop()||new Set;e.dirtyChildren.add(t),Ar(e)}function Lr(e,t){Mr(e.childValues.has(t)),Mr(!Fr(t));var r,n,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(r=o,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),zr(e,t),Fr(e)||Vr(e)}function zr(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(jr.length<100&&jr.push(r),e.dirtyChildren=null))}function Br(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){$r(e,r)})),e.forgetDeps(),Mr(null===e.dirtyChildren)}function $r(e,t){t.parents.delete(e),e.childValues.delete(t),zr(e,t)}var Wr=function(){return Object.create(null)},Ur=Array.prototype,Jr=Ur.forEach,Gr=Ur.slice,Yr=function(){function e(e,t){void 0===t&&(t=Wr),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return Jr.call(e,(function(e){return t=t.getChildTrie(e)})),t.data||(t.data=this.makeData(Gr.call(e)))},e.prototype.getChildTrie=function(t){var r=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness,this.makeData)),n},e}();function Hr(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=_r.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(Rr(i),i.unsubscribe=r(e))}}return n.dirty=function(e){var r=t.get(e);r&&(r.forEach((function(e){return e.setDirty()})),t.delete(e),Rr(r))},n}var Kr=new Yr("function"==typeof WeakMap);function Xr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kr.lookupArray(e)}var Zr=new Set;function en(e,t){void 0===t&&(t=Object.create(null));var r=new qr(t.max||Math.pow(2,16),(function(e){return e.dispose()})),n=t.keyArgs||function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e},i=t.makeCacheKey||Xr;function o(){var o=i.apply(null,n.apply(null,arguments));if(void 0===o)return e.apply(null,arguments);var s=r.get(o);s||(r.set(o,s=new Cr(e)),s.subscribe=t.subscribe);var a=s.recompute(Array.prototype.slice.call(arguments));return r.set(o,s),Zr.add(r),_r.hasValue()||(Zr.forEach((function(e){return e.clean()})),Zr.clear()),a}function s(){var e=i.apply(null,arguments);if(void 0!==e)return r.get(e)}return o.dirty=function(){var e=s.apply(null,arguments);e&&e.setDirty()},o.peek=function(){var e=s.apply(null,arguments);if(e)return e.peek()},o.forget=function(){var e=i.apply(null,arguments);return void 0!==e&&r.delete(e)},o}var tn,rn=function(){function e(){this.getFragmentDoc=en(Ie)}return e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read({rootId:e.id||"ROOT_QUERY",query:e.query,variables:e.variables,returnPartialData:e.returnPartialData,optimistic:t})},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read({query:this.getFragmentDoc(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,returnPartialData:e.returnPartialData,optimistic:t})},e.prototype.writeQuery=function(e){return this.write({dataId:e.id||"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables,broadcast:e.broadcast})},e.prototype.writeFragment=function(e){return this.write({dataId:e.id,result:e.data,variables:e.variables,query:this.getFragmentDoc(e.fragment,e.fragmentName),broadcast:e.broadcast})},e}();tn||(tn={});var nn=function(e,t,r,n,i){this.message=e,this.path=t,this.query=r,this.clientOnly=n,this.variables=i},on=Object.prototype.hasOwnProperty;var sn=/^[_a-z][_0-9a-z]*/i;function an(e){var t=e.match(sn);return t?t[0]:e}function un(e,t,r){return!(!t||"object"!=typeof t)&&(Array.isArray(t)?t.every((function(t){return un(e,t,r)})):e.selections.every((function(e){if(Ke(e)&&Fe(e,r)){var n=Ye(e);return on.call(t,n)&&(!e.selectionSet||un(e.selectionSet,t[n],r))}return!0})))}function cn(e){return null!==e&&"object"==typeof e&&!$e(e)&&!Array.isArray(e)}var ln=Object.create(null),pn=function(){return ln},fn=Object.create(null),hn=function(){function e(e,t){var r=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Dt($e(e)?r.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return $e(e)?r.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return Be(e);if($e(e))return e;var n=r.policies.identify(e)[0];if(n){var i=Be(n);return t&&r.merge(n,e),i}}}return e.prototype.toObject=function(){return M({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),on.call(this.data,e)){var r=this.data[e];if(r&&on.call(r,t))return r[t]}return"__typename"===t&&on.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof yn?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),on.call(this.data,e)?this.data[e]:this instanceof yn?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var r=this,n=this.lookup(e),i=new wt(mn).merge(n,t);if(this.data[e]=i,i!==n&&(delete this.refs[e],this.group.caching)){var o=Object.create(null);n||(o.__exists=1),Object.keys(t).forEach((function(e){if(!n||n[e]!==i[e]){o[e]=1;var t=an(e);t===e||r.policies.hasKeyArgs(i.__typename,t)||(o[t]=1),void 0!==i[e]||r instanceof yn||delete i[e]}})),Object.keys(o).forEach((function(t){return r.group.dirty(e,t)}))}},e.prototype.modify=function(e,t){var r=this,n=this.lookup(e);if(n){var i=Object.create(null),o=!1,s=!0,a={DELETE:ln,INVALIDATE:fn,isReference:$e,toReference:this.toReference,canRead:this.canRead,readField:function(t,n){return r.policies.readField("string"==typeof t?{fieldName:t,from:n||Be(e)}:t,{store:r})}};if(Object.keys(n).forEach((function(u){var c=an(u),l=n[u];if(void 0!==l){var p="function"==typeof t?t:t[u]||t[c];if(p){var f=p===pn?ln:p(Dt(l),M(M({},a),{fieldName:c,storeFieldName:u,storage:r.getStorage(e,u)}));f===fn?r.group.dirty(e,u):(f===ln&&(f=void 0),f!==l&&(i[u]=f,o=!0,l=f))}void 0!==l&&(s=!1)}})),o)return this.merge(e,i),s&&(this instanceof yn?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,r){var n,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),s=t&&r?this.policies.getStoreFieldName({typename:o,fieldName:t,args:r}):t;return this.modify(e,s?((n={})[s]=pn,n):pn)}return!1},e.prototype.evict=function(e){var t=!1;return e.id&&(on.call(this.data,e.id)&&(t=this.delete(e.id,e.fieldName,e.args)),this instanceof yn&&(t=this.parent.evict(e)||t),(e.fieldName||t)&&this.group.dirty(e.id,e.fieldName||"__exists")),t},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),r=[];return this.getRootIdSet().forEach((function(t){on.call(e.policies.rootTypenamesById,t)||r.push(t)})),r.length&&(t.__META={extraRootIds:r.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(r){e&&on.call(e,r)||t.delete(r)})),e){var r=e.__META,n=Q(e,["__META"]);Object.keys(n).forEach((function(e){t.merge(e,n[e])})),r&&r.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof yn?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){on.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof yn;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!on.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=new Set([this.data[e]]),n=function(e){return null!==e&&"object"==typeof e};r.forEach((function(e){$e(e)?t[e.__ref]=!0:n(e)&&Object.values(e).filter(n).forEach(r.add,r)}))}return this.refs[e]},e.prototype.makeCacheKey=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.group.keyMaker.lookupArray(e)},e}(),dn=function(){function e(e){this.caching=e,this.d=null,this.keyMaker=new Yr(Mt),this.d=e?Hr():null}return e.prototype.depend=function(e,t){if(this.d){this.d(vn(e,t));var r=an(t);r!==t&&this.d(vn(e,r))}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(vn(e,t))},e}();function vn(e,t){return t+"#"+e}!function(e){var t=function(e){function t(t){var r=t.policies,n=t.resultCaching,i=void 0===n||n,o=t.seed,s=e.call(this,r,new dn(i))||this;return s.storageTrie=new Yr(Mt),s.sharedLayerGroup=new dn(i),o&&s.replace(o),s}return j(t,e),t.prototype.addLayer=function(e,t){return new yn(e,this,t,this.sharedLayerGroup)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(hn||(hn={}));var yn=function(e){function t(t,r,n,i){var o=e.call(this,r.policies,i)||this;return o.id=t,o.parent=r,o.replay=n,o.group=i,n(o),o}return j(t,e),t.prototype.addLayer=function(e,r){return new t(e,this,r,this.group)},t.prototype.removeLayer=function(e){var t=this,r=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){t.data[e]!==r.lookup(e)&&t.delete(e)})),r):r===this.parent?this:r.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return M(M({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var r=this.parent.findChildRefIds(t);return on.call(this.data,t)?M(M({},r),e.prototype.findChildRefIds.call(this,t)):r},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(hn);function mn(e,t,r){var n=e[r],i=t[r];return cr(n,i)?n:i}function bn(e){return!!(e instanceof hn&&e.group.caching)}function gn(e,t){return new nn(e.message,t.path.slice(),t.query,t.clientOnly,t.variables)}var wn=function(){function e(e){var t=this;this.config=e,this.executeSelectionSet=en((function(e){return t.execSelectionSetImpl(e)}),{keyArgs:function(e){return[e.selectionSet,e.objectOrReference,e.context]},makeCacheKey:function(e,t,r){if(bn(r.store))return r.store.makeCacheKey(e,$e(t)?t.__ref:t,r.varString)}}),this.knownResults=new WeakMap,this.executeSubSelectedArray=en((function(e){return t.execSubSelectedArrayImpl(e)}),{makeCacheKey:function(e){var t=e.field,r=e.array,n=e.context;if(bn(n.store))return n.store.makeCacheKey(t,r,n.varString)}}),this.config=M({addTypename:!0},e)}return e.prototype.diffQueryAgainstStore=function(e){var t,r=e.store,n=e.query,i=e.rootId,o=void 0===i?"ROOT_QUERY":i,s=e.variables,a=e.returnPartialData,u=void 0===a||a,c=this.config.cache.policies;s=M(M({},it((t=et(n),"production"===process.env.NODE_ENV?fe(t&&"query"===t.operation,48):fe(t&&"query"===t.operation,"Must contain a query definition."),t))),s);var l=this.executeSelectionSet({selectionSet:nt(n).selectionSet,objectOrReference:Be(o),context:{store:r,query:n,policies:c,variables:s,varString:JSON.stringify(s),fragmentMap:Le(rt(n)),path:[],clientOnly:!1}}),p=l.missing&&l.missing.length>0;if(p&&!u)throw l.missing[0];return{result:l.result,missing:l.missing,complete:!p}},e.prototype.isFresh=function(e,t,r,n){if(bn(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n);if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,n=e.objectOrReference,i=e.context;if($e(n)&&!i.policies.rootTypenamesById[n.__ref]&&!i.store.has(n.__ref))return{result:{},missing:[gn("production"===process.env.NODE_ENV?new pe(4):new pe("Dangling reference to missing "+n.__ref+" object"),i)]};var o=i.variables,s=i.policies,a=i.store,u=[],c={result:null},l=a.getFieldValue(n,"__typename");function p(){return c.missing||(c.missing=[])}function f(e){var t;return e.missing&&(t=p()).push.apply(t,e.missing),e.result}this.config.addTypename&&"string"==typeof l&&!s.rootIdsByTypename[l]&&u.push({__typename:l});var h=new Set(r.selections);return h.forEach((function(e){var r;if(Fe(e,o))if(Ke(e)){var a=s.readField({fieldName:e.name.value,field:e,variables:i.variables,from:n},i),c=Ye(e);i.path.push(c);var d=i.clientOnly;i.clientOnly=d||!(!e.directives||!e.directives.some((function(e){return"client"===e.name.value}))),void 0===a?pt.added(e)||p().push(gn("production"===process.env.NODE_ENV?new pe(5):new pe("Can't find field '"+e.name.value+"' on "+($e(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2))),i)):Array.isArray(a)?a=f(t.executeSubSelectedArray({field:e,array:a,context:i})):e.selectionSet?null!=a&&(a=f(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:a,context:i}))):"production"!==process.env.NODE_ENV&&(On(i.store,e,a),Dt(a)),void 0!==a&&u.push(((r={})[c]=a,r)),i.clientOnly=d,fe(i.path.pop()===c)}else{var v=ze(e,i.fragmentMap);v&&s.fragmentMatches(v,l)&&v.selectionSet.selections.forEach(h.add,h)}})),c.result=mt(u),"production"!==process.env.NODE_ENV&&Object.freeze(c.result),this.knownResults.set(c.result,r),c},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,o=e.context;function s(e,r){return e.missing&&(t=t||[]).push.apply(t,e.missing),fe(o.path.pop()===r),e.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map((function(e,t){return null===e?null:(o.path.push(t),Array.isArray(e)?s(r.executeSubSelectedArray({field:n,array:e,context:o}),t):n.selectionSet?s(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,context:o}),t):("production"!==process.env.NODE_ENV&&On(o.store,n,e),fe(o.path.pop()===t),e))})),"production"!==process.env.NODE_ENV&&Object.freeze(i),{result:i,missing:t}},e}();function On(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach((function(r){r&&"object"==typeof r&&("production"===process.env.NODE_ENV?fe(!$e(r),6):fe(!$e(r),"Missing selection set for object of type "+function(e,t){return $e(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,r)+" returned for query field "+t.name.value),Object.values(r).forEach(n.add,n))}))}}var Sn=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e){var t=e.query,r=e.result,n=e.dataId,i=e.store,o=e.variables,s=et(t),a=new wt;o=M(M({},it(s)),o);var u=this.processSelectionSet({result:r||Object.create(null),dataId:n,selectionSet:s.selectionSet,mergeTree:{map:new Map},context:{store:i,written:Object.create(null),merge:function(e,t){return a.merge(e,t)},variables:o,varString:JSON.stringify(o),fragmentMap:Le(rt(t))}});if(!$e(u))throw"production"===process.env.NODE_ENV?new pe(7):new pe("Could not identify object "+JSON.stringify(r));return i.retain(u.__ref),u},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,n=e.result,i=e.selectionSet,o=e.context,s=e.mergeTree,a=this.cache.policies,u=a.identify(n,i,o.fragmentMap),c=u[0],l=u[1];if("string"==typeof(r=r||c)){var p=o.written[r]||(o.written[r]=[]),f=Be(r);if(p.indexOf(i)>=0)return f;if(p.push(i),this.reader&&this.reader.isFresh(n,f,i,o))return f}var h=Object.create(null);l&&(h=o.merge(h,l));var d=r&&a.rootTypenamesById[r]||He(n,i,o.fragmentMap)||r&&o.store.get(r,"__typename");"string"==typeof d&&(h.__typename=d);var v=new Set(i.selections);if(v.forEach((function(e){var r;if(Fe(e,o.variables))if(Ke(e)){var i=Ye(e),u=n[i];if(void 0!==u){var c=a.getStoreFieldName({typename:d,fieldName:e.name.value,field:e,variables:o.variables}),l=kn(s,c),p=t.processFieldValue(u,e,o,l),f=e.selectionSet&&o.store.getFieldValue(p,"__typename")||void 0,y=a.getMergeFunction(d,e.name.value,f);y?l.info={field:e,typename:d,merge:y}:xn(s,c),h=o.merge(h,((r={})[c]=p,r))}else if(a.usingPossibleTypes&&!Ae(["defer","client"],e))throw"production"===process.env.NODE_ENV?new pe(8):new pe("Missing field '"+i+"' in "+JSON.stringify(n,null,2).substring(0,100))}else{var m=ze(e,o.fragmentMap);m&&a.fragmentMatches(m,d,n,o.variables)&&m.selectionSet.selections.forEach(v.add,v)}})),"string"==typeof r){var y=Be(r);if(s.map.size&&(h=this.applyMerges(s,y,h,o)),"production"!==process.env.NODE_ENV){var m=new Set;v.forEach((function(e){Ke(e)&&e.selectionSet&&m.add(e.name.value)}));Object.keys(h).forEach((function(e){(function(e){return m.has(an(e))})(e)&&!function(e){var t=s.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,r,n){var i=function(e){var t=n.getFieldValue(e,r);return"object"==typeof t&&t},o=i(e);if(!o)return;var s=i(t);if(!s)return;if($e(o))return;if(cr(o,s))return;if(Object.keys(o).every((function(e){return void 0!==n.getFieldValue(s,e)})))return;var a=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),u=an(r),c=a+"."+u;if(Dn.has(c))return;Dn.add(c);var l=[];Array.isArray(o)||Array.isArray(s)||[o,s].forEach((function(e){var t=n.getFieldValue(e,"__typename");"string"!=typeof t||l.includes(t)||l.push(t)}));"production"===process.env.NODE_ENV||fe.warn("Cache data may be lost when replacing the "+u+" field of a "+a+" object.\n\nTo address this problem (which is not a bug in Apollo Client), "+(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"")+"define a custom merge function for the "+c+" field, so InMemoryCache can safely merge these objects:\n\n existing: "+JSON.stringify(o).slice(0,1e3)+"\n incoming: "+JSON.stringify(s).slice(0,1e3)+"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n")}(y,h,e,o.store)}))}return o.store.merge(r,h),y}return h},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Array.isArray(e)?e.map((function(e,o){var s=i.processFieldValue(e,t,r,kn(n,o));return xn(n,o),s})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):"production"===process.env.NODE_ENV?e:St(e)},e.prototype.applyMerges=function(e,t,r,n,i){var o,s=this;if(e.map.size&&!$e(r)){var a,u=Array.isArray(r)||!$e(t)&&!cn(t)?void 0:t,c=r;u&&!i&&(i=[$e(u)?u.__ref:u]);var l=function(e,t){return Array.isArray(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){i&&i.push(t);var r=l(u,t),o=l(c,t),p=s.applyMerges(e,r,o,n,i);p!==o&&(a=a||new Map).set(t,p),i&&fe(i.pop()===t)})),a&&(r=Array.isArray(c)?c.slice(0):M({},c),a.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,n,i&&(o=n.store).getStorage.apply(o,i)):r},e}(),En=[];function kn(e,t){var r=e.map;return r.has(t)||r.set(t,En.pop()||{map:new Map}),r.get(t)}function xn(e,t){var r=e.map,n=r.get(t);!n||n.info||n.map.size||(En.push(n),r.delete(t))}var Dn=new Set;var Nn=Hr(),Pn=new Nr;function qn(e,t){if(e.size){var r=[];e.forEach((function(e){return r.push(e)})),e.clear(),r.forEach(t)}}var _n=new WeakMap;function Rn(e){var t=new Set,r=new Set,n=function(o){if(arguments.length>0)e!==o&&(e=o,Nn.dirty(n),t.forEach(jn),qn(r,(function(t){return t(e)})));else{var s=Pn.getValue();s&&i(s),Nn(n)}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){t.add(e);var r=_n.get(e);return r||_n.set(e,r=new Set),r.add(n),n};return n.forgetCache=function(e){var r=t.delete(e);if(r){var i=_n.get(e);i&&i.delete(n)}return r},n}function jn(e){e.broadcastWatches&&e.broadcastWatches()}function Mn(e){return void 0!==e.args?e.args:e.field?Ge(e.field,e.variables):null}var Qn=function(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=void 0!==n?{id:n}:void 0!==i?{_id:i}:void 0),void 0===n&&(n=i),void 0!==n))return r+":"+("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))},Cn=function(){},Tn=function(e,t){return t.fieldName},Fn=function(e,t,r){return(0,r.mergeObjects)(e,t)},An=function(e,t){return t},Vn=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=M({dataIdFromObject:Qn},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t,r){var n=t&&r?He(e,t,r):e.__typename;if(n===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var i,o={typename:n,selectionSet:t,fragmentMap:r},s=n&&this.getTypePolicy(n),a=s&&s.keyFn||this.config.dataIdFromObject;a;){var u=a(e,o);if(!Array.isArray(u)){i=u;break}a=Bn(u)}return i=i&&String(i),o.keyObject?[i,o.keyObject]:[i]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var n=e[r];on.call(t.toBeAdded,r)?t.toBeAdded[r].push(n):t.toBeAdded[r]=[n]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function s(e,t){e.merge="function"==typeof t?t:!0===t?Fn:!1===t?An:e.merge}s(n,t.merge),t.queryType&&this.setRootTypename("Query",e),t.mutationType&&this.setRootTypename("Mutation",e),t.subscriptionType&&this.setRootTypename("Subscription",e),n.keyFn=!1===i?Cn:Array.isArray(i)?Bn(i):"function"==typeof i?i:n.keyFn,o&&Object.keys(o).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)n.read=i;else{var a=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===a?Tn:Array.isArray(a)?zn(a):"function"==typeof a?a:n.keyFn,"function"==typeof u&&(n.read=u),s(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||Tn)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&("production"===process.env.NODE_ENV?fe(!n||n===e,1):fe(!n||n===e,"Cannot change root "+e+" __typename more than once"),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match(sn);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!on.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach((function(e){var n=t.getTypePolicy(e),i=n.fields,o=Q(n,["fields"]);Object.assign(r,o),Object.assign(r.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&this.updateTypePolicy(e,Qt.apply(void 0,i.splice(0))),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},e.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(t,!0),a=[s],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&a.indexOf(t)<0&&a.push(t)},c=!(!r||!this.fuzzySubtypes.size),l=!1,p=0;p<a.length;++p){var f=a[p];if(f.has(o))return s.has(o)||(l&&("production"===process.env.NODE_ENV||fe.warn("Inferring subtype "+t+" of supertype "+o)),s.add(o)),!0;f.forEach(u),c&&p===a.length-1&&un(e.selectionSet,r,n)&&(c=!1,l=!0,this.fuzzySubtypes.forEach((function(e,r){var n=t.match(e);n&&n[0]===t&&u(r)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var r=this.getFieldPolicy(e,t,!1);return!(!r||!r.keyFn)},e.prototype.getStoreFieldName=function(e){var t,r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},a=Mn(e);o;){var u=o(a,s);if(!Array.isArray(u)){t=u||n;break}o=zn(u)}return void 0===t&&(t=e.field?function(e,t){var r=null;e.directives&&(r={},e.directives.forEach((function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach((function(n){var i=n.name,o=n.value;return We(r[e.name.value],i,o,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return We(n,r,i,t)}))),Je(e.name.value,n,r)}(e.field,e.variables):Je(n,Mn(e))),n===an(t)?t:n+":"+t},e.prototype.readField=function(e,t){var r=e.from;if(r&&(e.field||e.fieldName)){if(void 0===e.typename){var n=t.store.getFieldValue(r,"__typename");n&&(e.typename=n)}var i=this.getStoreFieldName(e),o=an(i),s=t.store.getFieldValue(r,i),a=this.getFieldPolicy(e.typename,o,!1),u=a&&a.read;if(u){var c=In(this,r,e,t,t.store.getStorage($e(r)?r.__ref:r,i));return Pn.withValue(this.cache,u,[s,c])}return s}},e.prototype.getMergeFunction=function(e,t,r){var n=this.getFieldPolicy(e,t,!1),i=n&&n.merge;return!i&&r&&(i=(n=this.getTypePolicy(r))&&n.merge),i},e.prototype.runMergeFunction=function(e,t,r,n,i){var o=r.field,s=r.typename,a=r.merge;return a===Fn?Ln(n.store.getFieldValue)(e,t):a===An?t:a(e,t,In(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:n.variables},n,i||Object.create(null)))},e}();function In(e,t,r,n,i){var o=e.getStoreFieldName(r),s=an(o),a=r.variables||n.variables,u=n.store,c=u.getFieldValue,l=u.toReference,p=u.canRead;return{args:Mn(r),field:r.field||null,fieldName:s,storeFieldName:o,variables:a,isReference:$e,toReference:l,storage:i,cache:e.cache,canRead:p,readField:function(r,i){var o="string"==typeof r?{fieldName:r,from:i}:M({},r);return void 0===o.from&&(o.from=t),void 0===o.variables&&(o.variables=a),e.readField(o,n)},mergeObjects:Ln(c)}}function Ln(e){return function(t,r){if(Array.isArray(t)||Array.isArray(r))throw"production"===process.env.NODE_ENV?new pe(2):new pe("Cannot automatically merge arrays");if(t&&"object"==typeof t&&r&&"object"==typeof r){var n=e(t,"__typename"),i=e(r,"__typename");return!(n&&i&&n!==i)&&cn(t)&&cn(r)?M(M({},t),r):r}return r}}function zn(e){return function(t,r){return t?r.fieldName+":"+JSON.stringify(Wn(t,e,!1)):r.fieldName}}function Bn(e){var t=new Yr(Mt);return function(r,n){var i;if(n.selectionSet&&n.fragmentMap){var o=t.lookupArray([n.selectionSet,n.fragmentMap]);i=o.aliasMap||(o.aliasMap=$n(n.selectionSet,n.fragmentMap))}var s=n.keyObject=Wn(r,e,!0,i);return n.typename+":"+JSON.stringify(s)}}function $n(e,t){var r=Object.create(null),n=new Set([e]);return n.forEach((function(e){e.selections.forEach((function(e){if(Ke(e)){if(e.alias){var i=e.alias.value,o=e.name.value;if(o!==i)(r.aliases||(r.aliases=Object.create(null)))[o]=i}if(e.selectionSet)(r.subsets||(r.subsets=Object.create(null)))[e.name.value]=$n(e.selectionSet,t)}else{var s=ze(e,t);s&&n.add(s.selectionSet)}}))})),r}function Wn(e,t,r,n){var i,o=Object.create(null);return t.forEach((function(t){if(Array.isArray(t)){if("string"==typeof i){var s=n&&n.subsets,a=s&&s[i];o[i]=Wn(e[i],t,r,a)}}else{var u=n&&n.aliases,c=u&&u[t]||t;on.call(e,c)?o[i=t]=e[c]:("production"===process.env.NODE_ENV?fe(!r,3):fe(!r,"Missing field '"+c+"' while computing key fields"),i=void 0)}})),o}var Un={dataIdFromObject:Qn,addTypename:!0,resultCaching:!0,typePolicies:{}},Jn=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.watches=new Set,r.typenameDocumentCache=new Map,r.makeVar=Rn,r.txCount=0,r.maybeBroadcastWatch=en((function(e,t){return r.broadcastWatch.call(r,e,!!t)}),{makeCacheKey:function(e){var t=e.optimistic?r.optimisticData:r.data;if(bn(t)){var n=e.optimistic,i=e.rootId,o=e.variables;return t.makeCacheKey(e.query,e.callback,JSON.stringify({optimistic:n,rootId:i,variables:o}))}}}),r.watchDep=Hr(),r.config=M(M({},Un),t),r.addTypename=!!r.config.addTypename,r.policies=new Vn({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.data=new hn.Root({policies:r.policies,resultCaching:r.config.resultCaching}),r.optimisticData=r.data,r.storeWriter=new Sn(r,r.storeReader=new wn({cache:r,addTypename:r.addTypename})),r}return j(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,r=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:e.query,variables:e.variables,rootId:e.rootId,config:this.config,returnPartialData:r}).result||null}catch(e){if(e instanceof nn)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore({store:this.data,query:e.query,result:e.result,dataId:e.dataId,variables:e.variables})}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(on.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",query:e.query,variables:e.variables,returnPartialData:e.returnPartialData,config:this.config})},t.prototype.watch=function(e){var t=this;return this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&function(e){var t=_n.get(e);t&&(qn(t,(function(t){return t.forgetCache(e)})),_n.delete(e))}(t),t.watchDep.dirty(e),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(){return this.optimisticData.gc()},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){return $e(e)?e.__ref:this.policies.identify(e)[0]},t.prototype.evict=function(e){if(!e.id){if(on.call(e,"id"))return!1;e=M(M({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(){return this.data.clear(),this.optimisticData=this.data,this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.performTransaction=function(e,t){var r=this,n=function(t){var n=r,i=n.data,o=n.optimisticData;++r.txCount,t&&(r.data=r.optimisticData=t);try{e(r)}finally{--r.txCount,r.data=i,r.optimisticData=o}},i=!1;"string"==typeof t?(this.optimisticData=this.optimisticData.addLayer(t,n),i=!0):null===t?n(this.data):n(),this.broadcastWatches(i)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=pt(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(r){return t.maybeBroadcastWatch(r,e)}))},t.prototype.broadcastWatch=function(e,t){this.watchDep.dirty(e),this.watchDep(e);var r=this.diff({query:e.query,variables:e.variables,optimistic:e.optimistic});e.optimistic&&t&&(r.fromOptimisticTransaction=!0),e.callback(r)},t}(rn),Gn=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=yt(t.resolvers,e)})):this.resolvers=yt(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,n=e.context,i=e.variables,o=e.onlyRunForcedResolvers,s=void 0!==o&&o;return C(this,void 0,void 0,(function(){return T(this,(function(e){return t?[2,this.resolveDocument(t,r.data,n,i,this.fragmentMatcher,s).then((function(e){return M(M({},r),{data:e.result})}))]:[2,r]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Ae(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){Ze(e);var t=lt([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=De(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return Ke(e)&&"__typename"===e.name.value})))return null}}})),t}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return M(M({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),C(this,void 0,void 0,(function(){return T(this,(function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then((function(e){return M(M({},t),e.exportedVariables)}))]:[2,M({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return De(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return xe}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:dt(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,n,i,o){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),C(this,void 0,void 0,(function(){var s,a,u,c,l,p,f,h,d;return T(this,(function(v){return s=nt(e),a=rt(e),u=Le(a),c=s.operation,l=c?c.charAt(0).toUpperCase()+c.slice(1):"Query",f=(p=this).cache,h=p.client,d={fragmentMap:u,context:M(M({},r),{cache:f,client:h}),variables:n,fragmentMatcher:i,defaultOperationType:l,exportedVariables:{},onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(s.selectionSet,t,d).then((function(e){return{result:e,exportedVariables:d.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,r){return C(this,void 0,void 0,(function(){var n,i,o,s,a,u=this;return T(this,(function(c){return n=r.fragmentMap,i=r.context,o=r.variables,s=[t],a=function(e){return C(u,void 0,void 0,(function(){var a,u;return T(this,(function(c){return Fe(e,o)?Ke(e)?[2,this.resolveField(e,t,r).then((function(t){var r;void 0!==t&&s.push(((r={})[Ye(e)]=t,r))}))]:(Xe(e)?a=e:(a=n[e.name.value],"production"===process.env.NODE_ENV?fe(a,11):fe(a,"No fragment named "+e.name.value)),a&&a.typeCondition&&(u=a.typeCondition.name.value,r.fragmentMatcher(t,u,i))?[2,this.resolveSelectionSet(a.selectionSet,t,r).then((function(e){s.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(a)).then((function(){return mt(s)}))]}))}))},e.prototype.resolveField=function(e,t,r){return C(this,void 0,void 0,(function(){var n,i,o,s,a,u,c,l,p,f=this;return T(this,(function(h){return n=r.variables,i=e.name.value,o=Ye(e),s=i!==o,a=t[o]||t[i],u=Promise.resolve(a),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(c=t.__typename||r.defaultOperationType,(l=this.resolvers&&this.resolvers[c])&&(p=l[s?i:o])&&(u=Promise.resolve(Pn.withValue(this.cache,p,[t,Ge(e,n),r.context,{field:e,fragmentMap:r.fragmentMap}])))),[2,u.then((function(t){return void 0===t&&(t=a),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?f.resolveSubSelectedArray(e,t,r):e.selectionSet?f.resolveSelectionSet(e.selectionSet,t,r):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,r){var n=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?n.resolveSubSelectedArray(e,t,r):e.selectionSet?n.resolveSelectionSet(e.selectionSet,t,r):void 0})))},e}(),Yn=new(Mt?WeakMap:Map);function Hn(e,t){var r=e[t];"function"==typeof r&&(e[t]=function(){return Yn.set(e,(Yn.get(e)+1)%1e15),r.apply(this,arguments)})}function Kn(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Xn=function(){function e(e){this.cache=e,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.diff=null,this.observableQuery=null,Yn.has(e)||(Yn.set(e,0),Hn(e,"evict"),Hn(e,"modify"),Hn(e,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||yr.loading;return this.variables&&this.networkStatus!==yr.loading&&!cr(this.variables,e.variables)&&(t=yr.setVariables),cr(e.variables,this.variables)||(this.diff=null),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.getDiff=function(e){return void 0===e&&(e=this.variables),this.diff&&cr(e,this.variables)?this.diff:(this.updateWatch(this.variables=e),this.diff=this.cache.diff({query:this.document,variables:e,returnPartialData:!0,optimistic:!0}))},e.prototype.setDiff=function(e){var t=this,r=this.diff;this.diff=e,this.dirty||(e&&e.result)===(r&&r.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():e.reobserve()})):delete this.oqListener)},e.prototype.notify=function(){var e=this;Kn(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(br(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.cancel(),delete this.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var e=this.observableQuery;e&&e.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var r=this.observableQuery;r&&"no-cache"===r.options.fetchPolicy||this.lastWatch&&this.lastWatch.query===this.document&&cr(e,this.lastWatch.variables)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch={query:this.document,variables:e,optimistic:!0,callback:function(e){return t.setDiff(e)}}))},e.prototype.shouldWrite=function(e,t){var r=this.lastWrite;return!(r&&r.dmCount===Yn.get(this.cache)&&cr(t,r.variables)&&cr(e.data,r.result.data))},e.prototype.markResult=function(e,t,r){var n=this;this.graphQLErrors=Rt(e.errors)?e.errors:[],Kn(this),"no-cache"===t.fetchPolicy?this.diff={result:e.data,complete:!0}:r&&(Zn(e,t.errorPolicy)?this.cache.performTransaction((function(r){if(n.shouldWrite(e,t.variables))r.writeQuery({query:n.document,data:e.data,variables:t.variables}),n.lastWrite={result:e,variables:t.variables,dmCount:Yn.get(n.cache)};else if(n.diff&&n.diff.complete)return void(e.data=n.diff.result);var i=r.diff({query:n.document,variables:t.variables,returnPartialData:!0,optimistic:!0});n.stopped||n.updateWatch(t.variables),n.diff=i,i.complete&&(e.data=i.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=yr.ready},e.prototype.markError=function(e){return this.networkStatus=yr.error,this.lastWrite=void 0,Kn(this),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function Zn(e,t){void 0===t&&(t="none");var r="ignore"===t||"all"===t,n=!jt(e);return!n&&r&&e.data&&(n=!0),n}var ei=Object.prototype.hasOwnProperty,ti=function(){function e(e){var t=e.cache,r=e.link,n=e.queryDeduplication,i=void 0!==n&&n,o=e.onBroadcast,s=e.ssrMode,a=void 0!==s&&s,u=e.clientAwareness,c=void 0===u?{}:u,l=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Mt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=r,this.queryDeduplication=i,this.clientAwareness=c,this.localState=l||new Gn({cache:t}),this.ssrMode=a,this.assumeImmutableResults=!!p,(this.onBroadcast=o)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.cancelPendingFetches("production"===process.env.NODE_ENV?new pe(12):new pe("QueryManager stopped while query was in flight"))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t=e.mutation,r=e.variables,n=e.optimisticResponse,i=e.updateQueries,o=e.refetchQueries,s=void 0===o?[]:o,a=e.awaitRefetchQueries,u=void 0!==a&&a,c=e.update,l=e.errorPolicy,p=void 0===l?"none":l,f=e.fetchPolicy,h=e.context,d=void 0===h?{}:h;return C(this,void 0,void 0,(function(){var e,o,a;return T(this,(function(l){switch(l.label){case 0:return"production"===process.env.NODE_ENV?fe(t,13):fe(t,"mutation option is required. You must specify your GraphQL document in the mutation option."),"production"===process.env.NODE_ENV?fe(!f||"no-cache"===f,14):fe(!f||"no-cache"===f,"Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior."),e=this.generateMutationId(),t=this.transform(t).document,r=this.getVariables(t,r),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,r,d)]:[3,2];case 1:r=l.sent(),l.label=2;case 2:return o=this.mutationStore&&(this.mutationStore[e]={mutation:t,variables:r,loading:!0,error:null}),n&&this.markMutationOptimistic(n,{mutationId:e,document:t,variables:r,errorPolicy:p,updateQueries:i,update:c}),this.broadcastQueries(),a=this,[2,new Promise((function(l,h){var v,y;a.getObservableFromLink(t,M(M({},d),{optimisticResponse:n}),r,!1).subscribe({next:function(n){if(jt(n)&&"none"===p)y=new mr({graphQLErrors:n.errors});else{if(o&&(o.loading=!1,o.error=null),"no-cache"!==f)try{a.markMutationResult({mutationId:e,result:n,document:t,variables:r,errorPolicy:p,updateQueries:i,update:c})}catch(e){return void(y=new mr({networkError:e}))}v=n}},error:function(t){o&&(o.loading=!1,o.error=t),n&&a.cache.removeOptimistic(e),a.broadcastQueries(),h(new mr({networkError:t}))},complete:function(){if(y&&o&&(o.loading=!1,o.error=y),n&&a.cache.removeOptimistic(e),a.broadcastQueries(),y)h(y);else{"function"==typeof s&&(s=s(v));var t=[];Rt(s)&&s.forEach((function(e){if("string"==typeof e)a.queries.forEach((function(r){var n=r.observableQuery;n&&n.queryName===e&&t.push(n.refetch())}));else{var r={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(r.context=e.context),t.push(a.query(r))}})),Promise.all(u?t:[]).then((function(){"ignore"===p&&v&&jt(v)&&delete v.errors,l(v)}),h)}}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var r=this;if(void 0===t&&(t=this.cache),Zn(e.result,e.errorPolicy)){var n=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],i=e.updateQueries;i&&this.queries.forEach((function(o,s){var a=o.observableQuery,u=a&&a.queryName;if(u&&ei.call(i,u)){var c=i[u],l=r.queries.get(s),p=l.document,f=l.variables,h=t.diff({query:p,variables:f,returnPartialData:!0,optimistic:!1}),d=h.result;if(h.complete&&d){var v=c(d,{mutationResult:e.result,queryName:p&&tt(p)||void 0,queryVariables:f});v&&n.push({result:v,dataId:"ROOT_QUERY",query:p,variables:f})}}})),t.performTransaction((function(t){n.forEach((function(e){return t.write(e)}));var r=e.update;r&&r(t,e.result)}),null)}},e.prototype.markMutationOptimistic=function(e,t){var r=this,n="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{r.markMutationResult(M(M({},t),{result:{data:n}}),e)}catch(e){"production"===process.env.NODE_ENV||fe.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,r){return this.fetchQueryObservable(e,t,r).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,r){e[r]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t,r=this.transformCache;if(!r.has(e)){var n=this.cache.transformDocument(e),i=(t=this.cache.transformForLink(n),lt([ft],Ze(t))),o=this.localState.clientQuery(n),s=i&&this.localState.serverQuery(i),a={document:n,hasClientExports:Ve(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:o,serverQuery:s,defaultVars:it(et(n))},u=function(e){e&&!r.has(e)&&r.set(e,a)};u(e),u(n),u(o),u(s)}return r.get(e)},e.prototype.getVariables=function(e,t){return M(M({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=M(M({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new Xn(this.cache),r=new Or({queryManager:this,queryInfo:t,options:e});return this.queries.set(r.queryId,t),t.init({document:e.query,observableQuery:r,variables:e.variables}),r},e.prototype.query=function(e){var t=this;"production"===process.env.NODE_ENV?fe(e.query,15):fe(e.query,"query option is required. You must specify your GraphQL document in the query option."),"production"===process.env.NODE_ENV?fe("Document"===e.query.kind,16):fe("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'),"production"===process.env.NODE_ENV?fe(!e.returnPartialData,17):fe(!e.returnPartialData,"returnPartialData option only supported on watchQuery."),"production"===process.env.NODE_ENV?fe(!e.pollInterval,18):fe(!e.pollInterval,"pollInterval option only supported on watchQuery.");var r=this.generateQueryId();return this.fetchQuery(r,e).finally((function(){return t.stopQuery(r)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(){return this.cancelPendingFetches("production"===process.env.NODE_ENV?new pe(19):new pe("Store reset while query was in flight (not completed in link chain)")),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=yr.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then((function(){return e.reFetchObservableQueries()}))},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.queries.forEach((function(n,i){var o=n.observableQuery;if(o&&o.hasObservers()){var s=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===s||!e&&"standby"===s||r.push(o.refetch()),t.getQuery(i).setDiff(null)}})),this.broadcastQueries(),Promise.all(r)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.errorPolicy,o=e.variables,s=e.context,a=void 0===s?{}:s;r=this.transform(r).document,o=this.getVariables(r,o);var u=function(e){return t.getObservableFromLink(r,a,e,!1).map((function(o){if("no-cache"!==n&&(Zn(o,i)&&t.cache.write({query:r,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),jt(o))throw new mr({graphQLErrors:o.errors});return o}))};if(this.transform(r).hasClientExports){var c=this.localState.addExportedVariables(r,o,a).then(u);return new q.default((function(e){var t=null;return c.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return u(o)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.getQuery(e).stop(),this.queries.delete(e)},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,n){var i,o,s=this;void 0===n&&(n=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var a=this.transform(e).serverQuery;if(a){var u=this.inFlightLinkObservables,c=this.link,l={query:a,variables:r,operationName:tt(a)||void 0,context:this.prepareContext(M(M({},t),{forceFetch:!n}))};if(t=l.context,n){var p=u.get(a)||new Map;u.set(a,p);var f=JSON.stringify(r);if(!(o=p.get(f))){var h=new _t([Ut(c,l)]);p.set(f,o=h),h.cleanup((function(){p.delete(f)&&p.size<1&&u.delete(a)}))}}else o=new _t([Ut(c,l)])}else o=new _t([q.default.of({data:{}})]),t=this.prepareContext(t);var d=this.transform(e).clientQuery;return d&&(o=Pt(o,(function(e){return s.localState.runResolvers({document:d,remoteResult:e,context:t,variables:r})}))),o},e.prototype.getResultsFromLink=function(e,t,r){var n=e.lastRequestId;return Pt(this.getObservableFromLink(e.document,r.context,r.variables),(function(i){var o=Rt(i.errors);if(n>=e.lastRequestId){if(o&&"none"===r.errorPolicy)throw e.markError(new mr({graphQLErrors:i.errors}));e.markResult(i,r,t),e.markReady()}var s={data:i.data,loading:!1,networkStatus:e.networkStatus||yr.ready};return o&&"ignore"!==r.errorPolicy&&(s.errors=i.errors),s}),(function(t){var r=vr(t)?t:new mr({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=yr.loading);var i=this.transform(t.query).document,o=this.getVariables(i,t.variables),s=this.getQuery(e),a=s.networkStatus,u=t.fetchPolicy,c=void 0===u?"cache-first":u,l=t.errorPolicy,p=void 0===l?"none":l,f=t.returnPartialData,h=void 0!==f&&f,d=t.notifyOnNetworkStatusChange,v=void 0!==d&&d,y=t.context,m=void 0===y?{}:y;("cache-first"===c||"cache-and-network"===c||"network-only"===c||"no-cache"===c)&&v&&"number"==typeof a&&a!==r&&br(r)&&("cache-first"!==c&&(c="cache-and-network"),h=!0);var b=Object.assign({},t,{query:i,variables:o,fetchPolicy:c,errorPolicy:p,returnPartialData:h,notifyOnNetworkStatusChange:v,context:m}),g=function(e){return b.variables=e,n.fetchQueryByPolicy(s,b,r)};this.fetchCancelFns.set(e,(function(e){Promise.resolve().then((function(){return w.cancel(e)}))}));var w=new _t(this.transform(b.query).hasClientExports?this.localState.addExportedVariables(b.query,b.variables,b.context).then(g):g(b.variables));return w.cleanup((function(){n.fetchCancelFns.delete(e);var r=t.nextFetchPolicy;r&&(t.nextFetchPolicy=void 0,t.fetchPolicy="function"==typeof r?r.call(t,t.fetchPolicy||"cache-first"):r)})),w},e.prototype.fetchQueryByPolicy=function(e,t,r){var n=this,i=t.query,o=t.variables,s=t.fetchPolicy,a=t.errorPolicy,u=t.returnPartialData,c=t.context;e.init({document:i,variables:o,lastRequestId:this.generateRequestId(),networkStatus:r});var l=function(){return e.getDiff(o)},p=function(t,r){void 0===r&&(r=e.networkStatus||yr.loading);var s=t.result;"production"===process.env.NODE_ENV||!Rt(t.missing)||cr(s,{})||u||"production"===process.env.NODE_ENV||fe.warn("Missing cache result fields: "+t.missing.map((function(e){return e.path.join(".")})).join(", "),t.missing);var a=function(e){return q.default.of(M({data:e,loading:br(r),networkStatus:r},t.complete?null:{partial:!0}))};return n.transform(i).hasForcedResolvers?n.localState.runResolvers({document:i,remoteResult:{data:s},context:c,variables:o,onlyRunForcedResolvers:!0}).then((function(e){return a(e.data)})):a(s)},f=function(t){return n.getResultsFromLink(e,t,{variables:o,context:c,fetchPolicy:s,errorPolicy:a})};switch(s){default:case"cache-first":return(h=l()).complete?[p(h,e.markReady())]:u?[p(h),f(!0)]:[f(!0)];case"cache-and-network":var h;return(h=l()).complete||u?[p(h),f(!0)]:[f(!0)];case"cache-only":return[p(l(),e.markReady())];case"network-only":return[f(!0)];case"no-cache":return[f(!1)];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Xn(this.cache)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return M(M({},t),{clientAwareness:this.clientAwareness})},e}(),ri=!1;function ni(e,t){return Qt(e,t,t.variables&&{variables:M(M({},e.variables),t.variables)})}var ii=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,i=e.headers,o=e.cache,s=e.ssrMode,a=void 0!==s&&s,u=e.ssrForceFetchDelay,c=void 0===u?0:u,l=e.connectToDevTools,p=void 0===l?"object"==typeof window&&!window.__APOLLO_CLIENT__&&"production"!==process.env.NODE_ENV:l,f=e.queryDeduplication,h=void 0===f||f,d=e.defaultOptions,v=e.assumeImmutableResults,y=void 0!==v&&v,m=e.resolvers,b=e.typeDefs,g=e.fragmentMatcher,w=e.name,O=e.version,S=e.link;if(S||(S=r?new nr({uri:r,credentials:n,headers:i}):Lt.empty()),!o)throw"production"===process.env.NODE_ENV?new pe(9):new pe("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs");this.link=S,this.cache=o,this.disableNetworkFetches=a||c>0,this.queryDeduplication=h,this.defaultOptions=d||{},this.typeDefs=b,c&&setTimeout((function(){return t.disableNetworkFetches=!1}),c),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),p&&(window.__APOLLO_CLIENT__=this),ri||"production"===process.env.NODE_ENV||(ri=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&void 0===window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("Chrome")>-1&&console.debug("Download the Apollo DevTools for a better development experience: https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm")),this.version="local",this.localState=new Gn({cache:o,client:this,resolvers:m,fragmentMatcher:g}),this.queryManager=new ti({cache:this.cache,link:this.link,queryDeduplication:h,ssrMode:a,clientAwareness:{name:w,version:O},localState:this.localState,assumeImmutableResults:y,onBroadcast:p?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=ni(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=M(M({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=ni(this.defaultOptions.query,e)),"production"===process.env.NODE_ENV?fe("cache-and-network"!==e.fetchPolicy,10):fe("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=M(M({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=ni(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Ut(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}();ye("warn");var oi=_.default.resetCaches,si=_.default.disableFragmentWarnings,ai=_.default.enableExperimentalFragmentVariables,ui=_.default.disableExperimentalFragmentVariables,ci=new(Mt?WeakMap:Map);function li(){var e=ci.get(x.default.createContext);return e||(e=x.default.createContext({}),ci.set(x.default.createContext,e)),e}var pi;!function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"}(pi||(pi={}));var fi=new Map;function hi(e){var t;switch(e){case pi.Query:t="Query";break;case pi.Mutation:t="Mutation";break;case pi.Subscription:t="Subscription"}return t}function di(e){var t,r,n=fi.get(e);if(n)return n;"production"===process.env.NODE_ENV?fe(!!e&&!!e.kind,34):fe(!!e&&!!e.kind,"Argument of "+e+" passed to parser was not a valid GraphQL DocumentNode. You may need to use 'graphql-tag' or another method to convert your operation into a document");var i=e.definitions.filter((function(e){return"FragmentDefinition"===e.kind})),o=e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&"query"===e.operation})),s=e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})),a=e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&"subscription"===e.operation}));"production"===process.env.NODE_ENV?fe(!i.length||o.length||s.length||a.length,35):fe(!i.length||o.length||s.length||a.length,"Passing only a fragment to 'graphql' is not yet supported. You must include a query, subscription or mutation as well"),"production"===process.env.NODE_ENV?fe(o.length+s.length+a.length<=1,36):fe(o.length+s.length+a.length<=1,"react-apollo only supports a query, subscription, or a mutation per HOC. "+e+" had "+o.length+" queries, "+a.length+" subscriptions and "+s.length+" mutations. You can use 'compose' to join multiple operation types to a component"),r=o.length?pi.Query:pi.Mutation,o.length||s.length||(r=pi.Subscription);var u=o.length?o:s.length?s:a;"production"===process.env.NODE_ENV?fe(1===u.length,37):fe(1===u.length,"react-apollo only supports one definition per HOC. "+e+" had "+u.length+" definitions. You can use 'compose' to join multiple operation types to a component");var c=u[0];t=c.variableDefinitions||[];var l={name:c.name&&"Name"===c.name.kind?c.name.value:"data",type:r,variables:t};return fi.set(e,l),l}var vi=function(){function e(e,t){this.isMounted=!1,this.previousOptions={},this.context={},this.options={},this.options=e||{},this.context=t||{}}return e.prototype.getOptions=function(){return this.options},e.prototype.setOptions=function(e,t){void 0===t&&(t=!1),t&&!cr(this.options,e)&&(this.previousOptions=this.options),this.options=e},e.prototype.unmount=function(){this.isMounted=!1},e.prototype.refreshClient=function(){var e=this.options&&this.options.client||this.context&&this.context.client;"production"===process.env.NODE_ENV?fe(!!e,29):fe(!!e,'Could not find "client" in the context or passed in as an option. Wrap the root component in an <ApolloProvider>, or pass an ApolloClient instance in via options.');var t=!1;return e!==this.client&&(t=!0,this.client=e,this.cleanup()),{client:this.client,isNew:t}},e.prototype.verifyDocumentType=function(e,t){var r=di(e),n=hi(t),i=hi(r.type);"production"===process.env.NODE_ENV?fe(r.type===t,30):fe(r.type===t,"Running a "+n+" requires a graphql "+n+", but a "+i+" was used instead.")},e}(),yi=function(e){function t(t){var r=t.options,n=t.context,i=t.setResult,o=e.call(this,r,n)||this;return o.currentObservable={},o.setResult=i,o.initialize(r),o}return j(t,e),t.prototype.execute=function(e){if(!0===this.getOptions().skip)return this.cleanup(),{loading:!1,error:void 0,data:void 0,variables:this.getOptions().variables};var t=e;this.refreshClient().isNew&&(t=this.getLoadingResult());var r=this.getOptions().shouldResubscribe;return"function"==typeof r&&(r=!!r(this.getOptions())),!1!==r&&this.previousOptions&&Object.keys(this.previousOptions).length>0&&(this.previousOptions.subscription!==this.getOptions().subscription||!cr(this.previousOptions.variables,this.getOptions().variables)||this.previousOptions.skip!==this.getOptions().skip)&&(this.cleanup(),t=this.getLoadingResult()),this.initialize(this.getOptions()),this.startSubscription(),this.previousOptions=this.getOptions(),M(M({},t),{variables:this.getOptions().variables})},t.prototype.afterExecute=function(){this.isMounted=!0},t.prototype.cleanup=function(){this.endSubscription(),delete this.currentObservable.query},t.prototype.initialize=function(e){this.currentObservable.query||!0===this.getOptions().skip||(this.currentObservable.query=this.refreshClient().client.subscribe({query:e.subscription,variables:e.variables,fetchPolicy:e.fetchPolicy}))},t.prototype.startSubscription=function(){this.currentObservable.subscription||(this.currentObservable.subscription=this.currentObservable.query.subscribe({next:this.updateCurrentData.bind(this),error:this.updateError.bind(this),complete:this.completeSubscription.bind(this)}))},t.prototype.getLoadingResult=function(){return{loading:!0,error:void 0,data:void 0}},t.prototype.updateResult=function(e){this.isMounted&&this.setResult(e)},t.prototype.updateCurrentData=function(e){var t=this.getOptions().onSubscriptionData;this.updateResult({data:e.data,loading:!1,error:void 0}),t&&t({client:this.refreshClient().client,subscriptionData:e})},t.prototype.updateError=function(e){this.updateResult({error:e,loading:!1})},t.prototype.completeSubscription=function(){var e=this.getOptions().onSubscriptionComplete;e&&e(),this.endSubscription()},t.prototype.endSubscription=function(){this.currentObservable.subscription&&(this.currentObservable.subscription.unsubscribe(),delete this.currentObservable.subscription)},t}(vi),mi=function(e){function t(t){var r=t.options,n=t.context,i=t.result,o=t.setResult,s=e.call(this,r,n)||this;return s.runMutation=function(e){void 0===e&&(e={}),s.onMutationStart();var t=s.generateNewMutationId();return s.mutate(e).then((function(e){return s.onMutationCompleted(e,t),e})).catch((function(e){if(s.onMutationError(e,t),!s.getOptions().onError)throw e}))},s.verifyDocumentType(r.mutation,pi.Mutation),s.result=i,s.setResult=o,s.mostRecentMutationId=0,s}return j(t,e),t.prototype.execute=function(e){return this.isMounted=!0,this.verifyDocumentType(this.getOptions().mutation,pi.Mutation),[this.runMutation,M(M({},e),{client:this.refreshClient().client})]},t.prototype.afterExecute=function(){return this.isMounted=!0,this.unmount.bind(this)},t.prototype.cleanup=function(){},t.prototype.mutate=function(e){return this.refreshClient().client.mutate(ni(this.getOptions(),e))},t.prototype.onMutationStart=function(){this.result.loading||this.getOptions().ignoreResults||this.updateResult({loading:!0,error:void 0,data:void 0,called:!0})},t.prototype.onMutationCompleted=function(e,t){var r=this.getOptions(),n=r.onCompleted,i=r.ignoreResults,o=e.data,s=e.errors,a=s&&s.length>0?new mr({graphQLErrors:s}):void 0;this.isMostRecentMutation(t)&&!i&&this.updateResult({called:!0,loading:!1,data:o,error:a}),n&&n(o)},t.prototype.onMutationError=function(e,t){var r=this.getOptions().onError;this.isMostRecentMutation(t)&&this.updateResult({loading:!1,error:e,data:void 0,called:!0}),r&&r(e)},t.prototype.generateNewMutationId=function(){return++this.mostRecentMutationId},t.prototype.isMostRecentMutation=function(e){return this.mostRecentMutationId===e},t.prototype.updateResult=function(e){!this.isMounted||this.previousResult&&cr(this.previousResult,e)||(this.setResult(e),this.previousResult=e)},t}(vi),bi=function(e){function t(t){var r=t.options,n=t.context,i=t.onNewData,o=e.call(this,r,n)||this;return o.runLazy=!1,o.previous=Object.create(null),o.runLazyQuery=function(e){o.cleanup(),o.runLazy=!0,o.lazyOptions=e,o.onNewData()},o.getQueryResult=function(){var e=o.observableQueryFields(),t=o.getOptions();if(t.skip)e=M(M({},e),{data:void 0,error:void 0,loading:!1,called:!0});else if(o.currentObservable){var r=o.currentObservable.getCurrentResult(),n=r.data,i=r.loading,s=r.partial,a=r.networkStatus,u=r.errors,c=r.error;if(u&&u.length>0&&(c=new mr({graphQLErrors:u})),e=M(M({},e),{data:n,loading:i,networkStatus:a,error:c,called:!0}),i);else if(c)Object.assign(e,{data:(o.currentObservable.getLastResult()||{}).data});else{var l=o.currentObservable.options.fetchPolicy;if(t.partialRefetch&&s&&(!n||0===Object.keys(n).length)&&"cache-only"!==l)return Object.assign(e,{loading:!0,networkStatus:yr.loading}),e.refetch(),e}}e.client=o.client,o.setOptions(t,!0);var p=o.previous.result;return o.previous.loading=p&&p.loading||!1,e.previousData=p&&(p.data||p.previousData),o.previous.result=e,o.currentObservable&&o.currentObservable.resetQueryStoreErrors(),e},o.obsRefetch=function(e){var t;return null===(t=o.currentObservable)||void 0===t?void 0:t.refetch(e)},o.obsFetchMore=function(e){return o.currentObservable.fetchMore(e)},o.obsUpdateQuery=function(e){return o.currentObservable.updateQuery(e)},o.obsStartPolling=function(e){var t;null===(t=o.currentObservable)||void 0===t||t.startPolling(e)},o.obsStopPolling=function(){var e;null===(e=o.currentObservable)||void 0===e||e.stopPolling()},o.obsSubscribeToMore=function(e){return o.currentObservable.subscribeToMore(e)},o.onNewData=i,o}return j(t,e),t.prototype.execute=function(){this.refreshClient();var e=this.getOptions(),t=e.skip,r=e.query;return(t||r!==this.previous.query)&&(this.removeQuerySubscription(),this.removeObservable(!t),this.previous.query=r),this.updateObservableQuery(),this.isMounted&&this.startQuerySubscription(),this.getExecuteSsrResult()||this.getExecuteResult()},t.prototype.executeLazy=function(){return this.runLazy?[this.runLazyQuery,this.execute()]:[this.runLazyQuery,{loading:!1,networkStatus:yr.ready,called:!1,data:void 0}]},t.prototype.fetchData=function(){var e=this,t=this.getOptions();return!t.skip&&!1!==t.ssr&&new Promise((function(t){return e.startQuerySubscription(t)}))},t.prototype.afterExecute=function(e){var t=(void 0===e?{}:e).lazy,r=void 0!==t&&t;return this.isMounted=!0,r&&!this.runLazy||this.handleErrorOrCompleted(),this.previousOptions=this.getOptions(),this.unmount.bind(this)},t.prototype.cleanup=function(){this.removeQuerySubscription(),this.removeObservable(!0),delete this.previous.result},t.prototype.getOptions=function(){var t=e.prototype.getOptions.call(this);return this.lazyOptions&&(t.variables=M(M({},t.variables),this.lazyOptions.variables),t.context=M(M({},t.context),this.lazyOptions.context)),this.runLazy&&delete t.skip,t},t.prototype.ssrInitiated=function(){return this.context&&this.context.renderPromises},t.prototype.getExecuteResult=function(){var e=this.getQueryResult();return this.startQuerySubscription(),e},t.prototype.getExecuteSsrResult=function(){var e,t=this.getOptions(),r=t.ssr,n=t.skip,i=!1===r||n,o=this.refreshClient().client.disableNetworkFetches,s=M({loading:!0,networkStatus:yr.loading,called:!0,data:void 0,stale:!1,client:this.client},this.observableQueryFields());return i&&(this.ssrInitiated()||o)?(this.previous.result=s,s):(this.ssrInitiated()&&(e=this.context.renderPromises.addQueryPromise(this,this.getQueryResult)||s),e)},t.prototype.prepareObservableQueryOptions=function(){var e=this.getOptions();this.verifyDocumentType(e.query,pi.Query);var t=e.displayName||"Query";return!this.ssrInitiated()||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e.fetchPolicy="cache-first"),M(M({},e),{displayName:t,context:e.context})},t.prototype.initializeObservableQuery=function(){if(this.ssrInitiated()&&(this.currentObservable=this.context.renderPromises.getSSRObservable(this.getOptions())),!this.currentObservable){var e=this.prepareObservableQueryOptions();this.previous.observableQueryOptions=M(M({},e),{children:null}),this.currentObservable=this.refreshClient().client.watchQuery(M({},e)),this.ssrInitiated()&&this.context.renderPromises.registerSSRObservable(this.currentObservable,e)}},t.prototype.updateObservableQuery=function(){if(this.currentObservable){if(!this.getOptions().skip){var e=M(M({},this.prepareObservableQueryOptions()),{children:null});cr(e,this.previous.observableQueryOptions)||(this.previous.observableQueryOptions=e,this.currentObservable.setOptions(e).catch((function(){})))}}else this.initializeObservableQuery()},t.prototype.startQuerySubscription=function(e){var t=this;void 0===e&&(e=this.onNewData),this.currentSubscription||this.getOptions().skip||(this.currentSubscription=this.currentObservable.subscribe({next:function(r){var n=r.loading,i=r.networkStatus,o=r.data,s=t.previous.result;s&&s.loading===n&&s.networkStatus===i&&cr(s.data,o)||e()},error:function(r){if(t.resubscribeToQuery(),!r.hasOwnProperty("graphQLErrors"))throw r;var n=t.previous.result;(n&&n.loading||!cr(r,t.previous.error))&&(t.previous.error=r,e())}}))},t.prototype.resubscribeToQuery=function(){this.removeQuerySubscription();var e=this.currentObservable;if(e){var t=e.getLastError(),r=e.getLastResult();e.resetLastResults(),this.startQuerySubscription(),Object.assign(e,{lastError:t,lastResult:r})}},t.prototype.handleErrorOrCompleted=function(){if(this.currentObservable&&this.previous.result){var e=this.previous.result,t=e.data,r=e.loading,n=e.error;if(!r){var i=this.getOptions(),o=i.query,s=i.variables,a=i.onCompleted,u=i.onError,c=i.skip;if(this.previousOptions&&!this.previous.loading&&cr(this.previousOptions.query,o)&&cr(this.previousOptions.variables,s))return;!a||n||c?u&&n&&u(n):a(t)}}},t.prototype.removeQuerySubscription=function(){this.currentSubscription&&(this.currentSubscription.unsubscribe(),delete this.currentSubscription)},t.prototype.removeObservable=function(e){this.currentObservable&&(this.currentObservable.tearDownQuery(),e&&delete this.currentObservable)},t.prototype.observableQueryFields=function(){var e;return{variables:null===(e=this.currentObservable)||void 0===e?void 0:e.variables,refetch:this.obsRefetch,fetchMore:this.obsFetchMore,updateQuery:this.obsUpdateQuery,startPolling:this.obsStartPolling,stopPolling:this.obsStopPolling,subscribeToMore:this.obsSubscribeToMore}},t}(vi);function gi(e,t,r){void 0===r&&(r=!1);var n=u.useContext(li()),i=u.useReducer((function(e){return e+1}),0),o=i[0],s=i[1],a=t?M(M({},t),{query:e}):{query:e},c=u.useRef(),l=c.current||new bi({options:a,context:n,onNewData:function(){l.ssrInitiated()?s():Promise.resolve().then(s)}});l.setOptions(a),l.context=n,l.ssrInitiated()&&!c.current&&(c.current=l);var p,f,h,d={options:M(M({},a),{onError:void 0,onCompleted:void 0}),context:n,tick:o},v=(p=function(){return r?l.executeLazy():l.execute()},f=d,(h=u.useRef()).current&&cr(f,h.current.key)||(h.current={key:f,value:p()}),h.current.value),y=r?v[1]:v;return u.useEffect((function(){return c.current||(c.current=l),function(){return l.cleanup()}}),[]),u.useEffect((function(){return l.afterExecute({lazy:r})}),[y.loading,y.networkStatus,y.error,y.data]),v}var wi=Object.freeze({__proto__:null,ApolloClient:ii,mergeOptions:ni,ObservableQuery:Or,get NetworkStatus(){return yr},isApolloError:vr,ApolloError:mr,get Cache(){return tn},ApolloCache:rn,InMemoryCache:Jn,MissingFieldError:nn,defaultDataIdFromObject:Qn,makeVar:Rn,fromError:Ct,toPromise:function(e){var t=!1;return new Promise((function(r,n){e.subscribe({next:function(e){t?"production"===process.env.NODE_ENV||fe.warn("Promise Wrapper does not support multiple results from Observable"):(t=!0,r(e))},error:n})}))},fromPromise:function(e){return new q.default((function(t){e.then((function(e){t.next(e),t.complete()})).catch(t.error.bind(t))}))},throwServerError:Tt,Observable:q.default,isReference:$e,makeReference:Be,empty:zt,from:Bt,split:$t,concat:Wt,execute:Ut,ApolloLink:Lt,parseAndCheckHttpResponse:Gt,serializeFetchParameter:Yt,fallbackHttpConfig:Ht,selectHttpOptionsAndBody:Kt,checkFetcher:Xt,createSignalIfSupported:Zt,selectURI:er,createHttpLink:rr,HttpLink:nr,rewriteURIForGET:tr,setLogVerbosity:ye,resetCaches:oi,disableFragmentWarnings:si,enableExperimentalFragmentVariables:ai,disableExperimentalFragmentVariables:ui,gql:_.default,ApolloProvider:function(e){var t=e.client,r=e.children,n=li();return x.default.createElement(n.Consumer,null,(function(e){return void 0===e&&(e={}),t&&e.client!==t&&(e=Object.assign({},e,{client:t})),"production"===process.env.NODE_ENV?fe(e.client,28):fe(e.client,'ApolloProvider was not passed a client instance. Make sure you pass in your client via the "client" prop.'),x.default.createElement(n.Provider,{value:e},r)}))},ApolloConsumer:function(e){var t=li();return x.default.createElement(t.Consumer,null,(function(t){return"production"===process.env.NODE_ENV?fe(t&&t.client,27):fe(t&&t.client,'Could not find "client" in the context of ApolloConsumer. Wrap the root component in an <ApolloProvider>.'),e.children(t.client)}))},getApolloContext:li,resetApolloContext:li,get DocumentType(){return pi},operationName:hi,parser:di,useApolloClient:function(){var e=x.default.useContext(li()).client;return"production"===process.env.NODE_ENV?fe(e,33):fe(e,"No Apollo Client instance can be found. Please ensure that you have called `ApolloProvider` higher up in your tree."),e},useLazyQuery:function(e,t){return gi(e,t,!0)},useMutation:function(e,t){var r=u.useContext(li()),n=u.useState({called:!1,loading:!1}),i=n[0],o=n[1],s=t?M(M({},t),{mutation:e}):{mutation:e},a=u.useRef(),c=(a.current||(a.current=new mi({options:s,context:r,result:i,setResult:o})),a.current);return c.setOptions(s),c.context=r,u.useEffect((function(){return c.afterExecute()})),c.execute(i)},useQuery:function(e,t){return gi(e,t,!1)},useSubscription:function(e,t){var r=u.useContext(li()),n=t?M(M({},t),{subscription:e}):{subscription:e},i=u.useState({loading:!n.skip,error:void 0,data:void 0}),o=i[0],s=i[1],a=u.useRef(),c=(a.current||(a.current=new yi({options:n,context:r,setResult:s})),a.current);return c.setOptions(n,!0),c.context=r,u.useEffect((function(){return c.afterExecute()})),u.useEffect((function(){return c.cleanup.bind(c)}),[]),c.execute(o)},useReactiveVar:function(e){var t=e(),r=e.onNextChange(u.useState(t)[1]);return u.useEffect((function(){return r}),[]),t}});exports.PluridStillsGenerator=class{constructor(e){this.options=this.resolveOptions(e)}resolveOptions(e){var t,r;return{server:null!==(t=null==e?void 0:e.server)&&void 0!==t?t:"./build/server.js",build:null!==(r=null==e?void 0:e.build)&&void 0!==r?r:"./build/"}}initialize(){return C(this,void 0,void 0,(function*(){const t=O.default.join(process.cwd(),this.options.server),r=O.default.join(process.cwd(),this.options.build),n=require(t),i=oe.analysis(n),o=i.options.stiller,s=(yield D.default(9900))+"",a=p.fork(t,[],{stdio:"pipe",env:{PORT:s,PLURID_OPEN:"false"}}),u=[];for(const e of i.routes)e.value.includes("/:")||o.ignore.includes(e.value)||u.push(e);const c=u.map((e=>e.value));console.info("\n\tParsed the following still routes:");for(const e of c)console.info(`\t ${e}`);yield new Promise((e=>setTimeout(e,1500)));const l=Date.now(),f=3*i.routes.length;console.info(`\n\tStarting to generate stills... (this may take about ${f} seconds)\n`);const d=new ae({host:"http://localhost:"+s,routes:[...c],configuration:{waitUntil:o.waitUntil,timeout:o.timeout}}).still(),v=[];let y;for(;!(y=yield d.next()).done;)v.push(y.value);const m=(Date.now()-l)/1e3,b=1===v.length?"":"s";console.info(`\n\tGenerated ${v.length} still${b} in ${m.toFixed(2)} seconds.\n`);const g=O.default.join(r,"./stills");yield e.promises.mkdir(g,{recursive:!0});const w=[];for(const t of v){if(!t)continue;const r=h.uuid.generate()+".json",n={route:t.route,name:r};w.push(n);const i=JSON.stringify(t,null,4),o=O.default.join(g,r);yield e.promises.writeFile(o,i)}const S=O.default.join(g,"metadata.json"),E=JSON.stringify(w,null,4);yield e.promises.writeFile(S,E),a.kill(2)}))}},exports.default=oe;
2
- //# sourceMappingURL=index.min.js.map