(window.webpackJsonp=window.webpackJsonp||[]).push([[75],{16:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return h})),r.d(t,"b",(function(){return C})),r.d(t,"c",(function(){return T})),r.d(t,"d",(function(){return N})),r.d(t,"e",(function(){return E})),r.d(t,"f",(function(){return M})),r.d(t,"g",(function(){return S})),r.d(t,"h",(function(){return R})),r.d(t,"i",(function(){return w})),r.d(t,"j",(function(){return k})),r.d(t,"k",(function(){return U})),r.d(t,"l",(function(){return O})),r.d(t,"m",(function(){return m})),r.d(t,"n",(function(){return v})),r.d(t,"o",(function(){return d})),r.d(t,"p",(function(){return W})),r.d(t,"q",(function(){return G})),r.d(t,"r",(function(){return V})),r.d(t,"s",(function(){return L})),r.d(t,"t",(function(){return f})),r.d(t,"u",(function(){return y})),r.d(t,"v",(function(){return B}));var n=r(11),o=r(5),c=r(3);r(67),r(38);function l(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 c={};r.fields.map((function(e){return l(c,e.name,e.value,n)})),e[t.value]=c}else if(function(e){return"Variable"===e.kind}(r)){var h=(n||{})[r.name.value];e[t.value]=h}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return l(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 new o.a(17);e[t.value]=null}}function h(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,o=e.value;return l(r,n,o,t)})),r}return null}function f(e){return e.alias?e.alias.value:e.name.value}function v(e){return"Field"===e.kind}function d(e){return"InlineFragment"===e.kind}function y(e,t){return void 0===t&&(t={}),(r=e.directives,r?r.filter(Q).map((function(e){var t=e.arguments;e.name.value,Object(o.b)(t&&1===t.length,2);var r=t[0];Object(o.b)(r.name&&"if"===r.name.value,3);var n=r.value;return Object(o.b)(n&&("Variable"===n.kind||"BooleanValue"===n.kind),4),{directive:e,ifArgument:r}})):[]).every((function(e){var r=e.directive,n=e.ifArgument,c=!1;return"Variable"===n.value.kind?(c=t[n.value.name.value],Object(o.b)(void 0!==c,1)):c=n.value.value,"skip"===r.name.value?!c:c}));var r}function m(e,t){return function(e){var t=[];return Object(n.b)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function O(e){return e&&m(["client"],e)&&m(["export"],e)}function Q(e){var t=e.name.value;return"skip"===t||"include"===t}function j(e){for(var t=[],r=1;r1){var n=[];t=Y(t,n);for(var i=1;i0}var j,_=function(e){function t(r){var n,o,c=r.graphQLErrors,l=r.networkError,h=r.errorMessage,f=r.extraInfo,v=e.call(this,h)||this;return v.graphQLErrors=c||[],v.networkError=l||null,v.message=h||(o="",Q((n=v).graphQLErrors)&&n.graphQLErrors.forEach((function(e){var t=e?e.message:"Error message not found.";o+="GraphQL error: "+t+"\n"})),n.networkError&&(o+="Network error: "+n.networkError.message+"\n"),o=o.replace(/\n$/,"")),v.extraInfo=f,v.__proto__=t.prototype,v}return Object(o.__extends)(t,e),t}(Error);!function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(j||(j={}));var w=function(e){function t(t){var r=t.queryManager,n=t.options,o=t.shouldSubscribe,l=void 0===o||o,h=e.call(this,(function(e){return h.onSubscribe(e)}))||this;h.observers=new Set,h.subscriptions=new Set,h.isTornDown=!1,h.options=n,h.variables=n.variables||{},h.queryId=r.generateQueryId(),h.shouldSubscribe=l;var f=Object(c.i)(n.query);return h.queryName=f&&f.name&&f.name.value,h.queryManager=r,h}return Object(o.__extends)(t,e),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(){o.unsubscribe()}),0)},error:r},o=e.subscribe(n)}))},t.prototype.currentResult=function(){var e=this.getCurrentResult();return void 0===e.data&&(e.data={}),e},t.prototype.getCurrentResult=function(){if(this.isTornDown){var e=this.lastResult;return{data:!this.lastError&&e&&e.data||void 0,error:this.lastError,loading:!1,networkStatus:n.error}}var t,r,c,l=this.queryManager.getCurrentQueryResult(this),data=l.data,h=l.partial,f=this.queryManager.queryStore.get(this.queryId),v=this.options.fetchPolicy,d="network-only"===v||"no-cache"===v;if(f){var y=f.networkStatus;if(r=f,void 0===(c=this.options.errorPolicy)&&(c="none"),r&&(r.networkError||"none"===c&&Q(r.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:y,error:new _({graphQLErrors:f.graphQLErrors,networkError:f.networkError})};f.variables&&(this.options.variables=Object(o.__assign)(Object(o.__assign)({},this.options.variables),f.variables),this.variables=this.options.variables),t={data:data,loading:m(y),networkStatus:y},f.graphQLErrors&&"all"===this.options.errorPolicy&&(t.errors=f.graphQLErrors)}else{var O=d||h&&"cache-only"!==v;t={data:data,loading:O,networkStatus:O?n.loading:n.ready}}return h||this.updateLastResult(Object(o.__assign)(Object(o.__assign)({},t),{stale:!1})),Object(o.__assign)(Object(o.__assign)({},t),{partial:h})},t.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&Object(l.a)(t.data,e.data))},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(){var e=this.queryManager.queryStore.get(this.queryId);e&&(e.networkError=null,e.graphQLErrors=[])},t.prototype.refetch=function(e){var t=this.options.fetchPolicy;return"cache-only"===t?Promise.reject(new d.a(3)):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),Object(l.a)(this.variables,e)||(this.variables=Object(o.__assign)(Object(o.__assign)({},this.variables),e)),Object(l.a)(this.options.variables,this.variables)||(this.options.variables=Object(o.__assign)(Object(o.__assign)({},this.options.variables),this.variables)),this.queryManager.fetchQuery(this.queryId,Object(o.__assign)(Object(o.__assign)({},this.options),{fetchPolicy:t}),j.refetch))},t.prototype.fetchMore=function(e){var t=this;Object(d.b)(e.updateQuery,4);var r=Object(o.__assign)(Object(o.__assign)({},e.query?e:Object(o.__assign)(Object(o.__assign)(Object(o.__assign)({},this.options),e),{variables:Object(o.__assign)(Object(o.__assign)({},this.variables),e.variables)})),{fetchPolicy:"network-only"}),n=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(n,r,j.normal,this.queryId).then((function(o){return t.updateQuery((function(t){return e.updateQuery(t,{fetchMoreResult:o.data,variables:r.variables})})),t.queryManager.stopQuery(n),o}),(function(e){throw t.queryManager.stopQuery(n),e}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var o=t.variables;return n(e,{subscriptionData:r,variables:o})}))},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){var t=this.options.fetchPolicy;this.options=Object(o.__assign)(Object(o.__assign)({},this.options),e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var r=e.fetchPolicy;return this.setVariables(this.options.variables,t!==r&&("cache-only"===t||"standby"===t||"network-only"===r),e.fetchResults)},t.prototype.setVariables=function(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!0),this.isTornDown=!1,e=e||this.variables,!t&&Object(l.a)(e,this.variables)?this.observers.size&&r?this.result():Promise.resolve():(this.variables=this.options.variables=e,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,r=t.getQueryWithPreviousResult(this.queryId),n=r.previousResult,o=r.variables,l=r.document,h=Object(c.v)((function(){return e(n,{variables:o})}));h&&(t.dataStore.markUpdateQueryResult(l,o,h),t.broadcastQueries())},t.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},t.prototype.startPolling=function(e){R(this),this.options.pollInterval=e,this.queryManager.startPollingQuery(this.options,this.queryId)},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:Object(c.d)(e),t},t.prototype.onSubscribe=function(e){var t=this;try{var r=e._subscription._observer;r&&!r.error&&(r.error=k)}catch(e){}var n=!this.observers.size;return this.observers.add(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),n&&this.setUpQuery(),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.setUpQuery=function(){var e=this,t=this.queryManager,r=this.queryId;this.shouldSubscribe&&t.addObservableQuery(r,this),this.options.pollInterval&&(R(this),t.startPollingQuery(this.options,r));var c=function(t){e.updateLastResult(Object(o.__assign)(Object(o.__assign)({},e.lastResult),{errors:t.graphQLErrors,networkStatus:n.error,loading:!1})),S(e.observers,"error",e.lastError=t)};t.observeQuery(r,this.options,{next:function(r){if(e.lastError||e.isDifferentFromLastResult(r)){var n=e.updateLastResult(r),o=e.options,c=o.query,h=o.variables,f=o.fetchPolicy;t.transform(c).hasClientExports?t.getLocalState().addExportedVariables(c,h).then((function(o){var h=e.variables;e.variables=e.options.variables=o,!r.loading&&n&&"cache-only"!==f&&t.transform(c).serverQuery&&!Object(l.a)(h,o)?e.refetch():S(e.observers,"next",r)})):S(e.observers,"next",r)}},error:c}).catch(c)},t.prototype.tearDownQuery=function(){var e=this.queryManager;this.isTornDown=!0,e.stopPollingQuery(this.queryId),this.subscriptions.forEach((function(sub){return sub.unsubscribe()})),this.subscriptions.clear(),e.removeObservableQuery(this.queryId),e.stopQuery(this.queryId),this.observers.clear()},t}(O);function k(e){}function S(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function R(e){var t=e.options.fetchPolicy;Object(d.b)("cache-first"!==t&&"cache-only"!==t,5)}var E=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,r){this.store[e]={mutation:t,variables:r||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var r=this.store[e];r&&(r.loading=!1,r.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),M=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var t=this.store[e.queryId];Object(d.b)(!t||t.document===e.document||Object(l.a)(t.document,e.document),19);var r,o=!1,c=null;e.storePreviousVariables&&t&&t.networkStatus!==n.loading&&(Object(l.a)(t.variables,e.variables)||(o=!0,c=t.variables)),r=o?n.setVariables:e.isPoll?n.poll:e.isRefetch?n.refetch:n.loading;var h=[];t&&t.graphQLErrors&&(h=t.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:c,networkError:null,graphQLErrors:h,networkStatus:r,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=n.fetchMore)},e.prototype.markQueryResult=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=Q(t.errors)?t.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=n.ready,"string"==typeof r&&this.store[r]&&(this.store[r].networkStatus=n.ready))},e.prototype.markQueryError=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=t,this.store[e].networkStatus=n.error,"string"==typeof r&&this.markQueryResultClient(r,!0))},e.prototype.markQueryResultClient=function(e,t){var r=this.store&&this.store[e];r&&(r.networkError=null,r.previousVariables=null,t&&(r.networkStatus=n.ready))},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var t=this;Object.keys(this.store).forEach((function(r){e.indexOf(r)<0?t.stopQuery(r):t.store[r].networkStatus=n.loading}))},e}();var I=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,o=e.fragmentMatcher;this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),o&&this.setFragmentMatcher(o)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Object(c.p)(t.resolvers,e)})):this.resolvers=Object(c.p)(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,c=e.variables,l=e.onlyRunForcedResolvers,h=void 0!==l&&l;return Object(o.__awaiter)(this,void 0,void 0,(function(){return Object(o.__generator)(this,(function(e){return t?[2,this.resolveDocument(t,r.data,n,c,this.fragmentMatcher,h).then((function(e){return Object(o.__assign)(Object(o.__assign)({},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 Object(c.m)(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return this.resolvers?Object(c.r)(e):e},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.cache;return Object(o.__assign)(Object(o.__assign)({},e),{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);Object(d.b)(!1,6)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),Object(o.__awaiter)(this,void 0,void 0,(function(){return Object(o.__generator)(this,(function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then((function(data){return Object(o.__assign)(Object(o.__assign)({},t),data.exportedVariables)}))]:[2,Object(o.__assign)({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Object(y.b)(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 y.a}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Object(c.b)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,n,l,h){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===l&&(l=function(){return!0}),void 0===h&&(h=!1),Object(o.__awaiter)(this,void 0,void 0,(function(){var f,v,d,y,m,O,Q,j,_;return Object(o.__generator)(this,(function(w){var k;return f=Object(c.h)(e),v=Object(c.g)(e),d=Object(c.e)(v),y=f.operation,m=y?(k=y).charAt(0).toUpperCase()+k.slice(1):"Query",Q=(O=this).cache,j=O.client,_={fragmentMap:d,context:Object(o.__assign)(Object(o.__assign)({},r),{cache:Q,client:j}),variables:n,fragmentMatcher:l,defaultOperationType:m,exportedVariables:{},onlyRunForcedResolvers:h},[2,this.resolveSelectionSet(f.selectionSet,t,_).then((function(e){return{result:e,exportedVariables:_.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,r){return Object(o.__awaiter)(this,void 0,void 0,(function(){var n,l,h,f,v,y=this;return Object(o.__generator)(this,(function(m){return n=r.fragmentMap,l=r.context,h=r.variables,f=[t],v=function(e){return Object(o.__awaiter)(y,void 0,void 0,(function(){var v,y;return Object(o.__generator)(this,(function(o){return Object(c.u)(e,h)?Object(c.n)(e)?[2,this.resolveField(e,t,r).then((function(t){var r;void 0!==t&&f.push(((r={})[Object(c.t)(e)]=t,r))}))]:(Object(c.o)(e)?v=e:(v=n[e.name.value],Object(d.b)(v,7)),v&&v.typeCondition&&(y=v.typeCondition.name.value,r.fragmentMatcher(t,y,l))?[2,this.resolveSelectionSet(v.selectionSet,t,r).then((function(e){f.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(v)).then((function(){return Object(c.q)(f)}))]}))}))},e.prototype.resolveField=function(e,t,r){return Object(o.__awaiter)(this,void 0,void 0,(function(){var n,l,h,f,v,d,y,m,O,Q=this;return Object(o.__generator)(this,(function(o){return n=r.variables,l=e.name.value,h=Object(c.t)(e),f=l!==h,v=t[h]||t[l],d=Promise.resolve(v),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(y=t.__typename||r.defaultOperationType,(m=this.resolvers&&this.resolvers[y])&&(O=m[f?l:h])&&(d=Promise.resolve(O(t,Object(c.a)(e,n),r.context,{field:e,fragmentMap:r.fragmentMap})))),[2,d.then((function(t){return void 0===t&&(t=v),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)?Q.resolveSubSelectedArray(e,t,r):e.selectionSet?Q.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}();function P(e){var t=new Set,sub=null;return new O((function(r){return t.add(r),sub=sub||e.subscribe({next:function(e){t.forEach((function(t){return t.next&&t.next(e)}))},error:function(e){t.forEach((function(t){return t.error&&t.error(e)}))},complete:function(){t.forEach((function(e){return e.complete&&e.complete()}))}}),function(){t.delete(r)&&!t.size&&sub&&(sub.unsubscribe(),sub=null)}}))}var F=Object.prototype.hasOwnProperty,D=function(){function e(e){var link=e.link,t=e.queryDeduplication,r=void 0!==t&&t,n=e.store,o=e.onBroadcast,l=void 0===o?function(){}:o,h=e.ssrMode,f=void 0!==h&&h,v=e.clientAwareness,d=void 0===v?{}:v,y=e.localState,m=e.assumeImmutableResults;this.mutationStore=new E,this.queryStore=new M,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(c.c?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=link,this.queryDeduplication=r,this.dataStore=n,this.onBroadcast=l,this.clientAwareness=d,this.localState=y||new I({cache:n.getCache()}),this.ssrMode=f,this.assumeImmutableResults=!!m}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.fetchQueryRejectFns.forEach((function(e){e(new d.a(8))}))},e.prototype.mutate=function(e){var t=e.mutation,r=e.variables,n=e.optimisticResponse,l=e.updateQueries,h=e.refetchQueries,f=void 0===h?[]:h,v=e.awaitRefetchQueries,y=void 0!==v&&v,m=e.update,O=e.errorPolicy,j=void 0===O?"none":O,w=e.fetchPolicy,k=e.context,S=void 0===k?{}:k;return Object(o.__awaiter)(this,void 0,void 0,(function(){var e,h,v,O=this;return Object(o.__generator)(this,(function(k){switch(k.label){case 0:return Object(d.b)(t,9),Object(d.b)(!w||"no-cache"===w,10),e=this.generateQueryId(),t=this.transform(t).document,this.setQuery(e,(function(){return{document:t}})),r=this.getVariables(t,r),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,r,S)]:[3,2];case 1:r=k.sent(),k.label=2;case 2:return h=function(){var e={};return l&&O.queries.forEach((function(t,r){var n=t.observableQuery;if(n){var o=n.queryName;o&&F.call(l,o)&&(e[r]={updater:l[o],query:O.queryStore.get(r)})}})),e},this.mutationStore.initMutation(e,t,r),this.dataStore.markMutationInit({mutationId:e,document:t,variables:r,updateQueries:h(),update:m,optimisticResponse:n}),this.broadcastQueries(),v=this,[2,new Promise((function(l,d){var O,k;v.getObservableFromLink(t,Object(o.__assign)(Object(o.__assign)({},S),{optimisticResponse:n}),r,!1).subscribe({next:function(n){Object(c.k)(n)&&"none"===j?k=new _({graphQLErrors:n.errors}):(v.mutationStore.markMutationResult(e),"no-cache"!==w&&v.dataStore.markMutationResult({mutationId:e,result:n,document:t,variables:r,updateQueries:h(),update:m}),O=n)},error:function(t){v.mutationStore.markMutationError(e,t),v.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),v.broadcastQueries(),v.setQuery(e,(function(){return{document:null}})),d(new _({networkError:t}))},complete:function(){if(k&&v.mutationStore.markMutationError(e,k),v.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),v.broadcastQueries(),k)d(k);else{"function"==typeof f&&(f=f(O));var t=[];Q(f)&&f.forEach((function(e){if("string"==typeof e)v.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(v.query(r))}})),Promise.all(y?t:[]).then((function(){v.setQuery(e,(function(){return{document:null}})),"ignore"===j&&O&&Object(c.k)(O)&&delete O.errors,l(O)}))}}})}))]}}))}))},e.prototype.fetchQuery=function(e,t,r,n){return Object(o.__awaiter)(this,void 0,void 0,(function(){var l,h,f,v,d,y,m,O,Q,w,k,S,R,E,M,I,P,F,D=this;return Object(o.__generator)(this,(function(x){switch(x.label){case 0:return l=t.metadata,h=void 0===l?null:l,f=t.fetchPolicy,v=void 0===f?"cache-first":f,d=t.context,y=void 0===d?{}:d,m=this.transform(t.query).document,O=this.getVariables(m,t.variables),this.transform(m).hasClientExports?[4,this.localState.addExportedVariables(m,O,y)]:[3,2];case 1:O=x.sent(),x.label=2;case 2:if(t=Object(o.__assign)(Object(o.__assign)({},t),{variables:O}),k=w="network-only"===v||"no-cache"===v,w||(S=this.dataStore.getCache().diff({query:m,variables:O,returnPartialData:!0,optimistic:!1}),R=S.complete,E=S.result,k=!R||"cache-and-network"===v,Q=E),M=k&&"cache-only"!==v&&"standby"!==v,Object(c.m)(["live"],m)&&(M=!0),I=this.idCounter++,P="no-cache"!==v?this.updateQueryWatch(e,m,t):void 0,this.setQuery(e,(function(){return{document:m,lastRequestId:I,invalidated:!0,cancel:P}})),this.invalidate(n),this.queryStore.initQuery({queryId:e,document:m,storePreviousVariables:M,variables:O,isPoll:r===j.poll,isRefetch:r===j.refetch,metadata:h,fetchMoreForQueryId:n}),this.broadcastQueries(),M){if(F=this.fetchRequest({requestId:I,queryId:e,document:m,options:t,fetchMoreForQueryId:n}).catch((function(t){throw t.hasOwnProperty("graphQLErrors")?t:(I>=D.getQuery(e).lastRequestId&&(D.queryStore.markQueryError(e,t,n),D.invalidate(e),D.invalidate(n),D.broadcastQueries()),new _({networkError:t}))})),"cache-and-network"!==v)return[2,F];F.catch((function(){}))}return this.queryStore.markQueryResultClient(e,!M),this.invalidate(e),this.invalidate(n),this.transform(m).hasForcedResolvers?[2,this.localState.runResolvers({document:m,remoteResult:{data:Q},context:y,variables:O,onlyRunForcedResolvers:!0}).then((function(r){return D.markQueryResult(e,r,t,n),D.broadcastQueries(),r}))]:(this.broadcastQueries(),[2,{data:Q}])}}))}))},e.prototype.markQueryResult=function(e,t,r,n){var o=r.fetchPolicy,c=r.variables,l=r.errorPolicy;"no-cache"===o?this.setQuery(e,(function(){return{newData:{result:t.data,complete:!0}}})):this.dataStore.markQueryResult(t,this.getQuery(e).document,c,n,"ignore"===l||"all"===l)},e.prototype.queryListenerForObserver=function(e,t,r){var n=this;function o(e,t){if(r[e])try{r[e](t)}catch(e){}}return function(r,c){if(n.invalidate(e,!1),r){var l=n.getQuery(e),h=l.observableQuery,f=l.document,v=h?h.options.fetchPolicy:t.fetchPolicy;if("standby"!==v){var d=m(r.networkStatus),y=h&&h.getLastResult(),O=!(!y||y.networkStatus===r.networkStatus),j=t.returnPartialData||!c&&r.previousVariables||O&&t.notifyOnNetworkStatusChange||"cache-only"===v||"cache-and-network"===v;if(!d||j){var w=Q(r.graphQLErrors),k=h&&h.options.errorPolicy||t.errorPolicy||"none";if("none"===k&&w||r.networkError)return o("error",new _({graphQLErrors:r.graphQLErrors,networkError:r.networkError}));try{var data=void 0,S=void 0;if(c)"no-cache"!==v&&"network-only"!==v&&n.setQuery(e,(function(){return{newData:null}})),data=c.result,S=!c.complete;else{var R=h&&h.getLastError(),E="none"!==k&&(R&&R.graphQLErrors)!==r.graphQLErrors;if(y&&y.data&&!E)data=y.data,S=!1;else{var M=n.dataStore.getCache().diff({query:f,variables:r.previousVariables||r.variables,returnPartialData:!0,optimistic:!0});data=M.result,S=!M.complete}}var I=S&&!(t.returnPartialData||"cache-only"===v),P={data:I?y&&y.data:data,loading:d,networkStatus:r.networkStatus,stale:I};"all"===k&&w&&(P.errors=r.graphQLErrors),o("next",P)}catch(e){o("error",new _({networkError:e}))}}}}}},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var r=this.dataStore.getCache(),n=r.transformDocument(e),o=Object(c.s)(r.transformForLink(n)),l=this.localState.clientQuery(n),h=this.localState.serverQuery(o),f={document:n,hasClientExports:Object(c.l)(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:l,serverQuery:h,defaultVars:Object(c.f)(Object(c.i)(n))},v=function(e){e&&!t.has(e)&&t.set(e,f)};v(e),v(n),v(l),v(h)}return t.get(e)},e.prototype.getVariables=function(e,t){return Object(o.__assign)(Object(o.__assign)({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),Object(d.b)("standby"!==e.fetchPolicy,11),e.variables=this.getVariables(e.query,e.variables),void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var r=Object(o.__assign)({},e);return new w({queryManager:this,options:r,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;return Object(d.b)(e.query,12),Object(d.b)("Document"===e.query.kind,13),Object(d.b)(!e.returnPartialData,14),Object(d.b)(!e.pollInterval,15),new Promise((function(r,n){var o=t.watchQuery(e,!1);t.fetchQueryRejectFns.set("query:"+o.queryId,n),o.result().then(r,n).then((function(){return t.fetchQueryRejectFns.delete("query:"+o.queryId)}))}))},e.prototype.generateQueryId=function(){return String(this.idCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){this.stopPollingQuery(e),this.queryStore.stopQuery(e),this.invalidate(e)},e.prototype.addQueryListener=function(e,t){this.setQuery(e,(function(e){return e.listeners.add(t),{invalidated:!1}}))},e.prototype.updateQueryWatch=function(e,t,r){var n=this,o=this.getQuery(e).cancel;o&&o();return this.dataStore.getCache().watch({query:t,variables:r.variables,optimistic:!0,previousResult:function(){var t=null,r=n.getQuery(e).observableQuery;if(r){var o=r.getLastResult();o&&(t=o.data)}return t},callback:function(t){n.setQuery(e,(function(){return{invalidated:!0,newData:t}}))}})},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,(function(){return{observableQuery:t}}))},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e).cancel;this.setQuery(e,(function(){return{observableQuery:null}})),t&&t()},e.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach((function(e){e(new d.a(16))}));var e=[];return this.queries.forEach((function(t,r){t.observableQuery&&e.push(r)})),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.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,o){var c=n.observableQuery;if(c){var l=c.options.fetchPolicy;c.resetLastResults(),"cache-only"===l||!e&&"standby"===l||r.push(c.refetch()),t.setQuery(o,(function(){return{newData:null}})),t.invalidate(o)}})),this.broadcastQueries(),Promise.all(r)},e.prototype.observeQuery=function(e,t,r){return this.addQueryListener(e,this.queryListenerForObserver(e,t,r)),this.fetchQuery(e,t)},e.prototype.startQuery=function(e,t,r){return this.addQueryListener(e,r),this.fetchQuery(e,t).catch((function(){})),e},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,o=e.variables;r=this.transform(r).document,o=this.getVariables(r,o);var l=function(e){return t.getObservableFromLink(r,{},e,!1).map((function(o){if(n&&"no-cache"===n||(t.dataStore.markSubscriptionResult(o,r,e),t.broadcastQueries()),Object(c.k)(o))throw new _({graphQLErrors:o.errors});return o}))};if(this.transform(r).hasClientExports){var h=this.localState.addExportedVariables(r,o).then(l);return new O((function(e){var sub=null;return h.then((function(t){return sub=t.subscribe(e)}),e.error),function(){return sub&&sub.unsubscribe()}}))}return l(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.fetchQueryRejectFns.delete("query:"+e),this.fetchQueryRejectFns.delete("fetchRequest:"+e),this.getQuery(e).subscriptions.forEach((function(e){return e.unsubscribe()})),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var r=e.options,n=r.variables,o=r.query,c=r.fetchPolicy,l=r.returnPartialData,h=e.getLastResult(),f=this.getQuery(e.queryId).newData;if(f&&f.complete)return{data:f.result,partial:!1};if("no-cache"===c||"network-only"===c)return{data:void 0,partial:!1};var v=this.dataStore.getCache().diff({query:o,variables:n,previousResult:h?h.data:void 0,returnPartialData:!0,optimistic:t}),d=v.result,y=v.complete;return{data:y||l?d:void 0,partial:!y}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var r=this.getQuery(e).observableQuery;Object(d.b)(r,17),t=r}else t=e;var n=t.options,o=n.variables,c=n.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:o,document:c}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach((function(t,r){t.invalidated&&t.listeners.forEach((function(n){n&&n(e.queryStore.get(r),t.newData)}))}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,n){var l,h=this;void 0===n&&(n=this.queryDeduplication);var v=this.transform(e).serverQuery;if(v){var d=this.inFlightLinkObservables,link=this.link,y={query:v,variables:r,operationName:Object(c.j)(v)||void 0,context:this.prepareContext(Object(o.__assign)(Object(o.__assign)({},t),{forceFetch:!n}))};if(t=y.context,n){var m=d.get(v)||new Map;d.set(v,m);var Q=JSON.stringify(r);if(!(l=m.get(Q))){m.set(Q,l=P(Object(f.execute)(link,y)));var j=function(){m.delete(Q),m.size||d.delete(v),_.unsubscribe()},_=l.subscribe({next:j,error:j,complete:j})}}else l=P(Object(f.execute)(link,y))}else l=O.of({data:{}}),t=this.prepareContext(t);var w=this.transform(e).clientQuery;return w&&(l=function(e,t){return new O((function(r){var n=r.next,o=r.error,c=r.complete,l=0,h=!1,f={next:function(e){++l,new Promise((function(r){r(t(e))})).then((function(e){--l,n&&n.call(r,e),h&&f.complete()}),(function(e){--l,o&&o.call(r,e)}))},error:function(e){o&&o.call(r,e)},complete:function(){h=!0,l||c&&c.call(r)}},sub=e.subscribe(f);return function(){return sub.unsubscribe()}}))}(l,(function(e){return h.localState.runResolvers({document:w,remoteResult:e,context:t,variables:r})}))),l},e.prototype.fetchRequest=function(e){var t,r,o=this,c=e.requestId,l=e.queryId,h=e.document,f=e.options,v=e.fetchMoreForQueryId,d=f.variables,y=f.errorPolicy,m=void 0===y?"none":y,O=f.fetchPolicy;return new Promise((function(e,y){var j=o.getObservableFromLink(h,f.context,d),w="fetchRequest:"+l;o.fetchQueryRejectFns.set(w,y);var k=function(){o.fetchQueryRejectFns.delete(w),o.setQuery(l,(function(e){e.subscriptions.delete(S)}))},S=j.map((function(e){if(c>=o.getQuery(l).lastRequestId&&(o.markQueryResult(l,e,f,v),o.queryStore.markQueryResult(l,e,v),o.invalidate(l),o.invalidate(v),o.broadcastQueries()),"none"===m&&Q(e.errors))return y(new _({graphQLErrors:e.errors}));if("all"===m&&(r=e.errors),v||"no-cache"===O)t=e.data;else{var n=o.dataStore.getCache().diff({variables:d,query:h,optimistic:!1,returnPartialData:!0}),j=n.result;(n.complete||f.returnPartialData)&&(t=j)}})).subscribe({error:function(e){k(),y(e)},complete:function(){k(),e({data:t,errors:r,loading:!1,networkStatus:n.ready,stale:!1})}});o.setQuery(l,(function(e){e.subscriptions.add(S)}))}))},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},e.prototype.setQuery=function(e,t){var r=this.getQuery(e),n=Object(o.__assign)(Object(o.__assign)({},r),t(r));this.queries.set(e,n)},e.prototype.invalidate=function(e,t){void 0===t&&(t=!0),e&&this.setQuery(e,(function(){return{invalidated:t}}))},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return Object(o.__assign)(Object(o.__assign)({},t),{clientAwareness:this.clientAwareness})},e.prototype.checkInFlight=function(e){var t=this.queryStore.get(e);return t&&t.networkStatus!==n.ready&&t.networkStatus!==n.error},e.prototype.startPollingQuery=function(e,t,r){var n=this,c=e.pollInterval;if(Object(d.b)(c,18),!this.ssrMode){var l=this.pollingInfoByQueryId.get(t);l||this.pollingInfoByQueryId.set(t,l={}),l.interval=c,l.options=Object(o.__assign)(Object(o.__assign)({},e),{fetchPolicy:"network-only"});var h=function(){var e=n.pollingInfoByQueryId.get(t);e&&(n.checkInFlight(t)?f():n.fetchQuery(t,e.options,j.poll).then(f,f))},f=function(){var e=n.pollingInfoByQueryId.get(t);e&&(clearTimeout(e.timeout),e.timeout=setTimeout(h,e.interval))};r&&this.addQueryListener(t,r),f()}return t},e.prototype.stopPollingQuery=function(e){this.pollingInfoByQueryId.delete(e)},e}(),x=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,r,n,o){void 0===o&&(o=!1);var l=!Object(c.k)(e);o&&Object(c.k)(e)&&e.data&&(l=!0),!n&&l&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:r})},e.prototype.markSubscriptionResult=function(e,t,r){Object(c.k)(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:r})},e.prototype.markMutationInit=function(e){var t,r=this;e.optimisticResponse&&(t="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse,this.cache.recordOptimisticTransaction((function(n){var o=r.cache;r.cache=n;try{r.markMutationResult({mutationId:e.mutationId,result:{data:t},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{r.cache=o}}),e.mutationId))},e.prototype.markMutationResult=function(e){var t=this;if(!Object(c.k)(e.result)){var r=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],n=e.updateQueries;n&&Object.keys(n).forEach((function(o){var l=n[o],h=l.query,f=l.updater,v=t.cache.diff({query:h.document,variables:h.variables,returnPartialData:!0,optimistic:!1}),d=v.result;if(v.complete){var y=Object(c.v)((function(){return f(d,{mutationResult:e.result,queryName:Object(c.j)(h.document)||void 0,queryVariables:h.variables})}));y&&r.push({result:y,dataId:"ROOT_QUERY",query:h.document,variables:h.variables})}})),this.cache.performTransaction((function(t){r.forEach((function(e){return t.write(e)}));var n=e.update;n&&Object(c.v)((function(){return n(t,e.result)}))}))}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,r){this.cache.write({result:r,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),L=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.cache,n=e.ssrMode,o=void 0!==n&&n,c=e.ssrForceFetchDelay,l=void 0===c?0:c,h=e.connectToDevTools,v=e.queryDeduplication,y=void 0===v||v,m=e.defaultOptions,O=e.assumeImmutableResults,Q=void 0!==O&&O,j=e.resolvers,_=e.typeDefs,w=e.fragmentMatcher,k=e.name,S=e.version,link=e.link;if(!link&&j&&(link=f.ApolloLink.empty()),!link||!r)throw new d.a(1);this.link=link,this.cache=r,this.store=new x(r),this.disableNetworkFetches=o||l>0,this.queryDeduplication=y,this.defaultOptions=m||{},this.typeDefs=_,l&&setTimeout((function(){return t.disableNetworkFetches=!1}),l),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);void 0!==h&&(h&&"undefined"!=typeof window)&&(window.__APOLLO_CLIENT__=this),this.version="2.6.8",this.localState=new I({cache:r,client:this,resolvers:j,fragmentMatcher:w}),this.queryManager=new D({link:this.link,store:this.store,queryDeduplication:y,ssrMode:o,clientAwareness:{name:k,version:S},localState:this.localState,assumeImmutableResults:Q,onBroadcast:function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.queryStore.getStore(),mutations:t.queryManager.mutationStore.getStore()},dataWithOptimisticResults:t.cache.extract(!0)})}})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Object(o.__assign)(Object(o.__assign)({},this.defaultOptions.watchQuery),e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=Object(o.__assign)(Object(o.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Object(o.__assign)(Object(o.__assign)({},this.defaultOptions.query),e)),Object(d.b)("cache-and-network"!==e.fetchPolicy,2),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=Object(o.__assign)(Object(o.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Object(o.__assign)(Object(o.__assign)({},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){var t=this.cache.writeQuery(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.cache.writeData(e);return this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Object(f.execute)(this.link,e)},e.prototype.initQueryManager=function(){return this.queryManager},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}()}}]); //# sourceMappingURL=ca6d5092d0c451c01c7d.js.map