Socket
Socket
Sign inDemoInstall

@urql/exchange-graphcache

Package Overview
Dependencies
5
Maintainers
31
Versions
292
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.3.0 to 2.3.1

dist/types/store/defer.d.ts

15

CHANGELOG.md
# @urql/exchange-graphcache
## 2.3.1
### Patch Changes
- Add graphql@^15.0.0 to peer dependency range, by [@kitten](https://github.com/kitten) (See [#688](https://github.com/FormidableLabs/urql/pull/688))
- Forcefully bump @urql/core package in all bindings and in @urql/exchange-graphcache.
We're aware that in some cases users may not have upgraded to @urql/core, even though that's within
the typical patch range. Since the latest @urql/core version contains a patch that is required for
`cache-and-network` to work, we're pushing another patch that now forcefully bumps everyone to the
new version that includes this fix, by [@kitten](https://github.com/kitten) (See [#684](https://github.com/FormidableLabs/urql/pull/684))
- Reimplement persistence support to take commutative layers into account, by [@kitten](https://github.com/kitten) (See [#674](https://github.com/FormidableLabs/urql/pull/674))
- Updated dependencies (See [#688](https://github.com/FormidableLabs/urql/pull/688) and [#678](https://github.com/FormidableLabs/urql/pull/678))
- @urql/exchange-populate@0.1.4
- @urql/core@1.10.8
## 2.3.0

@@ -4,0 +19,0 @@

2

dist/types/operations/invalidate.d.ts
import { Variables, OperationRequest } from '../types';
import { Store } from '../store';
export declare const invalidateEntity: (entityKey: string, field?: string | undefined, args?: Variables | undefined) => void;
export declare const invalidate: (store: Store, request: OperationRequest) => void;
export declare const invalidateEntity: (entityKey: string, field?: string | undefined, args?: Variables | undefined) => void;

@@ -10,10 +10,8 @@ import { Link, EntityField, FieldInfo, StorageAdapter, SerializedEntries } from '../types';

export interface InMemoryData {
/** Ensure persistence is never scheduled twice at a time */
persistenceScheduled: boolean;
/** Batches changes to the data layer that'll be written to `storage` */
persistenceBatch: SerializedEntries;
/** Ensure garbage collection is never scheduled twice at a time */
gcScheduled: boolean;
/** Flag for whether deferred tasks have been scheduled yet */
defer: boolean;
/** A list of entities that have been flagged for gargabe collection since no references to them are left */
gcBatch: Set<string>;
gc: Set<string>;
/** A list of entity+field keys that will be persisted */
persist: Set<string>;
/** The API's "Query" typename which is needed to filter dependencies */

@@ -48,3 +46,3 @@ queryRootKey: string;

/** Garbage collects all entities that have been marked as having no references */
export declare const gc: (data: InMemoryData) => void;
export declare const gc: () => void;
/** Reads an entity's field (a "record") from data */

@@ -65,3 +63,4 @@ export declare const readRecord: (entityKey: string, fieldKey: string) => EntityField;

export declare const inspectFields: (entityKey: string) => FieldInfo[];
export declare const persistData: () => void;
export declare const hydrateData: (data: InMemoryData, storage: StorageAdapter, entries: SerializedEntries) => void;
export {};

@@ -5,3 +5,3 @@ import { Variables, FieldInfo } from '../types';

export declare const joinKeys: (parentKey: string, key: string) => string;
/** Prefix key with its owner type Link / Record */
export declare const prefixKey: (owner: "l" | "r", key: string) => string;
export declare const serializeKeys: (entityKey: string, fieldKey: string) => string;
export declare const indexOfSeparator: (key: string) => number;

@@ -101,3 +101,3 @@ import { DocumentNode, FragmentDefinitionNode } from 'graphql';

export interface SerializedEntries {
[key: string]: SerializedEntry;
[key: string]: string | undefined;
}

@@ -104,0 +104,0 @@ export interface StorageAdapter {

@@ -18,14 +18,14 @@ "use strict";

}, getFieldArguments = function(a, b) {
var c = {}, d = 0;
var c = {}, e = 0;
if (a.arguments && a.arguments.length) {
for (var e = 0, f = a.arguments.length; e < f; e++) {
var g = a.arguments[e], h = graphql.valueFromASTUntyped(g.value, b);
null != h && (c[getName(g)] = h, d++);
for (var d = 0, f = a.arguments.length; d < f; d++) {
var g = a.arguments[d], h = graphql.valueFromASTUntyped(g.value, b);
null != h && (c[getName(g)] = h, e++);
}
}
return 0 < d ? c : null;
return 0 < e ? c : null;
}, filterVariables = function(a, b) {
if (b && a.variableDefinitions) {
for (var c = {}, d = 0, e = a.variableDefinitions.length; d < e; d++) {
var f = getName(a.variableDefinitions[d].variable);
for (var c = {}, e = 0, d = a.variableDefinitions.length; e < d; e++) {
var f = getName(a.variableDefinitions[e].variable);
c[f] = b[f];

@@ -41,4 +41,4 @@ }

if (a.variableDefinitions) {
for (var d = 0, e = a.variableDefinitions.length; d < e; d++) {
var f = a.variableDefinitions[d], g = getName(f.variable);
for (var e = 0, d = a.variableDefinitions.length; e < d; e++) {
var f = a.variableDefinitions[e], g = getName(f.variable);
c[g] = void 0 === b[g] && f.defaultValue ? graphql.valueFromASTUntyped(f.defaultValue, b) : b[g];

@@ -95,4 +95,4 @@ }

}
for (var d = 0, e = c.length; d < e; d++) {
var f = c[d];
for (var e = 0, d = c.length; e < d; e++) {
var f = c[e];
if (("include" === (a = getName(f)) || "skip" === a) && f.arguments && f.arguments[0] && "if" === getName(f.arguments[0])) {

@@ -120,11 +120,11 @@ return b = graphql.valueFromASTUntyped(f.arguments[0].value, b), "include" === a ? !!b : !b;

}
var d = a.getType(b), e = a.getType(c);
if (d instanceof graphql.GraphQLObjectType) {
return d === e;
var e = a.getType(b), d = a.getType(c);
if (e instanceof graphql.GraphQLObjectType) {
return e === d;
}
!function expectAbstractType(a, b) {
invariant(a instanceof graphql.GraphQLInterfaceType || a instanceof graphql.GraphQLUnionType, "production" !== process.env.NODE_ENV ? "Invalid Abstract type: The type `" + b + "` is not an Interface or Union type in the defined schema, but a fragment in the GraphQL document is using it as a type condition." : "", 5);
}(d, b);
expectObjectType(e, c);
return a.isPossibleType(d, e);
}(e, b);
expectObjectType(d, c);
return a.isPossibleType(e, d);
}, getField = function(a, b, c) {

@@ -140,5 +140,3 @@ expectObjectType(a = a.getType(b), b);

var makeDict = function() {
return Object.create(null);
}, keyOfField = function(a, b) {
var keyOfField = function(a, b) {
return b ? a + "(" + core.stringifyVariables(b) + ")" : a;

@@ -158,7 +156,9 @@ }, fieldInfoOfKey = function(a) {

return a + "." + b;
}, prefixKey = function(a, b) {
return a + "|" + b;
}, defer = "production" === process.env.NODE_ENV && "undefined" != typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : function(a) {
}, indexOfSeparator = function(a) {
return a.indexOf("\t");
}, makeDict = function() {
return Object.create(null);
}, scheduleTask = "production" === process.env.NODE_ENV && "undefined" != typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : function(a) {
return setTimeout(a, 0);
}, currentData = null, currentDependencies = null, previousDependencies = null, currentOptimisticKey = null, makeNodeMap = function() {
}, currentData = null, currentDependencies = null, previousDependencies = null, currentOptimisticKey = null, currentIgnoreOptimistic = !1, makeNodeMap = function() {
return {

@@ -172,2 +172,3 @@ optimistic: makeDict(),

currentDependencies = new Set;
currentIgnoreOptimistic = !1;
"production" !== process.env.NODE_ENV && (currentDebugStack.length = 0);

@@ -178,19 +179,19 @@ b ? c || 1 < a.optimisticOrder.length && -1 < a.optimisticOrder.indexOf(b) ? (c || a.commutativeKeys.has(b) || (clearLayer(a, b),

}, clearDataState = function() {
var c = currentData, d = currentOptimisticKey;
"production" !== process.env.NODE_ENV && getCurrentDependencies();
var b = currentData, c = currentOptimisticKey;
currentOptimisticKey = null;
if (d && -1 < c.optimisticOrder.indexOf(d)) {
for (d = c.optimisticOrder.length; 0 <= --d && c.refLock[c.optimisticOrder[d]] && c.commutativeKeys.has(c.optimisticOrder[d]); ) {
squashLayer(c.optimisticOrder[d]);
if (c && -1 < b.optimisticOrder.indexOf(c)) {
for (c = b.optimisticOrder.length; 0 <= --c && b.refLock[b.optimisticOrder[c]] && b.commutativeKeys.has(b.optimisticOrder[c]); ) {
squashLayer(b.optimisticOrder[c]);
}
}
"test" === process.env.NODE_ENV || b.defer || (b.defer = !0, scheduleTask((function a() {
initDataState(b, null);
gc();
persistData();
clearDataState();
b.defer = !1;
})));
currentDependencies = currentData = null;
"production" !== process.env.NODE_ENV && (currentDebugStack.length = 0);
!c.gcScheduled && 0 < c.gcBatch.size && (c.gcScheduled = !0, defer((function a() {
gc(c);
})));
c.storage && !c.persistenceScheduled && (c.persistenceScheduled = !0, defer((function b() {
c.storage.write(c.persistenceBatch);
c.persistenceScheduled = !1;
c.persistenceBatch = makeDict();
})));
}, noopDataState = function(a, b, c) {

@@ -208,25 +209,25 @@ initDataState(a, b, c);

previousDependencies = null;
}, setNode = function(a, b, c, d) {
var e = (a = currentOptimisticKey ? a.optimistic[currentOptimisticKey] : a.base).get(b);
void 0 === e && a.set(b, e = makeDict());
void 0 !== d || currentOptimisticKey ? e[c] = d : delete e[c];
}, setNode = function(a, b, c, e) {
var d = (a = currentOptimisticKey ? a.optimistic[currentOptimisticKey] : a.base).get(b);
void 0 === d && a.set(b, d = makeDict());
void 0 !== e || currentOptimisticKey ? d[c] = e : delete d[c];
}, getNode = function(a, b, c) {
for (var d, e = 0, f = currentData.optimisticOrder.length; e < f; e++) {
var g = a.optimistic[currentData.optimisticOrder[e]];
if (g && void 0 !== (d = g.get(b)) && c in d) {
return d[c];
for (var e, d = 0, f = currentData.optimisticOrder.length; d < f; d++) {
var g = currentData.optimisticOrder[d], h = a.optimistic[g];
if (h && (!currentIgnoreOptimistic || currentData.commutativeKeys.has(g)) && void 0 !== (e = h.get(b)) && c in e) {
return e[c];
}
}
return void 0 !== (d = a.base.get(b)) ? d[c] : void 0;
}, updateRCForEntity = function(a, b, c, d) {
var e = void 0 !== b[c] ? b[c] : 0;
b = b[c] = e + d | 0;
void 0 !== a && (0 >= b ? a.add(c) : 0 >= e && 0 < b && a.delete(c));
}, updateRCForLink = function(a, b, c, d) {
return void 0 !== (e = a.base.get(b)) ? e[c] : void 0;
}, updateRCForEntity = function(a, b, c, e) {
var d = void 0 !== b[c] ? b[c] : 0;
b = b[c] = d + e | 0;
void 0 !== a && (0 >= b ? a.add(c) : 0 >= d && 0 < b && a.delete(c));
}, updateRCForLink = function(a, b, c, e) {
if ("string" == typeof c) {
updateRCForEntity(a, b, c, d);
updateRCForEntity(a, b, c, e);
} else if (Array.isArray(c)) {
for (var e = 0, f = c.length; e < f; e++) {
var g = c[e];
g && updateRCForEntity(a, b, g, d);
for (var d = 0, f = c.length; d < f; d++) {
var g = c[d];
g && updateRCForEntity(a, b, g, e);
}

@@ -236,43 +237,44 @@ }

if (void 0 !== c) {
for (var d in c) {
b.has(d) || (a.push(fieldInfoOfKey(d)), b.add(d));
for (var e in c) {
b.has(e) || (a.push(fieldInfoOfKey(e)), b.add(e));
}
}
}, extractNodeMapFields = function(a, b, c, d) {
extractNodeFields(a, b, d.base.get(c));
for (var e = 0, f = currentData.optimisticOrder.length; e < f; e++) {
var g = d.optimistic[currentData.optimisticOrder[e]];
}, extractNodeMapFields = function(a, b, c, e) {
extractNodeFields(a, b, e.base.get(c));
for (var d = 0, f = currentData.optimisticOrder.length; d < f; d++) {
var g = e.optimistic[currentData.optimisticOrder[d]];
void 0 !== g && extractNodeFields(a, b, g.get(c));
}
}, gc = function(a) {
a.gcScheduled = !1;
a.gcBatch.forEach((function(b) {
if (0 >= (a.refCount[b] || 0)) {
for (var c in a.refLock) {
var d = a.refLock[c];
if (0 < (d[b] || 0)) {
return;
}
delete d[b];
};
function _ref2$1(a, b, c) {
if (0 < (currentData.refCount[a] || 0)) {
c.delete(a);
} else {
for (var e in currentData.refLock) {
if (0 < ((b = currentData.refLock[e])[a] || 0)) {
return;
}
delete a.refCount[b];
a.gcBatch.delete(b);
if (void 0 !== (c = a.records.base.get(b)) && (a.records.base.delete(b), a.storage)) {
for (var e in c) {
c = prefixKey("r", joinKeys(b, e)), a.persistenceBatch[c] = void 0;
}
delete b[a];
}
delete currentData.refCount[a];
c.delete(a);
currentData.records.base.delete(a);
if (e = currentData.links.base.get(a)) {
currentData.links.base.delete(a);
for (var d in e) {
updateRCForLink(c, currentData.refCount, e[d], -1);
}
if (void 0 !== (e = a.links.base.get(b))) {
a.links.base.delete(b);
for (var f in e) {
a.storage && (c = prefixKey("l", joinKeys(b, f)), a.persistenceBatch[c] = void 0),
updateRCForLink(a.gcBatch, a.refCount, e[f], -1);
}
}
} else {
a.gcBatch.delete(b);
}
}));
}
}
var gc = function() {
currentData.gc.forEach(_ref2$1);
}, updateDependencies = function(a, b) {
"__typename" !== b && (a !== currentData.queryRootKey ? currentDependencies.add(a) : void 0 !== b && currentDependencies.add(joinKeys(a, b)));
}, updatePersist = function(a, b) {
currentData.storage && currentData.persist.add(function(a, b) {
return a + "\t" + b;
}(a, b));
}, readRecord = function(a, b) {

@@ -286,21 +288,20 @@ updateDependencies(a, b);

updateDependencies(a, b);
updatePersist(a, b);
setNode(currentData.records, a, b, c);
currentData.storage && !currentOptimisticKey && (a = prefixKey("r", joinKeys(a, b)),
currentData.persistenceBatch[a] = c);
}, writeLink = function(a, b, c) {
var d = currentData;
var e = currentData;
if (currentOptimisticKey) {
var e = d.refLock[currentOptimisticKey] || (d.refLock[currentOptimisticKey] = makeDict());
var f = d.links.optimistic[currentOptimisticKey];
var d = e.refLock[currentOptimisticKey] || (e.refLock[currentOptimisticKey] = makeDict());
var f = e.links.optimistic[currentOptimisticKey];
} else {
d.storage && (e = prefixKey("l", joinKeys(a, b)), d.persistenceBatch[e] = c);
e = d.refCount;
f = d.links.base;
var g = d.gcBatch;
d = e.refCount;
f = e.links.base;
var g = e.gc;
}
f = (f = f && f.get(a)) && f[b];
updateDependencies(a, b);
setNode(d.links, a, b, c);
updateRCForLink(g, e, f, -1);
updateRCForLink(g, e, c, 1);
updatePersist(a, b);
setNode(e.links, a, b, c);
updateRCForLink(g, d, f, -1);
updateRCForLink(g, d, c, 1);
}, reserveLayer = function(a, b) {

@@ -340,8 +341,25 @@ -1 === a.optimisticOrder.indexOf(b) && a.optimisticOrder.unshift(b);

}, inspectFields = function(a) {
var b = currentData.links, c = currentData.records, d = [], e = new Set;
var b = currentData.links, c = currentData.records, e = [], d = new Set;
updateDependencies(a);
extractNodeMapFields(d, e, a, b);
extractNodeMapFields(d, e, a, c);
return d;
}, makeContext = function(a, b, c, d, e, f) {
extractNodeMapFields(e, d, a, b);
extractNodeMapFields(e, d, a, c);
return e;
}, persistData = function() {
if (currentData.storage) {
var b = makeDict();
currentIgnoreOptimistic = !0;
currentData.persist.forEach((function a(a) {
var c = indexOfSeparator(a);
if (-1 < c) {
var d = a.slice(0, c);
c = a.slice(c + 1);
var f;
void 0 !== (f = readLink(d, c)) ? b[a] = ":" + core.stringifyVariables(f) : void 0 !== (f = readRecord(d, c)) ? b[a] = core.stringifyVariables(f) : b[a] = void 0;
}
}));
currentIgnoreOptimistic = !1;
currentData.storage.write(b);
currentData.persist.clear();
}
}, makeContext = function(a, b, c, e, d, f) {
return {

@@ -351,4 +369,4 @@ store: a,

fragments: c,
parentTypeName: d,
parentKey: e,
parentTypeName: e,
parentKey: d,
parentFieldKey: "",

@@ -359,16 +377,16 @@ fieldName: "",

};
}, updateContext = function(a, b, c, d, e) {
}, updateContext = function(a, b, c, e, d) {
a.parentTypeName = b;
a.parentKey = c;
a.parentFieldKey = d;
a.fieldName = e;
}, isFragmentHeuristicallyMatching = function(a, b, c, d) {
a.parentFieldKey = e;
a.fieldName = d;
}, isFragmentHeuristicallyMatching = function(a, b, c, e) {
if (!b) {
return !1;
}
var e = getTypeCondition(a);
if (b === e) {
var d = getTypeCondition(a);
if (b === d) {
return !0;
}
"production" !== process.env.NODE_ENV && warn("Heuristic Fragment Matching: A fragment is trying to match against the `" + b + "` type, but the type condition is `" + e + "`. Since GraphQL allows for interfaces `" + e + "` may be aninterface.\nA schema needs to be defined for this match to be deterministic, otherwise the fragment will be matched heuristically!", 16);
"production" !== process.env.NODE_ENV && warn("Heuristic Fragment Matching: A fragment is trying to match against the `" + b + "` type, but the type condition is `" + d + "`. Since GraphQL allows for interfaces `" + d + "` may be aninterface.\nA schema needs to be defined for this match to be deterministic, otherwise the fragment will be matched heuristically!", 16);
return !getSelectionSet(a).some((function(a) {

@@ -378,3 +396,3 @@ if (!isFieldNode(a)) {

}
a = keyOfField(getName(a), getFieldArguments(a, d));
a = keyOfField(getName(a), getFieldArguments(a, e));
return !function(a, b) {

@@ -384,6 +402,6 @@ return void 0 !== readRecord(a, b) || void 0 !== readLink(a, b);

}));
}, SelectionIterator = function(a, b, c, d) {
}, SelectionIterator = function(a, b, c, e) {
this.typename = a;
this.entityKey = b;
this.context = d;
this.context = e;
this.indexStack = [ 0 ];

@@ -413,4 +431,4 @@ this.selectionStack = [ c ];

return void 0 === a ? null : a;
}, write = function(a, b, c, d) {
initDataState(a.data, d || null);
}, write = function(a, b, c, e) {
initDataState(a.data, e || null);
a = startWrite(a, b, c);

@@ -420,32 +438,32 @@ clearDataState();

}, startWrite = function(a, b, c) {
var d = getMainOperation(b.query), e = {
var e = getMainOperation(b.query), d = {
data: c,
dependencies: getCurrentDependencies()
}, f = a.rootFields[d.operation];
a = makeContext(a, normalizeVariables(d, b.variables), getFragments(b.query), f, f);
"production" !== process.env.NODE_ENV && pushDebugNode(f, d);
writeSelection(a, f, getSelectionSet(d), c);
return e;
}, f = a.rootFields[e.operation];
a = makeContext(a, normalizeVariables(e, b.variables), getFragments(b.query), f, f);
"production" !== process.env.NODE_ENV && pushDebugNode(f, e);
writeSelection(a, f, getSelectionSet(e), c);
return d;
}, writeOptimistic = function(a, b, c) {
initDataState(a.data, c, !0);
c = getMainOperation(b.query);
var d = {
var e = {
data: {},
dependencies: getCurrentDependencies()
}, e = a.rootFields[c.operation];
invariant(e === a.rootFields.mutation, "production" !== process.env.NODE_ENV ? "writeOptimistic(...) was called with an operation that is not a mutation.\nThis case is unsupported and should never occur." : "", 10);
"production" !== process.env.NODE_ENV && pushDebugNode(e, c);
a = makeContext(a, normalizeVariables(c, b.variables), getFragments(b.query), e, e, !0);
writeSelection(a, e, getSelectionSet(c), d.data);
}, d = a.rootFields[c.operation];
invariant(d === a.rootFields.mutation, "production" !== process.env.NODE_ENV ? "writeOptimistic(...) was called with an operation that is not a mutation.\nThis case is unsupported and should never occur." : "", 10);
"production" !== process.env.NODE_ENV && pushDebugNode(d, c);
a = makeContext(a, normalizeVariables(c, b.variables), getFragments(b.query), d, d, !0);
writeSelection(a, d, getSelectionSet(c), e.data);
clearDataState();
return d;
}, writeSelection = function(a, b, c, d) {
var e = b === a.store.rootFields.query, f = !e && !!a.store.rootNames[b], g = f || e ? b : d.__typename;
return e;
}, writeSelection = function(a, b, c, e) {
var d = b === a.store.rootFields.query, f = !d && !!a.store.rootNames[b], g = f || d ? b : e.__typename;
if (g) {
f || e || !b || writeRecord(b, "__typename", g);
f || d || !b || writeRecord(b, "__typename", g);
c = new SelectionIterator(g, b || g, c, a);
for (var h; h = c.next(); ) {
var k = getName(h), m = getFieldArguments(h, a.variables);
e = keyOfField(k, m);
var n = getFieldAlias(h), l = d[n];
d = keyOfField(k, m);
var n = getFieldAlias(h), l = e[n];
if ("production" !== process.env.NODE_ENV) {

@@ -457,3 +475,3 @@ if (f || void 0 !== l) {

m = void 0 === h.selectionSet ? "scalar (number, boolean, etc)" : "selection set";
"production" !== process.env.NODE_ENV && warn("Invalid undefined: The field at `" + e + "` is `undefined`, but the GraphQL query expects a " + m + " for this field." + k, 13);
"production" !== process.env.NODE_ENV && warn("Invalid undefined: The field at `" + d + "` is `undefined`, but the GraphQL query expects a " + m + " for this field." + k, 13);
continue;

@@ -466,19 +484,19 @@ }

}
updateContext(a, g, g, e, k);
l = d[n] = ensureData(l(m || {}, a.store, a));
updateContext(a, g, g, d, k);
l = e[n] = ensureData(l(m || {}, a.store, a));
}
h.selectionSet ? b && !f ? (n = joinKeys(b, e), h = writeField(a, getSelectionSet(h), ensureData(l), n),
writeLink(b || g, e, h)) : writeField(a, getSelectionSet(h), ensureData(l)) : b && !f && writeRecord(b || g, e, l);
f && (updateContext(a, g, g, joinKeys(g, e), k), e = a.store.updates[g][k]) && (d[k] = l,
e(d, m || {}, a.store, a));
h.selectionSet ? b && !f ? (n = joinKeys(b, d), h = writeField(a, getSelectionSet(h), ensureData(l), n),
writeLink(b || g, d, h)) : writeField(a, getSelectionSet(h), ensureData(l)) : b && !f && writeRecord(b || g, d, l);
f && (updateContext(a, g, g, joinKeys(g, d), k), d = a.store.updates[g][k]) && (e[k] = l,
d(e, m || {}, a.store, a));
}
}
}, writeField = function(a, b, c, d) {
}, writeField = function(a, b, c, e) {
if (Array.isArray(c)) {
for (var e = Array(c.length), f = 0, g = c.length; f < g; f++) {
var h = c[f], k = d ? joinKeys(d, "" + f) : void 0;
for (var d = Array(c.length), f = 0, g = c.length; f < g; f++) {
var h = c[f], k = e ? joinKeys(e, "" + f) : void 0;
h = writeField(a, b, h, k);
e[f] = h;
d[f] = h;
}
return e;
return d;
}

@@ -488,7 +506,16 @@ if (null === c) {

}
e = a.store.keyOfEntity(c);
d = a.store.keyOfEntity(c);
f = c.__typename;
!d || void 0 !== a.store.keys[c.__typename] || null !== e || "string" != typeof f || f.endsWith("Connection") || f.endsWith("Edge") || "PageInfo" === f || "production" !== process.env.NODE_ENV && warn("Invalid key: The GraphQL query at the field at `" + d + "` has a selection set, but no key could be generated for the data at this field.\nYou have to request `id` or `_id` fields for all selection sets or create a custom `keys` config for `" + f + "`.\nEntities without keys will be embedded directly on the parent entity. If this is intentional, create a `keys` config for `" + f + "` that always returns null.", 15);
writeSelection(a, d = e || d, b, c);
return d || null;
!e || void 0 !== a.store.keys[c.__typename] || null !== d || "string" != typeof f || f.endsWith("Connection") || f.endsWith("Edge") || "PageInfo" === f || "production" !== process.env.NODE_ENV && warn("Invalid key: The GraphQL query at the field at `" + e + "` has a selection set, but no key could be generated for the data at this field.\nYou have to request `id` or `_id` fields for all selection sets or create a custom `keys` config for `" + f + "`.\nEntities without keys will be embedded directly on the parent entity. If this is intentional, create a `keys` config for `" + f + "` that always returns null.", 15);
writeSelection(a, e = d || e, b, c);
return e || null;
}, invalidateEntity = function(a, b, c) {
b = b ? [ {
fieldKey: keyOfField(b, c)
} ] : inspectFields(a);
c = 0;
for (var e = b.length; c < e; c++) {
var d = b[c].fieldKey;
readLink(a, d) ? writeLink(a, d, void 0) : writeRecord(a, d, void 0);
}
}, Store = function(a) {

@@ -505,3 +532,3 @@ var b;

};
var c = "Query", d = "Mutation", e = "Subscription";
var c = "Query", e = "Mutation", d = "Subscription";
if (a.schema) {

@@ -513,19 +540,18 @@ var f = this.schema = graphql.buildClientSchema(a.schema);

a && (c = a.name);
g && (d = g.name);
f && (e = f.name);
g && (e = g.name);
f && (d = f.name);
}
this.rootFields = {
query: c,
mutation: d,
subscription: e
mutation: e,
subscription: d
};
this.rootNames = ((b = {})[c] = "query", b[d] = "mutation", b[e] = "subscription",
this.rootNames = ((b = {})[c] = "query", b[e] = "mutation", b[d] = "subscription",
b);
this.data = function(a) {
return {
persistenceScheduled: !1,
persistenceBatch: makeDict(),
gcScheduled: !1,
defer: !1,
gc: new Set,
persist: new Set,
queryRootKey: a,
gcBatch: new Set,
refCount: makeDict(),

@@ -543,3 +569,3 @@ refLock: makeDict(),

Store.prototype.keyOfEntity = function(a) {
var b = a.__typename, c = a.id, d = a._id;
var b = a.__typename, c = a.id, e = a._id;
if (!b) {

@@ -551,5 +577,5 @@ return null;

}
var e;
this.keys[b] ? e = this.keys[b](a) : null != c ? e = "" + c : null != d && (e = "" + d);
return e ? b + ":" + e : null;
var d;
this.keys[b] ? d = this.keys[b](a) : null != c ? d = "" + c : null != e && (d = "" + e);
return d ? b + ":" + d : null;
};

@@ -573,8 +599,8 @@

read(a, b);
unforkDependencies();
c.forEach((function(b) {
b.startsWith(a.data.queryRootKey + ".") ? (b = b.slice((a.data.queryRootKey + ".").length),
writeLink(a.data.queryRootKey, b), writeRecord(a.data.queryRootKey, b)) : a.invalidate(b);
writeLink(a.data.queryRootKey, b), writeRecord(a.data.queryRootKey, b)) : invalidateEntity(b);
}));
unforkDependencies();
gc(a.data);
gc();
}(this, core.createRequest(a, b));

@@ -584,14 +610,5 @@ };

Store.prototype.invalidate = function(a, b, c) {
var d = "string" == typeof a ? a : this.keyOfEntity(a);
invariant(d, "production" !== process.env.NODE_ENV ? "object" == "Can't generate a key for invalidate(...).\nYou have to pass an id or _id field or create a custom `keys` field for `" + typeof a ? a.__typename : a + "`." : "", 19);
!function(a, b, c) {
b = b ? [ {
fieldKey: keyOfField(b, c)
} ] : inspectFields(a);
c = 0;
for (var d = b.length; c < d; c++) {
var e = b[c].fieldKey;
readLink(a, e) ? writeLink(a, e, void 0) : writeRecord(a, e, void 0);
}
}(d, b, c);
var e = "string" == typeof a ? a : this.keyOfEntity(a);
invariant(e, "production" !== process.env.NODE_ENV ? "object" == "Can't generate a key for invalidate(...).\nYou have to pass an id or _id field or create a custom `keys` field for `" + typeof a ? a.__typename : a + "`." : "", 19);
invalidateEntity(e, b, c);
};

@@ -617,9 +634,9 @@

Store.prototype.writeFragment = function(a, b, c) {
!function(a, b, c, d) {
!function(a, b, c, e) {
b = getFragments(b);
var e = Object.keys(b);
if (void 0 === (e = b[e[0]])) {
var d = Object.keys(b);
if (void 0 === (d = b[d[0]])) {
return "production" !== process.env.NODE_ENV ? warn("writeFragment(...) was called with an empty fragment.\nYou have to call it with at least one fragment in your GraphQL document.", 11) : void 0;
}
var f = getFragmentTypeName(e);
var f = getFragmentTypeName(d);
c = _rollupPluginBabelHelpers._extends({}, {

@@ -632,5 +649,5 @@ __typename: f

}
"production" !== process.env.NODE_ENV && pushDebugNode(f, e);
a = makeContext(a, d || {}, b, f, g);
writeSelection(a, g, getSelectionSet(e), c);
"production" !== process.env.NODE_ENV && pushDebugNode(f, d);
a = makeContext(a, e || {}, b, f, g);
writeSelection(a, g, getSelectionSet(d), c);
}(this, a, b, c);

@@ -645,7 +662,7 @@ };

}, read = function(a, b, c) {
var d = getMainOperation(b.query), e = a.rootFields[d.operation], f = getSelectionSet(d);
a = makeContext(a, normalizeVariables(d, b.variables), getFragments(b.query), e, e);
"production" !== process.env.NODE_ENV && pushDebugNode(e, d);
var e = getMainOperation(b.query), d = a.rootFields[e.operation], f = getSelectionSet(e);
a = makeContext(a, normalizeVariables(e, b.variables), getFragments(b.query), d, d);
"production" !== process.env.NODE_ENV && pushDebugNode(d, e);
c = c || {};
c = e !== a.store.rootFields.query ? readRoot(a, e, f, c) : readSelection(a, e, f, c);
c = d !== a.store.rootFields.query ? readRoot(a, d, f, c) : readSelection(a, d, f, c);
return {

@@ -656,11 +673,11 @@ dependencies: getCurrentDependencies(),

};
}, readRoot = function(a, b, c, d) {
if ("string" != typeof d.__typename) {
return d;
}, readRoot = function(a, b, c, e) {
if ("string" != typeof e.__typename) {
return e;
}
b = new SelectionIterator(b, b, c, a);
(c = {}).__typename = d.__typename;
for (var e; void 0 !== (e = b.next()); ) {
var f = getFieldAlias(e), g = d[f];
void 0 !== e.selectionSet && null !== g ? (g = ensureData(g), c[f] = readRootField(a, getSelectionSet(e), g)) : c[f] = g;
(c = {}).__typename = e.__typename;
for (var d; void 0 !== (d = b.next()); ) {
var f = getFieldAlias(d), g = e[f];
void 0 !== d.selectionSet && null !== g ? (g = ensureData(g), c[f] = readRootField(a, getSelectionSet(d), g)) : c[f] = g;
}

@@ -670,6 +687,6 @@ return c;

if (Array.isArray(c)) {
for (var d = Array(c.length), e = 0, f = c.length; e < f; e++) {
d[e] = readRootField(a, b, c[e]);
for (var e = Array(c.length), d = 0, f = c.length; d < f; d++) {
e[d] = readRootField(a, b, c[d]);
}
return d;
return e;
}

@@ -679,11 +696,11 @@ if (null === c) {

}
return null !== (d = a.store.keyOfEntity(c)) ? void 0 === (a = readSelection(a, d, b, {})) ? null : a : readRoot(a, c.__typename, b, c);
}, readFragment = function(a, b, c, d) {
return null !== (e = a.store.keyOfEntity(c)) ? void 0 === (a = readSelection(a, e, b, {})) ? null : a : readRoot(a, c.__typename, b, c);
}, readFragment = function(a, b, c, e) {
b = getFragments(b);
var e = Object.keys(b);
if (void 0 === (e = b[e[0]])) {
var d = Object.keys(b);
if (void 0 === (d = b[d[0]])) {
return "production" !== process.env.NODE_ENV && warn("readFragment(...) was called with an empty fragment.\nYou have to call it with at least one fragment in your GraphQL document.", 6),
null;
}
var f = getFragmentTypeName(e);
var f = getFragmentTypeName(d);
"string" == typeof c || c.__typename || (c.__typename = f);

@@ -696,14 +713,14 @@ if (!(c = "string" != typeof c ? a.keyOfEntity(_rollupPluginBabelHelpers._extends({}, {

}
"production" !== process.env.NODE_ENV && pushDebugNode(f, e);
a = makeContext(a, d || {}, b, f, c);
return readSelection(a, c, getSelectionSet(e), {}) || null;
}, readSelection = function(a, b, c, d, e) {
var f = a.store, g = b === f.rootFields.query, h = e && f.keyOfEntity(e) || b;
if ("string" != typeof (b = g ? b : readRecord(h, "__typename") || e && e.__typename) || e && b !== e.__typename) {
"production" !== process.env.NODE_ENV && pushDebugNode(f, d);
a = makeContext(a, e || {}, b, f, c);
return readSelection(a, c, getSelectionSet(d), {}) || null;
}, readSelection = function(a, b, c, e, d) {
var f = a.store, g = b === f.rootFields.query, h = d && f.keyOfEntity(d) || b;
if ("string" != typeof (b = g ? b : readRecord(h, "__typename") || d && d.__typename) || d && b !== d.__typename) {
"production" !== process.env.NODE_ENV && warn("Invalid resolver data: The resolver at `" + h + "` returned an invalid typename that could not be reconciled with the cache.", 8);
} else {
d.__typename = b;
e.__typename = b;
c = new SelectionIterator(b, h, c, a);
for (var k, m = !1, n = !1; void 0 !== (k = c.next()); ) {
var l = getName(k), q = getFieldArguments(k, a.variables), r = getFieldAlias(k), u = keyOfField(l, q), v = joinKeys(h, u), t = readRecord(h, u), w = e ? e[l] : void 0, x = f.resolvers[b];
var l = getName(k), q = getFieldArguments(k, a.variables), r = getFieldAlias(k), u = keyOfField(l, q), v = joinKeys(h, u), t = readRecord(h, u), w = d ? d[l] : void 0, x = f.resolvers[b];
"production" !== process.env.NODE_ENV && f.schema && b && isFieldAvailableOnType(f.schema, b, l);

@@ -714,4 +731,4 @@ var p = void 0;

} else if (x && "function" == typeof x[l]) {
if (updateContext(a, b, h, v, l), void 0 !== t && (d[r] = t), p = x[l](d, q || {}, f, a),
void 0 !== k.selectionSet && (p = resolveResolverResult(a, b, l, v, getSelectionSet(k), d[r] || {}, p)),
if (updateContext(a, b, h, v, l), void 0 !== t && (e[r] = t), p = x[l](e, q || {}, f, a),
void 0 !== k.selectionSet && (p = resolveResolverResult(a, b, l, v, getSelectionSet(k), e[r] || {}, p)),
f.schema && null === p && !isFieldNullable(f.schema, b, l)) {

@@ -721,6 +738,6 @@ return;

} else {
void 0 === k.selectionSet ? p = t : void 0 !== w ? p = resolveResolverResult(a, b, l, v, getSelectionSet(k), d[r], w) : void 0 !== (q = readLink(h, u)) ? p = resolveLink(a, q, b, l, getSelectionSet(k), d[r]) : "object" == typeof t && null !== t && (p = t);
void 0 === k.selectionSet ? p = t : void 0 !== w ? p = resolveResolverResult(a, b, l, v, getSelectionSet(k), e[r], w) : void 0 !== (q = readLink(h, u)) ? p = resolveLink(a, q, b, l, getSelectionSet(k), e[r]) : "object" == typeof t && null !== t && (p = t);
}
if (void 0 === p && f.schema && isFieldNullable(f.schema, b, l)) {
n = !0, d[r] = null;
n = !0, e[r] = null;
} else {

@@ -731,9 +748,9 @@ if (void 0 === p) {

m = !0;
d[r] = p;
e[r] = p;
}
}
n && (a.partial = !0);
return g && n && !m ? void 0 : d;
return g && n && !m ? void 0 : e;
}
}, resolveResolverResult = function(a, b, c, d, e, f, g) {
}, resolveResolverResult = function(a, b, c, e, d, f, g) {
if (Array.isArray(g)) {

@@ -743,3 +760,3 @@ var h = a.store;

for (var k = Array(g.length), m = 0, n = g.length; m < n; m++) {
var l = resolveResolverResult(a, b, c, joinKeys(d, "" + m), e, void 0 !== f ? f[m] : void 0, g[m]);
var l = resolveResolverResult(a, b, c, joinKeys(e, "" + m), d, void 0 !== f ? f[m] : void 0, g[m]);
if (void 0 !== l || h) {

@@ -757,11 +774,11 @@ k[m] = void 0 !== l ? l : null;

if (isDataOrKey(g)) {
return b = void 0 === f ? {} : f, "string" == typeof g ? readSelection(a, g, e, b) : readSelection(a, d, e, b, g);
return b = void 0 === f ? {} : f, "string" == typeof g ? readSelection(a, g, d, b) : readSelection(a, e, d, b, g);
}
"production" !== process.env.NODE_ENV && warn("Invalid resolver value: The field at `" + d + "` is a scalar (number, boolean, etc), but the GraphQL query expects a selection set for this field.", 9);
}, resolveLink = function(a, b, c, d, e, f) {
"production" !== process.env.NODE_ENV && warn("Invalid resolver value: The field at `" + e + "` is a scalar (number, boolean, etc), but the GraphQL query expects a selection set for this field.", 9);
}, resolveLink = function(a, b, c, e, d, f) {
if (Array.isArray(b)) {
var g = a.store;
g = g.schema && isListNullable(g.schema, c, d);
g = g.schema && isListNullable(g.schema, c, e);
for (var h = Array(b.length), k = 0, m = b.length; k < m; k++) {
var n = resolveLink(a, b[k], c, d, e, void 0 !== f ? f[k] : void 0);
var n = resolveLink(a, b[k], c, e, d, void 0 !== f ? f[k] : void 0);
if (void 0 !== n || g) {

@@ -775,3 +792,3 @@ h[k] = void 0 !== n ? n : null;

}
return null === b ? null : readSelection(a, b, e, void 0 === f ? {} : f);
return null === b ? null : readSelection(a, b, d, void 0 === f ? {} : f);
}, isDataOrKey = function(a) {

@@ -821,3 +838,3 @@ return "string" == typeof a || "object" == typeof a && "string" == typeof a.__typename;

return function(b) {
function d(a) {
function e(a) {
var b = a.operation, c = a.outcome;

@@ -835,16 +852,12 @@ a = {

}
var h, e = b.forward, f = b.client, g = new Store(a);
var h, d = b.forward, f = b.client, g = new Store(a);
a && a.storage && (h = a.storage.read().then((function c(b) {
!function(a, b, c) {
initDataState(a, null);
for (var d in c) {
var e = d.indexOf("."), f = d.slice(2, e);
e = d.slice(e + 1);
switch (d.charCodeAt(0)) {
case 108:
writeLink(f, e, c[d]);
break;
case 114:
writeRecord(f, e, c[d]);
for (var e in c) {
var d = c[e], f = indexOfSeparator(e);
if (d && -1 < f) {
var g = e.slice(0, f);
f = e.slice(f + 1);
":" === d[0] ? writeLink(g, f, JSON.parse(d.slice(1))) : writeRecord(g, f, JSON.parse(d));
}

@@ -862,3 +875,3 @@ }

b = 0;
for (var d = c.length; b < d; b++) {
for (var e = c.length; b < e; b++) {
a.add(c[b]);

@@ -911,8 +924,8 @@ }

}, t = function(a) {
var b = a.operation, c = a.error, d = a.extensions, e = b.key, f = new Set;
"mutation" === b.operationName ? (l(f, k.get(e)), k.delete(e)) : reserveLayer(g.data, b.key);
var b = a.operation, c = a.error, e = a.extensions, d = b.key, f = new Set;
"mutation" === b.operationName ? (l(f, k.get(d)), k.delete(d)) : reserveLayer(g.data, b.key);
if (a.data) {
if (e = write(g, b, a.data, e).dependencies, l(f, e), e = query(g, b, a.data), a.data = e.data,
if (d = write(g, b, a.data, d).dependencies, l(f, d), d = query(g, b, a.data), a.data = d.data,
"query" === b.operationName) {
var h = e.dependencies;
var h = d.dependencies;
l(f, h);

@@ -928,3 +941,3 @@ }

error: c,
extensions: d,
extensions: e,
operation: b

@@ -940,4 +953,4 @@ };

var c = wonka.map(_ref5)(wonka.filter(_ref6)(a));
a = wonka.map(d)(wonka.filter(_ref8)(a));
b = wonka.map(t)(e(wonka.map(r)(wonka.merge([ b, c ]))));
a = wonka.map(e)(wonka.filter(_ref8)(a));
b = wonka.map(t)(d(wonka.map(r)(wonka.merge([ b, c ]))));
return wonka.merge([ b, a ]);

@@ -944,0 +957,0 @@ };

@@ -1,2 +0,2 @@

"use strict";var e=require("./1cc90026.min.js"),t=require("graphql"),n=require("@urql/core"),r=require("wonka"),i=require("@urql/exchange-populate"),o=function(e){return e.name.value},a=function(e){return e.typeCondition.name.value},s=function(e){return e.alias?e.alias.value:o(e)},u=function(e){return e.selectionSet?e.selectionSet.selections:[]},c=function(e){return(e=e.typeCondition)?o(e):null},l=function(e){return e.kind===t.Kind.FIELD},f=function(e){return e.kind===t.Kind.INLINE_FRAGMENT},d=function(e,n){var r={},i=0;if(e.arguments&&e.arguments.length)for(var a=0,s=e.arguments.length;a<s;a++){var u=e.arguments[a],c=t.valueFromASTUntyped(u.value,n);null!=c&&(r[o(u)]=c,i++)}return 0<i?r:null},p=function(e,t){if(t&&e.variableDefinitions){for(var n={},r=0,i=e.variableDefinitions.length;r<i;r++){var a=o(e.variableDefinitions[r].variable);n[a]=t[a]}return n}},y=function(e,n){var r={};if(!n)return r;if(e.variableDefinitions)for(var i=0,a=e.variableDefinitions.length;i<a;i++){var s=e.variableDefinitions[i],u=o(s.variable);r[u]=void 0===n[u]&&s.defaultValue?t.valueFromASTUntyped(s.defaultValue,n):n[u]}for(var c in n)c in r||(r[c]=n[c]);return r};function v(e,t,n){if(!e)throw(e=Error((t||"Minfied Error #"+n+"\n")+"\nhttps://bit.ly/38yWDau#"+n)).name="Graphcache Error",e}var m=function(e){return e.kind===t.Kind.FRAGMENT_DEFINITION};function h(e){return e.kind===t.Kind.OPERATION_DEFINITION}var g=function(e){return v(!!(e=e.definitions.find(h)),"",1),e};function k(e,t){return e[o(t)]=t,e}var x=function(e){return e.definitions.filter(m).reduce(k,{})},b=function(e,n){var r=e.directives;if(!r)return!0;for(var i=0,a=r.length;i<a;i++){var s=r[i];if(("include"===(e=o(s))||"skip"===e)&&s.arguments&&s.arguments[0]&&"if"===o(s.arguments[0]))return n=t.valueFromASTUntyped(s.arguments[0].value,n),"include"===e?!!n:!n}return!0},_=function(e,n,r){return!!(e=S(e,n,r))&&t.isNullableType(e.type)},O=function(e,n,r){return!!(e=S(e,n,r))&&(e=t.isNonNullType(e.type)?e.type.ofType:e.type,t.isListType(e)&&t.isNullableType(e.ofType))},q=function(e,n,r){return!(!r||!n)&&(r===n||(n=e.getType(n),r=e.getType(r),n instanceof t.GraphQLObjectType?n===r:(function(e,n){v(e instanceof t.GraphQLInterfaceType||e instanceof t.GraphQLUnionType,"",5)}(n),w(r),e.isPossibleType(n,r))))},S=function(e,t,n){return w(e=e.getType(t)),e.getFields()[n]};function w(e,n){v(e instanceof t.GraphQLObjectType,"",3)}var E=function(){return Object.create(null)},N=function(e,t){return t?e+"("+n.stringifyVariables(t)+")":e},K=function(e){var t=e.indexOf("(");return-1<t?{fieldKey:e,fieldName:e.slice(0,t),arguments:JSON.parse(e.slice(t+1,-1))}:{fieldKey:e,fieldName:e,arguments:null}},T=function(e,t){return e+"."+t},F=function(e,t){return e+"|"+t},A="undefined"!=typeof Promise?Promise.prototype.then.bind(Promise.resolve()):function(e){return setTimeout(e,0)},L=null,B=null,M=null,P=null,D=function(){return{optimistic:E(),base:new Map}},R=function(e,t,n){L=e,M=B,B=new Set,t?n||1<e.optimisticOrder.length&&-1<e.optimisticOrder.indexOf(t)?(n||e.commutativeKeys.has(t)||(ie(e,t),e.commutativeKeys.add(t)),P=t,re(e,t)):(P=null,oe(e,t)):P=null},I=function(){var e=L,t=P;if(P=null,t&&-1<e.optimisticOrder.indexOf(t))for(t=e.optimisticOrder.length;0<=--t&&e.refLock[e.optimisticOrder[t]]&&e.commutativeKeys.has(e.optimisticOrder[t]);)ue(e.optimisticOrder[t]);B=L=null,!e.gcScheduled&&0<e.gcBatch.size&&(e.gcScheduled=!0,A((function(){X(e)}))),e.storage&&!e.persistenceScheduled&&(e.persistenceScheduled=!0,A((function(){e.storage.write(e.persistenceBatch),e.persistenceScheduled=!1,e.persistenceBatch=E()})))},C=function(e,t,n){R(e,t,n),I()},Q=function(){return v(null!==B,"",2),B},j=function(){return M=B,B=new Set},G=function(){B=M,M=null},U=function(e,t,n,r){var i=(e=P?e.optimistic[P]:e.base).get(t);void 0===i&&e.set(t,i=E()),void 0!==r||P?i[n]=r:delete i[n]},W=function(e,t,n){for(var r,i=0,o=L.optimisticOrder.length;i<o;i++){var a=e.optimistic[L.optimisticOrder[i]];if(a&&void 0!==(r=a.get(t))&&n in r)return r[n]}return void 0!==(r=e.base.get(t))?r[n]:void 0},V=function(e,t,n,r){var i=void 0!==t[n]?t[n]:0;t=t[n]=i+r|0,void 0!==e&&(0>=t?e.add(n):0>=i&&0<t&&e.delete(n))},z=function(e,t,n,r){if("string"==typeof n)V(e,t,n,r);else if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++){var a=n[i];a&&V(e,t,a,r)}},J=function(e,t,n){if(void 0!==n)for(var r in n)t.has(r)||(e.push(K(r)),t.add(r))},H=function(e,t,n,r){J(e,t,r.base.get(n));for(var i=0,o=L.optimisticOrder.length;i<o;i++){var a=r.optimistic[L.optimisticOrder[i]];void 0!==a&&J(e,t,a.get(n))}},X=function(e){e.gcScheduled=!1,e.gcBatch.forEach((function(t){if(0>=(e.refCount[t]||0)){for(var n in e.refLock){var r=e.refLock[n];if(0<(r[t]||0))return;delete r[t]}if(delete e.refCount[t],e.gcBatch.delete(t),void 0!==(n=e.records.base.get(t))&&(e.records.base.delete(t),e.storage))for(var i in n)n=F("r",T(t,i)),e.persistenceBatch[n]=void 0;if(void 0!==(i=e.links.base.get(t)))for(var o in e.links.base.delete(t),i)e.storage&&(n=F("l",T(t,o)),e.persistenceBatch[n]=void 0),z(e.gcBatch,e.refCount,i[o],-1)}else e.gcBatch.delete(t)}))},Y=function(e,t){"__typename"!==t&&(e!==L.queryRootKey?B.add(e):void 0!==t&&B.add(T(e,t)))},Z=function(e,t){return Y(e,t),W(L.records,e,t)},$=function(e,t){return Y(e,t),W(L.links,e,t)},ee=function(e,t,n){Y(e,t),U(L.records,e,t,n),L.storage&&!P&&(e=F("r",T(e,t)),L.persistenceBatch[e]=n)},te=function(e,t,n){var r=L;if(P)var i=r.refLock[P]||(r.refLock[P]=E()),o=r.links.optimistic[P];else{r.storage&&(i=F("l",T(e,t)),r.persistenceBatch[i]=n),i=r.refCount,o=r.links.base;var a=r.gcBatch}o=(o=o&&o.get(e))&&o[t],Y(e,t),U(r.links,e,t,n),z(a,i,o,-1),z(a,i,n,1)},ne=function(e,t){-1===e.optimisticOrder.indexOf(t)&&e.optimisticOrder.unshift(t),e.commutativeKeys.add(t)},re=function(e,t){-1===e.optimisticOrder.indexOf(t)&&e.optimisticOrder.unshift(t),e.refLock[t]||(e.refLock[t]=E(),e.links.optimistic[t]=new Map,e.records.optimistic[t]=new Map)},ie=function(e,t){e.refLock[t]&&(delete e.refLock[t],delete e.records.optimistic[t],delete e.links.optimistic[t])},oe=function(e,t){var n=e.optimisticOrder.indexOf(t);-1<n&&(e.optimisticOrder.splice(n,1),e.commutativeKeys.delete(t)),ie(e,t)};function ae(e,t){for(var n in e)te(t,n,e[n])}function se(e,t){for(var n in e)ee(t,n,e[n])}var ue=function(e){j();var t=L.links.optimistic[e];t&&t.forEach(ae),(t=L.records.optimistic[e])&&t.forEach(se),G(),oe(L,e)},ce=function(e){var t=L.links,n=L.records,r=[],i=new Set;return Y(e),H(r,i,e,t),H(r,i,e,n),r},le=function(e,t,n,r,i,o){return{store:e,variables:t,fragments:n,parentTypeName:r,parentKey:i,parentFieldKey:"",fieldName:"",partial:!1,optimistic:!!o}},fe=function(e,t,n,r,i){e.parentTypeName=t,e.parentKey=n,e.parentFieldKey=r,e.fieldName=i},de=function(e,t,n,r){return!(!t||t!==c(e)&&u(e).some((function(e){return!!l(e)&&(e=N(o(e),d(e,r)),!function(e,t){return void 0!==Z(e,t)||void 0!==$(e,t)}(n,e))})))},pe=function(e,t,n,r){this.typename=e,this.entityKey=t,this.context=r,this.indexStack=[0],this.selectionStack=[n]};pe.prototype.next=function(){for(;0!==this.indexStack.length;){var e=this.indexStack[this.indexStack.length-1]++,t=this.selectionStack[this.selectionStack.length-1];if(e>=t.length)this.indexStack.pop(),this.selectionStack.pop();else if(b(e=t[e],this.context.variables))if(l(e)){if("__typename"!==o(e))return e}else void 0!==(e=f(e)?e:this.context.fragments[o(e)])&&(this.context.store.schema?q(this.context.store.schema,c(e),this.typename):de(e,this.typename,this.entityKey,this.context.variables))&&(this.indexStack.push(0),this.selectionStack.push(u(e)))}};var ye=function(e){return void 0===e?null:e},ve=function(e,t,n,r){return R(e.data,r||null),e=me(e,t,n),I(),e},me=function(e,t,n){var r=g(t.query),i={data:n,dependencies:Q()},o=e.rootFields[r.operation];return e=le(e,y(r,t.variables),x(t.query),o,o),ge(e,o,u(r),n),i},he=function(e,t,n){R(e.data,n,!0),n=g(t.query);var r={data:{},dependencies:Q()},i=e.rootFields[n.operation];return v(i===e.rootFields.mutation,"",10),e=le(e,y(n,t.variables),x(t.query),i,i,!0),ge(e,i,u(n),r.data),I(),r},ge=function(e,t,n,r){var i=t===e.store.rootFields.query,a=!i&&!!e.store.rootNames[t],c=a||i?t:r.__typename;if(c){a||i||!t||ee(t,"__typename",c),n=new pe(c,t||c,n,e);for(var l;l=n.next();){i=o(l);var f=d(l,e.variables),p=N(i,f),y=s(l),v=r[y];if(e.optimistic&&a){if(!(v=e.store.optimisticMutations[i]))continue;fe(e,c,c,p,i),v=r[y]=ye(v(f||{},e.store,e))}l.selectionSet?t&&!a?(y=T(t,p),l=ke(e,u(l),ye(v),y),te(t||c,p,l)):ke(e,u(l),ye(v)):t&&!a&&ee(t||c,p,v),a&&(fe(e,c,c,T(c,p),i),p=e.store.updates[c][i])&&(r[i]=v,p(r,f||{},e.store,e))}}},ke=function(e,t,n,r){if(Array.isArray(n)){for(var i=Array(n.length),o=0,a=n.length;o<a;o++){var s=n[o],u=r?T(r,""+o):void 0;s=ke(e,t,s,u),i[o]=s}return i}return null===n?null:(i=e.store.keyOfEntity(n),o=n.__typename,!r||void 0!==e.store.keys[n.__typename]||null!==i||"string"!=typeof o||o.endsWith("Connection")||o.endsWith("Edge"),ge(e,r=i||r,t,n),r||null)},xe=function(e){var n;this.keyOfField=N,e||(e={}),this.resolvers=e.resolvers||{},this.optimisticMutations=e.optimistic||{},this.keys=e.keys||{},this.updates={Mutation:e.updates&&e.updates.Mutation||{},Subscription:e.updates&&e.updates.Subscription||{}};var r="Query",i="Mutation",o="Subscription";if(e.schema){var a=this.schema=t.buildClientSchema(e.schema);e=a.getQueryType();var s=a.getMutationType();a=a.getSubscriptionType(),e&&(r=e.name),s&&(i=s.name),a&&(o=a.name)}this.rootFields={query:r,mutation:i,subscription:o},this.rootNames=((n={})[r]="query",n[i]="mutation",n[o]="subscription",n),this.data=function(e){return{persistenceScheduled:!1,persistenceBatch:E(),gcScheduled:!1,queryRootKey:e,gcBatch:new Set,refCount:E(),refLock:E(),links:D(),records:D(),commutativeKeys:new Set,optimisticOrder:[],storage:null}}(r)};xe.prototype.keyOfEntity=function(e){var t,n=e.__typename,r=e.id,i=e._id;return n?void 0!==this.rootNames[n]?n:(this.keys[n]?t=this.keys[n](e):null!=r?t=""+r:null!=i&&(t=""+i),t?n+":"+t:null):null},xe.prototype.resolveFieldByKey=function(e,t){if(null===(e=null!==e&&"string"!=typeof e?this.keyOfEntity(e):e))return null;var n=Z(e,t);return void 0!==n?n:(t=$(e,t))?t:null},xe.prototype.resolve=function(e,t,n){return this.resolveFieldByKey(e,N(t,n))},xe.prototype.invalidateQuery=function(e,t){!function(e,t){var n=j();_e(e,t),n.forEach((function(t){t.startsWith(e.data.queryRootKey+".")?(t=t.slice((e.data.queryRootKey+".").length),te(e.data.queryRootKey,t),ee(e.data.queryRootKey,t)):e.invalidate(t)})),G(),X(e.data)}(this,n.createRequest(e,t))},xe.prototype.invalidate=function(e,t,n){v(e="string"==typeof e?e:this.keyOfEntity(e),"",19),function(e,t,n){t=t?[{fieldKey:N(t,n)}]:ce(e),n=0;for(var r=t.length;n<r;n++){var i=t[n].fieldKey;$(e,i)?te(e,i,void 0):ee(e,i,void 0)}}(e,t,n)},xe.prototype.inspectFields=function(e){return null!==(e=null!==e&&"string"!=typeof e?this.keyOfEntity(e):e)?ce(e):[]},xe.prototype.updateQuery=function(e,t){e=n.createRequest(e.query,e.variables),null!==(t=t(this.readQuery(e)))&&me(this,e,t)},xe.prototype.readQuery=function(e){return _e(this,n.createRequest(e.query,e.variables)).data},xe.prototype.readFragment=function(e,t,n){return Se(this,e,t,n)},xe.prototype.writeFragment=function(t,n,r){!function(t,n,r,i){n=x(n);var o=Object.keys(n);if(void 0!==(o=n[o[0]])){var s=a(o);r=e._extends({},{__typename:s},r);var c=t.keyOfEntity(r);c&&(t=le(t,i||{},n,s,c),ge(t,c,u(o),r))}}(this,t,n,r)};var be=function(e,t,n){return R(e.data,null),e=_e(e,t,n),I(),e},_e=function(e,t,n){var r=g(t.query),i=e.rootFields[r.operation],o=u(r);return n=n||{},n=i!==(e=le(e,y(r,t.variables),x(t.query),i,i)).store.rootFields.query?Oe(e,i,o,n):we(e,i,o,n),{dependencies:Q(),partial:void 0!==n&&e.partial,data:void 0===n?null:n}},Oe=function(e,t,n,r){if("string"!=typeof r.__typename)return r;t=new pe(t,t,n,e),(n={}).__typename=r.__typename;for(var i;void 0!==(i=t.next());){var o=s(i),a=r[o];void 0!==i.selectionSet&&null!==a?(a=ye(a),n[o]=qe(e,u(i),a)):n[o]=a}return n},qe=function(e,t,n){if(Array.isArray(n)){for(var r=Array(n.length),i=0,o=n.length;i<o;i++)r[i]=qe(e,t,n[i]);return r}return null===n?null:null!==(r=e.store.keyOfEntity(n))?void 0===(e=we(e,r,t,{}))?null:e:Oe(e,n.__typename,t,n)},Se=function(t,n,r,i){n=x(n);var o=Object.keys(n);if(void 0===(o=n[o[0]]))return null;var s=a(o);return"string"==typeof r||r.__typename||(r.__typename=s),(r="string"!=typeof r?t.keyOfEntity(e._extends({},{__typename:s},r)):r)?(t=le(t,i||{},n,s,r),we(t,r,u(o),{})||null):null},we=function(e,t,n,r,i){var a=e.store,c=t===a.rootFields.query,l=i&&a.keyOfEntity(i)||t;if(!("string"!=typeof(t=c?t:Z(l,"__typename")||i&&i.__typename)||i&&t!==i.__typename)){r.__typename=t,n=new pe(t,l,n,e);for(var f,p=!1,y=!1;void 0!==(f=n.next());){var v=o(f),m=d(f,e.variables),h=s(f),g=N(v,m),k=T(l,g),x=Z(l,g),b=i?i[v]:void 0,O=a.resolvers[t],q=void 0;if(void 0!==b&&void 0===f.selectionSet)q=b;else if(O&&"function"==typeof O[v]){if(fe(e,t,l,k,v),void 0!==x&&(r[h]=x),q=O[v](r,m||{},a,e),void 0!==f.selectionSet&&(q=Ee(e,t,v,k,u(f),r[h]||{},q)),a.schema&&null===q&&!_(a.schema,t,v))return}else void 0===f.selectionSet?q=x:void 0!==b?q=Ee(e,t,v,k,u(f),r[h],b):void 0!==(m=$(l,g))?q=Ne(e,m,t,v,u(f),r[h]):"object"==typeof x&&null!==x&&(q=x);if(void 0===q&&a.schema&&_(a.schema,t,v))y=!0,r[h]=null;else{if(void 0===q)return;p=!0,r[h]=q}}return y&&(e.partial=!0),c&&y&&!p?void 0:r}},Ee=function(e,t,n,r,i,o,a){if(Array.isArray(a)){var s=e.store;s=!s.schema||O(s.schema,t,n);for(var u=Array(a.length),c=0,l=a.length;c<l;c++){var f=Ee(e,t,n,T(r,""+c),i,void 0!==o?o[c]:void 0,a[c]);if(void 0===f&&!s)return;u[c]=void 0!==f?f:null}return u}return null==a?a:Ke(a)?(t=void 0===o?{}:o,"string"==typeof a?we(e,a,i,t):we(e,r,i,t,a)):void 0},Ne=function(e,t,n,r,i,o){if(Array.isArray(t)){var a=e.store;a=a.schema&&O(a.schema,n,r);for(var s=Array(t.length),u=0,c=t.length;u<c;u++){var l=Ne(e,t[u],n,r,i,void 0!==o?o[u]:void 0);if(void 0===l&&!a)return;s[u]=void 0!==l?l:null}return s}return null===t?null:we(e,t,i,void 0===o?{}:o)},Ke=function(e){return"string"==typeof e||"object"==typeof e&&"string"==typeof e.__typename},Te=function(t,n){return e._extends({},t,{context:e._extends({},t.context,{meta:e._extends({},t.context.meta,{cacheOutcome:n})})})},Fe=function(t,n){return e._extends({},t,{context:e._extends({},t.context,{requestPolicy:n})})};function Ae(e){return"query"===e.operationName&&"network-only"!==e.context.requestPolicy}function Le(e){return"query"!==e.operationName||"network-only"===e.context.requestPolicy}function Be(e){return Te(e.operation,"miss")}function Me(e){return"miss"===e.outcome&&"cache-only"!==e.operation.context.requestPolicy}function Pe(e){return"miss"!==e.outcome||"cache-only"===e.operation.context.requestPolicy}exports.populateExchange=i.populateExchange,exports.Store=xe,exports.cacheExchange=function(t){return function(i){function o(e){var t=e.operation,n=e.outcome;return e={operation:Te(t,n),data:e.data,error:e.error,extensions:e.extensions},("cache-and-network"===t.context.requestPolicy||"cache-first"===t.context.requestPolicy&&"partial"===n)&&(e.stale=!0,u.reexecuteOperation(Fe(t,"network-only"))),e}var a,s=i.forward,u=i.client,c=new xe(t);t&&t.storage&&(a=t.storage.read().then((function(e){!function(e,t,n){for(var r in R(e,null),n){var i=r.indexOf("."),o=r.slice(2,i);switch(i=r.slice(i+1),r.charCodeAt(0)){case 108:te(o,i,n[r]);break;case 114:ee(o,i,n[r])}}I(),e.storage=t}(c.data,t.storage,e)})));var l=new Map,f=new Map,d=E(),y=function(e,t){t&&t.forEach((function(t){var n=d[t];if(n){d[t]=[],t=0;for(var r=n.length;t<r;t++)e.add(n[t])}}))},v=function(e,t){t.forEach((function(t){if(t!==e.key){var n=f.get(t);n&&(f.delete(t),u.reexecuteOperation(Fe(n,"cache-first")))}}))},m=function(t){if("query"===t.operationName)ne(c.data,t.key);else if("teardown"===t.operationName)C(c.data,t.key);else if("mutation"===t.operationName)if("network-only"!==t.context.requestPolicy){var r=he(c,t,t.key).dependencies;if(0!==r.size){l.set(t.key,r);var i=new Set;y(i,r),v(t,i)}}else ne(c.data,t.key);return e._extends({},t,{variables:t.variables?p(g(t.query),t.variables):t.variables,query:n.formatDocument(t.query)})},h=function(e,t){t.forEach((function(t){(d[t]||(d[t]=[])).push(e.key),f.has(e.key)||f.set(e.key,"network-only"===e.context.requestPolicy?Fe(e,"cache-and-network"):e)}))},k=function(e){var t=be(c,e),n=t.data?t.partial?"partial":"hit":"miss";return t.data&&h(e,t.dependencies),{outcome:n,operation:e,data:t.data}},x=function(e){var t=e.operation,n=e.error,r=e.extensions,i=t.key,o=new Set;if("mutation"===t.operationName?(y(o,l.get(i)),l.delete(i)):ne(c.data,t.key),e.data){if(i=ve(c,t,e.data,i).dependencies,y(o,i),i=be(c,t,e.data),e.data=i.data,"query"===t.operationName){var a=i.dependencies;y(o,a)}}else C(c.data,t.key);return v(e.operation,o),a&&h(e.operation,a),{data:e.data,error:n,extensions:r,operation:t}};return function(e){e=r.share(e);var t=a?r.mergeMap(r.fromArray)(r.take(1)(r.buffer(r.fromPromise(a))(e))):r.empty;t=r.share(r.concat([t,e])),e=r.share(r.map(k)(r.filter(Ae)(t))),t=r.filter(Le)(t);var n=r.map(Be)(r.filter(Me)(e));return e=r.map(o)(r.filter(Pe)(e)),t=r.map(x)(s(r.map(m)(r.merge([t,n])))),r.merge([t,e])}}},exports.noopDataState=C,exports.query=be,exports.reserveLayer=ne,exports.write=ve,exports.writeOptimistic=he;
"use strict";var e=require("./1cc90026.min.js"),t=require("graphql"),n=require("@urql/core"),r=require("wonka"),i=require("@urql/exchange-populate"),o=function(e){return e.name.value},a=function(e){return e.typeCondition.name.value},u=function(e){return e.alias?e.alias.value:o(e)},s=function(e){return e.selectionSet?e.selectionSet.selections:[]},c=function(e){return(e=e.typeCondition)?o(e):null},l=function(e){return e.kind===t.Kind.FIELD},f=function(e){return e.kind===t.Kind.INLINE_FRAGMENT},d=function(e,n){var r={},i=0;if(e.arguments&&e.arguments.length)for(var a=0,u=e.arguments.length;a<u;a++){var s=e.arguments[a],c=t.valueFromASTUntyped(s.value,n);null!=c&&(r[o(s)]=c,i++)}return 0<i?r:null},p=function(e,t){if(t&&e.variableDefinitions){for(var n={},r=0,i=e.variableDefinitions.length;r<i;r++){var a=o(e.variableDefinitions[r].variable);n[a]=t[a]}return n}},y=function(e,n){var r={};if(!n)return r;if(e.variableDefinitions)for(var i=0,a=e.variableDefinitions.length;i<a;i++){var u=e.variableDefinitions[i],s=o(u.variable);r[s]=void 0===n[s]&&u.defaultValue?t.valueFromASTUntyped(u.defaultValue,n):n[s]}for(var c in n)c in r||(r[c]=n[c]);return r};function v(e,t,n){if(!e)throw(e=Error((t||"Minfied Error #"+n+"\n")+"\nhttps://bit.ly/38yWDau#"+n)).name="Graphcache Error",e}var m=function(e){return e.kind===t.Kind.FRAGMENT_DEFINITION};function h(e){return e.kind===t.Kind.OPERATION_DEFINITION}var g=function(e){return v(!!(e=e.definitions.find(h)),"",1),e};function k(e,t){return e[o(t)]=t,e}var x=function(e){return e.definitions.filter(m).reduce(k,{})},b=function(e,n){var r=e.directives;if(!r)return!0;for(var i=0,a=r.length;i<a;i++){var u=r[i];if(("include"===(e=o(u))||"skip"===e)&&u.arguments&&u.arguments[0]&&"if"===o(u.arguments[0]))return n=t.valueFromASTUntyped(u.arguments[0].value,n),"include"===e?!!n:!n}return!0},_=function(e,n,r){return!!(e=S(e,n,r))&&t.isNullableType(e.type)},O=function(e,n,r){return!!(e=S(e,n,r))&&(e=t.isNonNullType(e.type)?e.type.ofType:e.type,t.isListType(e)&&t.isNullableType(e.ofType))},q=function(e,n,r){return!(!r||!n)&&(r===n||(n=e.getType(n),r=e.getType(r),n instanceof t.GraphQLObjectType?n===r:(function(e,n){v(e instanceof t.GraphQLInterfaceType||e instanceof t.GraphQLUnionType,"",5)}(n),w(r),e.isPossibleType(n,r))))},S=function(e,t,n){return w(e=e.getType(t)),e.getFields()[n]};function w(e,n){v(e instanceof t.GraphQLObjectType,"",3)}var N=function(e,t){return t?e+"("+n.stringifyVariables(t)+")":e},E=function(e){var t=e.indexOf("(");return-1<t?{fieldKey:e,fieldName:e.slice(0,t),arguments:JSON.parse(e.slice(t+1,-1))}:{fieldKey:e,fieldName:e,arguments:null}},K=function(e,t){return e+"."+t},T=function(e){return e.indexOf("\t")},F=function(){return Object.create(null)},A="undefined"!=typeof Promise?Promise.prototype.then.bind(Promise.resolve()):function(e){return setTimeout(e,0)},L=null,M=null,P=null,D=null,R=!1,I=function(){return{optimistic:F(),base:new Map}},Q=function(e,t,n){L=e,P=M,M=new Set,R=!1,t?n||1<e.optimisticOrder.length&&-1<e.optimisticOrder.indexOf(t)?(n||e.commutativeKeys.has(t)||(ue(e,t),e.commutativeKeys.add(t)),D=t,ae(e,t)):(D=null,se(e,t)):D=null},C=function(){var e=L,t=D;if(D=null,t&&-1<e.optimisticOrder.indexOf(t))for(t=e.optimisticOrder.length;0<=--t&&e.refLock[e.optimisticOrder[t]]&&e.commutativeKeys.has(e.optimisticOrder[t]);)fe(e.optimisticOrder[t]);e.defer||(e.defer=!0,A((function(){Q(e,null),Z(),pe(),C(),e.defer=!1}))),M=L=null},j=function(e,t,n){Q(e,t,n),C()},G=function(){return v(null!==M,"",2),M},V=function(){return P=M,M=new Set},U=function(){M=P,P=null},W=function(e,t,n,r){var i=(e=D?e.optimistic[D]:e.base).get(t);void 0===i&&e.set(t,i=F()),void 0!==r||D?i[n]=r:delete i[n]},J=function(e,t,n){for(var r,i=0,o=L.optimisticOrder.length;i<o;i++){var a=L.optimisticOrder[i],u=e.optimistic[a];if(u&&(!R||L.commutativeKeys.has(a))&&void 0!==(r=u.get(t))&&n in r)return r[n]}return void 0!==(r=e.base.get(t))?r[n]:void 0},B=function(e,t,n,r){var i=void 0!==t[n]?t[n]:0;t=t[n]=i+r|0,void 0!==e&&(0>=t?e.add(n):0>=i&&0<t&&e.delete(n))},z=function(e,t,n,r){if("string"==typeof n)B(e,t,n,r);else if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++){var a=n[i];a&&B(e,t,a,r)}},H=function(e,t,n){if(void 0!==n)for(var r in n)t.has(r)||(e.push(E(r)),t.add(r))},X=function(e,t,n,r){H(e,t,r.base.get(n));for(var i=0,o=L.optimisticOrder.length;i<o;i++){var a=r.optimistic[L.optimisticOrder[i]];void 0!==a&&H(e,t,a.get(n))}};function Y(e,t,n){if(0<(L.refCount[e]||0))n.delete(e);else{for(var r in L.refLock){if(0<((t=L.refLock[r])[e]||0))return;delete t[e]}if(delete L.refCount[e],n.delete(e),L.records.base.delete(e),r=L.links.base.get(e))for(var i in L.links.base.delete(e),r)z(n,L.refCount,r[i],-1)}}var Z=function(){L.gc.forEach(Y)},$=function(e,t){"__typename"!==t&&(e!==L.queryRootKey?M.add(e):void 0!==t&&M.add(K(e,t)))},ee=function(e,t){L.storage&&L.persist.add(function(e,t){return e+"\t"+t}(e,t))},te=function(e,t){return $(e,t),J(L.records,e,t)},ne=function(e,t){return $(e,t),J(L.links,e,t)},re=function(e,t,n){$(e,t),ee(e,t),W(L.records,e,t,n)},ie=function(e,t,n){var r=L;if(D)var i=r.refLock[D]||(r.refLock[D]=F()),o=r.links.optimistic[D];else{i=r.refCount,o=r.links.base;var a=r.gc}o=(o=o&&o.get(e))&&o[t],$(e,t),ee(e,t),W(r.links,e,t,n),z(a,i,o,-1),z(a,i,n,1)},oe=function(e,t){-1===e.optimisticOrder.indexOf(t)&&e.optimisticOrder.unshift(t),e.commutativeKeys.add(t)},ae=function(e,t){-1===e.optimisticOrder.indexOf(t)&&e.optimisticOrder.unshift(t),e.refLock[t]||(e.refLock[t]=F(),e.links.optimistic[t]=new Map,e.records.optimistic[t]=new Map)},ue=function(e,t){e.refLock[t]&&(delete e.refLock[t],delete e.records.optimistic[t],delete e.links.optimistic[t])},se=function(e,t){var n=e.optimisticOrder.indexOf(t);-1<n&&(e.optimisticOrder.splice(n,1),e.commutativeKeys.delete(t)),ue(e,t)};function ce(e,t){for(var n in e)ie(t,n,e[n])}function le(e,t){for(var n in e)re(t,n,e[n])}var fe=function(e){V();var t=L.links.optimistic[e];t&&t.forEach(ce),(t=L.records.optimistic[e])&&t.forEach(le),U(),se(L,e)},de=function(e){var t=L.links,n=L.records,r=[],i=new Set;return $(e),X(r,i,e,t),X(r,i,e,n),r},pe=function(){if(L.storage){var e=F();R=!0,L.persist.forEach((function(t){var r=T(t);if(-1<r){var i,o=t.slice(0,r);r=t.slice(r+1),e[t]=void 0!==(i=ne(o,r))?":"+n.stringifyVariables(i):void 0!==(i=te(o,r))?n.stringifyVariables(i):void 0}})),R=!1,L.storage.write(e),L.persist.clear()}},ye=function(e,t,n,r,i,o){return{store:e,variables:t,fragments:n,parentTypeName:r,parentKey:i,parentFieldKey:"",fieldName:"",partial:!1,optimistic:!!o}},ve=function(e,t,n,r,i){e.parentTypeName=t,e.parentKey=n,e.parentFieldKey=r,e.fieldName=i},me=function(e,t,n,r){return!(!t||t!==c(e)&&s(e).some((function(e){return!!l(e)&&(e=N(o(e),d(e,r)),!function(e,t){return void 0!==te(e,t)||void 0!==ne(e,t)}(n,e))})))},he=function(e,t,n,r){this.typename=e,this.entityKey=t,this.context=r,this.indexStack=[0],this.selectionStack=[n]};he.prototype.next=function(){for(;0!==this.indexStack.length;){var e=this.indexStack[this.indexStack.length-1]++,t=this.selectionStack[this.selectionStack.length-1];if(e>=t.length)this.indexStack.pop(),this.selectionStack.pop();else if(b(e=t[e],this.context.variables))if(l(e)){if("__typename"!==o(e))return e}else void 0!==(e=f(e)?e:this.context.fragments[o(e)])&&(this.context.store.schema?q(this.context.store.schema,c(e),this.typename):me(e,this.typename,this.entityKey,this.context.variables))&&(this.indexStack.push(0),this.selectionStack.push(s(e)))}};var ge=function(e){return void 0===e?null:e},ke=function(e,t,n,r){return Q(e.data,r||null),e=xe(e,t,n),C(),e},xe=function(e,t,n){var r=g(t.query),i={data:n,dependencies:G()},o=e.rootFields[r.operation];return e=ye(e,y(r,t.variables),x(t.query),o,o),_e(e,o,s(r),n),i},be=function(e,t,n){Q(e.data,n,!0),n=g(t.query);var r={data:{},dependencies:G()},i=e.rootFields[n.operation];return v(i===e.rootFields.mutation,"",10),e=ye(e,y(n,t.variables),x(t.query),i,i,!0),_e(e,i,s(n),r.data),C(),r},_e=function(e,t,n,r){var i=t===e.store.rootFields.query,a=!i&&!!e.store.rootNames[t],c=a||i?t:r.__typename;if(c){a||i||!t||re(t,"__typename",c),n=new he(c,t||c,n,e);for(var l;l=n.next();){i=o(l);var f=d(l,e.variables),p=N(i,f),y=u(l),v=r[y];if(e.optimistic&&a){if(!(v=e.store.optimisticMutations[i]))continue;ve(e,c,c,p,i),v=r[y]=ge(v(f||{},e.store,e))}l.selectionSet?t&&!a?(y=K(t,p),l=Oe(e,s(l),ge(v),y),ie(t||c,p,l)):Oe(e,s(l),ge(v)):t&&!a&&re(t||c,p,v),a&&(ve(e,c,c,K(c,p),i),p=e.store.updates[c][i])&&(r[i]=v,p(r,f||{},e.store,e))}}},Oe=function(e,t,n,r){if(Array.isArray(n)){for(var i=Array(n.length),o=0,a=n.length;o<a;o++){var u=n[o],s=r?K(r,""+o):void 0;u=Oe(e,t,u,s),i[o]=u}return i}return null===n?null:(i=e.store.keyOfEntity(n),o=n.__typename,!r||void 0!==e.store.keys[n.__typename]||null!==i||"string"!=typeof o||o.endsWith("Connection")||o.endsWith("Edge"),_e(e,r=i||r,t,n),r||null)},qe=function(e,t,n){t=t?[{fieldKey:N(t,n)}]:de(e),n=0;for(var r=t.length;n<r;n++){var i=t[n].fieldKey;ne(e,i)?ie(e,i,void 0):re(e,i,void 0)}},Se=function(e){var n;this.keyOfField=N,e||(e={}),this.resolvers=e.resolvers||{},this.optimisticMutations=e.optimistic||{},this.keys=e.keys||{},this.updates={Mutation:e.updates&&e.updates.Mutation||{},Subscription:e.updates&&e.updates.Subscription||{}};var r="Query",i="Mutation",o="Subscription";if(e.schema){var a=this.schema=t.buildClientSchema(e.schema);e=a.getQueryType();var u=a.getMutationType();a=a.getSubscriptionType(),e&&(r=e.name),u&&(i=u.name),a&&(o=a.name)}this.rootFields={query:r,mutation:i,subscription:o},this.rootNames=((n={})[r]="query",n[i]="mutation",n[o]="subscription",n),this.data=function(e){return{defer:!1,gc:new Set,persist:new Set,queryRootKey:e,refCount:F(),refLock:F(),links:I(),records:I(),commutativeKeys:new Set,optimisticOrder:[],storage:null}}(r)};Se.prototype.keyOfEntity=function(e){var t,n=e.__typename,r=e.id,i=e._id;return n?void 0!==this.rootNames[n]?n:(this.keys[n]?t=this.keys[n](e):null!=r?t=""+r:null!=i&&(t=""+i),t?n+":"+t:null):null},Se.prototype.resolveFieldByKey=function(e,t){if(null===(e=null!==e&&"string"!=typeof e?this.keyOfEntity(e):e))return null;var n=te(e,t);return void 0!==n?n:(t=ne(e,t))?t:null},Se.prototype.resolve=function(e,t,n){return this.resolveFieldByKey(e,N(t,n))},Se.prototype.invalidateQuery=function(e,t){!function(e,t){var n=V();Ne(e,t),U(),n.forEach((function(t){t.startsWith(e.data.queryRootKey+".")?(t=t.slice((e.data.queryRootKey+".").length),ie(e.data.queryRootKey,t),re(e.data.queryRootKey,t)):qe(t)})),Z()}(this,n.createRequest(e,t))},Se.prototype.invalidate=function(e,t,n){v(e="string"==typeof e?e:this.keyOfEntity(e),"",19),qe(e,t,n)},Se.prototype.inspectFields=function(e){return null!==(e=null!==e&&"string"!=typeof e?this.keyOfEntity(e):e)?de(e):[]},Se.prototype.updateQuery=function(e,t){e=n.createRequest(e.query,e.variables),null!==(t=t(this.readQuery(e)))&&xe(this,e,t)},Se.prototype.readQuery=function(e){return Ne(this,n.createRequest(e.query,e.variables)).data},Se.prototype.readFragment=function(e,t,n){return Te(this,e,t,n)},Se.prototype.writeFragment=function(t,n,r){!function(t,n,r,i){n=x(n);var o=Object.keys(n);if(void 0!==(o=n[o[0]])){var u=a(o);r=e._extends({},{__typename:u},r);var c=t.keyOfEntity(r);c&&(t=ye(t,i||{},n,u,c),_e(t,c,s(o),r))}}(this,t,n,r)};var we=function(e,t,n){return Q(e.data,null),e=Ne(e,t,n),C(),e},Ne=function(e,t,n){var r=g(t.query),i=e.rootFields[r.operation],o=s(r);return n=n||{},n=i!==(e=ye(e,y(r,t.variables),x(t.query),i,i)).store.rootFields.query?Ee(e,i,o,n):Fe(e,i,o,n),{dependencies:G(),partial:void 0!==n&&e.partial,data:void 0===n?null:n}},Ee=function(e,t,n,r){if("string"!=typeof r.__typename)return r;t=new he(t,t,n,e),(n={}).__typename=r.__typename;for(var i;void 0!==(i=t.next());){var o=u(i),a=r[o];void 0!==i.selectionSet&&null!==a?(a=ge(a),n[o]=Ke(e,s(i),a)):n[o]=a}return n},Ke=function(e,t,n){if(Array.isArray(n)){for(var r=Array(n.length),i=0,o=n.length;i<o;i++)r[i]=Ke(e,t,n[i]);return r}return null===n?null:null!==(r=e.store.keyOfEntity(n))?void 0===(e=Fe(e,r,t,{}))?null:e:Ee(e,n.__typename,t,n)},Te=function(t,n,r,i){n=x(n);var o=Object.keys(n);if(void 0===(o=n[o[0]]))return null;var u=a(o);return"string"==typeof r||r.__typename||(r.__typename=u),(r="string"!=typeof r?t.keyOfEntity(e._extends({},{__typename:u},r)):r)?(t=ye(t,i||{},n,u,r),Fe(t,r,s(o),{})||null):null},Fe=function(e,t,n,r,i){var a=e.store,c=t===a.rootFields.query,l=i&&a.keyOfEntity(i)||t;if(!("string"!=typeof(t=c?t:te(l,"__typename")||i&&i.__typename)||i&&t!==i.__typename)){r.__typename=t,n=new he(t,l,n,e);for(var f,p=!1,y=!1;void 0!==(f=n.next());){var v=o(f),m=d(f,e.variables),h=u(f),g=N(v,m),k=K(l,g),x=te(l,g),b=i?i[v]:void 0,O=a.resolvers[t],q=void 0;if(void 0!==b&&void 0===f.selectionSet)q=b;else if(O&&"function"==typeof O[v]){if(ve(e,t,l,k,v),void 0!==x&&(r[h]=x),q=O[v](r,m||{},a,e),void 0!==f.selectionSet&&(q=Ae(e,t,v,k,s(f),r[h]||{},q)),a.schema&&null===q&&!_(a.schema,t,v))return}else void 0===f.selectionSet?q=x:void 0!==b?q=Ae(e,t,v,k,s(f),r[h],b):void 0!==(m=ne(l,g))?q=Le(e,m,t,v,s(f),r[h]):"object"==typeof x&&null!==x&&(q=x);if(void 0===q&&a.schema&&_(a.schema,t,v))y=!0,r[h]=null;else{if(void 0===q)return;p=!0,r[h]=q}}return y&&(e.partial=!0),c&&y&&!p?void 0:r}},Ae=function(e,t,n,r,i,o,a){if(Array.isArray(a)){var u=e.store;u=!u.schema||O(u.schema,t,n);for(var s=Array(a.length),c=0,l=a.length;c<l;c++){var f=Ae(e,t,n,K(r,""+c),i,void 0!==o?o[c]:void 0,a[c]);if(void 0===f&&!u)return;s[c]=void 0!==f?f:null}return s}return null==a?a:Me(a)?(t=void 0===o?{}:o,"string"==typeof a?Fe(e,a,i,t):Fe(e,r,i,t,a)):void 0},Le=function(e,t,n,r,i,o){if(Array.isArray(t)){var a=e.store;a=a.schema&&O(a.schema,n,r);for(var u=Array(t.length),s=0,c=t.length;s<c;s++){var l=Le(e,t[s],n,r,i,void 0!==o?o[s]:void 0);if(void 0===l&&!a)return;u[s]=void 0!==l?l:null}return u}return null===t?null:Fe(e,t,i,void 0===o?{}:o)},Me=function(e){return"string"==typeof e||"object"==typeof e&&"string"==typeof e.__typename},Pe=function(t,n){return e._extends({},t,{context:e._extends({},t.context,{meta:e._extends({},t.context.meta,{cacheOutcome:n})})})},De=function(t,n){return e._extends({},t,{context:e._extends({},t.context,{requestPolicy:n})})};function Re(e){return"query"===e.operationName&&"network-only"!==e.context.requestPolicy}function Ie(e){return"query"!==e.operationName||"network-only"===e.context.requestPolicy}function Qe(e){return Pe(e.operation,"miss")}function Ce(e){return"miss"===e.outcome&&"cache-only"!==e.operation.context.requestPolicy}function je(e){return"miss"!==e.outcome||"cache-only"===e.operation.context.requestPolicy}exports.populateExchange=i.populateExchange,exports.Store=Se,exports.cacheExchange=function(t){return function(i){function o(e){var t=e.operation,n=e.outcome;return e={operation:Pe(t,n),data:e.data,error:e.error,extensions:e.extensions},("cache-and-network"===t.context.requestPolicy||"cache-first"===t.context.requestPolicy&&"partial"===n)&&(e.stale=!0,s.reexecuteOperation(De(t,"network-only"))),e}var a,u=i.forward,s=i.client,c=new Se(t);t&&t.storage&&(a=t.storage.read().then((function(e){!function(e,t,n){for(var r in Q(e,null),n){var i=n[r],o=T(r);if(i&&-1<o){var a=r.slice(0,o);o=r.slice(o+1),":"===i[0]?ie(a,o,JSON.parse(i.slice(1))):re(a,o,JSON.parse(i))}}C(),e.storage=t}(c.data,t.storage,e)})));var l=new Map,f=new Map,d=F(),y=function(e,t){t&&t.forEach((function(t){var n=d[t];if(n){d[t]=[],t=0;for(var r=n.length;t<r;t++)e.add(n[t])}}))},v=function(e,t){t.forEach((function(t){if(t!==e.key){var n=f.get(t);n&&(f.delete(t),s.reexecuteOperation(De(n,"cache-first")))}}))},m=function(t){if("query"===t.operationName)oe(c.data,t.key);else if("teardown"===t.operationName)j(c.data,t.key);else if("mutation"===t.operationName)if("network-only"!==t.context.requestPolicy){var r=be(c,t,t.key).dependencies;if(0!==r.size){l.set(t.key,r);var i=new Set;y(i,r),v(t,i)}}else oe(c.data,t.key);return e._extends({},t,{variables:t.variables?p(g(t.query),t.variables):t.variables,query:n.formatDocument(t.query)})},h=function(e,t){t.forEach((function(t){(d[t]||(d[t]=[])).push(e.key),f.has(e.key)||f.set(e.key,"network-only"===e.context.requestPolicy?De(e,"cache-and-network"):e)}))},k=function(e){var t=we(c,e),n=t.data?t.partial?"partial":"hit":"miss";return t.data&&h(e,t.dependencies),{outcome:n,operation:e,data:t.data}},x=function(e){var t=e.operation,n=e.error,r=e.extensions,i=t.key,o=new Set;if("mutation"===t.operationName?(y(o,l.get(i)),l.delete(i)):oe(c.data,t.key),e.data){if(i=ke(c,t,e.data,i).dependencies,y(o,i),i=we(c,t,e.data),e.data=i.data,"query"===t.operationName){var a=i.dependencies;y(o,a)}}else j(c.data,t.key);return v(e.operation,o),a&&h(e.operation,a),{data:e.data,error:n,extensions:r,operation:t}};return function(e){e=r.share(e);var t=a?r.mergeMap(r.fromArray)(r.take(1)(r.buffer(r.fromPromise(a))(e))):r.empty;t=r.share(r.concat([t,e])),e=r.share(r.map(k)(r.filter(Re)(t))),t=r.filter(Ie)(t);var n=r.map(Qe)(r.filter(Ce)(e));return e=r.map(o)(r.filter(je)(e)),t=r.map(x)(u(r.map(m)(r.merge([t,n])))),r.merge([t,e])}}},exports.noopDataState=j,exports.query=we,exports.reserveLayer=oe,exports.write=ke,exports.writeOptimistic=be;
//# sourceMappingURL=urql-exchange-graphcache.min.js.map

@@ -9,6 +9,6 @@ {

"dependencies": {
"@urql/core": ">=1.10.5",
"@urql/exchange-populate": ">=0.1.3",
"@urql/core": ">=1.10.8",
"@urql/exchange-populate": ">=0.1.4",
"wonka": "^4.0.9"
}
}
{
"name": "@urql/exchange-graphcache",
"version": "2.3.0",
"version": "2.3.1",
"description": "A normalized and configurable cache exchange for urql",

@@ -60,11 +60,11 @@ "sideEffects": false,

"dependencies": {
"@urql/core": ">=1.10.5",
"@urql/exchange-populate": ">=0.1.3",
"@urql/core": ">=1.10.8",
"@urql/exchange-populate": ">=0.1.4",
"wonka": "^4.0.9"
},
"peerDependencies": {
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0"
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"
},
"devDependencies": {
"graphql": "^14.5.8",
"graphql": "^15.0.0",
"graphql-tag": "^2.10.1"

@@ -71,0 +71,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc