@cedarjs/web 7.0.0-canary.3259 → 7.0.0-rc.123

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/apollo/index.js +1 -0
  2. package/apollo/package.json +5 -0
  3. package/dist/apollo/ApolloProviderWithFetchConfig.d.ts +3 -9
  4. package/dist/apollo/ApolloProviderWithFetchConfig.d.ts.map +1 -1
  5. package/dist/apollo/ApolloProviderWithFetchConfig.js +37 -60
  6. package/dist/apollo/CedarApolloProvider.d.ts +0 -1
  7. package/dist/apollo/CedarApolloProvider.d.ts.map +1 -1
  8. package/dist/apollo/CedarApolloProvider.js +6 -13
  9. package/dist/apollo/apolloLinkTypes.d.ts +4 -9
  10. package/dist/apollo/apolloLinkTypes.d.ts.map +1 -1
  11. package/dist/apollo/fragmentRegistry.d.ts +3 -3
  12. package/dist/apollo/fragmentRegistry.d.ts.map +1 -1
  13. package/dist/apollo/fragmentRegistry.js +8 -35
  14. package/dist/apollo/index.d.ts +0 -4
  15. package/dist/apollo/index.d.ts.map +1 -1
  16. package/dist/apollo/index.js +1 -3
  17. package/dist/apollo/links.d.ts +5 -6
  18. package/dist/apollo/links.d.ts.map +1 -1
  19. package/dist/apollo/links.js +9 -14
  20. package/dist/apollo/sseLink.d.ts +8 -5
  21. package/dist/apollo/sseLink.d.ts.map +1 -1
  22. package/dist/apollo/sseLink.js +12 -9
  23. package/dist/apollo/suspense.d.ts +3 -5
  24. package/dist/apollo/suspense.d.ts.map +1 -1
  25. package/dist/apollo/suspense.js +7 -35
  26. package/dist/apollo/useCache.d.ts +6 -4
  27. package/dist/apollo/useCache.d.ts.map +1 -1
  28. package/dist/apollo/useCache.js +1 -1
  29. package/dist/bundled/apollo-upload-client.d.ts +2 -2
  30. package/dist/bundled/apollo-upload-client.d.ts.map +1 -1
  31. package/dist/bundled/apollo-upload-client.js +1685 -1513
  32. package/dist/components/DevFatalErrorPage.d.ts +3 -3
  33. package/dist/components/DevFatalErrorPage.d.ts.map +1 -1
  34. package/dist/components/DevFatalErrorPage.js +49 -66
  35. package/dist/components/FatalErrorBoundary.d.ts +1 -1
  36. package/dist/components/cell/CellErrorBoundary.d.ts +3 -3
  37. package/dist/components/cell/CellErrorBoundary.d.ts.map +1 -1
  38. package/dist/components/cell/cellTypes.d.ts +18 -51
  39. package/dist/components/cell/cellTypes.d.ts.map +1 -1
  40. package/dist/components/cell/createCell.d.ts +1 -2
  41. package/dist/components/cell/createCell.d.ts.map +1 -1
  42. package/dist/components/cell/createCell.js +60 -65
  43. package/dist/components/cell/createFragmentCell.d.ts +1 -2
  44. package/dist/components/cell/createFragmentCell.d.ts.map +1 -1
  45. package/dist/components/cell/createFragmentCell.js +2 -4
  46. package/dist/components/cell/createServerCell.d.ts +2 -3
  47. package/dist/components/cell/createServerCell.d.ts.map +1 -1
  48. package/dist/components/cell/createServerCell.js +2 -4
  49. package/dist/components/cell/createSuspendingCell.d.ts +1 -2
  50. package/dist/components/cell/createSuspendingCell.d.ts.map +1 -1
  51. package/dist/components/cell/createSuspendingCell.js +34 -37
  52. package/dist/index.d.ts +2 -3
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +5 -2
  55. package/dist/server/middleware.d.ts +1 -1
  56. package/dist/server/middleware.d.ts.map +1 -1
  57. package/package.json +26 -20
  58. package/toast/index.js +1 -0
  59. package/toast/package.json +5 -0
  60. package/dist/apollo/ApolloClientFactoryContext.d.ts +0 -26
  61. package/dist/apollo/ApolloClientFactoryContext.d.ts.map +0 -1
  62. package/dist/apollo/ApolloClientFactoryContext.js +0 -5
  63. package/dist/apollo/parsedScalars.d.ts +0 -36
  64. package/dist/apollo/parsedScalars.d.ts.map +0 -1
  65. package/dist/apollo/parsedScalars.js +0 -75
  66. package/dist/apollo/typeOverrides.d.ts +0 -8
  67. package/dist/apollo/typeOverrides.d.ts.map +0 -1
  68. package/dist/apollo/typeOverrides.js +0 -0
  69. package/dist/apollo/useCreateApolloClient.d.ts +0 -11
  70. package/dist/apollo/useCreateApolloClient.d.ts.map +0 -1
  71. package/dist/apollo/useCreateApolloClient.js +0 -14
@@ -16,34 +16,16 @@ function __extends(d, b) {
16
16
  }
17
17
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18
18
  }
19
- function __values(o) {
20
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
21
- if (m) return m.call(o);
22
- if (o && typeof o.length === "number") return {
23
- next: function() {
24
- if (o && i >= o.length) o = void 0;
25
- return { value: o && o[i++], done: !o };
19
+ var __assign = function() {
20
+ __assign = Object.assign || function __assign2(t) {
21
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
22
+ s = arguments[i];
23
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
26
24
  }
25
+ return t;
27
26
  };
28
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
29
- }
30
- function __read(o, n) {
31
- var m = typeof Symbol === "function" && o[Symbol.iterator];
32
- if (!m) return o;
33
- var i = m.call(o), r, ar = [], e;
34
- try {
35
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
36
- } catch (error) {
37
- e = { error };
38
- } finally {
39
- try {
40
- if (r && !r.done && (m = i["return"])) m.call(i);
41
- } finally {
42
- if (e) throw e.error;
43
- }
44
- }
45
- return ar;
46
- }
27
+ return __assign.apply(this, arguments);
28
+ };
47
29
  function __spreadArray(to, from, pack) {
48
30
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
49
31
  if (ar || !(i in from)) {
@@ -54,552 +36,174 @@ function __spreadArray(to, from, pack) {
54
36
  return to.concat(ar || Array.prototype.slice.call(from));
55
37
  }
56
38
 
57
- // ../../node_modules/rxjs/dist/esm5/internal/util/isFunction.js
58
- function isFunction(value) {
59
- return typeof value === "function";
60
- }
61
-
62
- // ../../node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js
63
- function createErrorClass(createImpl) {
64
- var _super = function(instance) {
65
- Error.call(instance);
66
- instance.stack = new Error().stack;
67
- };
68
- var ctorFunc = createImpl(_super);
69
- ctorFunc.prototype = Object.create(Error.prototype);
70
- ctorFunc.prototype.constructor = ctorFunc;
71
- return ctorFunc;
72
- }
73
-
74
- // ../../node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js
75
- var UnsubscriptionError = createErrorClass(function(_super) {
76
- return function UnsubscriptionErrorImpl(errors) {
77
- _super(this);
78
- this.message = errors ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function(err, i) {
79
- return i + 1 + ") " + err.toString();
80
- }).join("\n ") : "";
81
- this.name = "UnsubscriptionError";
82
- this.errors = errors;
83
- };
84
- });
85
-
86
- // ../../node_modules/rxjs/dist/esm5/internal/util/arrRemove.js
87
- function arrRemove(arr, item) {
88
- if (arr) {
89
- var index = arr.indexOf(item);
90
- 0 <= index && arr.splice(index, 1);
91
- }
92
- }
93
-
94
- // ../../node_modules/rxjs/dist/esm5/internal/Subscription.js
95
- var Subscription = (function() {
96
- function Subscription2(initialTeardown) {
97
- this.initialTeardown = initialTeardown;
98
- this.closed = false;
99
- this._parentage = null;
100
- this._finalizers = null;
101
- }
102
- Subscription2.prototype.unsubscribe = function() {
103
- var e_1, _a, e_2, _b;
104
- var errors;
105
- if (!this.closed) {
106
- this.closed = true;
107
- var _parentage = this._parentage;
108
- if (_parentage) {
109
- this._parentage = null;
110
- if (Array.isArray(_parentage)) {
111
- try {
112
- for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {
113
- var parent_1 = _parentage_1_1.value;
114
- parent_1.remove(this);
115
- }
116
- } catch (e_1_1) {
117
- e_1 = { error: e_1_1 };
118
- } finally {
119
- try {
120
- if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);
121
- } finally {
122
- if (e_1) throw e_1.error;
123
- }
124
- }
125
- } else {
126
- _parentage.remove(this);
127
- }
128
- }
129
- var initialFinalizer = this.initialTeardown;
130
- if (isFunction(initialFinalizer)) {
131
- try {
132
- initialFinalizer();
133
- } catch (e) {
134
- errors = e instanceof UnsubscriptionError ? e.errors : [e];
135
- }
136
- }
137
- var _finalizers = this._finalizers;
138
- if (_finalizers) {
139
- this._finalizers = null;
140
- try {
141
- for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {
142
- var finalizer = _finalizers_1_1.value;
143
- try {
144
- execFinalizer(finalizer);
145
- } catch (err) {
146
- errors = errors !== null && errors !== void 0 ? errors : [];
147
- if (err instanceof UnsubscriptionError) {
148
- errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));
149
- } else {
150
- errors.push(err);
151
- }
152
- }
153
- }
154
- } catch (e_2_1) {
155
- e_2 = { error: e_2_1 };
156
- } finally {
157
- try {
158
- if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);
159
- } finally {
160
- if (e_2) throw e_2.error;
161
- }
162
- }
163
- }
164
- if (errors) {
165
- throw new UnsubscriptionError(errors);
166
- }
167
- }
168
- };
169
- Subscription2.prototype.add = function(teardown) {
170
- var _a;
171
- if (teardown && teardown !== this) {
172
- if (this.closed) {
173
- execFinalizer(teardown);
174
- } else {
175
- if (teardown instanceof Subscription2) {
176
- if (teardown.closed || teardown._hasParent(this)) {
177
- return;
178
- }
179
- teardown._addParent(this);
180
- }
181
- (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
39
+ // ../../node_modules/ts-invariant/lib/invariant.js
40
+ var genericMessage = "Invariant Violation";
41
+ var _a = Object.setPrototypeOf;
42
+ var setPrototypeOf = _a === void 0 ? function(obj, proto) {
43
+ obj.__proto__ = proto;
44
+ return obj;
45
+ } : _a;
46
+ var InvariantError = (
47
+ /** @class */
48
+ (function(_super) {
49
+ __extends(InvariantError2, _super);
50
+ function InvariantError2(message) {
51
+ if (message === void 0) {
52
+ message = genericMessage;
182
53
  }
54
+ var _this = _super.call(this, typeof message === "number" ? genericMessage + ": " + message + " (see https://github.com/apollographql/invariant-packages)" : message) || this;
55
+ _this.framesToPop = 1;
56
+ _this.name = genericMessage;
57
+ setPrototypeOf(_this, InvariantError2.prototype);
58
+ return _this;
183
59
  }
184
- };
185
- Subscription2.prototype._hasParent = function(parent) {
186
- var _parentage = this._parentage;
187
- return _parentage === parent || Array.isArray(_parentage) && _parentage.includes(parent);
188
- };
189
- Subscription2.prototype._addParent = function(parent) {
190
- var _parentage = this._parentage;
191
- this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
192
- };
193
- Subscription2.prototype._removeParent = function(parent) {
194
- var _parentage = this._parentage;
195
- if (_parentage === parent) {
196
- this._parentage = null;
197
- } else if (Array.isArray(_parentage)) {
198
- arrRemove(_parentage, parent);
199
- }
200
- };
201
- Subscription2.prototype.remove = function(teardown) {
202
- var _finalizers = this._finalizers;
203
- _finalizers && arrRemove(_finalizers, teardown);
204
- if (teardown instanceof Subscription2) {
205
- teardown._removeParent(this);
60
+ return InvariantError2;
61
+ })(Error)
62
+ );
63
+ function invariant(condition, message) {
64
+ if (!condition) {
65
+ throw new InvariantError(message);
66
+ }
67
+ }
68
+ var verbosityLevels = ["debug", "log", "warn", "error", "silent"];
69
+ var verbosityLevel = verbosityLevels.indexOf("log");
70
+ function wrapConsoleMethod(name) {
71
+ return function() {
72
+ if (verbosityLevels.indexOf(name) >= verbosityLevel) {
73
+ var method = console[name] || console.log;
74
+ return method.apply(console, arguments);
206
75
  }
207
76
  };
208
- Subscription2.EMPTY = (function() {
209
- var empty = new Subscription2();
210
- empty.closed = true;
211
- return empty;
212
- })();
213
- return Subscription2;
214
- })();
215
- var EMPTY_SUBSCRIPTION = Subscription.EMPTY;
216
- function isSubscription(value) {
217
- return value instanceof Subscription || value && "closed" in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe);
218
- }
219
- function execFinalizer(finalizer) {
220
- if (isFunction(finalizer)) {
221
- finalizer();
222
- } else {
223
- finalizer.unsubscribe();
224
- }
225
77
  }
78
+ (function(invariant4) {
79
+ invariant4.debug = wrapConsoleMethod("debug");
80
+ invariant4.log = wrapConsoleMethod("log");
81
+ invariant4.warn = wrapConsoleMethod("warn");
82
+ invariant4.error = wrapConsoleMethod("error");
83
+ })(invariant || (invariant = {}));
226
84
 
227
- // ../../node_modules/rxjs/dist/esm5/internal/config.js
228
- var config = {
229
- onUnhandledError: null,
230
- onStoppedNotification: null,
231
- Promise: void 0,
232
- useDeprecatedSynchronousErrorHandling: false,
233
- useDeprecatedNextContext: false
234
- };
235
-
236
- // ../../node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js
237
- var timeoutProvider = {
238
- setTimeout: function(handler, timeout) {
239
- var args = [];
240
- for (var _i = 2; _i < arguments.length; _i++) {
241
- args[_i - 2] = arguments[_i];
242
- }
243
- var delegate = timeoutProvider.delegate;
244
- if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
245
- return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));
246
- }
247
- return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));
248
- },
249
- clearTimeout: function(handle) {
250
- var delegate = timeoutProvider.delegate;
251
- return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
252
- },
253
- delegate: void 0
254
- };
85
+ // ../../node_modules/@apollo/client/version.js
86
+ var version = "3.14.1";
255
87
 
256
- // ../../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js
257
- function reportUnhandledError(err) {
258
- timeoutProvider.setTimeout(function() {
259
- var onUnhandledError = config.onUnhandledError;
260
- if (onUnhandledError) {
261
- onUnhandledError(err);
262
- } else {
263
- throw err;
264
- }
265
- });
88
+ // ../../node_modules/@apollo/client/utilities/globals/maybe.js
89
+ function maybe(thunk) {
90
+ try {
91
+ return thunk();
92
+ } catch (_a3) {
93
+ }
266
94
  }
267
95
 
268
- // ../../node_modules/rxjs/dist/esm5/internal/util/noop.js
269
- function noop() {
270
- }
96
+ // ../../node_modules/@apollo/client/utilities/globals/global.js
97
+ var global_default = maybe(function() {
98
+ return globalThis;
99
+ }) || maybe(function() {
100
+ return window;
101
+ }) || maybe(function() {
102
+ return self;
103
+ }) || maybe(function() {
104
+ return global;
105
+ }) || // We don't expect the Function constructor ever to be invoked at runtime, as
106
+ // long as at least one of globalThis, window, self, or global is defined, so
107
+ // we are under no obligation to make it easy for static analysis tools to
108
+ // detect syntactic usage of the Function constructor. If you think you can
109
+ // improve your static analysis to detect this obfuscation, think again. This
110
+ // is an arms race you cannot win, at least not in JavaScript.
111
+ maybe(function() {
112
+ return maybe.constructor("return this")();
113
+ });
271
114
 
272
- // ../../node_modules/rxjs/dist/esm5/internal/NotificationFactories.js
273
- var COMPLETE_NOTIFICATION = (function() {
274
- return createNotification("C", void 0, void 0);
275
- })();
276
- function errorNotification(error) {
277
- return createNotification("E", void 0, error);
278
- }
279
- function nextNotification(value) {
280
- return createNotification("N", value, void 0);
281
- }
282
- function createNotification(kind, value, error) {
283
- return {
284
- kind,
285
- value,
286
- error
287
- };
115
+ // ../../node_modules/@apollo/client/utilities/common/makeUniqueId.js
116
+ var prefixCounts = /* @__PURE__ */ new Map();
117
+ function makeUniqueId(prefix) {
118
+ var count = prefixCounts.get(prefix) || 1;
119
+ prefixCounts.set(prefix, count + 1);
120
+ return "".concat(prefix, ":").concat(count, ":").concat(Math.random().toString(36).slice(2));
288
121
  }
289
122
 
290
- // ../../node_modules/rxjs/dist/esm5/internal/util/errorContext.js
291
- var context = null;
292
- function errorContext(cb) {
293
- if (config.useDeprecatedSynchronousErrorHandling) {
294
- var isRoot = !context;
295
- if (isRoot) {
296
- context = { errorThrown: false, error: null };
297
- }
298
- cb();
299
- if (isRoot) {
300
- var _a = context, errorThrown = _a.errorThrown, error = _a.error;
301
- context = null;
302
- if (errorThrown) {
303
- throw error;
304
- }
305
- }
306
- } else {
307
- cb();
308
- }
309
- }
310
- function captureError(err) {
311
- if (config.useDeprecatedSynchronousErrorHandling && context) {
312
- context.errorThrown = true;
313
- context.error = err;
123
+ // ../../node_modules/@apollo/client/utilities/common/stringifyForDisplay.js
124
+ function stringifyForDisplay(value, space) {
125
+ if (space === void 0) {
126
+ space = 0;
314
127
  }
128
+ var undefId = makeUniqueId("stringifyForDisplay");
129
+ return JSON.stringify(value, function(key, value2) {
130
+ return value2 === void 0 ? undefId : value2;
131
+ }, space).split(JSON.stringify(undefId)).join("<undefined>");
315
132
  }
316
133
 
317
- // ../../node_modules/rxjs/dist/esm5/internal/Subscriber.js
318
- var Subscriber = (function(_super) {
319
- __extends(Subscriber2, _super);
320
- function Subscriber2(destination) {
321
- var _this = _super.call(this) || this;
322
- _this.isStopped = false;
323
- if (destination) {
324
- _this.destination = destination;
325
- if (isSubscription(destination)) {
326
- destination.add(_this);
327
- }
328
- } else {
329
- _this.destination = EMPTY_OBSERVER;
330
- }
331
- return _this;
332
- }
333
- Subscriber2.create = function(next, error, complete) {
334
- return new SafeSubscriber(next, error, complete);
335
- };
336
- Subscriber2.prototype.next = function(value) {
337
- if (this.isStopped) {
338
- handleStoppedNotification(nextNotification(value), this);
339
- } else {
340
- this._next(value);
341
- }
342
- };
343
- Subscriber2.prototype.error = function(err) {
344
- if (this.isStopped) {
345
- handleStoppedNotification(errorNotification(err), this);
346
- } else {
347
- this.isStopped = true;
348
- this._error(err);
349
- }
350
- };
351
- Subscriber2.prototype.complete = function() {
352
- if (this.isStopped) {
353
- handleStoppedNotification(COMPLETE_NOTIFICATION, this);
354
- } else {
355
- this.isStopped = true;
356
- this._complete();
357
- }
358
- };
359
- Subscriber2.prototype.unsubscribe = function() {
360
- if (!this.closed) {
361
- this.isStopped = true;
362
- _super.prototype.unsubscribe.call(this);
363
- this.destination = null;
364
- }
365
- };
366
- Subscriber2.prototype._next = function(value) {
367
- this.destination.next(value);
368
- };
369
- Subscriber2.prototype._error = function(err) {
370
- try {
371
- this.destination.error(err);
372
- } finally {
373
- this.unsubscribe();
374
- }
375
- };
376
- Subscriber2.prototype._complete = function() {
377
- try {
378
- this.destination.complete();
379
- } finally {
380
- this.unsubscribe();
381
- }
382
- };
383
- return Subscriber2;
384
- })(Subscription);
385
- var _bind = Function.prototype.bind;
386
- function bind(fn, thisArg) {
387
- return _bind.call(fn, thisArg);
388
- }
389
- var ConsumerObserver = (function() {
390
- function ConsumerObserver2(partialObserver) {
391
- this.partialObserver = partialObserver;
392
- }
393
- ConsumerObserver2.prototype.next = function(value) {
394
- var partialObserver = this.partialObserver;
395
- if (partialObserver.next) {
396
- try {
397
- partialObserver.next(value);
398
- } catch (error) {
399
- handleUnhandledError(error);
400
- }
401
- }
402
- };
403
- ConsumerObserver2.prototype.error = function(err) {
404
- var partialObserver = this.partialObserver;
405
- if (partialObserver.error) {
406
- try {
407
- partialObserver.error(err);
408
- } catch (error) {
409
- handleUnhandledError(error);
410
- }
411
- } else {
412
- handleUnhandledError(err);
134
+ // ../../node_modules/@apollo/client/utilities/globals/invariantWrappers.js
135
+ function wrap(fn) {
136
+ return function(message) {
137
+ var args = [];
138
+ for (var _i = 1; _i < arguments.length; _i++) {
139
+ args[_i - 1] = arguments[_i];
413
140
  }
414
- };
415
- ConsumerObserver2.prototype.complete = function() {
416
- var partialObserver = this.partialObserver;
417
- if (partialObserver.complete) {
418
- try {
419
- partialObserver.complete();
420
- } catch (error) {
421
- handleUnhandledError(error);
141
+ if (typeof message === "number") {
142
+ var arg0 = message;
143
+ message = getHandledErrorMsg(arg0);
144
+ if (!message) {
145
+ message = getFallbackErrorMsg(arg0, args);
146
+ args = [];
422
147
  }
423
148
  }
149
+ fn.apply(void 0, [message].concat(args));
424
150
  };
425
- return ConsumerObserver2;
426
- })();
427
- var SafeSubscriber = (function(_super) {
428
- __extends(SafeSubscriber2, _super);
429
- function SafeSubscriber2(observerOrNext, error, complete) {
430
- var _this = _super.call(this) || this;
431
- var partialObserver;
432
- if (isFunction(observerOrNext) || !observerOrNext) {
433
- partialObserver = {
434
- next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : void 0,
435
- error: error !== null && error !== void 0 ? error : void 0,
436
- complete: complete !== null && complete !== void 0 ? complete : void 0
437
- };
438
- } else {
439
- var context_1;
440
- if (_this && config.useDeprecatedNextContext) {
441
- context_1 = Object.create(observerOrNext);
442
- context_1.unsubscribe = function() {
443
- return _this.unsubscribe();
444
- };
445
- partialObserver = {
446
- next: observerOrNext.next && bind(observerOrNext.next, context_1),
447
- error: observerOrNext.error && bind(observerOrNext.error, context_1),
448
- complete: observerOrNext.complete && bind(observerOrNext.complete, context_1)
449
- };
450
- } else {
451
- partialObserver = observerOrNext;
452
- }
453
- }
454
- _this.destination = new ConsumerObserver(partialObserver);
455
- return _this;
151
+ }
152
+ var invariant2 = Object.assign(function invariant3(condition, message) {
153
+ var args = [];
154
+ for (var _i = 2; _i < arguments.length; _i++) {
155
+ args[_i - 2] = arguments[_i];
456
156
  }
457
- return SafeSubscriber2;
458
- })(Subscriber);
459
- function handleUnhandledError(error) {
460
- if (config.useDeprecatedSynchronousErrorHandling) {
461
- captureError(error);
462
- } else {
463
- reportUnhandledError(error);
157
+ if (!condition) {
158
+ invariant(condition, getHandledErrorMsg(message, args) || getFallbackErrorMsg(message, args));
464
159
  }
160
+ }, {
161
+ debug: wrap(invariant.debug),
162
+ log: wrap(invariant.log),
163
+ warn: wrap(invariant.warn),
164
+ error: wrap(invariant.error)
165
+ });
166
+ function newInvariantError(message) {
167
+ var optionalParams = [];
168
+ for (var _i = 1; _i < arguments.length; _i++) {
169
+ optionalParams[_i - 1] = arguments[_i];
170
+ }
171
+ return new InvariantError(getHandledErrorMsg(message, optionalParams) || getFallbackErrorMsg(message, optionalParams));
465
172
  }
466
- function defaultErrorHandler(err) {
467
- throw err;
468
- }
469
- function handleStoppedNotification(notification, subscriber) {
470
- var onStoppedNotification = config.onStoppedNotification;
471
- onStoppedNotification && timeoutProvider.setTimeout(function() {
472
- return onStoppedNotification(notification, subscriber);
473
- });
474
- }
475
- var EMPTY_OBSERVER = {
476
- closed: true,
477
- next: noop,
478
- error: defaultErrorHandler,
479
- complete: noop
480
- };
481
-
482
- // ../../node_modules/rxjs/dist/esm5/internal/symbol/observable.js
483
- var observable = (function() {
484
- return typeof Symbol === "function" && Symbol.observable || "@@observable";
485
- })();
486
-
487
- // ../../node_modules/rxjs/dist/esm5/internal/util/identity.js
488
- function identity(x) {
489
- return x;
490
- }
491
-
492
- // ../../node_modules/rxjs/dist/esm5/internal/util/pipe.js
493
- function pipeFromArray(fns) {
494
- if (fns.length === 0) {
495
- return identity;
496
- }
497
- if (fns.length === 1) {
498
- return fns[0];
499
- }
500
- return function piped(input) {
501
- return fns.reduce(function(prev, fn) {
502
- return fn(prev);
503
- }, input);
504
- };
505
- }
506
-
507
- // ../../node_modules/rxjs/dist/esm5/internal/Observable.js
508
- var Observable = (function() {
509
- function Observable2(subscribe) {
510
- if (subscribe) {
511
- this._subscribe = subscribe;
512
- }
513
- }
514
- Observable2.prototype.lift = function(operator) {
515
- var observable2 = new Observable2();
516
- observable2.source = this;
517
- observable2.operator = operator;
518
- return observable2;
519
- };
520
- Observable2.prototype.subscribe = function(observerOrNext, error, complete) {
521
- var _this = this;
522
- var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
523
- errorContext(function() {
524
- var _a = _this, operator = _a.operator, source = _a.source;
525
- subscriber.add(operator ? operator.call(subscriber, source) : source ? _this._subscribe(subscriber) : _this._trySubscribe(subscriber));
526
- });
527
- return subscriber;
528
- };
529
- Observable2.prototype._trySubscribe = function(sink) {
530
- try {
531
- return this._subscribe(sink);
532
- } catch (err) {
533
- sink.error(err);
534
- }
535
- };
536
- Observable2.prototype.forEach = function(next, promiseCtor) {
537
- var _this = this;
538
- promiseCtor = getPromiseCtor(promiseCtor);
539
- return new promiseCtor(function(resolve, reject) {
540
- var subscriber = new SafeSubscriber({
541
- next: function(value) {
542
- try {
543
- next(value);
544
- } catch (err) {
545
- reject(err);
546
- subscriber.unsubscribe();
547
- }
548
- },
549
- error: reject,
550
- complete: resolve
551
- });
552
- _this.subscribe(subscriber);
553
- });
554
- };
555
- Observable2.prototype._subscribe = function(subscriber) {
556
- var _a;
557
- return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
558
- };
559
- Observable2.prototype[observable] = function() {
560
- return this;
561
- };
562
- Observable2.prototype.pipe = function() {
563
- var operations = [];
564
- for (var _i = 0; _i < arguments.length; _i++) {
565
- operations[_i] = arguments[_i];
566
- }
567
- return pipeFromArray(operations)(this);
568
- };
569
- Observable2.prototype.toPromise = function(promiseCtor) {
570
- var _this = this;
571
- promiseCtor = getPromiseCtor(promiseCtor);
572
- return new promiseCtor(function(resolve, reject) {
573
- var value;
574
- _this.subscribe(function(x) {
575
- return value = x;
576
- }, function(err) {
577
- return reject(err);
578
- }, function() {
579
- return resolve(value);
580
- });
581
- });
582
- };
583
- Observable2.create = function(subscribe) {
584
- return new Observable2(subscribe);
585
- };
586
- return Observable2;
587
- })();
588
- function getPromiseCtor(promiseCtor) {
589
- var _a;
590
- return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
173
+ var ApolloErrorMessageHandler = /* @__PURE__ */ Symbol.for("ApolloErrorMessageHandler_" + version);
174
+ function stringify(arg) {
175
+ if (typeof arg == "string") {
176
+ return arg;
177
+ }
178
+ try {
179
+ return stringifyForDisplay(arg, 2).slice(0, 1e3);
180
+ } catch (_a3) {
181
+ return "<non-serializable>";
182
+ }
591
183
  }
592
- function isObserver(value) {
593
- return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
184
+ function getHandledErrorMsg(message, messageArgs) {
185
+ if (messageArgs === void 0) {
186
+ messageArgs = [];
187
+ }
188
+ if (!message)
189
+ return;
190
+ return global_default[ApolloErrorMessageHandler] && global_default[ApolloErrorMessageHandler](message, messageArgs.map(stringify));
594
191
  }
595
- function isSubscriber(value) {
596
- return value && value instanceof Subscriber || isObserver(value) && isSubscription(value);
192
+ function getFallbackErrorMsg(message, messageArgs) {
193
+ if (messageArgs === void 0) {
194
+ messageArgs = [];
195
+ }
196
+ if (!message)
197
+ return;
198
+ return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
199
+ version,
200
+ message,
201
+ args: messageArgs.map(stringify)
202
+ })));
597
203
  }
598
204
 
599
- // ../../node_modules/rxjs/dist/esm5/internal/observable/empty.js
600
- var EMPTY = new Observable(function(subscriber) {
601
- return subscriber.complete();
602
- });
205
+ // ../../node_modules/@apollo/client/utilities/globals/index.js
206
+ var DEV = globalThis.__DEV__ !== false;
603
207
 
604
208
  // ../../node_modules/graphql/jsutils/devAssert.mjs
605
209
  function devAssert(condition, message) {
@@ -788,16 +392,16 @@ function printBlockString(value, options) {
788
392
  const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash;
789
393
  const printAsMultipleLines = !(options !== null && options !== void 0 && options.minimize) && // add leading and trailing new lines only if it improves readability
790
394
  (!isSingleLine || value.length > 70 || forceTrailingNewline || forceLeadingNewLine || hasTrailingTripleQuotes);
791
- let result = "";
395
+ let result2 = "";
792
396
  const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0));
793
397
  if (printAsMultipleLines && !skipLeadingNewLine || forceLeadingNewLine) {
794
- result += "\n";
398
+ result2 += "\n";
795
399
  }
796
- result += escapedValue;
400
+ result2 += escapedValue;
797
401
  if (printAsMultipleLines || forceTrailingNewline) {
798
- result += "\n";
402
+ result2 += "\n";
799
403
  }
800
- return '"""' + result + '"""';
404
+ return '"""' + result2 + '"""';
801
405
  }
802
406
 
803
407
  // ../../node_modules/graphql/jsutils/inspect.mjs
@@ -1061,17 +665,17 @@ var escapeSequences = [
1061
665
 
1062
666
  // ../../node_modules/graphql/language/visitor.mjs
1063
667
  var BREAK = Object.freeze({});
1064
- function visit(root, visitor, visitorKeys = QueryDocumentKeys) {
668
+ function visit(root2, visitor, visitorKeys = QueryDocumentKeys) {
1065
669
  const enterLeaveMap = /* @__PURE__ */ new Map();
1066
670
  for (const kind of Object.values(Kind)) {
1067
671
  enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));
1068
672
  }
1069
673
  let stack = void 0;
1070
- let inArray = Array.isArray(root);
1071
- let keys = [root];
674
+ let inArray = Array.isArray(root2);
675
+ let keys = [root2];
1072
676
  let index = -1;
1073
677
  let edits = [];
1074
- let node = root;
678
+ let node = root2;
1075
679
  let key = void 0;
1076
680
  let parent = void 0;
1077
681
  const path = [];
@@ -1117,25 +721,25 @@ function visit(root, visitor, visitorKeys = QueryDocumentKeys) {
1117
721
  }
1118
722
  path.push(key);
1119
723
  }
1120
- let result;
724
+ let result2;
1121
725
  if (!Array.isArray(node)) {
1122
726
  var _enterLeaveMap$get, _enterLeaveMap$get2;
1123
727
  isNode(node) || devAssert(false, `Invalid AST Node: ${inspect(node)}.`);
1124
728
  const visitFn = isLeaving ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get === void 0 ? void 0 : _enterLeaveMap$get.leave : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get2 === void 0 ? void 0 : _enterLeaveMap$get2.enter;
1125
- result = visitFn === null || visitFn === void 0 ? void 0 : visitFn.call(visitor, node, key, parent, path, ancestors);
1126
- if (result === BREAK) {
729
+ result2 = visitFn === null || visitFn === void 0 ? void 0 : visitFn.call(visitor, node, key, parent, path, ancestors);
730
+ if (result2 === BREAK) {
1127
731
  break;
1128
732
  }
1129
- if (result === false) {
733
+ if (result2 === false) {
1130
734
  if (!isLeaving) {
1131
735
  path.pop();
1132
736
  continue;
1133
737
  }
1134
- } else if (result !== void 0) {
1135
- edits.push([key, result]);
738
+ } else if (result2 !== void 0) {
739
+ edits.push([key, result2]);
1136
740
  if (!isLeaving) {
1137
- if (isNode(result)) {
1138
- node = result;
741
+ if (isNode(result2)) {
742
+ node = result2;
1139
743
  } else {
1140
744
  path.pop();
1141
745
  continue;
@@ -1143,7 +747,7 @@ function visit(root, visitor, visitorKeys = QueryDocumentKeys) {
1143
747
  }
1144
748
  }
1145
749
  }
1146
- if (result === void 0 && isEdited) {
750
+ if (result2 === void 0 && isEdited) {
1147
751
  edits.push([key, node]);
1148
752
  }
1149
753
  if (isLeaving) {
@@ -1170,7 +774,7 @@ function visit(root, visitor, visitorKeys = QueryDocumentKeys) {
1170
774
  if (edits.length !== 0) {
1171
775
  return edits[edits.length - 1][1];
1172
776
  }
1173
- return root;
777
+ return root2;
1174
778
  }
1175
779
  function getEnterLeaveForKind(visitor, kind) {
1176
780
  const kindVisitor = visitor[kind];
@@ -1206,8 +810,8 @@ var printDocASTReducer = {
1206
810
  },
1207
811
  OperationDefinition: {
1208
812
  leave(node) {
1209
- const varDefs = hasMultilineItems(node.variableDefinitions) ? wrap("(\n", join(node.variableDefinitions, "\n"), "\n)") : wrap("(", join(node.variableDefinitions, ", "), ")");
1210
- const prefix = wrap("", node.description, "\n") + join(
813
+ const varDefs = hasMultilineItems(node.variableDefinitions) ? wrap2("(\n", join(node.variableDefinitions, "\n"), "\n)") : wrap2("(", join(node.variableDefinitions, ", "), ")");
814
+ const prefix = wrap2("", node.description, "\n") + join(
1211
815
  [
1212
816
  node.operation,
1213
817
  join([node.name, varDefs]),
@@ -1219,17 +823,17 @@ var printDocASTReducer = {
1219
823
  }
1220
824
  },
1221
825
  VariableDefinition: {
1222
- leave: ({ variable, type, defaultValue, directives, description }) => wrap("", description, "\n") + variable + ": " + type + wrap(" = ", defaultValue) + wrap(" ", join(directives, " "))
826
+ leave: ({ variable, type, defaultValue, directives, description }) => wrap2("", description, "\n") + variable + ": " + type + wrap2(" = ", defaultValue) + wrap2(" ", join(directives, " "))
1223
827
  },
1224
828
  SelectionSet: {
1225
829
  leave: ({ selections }) => block(selections)
1226
830
  },
1227
831
  Field: {
1228
832
  leave({ alias, name, arguments: args, directives, selectionSet }) {
1229
- const prefix = wrap("", alias, ": ") + name;
1230
- let argsLine = prefix + wrap("(", join(args, ", "), ")");
833
+ const prefix = wrap2("", alias, ": ") + name;
834
+ let argsLine = prefix + wrap2("(", join(args, ", "), ")");
1231
835
  if (argsLine.length > MAX_LINE_LENGTH) {
1232
- argsLine = prefix + wrap("(\n", indent(join(args, "\n")), "\n)");
836
+ argsLine = prefix + wrap2("(\n", indent(join(args, "\n")), "\n)");
1233
837
  }
1234
838
  return join([argsLine, join(directives, " "), selectionSet], " ");
1235
839
  }
@@ -1239,13 +843,13 @@ var printDocASTReducer = {
1239
843
  },
1240
844
  // Fragments
1241
845
  FragmentSpread: {
1242
- leave: ({ name, directives }) => "..." + name + wrap(" ", join(directives, " "))
846
+ leave: ({ name, directives }) => "..." + name + wrap2(" ", join(directives, " "))
1243
847
  },
1244
848
  InlineFragment: {
1245
849
  leave: ({ typeCondition, directives, selectionSet }) => join(
1246
850
  [
1247
851
  "...",
1248
- wrap("on ", typeCondition),
852
+ wrap2("on ", typeCondition),
1249
853
  join(directives, " "),
1250
854
  selectionSet
1251
855
  ],
@@ -1260,9 +864,9 @@ var printDocASTReducer = {
1260
864
  directives,
1261
865
  selectionSet,
1262
866
  description
1263
- }) => wrap("", description, "\n") + // Note: fragment variable definitions are experimental and may be changed
867
+ }) => wrap2("", description, "\n") + // Note: fragment variable definitions are experimental and may be changed
1264
868
  // or removed in the future.
1265
- `fragment ${name}${wrap("(", join(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap("", join(directives, " "), " ")}` + selectionSet
869
+ `fragment ${name}${wrap2("(", join(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap2("", join(directives, " "), " ")}` + selectionSet
1266
870
  },
1267
871
  // Value
1268
872
  IntValue: {
@@ -1294,7 +898,7 @@ var printDocASTReducer = {
1294
898
  },
1295
899
  // Directive
1296
900
  Directive: {
1297
- leave: ({ name, arguments: args }) => "@" + name + wrap("(", join(args, ", "), ")")
901
+ leave: ({ name, arguments: args }) => "@" + name + wrap2("(", join(args, ", "), ")")
1298
902
  },
1299
903
  // Type
1300
904
  NamedType: {
@@ -1308,20 +912,20 @@ var printDocASTReducer = {
1308
912
  },
1309
913
  // Type System Definitions
1310
914
  SchemaDefinition: {
1311
- leave: ({ description, directives, operationTypes }) => wrap("", description, "\n") + join(["schema", join(directives, " "), block(operationTypes)], " ")
915
+ leave: ({ description, directives, operationTypes }) => wrap2("", description, "\n") + join(["schema", join(directives, " "), block(operationTypes)], " ")
1312
916
  },
1313
917
  OperationTypeDefinition: {
1314
918
  leave: ({ operation, type }) => operation + ": " + type
1315
919
  },
1316
920
  ScalarTypeDefinition: {
1317
- leave: ({ description, name, directives }) => wrap("", description, "\n") + join(["scalar", name, join(directives, " ")], " ")
921
+ leave: ({ description, name, directives }) => wrap2("", description, "\n") + join(["scalar", name, join(directives, " ")], " ")
1318
922
  },
1319
923
  ObjectTypeDefinition: {
1320
- leave: ({ description, name, interfaces, directives, fields }) => wrap("", description, "\n") + join(
924
+ leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join(
1321
925
  [
1322
926
  "type",
1323
927
  name,
1324
- wrap("implements ", join(interfaces, " & ")),
928
+ wrap2("implements ", join(interfaces, " & ")),
1325
929
  join(directives, " "),
1326
930
  block(fields)
1327
931
  ],
@@ -1329,20 +933,20 @@ var printDocASTReducer = {
1329
933
  )
1330
934
  },
1331
935
  FieldDefinition: {
1332
- leave: ({ description, name, arguments: args, type, directives }) => wrap("", description, "\n") + name + (hasMultilineItems(args) ? wrap("(\n", indent(join(args, "\n")), "\n)") : wrap("(", join(args, ", "), ")")) + ": " + type + wrap(" ", join(directives, " "))
936
+ leave: ({ description, name, arguments: args, type, directives }) => wrap2("", description, "\n") + name + (hasMultilineItems(args) ? wrap2("(\n", indent(join(args, "\n")), "\n)") : wrap2("(", join(args, ", "), ")")) + ": " + type + wrap2(" ", join(directives, " "))
1333
937
  },
1334
938
  InputValueDefinition: {
1335
- leave: ({ description, name, type, defaultValue, directives }) => wrap("", description, "\n") + join(
1336
- [name + ": " + type, wrap("= ", defaultValue), join(directives, " ")],
939
+ leave: ({ description, name, type, defaultValue, directives }) => wrap2("", description, "\n") + join(
940
+ [name + ": " + type, wrap2("= ", defaultValue), join(directives, " ")],
1337
941
  " "
1338
942
  )
1339
943
  },
1340
944
  InterfaceTypeDefinition: {
1341
- leave: ({ description, name, interfaces, directives, fields }) => wrap("", description, "\n") + join(
945
+ leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join(
1342
946
  [
1343
947
  "interface",
1344
948
  name,
1345
- wrap("implements ", join(interfaces, " & ")),
949
+ wrap2("implements ", join(interfaces, " & ")),
1346
950
  join(directives, " "),
1347
951
  block(fields)
1348
952
  ],
@@ -1350,19 +954,19 @@ var printDocASTReducer = {
1350
954
  )
1351
955
  },
1352
956
  UnionTypeDefinition: {
1353
- leave: ({ description, name, directives, types }) => wrap("", description, "\n") + join(
1354
- ["union", name, join(directives, " "), wrap("= ", join(types, " | "))],
957
+ leave: ({ description, name, directives, types }) => wrap2("", description, "\n") + join(
958
+ ["union", name, join(directives, " "), wrap2("= ", join(types, " | "))],
1355
959
  " "
1356
960
  )
1357
961
  },
1358
962
  EnumTypeDefinition: {
1359
- leave: ({ description, name, directives, values }) => wrap("", description, "\n") + join(["enum", name, join(directives, " "), block(values)], " ")
963
+ leave: ({ description, name, directives, values }) => wrap2("", description, "\n") + join(["enum", name, join(directives, " "), block(values)], " ")
1360
964
  },
1361
965
  EnumValueDefinition: {
1362
- leave: ({ description, name, directives }) => wrap("", description, "\n") + join([name, join(directives, " ")], " ")
966
+ leave: ({ description, name, directives }) => wrap2("", description, "\n") + join([name, join(directives, " ")], " ")
1363
967
  },
1364
968
  InputObjectTypeDefinition: {
1365
- leave: ({ description, name, directives, fields }) => wrap("", description, "\n") + join(["input", name, join(directives, " "), block(fields)], " ")
969
+ leave: ({ description, name, directives, fields }) => wrap2("", description, "\n") + join(["input", name, join(directives, " "), block(fields)], " ")
1366
970
  },
1367
971
  DirectiveDefinition: {
1368
972
  leave: ({
@@ -1372,7 +976,7 @@ var printDocASTReducer = {
1372
976
  directives,
1373
977
  repeatable,
1374
978
  locations
1375
- }) => wrap("", description, "\n") + "directive @" + name + (hasMultilineItems(args) ? wrap("(\n", indent(join(args, "\n")), "\n)") : wrap("(", join(args, ", "), ")")) + wrap(" ", join(directives, " ")) + (repeatable ? " repeatable" : "") + " on " + join(locations, " | ")
979
+ }) => wrap2("", description, "\n") + "directive @" + name + (hasMultilineItems(args) ? wrap2("(\n", indent(join(args, "\n")), "\n)") : wrap2("(", join(args, ", "), ")")) + wrap2(" ", join(directives, " ")) + (repeatable ? " repeatable" : "") + " on " + join(locations, " | ")
1376
980
  },
1377
981
  SchemaExtension: {
1378
982
  leave: ({ directives, operationTypes }) => join(
@@ -1388,7 +992,7 @@ var printDocASTReducer = {
1388
992
  [
1389
993
  "extend type",
1390
994
  name,
1391
- wrap("implements ", join(interfaces, " & ")),
995
+ wrap2("implements ", join(interfaces, " & ")),
1392
996
  join(directives, " "),
1393
997
  block(fields)
1394
998
  ],
@@ -1400,7 +1004,7 @@ var printDocASTReducer = {
1400
1004
  [
1401
1005
  "extend interface",
1402
1006
  name,
1403
- wrap("implements ", join(interfaces, " & ")),
1007
+ wrap2("implements ", join(interfaces, " & ")),
1404
1008
  join(directives, " "),
1405
1009
  block(fields)
1406
1010
  ],
@@ -1413,7 +1017,7 @@ var printDocASTReducer = {
1413
1017
  "extend union",
1414
1018
  name,
1415
1019
  join(directives, " "),
1416
- wrap("= ", join(types, " | "))
1020
+ wrap2("= ", join(types, " | "))
1417
1021
  ],
1418
1022
  " "
1419
1023
  )
@@ -1432,16 +1036,16 @@ var printDocASTReducer = {
1432
1036
  leave: ({ name }) => name
1433
1037
  },
1434
1038
  MemberCoordinate: {
1435
- leave: ({ name, memberName }) => join([name, wrap(".", memberName)])
1039
+ leave: ({ name, memberName }) => join([name, wrap2(".", memberName)])
1436
1040
  },
1437
1041
  ArgumentCoordinate: {
1438
- leave: ({ name, fieldName, argumentName }) => join([name, wrap(".", fieldName), wrap("(", argumentName, ":)")])
1042
+ leave: ({ name, fieldName, argumentName }) => join([name, wrap2(".", fieldName), wrap2("(", argumentName, ":)")])
1439
1043
  },
1440
1044
  DirectiveCoordinate: {
1441
1045
  leave: ({ name }) => join(["@", name])
1442
1046
  },
1443
1047
  DirectiveArgumentCoordinate: {
1444
- leave: ({ name, argumentName }) => join(["@", name, wrap("(", argumentName, ":)")])
1048
+ leave: ({ name, argumentName }) => join(["@", name, wrap2("(", argumentName, ":)")])
1445
1049
  }
1446
1050
  };
1447
1051
  function join(maybeArray, separator = "") {
@@ -1449,223 +1053,31 @@ function join(maybeArray, separator = "") {
1449
1053
  return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter((x) => x).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : "";
1450
1054
  }
1451
1055
  function block(array) {
1452
- return wrap("{\n", indent(join(array, "\n")), "\n}");
1056
+ return wrap2("{\n", indent(join(array, "\n")), "\n}");
1453
1057
  }
1454
- function wrap(start, maybeString, end = "") {
1058
+ function wrap2(start, maybeString, end = "") {
1455
1059
  return maybeString != null && maybeString !== "" ? start + maybeString + end : "";
1456
1060
  }
1457
1061
  function indent(str) {
1458
- return wrap(" ", str.replace(/\n/g, "\n "));
1062
+ return wrap2(" ", str.replace(/\n/g, "\n "));
1459
1063
  }
1460
1064
  function hasMultilineItems(maybeArray) {
1461
1065
  var _maybeArray$some;
1462
1066
  return (_maybeArray$some = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.some((str) => str.includes("\n"))) !== null && _maybeArray$some !== void 0 ? _maybeArray$some : false;
1463
1067
  }
1464
1068
 
1465
- // ../../node_modules/@apollo/client/utilities/environment/index.js
1466
- var __DEV__ = globalThis.__DEV__ === true;
1467
-
1468
- // ../../node_modules/@apollo/client/utilities/internal/globals/maybe.js
1469
- function maybe(thunk) {
1470
- try {
1471
- return thunk();
1472
- } catch {
1473
- }
1474
- }
1475
-
1476
- // ../../node_modules/@apollo/client/utilities/internal/globals/global.js
1477
- var global_default = (
1478
- // We don't expect the Function constructor ever to be invoked at runtime, as
1479
- // long as at least one of globalThis, window, self, or global is defined, so
1480
- // we are under no obligation to make it easy for static analysis tools to
1481
- // detect syntactic usage of the Function constructor. If you think you can
1482
- maybe(() => globalThis) || maybe(() => window) || maybe(() => self) || maybe(() => global) || // improve your static analysis to detect this obfuscation, think again. This
1483
- // is an arms race you cannot win, at least not in JavaScript.
1484
- maybe(function() {
1485
- return maybe.constructor("return this")();
1486
- })
1487
- );
1488
-
1489
- // ../../node_modules/@apollo/client/version.js
1490
- var version = "4.3.1";
1491
-
1492
- // ../../node_modules/@apollo/client/utilities/internal/makeUniqueId.js
1493
- var prefixCounts = /* @__PURE__ */ new Map();
1494
- function makeUniqueId(prefix) {
1495
- const count = prefixCounts.get(prefix) || 1;
1496
- prefixCounts.set(prefix, count + 1);
1497
- return `${prefix}:${count}:${Math.random().toString(36).slice(2)}`;
1498
- }
1499
-
1500
- // ../../node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js
1501
- function stringifyForDisplay(value, space = 0) {
1502
- const undefId = makeUniqueId("stringifyForDisplay");
1503
- return JSON.stringify(value, (_, value2) => {
1504
- return value2 === void 0 ? undefId : value2;
1505
- }, space).split(JSON.stringify(undefId)).join("<undefined>");
1069
+ // ../../node_modules/@wry/caches/lib/weak.js
1070
+ function noop() {
1506
1071
  }
1507
-
1508
- // ../../node_modules/@apollo/client/utilities/invariant/index.js
1509
- var genericMessage = "Invariant Violation";
1510
- var InvariantError = class _InvariantError extends Error {
1511
- constructor(message = genericMessage) {
1512
- super(message);
1513
- this.name = genericMessage;
1514
- Object.setPrototypeOf(this, _InvariantError.prototype);
1515
- }
1072
+ var defaultDispose = noop;
1073
+ var _WeakRef = typeof WeakRef !== "undefined" ? WeakRef : function(value) {
1074
+ return { deref: () => value };
1516
1075
  };
1517
- var verbosityLevels = ["debug", "log", "warn", "error", "silent"];
1518
- var verbosityLevel = verbosityLevels.indexOf(__DEV__ ? "log" : "silent");
1519
- function invariant(condition, ...args) {
1520
- if (!condition) {
1521
- throw newInvariantError(...args);
1522
- }
1523
- }
1524
- function wrapConsoleMethod(name) {
1525
- return function(message, ...args) {
1526
- if (verbosityLevels.indexOf(name) >= verbosityLevel) {
1527
- const method = console[name] || console.log;
1528
- if (typeof message === "number") {
1529
- const arg0 = message;
1530
- message = getHandledErrorMsg(arg0);
1531
- if (!message) {
1532
- message = getFallbackErrorMsg(arg0, args);
1533
- args = [];
1534
- }
1535
- }
1536
- method(message, ...args);
1537
- }
1538
- };
1539
- }
1540
- invariant.debug = wrapConsoleMethod("debug");
1541
- invariant.log = wrapConsoleMethod("log");
1542
- invariant.warn = wrapConsoleMethod("warn");
1543
- invariant.error = wrapConsoleMethod("error");
1544
- function newInvariantError(message, ...optionalParams) {
1545
- return new InvariantError(getHandledErrorMsg(message, optionalParams) || getFallbackErrorMsg(message, optionalParams));
1546
- }
1547
- var ApolloErrorMessageHandler = /* @__PURE__ */ Symbol.for("ApolloErrorMessageHandler_" + version);
1548
- function stringify(arg) {
1549
- if (typeof arg == "string") {
1550
- return arg;
1551
- }
1552
- try {
1553
- return stringifyForDisplay(arg, 2).slice(0, 1e3);
1554
- } catch {
1555
- return "<non-serializable>";
1556
- }
1557
- }
1558
- function getHandledErrorMsg(message, messageArgs = []) {
1559
- if (!message)
1560
- return;
1561
- return global_default[ApolloErrorMessageHandler] && global_default[ApolloErrorMessageHandler](message, messageArgs.map(stringify));
1562
- }
1563
- function getFallbackErrorMsg(message, messageArgs = []) {
1564
- if (!message)
1565
- return;
1566
- if (typeof message === "string") {
1567
- return messageArgs.reduce((msg, arg) => msg.replace(/%[sdfo]/, stringify(arg)), message);
1568
- }
1569
- return `An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({
1570
- version,
1571
- message,
1572
- args: messageArgs.map(stringify)
1573
- }))}`;
1574
- }
1575
-
1576
- // ../../node_modules/@apollo/client/utilities/caching/sizes.js
1577
- var cacheSizeSymbol = /* @__PURE__ */ Symbol.for("apollo.cacheSize");
1578
- var cacheSizes = { ...global_default[cacheSizeSymbol] };
1579
-
1580
- // ../../node_modules/@apollo/client/utilities/internal/getOperationName.js
1581
- function getOperationName(doc, fallback) {
1582
- return doc.definitions.find((definition) => definition.kind === "OperationDefinition" && !!definition.name)?.name.value ?? fallback;
1583
- }
1584
-
1585
- // ../../node_modules/@wry/trie/lib/index.js
1586
- var defaultMakeData = () => /* @__PURE__ */ Object.create(null);
1587
- var { forEach, slice } = Array.prototype;
1588
- var { hasOwnProperty } = Object.prototype;
1589
- var Trie = class _Trie {
1590
- constructor(weakness = true, makeData = defaultMakeData) {
1591
- this.weakness = weakness;
1592
- this.makeData = makeData;
1593
- }
1594
- lookup() {
1595
- return this.lookupArray(arguments);
1596
- }
1597
- lookupArray(array) {
1598
- let node = this;
1599
- forEach.call(array, (key) => node = node.getChildTrie(key));
1600
- return hasOwnProperty.call(node, "data") ? node.data : node.data = this.makeData(slice.call(array));
1601
- }
1602
- peek() {
1603
- return this.peekArray(arguments);
1604
- }
1605
- peekArray(array) {
1606
- let node = this;
1607
- for (let i = 0, len = array.length; node && i < len; ++i) {
1608
- const map = node.mapFor(array[i], false);
1609
- node = map && map.get(array[i]);
1610
- }
1611
- return node && node.data;
1612
- }
1613
- remove() {
1614
- return this.removeArray(arguments);
1615
- }
1616
- removeArray(array) {
1617
- let data;
1618
- if (array.length) {
1619
- const head = array[0];
1620
- const map = this.mapFor(head, false);
1621
- const child = map && map.get(head);
1622
- if (child) {
1623
- data = child.removeArray(slice.call(array, 1));
1624
- if (!child.data && !child.weak && !(child.strong && child.strong.size)) {
1625
- map.delete(head);
1626
- }
1627
- }
1628
- } else {
1629
- data = this.data;
1630
- delete this.data;
1631
- }
1632
- return data;
1633
- }
1634
- getChildTrie(key) {
1635
- const map = this.mapFor(key, true);
1636
- let child = map.get(key);
1637
- if (!child)
1638
- map.set(key, child = new _Trie(this.weakness, this.makeData));
1639
- return child;
1640
- }
1641
- mapFor(key, create) {
1642
- return this.weakness && isObjRef(key) ? this.weak || (create ? this.weak = /* @__PURE__ */ new WeakMap() : void 0) : this.strong || (create ? this.strong = /* @__PURE__ */ new Map() : void 0);
1643
- }
1644
- };
1645
- function isObjRef(value) {
1646
- switch (typeof value) {
1647
- case "object":
1648
- if (value === null)
1649
- break;
1650
- // Fall through to return true...
1651
- case "function":
1652
- return true;
1653
- }
1654
- return false;
1655
- }
1656
-
1657
- // ../../node_modules/@wry/caches/lib/weak.js
1658
- function noop2() {
1659
- }
1660
- var defaultDispose = noop2;
1661
- var _WeakRef = typeof WeakRef !== "undefined" ? WeakRef : function(value) {
1662
- return { deref: () => value };
1663
- };
1664
- var _WeakMap = typeof WeakMap !== "undefined" ? WeakMap : Map;
1665
- var _FinalizationRegistry = typeof FinalizationRegistry !== "undefined" ? FinalizationRegistry : function() {
1666
- return {
1667
- register: noop2,
1668
- unregister: noop2
1076
+ var _WeakMap = typeof WeakMap !== "undefined" ? WeakMap : Map;
1077
+ var _FinalizationRegistry = typeof FinalizationRegistry !== "undefined" ? FinalizationRegistry : function() {
1078
+ return {
1079
+ register: noop,
1080
+ unregister: noop
1669
1081
  };
1670
1082
  };
1671
1083
  var finalizationBatchSize = 10024;
@@ -1793,7 +1205,7 @@ var WeakCache = class {
1793
1205
  }
1794
1206
  };
1795
1207
 
1796
- // ../../node_modules/@apollo/client/utilities/internal/caches.js
1208
+ // ../../node_modules/@apollo/client/utilities/caching/caches.js
1797
1209
  var scheduledCleanup = /* @__PURE__ */ new WeakSet();
1798
1210
  function schedule(cache) {
1799
1211
  if (cache.size <= (cache.max || -1)) {
@@ -1801,121 +1213,1142 @@ function schedule(cache) {
1801
1213
  }
1802
1214
  if (!scheduledCleanup.has(cache)) {
1803
1215
  scheduledCleanup.add(cache);
1804
- setTimeout(() => {
1216
+ setTimeout(function() {
1805
1217
  cache.clean();
1806
1218
  scheduledCleanup.delete(cache);
1807
1219
  }, 100);
1808
1220
  }
1809
1221
  }
1810
1222
  var AutoCleanedWeakCache = function(max, dispose) {
1811
- const cache = new WeakCache(max, dispose);
1223
+ var cache = new WeakCache(max, dispose);
1812
1224
  cache.set = function(key, value) {
1813
- const ret = WeakCache.prototype.set.call(this, key, value);
1225
+ var ret = WeakCache.prototype.set.call(this, key, value);
1814
1226
  schedule(this);
1815
1227
  return ret;
1816
1228
  };
1817
- return cache;
1818
- };
1819
-
1820
- // ../../node_modules/@apollo/client/utilities/internal/memoize.js
1821
- function memoize(fn, { max, makeCacheKey = (args) => args }) {
1822
- const keys = new Trie(true);
1823
- const cache = new AutoCleanedWeakCache(max);
1824
- return (...args) => {
1825
- const cacheKey = keys.lookupArray(makeCacheKey(args));
1826
- const cached = cache.get(cacheKey);
1827
- if (cached) {
1828
- if (cached.error) {
1829
- throw cached.error;
1229
+ return cache;
1230
+ };
1231
+
1232
+ // ../../node_modules/@apollo/client/utilities/caching/sizes.js
1233
+ var cacheSizeSymbol = /* @__PURE__ */ Symbol.for("apollo.cacheSize");
1234
+ var cacheSizes = __assign({}, global_default[cacheSizeSymbol]);
1235
+
1236
+ // ../../node_modules/@apollo/client/utilities/caching/getMemoryInternals.js
1237
+ var globalCaches = {};
1238
+ function registerGlobalCache(name, getSize) {
1239
+ globalCaches[name] = getSize;
1240
+ }
1241
+ var getApolloClientMemoryInternals = globalThis.__DEV__ !== false ? _getApolloClientMemoryInternals : void 0;
1242
+ var getInMemoryCacheMemoryInternals = globalThis.__DEV__ !== false ? _getInMemoryCacheMemoryInternals : void 0;
1243
+ var getApolloCacheMemoryInternals = globalThis.__DEV__ !== false ? _getApolloCacheMemoryInternals : void 0;
1244
+ function getCurrentCacheSizes() {
1245
+ var defaults = {
1246
+ parser: 1e3,
1247
+ canonicalStringify: 1e3,
1248
+ print: 2e3,
1249
+ "documentTransform.cache": 2e3,
1250
+ "queryManager.getDocumentInfo": 2e3,
1251
+ "PersistedQueryLink.persistedQueryHashes": 2e3,
1252
+ "fragmentRegistry.transform": 2e3,
1253
+ "fragmentRegistry.lookup": 1e3,
1254
+ "fragmentRegistry.findFragmentSpreads": 4e3,
1255
+ "cache.fragmentQueryDocuments": 1e3,
1256
+ "removeTypenameFromVariables.getVariableDefinitions": 2e3,
1257
+ "inMemoryCache.maybeBroadcastWatch": 5e3,
1258
+ "inMemoryCache.executeSelectionSet": 5e4,
1259
+ "inMemoryCache.executeSubSelectedArray": 1e4
1260
+ };
1261
+ return Object.fromEntries(Object.entries(defaults).map(function(_a3) {
1262
+ var k = _a3[0], v = _a3[1];
1263
+ return [
1264
+ k,
1265
+ cacheSizes[k] || v
1266
+ ];
1267
+ }));
1268
+ }
1269
+ function _getApolloClientMemoryInternals() {
1270
+ var _a3, _b, _c, _d, _e;
1271
+ if (!(globalThis.__DEV__ !== false))
1272
+ throw new Error("only supported in development mode");
1273
+ return {
1274
+ limits: getCurrentCacheSizes(),
1275
+ sizes: __assign({ print: (_a3 = globalCaches.print) === null || _a3 === void 0 ? void 0 : _a3.call(globalCaches), parser: (_b = globalCaches.parser) === null || _b === void 0 ? void 0 : _b.call(globalCaches), canonicalStringify: (_c = globalCaches.canonicalStringify) === null || _c === void 0 ? void 0 : _c.call(globalCaches), links: linkInfo(this.link), queryManager: {
1276
+ getDocumentInfo: this["queryManager"]["transformCache"].size,
1277
+ documentTransforms: transformInfo(this["queryManager"].documentTransform)
1278
+ } }, (_e = (_d = this.cache).getMemoryInternals) === null || _e === void 0 ? void 0 : _e.call(_d))
1279
+ };
1280
+ }
1281
+ function _getApolloCacheMemoryInternals() {
1282
+ return {
1283
+ cache: {
1284
+ fragmentQueryDocuments: getWrapperInformation(this["getFragmentDoc"])
1285
+ }
1286
+ };
1287
+ }
1288
+ function _getInMemoryCacheMemoryInternals() {
1289
+ var fragments = this.config.fragments;
1290
+ return __assign(__assign({}, _getApolloCacheMemoryInternals.apply(this)), { addTypenameDocumentTransform: transformInfo(this["addTypenameTransform"]), inMemoryCache: {
1291
+ executeSelectionSet: getWrapperInformation(this["storeReader"]["executeSelectionSet"]),
1292
+ executeSubSelectedArray: getWrapperInformation(this["storeReader"]["executeSubSelectedArray"]),
1293
+ maybeBroadcastWatch: getWrapperInformation(this["maybeBroadcastWatch"])
1294
+ }, fragmentRegistry: {
1295
+ findFragmentSpreads: getWrapperInformation(fragments === null || fragments === void 0 ? void 0 : fragments.findFragmentSpreads),
1296
+ lookup: getWrapperInformation(fragments === null || fragments === void 0 ? void 0 : fragments.lookup),
1297
+ transform: getWrapperInformation(fragments === null || fragments === void 0 ? void 0 : fragments.transform)
1298
+ } });
1299
+ }
1300
+ function isWrapper(f) {
1301
+ return !!f && "dirtyKey" in f;
1302
+ }
1303
+ function getWrapperInformation(f) {
1304
+ return isWrapper(f) ? f.size : void 0;
1305
+ }
1306
+ function isDefined(value) {
1307
+ return value != null;
1308
+ }
1309
+ function transformInfo(transform) {
1310
+ return recurseTransformInfo(transform).map(function(cache) {
1311
+ return { cache };
1312
+ });
1313
+ }
1314
+ function recurseTransformInfo(transform) {
1315
+ return transform ? __spreadArray(__spreadArray([
1316
+ getWrapperInformation(transform === null || transform === void 0 ? void 0 : transform["performWork"])
1317
+ ], recurseTransformInfo(transform === null || transform === void 0 ? void 0 : transform["left"]), true), recurseTransformInfo(transform === null || transform === void 0 ? void 0 : transform["right"]), true).filter(isDefined) : [];
1318
+ }
1319
+ function linkInfo(link) {
1320
+ var _a3;
1321
+ return link ? __spreadArray(__spreadArray([
1322
+ (_a3 = link === null || link === void 0 ? void 0 : link.getMemoryInternals) === null || _a3 === void 0 ? void 0 : _a3.call(link)
1323
+ ], linkInfo(link === null || link === void 0 ? void 0 : link.left), true), linkInfo(link === null || link === void 0 ? void 0 : link.right), true).filter(isDefined) : [];
1324
+ }
1325
+
1326
+ // ../../node_modules/@apollo/client/utilities/graphql/getFromAST.js
1327
+ function getOperationName(doc) {
1328
+ return doc.definitions.filter(function(definition) {
1329
+ return definition.kind === "OperationDefinition" && !!definition.name;
1330
+ }).map(function(x) {
1331
+ return x.name.value;
1332
+ })[0] || null;
1333
+ }
1334
+
1335
+ // ../../node_modules/optimism/node_modules/@wry/trie/lib/index.js
1336
+ var { forEach, slice } = Array.prototype;
1337
+ var { hasOwnProperty } = Object.prototype;
1338
+
1339
+ // ../../node_modules/@wry/context/lib/slot.js
1340
+ var currentContext = null;
1341
+ var MISSING_VALUE = {};
1342
+ var idCounter = 1;
1343
+ var makeSlotClass = () => class Slot {
1344
+ constructor() {
1345
+ this.id = [
1346
+ "slot",
1347
+ idCounter++,
1348
+ Date.now(),
1349
+ Math.random().toString(36).slice(2)
1350
+ ].join(":");
1351
+ }
1352
+ hasValue() {
1353
+ for (let context = currentContext; context; context = context.parent) {
1354
+ if (this.id in context.slots) {
1355
+ const value = context.slots[this.id];
1356
+ if (value === MISSING_VALUE)
1357
+ break;
1358
+ if (context !== currentContext) {
1359
+ currentContext.slots[this.id] = value;
1360
+ }
1361
+ return true;
1362
+ }
1363
+ }
1364
+ if (currentContext) {
1365
+ currentContext.slots[this.id] = MISSING_VALUE;
1366
+ }
1367
+ return false;
1368
+ }
1369
+ getValue() {
1370
+ if (this.hasValue()) {
1371
+ return currentContext.slots[this.id];
1372
+ }
1373
+ }
1374
+ withValue(value, callback, args, thisArg) {
1375
+ const slots = {
1376
+ __proto__: null,
1377
+ [this.id]: value
1378
+ };
1379
+ const parent = currentContext;
1380
+ currentContext = { parent, slots };
1381
+ try {
1382
+ return callback.apply(thisArg, args);
1383
+ } finally {
1384
+ currentContext = parent;
1385
+ }
1386
+ }
1387
+ // Capture the current context and wrap a callback function so that it
1388
+ // reestablishes the captured context when called.
1389
+ static bind(callback) {
1390
+ const context = currentContext;
1391
+ return function() {
1392
+ const saved = currentContext;
1393
+ try {
1394
+ currentContext = context;
1395
+ return callback.apply(this, arguments);
1396
+ } finally {
1397
+ currentContext = saved;
1398
+ }
1399
+ };
1400
+ }
1401
+ // Immediately run a callback function without any captured context.
1402
+ static noContext(callback, args, thisArg) {
1403
+ if (currentContext) {
1404
+ const saved = currentContext;
1405
+ try {
1406
+ currentContext = null;
1407
+ return callback.apply(thisArg, args);
1408
+ } finally {
1409
+ currentContext = saved;
1410
+ }
1411
+ } else {
1412
+ return callback.apply(thisArg, args);
1413
+ }
1414
+ }
1415
+ };
1416
+ function maybe2(fn) {
1417
+ try {
1418
+ return fn();
1419
+ } catch (ignored) {
1420
+ }
1421
+ }
1422
+ var globalKey = "@wry/context:Slot";
1423
+ var host = (
1424
+ // Prefer globalThis when available.
1425
+ // https://github.com/benjamn/wryware/issues/347
1426
+ maybe2(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
1427
+ // bundlers to the appropriate identifier (window, self, ...) depending on the
1428
+ // bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
1429
+ maybe2(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
1430
+ // back to using the Array constructor as a namespace, but that was flagged in
1431
+ // https://github.com/benjamn/wryware/issues/347, and can be avoided.
1432
+ /* @__PURE__ */ Object.create(null)
1433
+ );
1434
+ var globalHost = host;
1435
+ var Slot = globalHost[globalKey] || // Earlier versions of this package stored the globalKey property on the Array
1436
+ // constructor, so we check there as well, to prevent Slot class duplication.
1437
+ Array[globalKey] || (function(Slot2) {
1438
+ try {
1439
+ Object.defineProperty(globalHost, globalKey, {
1440
+ value: Slot2,
1441
+ enumerable: false,
1442
+ writable: false,
1443
+ // When it was possible for globalHost to be the Array constructor (a
1444
+ // legacy Slot dedup strategy), it was important for the property to be
1445
+ // configurable:true so it could be deleted. That does not seem to be as
1446
+ // important when globalHost is the global object, but I don't want to
1447
+ // cause similar problems again, and configurable:true seems safest.
1448
+ // https://github.com/endojs/endo/issues/576#issuecomment-1178274008
1449
+ configurable: true
1450
+ });
1451
+ } finally {
1452
+ return Slot2;
1453
+ }
1454
+ })(makeSlotClass());
1455
+
1456
+ // ../../node_modules/@wry/context/lib/index.js
1457
+ var { bind, noContext } = Slot;
1458
+
1459
+ // ../../node_modules/optimism/lib/context.js
1460
+ var parentEntrySlot = new Slot();
1461
+
1462
+ // ../../node_modules/optimism/lib/helpers.js
1463
+ var { hasOwnProperty: hasOwnProperty2 } = Object.prototype;
1464
+ var arrayFromSet = Array.from || function(set) {
1465
+ const array = [];
1466
+ set.forEach((item) => array.push(item));
1467
+ return array;
1468
+ };
1469
+ function maybeUnsubscribe(entryOrDep) {
1470
+ const { unsubscribe } = entryOrDep;
1471
+ if (typeof unsubscribe === "function") {
1472
+ entryOrDep.unsubscribe = void 0;
1473
+ unsubscribe();
1474
+ }
1475
+ }
1476
+
1477
+ // ../../node_modules/optimism/lib/entry.js
1478
+ var emptySetPool = [];
1479
+ var POOL_TARGET_SIZE = 100;
1480
+ function assert(condition, optionalMessage) {
1481
+ if (!condition) {
1482
+ throw new Error(optionalMessage || "assertion failure");
1483
+ }
1484
+ }
1485
+ function valueIs(a, b) {
1486
+ const len = a.length;
1487
+ return (
1488
+ // Unknown values are not equal to each other.
1489
+ len > 0 && // Both values must be ordinary (or both exceptional) to be equal.
1490
+ len === b.length && // The underlying value or exception must be the same.
1491
+ a[len - 1] === b[len - 1]
1492
+ );
1493
+ }
1494
+ function valueGet(value) {
1495
+ switch (value.length) {
1496
+ case 0:
1497
+ throw new Error("unknown value");
1498
+ case 1:
1499
+ return value[0];
1500
+ case 2:
1501
+ throw value[1];
1502
+ }
1503
+ }
1504
+ function valueCopy(value) {
1505
+ return value.slice(0);
1506
+ }
1507
+ var Entry = class _Entry {
1508
+ constructor(fn) {
1509
+ this.fn = fn;
1510
+ this.parents = /* @__PURE__ */ new Set();
1511
+ this.childValues = /* @__PURE__ */ new Map();
1512
+ this.dirtyChildren = null;
1513
+ this.dirty = true;
1514
+ this.recomputing = false;
1515
+ this.value = [];
1516
+ this.deps = null;
1517
+ ++_Entry.count;
1518
+ }
1519
+ peek() {
1520
+ if (this.value.length === 1 && !mightBeDirty(this)) {
1521
+ rememberParent(this);
1522
+ return this.value[0];
1523
+ }
1524
+ }
1525
+ // This is the most important method of the Entry API, because it
1526
+ // determines whether the cached this.value can be returned immediately,
1527
+ // or must be recomputed. The overall performance of the caching system
1528
+ // depends on the truth of the following observations: (1) this.dirty is
1529
+ // usually false, (2) this.dirtyChildren is usually null/empty, and thus
1530
+ // (3) valueGet(this.value) is usually returned without recomputation.
1531
+ recompute(args) {
1532
+ assert(!this.recomputing, "already recomputing");
1533
+ rememberParent(this);
1534
+ return mightBeDirty(this) ? reallyRecompute(this, args) : valueGet(this.value);
1535
+ }
1536
+ setDirty() {
1537
+ if (this.dirty)
1538
+ return;
1539
+ this.dirty = true;
1540
+ reportDirty(this);
1541
+ maybeUnsubscribe(this);
1542
+ }
1543
+ dispose() {
1544
+ this.setDirty();
1545
+ forgetChildren(this);
1546
+ eachParent(this, (parent, child) => {
1547
+ parent.setDirty();
1548
+ forgetChild(parent, this);
1549
+ });
1550
+ }
1551
+ forget() {
1552
+ this.dispose();
1553
+ }
1554
+ dependOn(dep2) {
1555
+ dep2.add(this);
1556
+ if (!this.deps) {
1557
+ this.deps = emptySetPool.pop() || /* @__PURE__ */ new Set();
1558
+ }
1559
+ this.deps.add(dep2);
1560
+ }
1561
+ forgetDeps() {
1562
+ if (this.deps) {
1563
+ arrayFromSet(this.deps).forEach((dep2) => dep2.delete(this));
1564
+ this.deps.clear();
1565
+ emptySetPool.push(this.deps);
1566
+ this.deps = null;
1567
+ }
1568
+ }
1569
+ };
1570
+ Entry.count = 0;
1571
+ function rememberParent(child) {
1572
+ const parent = parentEntrySlot.getValue();
1573
+ if (parent) {
1574
+ child.parents.add(parent);
1575
+ if (!parent.childValues.has(child)) {
1576
+ parent.childValues.set(child, []);
1577
+ }
1578
+ if (mightBeDirty(child)) {
1579
+ reportDirtyChild(parent, child);
1580
+ } else {
1581
+ reportCleanChild(parent, child);
1582
+ }
1583
+ return parent;
1584
+ }
1585
+ }
1586
+ function reallyRecompute(entry, args) {
1587
+ forgetChildren(entry);
1588
+ parentEntrySlot.withValue(entry, recomputeNewValue, [entry, args]);
1589
+ if (maybeSubscribe(entry, args)) {
1590
+ setClean(entry);
1591
+ }
1592
+ return valueGet(entry.value);
1593
+ }
1594
+ function recomputeNewValue(entry, args) {
1595
+ entry.recomputing = true;
1596
+ const { normalizeResult } = entry;
1597
+ let oldValueCopy;
1598
+ if (normalizeResult && entry.value.length === 1) {
1599
+ oldValueCopy = valueCopy(entry.value);
1600
+ }
1601
+ entry.value.length = 0;
1602
+ try {
1603
+ entry.value[0] = entry.fn.apply(null, args);
1604
+ if (normalizeResult && oldValueCopy && !valueIs(oldValueCopy, entry.value)) {
1605
+ try {
1606
+ entry.value[0] = normalizeResult(entry.value[0], oldValueCopy[0]);
1607
+ } catch (_a3) {
1608
+ }
1609
+ }
1610
+ } catch (e) {
1611
+ entry.value[1] = e;
1612
+ }
1613
+ entry.recomputing = false;
1614
+ }
1615
+ function mightBeDirty(entry) {
1616
+ return entry.dirty || !!(entry.dirtyChildren && entry.dirtyChildren.size);
1617
+ }
1618
+ function setClean(entry) {
1619
+ entry.dirty = false;
1620
+ if (mightBeDirty(entry)) {
1621
+ return;
1622
+ }
1623
+ reportClean(entry);
1624
+ }
1625
+ function reportDirty(child) {
1626
+ eachParent(child, reportDirtyChild);
1627
+ }
1628
+ function reportClean(child) {
1629
+ eachParent(child, reportCleanChild);
1630
+ }
1631
+ function eachParent(child, callback) {
1632
+ const parentCount = child.parents.size;
1633
+ if (parentCount) {
1634
+ const parents = arrayFromSet(child.parents);
1635
+ for (let i = 0; i < parentCount; ++i) {
1636
+ callback(parents[i], child);
1637
+ }
1638
+ }
1639
+ }
1640
+ function reportDirtyChild(parent, child) {
1641
+ assert(parent.childValues.has(child));
1642
+ assert(mightBeDirty(child));
1643
+ const parentWasClean = !mightBeDirty(parent);
1644
+ if (!parent.dirtyChildren) {
1645
+ parent.dirtyChildren = emptySetPool.pop() || /* @__PURE__ */ new Set();
1646
+ } else if (parent.dirtyChildren.has(child)) {
1647
+ return;
1648
+ }
1649
+ parent.dirtyChildren.add(child);
1650
+ if (parentWasClean) {
1651
+ reportDirty(parent);
1652
+ }
1653
+ }
1654
+ function reportCleanChild(parent, child) {
1655
+ assert(parent.childValues.has(child));
1656
+ assert(!mightBeDirty(child));
1657
+ const childValue = parent.childValues.get(child);
1658
+ if (childValue.length === 0) {
1659
+ parent.childValues.set(child, valueCopy(child.value));
1660
+ } else if (!valueIs(childValue, child.value)) {
1661
+ parent.setDirty();
1662
+ }
1663
+ removeDirtyChild(parent, child);
1664
+ if (mightBeDirty(parent)) {
1665
+ return;
1666
+ }
1667
+ reportClean(parent);
1668
+ }
1669
+ function removeDirtyChild(parent, child) {
1670
+ const dc = parent.dirtyChildren;
1671
+ if (dc) {
1672
+ dc.delete(child);
1673
+ if (dc.size === 0) {
1674
+ if (emptySetPool.length < POOL_TARGET_SIZE) {
1675
+ emptySetPool.push(dc);
1676
+ }
1677
+ parent.dirtyChildren = null;
1678
+ }
1679
+ }
1680
+ }
1681
+ function forgetChildren(parent) {
1682
+ if (parent.childValues.size > 0) {
1683
+ parent.childValues.forEach((_value, child) => {
1684
+ forgetChild(parent, child);
1685
+ });
1686
+ }
1687
+ parent.forgetDeps();
1688
+ assert(parent.dirtyChildren === null);
1689
+ }
1690
+ function forgetChild(parent, child) {
1691
+ child.parents.delete(parent);
1692
+ parent.childValues.delete(child);
1693
+ removeDirtyChild(parent, child);
1694
+ }
1695
+ function maybeSubscribe(entry, args) {
1696
+ if (typeof entry.subscribe === "function") {
1697
+ try {
1698
+ maybeUnsubscribe(entry);
1699
+ entry.unsubscribe = entry.subscribe.apply(null, args);
1700
+ } catch (e) {
1701
+ entry.setDirty();
1702
+ return false;
1703
+ }
1704
+ }
1705
+ return true;
1706
+ }
1707
+
1708
+ // ../../node_modules/@apollo/client/utilities/graphql/print.js
1709
+ var printCache;
1710
+ var print2 = Object.assign(function(ast) {
1711
+ var result2 = printCache.get(ast);
1712
+ if (!result2) {
1713
+ result2 = print(ast);
1714
+ printCache.set(ast, result2);
1715
+ }
1716
+ return result2;
1717
+ }, {
1718
+ reset: function() {
1719
+ printCache = new AutoCleanedWeakCache(
1720
+ cacheSizes.print || 2e3
1721
+ /* defaultCacheSizes.print */
1722
+ );
1723
+ }
1724
+ });
1725
+ print2.reset();
1726
+ if (globalThis.__DEV__ !== false) {
1727
+ registerGlobalCache("print", function() {
1728
+ return printCache ? printCache.size : 0;
1729
+ });
1730
+ }
1731
+
1732
+ // ../../node_modules/zen-observable-ts/module.js
1733
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
1734
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
1735
+ if (it) return (it = it.call(o)).next.bind(it);
1736
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
1737
+ if (it) o = it;
1738
+ var i = 0;
1739
+ return function() {
1740
+ if (i >= o.length) return { done: true };
1741
+ return { done: false, value: o[i++] };
1742
+ };
1743
+ }
1744
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1745
+ }
1746
+ function _unsupportedIterableToArray(o, minLen) {
1747
+ if (!o) return;
1748
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1749
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1750
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1751
+ if (n === "Map" || n === "Set") return Array.from(o);
1752
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1753
+ }
1754
+ function _arrayLikeToArray(arr, len) {
1755
+ if (len == null || len > arr.length) len = arr.length;
1756
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
1757
+ arr2[i] = arr[i];
1758
+ }
1759
+ return arr2;
1760
+ }
1761
+ function _defineProperties(target, props) {
1762
+ for (var i = 0; i < props.length; i++) {
1763
+ var descriptor = props[i];
1764
+ descriptor.enumerable = descriptor.enumerable || false;
1765
+ descriptor.configurable = true;
1766
+ if ("value" in descriptor) descriptor.writable = true;
1767
+ Object.defineProperty(target, descriptor.key, descriptor);
1768
+ }
1769
+ }
1770
+ function _createClass(Constructor, protoProps, staticProps) {
1771
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1772
+ if (staticProps) _defineProperties(Constructor, staticProps);
1773
+ Object.defineProperty(Constructor, "prototype", { writable: false });
1774
+ return Constructor;
1775
+ }
1776
+ var hasSymbols = function() {
1777
+ return typeof Symbol === "function";
1778
+ };
1779
+ var hasSymbol = function(name) {
1780
+ return hasSymbols() && Boolean(Symbol[name]);
1781
+ };
1782
+ var getSymbol = function(name) {
1783
+ return hasSymbol(name) ? Symbol[name] : "@@" + name;
1784
+ };
1785
+ if (hasSymbols() && !hasSymbol("observable")) {
1786
+ Symbol.observable = /* @__PURE__ */ Symbol("observable");
1787
+ }
1788
+ var SymbolIterator = getSymbol("iterator");
1789
+ var SymbolObservable = getSymbol("observable");
1790
+ var SymbolSpecies = getSymbol("species");
1791
+ function getMethod(obj, key) {
1792
+ var value = obj[key];
1793
+ if (value == null) return void 0;
1794
+ if (typeof value !== "function") throw new TypeError(value + " is not a function");
1795
+ return value;
1796
+ }
1797
+ function getSpecies(obj) {
1798
+ var ctor = obj.constructor;
1799
+ if (ctor !== void 0) {
1800
+ ctor = ctor[SymbolSpecies];
1801
+ if (ctor === null) {
1802
+ ctor = void 0;
1803
+ }
1804
+ }
1805
+ return ctor !== void 0 ? ctor : Observable;
1806
+ }
1807
+ function isObservable(x) {
1808
+ return x instanceof Observable;
1809
+ }
1810
+ function hostReportError(e) {
1811
+ if (hostReportError.log) {
1812
+ hostReportError.log(e);
1813
+ } else {
1814
+ setTimeout(function() {
1815
+ throw e;
1816
+ });
1817
+ }
1818
+ }
1819
+ function enqueue(fn) {
1820
+ Promise.resolve().then(function() {
1821
+ try {
1822
+ fn();
1823
+ } catch (e) {
1824
+ hostReportError(e);
1825
+ }
1826
+ });
1827
+ }
1828
+ function cleanupSubscription(subscription) {
1829
+ var cleanup = subscription._cleanup;
1830
+ if (cleanup === void 0) return;
1831
+ subscription._cleanup = void 0;
1832
+ if (!cleanup) {
1833
+ return;
1834
+ }
1835
+ try {
1836
+ if (typeof cleanup === "function") {
1837
+ cleanup();
1838
+ } else {
1839
+ var unsubscribe = getMethod(cleanup, "unsubscribe");
1840
+ if (unsubscribe) {
1841
+ unsubscribe.call(cleanup);
1842
+ }
1843
+ }
1844
+ } catch (e) {
1845
+ hostReportError(e);
1846
+ }
1847
+ }
1848
+ function closeSubscription(subscription) {
1849
+ subscription._observer = void 0;
1850
+ subscription._queue = void 0;
1851
+ subscription._state = "closed";
1852
+ }
1853
+ function flushSubscription(subscription) {
1854
+ var queue = subscription._queue;
1855
+ if (!queue) {
1856
+ return;
1857
+ }
1858
+ subscription._queue = void 0;
1859
+ subscription._state = "ready";
1860
+ for (var i = 0; i < queue.length; ++i) {
1861
+ notifySubscription(subscription, queue[i].type, queue[i].value);
1862
+ if (subscription._state === "closed") break;
1863
+ }
1864
+ }
1865
+ function notifySubscription(subscription, type, value) {
1866
+ subscription._state = "running";
1867
+ var observer = subscription._observer;
1868
+ try {
1869
+ var m = getMethod(observer, type);
1870
+ switch (type) {
1871
+ case "next":
1872
+ if (m) m.call(observer, value);
1873
+ break;
1874
+ case "error":
1875
+ closeSubscription(subscription);
1876
+ if (m) m.call(observer, value);
1877
+ else throw value;
1878
+ break;
1879
+ case "complete":
1880
+ closeSubscription(subscription);
1881
+ if (m) m.call(observer);
1882
+ break;
1883
+ }
1884
+ } catch (e) {
1885
+ hostReportError(e);
1886
+ }
1887
+ if (subscription._state === "closed") cleanupSubscription(subscription);
1888
+ else if (subscription._state === "running") subscription._state = "ready";
1889
+ }
1890
+ function onNotify(subscription, type, value) {
1891
+ if (subscription._state === "closed") return;
1892
+ if (subscription._state === "buffering") {
1893
+ subscription._queue.push({
1894
+ type,
1895
+ value
1896
+ });
1897
+ return;
1898
+ }
1899
+ if (subscription._state !== "ready") {
1900
+ subscription._state = "buffering";
1901
+ subscription._queue = [{
1902
+ type,
1903
+ value
1904
+ }];
1905
+ enqueue(function() {
1906
+ return flushSubscription(subscription);
1907
+ });
1908
+ return;
1909
+ }
1910
+ notifySubscription(subscription, type, value);
1911
+ }
1912
+ var Subscription = /* @__PURE__ */ (function() {
1913
+ function Subscription2(observer, subscriber) {
1914
+ this._cleanup = void 0;
1915
+ this._observer = observer;
1916
+ this._queue = void 0;
1917
+ this._state = "initializing";
1918
+ var subscriptionObserver = new SubscriptionObserver(this);
1919
+ try {
1920
+ this._cleanup = subscriber.call(void 0, subscriptionObserver);
1921
+ } catch (e) {
1922
+ subscriptionObserver.error(e);
1923
+ }
1924
+ if (this._state === "initializing") this._state = "ready";
1925
+ }
1926
+ var _proto = Subscription2.prototype;
1927
+ _proto.unsubscribe = function unsubscribe() {
1928
+ if (this._state !== "closed") {
1929
+ closeSubscription(this);
1930
+ cleanupSubscription(this);
1931
+ }
1932
+ };
1933
+ _createClass(Subscription2, [{
1934
+ key: "closed",
1935
+ get: function() {
1936
+ return this._state === "closed";
1937
+ }
1938
+ }]);
1939
+ return Subscription2;
1940
+ })();
1941
+ var SubscriptionObserver = /* @__PURE__ */ (function() {
1942
+ function SubscriptionObserver2(subscription) {
1943
+ this._subscription = subscription;
1944
+ }
1945
+ var _proto2 = SubscriptionObserver2.prototype;
1946
+ _proto2.next = function next(value) {
1947
+ onNotify(this._subscription, "next", value);
1948
+ };
1949
+ _proto2.error = function error(value) {
1950
+ onNotify(this._subscription, "error", value);
1951
+ };
1952
+ _proto2.complete = function complete() {
1953
+ onNotify(this._subscription, "complete");
1954
+ };
1955
+ _createClass(SubscriptionObserver2, [{
1956
+ key: "closed",
1957
+ get: function() {
1958
+ return this._subscription._state === "closed";
1959
+ }
1960
+ }]);
1961
+ return SubscriptionObserver2;
1962
+ })();
1963
+ var Observable = /* @__PURE__ */ (function() {
1964
+ function Observable2(subscriber) {
1965
+ if (!(this instanceof Observable2)) throw new TypeError("Observable cannot be called as a function");
1966
+ if (typeof subscriber !== "function") throw new TypeError("Observable initializer must be a function");
1967
+ this._subscriber = subscriber;
1968
+ }
1969
+ var _proto3 = Observable2.prototype;
1970
+ _proto3.subscribe = function subscribe(observer) {
1971
+ if (typeof observer !== "object" || observer === null) {
1972
+ observer = {
1973
+ next: observer,
1974
+ error: arguments[1],
1975
+ complete: arguments[2]
1976
+ };
1977
+ }
1978
+ return new Subscription(observer, this._subscriber);
1979
+ };
1980
+ _proto3.forEach = function forEach2(fn) {
1981
+ var _this = this;
1982
+ return new Promise(function(resolve, reject) {
1983
+ if (typeof fn !== "function") {
1984
+ reject(new TypeError(fn + " is not a function"));
1985
+ return;
1986
+ }
1987
+ function done() {
1988
+ subscription.unsubscribe();
1989
+ resolve();
1990
+ }
1991
+ var subscription = _this.subscribe({
1992
+ next: function(value) {
1993
+ try {
1994
+ fn(value, done);
1995
+ } catch (e) {
1996
+ reject(e);
1997
+ subscription.unsubscribe();
1998
+ }
1999
+ },
2000
+ error: reject,
2001
+ complete: resolve
2002
+ });
2003
+ });
2004
+ };
2005
+ _proto3.map = function map(fn) {
2006
+ var _this2 = this;
2007
+ if (typeof fn !== "function") throw new TypeError(fn + " is not a function");
2008
+ var C = getSpecies(this);
2009
+ return new C(function(observer) {
2010
+ return _this2.subscribe({
2011
+ next: function(value) {
2012
+ try {
2013
+ value = fn(value);
2014
+ } catch (e) {
2015
+ return observer.error(e);
2016
+ }
2017
+ observer.next(value);
2018
+ },
2019
+ error: function(e) {
2020
+ observer.error(e);
2021
+ },
2022
+ complete: function() {
2023
+ observer.complete();
2024
+ }
2025
+ });
2026
+ });
2027
+ };
2028
+ _proto3.filter = function filter(fn) {
2029
+ var _this3 = this;
2030
+ if (typeof fn !== "function") throw new TypeError(fn + " is not a function");
2031
+ var C = getSpecies(this);
2032
+ return new C(function(observer) {
2033
+ return _this3.subscribe({
2034
+ next: function(value) {
2035
+ try {
2036
+ if (!fn(value)) return;
2037
+ } catch (e) {
2038
+ return observer.error(e);
2039
+ }
2040
+ observer.next(value);
2041
+ },
2042
+ error: function(e) {
2043
+ observer.error(e);
2044
+ },
2045
+ complete: function() {
2046
+ observer.complete();
2047
+ }
2048
+ });
2049
+ });
2050
+ };
2051
+ _proto3.reduce = function reduce(fn) {
2052
+ var _this4 = this;
2053
+ if (typeof fn !== "function") throw new TypeError(fn + " is not a function");
2054
+ var C = getSpecies(this);
2055
+ var hasSeed = arguments.length > 1;
2056
+ var hasValue = false;
2057
+ var seed = arguments[1];
2058
+ var acc = seed;
2059
+ return new C(function(observer) {
2060
+ return _this4.subscribe({
2061
+ next: function(value) {
2062
+ var first = !hasValue;
2063
+ hasValue = true;
2064
+ if (!first || hasSeed) {
2065
+ try {
2066
+ acc = fn(acc, value);
2067
+ } catch (e) {
2068
+ return observer.error(e);
2069
+ }
2070
+ } else {
2071
+ acc = value;
2072
+ }
2073
+ },
2074
+ error: function(e) {
2075
+ observer.error(e);
2076
+ },
2077
+ complete: function() {
2078
+ if (!hasValue && !hasSeed) return observer.error(new TypeError("Cannot reduce an empty sequence"));
2079
+ observer.next(acc);
2080
+ observer.complete();
2081
+ }
2082
+ });
2083
+ });
2084
+ };
2085
+ _proto3.concat = function concat() {
2086
+ var _this5 = this;
2087
+ for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
2088
+ sources[_key] = arguments[_key];
2089
+ }
2090
+ var C = getSpecies(this);
2091
+ return new C(function(observer) {
2092
+ var subscription;
2093
+ var index = 0;
2094
+ function startNext(next) {
2095
+ subscription = next.subscribe({
2096
+ next: function(v) {
2097
+ observer.next(v);
2098
+ },
2099
+ error: function(e) {
2100
+ observer.error(e);
2101
+ },
2102
+ complete: function() {
2103
+ if (index === sources.length) {
2104
+ subscription = void 0;
2105
+ observer.complete();
2106
+ } else {
2107
+ startNext(C.from(sources[index++]));
2108
+ }
2109
+ }
2110
+ });
2111
+ }
2112
+ startNext(_this5);
2113
+ return function() {
2114
+ if (subscription) {
2115
+ subscription.unsubscribe();
2116
+ subscription = void 0;
2117
+ }
2118
+ };
2119
+ });
2120
+ };
2121
+ _proto3.flatMap = function flatMap(fn) {
2122
+ var _this6 = this;
2123
+ if (typeof fn !== "function") throw new TypeError(fn + " is not a function");
2124
+ var C = getSpecies(this);
2125
+ return new C(function(observer) {
2126
+ var subscriptions = [];
2127
+ var outer = _this6.subscribe({
2128
+ next: function(value) {
2129
+ if (fn) {
2130
+ try {
2131
+ value = fn(value);
2132
+ } catch (e) {
2133
+ return observer.error(e);
2134
+ }
2135
+ }
2136
+ var inner = C.from(value).subscribe({
2137
+ next: function(value2) {
2138
+ observer.next(value2);
2139
+ },
2140
+ error: function(e) {
2141
+ observer.error(e);
2142
+ },
2143
+ complete: function() {
2144
+ var i = subscriptions.indexOf(inner);
2145
+ if (i >= 0) subscriptions.splice(i, 1);
2146
+ completeIfDone();
2147
+ }
2148
+ });
2149
+ subscriptions.push(inner);
2150
+ },
2151
+ error: function(e) {
2152
+ observer.error(e);
2153
+ },
2154
+ complete: function() {
2155
+ completeIfDone();
2156
+ }
2157
+ });
2158
+ function completeIfDone() {
2159
+ if (outer.closed && subscriptions.length === 0) observer.complete();
1830
2160
  }
1831
- return cached.result;
2161
+ return function() {
2162
+ subscriptions.forEach(function(s) {
2163
+ return s.unsubscribe();
2164
+ });
2165
+ outer.unsubscribe();
2166
+ };
2167
+ });
2168
+ };
2169
+ _proto3[SymbolObservable] = function() {
2170
+ return this;
2171
+ };
2172
+ Observable2.from = function from(x) {
2173
+ var C = typeof this === "function" ? this : Observable2;
2174
+ if (x == null) throw new TypeError(x + " is not an object");
2175
+ var method = getMethod(x, SymbolObservable);
2176
+ if (method) {
2177
+ var observable = method.call(x);
2178
+ if (Object(observable) !== observable) throw new TypeError(observable + " is not an object");
2179
+ if (isObservable(observable) && observable.constructor === C) return observable;
2180
+ return new C(function(observer) {
2181
+ return observable.subscribe(observer);
2182
+ });
1832
2183
  }
1833
- const entry = cache.set(cacheKey, {});
1834
- try {
1835
- return entry.result = fn(...args);
1836
- } catch (error) {
1837
- entry.error = error;
1838
- throw error;
2184
+ if (hasSymbol("iterator")) {
2185
+ method = getMethod(x, SymbolIterator);
2186
+ if (method) {
2187
+ return new C(function(observer) {
2188
+ enqueue(function() {
2189
+ if (observer.closed) return;
2190
+ for (var _iterator = _createForOfIteratorHelperLoose(method.call(x)), _step; !(_step = _iterator()).done; ) {
2191
+ var item = _step.value;
2192
+ observer.next(item);
2193
+ if (observer.closed) return;
2194
+ }
2195
+ observer.complete();
2196
+ });
2197
+ });
2198
+ }
2199
+ }
2200
+ if (Array.isArray(x)) {
2201
+ return new C(function(observer) {
2202
+ enqueue(function() {
2203
+ if (observer.closed) return;
2204
+ for (var i = 0; i < x.length; ++i) {
2205
+ observer.next(x[i]);
2206
+ if (observer.closed) return;
2207
+ }
2208
+ observer.complete();
2209
+ });
2210
+ });
2211
+ }
2212
+ throw new TypeError(x + " is not observable");
2213
+ };
2214
+ Observable2.of = function of() {
2215
+ for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
2216
+ items[_key2] = arguments[_key2];
1839
2217
  }
2218
+ var C = typeof this === "function" ? this : Observable2;
2219
+ return new C(function(observer) {
2220
+ enqueue(function() {
2221
+ if (observer.closed) return;
2222
+ for (var i = 0; i < items.length; ++i) {
2223
+ observer.next(items[i]);
2224
+ if (observer.closed) return;
2225
+ }
2226
+ observer.complete();
2227
+ });
2228
+ });
1840
2229
  };
2230
+ _createClass(Observable2, null, [{
2231
+ key: SymbolSpecies,
2232
+ get: function() {
2233
+ return this;
2234
+ }
2235
+ }]);
2236
+ return Observable2;
2237
+ })();
2238
+ if (hasSymbols()) {
2239
+ Object.defineProperty(Observable, /* @__PURE__ */ Symbol("extensions"), {
2240
+ value: {
2241
+ symbol: SymbolObservable,
2242
+ hostReportError
2243
+ },
2244
+ configurable: true
2245
+ });
1841
2246
  }
1842
2247
 
1843
- // ../../node_modules/@apollo/client/utilities/internal/checkDocument.js
1844
- var checkDocument = memoize((doc, expectedType) => {
1845
- invariant(doc && doc.kind === "Document", 1);
1846
- const operations = doc.definitions.filter((d) => d.kind === "OperationDefinition");
1847
- if (__DEV__) {
1848
- doc.definitions.forEach((definition) => {
1849
- if (definition.kind !== "OperationDefinition" && definition.kind !== "FragmentDefinition") {
1850
- throw newInvariantError(2, definition.kind);
2248
+ // ../../node_modules/symbol-observable/es/ponyfill.js
2249
+ function symbolObservablePonyfill(root2) {
2250
+ var result2;
2251
+ var Symbol2 = root2.Symbol;
2252
+ if (typeof Symbol2 === "function") {
2253
+ if (Symbol2.observable) {
2254
+ result2 = Symbol2.observable;
2255
+ } else {
2256
+ if (typeof Symbol2.for === "function") {
2257
+ result2 = Symbol2.for("https://github.com/benlesh/symbol-observable");
2258
+ } else {
2259
+ result2 = Symbol2("https://github.com/benlesh/symbol-observable");
1851
2260
  }
1852
- });
1853
- invariant(operations.length <= 1, 3, operations.length);
1854
- }
1855
- if (expectedType) {
1856
- invariant(
1857
- operations.length == 1 && operations[0].operation === expectedType,
1858
- 4,
1859
- expectedType,
1860
- expectedType,
1861
- operations[0].operation
1862
- );
1863
- }
1864
- visit(doc, {
1865
- Field(field, _, __, path) {
1866
- if (field.alias && (field.alias.value === "__typename" || field.alias.value.startsWith("__ac_")) && field.alias.value !== field.name.value) {
1867
- let current = doc, fieldPath = [];
1868
- for (const key of path) {
1869
- current = current[key];
1870
- if (current.kind === Kind.FIELD) {
1871
- fieldPath.push(current.alias?.value || current.name.value);
1872
- }
1873
- }
1874
- fieldPath.splice(-1, 1, field.name.value);
1875
- throw newInvariantError(
1876
- 5,
1877
- field.alias.value,
1878
- fieldPath.join("."),
1879
- operations[0].operation,
1880
- getOperationName(doc, "(anonymous)")
1881
- );
2261
+ try {
2262
+ Symbol2.observable = result2;
2263
+ } catch (err) {
1882
2264
  }
1883
2265
  }
1884
- });
1885
- }, {
1886
- max: cacheSizes["checkDocument"] || 2e3
1887
- });
2266
+ } else {
2267
+ result2 = "@@observable";
2268
+ }
2269
+ return result2;
2270
+ }
1888
2271
 
1889
- // ../../node_modules/@apollo/client/utilities/internal/getOperationDefinition.js
1890
- function getOperationDefinition(doc) {
1891
- checkDocument(doc);
1892
- return doc.definitions.filter((definition) => definition.kind === "OperationDefinition")[0];
2272
+ // ../../node_modules/symbol-observable/es/index.js
2273
+ var root;
2274
+ if (typeof self !== "undefined") {
2275
+ root = self;
2276
+ } else if (typeof window !== "undefined") {
2277
+ root = window;
2278
+ } else if (typeof global !== "undefined") {
2279
+ root = global;
2280
+ } else if (typeof module !== "undefined") {
2281
+ root = module;
2282
+ } else {
2283
+ root = Function("return this")();
2284
+ }
2285
+ var result = symbolObservablePonyfill(root);
2286
+
2287
+ // ../../node_modules/@apollo/client/utilities/observables/Observable.js
2288
+ var prototype = Observable.prototype;
2289
+ var fakeObsSymbol = "@@observable";
2290
+ if (!prototype[fakeObsSymbol]) {
2291
+ prototype[fakeObsSymbol] = function() {
2292
+ return this;
2293
+ };
1893
2294
  }
1894
2295
 
1895
- // ../../node_modules/@apollo/client/utilities/internal/getMemoryInternals.js
1896
- var globalCaches = {};
1897
- function registerGlobalCache(name, getSize) {
1898
- globalCaches[name] = getSize;
2296
+ // ../../node_modules/@apollo/client/utilities/deprecation/index.js
2297
+ var _a2;
2298
+ var muteAllDeprecations = /* @__PURE__ */ Symbol.for("apollo.deprecations");
2299
+ var deprecationsSlot = /* @__PURE__ */ Symbol.for("apollo.deprecations.slot");
2300
+ var global2 = global_default;
2301
+ var slot = (_a2 = global2[deprecationsSlot]) !== null && _a2 !== void 0 ? _a2 : global2[deprecationsSlot] = new Slot();
2302
+ function isMuted(name) {
2303
+ return global2[muteAllDeprecations] || (slot.getValue() || []).includes(name);
2304
+ }
2305
+ function warnDeprecated(name, cb) {
2306
+ if (!isMuted(name)) {
2307
+ cb();
2308
+ }
2309
+ }
2310
+
2311
+ // ../../node_modules/@apollo/client/link/utils/throwServerError.js
2312
+ var throwServerError = function(response, result2, message) {
2313
+ var error = new Error(message);
2314
+ error.name = "ServerError";
2315
+ error.response = response;
2316
+ error.statusCode = response.status;
2317
+ error.result = result2;
2318
+ throw error;
2319
+ };
2320
+
2321
+ // ../../node_modules/@apollo/client/link/utils/validateOperation.js
2322
+ function validateOperation(operation) {
2323
+ var OPERATION_FIELDS = [
2324
+ "query",
2325
+ "operationName",
2326
+ "variables",
2327
+ "extensions",
2328
+ "context"
2329
+ ];
2330
+ for (var _i = 0, _a3 = Object.keys(operation); _i < _a3.length; _i++) {
2331
+ var key = _a3[_i];
2332
+ if (OPERATION_FIELDS.indexOf(key) < 0) {
2333
+ throw newInvariantError(58, key);
2334
+ }
2335
+ }
2336
+ return operation;
1899
2337
  }
1900
2338
 
1901
2339
  // ../../node_modules/@apollo/client/link/utils/createOperation.js
1902
- function createOperation(request, { client }) {
1903
- const operation = {
1904
- query: request.query,
1905
- variables: request.variables || {},
1906
- extensions: request.extensions || {},
1907
- operationName: getOperationName(request.query),
1908
- operationType: getOperationDefinition(request.query).operation
1909
- };
1910
- let context2 = { ...request.context };
1911
- const setContext = (next) => {
2340
+ function createOperation(starting, operation) {
2341
+ var context = __assign({}, starting);
2342
+ var setContext = function(next) {
1912
2343
  if (typeof next === "function") {
1913
- context2 = { ...context2, ...next(getContext()) };
2344
+ context = __assign(__assign({}, context), next(context));
1914
2345
  } else {
1915
- context2 = { ...context2, ...next };
2346
+ context = __assign(__assign({}, context), next);
1916
2347
  }
1917
2348
  };
1918
- const getContext = () => Object.freeze({ ...context2 });
2349
+ var getContext = function() {
2350
+ return __assign({}, context);
2351
+ };
1919
2352
  Object.defineProperty(operation, "setContext", {
1920
2353
  enumerable: false,
1921
2354
  value: setContext
@@ -1924,428 +2357,236 @@ function createOperation(request, { client }) {
1924
2357
  enumerable: false,
1925
2358
  value: getContext
1926
2359
  });
1927
- Object.defineProperty(operation, "client", {
1928
- enumerable: false,
1929
- value: client
1930
- });
1931
2360
  return operation;
1932
2361
  }
1933
2362
 
1934
- // ../../node_modules/@apollo/client/link/utils/filterOperationVariables.js
1935
- function filterOperationVariables(variables, query) {
1936
- const result = { ...variables };
1937
- const unusedNames = new Set(Object.keys(variables));
1938
- visit(query, {
1939
- Variable(node, _key, parent) {
1940
- if (parent && parent.kind !== "VariableDefinition") {
1941
- unusedNames.delete(node.name.value);
1942
- }
1943
- }
1944
- });
1945
- unusedNames.forEach((name) => {
1946
- delete result[name];
1947
- });
1948
- return result;
2363
+ // ../../node_modules/@apollo/client/link/utils/transformOperation.js
2364
+ function transformOperation(operation) {
2365
+ var transformedOperation = {
2366
+ variables: operation.variables || {},
2367
+ extensions: operation.extensions || {},
2368
+ operationName: operation.operationName,
2369
+ query: operation.query
2370
+ };
2371
+ if (!transformedOperation.operationName) {
2372
+ transformedOperation.operationName = typeof transformedOperation.query !== "string" ? getOperationName(transformedOperation.query) || void 0 : "";
2373
+ }
2374
+ return transformedOperation;
1949
2375
  }
1950
2376
 
1951
2377
  // ../../node_modules/@apollo/client/link/core/ApolloLink.js
1952
- var ApolloLink = class _ApolloLink {
1953
- /**
1954
- * Creates a link that completes immediately and does not emit a result.
1955
- *
1956
- * @example
1957
- *
1958
- * ```ts
1959
- * const link = ApolloLink.empty();
1960
- * ```
1961
- */
1962
- static empty() {
1963
- return new _ApolloLink(() => EMPTY);
1964
- }
1965
- /**
1966
- * Composes multiple links into a single composed link that executes each
1967
- * provided link in serial order.
1968
- *
1969
- * @example
1970
- *
1971
- * ```ts
1972
- * import { from, HttpLink, ApolloLink } from "@apollo/client";
1973
- * import { RetryLink } from "@apollo/client/link/retry";
1974
- * import MyAuthLink from "../auth";
1975
- *
1976
- * const link = ApolloLink.from([
1977
- * new RetryLink(),
1978
- * new MyAuthLink(),
1979
- * new HttpLink({ uri: "http://localhost:4000/graphql" }),
1980
- * ]);
1981
- * ```
1982
- *
1983
- * @param links - An array of `ApolloLink` instances or request handlers that
1984
- * are executed in serial order.
1985
- */
1986
- static from(links) {
1987
- if (links.length === 0)
1988
- return _ApolloLink.empty();
1989
- const [first, ...rest] = links;
1990
- return first.concat(...rest);
1991
- }
1992
- /**
1993
- * Creates a link that conditionally routes a request to different links.
1994
- *
1995
- * @example
1996
- *
1997
- * ```ts
1998
- * import { ApolloLink, HttpLink } from "@apollo/client";
1999
- *
2000
- * const link = ApolloLink.split(
2001
- * (operation) => operation.getContext().version === 1,
2002
- * new HttpLink({ uri: "http://localhost:4000/v1/graphql" }),
2003
- * new HttpLink({ uri: "http://localhost:4000/v2/graphql" })
2004
- * );
2005
- * ```
2006
- *
2007
- * @param test - A predicate function that receives the current `operation`
2008
- * and returns a boolean indicating which link to execute. Returning `true`
2009
- * executes the `left` link. Returning `false` executes the `right` link.
2010
- *
2011
- * @param left - The link that executes when the `test` function returns
2012
- * `true`.
2013
- *
2014
- * @param right - The link that executes when the `test` function returns
2015
- * `false`. If the `right` link is not provided, the request is forwarded to
2016
- * the next link in the chain.
2017
- */
2018
- static split(test, left, right = new _ApolloLink((op, forward) => forward(op))) {
2019
- const link = new _ApolloLink((operation, forward) => {
2020
- const result = test(operation);
2021
- if (__DEV__) {
2022
- if (typeof result !== "boolean") {
2023
- __DEV__ && invariant.warn(65, result);
2024
- }
2378
+ function passthrough(op, forward) {
2379
+ return forward ? forward(op) : Observable.of();
2380
+ }
2381
+ function toLink(handler) {
2382
+ return typeof handler === "function" ? new ApolloLink(handler) : handler;
2383
+ }
2384
+ function isTerminating(link) {
2385
+ return link.request.length <= 1;
2386
+ }
2387
+ var ApolloLink = (
2388
+ /** @class */
2389
+ (function() {
2390
+ function ApolloLink2(request) {
2391
+ if (request)
2392
+ this.request = request;
2393
+ }
2394
+ ApolloLink2.empty = function() {
2395
+ return new ApolloLink2(function() {
2396
+ return Observable.of();
2397
+ });
2398
+ };
2399
+ ApolloLink2.from = function(links) {
2400
+ if (links.length === 0)
2401
+ return ApolloLink2.empty();
2402
+ return links.map(toLink).reduce(function(x, y) {
2403
+ return x.concat(y);
2404
+ });
2405
+ };
2406
+ ApolloLink2.split = function(test, left, right) {
2407
+ var leftLink = toLink(left);
2408
+ var rightLink = toLink(right || new ApolloLink2(passthrough));
2409
+ var ret;
2410
+ if (isTerminating(leftLink) && isTerminating(rightLink)) {
2411
+ ret = new ApolloLink2(function(operation) {
2412
+ return test(operation) ? leftLink.request(operation) || Observable.of() : rightLink.request(operation) || Observable.of();
2413
+ });
2414
+ } else {
2415
+ ret = new ApolloLink2(function(operation, forward) {
2416
+ return test(operation) ? leftLink.request(operation, forward) || Observable.of() : rightLink.request(operation, forward) || Observable.of();
2417
+ });
2025
2418
  }
2026
- return result ? left.request(operation, forward) : right.request(operation, forward);
2027
- });
2028
- return Object.assign(link, { left, right });
2029
- }
2030
- /**
2031
- * Executes a GraphQL request against a link. The `execute` function begins
2032
- * the request by calling the request handler of the link.
2033
- *
2034
- * @example
2035
- *
2036
- * ```ts
2037
- * const observable = ApolloLink.execute(link, { query, variables }, { client });
2038
- *
2039
- * observable.subscribe({
2040
- * next(value) {
2041
- * console.log("Received", value);
2042
- * },
2043
- * error(error) {
2044
- * console.error("Oops got error", error);
2045
- * },
2046
- * complete() {
2047
- * console.log("Request complete");
2048
- * },
2049
- * });
2050
- * ```
2051
- *
2052
- * @param link - The `ApolloLink` instance to execute the request.
2053
- *
2054
- * @param request - The GraphQL request details, such as the `query` and
2055
- * `variables`.
2056
- *
2057
- * @param context - The execution context for the request, such as the
2058
- * `client` making the request.
2059
- */
2060
- static execute(link, request, context2) {
2061
- return link.request(createOperation(request, context2), () => {
2062
- if (__DEV__) {
2063
- __DEV__ && invariant.warn(66);
2419
+ return Object.assign(ret, { left: leftLink, right: rightLink });
2420
+ };
2421
+ ApolloLink2.execute = function(link, operation) {
2422
+ return link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of();
2423
+ };
2424
+ ApolloLink2.concat = function(first, second) {
2425
+ var firstLink = toLink(first);
2426
+ if (isTerminating(firstLink)) {
2427
+ globalThis.__DEV__ !== false && invariant2.warn(47, firstLink);
2428
+ return firstLink;
2064
2429
  }
2065
- return EMPTY;
2066
- });
2067
- }
2068
- /**
2069
- * Combines multiple links into a single composed link.
2070
- *
2071
- * @example
2072
- *
2073
- * ```ts
2074
- * const link = ApolloLink.concat(firstLink, secondLink, thirdLink);
2075
- * ```
2076
- *
2077
- * @param links - The links to concatenate into a single link. Each link will
2078
- * execute in serial order.
2079
- *
2080
- * @deprecated Use `ApolloLink.from` instead. `ApolloLink.concat` will be
2081
- * removed in a future major version.
2082
- */
2083
- static concat(...links) {
2084
- return _ApolloLink.from(links);
2085
- }
2086
- constructor(request) {
2087
- if (request)
2088
- this.request = request;
2089
- }
2090
- /**
2091
- * Concatenates a link that conditionally routes a request to different links.
2092
- *
2093
- * @example
2094
- *
2095
- * ```ts
2096
- * import { ApolloLink, HttpLink } from "@apollo/client";
2097
- *
2098
- * const previousLink = new ApolloLink((operation, forward) => {
2099
- * // Handle the request
2100
- *
2101
- * return forward(operation);
2102
- * });
2103
- *
2104
- * const link = previousLink.split(
2105
- * (operation) => operation.getContext().version === 1,
2106
- * new HttpLink({ uri: "http://localhost:4000/v1/graphql" }),
2107
- * new HttpLink({ uri: "http://localhost:4000/v2/graphql" })
2108
- * );
2109
- * ```
2110
- *
2111
- * @param test - A predicate function that receives the current `operation`
2112
- * and returns a boolean indicating which link to execute. Returning `true`
2113
- * executes the `left` link. Returning `false` executes the `right` link.
2114
- *
2115
- * @param left - The link that executes when the `test` function returns
2116
- * `true`.
2117
- *
2118
- * @param right - The link that executes when the `test` function returns
2119
- * `false`. If the `right` link is not provided, the request is forwarded to
2120
- * the next link in the chain.
2121
- */
2122
- split(test, left, right) {
2123
- return this.concat(_ApolloLink.split(test, left, right));
2124
- }
2125
- /**
2126
- * Combines the link with other links into a single composed link.
2127
- *
2128
- * @example
2129
- *
2130
- * ```ts
2131
- * import { ApolloLink, HttpLink } from "@apollo/client";
2132
- *
2133
- * const previousLink = new ApolloLink((operation, forward) => {
2134
- * // Handle the request
2135
- *
2136
- * return forward(operation);
2137
- * });
2138
- *
2139
- * const link = previousLink.concat(
2140
- * link1,
2141
- * link2,
2142
- * new HttpLink({ uri: "http://localhost:4000/graphql" })
2143
- * );
2144
- * ```
2145
- */
2146
- concat(...links) {
2147
- if (links.length === 0) {
2430
+ var nextLink = toLink(second);
2431
+ var ret;
2432
+ if (isTerminating(nextLink)) {
2433
+ ret = new ApolloLink2(function(operation) {
2434
+ return firstLink.request(operation, function(op) {
2435
+ return nextLink.request(op) || Observable.of();
2436
+ }) || Observable.of();
2437
+ });
2438
+ } else {
2439
+ ret = new ApolloLink2(function(operation, forward) {
2440
+ return firstLink.request(operation, function(op) {
2441
+ return nextLink.request(op, forward) || Observable.of();
2442
+ }) || Observable.of();
2443
+ });
2444
+ }
2445
+ return Object.assign(ret, { left: firstLink, right: nextLink });
2446
+ };
2447
+ ApolloLink2.prototype.split = function(test, left, right) {
2448
+ return this.concat(ApolloLink2.split(test, left, right || new ApolloLink2(passthrough)));
2449
+ };
2450
+ ApolloLink2.prototype.concat = function(next) {
2451
+ return ApolloLink2.concat(this, next);
2452
+ };
2453
+ ApolloLink2.prototype.request = function(operation, forward) {
2454
+ throw newInvariantError(48);
2455
+ };
2456
+ ApolloLink2.prototype.onError = function(error, observer) {
2457
+ if (globalThis.__DEV__ !== false) {
2458
+ warnDeprecated("onError", function() {
2459
+ globalThis.__DEV__ !== false && invariant2.warn(49);
2460
+ });
2461
+ }
2462
+ if (observer && observer.error) {
2463
+ observer.error(error);
2464
+ return false;
2465
+ }
2466
+ throw error;
2467
+ };
2468
+ ApolloLink2.prototype.setOnError = function(fn) {
2469
+ if (globalThis.__DEV__ !== false) {
2470
+ globalThis.__DEV__ !== false && invariant2.warn(50);
2471
+ }
2472
+ this.onError = fn;
2148
2473
  return this;
2149
- }
2150
- return links.reduce(this.combine.bind(this), this);
2151
- }
2152
- combine(left, right) {
2153
- const link = new _ApolloLink((operation, forward) => {
2154
- return left.request(operation, (op) => right.request(op, forward));
2155
- });
2156
- return Object.assign(link, { left, right });
2157
- }
2158
- /**
2159
- * Runs the request handler for the provided operation.
2160
- *
2161
- * > [!NOTE]
2162
- * > This is called by the `ApolloLink.execute` function for you and should
2163
- * > not be called directly. Prefer using `ApolloLink.execute` to make the
2164
- * > request instead.
2165
- */
2166
- request(operation, forward) {
2167
- throw newInvariantError(67);
2168
- }
2169
- /**
2170
- * @internal
2171
- * Used to iterate through all links that are concatenations or `split` links.
2172
- *
2173
- * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
2174
- */
2175
- left;
2176
- /**
2177
- * @internal
2178
- * Used to iterate through all links that are concatenations or `split` links.
2179
- *
2180
- * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
2181
- */
2182
- right;
2183
- };
2184
-
2185
- // ../../node_modules/@apollo/client/errors/utils.js
2186
- function isBranded(error, name) {
2187
- return typeof error === "object" && error !== null && error[/* @__PURE__ */ Symbol.for("apollo.error")] === name;
2188
- }
2189
- function brand(error) {
2190
- Object.defineProperty(error, /* @__PURE__ */ Symbol.for("apollo.error"), {
2191
- value: error.name,
2192
- enumerable: false,
2193
- writable: false,
2194
- configurable: false
2195
- });
2196
- }
2197
-
2198
- // ../../node_modules/@apollo/client/errors/ServerError.js
2199
- var ServerError = class _ServerError extends Error {
2200
- /**
2201
- * A method that determines whether an error is a `ServerError` object. This
2202
- * method enables TypeScript to narrow the error type.
2203
- *
2204
- * @example
2205
- *
2206
- * ```ts
2207
- * if (ServerError.is(error)) {
2208
- * // TypeScript now knows `error` is a ServerError object
2209
- * console.log(error.errors);
2210
- * }
2211
- * ```
2212
- */
2213
- static is(error) {
2214
- return isBranded(error, "ServerError");
2215
- }
2216
- /**
2217
- * The raw [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) object provided by the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).
2218
- */
2219
- response;
2220
- /**
2221
- * The status code returned by the server in the response. This is provided as
2222
- * a shortcut for `response.status`.
2223
- */
2224
- statusCode;
2225
- /**
2226
- * The raw response body text.
2227
- */
2228
- bodyText;
2229
- constructor(message, options) {
2230
- super(message);
2231
- this.name = "ServerError";
2232
- this.response = options.response;
2233
- this.statusCode = options.response.status;
2234
- this.bodyText = options.bodyText;
2235
- brand(this);
2236
- Object.setPrototypeOf(this, _ServerError.prototype);
2237
- }
2238
- };
2474
+ };
2475
+ return ApolloLink2;
2476
+ })()
2477
+ );
2239
2478
 
2240
- // ../../node_modules/@apollo/client/errors/ServerParseError.js
2241
- var ServerParseError = class _ServerParseError extends Error {
2242
- /**
2243
- * A method that determines whether an error is a `ServerParseError`
2244
- * object. This method enables TypeScript to narrow the error type.
2245
- *
2246
- * @example
2247
- *
2248
- * ```ts
2249
- * if (ServerParseError.is(error)) {
2250
- * // TypeScript now knows `error` is a ServerParseError object
2251
- * console.log(error.statusCode);
2252
- * }
2253
- * ```
2254
- */
2255
- static is(error) {
2256
- return isBranded(error, "ServerParseError");
2257
- }
2258
- /**
2259
- * The raw [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) object provided by the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).
2260
- */
2261
- response;
2262
- /**
2263
- * The status code returned by the server in the response. This is provided
2264
- * as a shortcut for `response.status`.
2265
- */
2266
- statusCode;
2267
- /**
2268
- * The raw response body text.
2269
- */
2270
- bodyText;
2271
- constructor(originalParseError, options) {
2272
- super(originalParseError instanceof Error ? originalParseError.message : "Could not parse server response", { cause: originalParseError });
2273
- this.name = "ServerParseError";
2274
- this.response = options.response;
2275
- this.statusCode = options.response.status;
2276
- this.bodyText = options.bodyText;
2277
- brand(this);
2278
- Object.setPrototypeOf(this, _ServerParseError.prototype);
2279
- }
2479
+ // ../../node_modules/@apollo/client/link/http/createSignalIfSupported.js
2480
+ var createSignalIfSupported = function() {
2481
+ if (typeof AbortController === "undefined")
2482
+ return { controller: false, signal: false };
2483
+ var controller = new AbortController();
2484
+ var signal = controller.signal;
2485
+ return { controller, signal };
2280
2486
  };
2281
2487
 
2282
2488
  // ../../node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js
2283
- var { hasOwnProperty: hasOwnProperty2 } = Object.prototype;
2284
- function parseJsonEncoding(response, bodyText) {
2489
+ var hasOwnProperty3 = Object.prototype.hasOwnProperty;
2490
+ function parseJsonBody(response, bodyText) {
2285
2491
  if (response.status >= 300) {
2286
- throw new ServerError(`Response not successful: Received status code ${response.status}`, { response, bodyText });
2492
+ var getResult = function() {
2493
+ try {
2494
+ return JSON.parse(bodyText);
2495
+ } catch (err) {
2496
+ return bodyText;
2497
+ }
2498
+ };
2499
+ throwServerError(response, getResult(), "Response not successful: Received status code ".concat(response.status));
2287
2500
  }
2288
2501
  try {
2289
2502
  return JSON.parse(bodyText);
2290
2503
  } catch (err) {
2291
- throw new ServerParseError(err, { response, bodyText });
2504
+ var parseError = err;
2505
+ parseError.name = "ServerParseError";
2506
+ parseError.response = response;
2507
+ parseError.statusCode = response.status;
2508
+ parseError.bodyText = bodyText;
2509
+ throw parseError;
2292
2510
  }
2293
2511
  }
2294
- function parseGraphQLResponseJsonEncoding(response, bodyText) {
2512
+ function parseAndCheckHttpResponse(operations) {
2513
+ return function(response) {
2514
+ return response.text().then(function(bodyText) {
2515
+ return parseJsonBody(response, bodyText);
2516
+ }).then(function(result2) {
2517
+ if (!Array.isArray(result2) && !hasOwnProperty3.call(result2, "data") && !hasOwnProperty3.call(result2, "errors")) {
2518
+ throwServerError(response, result2, "Server response was missing for query '".concat(Array.isArray(operations) ? operations.map(function(op) {
2519
+ return op.operationName;
2520
+ }) : operations.operationName, "'."));
2521
+ }
2522
+ return result2;
2523
+ });
2524
+ };
2525
+ }
2526
+
2527
+ // ../../node_modules/@apollo/client/link/http/serializeFetchParameter.js
2528
+ var serializeFetchParameter = function(p, label) {
2529
+ var serialized;
2295
2530
  try {
2296
- return JSON.parse(bodyText);
2297
- } catch (err) {
2298
- throw new ServerParseError(err, { response, bodyText });
2531
+ serialized = JSON.stringify(p);
2532
+ } catch (e) {
2533
+ var parseError = newInvariantError(54, label, e.message);
2534
+ parseError.parseError = e;
2535
+ throw parseError;
2299
2536
  }
2300
- }
2301
- function parseResponse(response, bodyText) {
2302
- const contentType = response.headers.get("content-type");
2303
- if (contentType?.includes("application/graphql-response+json")) {
2304
- return parseGraphQLResponseJsonEncoding(response, bodyText);
2537
+ return serialized;
2538
+ };
2539
+
2540
+ // ../../node_modules/@apollo/client/link/http/rewriteURIForGET.js
2541
+ function rewriteURIForGET(chosenURI, body) {
2542
+ var queryParams = [];
2543
+ var addQueryParam = function(key, value) {
2544
+ queryParams.push("".concat(key, "=").concat(encodeURIComponent(value)));
2545
+ };
2546
+ if ("query" in body) {
2547
+ addQueryParam("query", body.query);
2305
2548
  }
2306
- return parseJsonEncoding(response, bodyText);
2307
- }
2308
- function parseAndCheckHttpResponse(operations) {
2309
- return (response) => response.text().then((bodyText) => {
2310
- const result = parseResponse(response, bodyText);
2311
- if (!Array.isArray(result) && !hasOwnProperty2.call(result, "data") && !hasOwnProperty2.call(result, "errors")) {
2312
- throw new ServerError(`Server response was malformed for query '${Array.isArray(operations) ? operations.map((op) => op.operationName) : operations.operationName}'.`, { response, bodyText });
2549
+ if (body.operationName) {
2550
+ addQueryParam("operationName", body.operationName);
2551
+ }
2552
+ if (body.variables) {
2553
+ var serializedVariables = void 0;
2554
+ try {
2555
+ serializedVariables = serializeFetchParameter(body.variables, "Variables map");
2556
+ } catch (parseError) {
2557
+ return { parseError };
2313
2558
  }
2314
- return result;
2315
- });
2316
- }
2317
-
2318
- // ../../node_modules/@apollo/client/utilities/graphql/print.js
2319
- var printCache;
2320
- var print2 = Object.assign((ast) => {
2321
- let result = printCache.get(ast);
2322
- if (!result) {
2323
- result = print(ast);
2324
- printCache.set(ast, result);
2559
+ addQueryParam("variables", serializedVariables);
2325
2560
  }
2326
- return result;
2327
- }, {
2328
- reset() {
2329
- printCache = new AutoCleanedWeakCache(
2330
- cacheSizes.print || 2e3
2331
- /* defaultCacheSizes.print */
2332
- );
2561
+ if (body.extensions) {
2562
+ var serializedExtensions = void 0;
2563
+ try {
2564
+ serializedExtensions = serializeFetchParameter(body.extensions, "Extensions map");
2565
+ } catch (parseError) {
2566
+ return { parseError };
2567
+ }
2568
+ addQueryParam("extensions", serializedExtensions);
2333
2569
  }
2334
- });
2335
- print2.reset();
2336
- if (__DEV__) {
2337
- registerGlobalCache("print", () => printCache ? printCache.size : 0);
2570
+ var fragment = "", preFragment = chosenURI;
2571
+ var fragmentStart = chosenURI.indexOf("#");
2572
+ if (fragmentStart !== -1) {
2573
+ fragment = chosenURI.substr(fragmentStart);
2574
+ preFragment = chosenURI.substr(0, fragmentStart);
2575
+ }
2576
+ var queryParamsPrefix = preFragment.indexOf("?") === -1 ? "?" : "&";
2577
+ var newURI = preFragment + queryParamsPrefix + queryParams.join("&") + fragment;
2578
+ return { newURI };
2338
2579
  }
2339
2580
 
2340
2581
  // ../../node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js
2341
2582
  var defaultHttpOptions = {
2342
2583
  includeQuery: true,
2343
- includeExtensions: true,
2584
+ includeExtensions: false,
2344
2585
  preserveHeaderCase: false
2345
2586
  };
2346
2587
  var defaultHeaders = {
2347
2588
  // headers are case insensitive (https://stackoverflow.com/a/5259004)
2348
- accept: "application/graphql-response+json,application/json;q=0.9",
2589
+ accept: "*/*",
2349
2590
  // The content-type header describes the type of the body of the request, and
2350
2591
  // so it typically only is sent with requests that actually have bodies. One
2351
2592
  // could imagine that Apollo Client would remove this header when constructing
@@ -2368,32 +2609,29 @@ var fallbackHttpConfig = {
2368
2609
  headers: defaultHeaders,
2369
2610
  options: defaultOptions
2370
2611
  };
2371
- var defaultPrinter = (ast, printer) => printer(ast);
2372
- function selectHttpOptionsAndBodyInternal(operation, printer, ...configs) {
2373
- let options = {};
2374
- let http = {};
2375
- configs.forEach((config2) => {
2376
- options = {
2377
- ...options,
2378
- ...config2.options,
2379
- headers: {
2380
- ...options.headers,
2381
- ...config2.headers
2382
- }
2383
- };
2384
- if (config2.credentials) {
2385
- options.credentials = config2.credentials;
2612
+ var defaultPrinter = function(ast, printer) {
2613
+ return printer(ast);
2614
+ };
2615
+ function selectHttpOptionsAndBodyInternal(operation, printer) {
2616
+ var configs = [];
2617
+ for (var _i = 2; _i < arguments.length; _i++) {
2618
+ configs[_i - 2] = arguments[_i];
2619
+ }
2620
+ var options = {};
2621
+ var http = {};
2622
+ configs.forEach(function(config) {
2623
+ options = __assign(__assign(__assign({}, options), config.options), { headers: __assign(__assign({}, options.headers), config.headers) });
2624
+ if (config.credentials) {
2625
+ options.credentials = config.credentials;
2386
2626
  }
2387
- options.headers.accept = (config2.http?.accept || []).concat(options.headers.accept).join(",");
2388
- http = {
2389
- ...http,
2390
- ...config2.http
2391
- };
2627
+ http = __assign(__assign({}, http), config.http);
2392
2628
  });
2393
- options.headers = removeDuplicateHeaders(options.headers, http.preserveHeaderCase);
2394
- const { operationName, extensions, variables, query } = operation;
2395
- const body = { operationName, variables };
2396
- if (http.includeExtensions && Object.keys(extensions || {}).length)
2629
+ if (options.headers) {
2630
+ options.headers = removeDuplicateHeaders(options.headers, http.preserveHeaderCase);
2631
+ }
2632
+ var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query;
2633
+ var body = { operationName, variables };
2634
+ if (http.includeExtensions)
2397
2635
  body.extensions = extensions;
2398
2636
  if (http.includeQuery)
2399
2637
  body.query = printer(query, print2);
@@ -2404,30 +2642,30 @@ function selectHttpOptionsAndBodyInternal(operation, printer, ...configs) {
2404
2642
  }
2405
2643
  function removeDuplicateHeaders(headers, preserveHeaderCase) {
2406
2644
  if (!preserveHeaderCase) {
2407
- const normalizedHeaders2 = {};
2408
- Object.keys(Object(headers)).forEach((name) => {
2409
- normalizedHeaders2[name.toLowerCase()] = headers[name];
2645
+ var normalizedHeaders_1 = {};
2646
+ Object.keys(Object(headers)).forEach(function(name) {
2647
+ normalizedHeaders_1[name.toLowerCase()] = headers[name];
2410
2648
  });
2411
- return normalizedHeaders2;
2649
+ return normalizedHeaders_1;
2412
2650
  }
2413
- const headerData = {};
2414
- Object.keys(Object(headers)).forEach((name) => {
2651
+ var headerData = {};
2652
+ Object.keys(Object(headers)).forEach(function(name) {
2415
2653
  headerData[name.toLowerCase()] = {
2416
2654
  originalName: name,
2417
2655
  value: headers[name]
2418
2656
  };
2419
2657
  });
2420
- const normalizedHeaders = {};
2421
- Object.keys(headerData).forEach((name) => {
2658
+ var normalizedHeaders = {};
2659
+ Object.keys(headerData).forEach(function(name) {
2422
2660
  normalizedHeaders[headerData[name].originalName] = headerData[name].value;
2423
2661
  });
2424
2662
  return normalizedHeaders;
2425
2663
  }
2426
2664
 
2427
2665
  // ../../node_modules/@apollo/client/link/http/selectURI.js
2428
- var selectURI = (operation, fallbackURI) => {
2429
- const context2 = operation.getContext();
2430
- const contextURI = context2.uri;
2666
+ var selectURI = function(operation, fallbackURI) {
2667
+ var context = operation.getContext();
2668
+ var contextURI = context.uri;
2431
2669
  if (contextURI) {
2432
2670
  return contextURI;
2433
2671
  } else if (typeof fallbackURI === "function") {
@@ -2437,54 +2675,13 @@ var selectURI = (operation, fallbackURI) => {
2437
2675
  }
2438
2676
  };
2439
2677
 
2440
- // ../../node_modules/@apollo/client/link/http/rewriteURIForGET.js
2441
- function rewriteURIForGET(chosenURI, body) {
2442
- const queryParams = [];
2443
- const addQueryParam = (key, value) => {
2444
- queryParams.push(`${key}=${encodeURIComponent(value)}`);
2445
- };
2446
- if ("query" in body) {
2447
- addQueryParam("query", body.query);
2448
- }
2449
- if (body.operationName) {
2450
- addQueryParam("operationName", body.operationName);
2451
- }
2452
- if (body.variables) {
2453
- let serializedVariables;
2454
- try {
2455
- serializedVariables = JSON.stringify(body.variables);
2456
- } catch (parseError) {
2457
- return { parseError };
2458
- }
2459
- addQueryParam("variables", serializedVariables);
2460
- }
2461
- if (body.extensions) {
2462
- let serializedExtensions;
2463
- try {
2464
- serializedExtensions = JSON.stringify(body.extensions);
2465
- } catch (parseError) {
2466
- return { parseError };
2467
- }
2468
- addQueryParam("extensions", serializedExtensions);
2469
- }
2470
- let fragment = "", preFragment = chosenURI;
2471
- const fragmentStart = chosenURI.indexOf("#");
2472
- if (fragmentStart !== -1) {
2473
- fragment = chosenURI.substr(fragmentStart);
2474
- preFragment = chosenURI.substr(0, fragmentStart);
2475
- }
2476
- const queryParamsPrefix = preFragment.indexOf("?") === -1 ? "?" : "&";
2477
- const newURI = preFragment + queryParamsPrefix + queryParams.join("&") + fragment;
2478
- return { newURI };
2479
- }
2480
-
2481
2678
  // ../../node_modules/is-plain-obj/index.js
2482
2679
  function isPlainObject(value) {
2483
2680
  if (typeof value !== "object" || value === null) {
2484
2681
  return false;
2485
2682
  }
2486
- const prototype = Object.getPrototypeOf(value);
2487
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
2683
+ const prototype2 = Object.getPrototypeOf(value);
2684
+ return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
2488
2685
  }
2489
2686
 
2490
2687
  // ../../node_modules/extract-files/extractFiles.mjs
@@ -2563,168 +2760,143 @@ function isExtractableFile(value) {
2563
2760
  return typeof File !== "undefined" && value instanceof File || typeof Blob !== "undefined" && value instanceof Blob;
2564
2761
  }
2565
2762
 
2566
- // ../../node_modules/apollo-upload-client/UploadHttpLink.mjs
2567
- var UploadHttpLink = class extends ApolloLink {
2568
- /**
2569
- * @param {object} options Options.
2570
- * @param {Parameters<typeof selectURI>[1]} [options.uri] GraphQL endpoint
2571
- * URI. Defaults to `"/graphql"`.
2572
- * @param {boolean} [options.useGETForQueries] Should GET be used to fetch
2573
- * queries, if there are no files to upload.
2574
- * @param {ExtractableFileMatcher} [options.isExtractableFile] Matches
2575
- * extractable files in the GraphQL operation. Defaults to
2576
- * {@linkcode isExtractableFile}.
2577
- * @param {typeof FormData} [options.FormData]
2578
- * [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData)
2579
- * class. Defaults to the {@linkcode FormData} global.
2580
- * @param {FormDataFileAppender} [options.formDataAppendFile]
2581
- * Customizes how extracted files are appended to the
2582
- * [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData)
2583
- * instance. Defaults to {@linkcode formDataAppendFile}.
2584
- * @param {BaseHttpLink.Printer} [options.print] Prints the GraphQL query or
2585
- * mutation AST to a string for transport. Defaults to
2586
- * {@linkcode defaultPrinter}.
2587
- * @param {typeof fetch} [options.fetch]
2588
- * [`fetch`](https://fetch.spec.whatwg.org) implementation. Defaults to the
2589
- * {@linkcode fetch} global.
2590
- * @param {RequestInit} [options.fetchOptions] `fetch` options; overridden by
2591
- * upload requirements.
2592
- * @param {string} [options.credentials] Overrides
2593
- * {@linkcode RequestInit.credentials credentials} in
2594
- * {@linkcode fetchOptions}.
2595
- * @param {{ [headerName: string]: string }} [options.headers] Merges with and
2596
- * overrides {@linkcode RequestInit.headers headers} in
2597
- * {@linkcode fetchOptions}.
2598
- * @param {boolean} [options.includeExtensions] Toggles sending `extensions`
2599
- * fields to the GraphQL server. Defaults to `false`.
2600
- * @param {boolean} [options.includeUnusedVariables] Toggles including unused
2601
- * GraphQL variables in the request. Defaults to `false`.
2602
- */
2603
- constructor({
2604
- uri: fetchUri = "/graphql",
2605
- useGETForQueries,
2606
- isExtractableFile: customIsExtractableFile = isExtractableFile,
2607
- FormData: CustomFormData,
2608
- formDataAppendFile: customFormDataAppendFile = formDataAppendFile,
2609
- print: print3 = defaultPrinter,
2610
- fetch: customFetch,
2611
- fetchOptions,
2763
+ // ../../node_modules/apollo-upload-client/createUploadLink.mjs
2764
+ function createUploadLink({
2765
+ uri: fetchUri = "/graphql",
2766
+ useGETForQueries,
2767
+ isExtractableFile: customIsExtractableFile = isExtractableFile,
2768
+ FormData: CustomFormData,
2769
+ formDataAppendFile: customFormDataAppendFile = formDataAppendFile,
2770
+ print: print3 = defaultPrinter,
2771
+ fetch: customFetch,
2772
+ fetchOptions,
2773
+ credentials,
2774
+ headers,
2775
+ includeExtensions
2776
+ } = {}) {
2777
+ const linkConfig = {
2778
+ http: { includeExtensions },
2779
+ options: fetchOptions,
2612
2780
  credentials,
2613
- headers,
2614
- includeExtensions,
2615
- includeUnusedVariables = false
2616
- } = {}) {
2617
- super(
2618
- (operation) => new Observable((observer) => {
2619
- const context2 = operation.getContext();
2620
- const { options, body } = selectHttpOptionsAndBodyInternal(
2621
- operation,
2622
- print3,
2623
- fallbackHttpConfig,
2624
- {
2625
- http: {
2626
- includeExtensions
2781
+ headers
2782
+ };
2783
+ return new ApolloLink((operation) => {
2784
+ const context = (
2785
+ /**
2786
+ * @type {import("@apollo/client/core/types.js").DefaultContext & {
2787
+ * clientAwareness?: {
2788
+ * name?: string,
2789
+ * version?: string,
2790
+ * },
2791
+ * }}
2792
+ */
2793
+ operation.getContext()
2794
+ );
2795
+ const {
2796
+ // Apollo Studio client awareness `name` and `version` can be configured
2797
+ // via `ApolloClient` constructor options:
2798
+ // https://www.apollographql.com/docs/graphos/metrics/client-awareness/#setup
2799
+ clientAwareness: { name, version: version2 } = {},
2800
+ headers: headers2
2801
+ } = context;
2802
+ const contextConfig = {
2803
+ http: context.http,
2804
+ options: context.fetchOptions,
2805
+ credentials: context.credentials,
2806
+ headers: {
2807
+ // Client awareness headers can be overridden by context `headers`.
2808
+ ...name && { "apollographql-client-name": name },
2809
+ ...version2 && { "apollographql-client-version": version2 },
2810
+ ...headers2
2811
+ }
2812
+ };
2813
+ const { options, body } = selectHttpOptionsAndBodyInternal(
2814
+ operation,
2815
+ print3,
2816
+ fallbackHttpConfig,
2817
+ linkConfig,
2818
+ contextConfig
2819
+ );
2820
+ const { clone, files } = extractFiles(body, customIsExtractableFile, "");
2821
+ let uri = selectURI(operation, fetchUri);
2822
+ if (files.size) {
2823
+ if (options.headers)
2824
+ delete options.headers["content-type"];
2825
+ const RuntimeFormData = CustomFormData || FormData;
2826
+ const form = new RuntimeFormData();
2827
+ form.append("operations", serializeFetchParameter(clone, "Payload"));
2828
+ const map = {};
2829
+ let i = 0;
2830
+ files.forEach((paths) => {
2831
+ map[++i] = paths;
2832
+ });
2833
+ form.append("map", JSON.stringify(map));
2834
+ i = 0;
2835
+ files.forEach((_paths, file) => {
2836
+ customFormDataAppendFile(form, String(++i), file);
2837
+ });
2838
+ options.body = form;
2839
+ } else {
2840
+ if (useGETForQueries && // If the operation contains some mutations GET shouldn’t be used.
2841
+ !operation.query.definitions.some(
2842
+ (definition) => definition.kind === "OperationDefinition" && definition.operation === "mutation"
2843
+ ))
2844
+ options.method = "GET";
2845
+ if (options.method === "GET") {
2846
+ const { newURI, parseError } = rewriteURIForGET(uri, body);
2847
+ if (parseError)
2848
+ return new Observable((observer) => {
2849
+ observer.error(parseError);
2850
+ });
2851
+ uri = newURI;
2852
+ } else options.body = serializeFetchParameter(clone, "Payload");
2853
+ }
2854
+ const { controller } = createSignalIfSupported();
2855
+ if (typeof controller !== "boolean") {
2856
+ if (options.signal)
2857
+ options.signal.aborted ? (
2858
+ // Signal already aborted, so immediately abort.
2859
+ controller.abort()
2860
+ ) : (
2861
+ // Signal not already aborted, so setup a listener to abort when it
2862
+ // does.
2863
+ options.signal.addEventListener(
2864
+ "abort",
2865
+ () => {
2866
+ controller.abort();
2627
2867
  },
2628
- options: fetchOptions,
2629
- credentials,
2630
- headers
2631
- },
2632
- {
2633
- http: context2.http,
2634
- options: context2.fetchOptions,
2635
- credentials: context2.credentials,
2636
- headers: context2.headers
2637
- }
2638
- );
2639
- if (body.variables && !includeUnusedVariables)
2640
- body.variables = filterOperationVariables(
2641
- body.variables,
2642
- operation.query
2643
- );
2644
- const { clone, files } = extractFiles(
2645
- body,
2646
- customIsExtractableFile,
2647
- ""
2868
+ {
2869
+ // Prevent a memory leak if the user configured abort controller
2870
+ // is long lasting, or controls multiple things.
2871
+ once: true
2872
+ }
2873
+ )
2648
2874
  );
2649
- let uri = selectURI(operation, fetchUri);
2650
- if (files.size) {
2651
- if (options.headers)
2652
- delete options.headers["content-type"];
2653
- const RuntimeFormData = CustomFormData || FormData;
2654
- const form = new RuntimeFormData();
2655
- form.append("operations", JSON.stringify(clone));
2656
- const map = {};
2657
- let i = 0;
2658
- files.forEach((paths) => {
2659
- map[++i] = paths;
2660
- });
2661
- form.append("map", JSON.stringify(map));
2662
- i = 0;
2663
- files.forEach((_paths, file) => {
2664
- customFormDataAppendFile(form, String(++i), file);
2665
- });
2666
- options.body = form;
2667
- } else {
2668
- if (useGETForQueries && // If the operation contains some mutations GET shouldn’t be used.
2669
- !operation.query.definitions.some(
2670
- (definition) => definition.kind === "OperationDefinition" && definition.operation === "mutation"
2671
- ))
2672
- options.method = "GET";
2673
- if (options.method === "GET") {
2674
- const result = (
2675
- /** @type {{ newURI: string } | { parseError: unknown }} */
2676
- // The return type is incorrect; `newURI` and `parseError`
2677
- // will never both be present.
2678
- rewriteURIForGET(uri, body)
2679
- );
2680
- if ("parseError" in result) throw result.parseError;
2681
- uri = result.newURI;
2682
- } else options.body = JSON.stringify(clone);
2683
- }
2684
- let controller;
2685
- if (typeof AbortController !== "undefined") {
2686
- controller = new AbortController();
2687
- if (options.signal)
2688
- options.signal.aborted ? (
2689
- // Signal already aborted, so immediately abort.
2690
- controller.abort()
2691
- ) : (
2692
- // Signal not already aborted, so setup a listener to abort
2693
- // when it does.
2694
- options.signal.addEventListener(
2695
- "abort",
2696
- () => {
2697
- controller.abort();
2698
- },
2699
- {
2700
- // Prevent a memory leak if the user configured abort
2701
- // controller is long lasting, or controls multiple
2702
- // things.
2703
- once: true
2704
- }
2705
- )
2706
- );
2707
- options.signal = controller.signal;
2875
+ options.signal = controller.signal;
2876
+ }
2877
+ const runtimeFetch = customFetch || fetch;
2878
+ return new Observable((observer) => {
2879
+ let cleaningUp;
2880
+ runtimeFetch(uri, options).then((response) => {
2881
+ operation.setContext({ response });
2882
+ return response;
2883
+ }).then(parseAndCheckHttpResponse(operation)).then((result2) => {
2884
+ observer.next(result2);
2885
+ observer.complete();
2886
+ }).catch((error) => {
2887
+ if (!cleaningUp) {
2888
+ if (error.result && error.result.errors && error.result.data)
2889
+ observer.next(error.result);
2890
+ observer.error(error);
2708
2891
  }
2709
- const runtimeFetch = customFetch || fetch;
2710
- let cleaningUp;
2711
- runtimeFetch(uri, options).then((response) => {
2712
- operation.setContext({ response });
2713
- return response;
2714
- }).then(parseAndCheckHttpResponse(operation)).then((result) => {
2715
- observer.next(result);
2716
- observer.complete();
2717
- }).catch((error) => {
2718
- if (!cleaningUp) observer.error(error);
2719
- });
2720
- return () => {
2721
- cleaningUp = true;
2722
- if (controller) controller.abort();
2723
- };
2724
- })
2725
- );
2726
- }
2727
- };
2892
+ });
2893
+ return () => {
2894
+ cleaningUp = true;
2895
+ if (typeof controller !== "boolean") controller.abort();
2896
+ };
2897
+ });
2898
+ });
2899
+ }
2728
2900
  export {
2729
- UploadHttpLink
2901
+ createUploadLink
2730
2902
  };