@coasys/ad4m-connect 0.12.0-rc2 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.js CHANGED
@@ -48,7 +48,7 @@ For more information about these options, please refer to the documentation:
48
48
  `)})}return r.networkError&&(e+="".concat(r.networkError.message,`
49
49
  `)),e=e.replace(/\n$/,""),e},fr=function(r){Oe(e,r);function e(t){var n=t.graphQLErrors,i=t.clientErrors,a=t.networkError,o=t.errorMessage,s=t.extraInfo,c=r.call(this,o)||this;return c.name="ApolloError",c.graphQLErrors=n||[],c.clientErrors=i||[],c.networkError=a||null,c.message=o||Ng(c),c.extraInfo=s,c.__proto__=e.prototype,c}return e}(Error);var pe;(function(r){r[r.loading=1]="loading",r[r.setVariables=2]="setVariables",r[r.fetchMore=3]="fetchMore",r[r.refetch=4]="refetch",r[r.poll=6]="poll",r[r.ready=7]="ready",r[r.error=8]="error"})(pe||(pe={}));function Rr(r){return r?r<7:!1}var Rg=Object.assign,Cg=Object.hasOwnProperty,$o=function(r){Oe(e,r);function e(t){var n=t.queryManager,i=t.queryInfo,a=t.options,o=r.call(this,function(v){try{var _=v._subscription._observer;_&&!_.error&&(_.error=Pg)}catch{}var y=!o.observers.size;o.observers.add(v);var b=o.last;return b&&b.error?v.error&&v.error(b.error):b&&b.result&&v.next&&v.next(b.result),y&&o.reobserve().catch(function(){}),function(){o.observers.delete(v)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.isTornDown=!1;var s=n.defaultOptions.watchQuery,c=s===void 0?{}:s,u=c.fetchPolicy,l=u===void 0?"cache-first":u,p=a.fetchPolicy,d=p===void 0?l:p,f=a.initialFetchPolicy,h=f===void 0?d==="standby"?l:d:f;o.options=x(x({},a),{initialFetchPolicy:h,fetchPolicy:d}),o.queryId=i.queryId||n.generateQueryId();var m=Wt(o.query);return o.queryName=m&&m.name&&m.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var t=this;return new Promise(function(n,i){var a={next:function(s){n(s),t.observers.delete(a),t.observers.size||t.queryManager.removeQuery(t.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=t.subscribe(a)})},e.prototype.getCurrentResult=function(t){t===void 0&&(t=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||pe.ready,a=x(x({},n),{loading:Rr(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var c=this.queryInfo.getDiff();(c.complete||this.options.returnPartialData)&&(a.data=c.result),Ee(a.data,{})&&(a.data=void 0),c.complete?(delete a.partial,c.complete&&a.networkStatus===pe.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=pe.ready,a.loading=!1)):a.partial=!0,__DEV__&&!c.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&iu(c.missing)}return t&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(t,n){return!this.last||!Ee(this.last.result,t)||n&&!Ee(this.last.variables,n)},e.prototype.getLast=function(t,n){var i=this.last;if(i&&i[t]&&(!n||Ee(i.variables,this.variables)))return i[t]},e.prototype.getLastResult=function(t){return this.getLast("result",t)},e.prototype.getLastError=function(t){return this.getLast("error",t)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(t){var n,i={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?i.fetchPolicy=a:a==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",__DEV__&&t&&Cg.call(t,"variables")){var o=Wi(this.query),s=o.variableDefinitions;(!s||!s.some(function(c){return c.variable.name.value==="variables"}))&&__DEV__&&L.warn("Called refetch(".concat(JSON.stringify(t),") for query ").concat(((n=o.name)===null||n===void 0?void 0:n.value)||JSON.stringify(o),`, which does not declare a $variables variable.
50
50
  Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return t&&!Ee(this.options.variables,t)&&(i.variables=this.options.variables=x(x({},this.options.variables),t)),this.queryInfo.resetLastWrite(),this.reobserve(i,pe.refetch)},e.prototype.fetchMore=function(t){var n=this,i=x(x({},t.query?t:x(x(x(x({},this.options),{query:this.query}),t),{variables:x(x({},this.options.variables),t.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=pe.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set;return this.queryManager.fetchQuery(a,i,pe.fetchMore).then(function(u){return n.queryManager.removeQuery(a),o.networkStatus===pe.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var p=t.updateQuery;p?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(d){return p(d,{fetchMoreResult:u.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:u.data})},onWatchUpdated:function(l){c.add(l.query)}}),u}).finally(function(){c.has(n.query)||nu(n)})},e.prototype.subscribeToMore=function(t){var n=this,i=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:function(a){var o=t.updateQuery;o&&n.updateQuery(function(s,c){var u=c.variables;return o(s,{subscriptionData:a,variables:u})})},error:function(a){if(t.onError){t.onError(a);return}__DEV__&&L.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(t){return this.reobserve(t)},e.prototype.setVariables=function(t){return Ee(this.variables,t)?this.observers.size?this.result():Promise.resolve():(this.options.variables=t,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:t},pe.setVariables):Promise.resolve())},e.prototype.updateQuery=function(t){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=t(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(t){this.options.pollInterval=t,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(t,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:t,options:n,observable:this,initialFetchPolicy:s}):t==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(t,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,t,n)},e.prototype.updatePolling=function(){var t=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){__DEV__?L(a,"Attempted to start a polling query without a polling interval."):L(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){t.pollingInfo&&(Rr(t.queryInfo.networkStatus)?c():t.reobserve({fetchPolicy:t.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},pe.poll).then(c,c))},c=function(){var u=t.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(s,u.interval))};c()}}},e.prototype.updateLastResult=function(t,n){return n===void 0&&(n=this.variables),this.last=x(x({},this.last),{result:this.queryManager.assumeImmutableResults?t:ho(t),variables:n}),Fe(t.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(t,n){var i=this;this.isTornDown=!1;var a=n===pe.refetch||n===pe.fetchMore||n===pe.poll,o=this.options.variables,s=this.options.fetchPolicy,c=Ar(this.options,t||{}),u=a?c:Rg(this.options,c);a||(this.updatePolling(),t&&t.variables&&!Ee(t.variables,o)&&u.fetchPolicy!=="standby"&&u.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",u),n===void 0&&(n=pe.setVariables)));var l=u.variables&&x({},u.variables),p=this.fetch(u,n),d={next:function(f){i.reportResult(f,l)},error:function(f){i.reportError(f,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=p,this.observer=d),p.addObserver(d),p.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(t,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(t,n))&&((i||!t.partial||this.options.returnPartialData)&&this.updateLastResult(t,n),un(this.observers,"next",t))},e.prototype.reportError=function(t,n){var i=x(x({},this.getLastResult()),{error:t,errors:t.graphQLErrors,networkStatus:pe.error,loading:!1});this.updateLastResult(i,n),un(this.observers,"error",this.last.error=t)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(t){return t.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(ee);go($o);function nu(r){var e=r.options,t=e.fetchPolicy,n=e.nextFetchPolicy;return t==="cache-and-network"||t==="network-only"?r.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):t}}):r.reobserve()}function Pg(r){__DEV__&&L.error("Unhandled error",r.message,r.stack)}function iu(r){__DEV__&&r&&__DEV__&&L.debug("Missing cache result fields: ".concat(JSON.stringify(r)),r)}var Fo=function(){function r(e){var t=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return r.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){t.resolvers=yc(t.resolvers,n)}):this.resolvers=yc(this.resolvers,e)},r.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},r.prototype.getResolvers=function(){return this.resolvers||{}},r.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return Lt(this,void 0,void 0,function(){return $t(this,function(c){return t?[2,this.resolveDocument(t,n.data,i,a,this.fragmentMatcher,s).then(function(u){return x(x({},n),{data:u.result})})]:[2,n]})})},r.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},r.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},r.prototype.clientQuery=function(e){return Jn(["client"],e)&&this.resolvers?e:null},r.prototype.serverQuery=function(e){return gc(e)},r.prototype.prepareContext=function(e){var t=this.cache;return x(x({},e),{cache:t,getCacheKey:function(n){return t.identify(n)}})},r.prototype.addExportedVariables=function(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),Lt(this,void 0,void 0,function(){return $t(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(a){return x(x({},t),a.exportedVariables)})]:[2,x({},t)]})})},r.prototype.shouldForceResolvers=function(e){var t=!1;return Ye(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(t=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),t))return tn}}}),t},r.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:mc(e),variables:t,returnPartialData:!0,optimistic:!1}).result},r.prototype.resolveDocument=function(e,t,n,i,a,o){return n===void 0&&(n={}),i===void 0&&(i={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),Lt(this,void 0,void 0,function(){var s,c,u,l,p,d,f,h,m,v,_;return $t(this,function(y){return s=on(e),c=an(e),u=rn(c),l=this.collectSelectionsToResolve(s,u),p=s.operation,d=p?p.charAt(0).toUpperCase()+p.slice(1):"Query",f=this,h=f.cache,m=f.client,v={fragmentMap:u,context:x(x({},n),{cache:h,client:m}),variables:i,fragmentMatcher:a,defaultOperationType:d,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},_=!1,[2,this.resolveSelectionSet(s.selectionSet,_,t,v).then(function(b){return{result:b,exportedVariables:v.exportedVariables}})]})})},r.prototype.resolveSelectionSet=function(e,t,n,i){return Lt(this,void 0,void 0,function(){var a,o,s,c,u,l=this;return $t(this,function(p){return a=i.fragmentMap,o=i.context,s=i.variables,c=[n],u=function(d){return Lt(l,void 0,void 0,function(){var f,h;return $t(this,function(m){return!t&&!i.selectionsToResolve.has(d)?[2]:ur(d,s)?vt(d)?[2,this.resolveField(d,t,n,i).then(function(v){var _;typeof v<"u"&&c.push((_={},_[It(d)]=v,_))})]:(fc(d)?f=d:(f=a[d.name.value],__DEV__?L(f,"No fragment named ".concat(d.name.value)):L(f,11)),f&&f.typeCondition&&(h=f.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(f.selectionSet,t,n,i).then(function(v){c.push(v)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return Gi(c)})]})})},r.prototype.resolveField=function(e,t,n,i){return Lt(this,void 0,void 0,function(){var a,o,s,c,u,l,p,d,f,h=this;return $t(this,function(m){return n?(a=i.variables,o=e.name.value,s=It(e),c=o!==s,u=n[s]||n[o],l=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(p=n.__typename||i.defaultOperationType,d=this.resolvers&&this.resolvers[p],d&&(f=d[c?o:s],f&&(l=Promise.resolve(si.withValue(this.cache,f,[n,lr(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(v){var _,y;if(v===void 0&&(v=u),e.directives&&e.directives.forEach(function(g){g.name.value==="export"&&g.arguments&&g.arguments.forEach(function(A){A.name.value==="as"&&A.value.kind==="StringValue"&&(i.exportedVariables[A.value.value]=v)})}),!e.selectionSet||v==null)return v;var b=(y=(_=e.directives)===null||_===void 0?void 0:_.some(function(g){return g.name.value==="client"}))!==null&&y!==void 0?y:!1;if(Array.isArray(v))return h.resolveSubSelectedArray(e,t||b,v,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,t||b,v,i)})]):[2,null]})})},r.prototype.resolveSubSelectedArray=function(e,t,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,t,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,t,o,i)}))},r.prototype.collectSelectionsToResolve=function(e,t){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),Ye(o,{Directive:function(c,u,l,p,d){c.name.value==="client"&&d.forEach(function(f){n(f)&&Bi(f)&&s.add(f)})},FragmentSpread:function(c,u,l,p,d){var f=t[c.name.value];__DEV__?L(f,"No fragment named ".concat(c.name.value)):L(f,12);var h=a(f);h.size>0&&(d.forEach(function(m){n(m)&&Bi(m)&&s.add(m)}),s.add(c),h.forEach(function(m){s.add(m)}))}})}return i.get(o)}return a(e)},r}();var ui=new(Tt?WeakMap:Map);function au(r,e){var t=r[e];typeof t=="function"&&(r[e]=function(){return ui.set(r,(ui.get(r)+1)%1e15),t.apply(this,arguments)})}function sp(r){r.notifyTimeout&&(clearTimeout(r.notifyTimeout),r.notifyTimeout=void 0)}var Mo=function(){function r(e,t){t===void 0&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;ui.has(n)||(ui.set(n,0),au(n,"evict"),au(n,"modify"),au(n,"reset"))}return r.prototype.init=function(e){var t=e.networkStatus||pe.loading;return this.variables&&this.networkStatus!==pe.loading&&!Ee(this.variables,e.variables)&&(t=pe.setVariables),Ee(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},r.prototype.reset=function(){sp(this),this.dirty=!1},r.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&Ee(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=this.cache.diff(t);return this.updateLastDiff(i,t),i},r.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},r.prototype.getDiffOptions=function(e){var t;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(t=this.observableQuery)===null||t===void 0?void 0:t.options.canonizeResults}},r.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!Ee(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},r.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=t.getDiff();n.fromOptimisticTransaction?e.observe():nu(e)})):delete this.oqListener)},r.prototype.notify=function(){var e=this;sp(this),this.shouldNotify()&&this.listeners.forEach(function(t){return t(e)}),this.dirty=!1},r.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Rr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},r.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=r.prototype.cancel,this.subscriptions.forEach(function(t){return t.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},r.prototype.cancel=function(){},r.prototype.updateWatch=function(e){var t=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=x(x({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return t.setDiff(a)}});(!this.lastWatch||!Ee(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},r.prototype.resetLastWrite=function(){this.lastWrite=void 0},r.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===ui.get(this.cache)&&Ee(t,n.variables)&&Ee(e.data,n.result.data))},r.prototype.markResult=function(e,t,n,i){var a=this,o=new ut,s=Fe(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Fe(e.incremental)){var c=yo(this.getDiff().result,e);e.data=c}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(jo(e,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,n.variables))l.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:ui.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var p=a.getDiffOptions(n.variables),d=l.diff(p);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(d,p),d.complete&&(e.data=d.result)}):this.lastWrite=void 0)},r.prototype.markReady=function(){return this.networkError=null,this.networkStatus=pe.ready},r.prototype.markError=function(e){return this.networkStatus=pe.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},r}();function jo(r,e){e===void 0&&(e="none");var t=e==="ignore"||e==="all",n=!ri(r);return!n&&t&&r.data&&(n=!0),n}var Lg=Object.prototype.hasOwnProperty,cp=function(){function r(e){var t=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,c=e.ssrMode,u=c===void 0?!1:c,l=e.clientAwareness,p=l===void 0?{}:l,d=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Tt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=p,this.localState=d||new Fo({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!f,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return r.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new K("QueryManager stopped while query was in flight"):new K(14))},r.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},r.prototype.mutate=function(e){var t,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,c=e.refetchQueries,u=c===void 0?[]:c,l=e.awaitRefetchQueries,p=l===void 0?!1:l,d=e.update,f=e.onQueryUpdated,h=e.fetchPolicy,m=h===void 0?((t=this.defaultOptions.mutate)===null||t===void 0?void 0:t.fetchPolicy)||"network-only":h,v=e.errorPolicy,_=v===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":v,y=e.keepRootFields,b=e.context;return Lt(this,void 0,void 0,function(){var g,A,N,I,C,$;return $t(this,function(P){switch(P.label){case 0:return __DEV__?L(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):L(i,15),__DEV__?L(m==="network-only"||m==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):L(m==="network-only"||m==="no-cache",16),g=this.generateMutationId(),A=this.transform(i),N=A.document,I=A.hasClientExports,i=this.cache.transformForLink(N),a=this.getVariables(i,a),I?[4,this.localState.addExportedVariables(i,a,b)]:[3,2];case 1:a=P.sent(),P.label=2;case 2:return C=this.mutationStore&&(this.mutationStore[g]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:g,document:i,variables:a,fetchPolicy:m,errorPolicy:_,context:b,updateQueries:s,update:d,keepRootFields:y}),this.broadcastQueries(),$=this,[2,new Promise(function(j,xe){return mo($.getObservableFromLink(i,x(x({},b),{optimisticResponse:o}),a,!1),function(Te){if(ri(Te)&&_==="none")throw new fr({graphQLErrors:vo(Te)});C&&(C.loading=!1,C.error=null);var k=x({},Te);return typeof u=="function"&&(u=u(k)),_==="ignore"&&ri(k)&&delete k.errors,$.markMutationResult({mutationId:g,result:k,document:i,variables:a,fetchPolicy:m,errorPolicy:_,context:b,update:d,updateQueries:s,awaitRefetchQueries:p,refetchQueries:u,removeOptimistic:o?g:void 0,onQueryUpdated:f,keepRootFields:y})}).subscribe({next:function(Te){$.broadcastQueries(),(!("hasNext"in Te)||Te.hasNext===!1)&&j(Te)},error:function(Te){C&&(C.loading=!1,C.error=Te),o&&$.cache.removeOptimistic(g),$.broadcastQueries(),xe(Te instanceof fr?Te:new fr({networkError:Te}))}})})]}})})},r.prototype.markMutationResult=function(e,t){var n=this;t===void 0&&(t=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&jo(i,e.errorPolicy)){if(Tr(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Tr(i)&&Fe(i.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),c=void 0;s.result&&(c=yo(s.result,i)),typeof c<"u"&&(i.data=c,a.push({result:c,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(p,d){var f=p.observableQuery,h=f&&f.queryName;if(!(!h||!Lg.call(u,h))){var m=u[h],v=n.queries.get(d),_=v.document,y=v.variables,b=t.diff({query:_,variables:y,returnPartialData:!0,optimistic:!1}),g=b.result,A=b.complete;if(A&&g){var N=m(g,{mutationResult:i,queryName:_&&Yn(_)||void 0,queryVariables:y});N&&a.push({result:N,dataId:"ROOT_QUERY",query:_,variables:y})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(p){o||a.forEach(function(m){return p.write(m)});var d=e.update,f=!Ql(i)||Tr(i)&&!i.hasNext;if(d){if(!o){var h=p.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=x(x({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&d(p,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&f&&p.modify({id:"ROOT_MUTATION",fields:function(m,v){var _=v.fieldName,y=v.DELETE;return _==="__typename"?m:y}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(p){return l.push(p)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},r.prototype.markMutationOptimistic=function(e,t){var n=this,i=typeof e=="function"?e(t.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(x(x({},t),{result:{data:i}}),a)}catch(o){__DEV__&&L.error(o)}},t.mutationId)},r.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},r.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},r.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},r.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.cache.transformDocument(e),i=hc(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:sc(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:sn(Wt(n)),asQuery:x(x({},n),{definitions:n.definitions.map(function(u){return u.kind==="OperationDefinition"&&u.operation!=="query"?x(x({},u),{operation:"query"}):u})})},c=function(u){u&&!t.has(u)&&t.set(u,s)};c(e),c(n),c(a),c(o)}return t.get(e)},r.prototype.getVariables=function(e,t){return x(x({},this.transform(e).defaultVars),t)},r.prototype.watchQuery=function(e){e=x(x({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var t=new Mo(this),n=new $o({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:n.query,observableQuery:n,variables:n.variables}),n},r.prototype.query=function(e,t){var n=this;return t===void 0&&(t=this.generateQueryId()),__DEV__?L(e.query,"query option is required. You must specify your GraphQL document in the query option."):L(e.query,17),__DEV__?L(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):L(e.query.kind==="Document",18),__DEV__?L(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):L(!e.returnPartialData,19),__DEV__?L(!e.pollInterval,"pollInterval option only supported on watchQuery."):L(!e.pollInterval,20),this.fetchQuery(t,e).finally(function(){return n.stopQuery(t)})},r.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},r.prototype.generateRequestId=function(){return this.requestIdCounter++},r.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},r.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},r.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new K("Store reset while query was in flight (not completed in link chain)"):new K(21)),this.queries.forEach(function(t){t.observableQuery?t.networkStatus=pe.loading:t.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},r.prototype.getObservableQueries=function(e){var t=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):uc(o)?i.set(t.transform(o).document,!1):se(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var c=o.observableQuery,u=o.document;if(c){if(e==="all"){n.set(s,c);return}var l=c.queryName,p=c.options.fetchPolicy;if(p==="standby"||e==="active"&&!c.hasObservers())return;(e==="active"||l&&i.has(l)||u&&i.has(u))&&(n.set(s,c),l&&i.set(l,!0),u&&i.set(u,!0))}}),a.size&&a.forEach(function(o){var s=Ji("legacyOneTimeQuery"),c=t.getQuery(s).init({document:o.query,variables:o.variables}),u=new $o({queryManager:t,queryInfo:c,options:x(x({},o),{fetchPolicy:"network-only"})});L(u.queryId===s),c.setObservableQuery(u),n.set(s,u)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&L.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},r.prototype.reFetchObservableQueries=function(e){var t=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),t.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},r.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},r.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,c=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var u=function(p){return t.getObservableFromLink(n,c,p).map(function(d){if(i!=="no-cache"&&(jo(d,a)&&t.cache.write({query:n,result:d.data,dataId:"ROOT_SUBSCRIPTION",variables:p}),t.broadcastQueries()),ri(d))throw new fr({graphQLErrors:d.errors});return d})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,c).then(u);return new ee(function(p){var d=null;return l.then(function(f){return d=f.subscribe(p)},p.error),function(){return d&&d.unsubscribe()}})}return u(o)},r.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},r.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},r.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},r.prototype.getLocalState=function(){return this.localState},r.prototype.getObservableFromLink=function(e,t,n,i){var a=this,o;i===void 0&&(i=(o=t?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,c=this.transform(e).serverQuery;if(c){var u=this,l=u.inFlightLinkObservables,p=u.link,d={query:c,variables:n,operationName:Yn(c)||void 0,context:this.prepareContext(x(x({},t),{forceFetch:!i}))};if(t=d.context,i){var f=l.get(c)||new Map;l.set(c,f);var h=bt(n);if(s=f.get(h),!s){var m=new ti([ni(p,d)]);f.set(h,s=m),m.beforeNext(function(){f.delete(h)&&f.size<1&&l.delete(c)})}}else s=new ti([ni(p,d)])}else s=new ti([ee.of({data:{}})]),t=this.prepareContext(t);var v=this.transform(e).clientQuery;return v&&(s=mo(s,function(_){return a.localState.runResolvers({document:v,remoteResult:_,context:t,variables:n})})),s},r.prototype.getResultsFromLink=function(e,t,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return mo(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=vo(o),c=s.length>0;if(i>=e.lastRequestId){if(c&&n.errorPolicy==="none")throw e.markError(new fr({graphQLErrors:s}));e.markResult(o,a,n,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:pe.ready};return c&&n.errorPolicy!=="ignore"&&(u.errors=s,u.networkStatus=pe.error),u},function(o){var s=op(o)?o:new fr({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},r.prototype.fetchQueryObservable=function(e,t,n){var i=this;n===void 0&&(n=pe.loading);var a=this.transform(t.query).document,o=this.getVariables(a,t.variables),s=this.getQuery(e),c=this.defaultOptions.watchQuery,u=t.fetchPolicy,l=u===void 0?c&&c.fetchPolicy||"cache-first":u,p=t.errorPolicy,d=p===void 0?c&&c.errorPolicy||"none":p,f=t.returnPartialData,h=f===void 0?!1:f,m=t.notifyOnNetworkStatusChange,v=m===void 0?!1:m,_=t.context,y=_===void 0?{}:_,b=Object.assign({},t,{query:a,variables:o,fetchPolicy:l,errorPolicy:d,returnPartialData:h,notifyOnNetworkStatusChange:v,context:y}),g=function(I){b.variables=I;var C=i.fetchQueryByPolicy(s,b,n);return b.fetchPolicy!=="standby"&&C.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",t),C},A=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(I){A(),setTimeout(function(){return N.cancel(I)})});var N=new ti(this.transform(b.query).hasClientExports?this.localState.addExportedVariables(b.query,b.variables,b.context).then(g):g(b.variables));return N.promise.then(A,A),N},r.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,c=s===void 0?o?Ji("refetchQueries"):void 0:s,u=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(d,f){l.set(f,{oq:d,lastDiff:t.getQuery(f).getDiff()})});var p=new Map;return n&&this.cache.batch({update:n,optimistic:o&&c||!1,removeOptimistic:c,onWatchUpdated:function(d,f,h){var m=d.watcher instanceof Mo&&d.watcher.observableQuery;if(m){if(u){l.delete(m.queryId);var v=u(m,f,h);return v===!0&&(v=m.refetch()),v!==!1&&p.set(m,v),v}u!==null&&l.set(m.queryId,{oq:m,lastDiff:h,diff:f})}}}),l.size&&l.forEach(function(d,f){var h=d.oq,m=d.lastDiff,v=d.diff,_;if(u){if(!v){var y=h.queryInfo;y.reset(),v=y.getDiff()}_=u(h,v,m)}(!u||_===!0)&&(_=h.refetch()),_!==!1&&p.set(h,_),f.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(f)}),c&&this.cache.removeOptimistic(c),p},r.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,a=t.query,o=t.variables,s=t.fetchPolicy,c=t.refetchWritePolicy,u=t.errorPolicy,l=t.returnPartialData,p=t.context,d=t.notifyOnNetworkStatusChange,f=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return e.getDiff(o)},m=function(g,A){A===void 0&&(A=e.networkStatus||pe.loading);var N=g.result;__DEV__&&!l&&!Ee(N,{})&&iu(g.missing);var I=function(C){return ee.of(x({data:C,loading:Rr(A),networkStatus:A},g.complete?null:{partial:!0}))};return N&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:N},context:p,variables:o,onlyRunForcedResolvers:!0}).then(function(C){return I(C.data||void 0)}):u==="none"&&A===pe.refetch&&Array.isArray(g.missing)?I(void 0):I(N)},v=s==="no-cache"?0:n===pe.refetch&&c!=="merge"?1:2,_=function(){return i.getResultsFromLink(e,v,{variables:o,context:p,fetchPolicy:s,errorPolicy:u})},y=d&&typeof f=="number"&&f!==n&&Rr(n);switch(s){default:case"cache-first":{var b=h();return b.complete?[m(b,e.markReady())]:l||y?[m(b),_()]:[_()]}case"cache-and-network":{var b=h();return b.complete||l||y?[m(b),_()]:[_()]}case"cache-only":return[m(h(),e.markReady())];case"network-only":return y?[m(h()),_()]:[_()];case"no-cache":return y?[m(e.getDiff()),_()]:[_()];case"standby":return[]}},r.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Mo(this,e)),this.queries.get(e)},r.prototype.prepareContext=function(e){e===void 0&&(e={});var t=this.localState.prepareContext(e);return x(x({},t),{clientAwareness:this.clientAwareness})},r}();var up=!1;var ou=function(){function r(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,c=s===void 0?!1:s,u=e.ssrForceFetchDelay,l=u===void 0?0:u,p=e.connectToDevTools,d=p===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:p,f=e.queryDeduplication,h=f===void 0?!0:f,m=e.defaultOptions,v=e.assumeImmutableResults,_=v===void 0?!1:v,y=e.resolvers,b=e.typeDefs,g=e.fragmentMatcher,A=e.name,N=e.version,I=e.link;if(I||(I=n?new Pc({uri:n,credentials:i,headers:a}):At.empty()),!o)throw __DEV__?new K(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
51
- For more information, please visit: https://go.apollo.dev/c/docs`):new K(9);if(this.link=I,this.cache=o,this.disableNetworkFetches=c||l>0,this.queryDeduplication=h,this.defaultOptions=m||Object.create(null),this.typeDefs=b,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),d&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!up&&d&&__DEV__&&(up=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var C=window.navigator,$=C&&C.userAgent,P=void 0;typeof $=="string"&&($.indexOf("Chrome/")>-1?P="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":$.indexOf("Firefox/")>-1&&(P="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),P&&__DEV__&&L.log("Download the Apollo DevTools for a better development experience: "+P)}this.version=Hl,this.localState=new Fo({cache:o,client:this,resolvers:y,fragmentMatcher:g}),this.queryManager=new cp({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:c,clientAwareness:{name:A,version:N},localState:this.localState,assumeImmutableResults:_,onBroadcast:d?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return r.prototype.stop=function(){this.queryManager.stop()},r.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Zi(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=x(x({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},r.prototype.query=function(e){return this.defaultOptions.query&&(e=Zi(this.defaultOptions.query,e)),__DEV__?L(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):L(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=x(x({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},r.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Zi(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},r.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!1),this.cache.readQuery(e,t)},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!1),this.cache.readFragment(e,t)},r.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},r.prototype.__requestRaw=function(e){return ni(this.link,e)},r.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(t){return t()}))}).then(function(){return e.reFetchObservableQueries()})},r.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(t){return t()}))})},r.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},r.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],i=[];t.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&L.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},r.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},r.prototype.extract=function(e){return this.cache.extract(e)},r.prototype.restore=function(e){return this.cache.restore(e)},r.prototype.addResolvers=function(e){this.localState.addResolvers(e)},r.prototype.setResolvers=function(e){this.localState.setResolvers(e)},r.prototype.getResolvers=function(){return this.localState.getResolvers()},r.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},r.prototype.setLink=function(e){this.link=this.queryManager.link=e},r}();Sl(en?"log":"silent");function tt(r){return r===null?"null":Array.isArray(r)?"array":typeof r}function pr(r){return tt(r)==="object"}function lp(r){return Array.isArray(r)&&r.length>0&&r.every(e=>"message"in e)}function su(r,e){return r.length<124?r:e}var fp="graphql-transport-ws";var lt;(function(r){r[r.InternalServerError=4500]="InternalServerError",r[r.InternalClientError=4005]="InternalClientError",r[r.BadRequest=4400]="BadRequest",r[r.BadResponse=4004]="BadResponse",r[r.Unauthorized=4401]="Unauthorized",r[r.Forbidden=4403]="Forbidden",r[r.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",r[r.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",r[r.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",r[r.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",r[r.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(lt||(lt={}));var Ne;(function(r){r.ConnectionInit="connection_init",r.ConnectionAck="connection_ack",r.Ping="ping",r.Pong="pong",r.Subscribe="subscribe",r.Next="next",r.Error="error",r.Complete="complete"})(Ne||(Ne={}));function pp(r){if(!pr(r))throw new Error(`Message is expected to be an object, but got ${tt(r)}`);if(!r.type)throw new Error("Message is missing the 'type' property");if(typeof r.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${tt(r.type)}`);switch(r.type){case Ne.ConnectionInit:case Ne.ConnectionAck:case Ne.Ping:case Ne.Pong:{if(r.payload!=null&&!pr(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${r.payload}"`);break}case Ne.Subscribe:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${tt(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!pr(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${tt(r.payload)}`);if(typeof r.payload.query!="string")throw new Error(`"${r.type}" message payload expects the 'query' property to be a string, but got ${tt(r.payload.query)}`);if(r.payload.variables!=null&&!pr(r.payload.variables))throw new Error(`"${r.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${tt(r.payload.variables)}`);if(r.payload.operationName!=null&&tt(r.payload.operationName)!=="string")throw new Error(`"${r.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${tt(r.payload.operationName)}`);if(r.payload.extensions!=null&&!pr(r.payload.extensions))throw new Error(`"${r.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${tt(r.payload.extensions)}`);break}case Ne.Next:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${tt(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!pr(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${tt(r.payload)}`);break}case Ne.Error:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${tt(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!lp(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(r.payload)}`);break}case Ne.Complete:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${tt(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${r.type}"`)}return r}function dp(r,e){return pp(typeof r=="string"?JSON.parse(r,e):r)}function li(r,e){return pp(r),JSON.stringify(r,e)}function cu(r){let{url:e,connectionParams:t,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:c=0,retryAttempts:u=5,retryWait:l=async function(ye){let ve=1e3;for(let ae=0;ae<ye;ae++)ve*=2;await new Promise(ae=>setTimeout(ae,ve+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:p=Uo,isFatalConnectionProblem:d,on:f,webSocketImpl:h,generateID:m=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,ye=>{let ve=Math.random()*16|0;return(ye=="x"?ve:ve&3|8).toString(16)})},jsonMessageReplacer:v,jsonMessageReviver:_}=r,y;if(h){if(!Fg(h))throw new Error("Invalid WebSocket implementation provided");y=h}else typeof WebSocket<"u"?y=WebSocket:typeof global<"u"?y=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(y=window.WebSocket||window.MozWebSocket);if(!y)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let b=y,g=(()=>{let k=(()=>{let ve={};return{on(ae,oe){return ve[ae]=oe,()=>{delete ve[ae]}},emit(ae){var oe;"id"in ae&&((oe=ve[ae.id])===null||oe===void 0||oe.call(ve,ae))}}})(),ye={connecting:f?.connecting?[f.connecting]:[],opened:f?.opened?[f.opened]:[],connected:f?.connected?[f.connected]:[],ping:f?.ping?[f.ping]:[],pong:f?.pong?[f.pong]:[],message:f?.message?[k.emit,f.message]:[k.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:k.on,on(ve,ae){let oe=ye[ve];return oe.push(ae),()=>{oe.splice(oe.indexOf(ae),1)}},emit(ve,...ae){for(let oe of[...ye[ve]])oe(...ae)}}})();function A(k){let ye=[g.on("error",ve=>{ye.forEach(ae=>ae()),k(ve)}),g.on("closed",ve=>{ye.forEach(ae=>ae()),k(ve)})]}let N,I=0,C,$=!1,P=0,j=!1;async function xe(){clearTimeout(C);let[k,ye]=await(N??(N=new Promise((oe,Bt)=>(async()=>{if($){if(await l(P),!I)return N=void 0,Bt({code:1e3,reason:"All Subscriptions Gone"});P++}g.emit("connecting");let X=new b(typeof e=="function"?await e():e,fp),Vt,_r;function ro(){isFinite(o)&&o>0&&(clearTimeout(_r),_r=setTimeout(()=>{X.readyState===b.OPEN&&(X.send(li({type:Ne.Ping})),g.emit("ping",!1,void 0))},o))}A(We=>{N=void 0,clearTimeout(Vt),clearTimeout(_r),Bt(We),Uo(We)&&We.code===4499&&(X.close(4499,"Terminated"),X.onerror=null,X.onclose=null)}),X.onerror=We=>g.emit("error",We),X.onclose=We=>g.emit("closed",We),X.onopen=async()=>{try{g.emit("opened",X);let We=typeof t=="function"?await t():t;if(X.readyState!==b.OPEN)return;X.send(li(We?{type:Ne.ConnectionInit,payload:We}:{type:Ne.ConnectionInit},v)),isFinite(c)&&c>0&&(Vt=setTimeout(()=>{X.close(lt.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},c)),ro()}catch(We){g.emit("error",We),X.close(lt.InternalClientError,su(We instanceof Error?We.message:new Error(We).message,"Internal client error"))}};let Hn=!1;X.onmessage=({data:We})=>{try{let Ge=dp(We,_);if(g.emit("message",Ge),Ge.type==="ping"||Ge.type==="pong"){g.emit(Ge.type,!0,Ge.payload),Ge.type==="pong"?ro():s||(X.send(li(Ge.payload?{type:Ne.Pong,payload:Ge.payload}:{type:Ne.Pong})),g.emit("pong",!1,Ge.payload));return}if(Hn)return;if(Ge.type!==Ne.ConnectionAck)throw new Error(`First message cannot be of type ${Ge.type}`);clearTimeout(Vt),Hn=!0,g.emit("connected",X,Ge.payload),$=!1,P=0,oe([X,new Promise((Sw,zh)=>A(zh))])}catch(Ge){X.onmessage=null,g.emit("error",Ge),X.close(lt.BadResponse,su(Ge instanceof Error?Ge.message:new Error(Ge).message,"Bad response"))}}})())));k.readyState===b.CLOSING&&await ye;let ve=()=>{},ae=new Promise(oe=>ve=oe);return[k,ve,Promise.race([ae.then(()=>{if(!I){let oe=()=>k.close(1e3,"Normal Closure");isFinite(a)&&a>0?C=setTimeout(()=>{k.readyState===b.OPEN&&oe()},a):oe()}}),ye])]}function Te(k){if(Uo(k)&&($g(k.code)||[lt.InternalServerError,lt.InternalClientError,lt.BadRequest,lt.BadResponse,lt.Unauthorized,lt.SubprotocolNotAcceptable,lt.SubscriberAlreadyExists,lt.TooManyInitialisationRequests].includes(k.code)))throw k;if(j)return!1;if(Uo(k)&&k.code===1e3)return I>0;if(!u||P>=u||!p(k)||d?.(k))throw k;return $=!0}return n||(async()=>{for(I++;;)try{let[,,k]=await xe();await k}catch(k){try{if(!Te(k))return}catch(ye){return i?.(ye)}}})(),{on:g.on,subscribe(k,ye){let ve=m(k),ae=!1,oe=!1,Bt=()=>{I--,ae=!0};return(async()=>{for(I++;;)try{let[X,Vt,_r]=await xe();if(ae)return Vt();let ro=g.onMessage(ve,Hn=>{switch(Hn.type){case Ne.Next:{ye.next(Hn.payload);return}case Ne.Error:{oe=!0,ae=!0,ye.error(Hn.payload),Bt();return}case Ne.Complete:{ae=!0,Bt();return}}});X.send(li({id:ve,type:Ne.Subscribe,payload:k},v)),Bt=()=>{!ae&&X.readyState===b.OPEN&&X.send(li({id:ve,type:Ne.Complete},v)),I--,ae=!0,Vt()},await _r.finally(ro);return}catch(X){if(!Te(X))return}})().then(()=>{oe||ye.complete()}).catch(X=>{ye.error(X)}),()=>{ae||Bt()}},async dispose(){if(j=!0,N){let[k]=await N;k.close(1e3,"Normal Closure")}},terminate(){N&&g.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Uo(r){return pr(r)&&"code"in r&&"reason"in r}function $g(r){return[1e3,1001,1006,1005,1012,1013,1013].includes(r)?!1:r>=1e3&&r<=1999}function Fg(r){return typeof r=="function"&&"constructor"in r&&"CLOSED"in r&&"CLOSING"in r&&"CONNECTING"in r&&"OPEN"in r}function Mg(r){return se(r)&&"code"in r&&"reason"in r}var hp=function(r){Oe(e,r);function e(t){var n=r.call(this)||this;return n.client=t,n}return e.prototype.request=function(t){var n=this;return new ee(function(i){return n.client.subscribe(x(x({},t),{query:Kn(t.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):Mg(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new fr({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(At);var qo="0.12.0-rc2";function mp(){return typeof window!="undefined"&&window.self!==window.top}function uu(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(r){return!1}return!0}function dr(r,e){uu()&&localStorage.setItem(`${qo}/${r}`,e)}function Bo(r){return uu()?localStorage.getItem(`${qo}/${r}`):null}function aa(r){uu()&&localStorage.removeItem(`${qo}/${r}`)}function gp(r,e=1e4){return _e(this,null,function*(){return Promise.race([new Promise((t,n)=>{let i;try{i=new WebSocket(r,"graphql-transport-ws"),i.onopen=()=>{i.close(),t(i)},i.onerror=a=>{n(a)},i.onclose=a=>{a.code!==1e3&&n(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){i&&i.close(),n(a)}}),new Promise((t,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}var bs=function(){return bs=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},bs.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function ns(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ns=function(t){return typeof t}:ns=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ns(r)}function Ug(r){return ns(r)=="object"&&r!==null}var jd=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Ou(r,e){for(var t=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=t.exec(r.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function qg(r){return Ud(r.source,Ou(r.source,r.start))}function Ud(r,e){var t=r.locationOffset.column-1,n=is(t)+r.body,i=e.line-1,a=r.locationOffset.line-1,o=e.line+a,s=e.line===1?t:0,c=e.column+s,u="".concat(r.name,":").concat(o,":").concat(c,`
51
+ For more information, please visit: https://go.apollo.dev/c/docs`):new K(9);if(this.link=I,this.cache=o,this.disableNetworkFetches=c||l>0,this.queryDeduplication=h,this.defaultOptions=m||Object.create(null),this.typeDefs=b,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),d&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!up&&d&&__DEV__&&(up=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var C=window.navigator,$=C&&C.userAgent,P=void 0;typeof $=="string"&&($.indexOf("Chrome/")>-1?P="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":$.indexOf("Firefox/")>-1&&(P="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),P&&__DEV__&&L.log("Download the Apollo DevTools for a better development experience: "+P)}this.version=Hl,this.localState=new Fo({cache:o,client:this,resolvers:y,fragmentMatcher:g}),this.queryManager=new cp({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:c,clientAwareness:{name:A,version:N},localState:this.localState,assumeImmutableResults:_,onBroadcast:d?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return r.prototype.stop=function(){this.queryManager.stop()},r.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Zi(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=x(x({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},r.prototype.query=function(e){return this.defaultOptions.query&&(e=Zi(this.defaultOptions.query,e)),__DEV__?L(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):L(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=x(x({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},r.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Zi(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},r.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!1),this.cache.readQuery(e,t)},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!1),this.cache.readFragment(e,t)},r.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},r.prototype.__requestRaw=function(e){return ni(this.link,e)},r.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(t){return t()}))}).then(function(){return e.reFetchObservableQueries()})},r.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(t){return t()}))})},r.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},r.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],i=[];t.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&L.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},r.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},r.prototype.extract=function(e){return this.cache.extract(e)},r.prototype.restore=function(e){return this.cache.restore(e)},r.prototype.addResolvers=function(e){this.localState.addResolvers(e)},r.prototype.setResolvers=function(e){this.localState.setResolvers(e)},r.prototype.getResolvers=function(){return this.localState.getResolvers()},r.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},r.prototype.setLink=function(e){this.link=this.queryManager.link=e},r}();Sl(en?"log":"silent");function tt(r){return r===null?"null":Array.isArray(r)?"array":typeof r}function pr(r){return tt(r)==="object"}function lp(r){return Array.isArray(r)&&r.length>0&&r.every(e=>"message"in e)}function su(r,e){return r.length<124?r:e}var fp="graphql-transport-ws";var lt;(function(r){r[r.InternalServerError=4500]="InternalServerError",r[r.InternalClientError=4005]="InternalClientError",r[r.BadRequest=4400]="BadRequest",r[r.BadResponse=4004]="BadResponse",r[r.Unauthorized=4401]="Unauthorized",r[r.Forbidden=4403]="Forbidden",r[r.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",r[r.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",r[r.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",r[r.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",r[r.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(lt||(lt={}));var Ne;(function(r){r.ConnectionInit="connection_init",r.ConnectionAck="connection_ack",r.Ping="ping",r.Pong="pong",r.Subscribe="subscribe",r.Next="next",r.Error="error",r.Complete="complete"})(Ne||(Ne={}));function pp(r){if(!pr(r))throw new Error(`Message is expected to be an object, but got ${tt(r)}`);if(!r.type)throw new Error("Message is missing the 'type' property");if(typeof r.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${tt(r.type)}`);switch(r.type){case Ne.ConnectionInit:case Ne.ConnectionAck:case Ne.Ping:case Ne.Pong:{if(r.payload!=null&&!pr(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${r.payload}"`);break}case Ne.Subscribe:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${tt(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!pr(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${tt(r.payload)}`);if(typeof r.payload.query!="string")throw new Error(`"${r.type}" message payload expects the 'query' property to be a string, but got ${tt(r.payload.query)}`);if(r.payload.variables!=null&&!pr(r.payload.variables))throw new Error(`"${r.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${tt(r.payload.variables)}`);if(r.payload.operationName!=null&&tt(r.payload.operationName)!=="string")throw new Error(`"${r.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${tt(r.payload.operationName)}`);if(r.payload.extensions!=null&&!pr(r.payload.extensions))throw new Error(`"${r.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${tt(r.payload.extensions)}`);break}case Ne.Next:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${tt(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!pr(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${tt(r.payload)}`);break}case Ne.Error:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${tt(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!lp(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(r.payload)}`);break}case Ne.Complete:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${tt(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${r.type}"`)}return r}function dp(r,e){return pp(typeof r=="string"?JSON.parse(r,e):r)}function li(r,e){return pp(r),JSON.stringify(r,e)}function cu(r){let{url:e,connectionParams:t,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:c=0,retryAttempts:u=5,retryWait:l=async function(ye){let ve=1e3;for(let ae=0;ae<ye;ae++)ve*=2;await new Promise(ae=>setTimeout(ae,ve+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:p=Uo,isFatalConnectionProblem:d,on:f,webSocketImpl:h,generateID:m=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,ye=>{let ve=Math.random()*16|0;return(ye=="x"?ve:ve&3|8).toString(16)})},jsonMessageReplacer:v,jsonMessageReviver:_}=r,y;if(h){if(!Fg(h))throw new Error("Invalid WebSocket implementation provided");y=h}else typeof WebSocket<"u"?y=WebSocket:typeof global<"u"?y=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(y=window.WebSocket||window.MozWebSocket);if(!y)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let b=y,g=(()=>{let k=(()=>{let ve={};return{on(ae,oe){return ve[ae]=oe,()=>{delete ve[ae]}},emit(ae){var oe;"id"in ae&&((oe=ve[ae.id])===null||oe===void 0||oe.call(ve,ae))}}})(),ye={connecting:f?.connecting?[f.connecting]:[],opened:f?.opened?[f.opened]:[],connected:f?.connected?[f.connected]:[],ping:f?.ping?[f.ping]:[],pong:f?.pong?[f.pong]:[],message:f?.message?[k.emit,f.message]:[k.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:k.on,on(ve,ae){let oe=ye[ve];return oe.push(ae),()=>{oe.splice(oe.indexOf(ae),1)}},emit(ve,...ae){for(let oe of[...ye[ve]])oe(...ae)}}})();function A(k){let ye=[g.on("error",ve=>{ye.forEach(ae=>ae()),k(ve)}),g.on("closed",ve=>{ye.forEach(ae=>ae()),k(ve)})]}let N,I=0,C,$=!1,P=0,j=!1;async function xe(){clearTimeout(C);let[k,ye]=await(N??(N=new Promise((oe,Bt)=>(async()=>{if($){if(await l(P),!I)return N=void 0,Bt({code:1e3,reason:"All Subscriptions Gone"});P++}g.emit("connecting");let X=new b(typeof e=="function"?await e():e,fp),Vt,_r;function ro(){isFinite(o)&&o>0&&(clearTimeout(_r),_r=setTimeout(()=>{X.readyState===b.OPEN&&(X.send(li({type:Ne.Ping})),g.emit("ping",!1,void 0))},o))}A(We=>{N=void 0,clearTimeout(Vt),clearTimeout(_r),Bt(We),Uo(We)&&We.code===4499&&(X.close(4499,"Terminated"),X.onerror=null,X.onclose=null)}),X.onerror=We=>g.emit("error",We),X.onclose=We=>g.emit("closed",We),X.onopen=async()=>{try{g.emit("opened",X);let We=typeof t=="function"?await t():t;if(X.readyState!==b.OPEN)return;X.send(li(We?{type:Ne.ConnectionInit,payload:We}:{type:Ne.ConnectionInit},v)),isFinite(c)&&c>0&&(Vt=setTimeout(()=>{X.close(lt.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},c)),ro()}catch(We){g.emit("error",We),X.close(lt.InternalClientError,su(We instanceof Error?We.message:new Error(We).message,"Internal client error"))}};let Hn=!1;X.onmessage=({data:We})=>{try{let Ge=dp(We,_);if(g.emit("message",Ge),Ge.type==="ping"||Ge.type==="pong"){g.emit(Ge.type,!0,Ge.payload),Ge.type==="pong"?ro():s||(X.send(li(Ge.payload?{type:Ne.Pong,payload:Ge.payload}:{type:Ne.Pong})),g.emit("pong",!1,Ge.payload));return}if(Hn)return;if(Ge.type!==Ne.ConnectionAck)throw new Error(`First message cannot be of type ${Ge.type}`);clearTimeout(Vt),Hn=!0,g.emit("connected",X,Ge.payload),$=!1,P=0,oe([X,new Promise((Sw,zh)=>A(zh))])}catch(Ge){X.onmessage=null,g.emit("error",Ge),X.close(lt.BadResponse,su(Ge instanceof Error?Ge.message:new Error(Ge).message,"Bad response"))}}})())));k.readyState===b.CLOSING&&await ye;let ve=()=>{},ae=new Promise(oe=>ve=oe);return[k,ve,Promise.race([ae.then(()=>{if(!I){let oe=()=>k.close(1e3,"Normal Closure");isFinite(a)&&a>0?C=setTimeout(()=>{k.readyState===b.OPEN&&oe()},a):oe()}}),ye])]}function Te(k){if(Uo(k)&&($g(k.code)||[lt.InternalServerError,lt.InternalClientError,lt.BadRequest,lt.BadResponse,lt.Unauthorized,lt.SubprotocolNotAcceptable,lt.SubscriberAlreadyExists,lt.TooManyInitialisationRequests].includes(k.code)))throw k;if(j)return!1;if(Uo(k)&&k.code===1e3)return I>0;if(!u||P>=u||!p(k)||d?.(k))throw k;return $=!0}return n||(async()=>{for(I++;;)try{let[,,k]=await xe();await k}catch(k){try{if(!Te(k))return}catch(ye){return i?.(ye)}}})(),{on:g.on,subscribe(k,ye){let ve=m(k),ae=!1,oe=!1,Bt=()=>{I--,ae=!0};return(async()=>{for(I++;;)try{let[X,Vt,_r]=await xe();if(ae)return Vt();let ro=g.onMessage(ve,Hn=>{switch(Hn.type){case Ne.Next:{ye.next(Hn.payload);return}case Ne.Error:{oe=!0,ae=!0,ye.error(Hn.payload),Bt();return}case Ne.Complete:{ae=!0,Bt();return}}});X.send(li({id:ve,type:Ne.Subscribe,payload:k},v)),Bt=()=>{!ae&&X.readyState===b.OPEN&&X.send(li({id:ve,type:Ne.Complete},v)),I--,ae=!0,Vt()},await _r.finally(ro);return}catch(X){if(!Te(X))return}})().then(()=>{oe||ye.complete()}).catch(X=>{ye.error(X)}),()=>{ae||Bt()}},async dispose(){if(j=!0,N){let[k]=await N;k.close(1e3,"Normal Closure")}},terminate(){N&&g.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Uo(r){return pr(r)&&"code"in r&&"reason"in r}function $g(r){return[1e3,1001,1006,1005,1012,1013,1013].includes(r)?!1:r>=1e3&&r<=1999}function Fg(r){return typeof r=="function"&&"constructor"in r&&"CLOSED"in r&&"CLOSING"in r&&"CONNECTING"in r&&"OPEN"in r}function Mg(r){return se(r)&&"code"in r&&"reason"in r}var hp=function(r){Oe(e,r);function e(t){var n=r.call(this)||this;return n.client=t,n}return e.prototype.request=function(t){var n=this;return new ee(function(i){return n.client.subscribe(x(x({},t),{query:Kn(t.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):Mg(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new fr({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(At);var qo="0.12.0";function mp(){return typeof window!="undefined"&&window.self!==window.top}function uu(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(r){return!1}return!0}function dr(r,e){uu()&&localStorage.setItem(`${qo}/${r}`,e)}function Bo(r){return uu()?localStorage.getItem(`${qo}/${r}`):null}function aa(r){uu()&&localStorage.removeItem(`${qo}/${r}`)}function gp(r,e=1e4){return _e(this,null,function*(){return Promise.race([new Promise((t,n)=>{let i;try{i=new WebSocket(r,"graphql-transport-ws"),i.onopen=()=>{i.close(),t(i)},i.onerror=a=>{n(a)},i.onclose=a=>{a.code!==1e3&&n(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){i&&i.close(),n(a)}}),new Promise((t,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}var bs=function(){return bs=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},bs.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function ns(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ns=function(t){return typeof t}:ns=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ns(r)}function Ug(r){return ns(r)=="object"&&r!==null}var jd=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Ou(r,e){for(var t=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=t.exec(r.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function qg(r){return Ud(r.source,Ou(r.source,r.start))}function Ud(r,e){var t=r.locationOffset.column-1,n=is(t)+r.body,i=e.line-1,a=r.locationOffset.line-1,o=e.line+a,s=e.line===1?t:0,c=e.column+s,u="".concat(r.name,":").concat(o,":").concat(c,`
52
52
  `),l=n.split(/\r\n|[\n\r]/g),p=l[i];if(p.length>120){for(var d=Math.floor(c/80),f=c%80,h=[],m=0;m<p.length;m+=80)h.push(p.slice(m,m+80));return u+yp([["".concat(o),h[0]]].concat(h.slice(1,d+1).map(function(v){return["",v]}),[[" ",is(f-1)+"^"],["",h[d+1]]]))}return u+yp([["".concat(o-1),l[i-1]],["".concat(o),p],["",is(c-1)+"^"],["".concat(o+1),l[i+1]]])}function yp(r){var e=r.filter(function(n){n[0];var i=n[1];return i!==void 0}),t=Math.max.apply(Math,e.map(function(n){var i=n[0];return i.length}));return e.map(function(n){var i=n[0],a=n[1];return Bg(t,i)+(a?" | "+a:" |")}).join(`
53
53
  `)}function is(r){return Array(r+1).join(" ")}function Bg(r,e){return is(r-e.length)+e}function as(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?as=function(t){return typeof t}:as=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},as(r)}function vp(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Vg(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vp(Object(t),!0).forEach(function(n){Qg(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):vp(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Qg(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function zg(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function bp(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Wg(r,e,t){return e&&bp(r.prototype,e),t&&bp(r,t),r}function Gg(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&La(r,e)}function Hg(r){var e=Bd();return function(){var n=$a(r),i;if(e){var a=$a(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return qd(this,i)}}function qd(r,e){return e&&(as(e)==="object"||typeof e=="function")?e:la(r)}function la(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Du(r){var e=typeof Map=="function"?new Map:void 0;return Du=function(n){if(n===null||!Kg(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return os(n,arguments,$a(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),La(i,n)},Du(r)}function os(r,e,t){return Bd()?os=Reflect.construct:os=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&La(u,o.prototype),u},os.apply(null,arguments)}function Bd(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Kg(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function La(r,e){return La=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},La(r,e)}function $a(r){return $a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},$a(r)}var Jg=function(r){Gg(t,r);var e=Hg(t);function t(n,i,a,o,s,c,u){var l,p,d,f;zg(this,t),f=e.call(this,n),f.name="GraphQLError",f.originalError=c??void 0,f.nodes=Sp(Array.isArray(i)?i:i?[i]:void 0);for(var h=[],m=0,v=(_=f.nodes)!==null&&_!==void 0?_:[];m<v.length;m++){var _,y=v[m],b=y.loc;b!=null&&h.push(b)}h=Sp(h),f.source=a??((l=h)===null||l===void 0?void 0:l[0].source),f.positions=o??((p=h)===null||p===void 0?void 0:p.map(function(A){return A.start})),f.locations=o&&a?o.map(function(A){return Ou(a,A)}):(d=h)===null||d===void 0?void 0:d.map(function(A){return Ou(A.source,A.start)}),f.path=s??void 0;var g=c?.extensions;return u==null&&Ug(g)?f.extensions=Vg({},g):f.extensions=u??{},Object.defineProperties(la(f),{message:{enumerable:!0},locations:{enumerable:f.locations!=null},path:{enumerable:f.path!=null},extensions:{enumerable:f.extensions!=null&&Object.keys(f.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),c!=null&&c.stack?(Object.defineProperty(la(f),"stack",{value:c.stack,writable:!0,configurable:!0}),qd(f)):(Error.captureStackTrace?Error.captureStackTrace(la(f),t):Object.defineProperty(la(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return Wg(t,[{key:"toString",value:function(){return Zg(this)}},{key:jd,get:function(){return"Object"}}]),t}(Du(Error));function Sp(r){return r===void 0||r.length===0?void 0:r}function Zg(r){var e=r.message;if(r.nodes)for(var t=0,n=r.nodes;t<n.length;t++){var i=n[t];i.loc&&(e+=`
54
54
 
package/dist/index.js CHANGED
@@ -48,7 +48,7 @@ For more information about these options, please refer to the documentation:
48
48
  `)})}return r.networkError&&(e+="".concat(r.networkError.message,`
49
49
  `)),e=e.replace(/\n$/,""),e},Ar=function(r){De(e,r);function e(t){var n=t.graphQLErrors,i=t.clientErrors,a=t.networkError,o=t.errorMessage,s=t.extraInfo,c=r.call(this,o)||this;return c.name="ApolloError",c.graphQLErrors=n||[],c.clientErrors=i||[],c.networkError=a||null,c.message=o||lv(c),c.extraInfo=s,c.__proto__=e.prototype,c}return e}(Error);var me;(function(r){r[r.loading=1]="loading",r[r.setVariables=2]="setVariables",r[r.fetchMore=3]="fetchMore",r[r.refetch=4]="refetch",r[r.poll=6]="poll",r[r.ready=7]="ready",r[r.error=8]="error"})(me||(me={}));function Wr(r){return r?r<7:!1}var pv=Object.assign,dv=Object.hasOwnProperty,Ss=function(r){De(e,r);function e(t){var n=t.queryManager,i=t.queryInfo,a=t.options,o=r.call(this,function(v){try{var _=v._subscription._observer;_&&!_.error&&(_.error=fv)}catch{}var y=!o.observers.size;o.observers.add(v);var b=o.last;return b&&b.error?v.error&&v.error(b.error):b&&b.result&&v.next&&v.next(b.result),y&&o.reobserve().catch(function(){}),function(){o.observers.delete(v)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.isTornDown=!1;var s=n.defaultOptions.watchQuery,c=s===void 0?{}:s,u=c.fetchPolicy,l=u===void 0?"cache-first":u,d=a.fetchPolicy,f=d===void 0?l:d,p=a.initialFetchPolicy,h=p===void 0?f==="standby"?l:f:p;o.options=x(x({},a),{initialFetchPolicy:h,fetchPolicy:f}),o.queryId=i.queryId||n.generateQueryId();var m=or(o.query);return o.queryName=m&&m.name&&m.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var t=this;return new Promise(function(n,i){var a={next:function(s){n(s),t.observers.delete(a),t.observers.size||t.queryManager.removeQuery(t.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=t.subscribe(a)})},e.prototype.getCurrentResult=function(t){t===void 0&&(t=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||me.ready,a=x(x({},n),{loading:Wr(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var c=this.queryInfo.getDiff();(c.complete||this.options.returnPartialData)&&(a.data=c.result),ke(a.data,{})&&(a.data=void 0),c.complete?(delete a.partial,c.complete&&a.networkStatus===me.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=me.ready,a.loading=!1)):a.partial=!0,__DEV__&&!c.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&Yu(c.missing)}return t&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(t,n){return!this.last||!ke(this.last.result,t)||n&&!ke(this.last.variables,n)},e.prototype.getLast=function(t,n){var i=this.last;if(i&&i[t]&&(!n||ke(i.variables,this.variables)))return i[t]},e.prototype.getLastResult=function(t){return this.getLast("result",t)},e.prototype.getLastError=function(t){return this.getLast("error",t)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(t){var n,i={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?i.fetchPolicy=a:a==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",__DEV__&&t&&dv.call(t,"variables")){var o=xa(this.query),s=o.variableDefinitions;(!s||!s.some(function(c){return c.variable.name.value==="variables"}))&&__DEV__&&P.warn("Called refetch(".concat(JSON.stringify(t),") for query ").concat(((n=o.name)===null||n===void 0?void 0:n.value)||JSON.stringify(o),`, which does not declare a $variables variable.
50
50
  Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return t&&!ke(this.options.variables,t)&&(i.variables=this.options.variables=x(x({},this.options.variables),t)),this.queryInfo.resetLastWrite(),this.reobserve(i,me.refetch)},e.prototype.fetchMore=function(t){var n=this,i=x(x({},t.query?t:x(x(x(x({},this.options),{query:this.query}),t),{variables:x(x({},this.options.variables),t.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=me.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set;return this.queryManager.fetchQuery(a,i,me.fetchMore).then(function(u){return n.queryManager.removeQuery(a),o.networkStatus===me.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var d=t.updateQuery;d?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(f){return d(f,{fetchMoreResult:u.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:u.data})},onWatchUpdated:function(l){c.add(l.query)}}),u}).finally(function(){c.has(n.query)||Zu(n)})},e.prototype.subscribeToMore=function(t){var n=this,i=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:function(a){var o=t.updateQuery;o&&n.updateQuery(function(s,c){var u=c.variables;return o(s,{subscriptionData:a,variables:u})})},error:function(a){if(t.onError){t.onError(a);return}__DEV__&&P.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(t){return this.reobserve(t)},e.prototype.setVariables=function(t){return ke(this.variables,t)?this.observers.size?this.result():Promise.resolve():(this.options.variables=t,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:t},me.setVariables):Promise.resolve())},e.prototype.updateQuery=function(t){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=t(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(t){this.options.pollInterval=t,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(t,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:t,options:n,observable:this,initialFetchPolicy:s}):t==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(t,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,t,n)},e.prototype.updatePolling=function(){var t=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){__DEV__?P(a,"Attempted to start a polling query without a polling interval."):P(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){t.pollingInfo&&(Wr(t.queryInfo.networkStatus)?c():t.reobserve({fetchPolicy:t.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},me.poll).then(c,c))},c=function(){var u=t.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(s,u.interval))};c()}}},e.prototype.updateLastResult=function(t,n){return n===void 0&&(n=this.variables),this.last=x(x({},this.last),{result:this.queryManager.assumeImmutableResults?t:Xo(t),variables:n}),qe(t.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(t,n){var i=this;this.isTornDown=!1;var a=n===me.refetch||n===me.fetchMore||n===me.poll,o=this.options.variables,s=this.options.fetchPolicy,c=Vr(this.options,t||{}),u=a?c:pv(this.options,c);a||(this.updatePolling(),t&&t.variables&&!ke(t.variables,o)&&u.fetchPolicy!=="standby"&&u.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",u),n===void 0&&(n=me.setVariables)));var l=u.variables&&x({},u.variables),d=this.fetch(u,n),f={next:function(p){i.reportResult(p,l)},error:function(p){i.reportError(p,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=f),d.addObserver(f),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(t,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(t,n))&&((i||!t.partial||this.options.returnPartialData)&&this.updateLastResult(t,n),In(this.observers,"next",t))},e.prototype.reportError=function(t,n){var i=x(x({},this.getLastResult()),{error:t,errors:t.graphQLErrors,networkStatus:me.error,loading:!1});this.updateLastResult(i,n),In(this.observers,"error",this.last.error=t)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(t){return t.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(ne);ts(Ss);function Zu(r){var e=r.options,t=e.fetchPolicy,n=e.nextFetchPolicy;return t==="cache-and-network"||t==="network-only"?r.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):t}}):r.reobserve()}function fv(r){__DEV__&&P.error("Unhandled error",r.message,r.stack)}function Yu(r){__DEV__&&r&&__DEV__&&P.debug("Missing cache result fields: ".concat(JSON.stringify(r)),r)}var _s=function(){function r(e){var t=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return r.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){t.resolvers=pu(t.resolvers,n)}):this.resolvers=pu(this.resolvers,e)},r.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},r.prototype.getResolvers=function(){return this.resolvers||{}},r.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return Wt(this,void 0,void 0,function(){return Gt(this,function(c){return t?[2,this.resolveDocument(t,n.data,i,a,this.fragmentMatcher,s).then(function(u){return x(x({},n),{data:u.result})})]:[2,n]})})},r.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},r.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},r.prototype.clientQuery=function(e){return Si(["client"],e)&&this.resolvers?e:null},r.prototype.serverQuery=function(e){return lu(e)},r.prototype.prepareContext=function(e){var t=this.cache;return x(x({},e),{cache:t,getCacheKey:function(n){return t.identify(n)}})},r.prototype.addExportedVariables=function(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),Wt(this,void 0,void 0,function(){return Gt(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(a){return x(x({},t),a.exportedVariables)})]:[2,x({},t)]})})},r.prototype.shouldForceResolvers=function(e){var t=!1;return it(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(t=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),t))return wn}}}),t},r.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:uu(e),variables:t,returnPartialData:!0,optimistic:!1}).result},r.prototype.resolveDocument=function(e,t,n,i,a,o){return n===void 0&&(n={}),i===void 0&&(i={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),Wt(this,void 0,void 0,function(){var s,c,u,l,d,f,p,h,m,v,_;return Gt(this,function(y){return s=xn(e),c=En(e),u=Sn(c),l=this.collectSelectionsToResolve(s,u),d=s.operation,f=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",p=this,h=p.cache,m=p.client,v={fragmentMap:u,context:x(x({},n),{cache:h,client:m}),variables:i,fragmentMatcher:a,defaultOperationType:f,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},_=!1,[2,this.resolveSelectionSet(s.selectionSet,_,t,v).then(function(b){return{result:b,exportedVariables:v.exportedVariables}})]})})},r.prototype.resolveSelectionSet=function(e,t,n,i){return Wt(this,void 0,void 0,function(){var a,o,s,c,u,l=this;return Gt(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,c=[n],u=function(f){return Wt(l,void 0,void 0,function(){var p,h;return Gt(this,function(m){return!t&&!i.selectionsToResolve.has(f)?[2]:xr(f,s)?It(f)?[2,this.resolveField(f,t,n,i).then(function(v){var _;typeof v<"u"&&c.push((_={},_[Mt(f)]=v,_))})]:(au(f)?p=f:(p=a[f.name.value],__DEV__?P(p,"No fragment named ".concat(f.name.value)):P(p,11)),p&&p.typeCondition&&(h=p.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(p.selectionSet,t,n,i).then(function(v){c.push(v)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return ka(c)})]})})},r.prototype.resolveField=function(e,t,n,i){return Wt(this,void 0,void 0,function(){var a,o,s,c,u,l,d,f,p,h=this;return Gt(this,function(m){return n?(a=i.variables,o=e.name.value,s=Mt(e),c=o!==s,u=n[s]||n[o],l=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(p=f[c?o:s],p&&(l=Promise.resolve($i.withValue(this.cache,p,[n,kr(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(v){var _,y;if(v===void 0&&(v=u),e.directives&&e.directives.forEach(function(g){g.name.value==="export"&&g.arguments&&g.arguments.forEach(function(T){T.name.value==="as"&&T.value.kind==="StringValue"&&(i.exportedVariables[T.value.value]=v)})}),!e.selectionSet||v==null)return v;var b=(y=(_=e.directives)===null||_===void 0?void 0:_.some(function(g){return g.name.value==="client"}))!==null&&y!==void 0?y:!1;if(Array.isArray(v))return h.resolveSubSelectedArray(e,t||b,v,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,t||b,v,i)})]):[2,null]})})},r.prototype.resolveSubSelectedArray=function(e,t,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,t,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,t,o,i)}))},r.prototype.collectSelectionsToResolve=function(e,t){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),it(o,{Directive:function(c,u,l,d,f){c.name.value==="client"&&f.forEach(function(p){n(p)&&wa(p)&&s.add(p)})},FragmentSpread:function(c,u,l,d,f){var p=t[c.name.value];__DEV__?P(p,"No fragment named ".concat(c.name.value)):P(p,12);var h=a(p);h.size>0&&(f.forEach(function(m){n(m)&&wa(m)&&s.add(m)}),s.add(c),h.forEach(function(m){s.add(m)}))}})}return i.get(o)}return a(e)},r}();var Ri=new(Ut?WeakMap:Map);function Xu(r,e){var t=r[e];typeof t=="function"&&(r[e]=function(){return Ri.set(r,(Ri.get(r)+1)%1e15),t.apply(this,arguments)})}function vf(r){r.notifyTimeout&&(clearTimeout(r.notifyTimeout),r.notifyTimeout=void 0)}var Es=function(){function r(e,t){t===void 0&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;Ri.has(n)||(Ri.set(n,0),Xu(n,"evict"),Xu(n,"modify"),Xu(n,"reset"))}return r.prototype.init=function(e){var t=e.networkStatus||me.loading;return this.variables&&this.networkStatus!==me.loading&&!ke(this.variables,e.variables)&&(t=me.setVariables),ke(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},r.prototype.reset=function(){vf(this),this.dirty=!1},r.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&ke(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=this.cache.diff(t);return this.updateLastDiff(i,t),i},r.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},r.prototype.getDiffOptions=function(e){var t;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(t=this.observableQuery)===null||t===void 0?void 0:t.options.canonizeResults}},r.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!ke(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},r.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=t.getDiff();n.fromOptimisticTransaction?e.observe():Zu(e)})):delete this.oqListener)},r.prototype.notify=function(){var e=this;vf(this),this.shouldNotify()&&this.listeners.forEach(function(t){return t(e)}),this.dirty=!1},r.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Wr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},r.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=r.prototype.cancel,this.subscriptions.forEach(function(t){return t.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},r.prototype.cancel=function(){},r.prototype.updateWatch=function(e){var t=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=x(x({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return t.setDiff(a)}});(!this.lastWatch||!ke(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},r.prototype.resetLastWrite=function(){this.lastWrite=void 0},r.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===Ri.get(this.cache)&&ke(t,n.variables)&&ke(e.data,n.result.data))},r.prototype.markResult=function(e,t,n,i){var a=this,o=new vt,s=qe(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&qe(e.incremental)){var c=rs(this.getDiff().result,e);e.data=c}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(xs(e,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,n.variables))l.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:Ri.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),f=l.diff(d);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(f,d),f.complete&&(e.data=f.result)}):this.lastWrite=void 0)},r.prototype.markReady=function(){return this.networkError=null,this.networkStatus=me.ready},r.prototype.markError=function(e){return this.networkStatus=me.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},r}();function xs(r,e){e===void 0&&(e="none");var t=e==="ignore"||e==="all",n=!Ii(r);return!n&&t&&r.data&&(n=!0),n}var hv=Object.prototype.hasOwnProperty,bf=function(){function r(e){var t=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,c=e.ssrMode,u=c===void 0?!1:c,l=e.clientAwareness,d=l===void 0?{}:l,f=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Ut?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=d,this.localState=f||new _s({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!p,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return r.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new Y("QueryManager stopped while query was in flight"):new Y(14))},r.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},r.prototype.mutate=function(e){var t,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,c=e.refetchQueries,u=c===void 0?[]:c,l=e.awaitRefetchQueries,d=l===void 0?!1:l,f=e.update,p=e.onQueryUpdated,h=e.fetchPolicy,m=h===void 0?((t=this.defaultOptions.mutate)===null||t===void 0?void 0:t.fetchPolicy)||"network-only":h,v=e.errorPolicy,_=v===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":v,y=e.keepRootFields,b=e.context;return Wt(this,void 0,void 0,function(){var g,T,N,A,D,L;return Gt(this,function(R){switch(R.label){case 0:return __DEV__?P(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):P(i,15),__DEV__?P(m==="network-only"||m==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):P(m==="network-only"||m==="no-cache",16),g=this.generateMutationId(),T=this.transform(i),N=T.document,A=T.hasClientExports,i=this.cache.transformForLink(N),a=this.getVariables(i,a),A?[4,this.localState.addExportedVariables(i,a,b)]:[3,2];case 1:a=R.sent(),R.label=2;case 2:return D=this.mutationStore&&(this.mutationStore[g]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:g,document:i,variables:a,fetchPolicy:m,errorPolicy:_,context:b,updateQueries:s,update:f,keepRootFields:y}),this.broadcastQueries(),L=this,[2,new Promise(function(j,Ae){return es(L.getObservableFromLink(i,x(x({},b),{optimisticResponse:o}),a,!1),function(Ce){if(Ii(Ce)&&_==="none")throw new Ar({graphQLErrors:ns(Ce)});D&&(D.loading=!1,D.error=null);var k=x({},Ce);return typeof u=="function"&&(u=u(k)),_==="ignore"&&Ii(k)&&delete k.errors,L.markMutationResult({mutationId:g,result:k,document:i,variables:a,fetchPolicy:m,errorPolicy:_,context:b,update:f,updateQueries:s,awaitRefetchQueries:d,refetchQueries:u,removeOptimistic:o?g:void 0,onQueryUpdated:p,keepRootFields:y})}).subscribe({next:function(Ce){L.broadcastQueries(),(!("hasNext"in Ce)||Ce.hasNext===!1)&&j(Ce)},error:function(Ce){D&&(D.loading=!1,D.error=Ce),o&&L.cache.removeOptimistic(g),L.broadcastQueries(),Ae(Ce instanceof Ar?Ce:new Ar({networkError:Ce}))}})})]}})})},r.prototype.markMutationResult=function(e,t){var n=this;t===void 0&&(t=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&xs(i,e.errorPolicy)){if(Br(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Br(i)&&qe(i.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),c=void 0;s.result&&(c=rs(s.result,i)),typeof c<"u"&&(i.data=c,a.push({result:c,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(d,f){var p=d.observableQuery,h=p&&p.queryName;if(!(!h||!hv.call(u,h))){var m=u[h],v=n.queries.get(f),_=v.document,y=v.variables,b=t.diff({query:_,variables:y,returnPartialData:!0,optimistic:!1}),g=b.result,T=b.complete;if(T&&g){var N=m(g,{mutationResult:i,queryName:_&&Ei(_)||void 0,queryVariables:y});N&&a.push({result:N,dataId:"ROOT_QUERY",query:_,variables:y})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(m){return d.write(m)});var f=e.update,p=!td(i)||Br(i)&&!i.hasNext;if(f){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=x(x({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}p&&f(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&p&&d.modify({id:"ROOT_MUTATION",fields:function(m,v){var _=v.fieldName,y=v.DELETE;return _==="__typename"?m:y}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},r.prototype.markMutationOptimistic=function(e,t){var n=this,i=typeof e=="function"?e(t.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(x(x({},t),{result:{data:i}}),a)}catch(o){__DEV__&&P.error(o)}},t.mutationId)},r.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},r.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},r.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},r.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.cache.transformDocument(e),i=cu(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:tu(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:kn(or(n)),asQuery:x(x({},n),{definitions:n.definitions.map(function(u){return u.kind==="OperationDefinition"&&u.operation!=="query"?x(x({},u),{operation:"query"}):u})})},c=function(u){u&&!t.has(u)&&t.set(u,s)};c(e),c(n),c(a),c(o)}return t.get(e)},r.prototype.getVariables=function(e,t){return x(x({},this.transform(e).defaultVars),t)},r.prototype.watchQuery=function(e){e=x(x({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var t=new Es(this),n=new Ss({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:n.query,observableQuery:n,variables:n.variables}),n},r.prototype.query=function(e,t){var n=this;return t===void 0&&(t=this.generateQueryId()),__DEV__?P(e.query,"query option is required. You must specify your GraphQL document in the query option."):P(e.query,17),__DEV__?P(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):P(e.query.kind==="Document",18),__DEV__?P(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):P(!e.returnPartialData,19),__DEV__?P(!e.pollInterval,"pollInterval option only supported on watchQuery."):P(!e.pollInterval,20),this.fetchQuery(t,e).finally(function(){return n.stopQuery(t)})},r.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},r.prototype.generateRequestId=function(){return this.requestIdCounter++},r.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},r.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},r.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new Y("Store reset while query was in flight (not completed in link chain)"):new Y(21)),this.queries.forEach(function(t){t.observableQuery?t.networkStatus=me.loading:t.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},r.prototype.getObservableQueries=function(e){var t=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):nu(o)?i.set(t.transform(o).document,!1):le(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var c=o.observableQuery,u=o.document;if(c){if(e==="all"){n.set(s,c);return}var l=c.queryName,d=c.options.fetchPolicy;if(d==="standby"||e==="active"&&!c.hasObservers())return;(e==="active"||l&&i.has(l)||u&&i.has(u))&&(n.set(s,c),l&&i.set(l,!0),u&&i.set(u,!0))}}),a.size&&a.forEach(function(o){var s=Ta("legacyOneTimeQuery"),c=t.getQuery(s).init({document:o.query,variables:o.variables}),u=new Ss({queryManager:t,queryInfo:c,options:x(x({},o),{fetchPolicy:"network-only"})});P(u.queryId===s),c.setObservableQuery(u),n.set(s,u)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&P.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},r.prototype.reFetchObservableQueries=function(e){var t=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),t.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},r.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},r.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,c=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var u=function(d){return t.getObservableFromLink(n,c,d).map(function(f){if(i!=="no-cache"&&(xs(f,a)&&t.cache.write({query:n,result:f.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),t.broadcastQueries()),Ii(f))throw new Ar({graphQLErrors:f.errors});return f})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,c).then(u);return new ne(function(d){var f=null;return l.then(function(p){return f=p.subscribe(d)},d.error),function(){return f&&f.unsubscribe()}})}return u(o)},r.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},r.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},r.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},r.prototype.getLocalState=function(){return this.localState},r.prototype.getObservableFromLink=function(e,t,n,i){var a=this,o;i===void 0&&(i=(o=t?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,c=this.transform(e).serverQuery;if(c){var u=this,l=u.inFlightLinkObservables,d=u.link,f={query:c,variables:n,operationName:Ei(c)||void 0,context:this.prepareContext(x(x({},t),{forceFetch:!i}))};if(t=f.context,i){var p=l.get(c)||new Map;l.set(c,p);var h=Tt(n);if(s=p.get(h),!s){var m=new Ai([Ti(d,f)]);p.set(h,s=m),m.beforeNext(function(){p.delete(h)&&p.size<1&&l.delete(c)})}}else s=new Ai([Ti(d,f)])}else s=new Ai([ne.of({data:{}})]),t=this.prepareContext(t);var v=this.transform(e).clientQuery;return v&&(s=es(s,function(_){return a.localState.runResolvers({document:v,remoteResult:_,context:t,variables:n})})),s},r.prototype.getResultsFromLink=function(e,t,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return es(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=ns(o),c=s.length>0;if(i>=e.lastRequestId){if(c&&n.errorPolicy==="none")throw e.markError(new Ar({graphQLErrors:s}));e.markResult(o,a,n,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:me.ready};return c&&n.errorPolicy!=="ignore"&&(u.errors=s,u.networkStatus=me.error),u},function(o){var s=yf(o)?o:new Ar({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},r.prototype.fetchQueryObservable=function(e,t,n){var i=this;n===void 0&&(n=me.loading);var a=this.transform(t.query).document,o=this.getVariables(a,t.variables),s=this.getQuery(e),c=this.defaultOptions.watchQuery,u=t.fetchPolicy,l=u===void 0?c&&c.fetchPolicy||"cache-first":u,d=t.errorPolicy,f=d===void 0?c&&c.errorPolicy||"none":d,p=t.returnPartialData,h=p===void 0?!1:p,m=t.notifyOnNetworkStatusChange,v=m===void 0?!1:m,_=t.context,y=_===void 0?{}:_,b=Object.assign({},t,{query:a,variables:o,fetchPolicy:l,errorPolicy:f,returnPartialData:h,notifyOnNetworkStatusChange:v,context:y}),g=function(A){b.variables=A;var D=i.fetchQueryByPolicy(s,b,n);return b.fetchPolicy!=="standby"&&D.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",t),D},T=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(A){T(),setTimeout(function(){return N.cancel(A)})});var N=new Ai(this.transform(b.query).hasClientExports?this.localState.addExportedVariables(b.query,b.variables,b.context).then(g):g(b.variables));return N.promise.then(T,T),N},r.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,c=s===void 0?o?Ta("refetchQueries"):void 0:s,u=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(f,p){l.set(p,{oq:f,lastDiff:t.getQuery(p).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&c||!1,removeOptimistic:c,onWatchUpdated:function(f,p,h){var m=f.watcher instanceof Es&&f.watcher.observableQuery;if(m){if(u){l.delete(m.queryId);var v=u(m,p,h);return v===!0&&(v=m.refetch()),v!==!1&&d.set(m,v),v}u!==null&&l.set(m.queryId,{oq:m,lastDiff:h,diff:p})}}}),l.size&&l.forEach(function(f,p){var h=f.oq,m=f.lastDiff,v=f.diff,_;if(u){if(!v){var y=h.queryInfo;y.reset(),v=y.getDiff()}_=u(h,v,m)}(!u||_===!0)&&(_=h.refetch()),_!==!1&&d.set(h,_),p.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(p)}),c&&this.cache.removeOptimistic(c),d},r.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,a=t.query,o=t.variables,s=t.fetchPolicy,c=t.refetchWritePolicy,u=t.errorPolicy,l=t.returnPartialData,d=t.context,f=t.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return e.getDiff(o)},m=function(g,T){T===void 0&&(T=e.networkStatus||me.loading);var N=g.result;__DEV__&&!l&&!ke(N,{})&&Yu(g.missing);var A=function(D){return ne.of(x({data:D,loading:Wr(T),networkStatus:T},g.complete?null:{partial:!0}))};return N&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:N},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(D){return A(D.data||void 0)}):u==="none"&&T===me.refetch&&Array.isArray(g.missing)?A(void 0):A(N)},v=s==="no-cache"?0:n===me.refetch&&c!=="merge"?1:2,_=function(){return i.getResultsFromLink(e,v,{variables:o,context:d,fetchPolicy:s,errorPolicy:u})},y=f&&typeof p=="number"&&p!==n&&Wr(n);switch(s){default:case"cache-first":{var b=h();return b.complete?[m(b,e.markReady())]:l||y?[m(b),_()]:[_()]}case"cache-and-network":{var b=h();return b.complete||l||y?[m(b),_()]:[_()]}case"cache-only":return[m(h(),e.markReady())];case"network-only":return y?[m(h()),_()]:[_()];case"no-cache":return y?[m(e.getDiff()),_()]:[_()];case"standby":return[]}},r.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Es(this,e)),this.queries.get(e)},r.prototype.prepareContext=function(e){e===void 0&&(e={});var t=this.localState.prepareContext(e);return x(x({},t),{clientAwareness:this.clientAwareness})},r}();var wf=!1;var el=function(){function r(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,c=s===void 0?!1:s,u=e.ssrForceFetchDelay,l=u===void 0?0:u,d=e.connectToDevTools,f=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,p=e.queryDeduplication,h=p===void 0?!0:p,m=e.defaultOptions,v=e.assumeImmutableResults,_=v===void 0?!1:v,y=e.resolvers,b=e.typeDefs,g=e.fragmentMatcher,T=e.name,N=e.version,A=e.link;if(A||(A=n?new Tu({uri:n,credentials:i,headers:a}):jt.empty()),!o)throw __DEV__?new Y(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
51
- For more information, please visit: https://go.apollo.dev/c/docs`):new Y(9);if(this.link=A,this.cache=o,this.disableNetworkFetches=c||l>0,this.queryDeduplication=h,this.defaultOptions=m||Object.create(null),this.typeDefs=b,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),f&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!wf&&f&&__DEV__&&(wf=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var D=window.navigator,L=D&&D.userAgent,R=void 0;typeof L=="string"&&(L.indexOf("Chrome/")>-1?R="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":L.indexOf("Firefox/")>-1&&(R="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),R&&__DEV__&&P.log("Download the Apollo DevTools for a better development experience: "+R)}this.version=ad,this.localState=new _s({cache:o,client:this,resolvers:y,fragmentMatcher:g}),this.queryManager=new bf({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:c,clientAwareness:{name:T,version:N},localState:this.localState,assumeImmutableResults:_,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return r.prototype.stop=function(){this.queryManager.stop()},r.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Oa(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=x(x({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},r.prototype.query=function(e){return this.defaultOptions.query&&(e=Oa(this.defaultOptions.query,e)),__DEV__?P(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):P(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=x(x({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},r.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Oa(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},r.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!1),this.cache.readQuery(e,t)},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!1),this.cache.readFragment(e,t)},r.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},r.prototype.__requestRaw=function(e){return Ti(this.link,e)},r.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(t){return t()}))}).then(function(){return e.reFetchObservableQueries()})},r.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(t){return t()}))})},r.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},r.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],i=[];t.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&P.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},r.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},r.prototype.extract=function(e){return this.cache.extract(e)},r.prototype.restore=function(e){return this.cache.restore(e)},r.prototype.addResolvers=function(e){this.localState.addResolvers(e)},r.prototype.setResolvers=function(e){this.localState.setResolvers(e)},r.prototype.getResolvers=function(){return this.localState.getResolvers()},r.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},r.prototype.setLink=function(e){this.link=this.queryManager.link=e},r}();Np(bn?"log":"silent");function ut(r){return r===null?"null":Array.isArray(r)?"array":typeof r}function Ir(r){return ut(r)==="object"}function Sf(r){return Array.isArray(r)&&r.length>0&&r.every(e=>"message"in e)}function tl(r,e){return r.length<124?r:e}var _f="graphql-transport-ws";var bt;(function(r){r[r.InternalServerError=4500]="InternalServerError",r[r.InternalClientError=4005]="InternalClientError",r[r.BadRequest=4400]="BadRequest",r[r.BadResponse=4004]="BadResponse",r[r.Unauthorized=4401]="Unauthorized",r[r.Forbidden=4403]="Forbidden",r[r.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",r[r.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",r[r.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",r[r.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",r[r.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(bt||(bt={}));var Pe;(function(r){r.ConnectionInit="connection_init",r.ConnectionAck="connection_ack",r.Ping="ping",r.Pong="pong",r.Subscribe="subscribe",r.Next="next",r.Error="error",r.Complete="complete"})(Pe||(Pe={}));function Ef(r){if(!Ir(r))throw new Error(`Message is expected to be an object, but got ${ut(r)}`);if(!r.type)throw new Error("Message is missing the 'type' property");if(typeof r.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${ut(r.type)}`);switch(r.type){case Pe.ConnectionInit:case Pe.ConnectionAck:case Pe.Ping:case Pe.Pong:{if(r.payload!=null&&!Ir(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${r.payload}"`);break}case Pe.Subscribe:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${ut(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Ir(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${ut(r.payload)}`);if(typeof r.payload.query!="string")throw new Error(`"${r.type}" message payload expects the 'query' property to be a string, but got ${ut(r.payload.query)}`);if(r.payload.variables!=null&&!Ir(r.payload.variables))throw new Error(`"${r.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${ut(r.payload.variables)}`);if(r.payload.operationName!=null&&ut(r.payload.operationName)!=="string")throw new Error(`"${r.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${ut(r.payload.operationName)}`);if(r.payload.extensions!=null&&!Ir(r.payload.extensions))throw new Error(`"${r.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${ut(r.payload.extensions)}`);break}case Pe.Next:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${ut(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Ir(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${ut(r.payload)}`);break}case Pe.Error:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${ut(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Sf(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(r.payload)}`);break}case Pe.Complete:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${ut(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${r.type}"`)}return r}function xf(r,e){return Ef(typeof r=="string"?JSON.parse(r,e):r)}function Pi(r,e){return Ef(r),JSON.stringify(r,e)}function rl(r){let{url:e,connectionParams:t,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:c=0,retryAttempts:u=5,retryWait:l=async function(we){let Se=1e3;for(let ce=0;ce<we;ce++)Se*=2;await new Promise(ce=>setTimeout(ce,Se+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=ks,isFatalConnectionProblem:f,on:p,webSocketImpl:h,generateID:m=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,we=>{let Se=Math.random()*16|0;return(we=="x"?Se:Se&3|8).toString(16)})},jsonMessageReplacer:v,jsonMessageReviver:_}=r,y;if(h){if(!gv(h))throw new Error("Invalid WebSocket implementation provided");y=h}else typeof WebSocket<"u"?y=WebSocket:typeof global<"u"?y=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(y=window.WebSocket||window.MozWebSocket);if(!y)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let b=y,g=(()=>{let k=(()=>{let Se={};return{on(ce,ue){return Se[ce]=ue,()=>{delete Se[ce]}},emit(ce){var ue;"id"in ce&&((ue=Se[ce.id])===null||ue===void 0||ue.call(Se,ce))}}})(),we={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[k.emit,p.message]:[k.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:k.on,on(Se,ce){let ue=we[Se];return ue.push(ce),()=>{ue.splice(ue.indexOf(ce),1)}},emit(Se,...ce){for(let ue of[...we[Se]])ue(...ce)}}})();function T(k){let we=[g.on("error",Se=>{we.forEach(ce=>ce()),k(Se)}),g.on("closed",Se=>{we.forEach(ce=>ce()),k(Se)})]}let N,A=0,D,L=!1,R=0,j=!1;async function Ae(){clearTimeout(D);let[k,we]=await(N??(N=new Promise((ue,rr)=>(async()=>{if(L){if(await l(R),!A)return N=void 0,rr({code:1e3,reason:"All Subscriptions Gone"});R++}g.emit("connecting");let re=new b(typeof e=="function"?await e():e,_f),nr,Fr;function Bo(){isFinite(o)&&o>0&&(clearTimeout(Fr),Fr=setTimeout(()=>{re.readyState===b.OPEN&&(re.send(Pi({type:Pe.Ping})),g.emit("ping",!1,void 0))},o))}T(Ze=>{N=void 0,clearTimeout(nr),clearTimeout(Fr),rr(Ze),ks(Ze)&&Ze.code===4499&&(re.close(4499,"Terminated"),re.onerror=null,re.onclose=null)}),re.onerror=Ze=>g.emit("error",Ze),re.onclose=Ze=>g.emit("closed",Ze),re.onopen=async()=>{try{g.emit("opened",re);let Ze=typeof t=="function"?await t():t;if(re.readyState!==b.OPEN)return;re.send(Pi(Ze?{type:Pe.ConnectionInit,payload:Ze}:{type:Pe.ConnectionInit},v)),isFinite(c)&&c>0&&(nr=setTimeout(()=>{re.close(bt.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},c)),Bo()}catch(Ze){g.emit("error",Ze),re.close(bt.InternalClientError,tl(Ze instanceof Error?Ze.message:new Error(Ze).message,"Internal client error"))}};let bi=!1;re.onmessage=({data:Ze})=>{try{let Ye=xf(Ze,_);if(g.emit("message",Ye),Ye.type==="ping"||Ye.type==="pong"){g.emit(Ye.type,!0,Ye.payload),Ye.type==="pong"?Bo():s||(re.send(Pi(Ye.payload?{type:Pe.Pong,payload:Ye.payload}:{type:Pe.Pong})),g.emit("pong",!1,Ye.payload));return}if(bi)return;if(Ye.type!==Pe.ConnectionAck)throw new Error(`First message cannot be of type ${Ye.type}`);clearTimeout(nr),bi=!0,g.emit("connected",re,Ye.payload),L=!1,R=0,ue([re,new Promise((c_,wg)=>T(wg))])}catch(Ye){re.onmessage=null,g.emit("error",Ye),re.close(bt.BadResponse,tl(Ye instanceof Error?Ye.message:new Error(Ye).message,"Bad response"))}}})())));k.readyState===b.CLOSING&&await we;let Se=()=>{},ce=new Promise(ue=>Se=ue);return[k,Se,Promise.race([ce.then(()=>{if(!A){let ue=()=>k.close(1e3,"Normal Closure");isFinite(a)&&a>0?D=setTimeout(()=>{k.readyState===b.OPEN&&ue()},a):ue()}}),we])]}function Ce(k){if(ks(k)&&(mv(k.code)||[bt.InternalServerError,bt.InternalClientError,bt.BadRequest,bt.BadResponse,bt.Unauthorized,bt.SubprotocolNotAcceptable,bt.SubscriberAlreadyExists,bt.TooManyInitialisationRequests].includes(k.code)))throw k;if(j)return!1;if(ks(k)&&k.code===1e3)return A>0;if(!u||R>=u||!d(k)||f?.(k))throw k;return L=!0}return n||(async()=>{for(A++;;)try{let[,,k]=await Ae();await k}catch(k){try{if(!Ce(k))return}catch(we){return i?.(we)}}})(),{on:g.on,subscribe(k,we){let Se=m(k),ce=!1,ue=!1,rr=()=>{A--,ce=!0};return(async()=>{for(A++;;)try{let[re,nr,Fr]=await Ae();if(ce)return nr();let Bo=g.onMessage(Se,bi=>{switch(bi.type){case Pe.Next:{we.next(bi.payload);return}case Pe.Error:{ue=!0,ce=!0,we.error(bi.payload),rr();return}case Pe.Complete:{ce=!0,rr();return}}});re.send(Pi({id:Se,type:Pe.Subscribe,payload:k},v)),rr=()=>{!ce&&re.readyState===b.OPEN&&re.send(Pi({id:Se,type:Pe.Complete},v)),A--,ce=!0,nr()},await Fr.finally(Bo);return}catch(re){if(!Ce(re))return}})().then(()=>{ue||we.complete()}).catch(re=>{we.error(re)}),()=>{ce||rr()}},async dispose(){if(j=!0,N){let[k]=await N;k.close(1e3,"Normal Closure")}},terminate(){N&&g.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function ks(r){return Ir(r)&&"code"in r&&"reason"in r}function mv(r){return[1e3,1001,1006,1005,1012,1013,1013].includes(r)?!1:r>=1e3&&r<=1999}function gv(r){return typeof r=="function"&&"constructor"in r&&"CLOSED"in r&&"CLOSING"in r&&"CONNECTING"in r&&"OPEN"in r}function yv(r){return le(r)&&"code"in r&&"reason"in r}var kf=function(r){De(e,r);function e(t){var n=r.call(this)||this;return n.client=t,n}return e.prototype.request=function(t){var n=this;return new ne(function(i){return n.client.subscribe(x(x({},t),{query:wi(t.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):yv(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new Ar({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(jt);var As="0.12.0-rc2";function Is(){return typeof window!="undefined"&&window.self!==window.top}function nl(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(r){return!1}return!0}function Ot(r,e){nl()&&localStorage.setItem(`${As}/${r}`,e)}function Ts(r){return nl()?localStorage.getItem(`${As}/${r}`):null}function Fa(r){nl()&&localStorage.removeItem(`${As}/${r}`)}function Li(r,e=1e4){return Z(this,null,function*(){return Promise.race([new Promise((t,n)=>{let i;try{i=new WebSocket(r,"graphql-transport-ws"),i.onopen=()=>{i.close(),t(i)},i.onerror=a=>{n(a)},i.onclose=a=>{a.code!==1e3&&n(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){i&&i.close(),n(a)}}),new Promise((t,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}var ac=function(){return ac=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},ac.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Vs(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Vs=function(t){return typeof t}:Vs=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vs(r)}function bv(r){return Vs(r)=="object"&&r!==null}var Gh=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function El(r,e){for(var t=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=t.exec(r.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function wv(r){return Kh(r.source,El(r.source,r.start))}function Kh(r,e){var t=r.locationOffset.column-1,n=Qs(t)+r.body,i=e.line-1,a=r.locationOffset.line-1,o=e.line+a,s=e.line===1?t:0,c=e.column+s,u="".concat(r.name,":").concat(o,":").concat(c,`
51
+ For more information, please visit: https://go.apollo.dev/c/docs`):new Y(9);if(this.link=A,this.cache=o,this.disableNetworkFetches=c||l>0,this.queryDeduplication=h,this.defaultOptions=m||Object.create(null),this.typeDefs=b,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),f&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!wf&&f&&__DEV__&&(wf=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var D=window.navigator,L=D&&D.userAgent,R=void 0;typeof L=="string"&&(L.indexOf("Chrome/")>-1?R="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":L.indexOf("Firefox/")>-1&&(R="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),R&&__DEV__&&P.log("Download the Apollo DevTools for a better development experience: "+R)}this.version=ad,this.localState=new _s({cache:o,client:this,resolvers:y,fragmentMatcher:g}),this.queryManager=new bf({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:c,clientAwareness:{name:T,version:N},localState:this.localState,assumeImmutableResults:_,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return r.prototype.stop=function(){this.queryManager.stop()},r.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Oa(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=x(x({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},r.prototype.query=function(e){return this.defaultOptions.query&&(e=Oa(this.defaultOptions.query,e)),__DEV__?P(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):P(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=x(x({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},r.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Oa(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},r.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!1),this.cache.readQuery(e,t)},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!1),this.cache.readFragment(e,t)},r.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},r.prototype.__requestRaw=function(e){return Ti(this.link,e)},r.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(t){return t()}))}).then(function(){return e.reFetchObservableQueries()})},r.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(t){return t()}))})},r.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},r.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],i=[];t.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&P.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},r.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},r.prototype.extract=function(e){return this.cache.extract(e)},r.prototype.restore=function(e){return this.cache.restore(e)},r.prototype.addResolvers=function(e){this.localState.addResolvers(e)},r.prototype.setResolvers=function(e){this.localState.setResolvers(e)},r.prototype.getResolvers=function(){return this.localState.getResolvers()},r.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},r.prototype.setLink=function(e){this.link=this.queryManager.link=e},r}();Np(bn?"log":"silent");function ut(r){return r===null?"null":Array.isArray(r)?"array":typeof r}function Ir(r){return ut(r)==="object"}function Sf(r){return Array.isArray(r)&&r.length>0&&r.every(e=>"message"in e)}function tl(r,e){return r.length<124?r:e}var _f="graphql-transport-ws";var bt;(function(r){r[r.InternalServerError=4500]="InternalServerError",r[r.InternalClientError=4005]="InternalClientError",r[r.BadRequest=4400]="BadRequest",r[r.BadResponse=4004]="BadResponse",r[r.Unauthorized=4401]="Unauthorized",r[r.Forbidden=4403]="Forbidden",r[r.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",r[r.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",r[r.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",r[r.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",r[r.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(bt||(bt={}));var Pe;(function(r){r.ConnectionInit="connection_init",r.ConnectionAck="connection_ack",r.Ping="ping",r.Pong="pong",r.Subscribe="subscribe",r.Next="next",r.Error="error",r.Complete="complete"})(Pe||(Pe={}));function Ef(r){if(!Ir(r))throw new Error(`Message is expected to be an object, but got ${ut(r)}`);if(!r.type)throw new Error("Message is missing the 'type' property");if(typeof r.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${ut(r.type)}`);switch(r.type){case Pe.ConnectionInit:case Pe.ConnectionAck:case Pe.Ping:case Pe.Pong:{if(r.payload!=null&&!Ir(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${r.payload}"`);break}case Pe.Subscribe:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${ut(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Ir(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${ut(r.payload)}`);if(typeof r.payload.query!="string")throw new Error(`"${r.type}" message payload expects the 'query' property to be a string, but got ${ut(r.payload.query)}`);if(r.payload.variables!=null&&!Ir(r.payload.variables))throw new Error(`"${r.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${ut(r.payload.variables)}`);if(r.payload.operationName!=null&&ut(r.payload.operationName)!=="string")throw new Error(`"${r.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${ut(r.payload.operationName)}`);if(r.payload.extensions!=null&&!Ir(r.payload.extensions))throw new Error(`"${r.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${ut(r.payload.extensions)}`);break}case Pe.Next:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${ut(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Ir(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${ut(r.payload)}`);break}case Pe.Error:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${ut(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Sf(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(r.payload)}`);break}case Pe.Complete:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${ut(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${r.type}"`)}return r}function xf(r,e){return Ef(typeof r=="string"?JSON.parse(r,e):r)}function Pi(r,e){return Ef(r),JSON.stringify(r,e)}function rl(r){let{url:e,connectionParams:t,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:c=0,retryAttempts:u=5,retryWait:l=async function(we){let Se=1e3;for(let ce=0;ce<we;ce++)Se*=2;await new Promise(ce=>setTimeout(ce,Se+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=ks,isFatalConnectionProblem:f,on:p,webSocketImpl:h,generateID:m=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,we=>{let Se=Math.random()*16|0;return(we=="x"?Se:Se&3|8).toString(16)})},jsonMessageReplacer:v,jsonMessageReviver:_}=r,y;if(h){if(!gv(h))throw new Error("Invalid WebSocket implementation provided");y=h}else typeof WebSocket<"u"?y=WebSocket:typeof global<"u"?y=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(y=window.WebSocket||window.MozWebSocket);if(!y)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let b=y,g=(()=>{let k=(()=>{let Se={};return{on(ce,ue){return Se[ce]=ue,()=>{delete Se[ce]}},emit(ce){var ue;"id"in ce&&((ue=Se[ce.id])===null||ue===void 0||ue.call(Se,ce))}}})(),we={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[k.emit,p.message]:[k.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:k.on,on(Se,ce){let ue=we[Se];return ue.push(ce),()=>{ue.splice(ue.indexOf(ce),1)}},emit(Se,...ce){for(let ue of[...we[Se]])ue(...ce)}}})();function T(k){let we=[g.on("error",Se=>{we.forEach(ce=>ce()),k(Se)}),g.on("closed",Se=>{we.forEach(ce=>ce()),k(Se)})]}let N,A=0,D,L=!1,R=0,j=!1;async function Ae(){clearTimeout(D);let[k,we]=await(N??(N=new Promise((ue,rr)=>(async()=>{if(L){if(await l(R),!A)return N=void 0,rr({code:1e3,reason:"All Subscriptions Gone"});R++}g.emit("connecting");let re=new b(typeof e=="function"?await e():e,_f),nr,Fr;function Bo(){isFinite(o)&&o>0&&(clearTimeout(Fr),Fr=setTimeout(()=>{re.readyState===b.OPEN&&(re.send(Pi({type:Pe.Ping})),g.emit("ping",!1,void 0))},o))}T(Ze=>{N=void 0,clearTimeout(nr),clearTimeout(Fr),rr(Ze),ks(Ze)&&Ze.code===4499&&(re.close(4499,"Terminated"),re.onerror=null,re.onclose=null)}),re.onerror=Ze=>g.emit("error",Ze),re.onclose=Ze=>g.emit("closed",Ze),re.onopen=async()=>{try{g.emit("opened",re);let Ze=typeof t=="function"?await t():t;if(re.readyState!==b.OPEN)return;re.send(Pi(Ze?{type:Pe.ConnectionInit,payload:Ze}:{type:Pe.ConnectionInit},v)),isFinite(c)&&c>0&&(nr=setTimeout(()=>{re.close(bt.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},c)),Bo()}catch(Ze){g.emit("error",Ze),re.close(bt.InternalClientError,tl(Ze instanceof Error?Ze.message:new Error(Ze).message,"Internal client error"))}};let bi=!1;re.onmessage=({data:Ze})=>{try{let Ye=xf(Ze,_);if(g.emit("message",Ye),Ye.type==="ping"||Ye.type==="pong"){g.emit(Ye.type,!0,Ye.payload),Ye.type==="pong"?Bo():s||(re.send(Pi(Ye.payload?{type:Pe.Pong,payload:Ye.payload}:{type:Pe.Pong})),g.emit("pong",!1,Ye.payload));return}if(bi)return;if(Ye.type!==Pe.ConnectionAck)throw new Error(`First message cannot be of type ${Ye.type}`);clearTimeout(nr),bi=!0,g.emit("connected",re,Ye.payload),L=!1,R=0,ue([re,new Promise((c_,wg)=>T(wg))])}catch(Ye){re.onmessage=null,g.emit("error",Ye),re.close(bt.BadResponse,tl(Ye instanceof Error?Ye.message:new Error(Ye).message,"Bad response"))}}})())));k.readyState===b.CLOSING&&await we;let Se=()=>{},ce=new Promise(ue=>Se=ue);return[k,Se,Promise.race([ce.then(()=>{if(!A){let ue=()=>k.close(1e3,"Normal Closure");isFinite(a)&&a>0?D=setTimeout(()=>{k.readyState===b.OPEN&&ue()},a):ue()}}),we])]}function Ce(k){if(ks(k)&&(mv(k.code)||[bt.InternalServerError,bt.InternalClientError,bt.BadRequest,bt.BadResponse,bt.Unauthorized,bt.SubprotocolNotAcceptable,bt.SubscriberAlreadyExists,bt.TooManyInitialisationRequests].includes(k.code)))throw k;if(j)return!1;if(ks(k)&&k.code===1e3)return A>0;if(!u||R>=u||!d(k)||f?.(k))throw k;return L=!0}return n||(async()=>{for(A++;;)try{let[,,k]=await Ae();await k}catch(k){try{if(!Ce(k))return}catch(we){return i?.(we)}}})(),{on:g.on,subscribe(k,we){let Se=m(k),ce=!1,ue=!1,rr=()=>{A--,ce=!0};return(async()=>{for(A++;;)try{let[re,nr,Fr]=await Ae();if(ce)return nr();let Bo=g.onMessage(Se,bi=>{switch(bi.type){case Pe.Next:{we.next(bi.payload);return}case Pe.Error:{ue=!0,ce=!0,we.error(bi.payload),rr();return}case Pe.Complete:{ce=!0,rr();return}}});re.send(Pi({id:Se,type:Pe.Subscribe,payload:k},v)),rr=()=>{!ce&&re.readyState===b.OPEN&&re.send(Pi({id:Se,type:Pe.Complete},v)),A--,ce=!0,nr()},await Fr.finally(Bo);return}catch(re){if(!Ce(re))return}})().then(()=>{ue||we.complete()}).catch(re=>{we.error(re)}),()=>{ce||rr()}},async dispose(){if(j=!0,N){let[k]=await N;k.close(1e3,"Normal Closure")}},terminate(){N&&g.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function ks(r){return Ir(r)&&"code"in r&&"reason"in r}function mv(r){return[1e3,1001,1006,1005,1012,1013,1013].includes(r)?!1:r>=1e3&&r<=1999}function gv(r){return typeof r=="function"&&"constructor"in r&&"CLOSED"in r&&"CLOSING"in r&&"CONNECTING"in r&&"OPEN"in r}function yv(r){return le(r)&&"code"in r&&"reason"in r}var kf=function(r){De(e,r);function e(t){var n=r.call(this)||this;return n.client=t,n}return e.prototype.request=function(t){var n=this;return new ne(function(i){return n.client.subscribe(x(x({},t),{query:wi(t.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):yv(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new Ar({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(jt);var As="0.12.0";function Is(){return typeof window!="undefined"&&window.self!==window.top}function nl(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(r){return!1}return!0}function Ot(r,e){nl()&&localStorage.setItem(`${As}/${r}`,e)}function Ts(r){return nl()?localStorage.getItem(`${As}/${r}`):null}function Fa(r){nl()&&localStorage.removeItem(`${As}/${r}`)}function Li(r,e=1e4){return Z(this,null,function*(){return Promise.race([new Promise((t,n)=>{let i;try{i=new WebSocket(r,"graphql-transport-ws"),i.onopen=()=>{i.close(),t(i)},i.onerror=a=>{n(a)},i.onclose=a=>{a.code!==1e3&&n(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){i&&i.close(),n(a)}}),new Promise((t,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}var ac=function(){return ac=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},ac.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Vs(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Vs=function(t){return typeof t}:Vs=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vs(r)}function bv(r){return Vs(r)=="object"&&r!==null}var Gh=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function El(r,e){for(var t=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=t.exec(r.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function wv(r){return Kh(r.source,El(r.source,r.start))}function Kh(r,e){var t=r.locationOffset.column-1,n=Qs(t)+r.body,i=e.line-1,a=r.locationOffset.line-1,o=e.line+a,s=e.line===1?t:0,c=e.column+s,u="".concat(r.name,":").concat(o,":").concat(c,`
52
52
  `),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var f=Math.floor(c/80),p=c%80,h=[],m=0;m<d.length;m+=80)h.push(d.slice(m,m+80));return u+Af([["".concat(o),h[0]]].concat(h.slice(1,f+1).map(function(v){return["",v]}),[[" ",Qs(p-1)+"^"],["",h[f+1]]]))}return u+Af([["".concat(o-1),l[i-1]],["".concat(o),d],["",Qs(c-1)+"^"],["".concat(o+1),l[i+1]]])}function Af(r){var e=r.filter(function(n){n[0];var i=n[1];return i!==void 0}),t=Math.max.apply(Math,e.map(function(n){var i=n[0];return i.length}));return e.map(function(n){var i=n[0],a=n[1];return Sv(t,i)+(a?" | "+a:" |")}).join(`
53
53
  `)}function Qs(r){return Array(r+1).join(" ")}function Sv(r,e){return Qs(r-e.length)+e}function zs(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zs=function(t){return typeof t}:zs=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zs(r)}function If(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function _v(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?If(Object(t),!0).forEach(function(n){Ev(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):If(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ev(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xv(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Tf(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function kv(r,e,t){return e&&Tf(r.prototype,e),t&&Tf(r,t),r}function Av(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&ho(r,e)}function Iv(r){var e=Zh();return function(){var n=mo(r),i;if(e){var a=mo(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Jh(this,i)}}function Jh(r,e){return e&&(zs(e)==="object"||typeof e=="function")?e:Ba(r)}function Ba(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function xl(r){var e=typeof Map=="function"?new Map:void 0;return xl=function(n){if(n===null||!Tv(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Hs(n,arguments,mo(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ho(i,n)},xl(r)}function Hs(r,e,t){return Zh()?Hs=Reflect.construct:Hs=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&ho(u,o.prototype),u},Hs.apply(null,arguments)}function Zh(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Tv(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function ho(r,e){return ho=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ho(r,e)}function mo(r){return mo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},mo(r)}var Ov=function(r){Av(t,r);var e=Iv(t);function t(n,i,a,o,s,c,u){var l,d,f,p;xv(this,t),p=e.call(this,n),p.name="GraphQLError",p.originalError=c??void 0,p.nodes=Of(Array.isArray(i)?i:i?[i]:void 0);for(var h=[],m=0,v=(_=p.nodes)!==null&&_!==void 0?_:[];m<v.length;m++){var _,y=v[m],b=y.loc;b!=null&&h.push(b)}h=Of(h),p.source=a??((l=h)===null||l===void 0?void 0:l[0].source),p.positions=o??((d=h)===null||d===void 0?void 0:d.map(function(T){return T.start})),p.locations=o&&a?o.map(function(T){return El(a,T)}):(f=h)===null||f===void 0?void 0:f.map(function(T){return El(T.source,T.start)}),p.path=s??void 0;var g=c?.extensions;return u==null&&bv(g)?p.extensions=_v({},g):p.extensions=u??{},Object.defineProperties(Ba(p),{message:{enumerable:!0},locations:{enumerable:p.locations!=null},path:{enumerable:p.path!=null},extensions:{enumerable:p.extensions!=null&&Object.keys(p.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),c!=null&&c.stack?(Object.defineProperty(Ba(p),"stack",{value:c.stack,writable:!0,configurable:!0}),Jh(p)):(Error.captureStackTrace?Error.captureStackTrace(Ba(p),t):Object.defineProperty(Ba(p),"stack",{value:Error().stack,writable:!0,configurable:!0}),p)}return kv(t,[{key:"toString",value:function(){return Cv(this)}},{key:Gh,get:function(){return"Object"}}]),t}(xl(Error));function Of(r){return r===void 0||r.length===0?void 0:r}function Cv(r){var e=r.message;if(r.nodes)for(var t=0,n=r.nodes;t<n.length;t++){var i=n[t];i.loc&&(e+=`
54
54
 
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- var l=(o,s,t)=>new Promise((c,e)=>{var r=n=>{try{u(t.next(n))}catch(d){e(d)}},p=n=>{try{u(t.throw(n))}catch(d){e(d)}},u=n=>n.done?c(n.value):Promise.resolve(n.value).then(r,p);u((t=t.apply(o,s)).next())});var a="0.12.0-rc2";function f(){return typeof window!="undefined"&&window.self!==window.top}function i(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(o){return!1}return!0}function w(o,s){i()&&localStorage.setItem(`${a}/${o}`,s)}function k(o){return i()?localStorage.getItem(`${a}/${o}`):null}function y(o){i()&&localStorage.removeItem(`${a}/${o}`)}function v(o,s=1e4){return l(this,null,function*(){return Promise.race([new Promise((t,c)=>{let e;try{e=new WebSocket(o,"graphql-transport-ws"),e.onopen=()=>{e.close(),t(e)},e.onerror=r=>{c(r)},e.onclose=r=>{r.code!==1e3&&c(new Error(`WebSocket closed with code ${r.code}: ${r.reason}`))}}catch(r){e&&e.close(),c(r)}}),new Promise((t,c)=>{setTimeout(()=>{c(new Error("WebSocket connection timed out"))},s)})])})}export{v as connectWebSocket,k as getLocal,f as isEmbedded,y as removeLocal,w as setLocal};
1
+ var l=(o,s,t)=>new Promise((c,e)=>{var r=n=>{try{u(t.next(n))}catch(d){e(d)}},p=n=>{try{u(t.throw(n))}catch(d){e(d)}},u=n=>n.done?c(n.value):Promise.resolve(n.value).then(r,p);u((t=t.apply(o,s)).next())});var a="0.12.0";function f(){return typeof window!="undefined"&&window.self!==window.top}function i(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(o){return!1}return!0}function w(o,s){i()&&localStorage.setItem(`${a}/${o}`,s)}function k(o){return i()?localStorage.getItem(`${a}/${o}`):null}function y(o){i()&&localStorage.removeItem(`${a}/${o}`)}function v(o,s=1e4){return l(this,null,function*(){return Promise.race([new Promise((t,c)=>{let e;try{e=new WebSocket(o,"graphql-transport-ws"),e.onopen=()=>{e.close(),t(e)},e.onerror=r=>{c(r)},e.onclose=r=>{r.code!==1e3&&c(new Error(`WebSocket closed with code ${r.code}: ${r.reason}`))}}catch(r){e&&e.close(),c(r)}}),new Promise((t,c)=>{setTimeout(()=>{c(new Error("WebSocket connection timed out"))},s)})])})}export{v as connectWebSocket,k as getLocal,f as isEmbedded,y as removeLocal,w as setLocal};
package/dist/web.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var xu=Object.defineProperty;var $u=Object.getOwnPropertyDescriptor;var Au=Object.getPrototypeOf;var ku=Reflect.get;var j=(i,e,t,r)=>{for(var n=r>1?void 0:r?$u(e,t):e,a=i.length-1,s;a>=0;a--)(s=i[a])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&xu(e,t,n),n};var ko=(i,e,t)=>ku(Au(i),t,e);var _e=(i,e,t)=>new Promise((r,n)=>{var a=l=>{try{o(t.next(l))}catch(c){n(c)}},s=l=>{try{o(t.throw(l))}catch(c){n(c)}},o=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,s);o((t=t.apply(i,e)).next())});var Dn=window,Mn=Dn.ShadowRoot&&(Dn.ShadyCSS===void 0||Dn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ts=Symbol(),Io=new WeakMap,Pr=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==ts)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Mn&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=Io.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Io.set(t,e))}return e}toString(){return this.cssText}},To=i=>new Pr(typeof i=="string"?i:i+"",void 0,ts),Je=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,a)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[a+1],i[0]);return new Pr(t,i,ts)},is=(i,e)=>{Mn?i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{let r=document.createElement("style"),n=Dn.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)})},Un=Mn?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return To(t)})(i):i;var rs,Fn=window,Co=Fn.trustedTypes,Iu=Co?Co.emptyScript:"",Lo=Fn.reactiveElementPolyfillSupport,as={toAttribute(i,e){switch(e){case Boolean:i=i?Iu:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},No=(i,e)=>e!==i&&(e==e||i==i),ns={attribute:!0,type:String,converter:as,reflect:!1,hasChanged:No},ss="finalized",Lt=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((t,r)=>{let n=this._$Ep(r,t);n!==void 0&&(this._$Ev.set(n,r),e.push(n))}),e}static createProperty(e,t=ns){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let r=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,r,t);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){return{get(){return this[t]},set(n){let a=this[e];this[t]=n,this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ns}static finalize(){if(this.hasOwnProperty(ss))return!1;this[ss]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let t=this.properties,r=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let n of r)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(Un(n))}else e!==void 0&&t.push(Un(e));return t}static _$Ep(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,r;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)===null||r===void 0||r.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;let t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return is(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var r;return(r=t.hostConnected)===null||r===void 0?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var r;return(r=t.hostDisconnected)===null||r===void 0?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EO(e,t,r=ns){var n;let a=this.constructor._$Ep(e,r);if(a!==void 0&&r.reflect===!0){let s=(((n=r.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?r.converter:as).toAttribute(t,r.type);this._$El=e,s==null?this.removeAttribute(a):this.setAttribute(a,s),this._$El=null}}_$AK(e,t){var r;let n=this.constructor,a=n._$Ev.get(e);if(a!==void 0&&this._$El!==a){let s=n.getPropertyOptions(a),o=typeof s.converter=="function"?{fromAttribute:s.converter}:((r=s.converter)===null||r===void 0?void 0:r.fromAttribute)!==void 0?s.converter:as;this._$El=a,this[a]=o.fromAttribute(t,s.type),this._$El=null}}requestUpdate(e,t,r){let n=!0;e!==void 0&&(((r=r||this.constructor.getPropertyOptions(e)).hasChanged||No)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,r))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,a)=>this[a]=n),this._$Ei=void 0);let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var a;return(a=n.hostUpdate)===null||a===void 0?void 0:a.call(n)}),this.update(r)):this._$Ek()}catch(n){throw t=!1,this._$Ek(),n}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach(r=>{var n;return(n=r.hostUpdated)===null||n===void 0?void 0:n.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((t,r)=>this._$EO(r,this[r],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Lt[ss]=!0,Lt.elementProperties=new Map,Lt.elementStyles=[],Lt.shadowRootOptions={mode:"open"},Lo?.({ReactiveElement:Lt}),((rs=Fn.reactiveElementVersions)!==null&&rs!==void 0?rs:Fn.reactiveElementVersions=[]).push("1.6.3");var os,jn=window,Xi=jn.trustedTypes,Ro=Xi?Xi.createPolicy("lit-html",{createHTML:i=>i}):void 0,ls="$lit$",jt=`lit$${(Math.random()+"").slice(9)}$`,jo="?"+jt,Tu=`<${jo}>`,pi=document,Dr=()=>pi.createComment(""),Mr=i=>i===null||typeof i!="object"&&typeof i!="function",Bo=Array.isArray,Cu=i=>Bo(i)||typeof i?.[Symbol.iterator]=="function",cs=`[
2
2
  \f\r]`,Or=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Po=/-->/g,Oo=/>/g,ui=RegExp(`>|${cs}(?:([^\\s"'>=/]+)(${cs}*=${cs}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Do=/'/g,Mo=/"/g,qo=/^(?:script|style|textarea|title)$/i,Ho=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),N=Ho(1),xg=Ho(2),fi=Symbol.for("lit-noChange"),Ee=Symbol.for("lit-nothing"),Uo=new WeakMap,di=pi.createTreeWalker(pi,129,null,!1);function Vo(i,e){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ro!==void 0?Ro.createHTML(e):e}var Lu=(i,e)=>{let t=i.length-1,r=[],n,a=e===2?"<svg>":"",s=Or;for(let o=0;o<t;o++){let l=i[o],c,u,m=-1,y=0;for(;y<l.length&&(s.lastIndex=y,u=s.exec(l),u!==null);)y=s.lastIndex,s===Or?u[1]==="!--"?s=Po:u[1]!==void 0?s=Oo:u[2]!==void 0?(qo.test(u[2])&&(n=RegExp("</"+u[2],"g")),s=ui):u[3]!==void 0&&(s=ui):s===ui?u[0]===">"?(s=n??Or,m=-1):u[1]===void 0?m=-2:(m=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?ui:u[3]==='"'?Mo:Do):s===Mo||s===Do?s=ui:s===Po||s===Oo?s=Or:(s=ui,n=void 0);let d=s===ui&&i[o+1].startsWith("/>")?" ":"";a+=s===Or?l+Tu:m>=0?(r.push(c),l.slice(0,m)+ls+l.slice(m)+jt+d):l+jt+(m===-2?(r.push(void 0),o):d)}return[Vo(i,a+(i[t]||"<?>")+(e===2?"</svg>":"")),r]},hi=class{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let a=0,s=0,o=e.length-1,l=this.parts,[c,u]=Lu(e,t);if(this.el=hi.createElement(c,r),di.currentNode=this.el.content,t===2){let m=this.el.content,y=m.firstChild;y.remove(),m.append(...y.childNodes)}for(;(n=di.nextNode())!==null&&l.length<o;){if(n.nodeType===1){if(n.hasAttributes()){let m=[];for(let y of n.getAttributeNames())if(y.endsWith(ls)||y.startsWith(jt)){let d=u[s++];if(m.push(y),d!==void 0){let p=n.getAttribute(d.toLowerCase()+ls).split(jt),f=/([.?@])?(.*)/.exec(d);l.push({type:1,index:a,name:f[2],strings:p,ctor:f[1]==="."?ds:f[1]==="?"?ps:f[1]==="@"?fs:tr})}else l.push({type:6,index:a})}for(let y of m)n.removeAttribute(y)}if(qo.test(n.tagName)){let m=n.textContent.split(jt),y=m.length-1;if(y>0){n.textContent=Xi?Xi.emptyScript:"";for(let d=0;d<y;d++)n.append(m[d],Dr()),di.nextNode(),l.push({type:2,index:++a});n.append(m[y],Dr())}}}else if(n.nodeType===8)if(n.data===jo)l.push({type:2,index:a});else{let m=-1;for(;(m=n.data.indexOf(jt,m+1))!==-1;)l.push({type:7,index:a}),m+=jt.length-1}a++}}static createElement(e,t){let r=pi.createElement("template");return r.innerHTML=e,r}};function er(i,e,t=i,r){var n,a,s,o;if(e===fi)return e;let l=r!==void 0?(n=t._$Co)===null||n===void 0?void 0:n[r]:t._$Cl,c=Mr(e)?void 0:e._$litDirective$;return l?.constructor!==c&&((a=l?._$AO)===null||a===void 0||a.call(l,!1),c===void 0?l=void 0:(l=new c(i),l._$AT(i,t,r)),r!==void 0?((s=(o=t)._$Co)!==null&&s!==void 0?s:o._$Co=[])[r]=l:t._$Cl=l),l!==void 0&&(e=er(i,l._$AS(i,e.values),l,r)),e}var us=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;let{el:{content:r},parts:n}=this._$AD,a=((t=e?.creationScope)!==null&&t!==void 0?t:pi).importNode(r,!0);di.currentNode=a;let s=di.nextNode(),o=0,l=0,c=n[0];for(;c!==void 0;){if(o===c.index){let u;c.type===2?u=new gi(s,s.nextSibling,this,e):c.type===1?u=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(u=new hs(s,this,e)),this._$AV.push(u),c=n[++l]}o!==c?.index&&(s=di.nextNode(),o++)}return di.currentNode=pi,a}v(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},gi=class{constructor(e,t,r,n){var a;this.type=2,this._$AH=Ee,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cp=(a=n?.isConnected)===null||a===void 0||a}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=er(this,e,t),Mr(e)?e===Ee||e==null||e===""?(this._$AH!==Ee&&this._$AR(),this._$AH=Ee):e!==this._$AH&&e!==fi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Cu(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Ee&&Mr(this._$AH)?this._$AA.nextSibling.data=e:this.$(pi.createTextNode(e)),this._$AH=e}g(e){var t;let{values:r,_$litType$:n}=e,a=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=hi.createElement(Vo(n.h,n.h[0]),this.options)),n);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===a)this._$AH.v(r);else{let s=new us(a,this),o=s.u(this.options);s.v(r),this.$(o),this._$AH=s}}_$AC(e){let t=Uo.get(e.strings);return t===void 0&&Uo.set(e.strings,t=new hi(e)),t}T(e){Bo(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let a of e)n===t.length?t.push(r=new gi(this.k(Dr()),this.k(Dr()),this,this.options)):r=t[n],r._$AI(a),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)===null||r===void 0||r.call(this,!1,!0,t);e&&e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},tr=class{constructor(e,t,r,n,a){this.type=1,this._$AH=Ee,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=a,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Ee}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,r,n){let a=this.strings,s=!1;if(a===void 0)e=er(this,e,t,0),s=!Mr(e)||e!==this._$AH&&e!==fi,s&&(this._$AH=e);else{let o=e,l,c;for(e=a[0],l=0;l<a.length-1;l++)c=er(this,o[r+l],t,l),c===fi&&(c=this._$AH[l]),s||(s=!Mr(c)||c!==this._$AH[l]),c===Ee?e=Ee:e!==Ee&&(e+=(c??"")+a[l+1]),this._$AH[l]=c}s&&!n&&this.j(e)}j(e){e===Ee?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ds=class extends tr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ee?void 0:e}},Nu=Xi?Xi.emptyScript:"",ps=class extends tr{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Ee?this.element.setAttribute(this.name,Nu):this.element.removeAttribute(this.name)}},fs=class extends tr{constructor(e,t,r,n,a){super(e,t,r,n,a),this.type=5}_$AI(e,t=this){var r;if((e=(r=er(this,e,t,0))!==null&&r!==void 0?r:Ee)===fi)return;let n=this._$AH,a=e===Ee&&n!==Ee||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==Ee&&(n===Ee||a);a&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,r;typeof this._$AH=="function"?this._$AH.call((r=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&r!==void 0?r:this.element,e):this._$AH.handleEvent(e)}},hs=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){er(this,e)}};var Fo=jn.litHtmlPolyfillSupport;Fo?.(hi,gi),((os=jn.litHtmlVersions)!==null&&os!==void 0?os:jn.litHtmlVersions=[]).push("2.8.0");var zo=(i,e,t)=>{var r,n;let a=(r=t?.renderBefore)!==null&&r!==void 0?r:e,s=a._$litPart$;if(s===void 0){let o=(n=t?.renderBefore)!==null&&n!==void 0?n:null;a._$litPart$=s=new gi(e.insertBefore(Dr(),o),o,void 0,t??{})}return s._$AI(i),s};var gs,ms;var Le=class extends Lt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let r=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=r.firstChild),r}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=zo(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return fi}};Le.finalized=!0,Le._$litElement$=!0,(gs=globalThis.litElementHydrateSupport)===null||gs===void 0||gs.call(globalThis,{LitElement:Le});var Wo=globalThis.litElementPolyfillSupport;Wo?.({LitElement:Le});((ms=globalThis.litElementVersions)!==null&&ms!==void 0?ms:globalThis.litElementVersions=[]).push("3.3.3");var gt=i=>e=>typeof e=="function"?((t,r)=>(customElements.define(t,r),r))(i,e):((t,r)=>{let{kind:n,elements:a}=r;return{kind:n,elements:a,finisher(s){customElements.define(t,s)}}})(i,e);var Ru=(i,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,i)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,i)}},Pu=(i,e,t)=>{e.constructor.createProperty(t,i)};function fe(i){return(e,t)=>t!==void 0?Pu(i,e,t):Ru(i,e)}function ue(i){return fe({...i,state:!0})}var ys,Jg=((ys=window.HTMLSlotElement)===null||ys===void 0?void 0:ys.prototype.assignedElements)!=null?(i,e)=>i.assignedElements(e):(i,e)=>i.assignedNodes(e).filter(t=>t.nodeType===Node.ELEMENT_NODE);var Ou=i=>{let e=new Set;do for(let t of Reflect.ownKeys(i))e.add([i,t]);while((i=Reflect.getPrototypeOf(i))&&i!==Object.prototype);return e};function vs(i,{include:e,exclude:t}={}){let r=n=>{let a=s=>typeof s=="string"?n===s:s.test(n);return e?e.some(a):t?!t.some(a):!0};for(let[n,a]of Ou(i.constructor.prototype)){if(a==="constructor"||!r(a))continue;let s=Reflect.getOwnPropertyDescriptor(n,a);s&&typeof s.value=="function"&&(i[a]=i[a].bind(i))}return i}var Ko="0.12.0-rc2";function Mu(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(i){return!1}return!0}function Bn(i,e){Mu()&&localStorage.setItem(`${Ko}/${i}`,e)}function qn(i,e=1e4){return _e(this,null,function*(){return Promise.race([new Promise((t,r)=>{let n;try{n=new WebSocket(i,"graphql-transport-ws"),n.onopen=()=>{n.close(),t(n)},n.onerror=a=>{r(a)},n.onclose=a=>{a.code!==1e3&&r(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){n&&n.close(),r(a)}}),new Promise((t,r)=>{setTimeout(()=>{r(new Error("WebSocket connection timed out"))},e)})])})}function mi(){return N`
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Do=/'/g,Mo=/"/g,qo=/^(?:script|style|textarea|title)$/i,Ho=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),N=Ho(1),xg=Ho(2),fi=Symbol.for("lit-noChange"),Ee=Symbol.for("lit-nothing"),Uo=new WeakMap,di=pi.createTreeWalker(pi,129,null,!1);function Vo(i,e){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ro!==void 0?Ro.createHTML(e):e}var Lu=(i,e)=>{let t=i.length-1,r=[],n,a=e===2?"<svg>":"",s=Or;for(let o=0;o<t;o++){let l=i[o],c,u,m=-1,y=0;for(;y<l.length&&(s.lastIndex=y,u=s.exec(l),u!==null);)y=s.lastIndex,s===Or?u[1]==="!--"?s=Po:u[1]!==void 0?s=Oo:u[2]!==void 0?(qo.test(u[2])&&(n=RegExp("</"+u[2],"g")),s=ui):u[3]!==void 0&&(s=ui):s===ui?u[0]===">"?(s=n??Or,m=-1):u[1]===void 0?m=-2:(m=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?ui:u[3]==='"'?Mo:Do):s===Mo||s===Do?s=ui:s===Po||s===Oo?s=Or:(s=ui,n=void 0);let d=s===ui&&i[o+1].startsWith("/>")?" ":"";a+=s===Or?l+Tu:m>=0?(r.push(c),l.slice(0,m)+ls+l.slice(m)+jt+d):l+jt+(m===-2?(r.push(void 0),o):d)}return[Vo(i,a+(i[t]||"<?>")+(e===2?"</svg>":"")),r]},hi=class{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let a=0,s=0,o=e.length-1,l=this.parts,[c,u]=Lu(e,t);if(this.el=hi.createElement(c,r),di.currentNode=this.el.content,t===2){let m=this.el.content,y=m.firstChild;y.remove(),m.append(...y.childNodes)}for(;(n=di.nextNode())!==null&&l.length<o;){if(n.nodeType===1){if(n.hasAttributes()){let m=[];for(let y of n.getAttributeNames())if(y.endsWith(ls)||y.startsWith(jt)){let d=u[s++];if(m.push(y),d!==void 0){let p=n.getAttribute(d.toLowerCase()+ls).split(jt),f=/([.?@])?(.*)/.exec(d);l.push({type:1,index:a,name:f[2],strings:p,ctor:f[1]==="."?ds:f[1]==="?"?ps:f[1]==="@"?fs:tr})}else l.push({type:6,index:a})}for(let y of m)n.removeAttribute(y)}if(qo.test(n.tagName)){let m=n.textContent.split(jt),y=m.length-1;if(y>0){n.textContent=Xi?Xi.emptyScript:"";for(let d=0;d<y;d++)n.append(m[d],Dr()),di.nextNode(),l.push({type:2,index:++a});n.append(m[y],Dr())}}}else if(n.nodeType===8)if(n.data===jo)l.push({type:2,index:a});else{let m=-1;for(;(m=n.data.indexOf(jt,m+1))!==-1;)l.push({type:7,index:a}),m+=jt.length-1}a++}}static createElement(e,t){let r=pi.createElement("template");return r.innerHTML=e,r}};function er(i,e,t=i,r){var n,a,s,o;if(e===fi)return e;let l=r!==void 0?(n=t._$Co)===null||n===void 0?void 0:n[r]:t._$Cl,c=Mr(e)?void 0:e._$litDirective$;return l?.constructor!==c&&((a=l?._$AO)===null||a===void 0||a.call(l,!1),c===void 0?l=void 0:(l=new c(i),l._$AT(i,t,r)),r!==void 0?((s=(o=t)._$Co)!==null&&s!==void 0?s:o._$Co=[])[r]=l:t._$Cl=l),l!==void 0&&(e=er(i,l._$AS(i,e.values),l,r)),e}var us=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;let{el:{content:r},parts:n}=this._$AD,a=((t=e?.creationScope)!==null&&t!==void 0?t:pi).importNode(r,!0);di.currentNode=a;let s=di.nextNode(),o=0,l=0,c=n[0];for(;c!==void 0;){if(o===c.index){let u;c.type===2?u=new gi(s,s.nextSibling,this,e):c.type===1?u=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(u=new hs(s,this,e)),this._$AV.push(u),c=n[++l]}o!==c?.index&&(s=di.nextNode(),o++)}return di.currentNode=pi,a}v(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},gi=class{constructor(e,t,r,n){var a;this.type=2,this._$AH=Ee,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cp=(a=n?.isConnected)===null||a===void 0||a}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=er(this,e,t),Mr(e)?e===Ee||e==null||e===""?(this._$AH!==Ee&&this._$AR(),this._$AH=Ee):e!==this._$AH&&e!==fi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Cu(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Ee&&Mr(this._$AH)?this._$AA.nextSibling.data=e:this.$(pi.createTextNode(e)),this._$AH=e}g(e){var t;let{values:r,_$litType$:n}=e,a=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=hi.createElement(Vo(n.h,n.h[0]),this.options)),n);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===a)this._$AH.v(r);else{let s=new us(a,this),o=s.u(this.options);s.v(r),this.$(o),this._$AH=s}}_$AC(e){let t=Uo.get(e.strings);return t===void 0&&Uo.set(e.strings,t=new hi(e)),t}T(e){Bo(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let a of e)n===t.length?t.push(r=new gi(this.k(Dr()),this.k(Dr()),this,this.options)):r=t[n],r._$AI(a),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)===null||r===void 0||r.call(this,!1,!0,t);e&&e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},tr=class{constructor(e,t,r,n,a){this.type=1,this._$AH=Ee,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=a,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Ee}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,r,n){let a=this.strings,s=!1;if(a===void 0)e=er(this,e,t,0),s=!Mr(e)||e!==this._$AH&&e!==fi,s&&(this._$AH=e);else{let o=e,l,c;for(e=a[0],l=0;l<a.length-1;l++)c=er(this,o[r+l],t,l),c===fi&&(c=this._$AH[l]),s||(s=!Mr(c)||c!==this._$AH[l]),c===Ee?e=Ee:e!==Ee&&(e+=(c??"")+a[l+1]),this._$AH[l]=c}s&&!n&&this.j(e)}j(e){e===Ee?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ds=class extends tr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ee?void 0:e}},Nu=Xi?Xi.emptyScript:"",ps=class extends tr{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Ee?this.element.setAttribute(this.name,Nu):this.element.removeAttribute(this.name)}},fs=class extends tr{constructor(e,t,r,n,a){super(e,t,r,n,a),this.type=5}_$AI(e,t=this){var r;if((e=(r=er(this,e,t,0))!==null&&r!==void 0?r:Ee)===fi)return;let n=this._$AH,a=e===Ee&&n!==Ee||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==Ee&&(n===Ee||a);a&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,r;typeof this._$AH=="function"?this._$AH.call((r=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&r!==void 0?r:this.element,e):this._$AH.handleEvent(e)}},hs=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){er(this,e)}};var Fo=jn.litHtmlPolyfillSupport;Fo?.(hi,gi),((os=jn.litHtmlVersions)!==null&&os!==void 0?os:jn.litHtmlVersions=[]).push("2.8.0");var zo=(i,e,t)=>{var r,n;let a=(r=t?.renderBefore)!==null&&r!==void 0?r:e,s=a._$litPart$;if(s===void 0){let o=(n=t?.renderBefore)!==null&&n!==void 0?n:null;a._$litPart$=s=new gi(e.insertBefore(Dr(),o),o,void 0,t??{})}return s._$AI(i),s};var gs,ms;var Le=class extends Lt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let r=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=r.firstChild),r}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=zo(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return fi}};Le.finalized=!0,Le._$litElement$=!0,(gs=globalThis.litElementHydrateSupport)===null||gs===void 0||gs.call(globalThis,{LitElement:Le});var Wo=globalThis.litElementPolyfillSupport;Wo?.({LitElement:Le});((ms=globalThis.litElementVersions)!==null&&ms!==void 0?ms:globalThis.litElementVersions=[]).push("3.3.3");var gt=i=>e=>typeof e=="function"?((t,r)=>(customElements.define(t,r),r))(i,e):((t,r)=>{let{kind:n,elements:a}=r;return{kind:n,elements:a,finisher(s){customElements.define(t,s)}}})(i,e);var Ru=(i,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,i)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,i)}},Pu=(i,e,t)=>{e.constructor.createProperty(t,i)};function fe(i){return(e,t)=>t!==void 0?Pu(i,e,t):Ru(i,e)}function ue(i){return fe({...i,state:!0})}var ys,Jg=((ys=window.HTMLSlotElement)===null||ys===void 0?void 0:ys.prototype.assignedElements)!=null?(i,e)=>i.assignedElements(e):(i,e)=>i.assignedNodes(e).filter(t=>t.nodeType===Node.ELEMENT_NODE);var Ou=i=>{let e=new Set;do for(let t of Reflect.ownKeys(i))e.add([i,t]);while((i=Reflect.getPrototypeOf(i))&&i!==Object.prototype);return e};function vs(i,{include:e,exclude:t}={}){let r=n=>{let a=s=>typeof s=="string"?n===s:s.test(n);return e?e.some(a):t?!t.some(a):!0};for(let[n,a]of Ou(i.constructor.prototype)){if(a==="constructor"||!r(a))continue;let s=Reflect.getOwnPropertyDescriptor(n,a);s&&typeof s.value=="function"&&(i[a]=i[a].bind(i))}return i}var Ko="0.12.0";function Mu(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(i){return!1}return!0}function Bn(i,e){Mu()&&localStorage.setItem(`${Ko}/${i}`,e)}function qn(i,e=1e4){return _e(this,null,function*(){return Promise.race([new Promise((t,r)=>{let n;try{n=new WebSocket(i,"graphql-transport-ws"),n.onopen=()=>{n.close(),t(n)},n.onerror=a=>{r(a)},n.onclose=a=>{a.code!==1e3&&r(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){n&&n.close(),r(a)}}),new Promise((t,r)=>{setTimeout(()=>{r(new Error("WebSocket connection timed out"))},e)})])})}function mi(){return N`
4
4
  <svg viewBox="0 0 63.6 60" fill="none" xmlns="http://www.w3.org/2000/svg">
5
5
  <path fill="currentColor" d="M63.2781 52.9928C62.4038 47.0393 59.8345 41.4763 55.9242 36.935C55.9403 36.5766 55.951 36.2182 55.951 35.8545C55.951 26.6328 50.7373 18.6039 43.0937 14.5333C41.093 9.35009 37.7352 4.72854 33.2402 1.14469L31.7705 0L30.2793 1.10725L30.2096 1.16074C25.7253 4.74458 22.3729 9.36079 20.3775 14.5386C12.7339 18.6039 7.52021 26.6328 7.52021 35.8599C7.52021 36.2236 7.53094 36.582 7.54703 36.9404C3.6421 41.471 1.06742 47.034 0.198465 52.9874L0 54.9131L1.70036 55.5817C5.40683 57.0313 9.32249 57.7695 13.3401 57.7695C15.668 57.7695 17.9369 57.5127 20.1254 57.0366C23.5744 58.9248 27.533 60 31.7383 60C35.9436 60 39.9022 58.9248 43.3512 57.0366C45.5397 57.5127 47.8086 57.7695 50.1365 57.7695C54.1541 57.7695 58.0698 57.0366 61.7762 55.5817L63.5624 54.881L63.2835 52.9874L63.2781 52.9928ZM42.5734 51.8802C40.0792 51.1581 37.7352 50.0829 35.595 48.7189C39.752 44.675 42.8041 39.5079 44.263 33.7202C46.1297 34.6938 47.8891 35.8866 49.4982 37.288C49.9917 37.716 50.4637 38.1653 50.9197 38.6253C50.1258 44.1294 46.9986 48.8954 42.568 51.8855L42.5734 51.8802ZM12.5516 38.62C13.0075 38.1599 13.4849 37.716 13.973 37.288C15.5822 35.8866 17.3415 34.6938 19.2082 33.7202C20.6672 39.5079 23.7192 44.675 27.8763 48.7189C25.7361 50.0829 23.392 51.1527 20.8978 51.8802C16.4672 48.8901 13.3401 44.1241 12.5462 38.62H12.5516ZM40.3957 25.9802C40.3957 26.3332 40.3903 26.6809 40.3742 27.0286C37.585 26.2477 34.6831 25.8411 31.7383 25.8411C28.7935 25.8411 25.8916 26.2477 23.1024 27.0286C23.0917 26.6809 23.0809 26.3279 23.0809 25.9802C23.0809 23.2362 23.494 20.5563 24.2825 18.0102C26.5782 17.0527 29.0993 16.5231 31.7383 16.5231C34.3773 16.5231 36.8984 17.0527 39.1941 18.0102C39.9826 20.5563 40.3957 23.2362 40.3957 25.9802ZM23.73 31.8641C26.3047 31.0671 29.0027 30.6553 31.7383 30.6553C34.4739 30.6553 37.1719 31.0671 39.7466 31.8641C38.5344 37.2827 35.6808 42.0915 31.7383 45.7395C27.7958 42.0861 24.9422 37.2773 23.73 31.8641ZM50.7641 32.1262C48.9887 30.8104 47.0898 29.6817 45.0998 28.7671C45.1803 27.847 45.2232 26.9163 45.2232 25.9802C45.2232 24.536 45.1266 23.1131 44.9335 21.7063C47.8676 24.4343 49.9595 28.0503 50.7641 32.1262ZM31.7383 6.19417C33.6639 7.97005 35.2946 9.99198 36.6087 12.1904C35.0371 11.8695 33.4065 11.6983 31.7383 11.6983C30.0701 11.6983 28.4395 11.8695 26.8679 12.1904C28.182 9.99198 29.8127 7.97005 31.7383 6.19417ZM18.5431 21.701C18.3553 23.1078 18.2534 24.5306 18.2534 25.9749C18.2534 26.9163 18.2963 27.8417 18.3768 28.7617C16.3868 29.6764 14.4879 30.805 12.7125 32.1209C13.5171 28.0449 15.6036 24.429 18.5377 21.701H18.5431ZM5.33173 51.7518C5.9915 48.7938 7.15547 45.9802 8.74855 43.418C9.95007 47.034 11.9776 50.2808 14.622 52.9179C14.1983 52.9393 13.7692 52.95 13.3401 52.95C10.5991 52.95 7.91178 52.5488 5.32637 51.7465L5.33173 51.7518ZM31.7383 55.1859C30.1506 55.1859 28.6058 54.988 27.1307 54.6296C28.7452 53.854 30.29 52.95 31.7383 51.923C33.1866 52.95 34.7314 53.854 36.3459 54.6296C34.8655 54.988 33.326 55.1859 31.7383 55.1859ZM50.1365 52.95C49.7074 52.95 49.2783 52.9339 48.8546 52.9179C51.499 50.2808 53.5265 47.0393 54.728 43.4234C56.3211 45.9802 57.4851 48.7938 58.1449 51.7518C55.5648 52.5488 52.8775 52.95 50.1365 52.95Z" />
6
6
  </svg>
package/package.json CHANGED
@@ -48,7 +48,7 @@
48
48
  "email": "nicolas@coasys.org"
49
49
  },
50
50
  "devDependencies": {
51
- "@coasys/ad4m": "workspace:0.12.0-rc2",
51
+ "@coasys/ad4m": "workspace:0.12.0",
52
52
  "@apollo/client": "3.7.10",
53
53
  "@types/node": "^16.11.11",
54
54
  "esbuild": "^0.15.5",
@@ -72,5 +72,5 @@
72
72
  "@coasys/ad4m": "*"
73
73
  }
74
74
  },
75
- "version": "0.12.0-rc2"
75
+ "version": "0.12.0"
76
76
  }