(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[5],{SLVX:function(t,e,r){"use strict";function o(t){var e,r=t.Symbol;return"function"===typeof r?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}r.d(e,"a",(function(){return o}))},bCCX:function(t,e,r){"use strict";(function(t,o){var i,s=r("SLVX");i="undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof t?t:o;var n=Object(s.a)(i);e.a=n}).call(this,r("yLpj"),r("3UD+")(t))},dMq0:function(t,e,r){"use strict";r.d(e,"a",(function(){return d})),r.d(e,"b",(function(){return o}));var o,i=r("mrSG"),s=r("RRgQ"),n=r("qx2n"),a=r("b0dj"),u=r("1jQf"),c=r("bCCX"),l=r("qVdT"),h=r("L2ys");function p(t){return t<7}!function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"}(o||(o={}));var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype[c.a]=function(){return this},e.prototype["@@observable"]=function(){return this},e}(a.a);function y(t){return Array.isArray(t)&&t.length>0}var f,d=function(t){function e(r){var o=r.graphQLErrors,i=r.networkError,s=r.errorMessage,n=r.extraInfo,a=t.call(this,s)||this;return a.graphQLErrors=o||[],a.networkError=i||null,a.message=s||function(t){var e="";return y(t.graphQLErrors)&&t.graphQLErrors.forEach((function(t){var r=t?t.message:"Error message not found.";e+="GraphQL error: "+r+"\n"})),t.networkError&&(e+="Network error: "+t.networkError.message+"\n"),e=e.replace(/\n$/,"")}(a),a.extraInfo=n,a.__proto__=e.prototype,a}return Object(i.c)(e,t),e}(Error);!function(t){t[t.normal=1]="normal",t[t.refetch=2]="refetch",t[t.poll=3]="poll"}(f||(f={}));var v=function(t){function e(e){var r=e.queryManager,o=e.options,i=e.shouldSubscribe,n=void 0===i||i,a=t.call(this,(function(t){return a.onSubscribe(t)}))||this;a.observers=new Set,a.subscriptions=new Set,a.isTornDown=!1,a.options=o,a.variables=o.variables||{},a.queryId=r.generateQueryId(),a.shouldSubscribe=n;var u=Object(s.m)(o.query);return a.queryName=u&&u.name&&u.name.value,a.queryManager=r,a}return Object(i.c)(e,t),e.prototype.result=function(){var t=this;return new Promise((function(e,r){var o={next:function(r){e(r),t.observers.delete(o),t.observers.size||t.queryManager.removeQuery(t.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=t.subscribe(o)}))},e.prototype.currentResult=function(){var t=this.getCurrentResult();return void 0===t.data&&(t.data={}),t},e.prototype.getCurrentResult=function(){if(this.isTornDown){var t=this.lastResult;return{data:!this.lastError&&t&&t.data||void 0,error:this.lastError,loading:!1,networkStatus:o.error}}var e,r,s,n=this.queryManager.getCurrentQueryResult(this),a=n.data,u=n.partial,c=this.queryManager.queryStore.get(this.queryId),l=this.options.fetchPolicy,h="network-only"===l||"no-cache"===l;if(c){var b=c.networkStatus;if(r=c,void 0===(s=this.options.errorPolicy)&&(s="none"),r&&(r.networkError||"none"===s&&y(r.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:b,error:new d({graphQLErrors:c.graphQLErrors,networkError:c.networkError})};c.variables&&(this.options.variables=Object(i.a)(Object(i.a)({},this.options.variables),c.variables),this.variables=this.options.variables),e={data:a,loading:p(b),networkStatus:b},c.graphQLErrors&&"all"===this.options.errorPolicy&&(e.errors=c.graphQLErrors)}else{var f=h||u&&"cache-only"!==l;e={data:a,loading:f,networkStatus:f?o.loading:o.ready}}return u||this.updateLastResult(Object(i.a)(Object(i.a)({},e),{stale:!1})),Object(i.a)(Object(i.a)({},e),{partial:u})},e.prototype.isDifferentFromLastResult=function(t){var e=this.lastResultSnapshot;return!(e&&t&&e.networkStatus===t.networkStatus&&e.stale===t.stale&&Object(n.a)(e.data,t.data))},e.prototype.getLastResult=function(){return this.lastResult},e.prototype.getLastError=function(){return this.lastError},e.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){var t=this.queryManager.queryStore.get(this.queryId);t&&(t.networkError=null,t.graphQLErrors=[])},e.prototype.refetch=function(t){var e=this.options.fetchPolicy;return"cache-only"===e?Promise.reject(new l.a(1)):("no-cache"!==e&&"cache-and-network"!==e&&(e="network-only"),Object(n.a)(this.variables,t)||(this.variables=Object(i.a)(Object(i.a)({},this.variables),t)),Object(n.a)(this.options.variables,this.variables)||(this.options.variables=Object(i.a)(Object(i.a)({},this.options.variables),this.variables)),this.queryManager.fetchQuery(this.queryId,Object(i.a)(Object(i.a)({},this.options),{fetchPolicy:e}),f.refetch))},e.prototype.fetchMore=function(t){var e=this;Object(l.b)(t.updateQuery,2);var r=Object(i.a)(Object(i.a)({},t.query?t:Object(i.a)(Object(i.a)(Object(i.a)({},this.options),t),{variables:Object(i.a)(Object(i.a)({},this.variables),t.variables)})),{fetchPolicy:"network-only"}),o=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(o,r,f.normal,this.queryId).then((function(i){return e.updateQuery((function(e){return t.updateQuery(e,{fetchMoreResult:i.data,variables:r.variables})})),e.queryManager.stopQuery(o),i}),(function(t){throw e.queryManager.stopQuery(o),t}))},e.prototype.subscribeToMore=function(t){var e=this,r=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables}).subscribe({next:function(r){var o=t.updateQuery;o&&e.updateQuery((function(t,e){var i=e.variables;return o(t,{subscriptionData:r,variables:i})}))},error:function(e){t.onError&&t.onError(e)}});return this.subscriptions.add(r),function(){e.subscriptions.delete(r)&&r.unsubscribe()}},e.prototype.setOptions=function(t){var e=this.options.fetchPolicy;this.options=Object(i.a)(Object(i.a)({},this.options),t),t.pollInterval?this.startPolling(t.pollInterval):0===t.pollInterval&&this.stopPolling();var r=t.fetchPolicy;return this.setVariables(this.options.variables,e!==r&&("cache-only"===e||"standby"===e||"network-only"===r),t.fetchResults)},e.prototype.setVariables=function(t,e,r){return void 0===e&&(e=!1),void 0===r&&(r=!0),this.isTornDown=!1,t=t||this.variables,!e&&Object(n.a)(t,this.variables)?this.observers.size&&r?this.result():Promise.resolve():(this.variables=this.options.variables=t,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},e.prototype.updateQuery=function(t){var e=this.queryManager,r=e.getQueryWithPreviousResult(this.queryId),o=r.previousResult,i=r.variables,n=r.document,a=Object(s.I)((function(){return t(o,{variables:i})}));a&&(e.dataStore.markUpdateQueryResult(n,i,a),e.broadcastQueries())},e.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},e.prototype.startPolling=function(t){g(this),this.options.pollInterval=t,this.queryManager.startPollingQuery(this.options,this.queryId)},e.prototype.updateLastResult=function(t){var e=this.lastResult;return this.lastResult=t,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?t:Object(s.f)(t),e},e.prototype.onSubscribe=function(t){var e=this;try{var r=t._subscription._observer;r&&!r.error&&(r.error=O)}catch(i){}var o=!this.observers.size;return this.observers.add(t),t.next&&this.lastResult&&t.next(this.lastResult),t.error&&this.lastError&&t.error(this.lastError),o&&this.setUpQuery(),function(){e.observers.delete(t)&&!e.observers.size&&e.tearDownQuery()}},e.prototype.setUpQuery=function(){var t=this,e=this.queryManager,r=this.queryId;this.shouldSubscribe&&e.addObservableQuery(r,this),this.options.pollInterval&&(g(this),e.startPollingQuery(this.options,r));var s=function(e){t.updateLastResult(Object(i.a)(Object(i.a)({},t.lastResult),{errors:e.graphQLErrors,networkStatus:o.error,loading:!1})),m(t.observers,"error",t.lastError=e)};e.observeQuery(r,this.options,{next:function(r){if(t.lastError||t.isDifferentFromLastResult(r)){var o=t.updateLastResult(r),i=t.options,s=i.query,a=i.variables,u=i.fetchPolicy;e.transform(s).hasClientExports?e.getLocalState().addExportedVariables(s,a).then((function(i){var a=t.variables;t.variables=t.options.variables=i,!r.loading&&o&&"cache-only"!==u&&e.transform(s).serverQuery&&!Object(n.a)(a,i)?t.refetch():m(t.observers,"next",r)})):m(t.observers,"next",r)}},error:s}).catch(s)},e.prototype.tearDownQuery=function(){var t=this.queryManager;this.isTornDown=!0,t.stopPollingQuery(this.queryId),this.subscriptions.forEach((function(t){return t.unsubscribe()})),this.subscriptions.clear(),t.removeObservableQuery(this.queryId),t.stopQuery(this.queryId),this.observers.clear()},e}(b);function O(t){}function m(t,e,r){var o=[];t.forEach((function(t){return t[e]&&o.push(t)})),o.forEach((function(t){return t[e](r)}))}function g(t){var e=t.options.fetchPolicy;Object(l.b)("cache-first"!==e&&"cache-only"!==e,3)}var Q=function(){function t(){this.store={}}return t.prototype.getStore=function(){return this.store},t.prototype.get=function(t){return this.store[t]},t.prototype.initMutation=function(t,e,r){this.store[t]={mutation:e,variables:r||{},loading:!0,error:null}},t.prototype.markMutationError=function(t,e){var r=this.store[t];r&&(r.loading=!1,r.error=e)},t.prototype.markMutationResult=function(t){var e=this.store[t];e&&(e.loading=!1,e.error=null)},t.prototype.reset=function(){this.store={}},t}(),j=function(){function t(){this.store={}}return t.prototype.getStore=function(){return this.store},t.prototype.get=function(t){return this.store[t]},t.prototype.initQuery=function(t){var e=this.store[t.queryId];Object(l.b)(!e||e.document===t.document||Object(n.a)(e.document,t.document),19);var r,i=!1,s=null;t.storePreviousVariables&&e&&e.networkStatus!==o.loading&&(Object(n.a)(e.variables,t.variables)||(i=!0,s=e.variables)),r=i?o.setVariables:t.isPoll?o.poll:t.isRefetch?o.refetch:o.loading;var a=[];e&&e.graphQLErrors&&(a=e.graphQLErrors),this.store[t.queryId]={document:t.document,variables:t.variables,previousVariables:s,networkError:null,graphQLErrors:a,networkStatus:r,metadata:t.metadata},"string"===typeof t.fetchMoreForQueryId&&this.store[t.fetchMoreForQueryId]&&(this.store[t.fetchMoreForQueryId].networkStatus=o.fetchMore)},t.prototype.markQueryResult=function(t,e,r){this.store&&this.store[t]&&(this.store[t].networkError=null,this.store[t].graphQLErrors=y(e.errors)?e.errors:[],this.store[t].previousVariables=null,this.store[t].networkStatus=o.ready,"string"===typeof r&&this.store[r]&&(this.store[r].networkStatus=o.ready))},t.prototype.markQueryError=function(t,e,r){this.store&&this.store[t]&&(this.store[t].networkError=e,this.store[t].networkStatus=o.error,"string"===typeof r&&this.markQueryResultClient(r,!0))},t.prototype.markQueryResultClient=function(t,e){var r=this.store&&this.store[t];r&&(r.networkError=null,r.previousVariables=null,e&&(r.networkStatus=o.ready))},t.prototype.stopQuery=function(t){delete this.store[t]},t.prototype.reset=function(t){var e=this;Object.keys(this.store).forEach((function(r){t.indexOf(r)<0?e.stopQuery(r):e.store[r].networkStatus=o.loading}))},t}();var S=function(){function t(t){var e=t.cache,r=t.client,o=t.resolvers,i=t.fragmentMatcher;this.cache=e,r&&(this.client=r),o&&this.addResolvers(o),i&&this.setFragmentMatcher(i)}return t.prototype.addResolvers=function(t){var e=this;this.resolvers=this.resolvers||{},Array.isArray(t)?t.forEach((function(t){e.resolvers=Object(s.A)(e.resolvers,t)})):this.resolvers=Object(s.A)(this.resolvers,t)},t.prototype.setResolvers=function(t){this.resolvers={},this.addResolvers(t)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(t){var e=t.document,r=t.remoteResult,o=t.context,s=t.variables,n=t.onlyRunForcedResolvers,a=void 0!==n&&n;return Object(i.b)(this,void 0,void 0,(function(){return Object(i.d)(this,(function(t){return e?[2,this.resolveDocument(e,r.data,o,s,this.fragmentMatcher,a).then((function(t){return Object(i.a)(Object(i.a)({},r),{data:t.result})}))]:[2,r]}))}))},t.prototype.setFragmentMatcher=function(t){this.fragmentMatcher=t},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(t){return Object(s.s)(["client"],t)&&this.resolvers?t:null},t.prototype.serverQuery=function(t){return this.resolvers?Object(s.C)(t):t},t.prototype.prepareContext=function(t){void 0===t&&(t={});var e=this.cache;return Object(i.a)(Object(i.a)({},t),{cache:e,getCacheKey:function(t){if(e.config)return e.config.dataIdFromObject(t);Object(l.b)(!1,6)}})},t.prototype.addExportedVariables=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),Object(i.b)(this,void 0,void 0,(function(){return Object(i.d)(this,(function(o){return t?[2,this.resolveDocument(t,this.buildRootValueFromCache(t,e)||{},this.prepareContext(r),e).then((function(t){return Object(i.a)(Object(i.a)({},e),t.exportedVariables)}))]:[2,Object(i.a)({},e)]}))}))},t.prototype.shouldForceResolvers=function(t){var e=!1;return Object(h.b)(t,{Directive:{enter:function(t){if("client"===t.name.value&&t.arguments&&(e=t.arguments.some((function(t){return"always"===t.name.value&&"BooleanValue"===t.value.kind&&!0===t.value.value}))))return h.a}}}),e},t.prototype.buildRootValueFromCache=function(t,e){return this.cache.diff({query:Object(s.d)(t),variables:e,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(t,e,r,o,n,a){return void 0===r&&(r={}),void 0===o&&(o={}),void 0===n&&(n=function(){return!0}),void 0===a&&(a=!1),Object(i.b)(this,void 0,void 0,(function(){var u,c,l,h,p,b,y,f,d;return Object(i.d)(this,(function(v){var O;return u=Object(s.l)(t),c=Object(s.j)(t),l=Object(s.g)(c),h=u.operation,p=h?(O=h).charAt(0).toUpperCase()+O.slice(1):"Query",y=(b=this).cache,f=b.client,d={fragmentMap:l,context:Object(i.a)(Object(i.a)({},r),{cache:y,client:f}),variables:o,fragmentMatcher:n,defaultOperationType:p,exportedVariables:{},onlyRunForcedResolvers:a},[2,this.resolveSelectionSet(u.selectionSet,e,d).then((function(t){return{result:t,exportedVariables:d.exportedVariables}}))]}))}))},t.prototype.resolveSelectionSet=function(t,e,r){return Object(i.b)(this,void 0,void 0,(function(){var o,n,a,u,c,h=this;return Object(i.d)(this,(function(p){return o=r.fragmentMap,n=r.context,a=r.variables,u=[e],c=function(t){return Object(i.b)(h,void 0,void 0,(function(){var c,h;return Object(i.d)(this,(function(i){return Object(s.F)(t,a)?Object(s.t)(t)?[2,this.resolveField(t,e,r).then((function(e){var r;"undefined"!==typeof e&&u.push(((r={})[Object(s.E)(t)]=e,r))}))]:(Object(s.v)(t)?c=t:(c=o[t.name.value],Object(l.b)(c,7)),c&&c.typeCondition&&(h=c.typeCondition.name.value,r.fragmentMatcher(e,h,n))?[2,this.resolveSelectionSet(c.selectionSet,e,r).then((function(t){u.push(t)}))]:[2]):[2]}))}))},[2,Promise.all(t.selections.map(c)).then((function(){return Object(s.B)(u)}))]}))}))},t.prototype.resolveField=function(t,e,r){return Object(i.b)(this,void 0,void 0,(function(){var o,n,a,u,c,l,h,p,b,y=this;return Object(i.d)(this,(function(i){return o=r.variables,n=t.name.value,a=Object(s.E)(t),u=n!==a,c=e[a]||e[n],l=Promise.resolve(c),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(t)||(h=e.__typename||r.defaultOperationType,(p=this.resolvers&&this.resolvers[h])&&(b=p[u?n:a])&&(l=Promise.resolve(b(e,Object(s.b)(t,o),r.context,{field:t,fragmentMap:r.fragmentMap})))),[2,l.then((function(e){return void 0===e&&(e=c),t.directives&&t.directives.forEach((function(t){"export"===t.name.value&&t.arguments&&t.arguments.forEach((function(t){"as"===t.name.value&&"StringValue"===t.value.kind&&(r.exportedVariables[t.value.value]=e)}))})),t.selectionSet?null==e?e:Array.isArray(e)?y.resolveSubSelectedArray(t,e,r):t.selectionSet?y.resolveSelectionSet(t.selectionSet,e,r):void 0:e}))]}))}))},t.prototype.resolveSubSelectedArray=function(t,e,r){var o=this;return Promise.all(e.map((function(e){return null===e?null:Array.isArray(e)?o.resolveSubSelectedArray(t,e,r):t.selectionSet?o.resolveSelectionSet(t.selectionSet,e,r):void 0})))},t}();function q(t){var e=new Set,r=null;return new b((function(o){return e.add(o),r=r||t.subscribe({next:function(t){e.forEach((function(e){return e.next&&e.next(t)}))},error:function(t){e.forEach((function(e){return e.error&&e.error(t)}))},complete:function(){e.forEach((function(t){return t.complete&&t.complete()}))}}),function(){e.delete(o)&&!e.size&&r&&(r.unsubscribe(),r=null)}}))}var w=Object.prototype.hasOwnProperty,R=function(){function t(t){var e=t.link,r=t.queryDeduplication,o=void 0!==r&&r,i=t.store,n=t.onBroadcast,a=void 0===n?function(){}:n,u=t.ssrMode,c=void 0!==u&&u,l=t.clientAwareness,h=void 0===l?{}:l,p=t.localState,b=t.assumeImmutableResults;this.mutationStore=new Q,this.queryStore=new j,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(s.e?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=e,this.queryDeduplication=o,this.dataStore=i,this.onBroadcast=a,this.clientAwareness=h,this.localState=p||new S({cache:i.getCache()}),this.ssrMode=c,this.assumeImmutableResults=!!b}return t.prototype.stop=function(){var t=this;this.queries.forEach((function(e,r){t.stopQueryNoBroadcast(r)})),this.fetchQueryRejectFns.forEach((function(t){t(new l.a(8))}))},t.prototype.mutate=function(t){var e=t.mutation,r=t.variables,o=t.optimisticResponse,n=t.updateQueries,a=t.refetchQueries,u=void 0===a?[]:a,c=t.awaitRefetchQueries,h=void 0!==c&&c,p=t.update,b=t.errorPolicy,f=void 0===b?"none":b,v=t.fetchPolicy,O=t.context,m=void 0===O?{}:O;return Object(i.b)(this,void 0,void 0,(function(){var t,a,c,b=this;return Object(i.d)(this,(function(O){switch(O.label){case 0:return Object(l.b)(e,9),Object(l.b)(!v||"no-cache"===v,10),t=this.generateQueryId(),e=this.transform(e).document,this.setQuery(t,(function(){return{document:e}})),r=this.getVariables(e,r),this.transform(e).hasClientExports?[4,this.localState.addExportedVariables(e,r,m)]:[3,2];case 1:r=O.sent(),O.label=2;case 2:return a=function(){var t={};return n&&b.queries.forEach((function(e,r){var o=e.observableQuery;if(o){var i=o.queryName;i&&w.call(n,i)&&(t[r]={updater:n[i],query:b.queryStore.get(r)})}})),t},this.mutationStore.initMutation(t,e,r),this.dataStore.markMutationInit({mutationId:t,document:e,variables:r,updateQueries:a(),update:p,optimisticResponse:o}),this.broadcastQueries(),c=this,[2,new Promise((function(n,l){var b,O;c.getObservableFromLink(e,Object(i.a)(Object(i.a)({},m),{optimisticResponse:o}),r,!1).subscribe({next:function(o){Object(s.q)(o)&&"none"===f?O=new d({graphQLErrors:o.errors}):(c.mutationStore.markMutationResult(t),"no-cache"!==v&&c.dataStore.markMutationResult({mutationId:t,result:o,document:e,variables:r,updateQueries:a(),update:p}),b=o)},error:function(e){c.mutationStore.markMutationError(t,e),c.dataStore.markMutationComplete({mutationId:t,optimisticResponse:o}),c.broadcastQueries(),c.setQuery(t,(function(){return{document:null}})),l(new d({networkError:e}))},complete:function(){if(O&&c.mutationStore.markMutationError(t,O),c.dataStore.markMutationComplete({mutationId:t,optimisticResponse:o}),c.broadcastQueries(),O)l(O);else{"function"===typeof u&&(u=u(b));var e=[];y(u)&&u.forEach((function(t){if("string"===typeof t)c.queries.forEach((function(r){var o=r.observableQuery;o&&o.queryName===t&&e.push(o.refetch())}));else{var r={query:t.query,variables:t.variables,fetchPolicy:"network-only"};t.context&&(r.context=t.context),e.push(c.query(r))}})),Promise.all(h?e:[]).then((function(){c.setQuery(t,(function(){return{document:null}})),"ignore"===f&&b&&Object(s.q)(b)&&delete b.errors,n(b)}))}}})}))]}}))}))},t.prototype.fetchQuery=function(t,e,r,o){return Object(i.b)(this,void 0,void 0,(function(){var n,a,u,c,l,h,p,b,y,v,O,m,g,Q,j,S,q,w,R=this;return Object(i.d)(this,(function(k){switch(k.label){case 0:return n=e.metadata,a=void 0===n?null:n,u=e.fetchPolicy,c=void 0===u?"cache-first":u,l=e.context,h=void 0===l?{}:l,p=this.transform(e.query).document,b=this.getVariables(p,e.variables),this.transform(p).hasClientExports?[4,this.localState.addExportedVariables(p,b,h)]:[3,2];case 1:b=k.sent(),k.label=2;case 2:if(e=Object(i.a)(Object(i.a)({},e),{variables:b}),O=v="network-only"===c||"no-cache"===c,v||(m=this.dataStore.getCache().diff({query:p,variables:b,returnPartialData:!0,optimistic:!1}),g=m.complete,Q=m.result,O=!g||"cache-and-network"===c,y=Q),j=O&&"cache-only"!==c&&"standby"!==c,Object(s.s)(["live"],p)&&(j=!0),S=this.idCounter++,q="no-cache"!==c?this.updateQueryWatch(t,p,e):void 0,this.setQuery(t,(function(){return{document:p,lastRequestId:S,invalidated:!0,cancel:q}})),this.invalidate(o),this.queryStore.initQuery({queryId:t,document:p,storePreviousVariables:j,variables:b,isPoll:r===f.poll,isRefetch:r===f.refetch,metadata:a,fetchMoreForQueryId:o}),this.broadcastQueries(),j){if(w=this.fetchRequest({requestId:S,queryId:t,document:p,options:e,fetchMoreForQueryId:o}).catch((function(e){throw e.hasOwnProperty("graphQLErrors")?e:(S>=R.getQuery(t).lastRequestId&&(R.queryStore.markQueryError(t,e,o),R.invalidate(t),R.invalidate(o),R.broadcastQueries()),new d({networkError:e}))})),"cache-and-network"!==c)return[2,w];w.catch((function(){}))}return this.queryStore.markQueryResultClient(t,!j),this.invalidate(t),this.invalidate(o),this.transform(p).hasForcedResolvers?[2,this.localState.runResolvers({document:p,remoteResult:{data:y},context:h,variables:b,onlyRunForcedResolvers:!0}).then((function(r){return R.markQueryResult(t,r,e,o),R.broadcastQueries(),r}))]:(this.broadcastQueries(),[2,{data:y}])}}))}))},t.prototype.markQueryResult=function(t,e,r,o){var i=r.fetchPolicy,s=r.variables,n=r.errorPolicy;"no-cache"===i?this.setQuery(t,(function(){return{newData:{result:e.data,complete:!0}}})):this.dataStore.markQueryResult(e,this.getQuery(t).document,s,o,"ignore"===n||"all"===n)},t.prototype.queryListenerForObserver=function(t,e,r){var o=this;function i(t,e){if(r[t])try{r[t](e)}catch(o){}}return function(r,s){if(o.invalidate(t,!1),r){var n=o.getQuery(t),a=n.observableQuery,u=n.document,c=a?a.options.fetchPolicy:e.fetchPolicy;if("standby"!==c){var l=p(r.networkStatus),h=a&&a.getLastResult(),b=!(!h||h.networkStatus===r.networkStatus),f=e.returnPartialData||!s&&r.previousVariables||b&&e.notifyOnNetworkStatusChange||"cache-only"===c||"cache-and-network"===c;if(!l||f){var v=y(r.graphQLErrors),O=a&&a.options.errorPolicy||e.errorPolicy||"none";if("none"===O&&v||r.networkError)return i("error",new d({graphQLErrors:r.graphQLErrors,networkError:r.networkError}));try{var m=void 0,g=void 0;if(s)"no-cache"!==c&&"network-only"!==c&&o.setQuery(t,(function(){return{newData:null}})),m=s.result,g=!s.complete;else{var Q=a&&a.getLastError(),j="none"!==O&&(Q&&Q.graphQLErrors)!==r.graphQLErrors;if(h&&h.data&&!j)m=h.data,g=!1;else{var S=o.dataStore.getCache().diff({query:u,variables:r.previousVariables||r.variables,returnPartialData:!0,optimistic:!0});m=S.result,g=!S.complete}}var q=g&&!(e.returnPartialData||"cache-only"===c),w={data:q?h&&h.data:m,loading:l,networkStatus:r.networkStatus,stale:q};"all"===O&&v&&(w.errors=r.graphQLErrors),i("next",w)}catch(R){i("error",new d({networkError:R}))}}}}}},t.prototype.transform=function(t){var e=this.transformCache;if(!e.has(t)){var r=this.dataStore.getCache(),o=r.transformDocument(t),i=Object(s.D)(r.transformForLink(o)),n=this.localState.clientQuery(o),a=this.localState.serverQuery(i),u={document:o,hasClientExports:Object(s.r)(o),hasForcedResolvers:this.localState.shouldForceResolvers(o),clientQuery:n,serverQuery:a,defaultVars:Object(s.h)(Object(s.m)(o))},c=function(t){t&&!e.has(t)&&e.set(t,u)};c(t),c(o),c(n),c(a)}return e.get(t)},t.prototype.getVariables=function(t,e){return Object(i.a)(Object(i.a)({},this.transform(t).defaultVars),e)},t.prototype.watchQuery=function(t,e){void 0===e&&(e=!0),Object(l.b)("standby"!==t.fetchPolicy,11),t.variables=this.getVariables(t.query,t.variables),"undefined"===typeof t.notifyOnNetworkStatusChange&&(t.notifyOnNetworkStatusChange=!1);var r=Object(i.a)({},t);return new v({queryManager:this,options:r,shouldSubscribe:e})},t.prototype.query=function(t){var e=this;return Object(l.b)(t.query,12),Object(l.b)("Document"===t.query.kind,13),Object(l.b)(!t.returnPartialData,14),Object(l.b)(!t.pollInterval,15),new Promise((function(r,o){var i=e.watchQuery(t,!1);e.fetchQueryRejectFns.set("query:"+i.queryId,o),i.result().then(r,o).then((function(){return e.fetchQueryRejectFns.delete("query:"+i.queryId)}))}))},t.prototype.generateQueryId=function(){return String(this.idCounter++)},t.prototype.stopQueryInStore=function(t){this.stopQueryInStoreNoBroadcast(t),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(t){this.stopPollingQuery(t),this.queryStore.stopQuery(t),this.invalidate(t)},t.prototype.addQueryListener=function(t,e){this.setQuery(t,(function(t){return t.listeners.add(e),{invalidated:!1}}))},t.prototype.updateQueryWatch=function(t,e,r){var o=this,i=this.getQuery(t).cancel;i&&i();return this.dataStore.getCache().watch({query:e,variables:r.variables,optimistic:!0,previousResult:function(){var e=null,r=o.getQuery(t).observableQuery;if(r){var i=r.getLastResult();i&&(e=i.data)}return e},callback:function(e){o.setQuery(t,(function(){return{invalidated:!0,newData:e}}))}})},t.prototype.addObservableQuery=function(t,e){this.setQuery(t,(function(){return{observableQuery:e}}))},t.prototype.removeObservableQuery=function(t){var e=this.getQuery(t).cancel;this.setQuery(t,(function(){return{observableQuery:null}})),e&&e()},t.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach((function(t){t(new l.a(16))}));var t=[];return this.queries.forEach((function(e,r){e.observableQuery&&t.push(r)})),this.queryStore.reset(t),this.mutationStore.reset(),this.dataStore.reset()},t.prototype.resetStore=function(){var t=this;return this.clearStore().then((function(){return t.reFetchObservableQueries()}))},t.prototype.reFetchObservableQueries=function(t){var e=this;void 0===t&&(t=!1);var r=[];return this.queries.forEach((function(o,i){var s=o.observableQuery;if(s){var n=s.options.fetchPolicy;s.resetLastResults(),"cache-only"===n||!t&&"standby"===n||r.push(s.refetch()),e.setQuery(i,(function(){return{newData:null}})),e.invalidate(i)}})),this.broadcastQueries(),Promise.all(r)},t.prototype.observeQuery=function(t,e,r){return this.addQueryListener(t,this.queryListenerForObserver(t,e,r)),this.fetchQuery(t,e)},t.prototype.startQuery=function(t,e,r){return this.addQueryListener(t,r),this.fetchQuery(t,e).catch((function(){})),t},t.prototype.startGraphQLSubscription=function(t){var e=this,r=t.query,o=t.fetchPolicy,i=t.variables;r=this.transform(r).document,i=this.getVariables(r,i);var n=function(t){return e.getObservableFromLink(r,{},t,!1).map((function(i){if(o&&"no-cache"===o||(e.dataStore.markSubscriptionResult(i,r,t),e.broadcastQueries()),Object(s.q)(i))throw new d({graphQLErrors:i.errors});return i}))};if(this.transform(r).hasClientExports){var a=this.localState.addExportedVariables(r,i).then(n);return new b((function(t){var e=null;return a.then((function(r){return e=r.subscribe(t)}),t.error),function(){return e&&e.unsubscribe()}}))}return n(i)},t.prototype.stopQuery=function(t){this.stopQueryNoBroadcast(t),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(t){this.stopQueryInStoreNoBroadcast(t),this.removeQuery(t)},t.prototype.removeQuery=function(t){this.fetchQueryRejectFns.delete("query:"+t),this.fetchQueryRejectFns.delete("fetchRequest:"+t),this.getQuery(t).subscriptions.forEach((function(t){return t.unsubscribe()})),this.queries.delete(t)},t.prototype.getCurrentQueryResult=function(t,e){void 0===e&&(e=!0);var r=t.options,o=r.variables,i=r.query,s=r.fetchPolicy,n=r.returnPartialData,a=t.getLastResult(),u=this.getQuery(t.queryId).newData;if(u&&u.complete)return{data:u.result,partial:!1};if("no-cache"===s||"network-only"===s)return{data:void 0,partial:!1};var c=this.dataStore.getCache().diff({query:i,variables:o,previousResult:a?a.data:void 0,returnPartialData:!0,optimistic:e}),l=c.result,h=c.complete;return{data:h||n?l:void 0,partial:!h}},t.prototype.getQueryWithPreviousResult=function(t){var e;if("string"===typeof t){var r=this.getQuery(t).observableQuery;Object(l.b)(r,17),e=r}else e=t;var o=e.options,i=o.variables,s=o.query;return{previousResult:this.getCurrentQueryResult(e,!1).data,variables:i,document:s}},t.prototype.broadcastQueries=function(){var t=this;this.onBroadcast(),this.queries.forEach((function(e,r){e.invalidated&&e.listeners.forEach((function(o){o&&o(t.queryStore.get(r),e.newData)}))}))},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(t,e,r,o){var n,a=this;void 0===o&&(o=this.queryDeduplication);var c=this.transform(t).serverQuery;if(c){var l=this.inFlightLinkObservables,h=this.link,p={query:c,variables:r,operationName:Object(s.n)(c)||void 0,context:this.prepareContext(Object(i.a)(Object(i.a)({},e),{forceFetch:!o}))};if(e=p.context,o){var y=l.get(c)||new Map;l.set(c,y);var f=JSON.stringify(r);if(!(n=y.get(f))){y.set(f,n=q(Object(u.b)(h,p)));var d=function(){y.delete(f),y.size||l.delete(c),v.unsubscribe()},v=n.subscribe({next:d,error:d,complete:d})}}else n=q(Object(u.b)(h,p))}else n=b.of({data:{}}),e=this.prepareContext(e);var O=this.transform(t).clientQuery;return O&&(n=function(t,e){return new b((function(r){var o=r.next,i=r.error,s=r.complete,n=0,a=!1,u={next:function(t){++n,new Promise((function(r){r(e(t))})).then((function(t){--n,o&&o.call(r,t),a&&u.complete()}),(function(t){--n,i&&i.call(r,t)}))},error:function(t){i&&i.call(r,t)},complete:function(){a=!0,n||s&&s.call(r)}},c=t.subscribe(u);return function(){return c.unsubscribe()}}))}(n,(function(t){return a.localState.runResolvers({document:O,remoteResult:t,context:e,variables:r})}))),n},t.prototype.fetchRequest=function(t){var e,r,i=this,s=t.requestId,n=t.queryId,a=t.document,u=t.options,c=t.fetchMoreForQueryId,l=u.variables,h=u.errorPolicy,p=void 0===h?"none":h,b=u.fetchPolicy;return new Promise((function(t,h){var f=i.getObservableFromLink(a,u.context,l),v="fetchRequest:"+n;i.fetchQueryRejectFns.set(v,h);var O=function(){i.fetchQueryRejectFns.delete(v),i.setQuery(n,(function(t){t.subscriptions.delete(m)}))},m=f.map((function(t){if(s>=i.getQuery(n).lastRequestId&&(i.markQueryResult(n,t,u,c),i.queryStore.markQueryResult(n,t,c),i.invalidate(n),i.invalidate(c),i.broadcastQueries()),"none"===p&&y(t.errors))return h(new d({graphQLErrors:t.errors}));if("all"===p&&(r=t.errors),c||"no-cache"===b)e=t.data;else{var o=i.dataStore.getCache().diff({variables:l,query:a,optimistic:!1,returnPartialData:!0}),f=o.result;(o.complete||u.returnPartialData)&&(e=f)}})).subscribe({error:function(t){O(),h(t)},complete:function(){O(),t({data:e,errors:r,loading:!1,networkStatus:o.ready,stale:!1})}});i.setQuery(n,(function(t){t.subscriptions.add(m)}))}))},t.prototype.getQuery=function(t){return this.queries.get(t)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},t.prototype.setQuery=function(t,e){var r=this.getQuery(t),o=Object(i.a)(Object(i.a)({},r),e(r));this.queries.set(t,o)},t.prototype.invalidate=function(t,e){void 0===e&&(e=!0),t&&this.setQuery(t,(function(){return{invalidated:e}}))},t.prototype.prepareContext=function(t){void 0===t&&(t={});var e=this.localState.prepareContext(t);return Object(i.a)(Object(i.a)({},e),{clientAwareness:this.clientAwareness})},t.prototype.checkInFlight=function(t){var e=this.queryStore.get(t);return e&&e.networkStatus!==o.ready&&e.networkStatus!==o.error},t.prototype.startPollingQuery=function(t,e,r){var o=this,s=t.pollInterval;if(Object(l.b)(s,18),!this.ssrMode){var n=this.pollingInfoByQueryId.get(e);n||this.pollingInfoByQueryId.set(e,n={}),n.interval=s,n.options=Object(i.a)(Object(i.a)({},t),{fetchPolicy:"network-only"});var a=function(){var t=o.pollingInfoByQueryId.get(e);t&&(o.checkInFlight(e)?u():o.fetchQuery(e,t.options,f.poll).then(u,u))},u=function(){var t=o.pollingInfoByQueryId.get(e);t&&(clearTimeout(t.timeout),t.timeout=setTimeout(a,t.interval))};r&&this.addQueryListener(e,r),u()}return e},t.prototype.stopPollingQuery=function(t){this.pollingInfoByQueryId.delete(t)},t}(),k=function(){function t(t){this.cache=t}return t.prototype.getCache=function(){return this.cache},t.prototype.markQueryResult=function(t,e,r,o,i){void 0===i&&(i=!1);var n=!Object(s.q)(t);i&&Object(s.q)(t)&&t.data&&(n=!0),!o&&n&&this.cache.write({result:t.data,dataId:"ROOT_QUERY",query:e,variables:r})},t.prototype.markSubscriptionResult=function(t,e,r){Object(s.q)(t)||this.cache.write({result:t.data,dataId:"ROOT_SUBSCRIPTION",query:e,variables:r})},t.prototype.markMutationInit=function(t){var e,r=this;t.optimisticResponse&&(e="function"===typeof t.optimisticResponse?t.optimisticResponse(t.variables):t.optimisticResponse,this.cache.recordOptimisticTransaction((function(o){var i=r.cache;r.cache=o;try{r.markMutationResult({mutationId:t.mutationId,result:{data:e},document:t.document,variables:t.variables,updateQueries:t.updateQueries,update:t.update})}finally{r.cache=i}}),t.mutationId))},t.prototype.markMutationResult=function(t){var e=this;if(!Object(s.q)(t.result)){var r=[{result:t.result.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}],o=t.updateQueries;o&&Object.keys(o).forEach((function(i){var n=o[i],a=n.query,u=n.updater,c=e.cache.diff({query:a.document,variables:a.variables,returnPartialData:!0,optimistic:!1}),l=c.result;if(c.complete){var h=Object(s.I)((function(){return u(l,{mutationResult:t.result,queryName:Object(s.n)(a.document)||void 0,queryVariables:a.variables})}));h&&r.push({result:h,dataId:"ROOT_QUERY",query:a.document,variables:a.variables})}})),this.cache.performTransaction((function(e){r.forEach((function(t){return e.write(t)}));var o=t.update;o&&Object(s.I)((function(){return o(e,t.result)}))}))}},t.prototype.markMutationComplete=function(t){var e=t.mutationId;t.optimisticResponse&&this.cache.removeOptimistic(e)},t.prototype.markUpdateQueryResult=function(t,e,r){this.cache.write({result:r,dataId:"ROOT_QUERY",variables:e,query:t})},t.prototype.reset=function(){return this.cache.reset()},t}(),M=function(){function t(t){var e=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=t.cache,o=t.ssrMode,i=void 0!==o&&o,s=t.ssrForceFetchDelay,n=void 0===s?0:s,a=t.connectToDevTools,c=t.queryDeduplication,h=void 0===c||c,p=t.defaultOptions,b=t.assumeImmutableResults,y=void 0!==b&&b,f=t.resolvers,d=t.typeDefs,v=t.fragmentMatcher,O=t.name,m=t.version,g=t.link;if(!g&&f&&(g=u.a.empty()),!g||!r)throw new l.a(4);this.link=g,this.cache=r,this.store=new k(r),this.disableNetworkFetches=i||n>0,this.queryDeduplication=h,this.defaultOptions=p||{},this.typeDefs=d,n&&setTimeout((function(){return e.disableNetworkFetches=!1}),n),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);"undefined"!==typeof a&&(a&&"undefined"!==typeof window)&&(window.__APOLLO_CLIENT__=this),this.version="2.6.10",this.localState=new S({cache:r,client:this,resolvers:f,fragmentMatcher:v}),this.queryManager=new R({link:this.link,store:this.store,queryDeduplication:h,ssrMode:i,clientAwareness:{name:O,version:m},localState:this.localState,assumeImmutableResults:y,onBroadcast:function(){e.devToolsHookCb&&e.devToolsHookCb({action:{},state:{queries:e.queryManager.queryStore.getStore(),mutations:e.queryManager.mutationStore.getStore()},dataWithOptimisticResults:e.cache.extract(!0)})}})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=Object(i.a)(Object(i.a)({},this.defaultOptions.watchQuery),t)),!this.disableNetworkFetches||"network-only"!==t.fetchPolicy&&"cache-and-network"!==t.fetchPolicy||(t=Object(i.a)(Object(i.a)({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},t.prototype.query=function(t){return this.defaultOptions.query&&(t=Object(i.a)(Object(i.a)({},this.defaultOptions.query),t)),Object(l.b)("cache-and-network"!==t.fetchPolicy,5),this.disableNetworkFetches&&"network-only"===t.fetchPolicy&&(t=Object(i.a)(Object(i.a)({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},t.prototype.mutate=function(t){return this.defaultOptions.mutate&&(t=Object(i.a)(Object(i.a)({},this.defaultOptions.mutate),t)),this.queryManager.mutate(t)},t.prototype.subscribe=function(t){return this.queryManager.startGraphQLSubscription(t)},t.prototype.readQuery=function(t,e){return void 0===e&&(e=!1),this.cache.readQuery(t,e)},t.prototype.readFragment=function(t,e){return void 0===e&&(e=!1),this.cache.readFragment(t,e)},t.prototype.writeQuery=function(t){var e=this.cache.writeQuery(t);return this.queryManager.broadcastQueries(),e},t.prototype.writeFragment=function(t){var e=this.cache.writeFragment(t);return this.queryManager.broadcastQueries(),e},t.prototype.writeData=function(t){var e=this.cache.writeData(t);return this.queryManager.broadcastQueries(),e},t.prototype.__actionHookForDevTools=function(t){this.devToolsHookCb=t},t.prototype.__requestRaw=function(t){return Object(u.b)(this.link,t)},t.prototype.initQueryManager=function(){return this.queryManager},t.prototype.resetStore=function(){var t=this;return Promise.resolve().then((function(){return t.queryManager.clearStore()})).then((function(){return Promise.all(t.resetStoreCallbacks.map((function(t){return t()})))})).then((function(){return t.reFetchObservableQueries()}))},t.prototype.clearStore=function(){var t=this;return Promise.resolve().then((function(){return t.queryManager.clearStore()})).then((function(){return Promise.all(t.clearStoreCallbacks.map((function(t){return t()})))}))},t.prototype.onResetStore=function(t){var e=this;return this.resetStoreCallbacks.push(t),function(){e.resetStoreCallbacks=e.resetStoreCallbacks.filter((function(e){return e!==t}))}},t.prototype.onClearStore=function(t){var e=this;return this.clearStoreCallbacks.push(t),function(){e.clearStoreCallbacks=e.clearStoreCallbacks.filter((function(e){return e!==t}))}},t.prototype.reFetchObservableQueries=function(t){return this.queryManager.reFetchObservableQueries(t)},t.prototype.extract=function(t){return this.cache.extract(t)},t.prototype.restore=function(t){return this.cache.restore(t)},t.prototype.addResolvers=function(t){this.localState.addResolvers(t)},t.prototype.setResolvers=function(t){this.localState.setResolvers(t)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(t){this.localState.setFragmentMatcher(t)},t}();e.c=M},ttZb:function(t,e,r){"use strict";r.d(e,"a",(function(){return y})),r.d(e,"b",(function(){return p}));var o=r("lqOT"),i=r("mrSG"),s=r("q1tI"),n=r("dMq0"),a=r("qx2n"),u=r("qVdT"),c=function(){function t(t,e){this.isMounted=!1,this.previousOptions={},this.context={},this.options={},this.options=t||{},this.context=e||{}}return t.prototype.getOptions=function(){return this.options},t.prototype.setOptions=function(t,e){void 0===e&&(e=!1),e&&!Object(a.a)(this.options,t)&&(this.previousOptions=this.options),this.options=t},t.prototype.unmount=function(){this.isMounted=!1},t.prototype.refreshClient=function(){var t=this.options&&this.options.client||this.context&&this.context.client;Object(u.b)(!!t,2);var e=!1;return t!==this.client&&(e=!0,this.client=t,this.cleanup()),{client:this.client,isNew:e}},t.prototype.verifyDocumentType=function(t,e){var r=Object(o.e)(t);Object(o.d)(e),Object(o.d)(r.type);Object(u.b)(r.type===e,3)},t}(),l=function(t){function e(e){var r=e.options,o=e.context,i=e.onNewData,s=t.call(this,r,o)||this;return s.previousData={},s.currentObservable={},s.runLazy=!1,s.runLazyQuery=function(t){s.cleanup(),s.runLazy=!0,s.lazyOptions=t,s.onNewData()},s.getExecuteResult=function(){var t=s.getQueryResult();return s.startQuerySubscription(),t},s.obsRefetch=function(t){return s.currentObservable.query.refetch(t)},s.obsFetchMore=function(t){return s.currentObservable.query.fetchMore(t)},s.obsUpdateQuery=function(t){return s.currentObservable.query.updateQuery(t)},s.obsStartPolling=function(t){s.currentObservable&&s.currentObservable.query&&s.currentObservable.query.startPolling(t)},s.obsStopPolling=function(){s.currentObservable&&s.currentObservable.query&&s.currentObservable.query.stopPolling()},s.obsSubscribeToMore=function(t){return s.currentObservable.query.subscribeToMore(t)},s.onNewData=i,s}return Object(i.c)(e,t),e.prototype.execute=function(){this.refreshClient();var t=this.getOptions(),e=t.skip,r=t.query;return(e||r!==this.previousData.query)&&(this.removeQuerySubscription(),this.previousData.query=r),this.updateObservableQuery(),this.isMounted&&this.startQuerySubscription(),this.getExecuteSsrResult()||this.getExecuteResult()},e.prototype.executeLazy=function(){return this.runLazy?[this.runLazyQuery,this.execute()]:[this.runLazyQuery,{loading:!1,networkStatus:n.b.ready,called:!1,data:void 0}]},e.prototype.fetchData=function(){var t=this.getOptions();if(t.skip||!1===t.ssr)return!1;var e=this.currentObservable.query;return!!e.getCurrentResult().loading&&e.result()},e.prototype.afterExecute=function(t){var e=(void 0===t?{}:t).lazy,r=void 0!==e&&e;return this.isMounted=!0,r&&!this.runLazy||this.handleErrorOrCompleted(),this.previousOptions=this.getOptions(),this.unmount.bind(this)},e.prototype.cleanup=function(){this.removeQuerySubscription(),delete this.currentObservable.query,delete this.previousData.result},e.prototype.getOptions=function(){var e=t.prototype.getOptions.call(this);return this.lazyOptions&&(e.variables=Object(i.a)(Object(i.a)({},e.variables),this.lazyOptions.variables),e.context=Object(i.a)(Object(i.a)({},e.context),this.lazyOptions.context)),this.runLazy&&delete e.skip,e},e.prototype.ssrInitiated=function(){return this.context&&this.context.renderPromises},e.prototype.getExecuteSsrResult=function(){var t,e=!1===this.getOptions().ssr,r=this.refreshClient().client.disableNetworkFetches,o=Object(i.a)({loading:!0,networkStatus:n.b.loading,called:!0,data:void 0,stale:!1,client:this.client},this.observableQueryFields());return e&&(this.ssrInitiated()||r)?(this.previousData.result=o,o):(this.ssrInitiated()&&(t=this.context.renderPromises.addQueryPromise(this,this.getExecuteResult)||o),t)},e.prototype.prepareObservableQueryOptions=function(){var t=this.getOptions();this.verifyDocumentType(t.query,o.b.Query);var e=t.displayName||"Query";return!this.ssrInitiated()||"network-only"!==t.fetchPolicy&&"cache-and-network"!==t.fetchPolicy||(t.fetchPolicy="cache-first"),Object(i.a)(Object(i.a)({},t),{displayName:e,context:t.context,metadata:{reactComponent:{displayName:e}}})},e.prototype.initializeObservableQuery=function(){var t,e;if(this.ssrInitiated()&&(this.currentObservable.query=this.context.renderPromises.getSSRObservable(this.getOptions())),!this.currentObservable.query){var r=this.prepareObservableQueryOptions();this.previousData.observableQueryOptions=Object(i.a)(Object(i.a)({},r),{children:null}),this.currentObservable.query=this.refreshClient().client.watchQuery(Object(i.a)({},r)),this.ssrInitiated()&&(null===(e=null===(t=this.context)||void 0===t?void 0:t.renderPromises)||void 0===e||e.registerSSRObservable(this.currentObservable.query,r))}},e.prototype.updateObservableQuery=function(){if(this.currentObservable.query){var t=Object(i.a)(Object(i.a)({},this.prepareObservableQueryOptions()),{children:null});Object(a.a)(t,this.previousData.observableQueryOptions)||(this.previousData.observableQueryOptions=t,this.currentObservable.query.setOptions(t).catch((function(){})))}else this.initializeObservableQuery()},e.prototype.startQuerySubscription=function(){var t=this;if(!this.currentObservable.subscription&&!this.getOptions().skip){var e=this.currentObservable.query;this.currentObservable.subscription=e.subscribe({next:function(e){var r=e.loading,o=e.networkStatus,i=e.data,s=t.previousData.result;s&&s.loading===r&&s.networkStatus===o&&Object(a.a)(s.data,i)||t.onNewData()},error:function(e){if(t.resubscribeToQuery(),!e.hasOwnProperty("graphQLErrors"))throw e;var r=t.previousData.result;(r&&r.loading||!Object(a.a)(e,t.previousData.error))&&(t.previousData.error=e,t.onNewData())}})}},e.prototype.resubscribeToQuery=function(){this.removeQuerySubscription();var t=this.currentObservable.query.getLastError(),e=this.currentObservable.query.getLastResult();this.currentObservable.query.resetLastResults(),this.startQuerySubscription(),Object.assign(this.currentObservable.query,{lastError:t,lastResult:e})},e.prototype.getQueryResult=function(){var t=this.observableQueryFields(),e=this.getOptions();if(e.skip)t=Object(i.a)(Object(i.a)({},t),{data:void 0,error:void 0,loading:!1,called:!0});else{var r=this.currentObservable.query.getCurrentResult(),o=r.loading,s=r.partial,a=r.networkStatus,u=r.errors,c=r.error,l=r.data;if(u&&u.length>0&&(c=new n.a({graphQLErrors:u})),t=Object(i.a)(Object(i.a)({},t),{loading:o,networkStatus:a,error:c,called:!0}),o){var h=this.previousData.result&&this.previousData.result.data;t.data=h&&l?Object(i.a)(Object(i.a)({},h),l):h||l}else if(c)Object.assign(t,{data:(this.currentObservable.query.getLastResult()||{}).data});else{var p=this.currentObservable.query.options.fetchPolicy;if(e.partialRefetch&&!l&&s&&"cache-only"!==p)return Object.assign(t,{loading:!0,networkStatus:n.b.loading}),t.refetch(),t;t.data=l}}return t.client=this.client,this.previousData.loading=this.previousData.result&&this.previousData.result.loading||!1,this.previousData.result=t,this.currentObservable.query&&this.currentObservable.query.resetQueryStoreErrors(),t},e.prototype.handleErrorOrCompleted=function(){if(this.currentObservable.query&&this.previousData.result){var t=this.previousData.result,e=t.data,r=t.loading,o=t.error;if(!r){var i=this.getOptions(),s=i.query,n=i.variables,u=i.onCompleted,c=i.onError;if(this.previousOptions&&!this.previousData.loading&&Object(a.a)(this.previousOptions.query,s)&&Object(a.a)(this.previousOptions.variables,n))return;u&&!o?u(e):c&&o&&c(o)}}},e.prototype.removeQuerySubscription=function(){this.currentObservable.subscription&&(this.currentObservable.subscription.unsubscribe(),delete this.currentObservable.subscription)},e.prototype.observableQueryFields=function(){return{variables:this.currentObservable.query.variables,refetch:this.obsRefetch,fetchMore:this.obsFetchMore,updateQuery:this.obsUpdateQuery,startPolling:this.obsStartPolling,stopPolling:this.obsStopPolling,subscribeToMore:this.obsSubscribeToMore}},e}(c);function h(t,e,r){void 0===r&&(r=!1);var n=Object(s.useContext)(Object(o.c)()),u=Object(s.useReducer)((function(t){return t+1}),0),c=u[0],h=u[1],p=e?Object(i.a)(Object(i.a)({},e),{query:t}):{query:t},b=Object(s.useRef)(),y=b.current||new l({options:p,context:n,onNewData:function(){y.ssrInitiated()?h():Promise.resolve().then(h)}});y.setOptions(p),y.context=n,y.ssrInitiated()&&!b.current&&(b.current=y);var f=function(t,e){var r=Object(s.useRef)();return r.current&&Object(a.a)(e,r.current.key)||(r.current={key:e,value:t()}),r.current.value}((function(){return r?y.executeLazy():y.execute()}),{options:Object(i.a)(Object(i.a)({},p),{onError:void 0,onCompleted:void 0}),context:n,tick:c}),d=r?f[1]:f;return Object(s.useEffect)((function(){return b.current||(b.current=y),function(){return y.cleanup()}}),[]),Object(s.useEffect)((function(){return y.afterExecute({lazy:r})}),[d.loading,d.networkStatus,d.error,d.data]),f}function p(t,e){return h(t,e,!1)}var b=function(t){function e(e){var r=e.options,i=e.context,s=e.result,n=e.setResult,a=t.call(this,r,i)||this;return a.runMutation=function(t){void 0===t&&(t={}),a.onMutationStart();var e=a.generateNewMutationId();return a.mutate(t).then((function(t){return a.onMutationCompleted(t,e),t})).catch((function(t){if(a.onMutationError(t,e),!a.getOptions().onError)throw t}))},a.verifyDocumentType(r.mutation,o.b.Mutation),a.result=s,a.setResult=n,a.mostRecentMutationId=0,a}return Object(i.c)(e,t),e.prototype.execute=function(t){return this.isMounted=!0,this.verifyDocumentType(this.getOptions().mutation,o.b.Mutation),t.client=this.refreshClient().client,[this.runMutation,t]},e.prototype.afterExecute=function(){return this.isMounted=!0,this.unmount.bind(this)},e.prototype.cleanup=function(){},e.prototype.mutate=function(t){var e=this.getOptions(),r=e.mutation,o=e.variables,s=e.optimisticResponse,n=e.update,a=e.context,u=void 0===a?{}:a,c=e.awaitRefetchQueries,l=void 0!==c&&c,h=e.fetchPolicy,p=Object(i.a)({},t),b=Object.assign({},o,p.variables);return delete p.variables,this.refreshClient().client.mutate(Object(i.a)({mutation:r,optimisticResponse:s,refetchQueries:p.refetchQueries||this.getOptions().refetchQueries,awaitRefetchQueries:l,update:n,context:u,fetchPolicy:h,variables:b},p))},e.prototype.onMutationStart=function(){this.result.loading||this.getOptions().ignoreResults||this.updateResult({loading:!0,error:void 0,data:void 0,called:!0})},e.prototype.onMutationCompleted=function(t,e){var r=this.getOptions(),o=r.onCompleted,i=r.ignoreResults,s=t.data,a=t.errors,u=a&&a.length>0?new n.a({graphQLErrors:a}):void 0;this.isMostRecentMutation(e)&&!i&&this.updateResult({called:!0,loading:!1,data:s,error:u}),o&&o(s)},e.prototype.onMutationError=function(t,e){var r=this.getOptions().onError;this.isMostRecentMutation(e)&&this.updateResult({loading:!1,error:t,data:void 0,called:!0}),r&&r(t)},e.prototype.generateNewMutationId=function(){return++this.mostRecentMutationId},e.prototype.isMostRecentMutation=function(t){return this.mostRecentMutationId===t},e.prototype.updateResult=function(t){!this.isMounted||this.previousResult&&Object(a.a)(this.previousResult,t)||(this.setResult(t),this.previousResult=t)},e}(c);function y(t,e){var r=Object(s.useContext)(Object(o.c)()),n=Object(s.useState)({called:!1,loading:!1}),a=n[0],u=n[1],c=e?Object(i.a)(Object(i.a)({},e),{mutation:t}):{mutation:t},l=Object(s.useRef)();var h=(l.current||(l.current=new b({options:c,context:r,result:a,setResult:u})),l.current);return h.setOptions(c),h.context=r,Object(s.useEffect)((function(){return h.afterExecute()})),h.execute(a)}!function(t){function e(e){var r=e.options,o=e.context,i=e.setResult,s=t.call(this,r,o)||this;return s.currentObservable={},s.setResult=i,s.initialize(r),s}Object(i.c)(e,t),e.prototype.execute=function(t){if(!0===this.getOptions().skip)return this.cleanup(),{loading:!1,error:void 0,data:void 0,variables:this.getOptions().variables};var e=t;this.refreshClient().isNew&&(e=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||!Object(a.a)(this.previousOptions.variables,this.getOptions().variables)||this.previousOptions.skip!==this.getOptions().skip)&&(this.cleanup(),e=this.getLoadingResult()),this.initialize(this.getOptions()),this.startSubscription(),this.previousOptions=this.getOptions(),Object(i.a)(Object(i.a)({},e),{variables:this.getOptions().variables})},e.prototype.afterExecute=function(){this.isMounted=!0},e.prototype.cleanup=function(){this.endSubscription(),delete this.currentObservable.query},e.prototype.initialize=function(t){this.currentObservable.query||!0===this.getOptions().skip||(this.currentObservable.query=this.refreshClient().client.subscribe({query:t.subscription,variables:t.variables,fetchPolicy:t.fetchPolicy}))},e.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)}))},e.prototype.getLoadingResult=function(){return{loading:!0,error:void 0,data:void 0}},e.prototype.updateResult=function(t){this.isMounted&&this.setResult(t)},e.prototype.updateCurrentData=function(t){var e=this.getOptions().onSubscriptionData;this.updateResult({data:t.data,loading:!1,error:void 0}),e&&e({client:this.refreshClient().client,subscriptionData:t})},e.prototype.updateError=function(t){this.updateResult({error:t,loading:!1})},e.prototype.completeSubscription=function(){var t=this.getOptions().onSubscriptionComplete;t&&t(),this.endSubscription()},e.prototype.endSubscription=function(){this.currentObservable.subscription&&(this.currentObservable.subscription.unsubscribe(),delete this.currentObservable.subscription)}}(c);!function(){function t(){this.queryPromises=new Map,this.queryInfoTrie=new Map}t.prototype.registerSSRObservable=function(t,e){this.lookupQueryInfo(e).observable=t},t.prototype.getSSRObservable=function(t){return this.lookupQueryInfo(t).observable},t.prototype.addQueryPromise=function(t,e){return this.lookupQueryInfo(t.getOptions()).seen?e():(this.queryPromises.set(t.getOptions(),new Promise((function(e){e(t.fetchData())}))),null)},t.prototype.hasPromises=function(){return this.queryPromises.size>0},t.prototype.consumeAndAwaitPromises=function(){var t=this,e=[];return this.queryPromises.forEach((function(r,o){t.lookupQueryInfo(o).seen=!0,e.push(r)})),this.queryPromises.clear(),Promise.all(e)},t.prototype.lookupQueryInfo=function(t){var e=this.queryInfoTrie,r=t.query,o=t.variables,i=e.get(r)||new Map;e.has(r)||e.set(r,i);var s=JSON.stringify(o),n=i.get(s)||{seen:!1,observable:null};return i.has(s)||i.set(s,n),n}}()}}]);