epicenter-libs 3.33.0 → 3.34.1

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 (76) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/browser/epicenter.js +105 -2
  3. package/dist/browser/epicenter.js.map +1 -1
  4. package/dist/cjs/epicenter.js +105 -2
  5. package/dist/cjs/epicenter.js.map +1 -1
  6. package/dist/epicenter.js +105 -2
  7. package/dist/epicenter.js.map +1 -1
  8. package/dist/epicenter.min.js +1 -1
  9. package/dist/epicenter.min.js.map +1 -1
  10. package/dist/module/epicenter.js +105 -2
  11. package/dist/module/epicenter.js.map +1 -1
  12. package/dist/types/adapters/chat.d.ts +63 -0
  13. package/package.json +1 -1
  14. package/src/adapters/chat.ts +95 -0
  15. package/src/utils/identification.ts +4 -0
  16. package/dist/test/_virtual/runtime.js +0 -3
  17. package/dist/test/_virtual/runtime2.js +0 -3
  18. package/dist/test/adapters/account.js +0 -169
  19. package/dist/test/adapters/admin.js +0 -53
  20. package/dist/test/adapters/asset.js +0 -425
  21. package/dist/test/adapters/authentication.js +0 -349
  22. package/dist/test/adapters/channel.js +0 -201
  23. package/dist/test/adapters/chat.js +0 -199
  24. package/dist/test/adapters/cometd.js +0 -514
  25. package/dist/test/adapters/consensus.js +0 -484
  26. package/dist/test/adapters/daily.js +0 -244
  27. package/dist/test/adapters/email.js +0 -179
  28. package/dist/test/adapters/episode.js +0 -175
  29. package/dist/test/adapters/group.js +0 -655
  30. package/dist/test/adapters/leaderboard.js +0 -162
  31. package/dist/test/adapters/matchmaker.js +0 -159
  32. package/dist/test/adapters/presence.js +0 -85
  33. package/dist/test/adapters/project.js +0 -94
  34. package/dist/test/adapters/recaptcha.js +0 -24
  35. package/dist/test/adapters/run.js +0 -1008
  36. package/dist/test/adapters/somebody.js +0 -154
  37. package/dist/test/adapters/task.js +0 -192
  38. package/dist/test/adapters/time.js +0 -28
  39. package/dist/test/adapters/user.js +0 -105
  40. package/dist/test/adapters/vault.js +0 -403
  41. package/dist/test/adapters/video.js +0 -249
  42. package/dist/test/adapters/vonage.js +0 -130
  43. package/dist/test/adapters/wallet.js +0 -130
  44. package/dist/test/adapters/world.js +0 -507
  45. package/dist/test/apis/video.js +0 -294
  46. package/dist/test/apis/vonage.js +0 -121
  47. package/dist/test/epicenter.js +0 -121
  48. package/dist/test/node_modules/@babel/runtime/helpers/esm/defineProperty.js +0 -12
  49. package/dist/test/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -14
  50. package/dist/test/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -9
  51. package/dist/test/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -11
  52. package/dist/test/node_modules/cometd/AckExtension.js +0 -91
  53. package/dist/test/node_modules/cometd/CallbackPollingTransport.js +0 -148
  54. package/dist/test/node_modules/cometd/Client.js +0 -2160
  55. package/dist/test/node_modules/cometd/Extension.js +0 -47
  56. package/dist/test/node_modules/cometd/LongPollingTransport.js +0 -135
  57. package/dist/test/node_modules/cometd/ReloadExtension.js +0 -214
  58. package/dist/test/node_modules/cometd/RequestTransport.js +0 -252
  59. package/dist/test/node_modules/cometd/Transport.js +0 -167
  60. package/dist/test/node_modules/cometd/TransportRegistry.js +0 -107
  61. package/dist/test/node_modules/cometd/WebSocketTransport.js +0 -384
  62. package/dist/test/node_modules/cometd/cometd.js +0 -9
  63. package/dist/test/node_modules/regenerator-runtime/runtime.js +0 -773
  64. package/dist/test/utilities.js +0 -17
  65. package/dist/test/utils/config.js +0 -189
  66. package/dist/test/utils/constants.js +0 -293
  67. package/dist/test/utils/cookies.js +0 -75
  68. package/dist/test/utils/error-manager.js +0 -57
  69. package/dist/test/utils/error.js +0 -12
  70. package/dist/test/utils/fault.js +0 -34
  71. package/dist/test/utils/filter-parser.js +0 -68
  72. package/dist/test/utils/helpers.js +0 -9
  73. package/dist/test/utils/identification.js +0 -161
  74. package/dist/test/utils/result.js +0 -20
  75. package/dist/test/utils/router.js +0 -551
  76. package/dist/test/utils/store.js +0 -79
@@ -1,773 +0,0 @@
1
- import { __module as runtime } from '../../_virtual/runtime2.js';
2
-
3
- /**
4
- * Copyright (c) 2014-present, Facebook, Inc.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
9
-
10
- var hasRequiredRuntime;
11
-
12
- function requireRuntime () {
13
- if (hasRequiredRuntime) return runtime.exports;
14
- hasRequiredRuntime = 1;
15
- (function (module) {
16
- var runtime = (function (exports$1) {
17
-
18
- var Op = Object.prototype;
19
- var hasOwn = Op.hasOwnProperty;
20
- var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; };
21
- var undefined$1; // More compressible than void 0.
22
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
23
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
24
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
25
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
26
-
27
- function define(obj, key, value) {
28
- Object.defineProperty(obj, key, {
29
- value: value,
30
- enumerable: true,
31
- configurable: true,
32
- writable: true
33
- });
34
- return obj[key];
35
- }
36
- try {
37
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
38
- define({}, "");
39
- } catch (err) {
40
- define = function(obj, key, value) {
41
- return obj[key] = value;
42
- };
43
- }
44
-
45
- function wrap(innerFn, outerFn, self, tryLocsList) {
46
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
47
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
48
- var generator = Object.create(protoGenerator.prototype);
49
- var context = new Context(tryLocsList || []);
50
-
51
- // The ._invoke method unifies the implementations of the .next,
52
- // .throw, and .return methods.
53
- defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) });
54
-
55
- return generator;
56
- }
57
- exports$1.wrap = wrap;
58
-
59
- // Try/catch helper to minimize deoptimizations. Returns a completion
60
- // record like context.tryEntries[i].completion. This interface could
61
- // have been (and was previously) designed to take a closure to be
62
- // invoked without arguments, but in all the cases we care about we
63
- // already have an existing method we want to call, so there's no need
64
- // to create a new function object. We can even get away with assuming
65
- // the method takes exactly one argument, since that happens to be true
66
- // in every case, so we don't have to touch the arguments object. The
67
- // only additional allocation required is the completion record, which
68
- // has a stable shape and so hopefully should be cheap to allocate.
69
- function tryCatch(fn, obj, arg) {
70
- try {
71
- return { type: "normal", arg: fn.call(obj, arg) };
72
- } catch (err) {
73
- return { type: "throw", arg: err };
74
- }
75
- }
76
-
77
- var GenStateSuspendedStart = "suspendedStart";
78
- var GenStateSuspendedYield = "suspendedYield";
79
- var GenStateExecuting = "executing";
80
- var GenStateCompleted = "completed";
81
-
82
- // Returning this object from the innerFn has the same effect as
83
- // breaking out of the dispatch switch statement.
84
- var ContinueSentinel = {};
85
-
86
- // Dummy constructor functions that we use as the .constructor and
87
- // .constructor.prototype properties for functions that return Generator
88
- // objects. For full spec compliance, you may wish to configure your
89
- // minifier not to mangle the names of these two functions.
90
- function Generator() {}
91
- function GeneratorFunction() {}
92
- function GeneratorFunctionPrototype() {}
93
-
94
- // This is a polyfill for %IteratorPrototype% for environments that
95
- // don't natively support it.
96
- var IteratorPrototype = {};
97
- define(IteratorPrototype, iteratorSymbol, function () {
98
- return this;
99
- });
100
-
101
- var getProto = Object.getPrototypeOf;
102
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
103
- if (NativeIteratorPrototype &&
104
- NativeIteratorPrototype !== Op &&
105
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
106
- // This environment has a native %IteratorPrototype%; use it instead
107
- // of the polyfill.
108
- IteratorPrototype = NativeIteratorPrototype;
109
- }
110
-
111
- var Gp = GeneratorFunctionPrototype.prototype =
112
- Generator.prototype = Object.create(IteratorPrototype);
113
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
114
- defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true });
115
- defineProperty(
116
- GeneratorFunctionPrototype,
117
- "constructor",
118
- { value: GeneratorFunction, configurable: true }
119
- );
120
- GeneratorFunction.displayName = define(
121
- GeneratorFunctionPrototype,
122
- toStringTagSymbol,
123
- "GeneratorFunction"
124
- );
125
-
126
- // Helper for defining the .next, .throw, and .return methods of the
127
- // Iterator interface in terms of a single ._invoke method.
128
- function defineIteratorMethods(prototype) {
129
- ["next", "throw", "return"].forEach(function(method) {
130
- define(prototype, method, function(arg) {
131
- return this._invoke(method, arg);
132
- });
133
- });
134
- }
135
-
136
- exports$1.isGeneratorFunction = function(genFun) {
137
- var ctor = typeof genFun === "function" && genFun.constructor;
138
- return ctor
139
- ? ctor === GeneratorFunction ||
140
- // For the native GeneratorFunction constructor, the best we can
141
- // do is to check its .name property.
142
- (ctor.displayName || ctor.name) === "GeneratorFunction"
143
- : false;
144
- };
145
-
146
- exports$1.mark = function(genFun) {
147
- if (Object.setPrototypeOf) {
148
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
149
- } else {
150
- genFun.__proto__ = GeneratorFunctionPrototype;
151
- define(genFun, toStringTagSymbol, "GeneratorFunction");
152
- }
153
- genFun.prototype = Object.create(Gp);
154
- return genFun;
155
- };
156
-
157
- // Within the body of any async function, `await x` is transformed to
158
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
159
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
160
- // meant to be awaited.
161
- exports$1.awrap = function(arg) {
162
- return { __await: arg };
163
- };
164
-
165
- function AsyncIterator(generator, PromiseImpl) {
166
- function invoke(method, arg, resolve, reject) {
167
- var record = tryCatch(generator[method], generator, arg);
168
- if (record.type === "throw") {
169
- reject(record.arg);
170
- } else {
171
- var result = record.arg;
172
- var value = result.value;
173
- if (value &&
174
- typeof value === "object" &&
175
- hasOwn.call(value, "__await")) {
176
- return PromiseImpl.resolve(value.__await).then(function(value) {
177
- invoke("next", value, resolve, reject);
178
- }, function(err) {
179
- invoke("throw", err, resolve, reject);
180
- });
181
- }
182
-
183
- return PromiseImpl.resolve(value).then(function(unwrapped) {
184
- // When a yielded Promise is resolved, its final value becomes
185
- // the .value of the Promise<{value,done}> result for the
186
- // current iteration.
187
- result.value = unwrapped;
188
- resolve(result);
189
- }, function(error) {
190
- // If a rejected Promise was yielded, throw the rejection back
191
- // into the async generator function so it can be handled there.
192
- return invoke("throw", error, resolve, reject);
193
- });
194
- }
195
- }
196
-
197
- var previousPromise;
198
-
199
- function enqueue(method, arg) {
200
- function callInvokeWithMethodAndArg() {
201
- return new PromiseImpl(function(resolve, reject) {
202
- invoke(method, arg, resolve, reject);
203
- });
204
- }
205
-
206
- return previousPromise =
207
- // If enqueue has been called before, then we want to wait until
208
- // all previous Promises have been resolved before calling invoke,
209
- // so that results are always delivered in the correct order. If
210
- // enqueue has not been called before, then it is important to
211
- // call invoke immediately, without waiting on a callback to fire,
212
- // so that the async generator function has the opportunity to do
213
- // any necessary setup in a predictable way. This predictability
214
- // is why the Promise constructor synchronously invokes its
215
- // executor callback, and why async functions synchronously
216
- // execute code before the first await. Since we implement simple
217
- // async functions in terms of async generators, it is especially
218
- // important to get this right, even though it requires care.
219
- previousPromise ? previousPromise.then(
220
- callInvokeWithMethodAndArg,
221
- // Avoid propagating failures to Promises returned by later
222
- // invocations of the iterator.
223
- callInvokeWithMethodAndArg
224
- ) : callInvokeWithMethodAndArg();
225
- }
226
-
227
- // Define the unified helper method that is used to implement .next,
228
- // .throw, and .return (see defineIteratorMethods).
229
- defineProperty(this, "_invoke", { value: enqueue });
230
- }
231
-
232
- defineIteratorMethods(AsyncIterator.prototype);
233
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
234
- return this;
235
- });
236
- exports$1.AsyncIterator = AsyncIterator;
237
-
238
- // Note that simple async functions are implemented on top of
239
- // AsyncIterator objects; they just return a Promise for the value of
240
- // the final result produced by the iterator.
241
- exports$1.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
242
- if (PromiseImpl === void 0) PromiseImpl = Promise;
243
-
244
- var iter = new AsyncIterator(
245
- wrap(innerFn, outerFn, self, tryLocsList),
246
- PromiseImpl
247
- );
248
-
249
- return exports$1.isGeneratorFunction(outerFn)
250
- ? iter // If outerFn is a generator, return the full iterator.
251
- : iter.next().then(function(result) {
252
- return result.done ? result.value : iter.next();
253
- });
254
- };
255
-
256
- function makeInvokeMethod(innerFn, self, context) {
257
- var state = GenStateSuspendedStart;
258
-
259
- return function invoke(method, arg) {
260
- if (state === GenStateExecuting) {
261
- throw new Error("Generator is already running");
262
- }
263
-
264
- if (state === GenStateCompleted) {
265
- if (method === "throw") {
266
- throw arg;
267
- }
268
-
269
- // Be forgiving, per GeneratorResume behavior specified since ES2015:
270
- // ES2015 spec, step 3: https://262.ecma-international.org/6.0/#sec-generatorresume
271
- // Latest spec, step 2: https://tc39.es/ecma262/#sec-generatorresume
272
- return doneResult();
273
- }
274
-
275
- context.method = method;
276
- context.arg = arg;
277
-
278
- while (true) {
279
- var delegate = context.delegate;
280
- if (delegate) {
281
- var delegateResult = maybeInvokeDelegate(delegate, context);
282
- if (delegateResult) {
283
- if (delegateResult === ContinueSentinel) continue;
284
- return delegateResult;
285
- }
286
- }
287
-
288
- if (context.method === "next") {
289
- // Setting context._sent for legacy support of Babel's
290
- // function.sent implementation.
291
- context.sent = context._sent = context.arg;
292
-
293
- } else if (context.method === "throw") {
294
- if (state === GenStateSuspendedStart) {
295
- state = GenStateCompleted;
296
- throw context.arg;
297
- }
298
-
299
- context.dispatchException(context.arg);
300
-
301
- } else if (context.method === "return") {
302
- context.abrupt("return", context.arg);
303
- }
304
-
305
- state = GenStateExecuting;
306
-
307
- var record = tryCatch(innerFn, self, context);
308
- if (record.type === "normal") {
309
- // If an exception is thrown from innerFn, we leave state ===
310
- // GenStateExecuting and loop back for another invocation.
311
- state = context.done
312
- ? GenStateCompleted
313
- : GenStateSuspendedYield;
314
-
315
- if (record.arg === ContinueSentinel) {
316
- continue;
317
- }
318
-
319
- return {
320
- value: record.arg,
321
- done: context.done
322
- };
323
-
324
- } else if (record.type === "throw") {
325
- state = GenStateCompleted;
326
- // Dispatch the exception by looping back around to the
327
- // context.dispatchException(context.arg) call above.
328
- context.method = "throw";
329
- context.arg = record.arg;
330
- }
331
- }
332
- };
333
- }
334
-
335
- // Call delegate.iterator[context.method](context.arg) and handle the
336
- // result, either by returning a { value, done } result from the
337
- // delegate iterator, or by modifying context.method and context.arg,
338
- // setting context.delegate to null, and returning the ContinueSentinel.
339
- function maybeInvokeDelegate(delegate, context) {
340
- var methodName = context.method;
341
- var method = delegate.iterator[methodName];
342
- if (method === undefined$1) {
343
- // A .throw or .return when the delegate iterator has no .throw
344
- // method, or a missing .next method, always terminate the
345
- // yield* loop.
346
- context.delegate = null;
347
-
348
- // Note: ["return"] must be used for ES3 parsing compatibility.
349
- if (methodName === "throw" && delegate.iterator["return"]) {
350
- // If the delegate iterator has a return method, give it a
351
- // chance to clean up.
352
- context.method = "return";
353
- context.arg = undefined$1;
354
- maybeInvokeDelegate(delegate, context);
355
-
356
- if (context.method === "throw") {
357
- // If maybeInvokeDelegate(context) changed context.method from
358
- // "return" to "throw", let that override the TypeError below.
359
- return ContinueSentinel;
360
- }
361
- }
362
- if (methodName !== "return") {
363
- context.method = "throw";
364
- context.arg = new TypeError(
365
- "The iterator does not provide a '" + methodName + "' method");
366
- }
367
-
368
- return ContinueSentinel;
369
- }
370
-
371
- var record = tryCatch(method, delegate.iterator, context.arg);
372
-
373
- if (record.type === "throw") {
374
- context.method = "throw";
375
- context.arg = record.arg;
376
- context.delegate = null;
377
- return ContinueSentinel;
378
- }
379
-
380
- var info = record.arg;
381
-
382
- if (! info) {
383
- context.method = "throw";
384
- context.arg = new TypeError("iterator result is not an object");
385
- context.delegate = null;
386
- return ContinueSentinel;
387
- }
388
-
389
- if (info.done) {
390
- // Assign the result of the finished delegate to the temporary
391
- // variable specified by delegate.resultName (see delegateYield).
392
- context[delegate.resultName] = info.value;
393
-
394
- // Resume execution at the desired location (see delegateYield).
395
- context.next = delegate.nextLoc;
396
-
397
- // If context.method was "throw" but the delegate handled the
398
- // exception, let the outer generator proceed normally. If
399
- // context.method was "next", forget context.arg since it has been
400
- // "consumed" by the delegate iterator. If context.method was
401
- // "return", allow the original .return call to continue in the
402
- // outer generator.
403
- if (context.method !== "return") {
404
- context.method = "next";
405
- context.arg = undefined$1;
406
- }
407
-
408
- } else {
409
- // Re-yield the result returned by the delegate method.
410
- return info;
411
- }
412
-
413
- // The delegate iterator is finished, so forget it and continue with
414
- // the outer generator.
415
- context.delegate = null;
416
- return ContinueSentinel;
417
- }
418
-
419
- // Define Generator.prototype.{next,throw,return} in terms of the
420
- // unified ._invoke helper method.
421
- defineIteratorMethods(Gp);
422
-
423
- define(Gp, toStringTagSymbol, "Generator");
424
-
425
- // A Generator should always return itself as the iterator object when the
426
- // @@iterator function is called on it. Some browsers' implementations of the
427
- // iterator prototype chain incorrectly implement this, causing the Generator
428
- // object to not be returned from this call. This ensures that doesn't happen.
429
- // See https://github.com/facebook/regenerator/issues/274 for more details.
430
- define(Gp, iteratorSymbol, function() {
431
- return this;
432
- });
433
-
434
- define(Gp, "toString", function() {
435
- return "[object Generator]";
436
- });
437
-
438
- function pushTryEntry(locs) {
439
- var entry = { tryLoc: locs[0] };
440
-
441
- if (1 in locs) {
442
- entry.catchLoc = locs[1];
443
- }
444
-
445
- if (2 in locs) {
446
- entry.finallyLoc = locs[2];
447
- entry.afterLoc = locs[3];
448
- }
449
-
450
- this.tryEntries.push(entry);
451
- }
452
-
453
- function resetTryEntry(entry) {
454
- var record = entry.completion || {};
455
- record.type = "normal";
456
- delete record.arg;
457
- entry.completion = record;
458
- }
459
-
460
- function Context(tryLocsList) {
461
- // The root entry object (effectively a try statement without a catch
462
- // or a finally block) gives us a place to store values thrown from
463
- // locations where there is no enclosing try statement.
464
- this.tryEntries = [{ tryLoc: "root" }];
465
- tryLocsList.forEach(pushTryEntry, this);
466
- this.reset(true);
467
- }
468
-
469
- exports$1.keys = function(val) {
470
- var object = Object(val);
471
- var keys = [];
472
- for (var key in object) {
473
- keys.push(key);
474
- }
475
- keys.reverse();
476
-
477
- // Rather than returning an object with a next method, we keep
478
- // things simple and return the next function itself.
479
- return function next() {
480
- while (keys.length) {
481
- var key = keys.pop();
482
- if (key in object) {
483
- next.value = key;
484
- next.done = false;
485
- return next;
486
- }
487
- }
488
-
489
- // To avoid creating an additional object, we just hang the .value
490
- // and .done properties off the next function object itself. This
491
- // also ensures that the minifier will not anonymize the function.
492
- next.done = true;
493
- return next;
494
- };
495
- };
496
-
497
- function values(iterable) {
498
- if (iterable != null) {
499
- var iteratorMethod = iterable[iteratorSymbol];
500
- if (iteratorMethod) {
501
- return iteratorMethod.call(iterable);
502
- }
503
-
504
- if (typeof iterable.next === "function") {
505
- return iterable;
506
- }
507
-
508
- if (!isNaN(iterable.length)) {
509
- var i = -1, next = function next() {
510
- while (++i < iterable.length) {
511
- if (hasOwn.call(iterable, i)) {
512
- next.value = iterable[i];
513
- next.done = false;
514
- return next;
515
- }
516
- }
517
-
518
- next.value = undefined$1;
519
- next.done = true;
520
-
521
- return next;
522
- };
523
-
524
- return next.next = next;
525
- }
526
- }
527
-
528
- throw new TypeError(typeof iterable + " is not iterable");
529
- }
530
- exports$1.values = values;
531
-
532
- function doneResult() {
533
- return { value: undefined$1, done: true };
534
- }
535
-
536
- Context.prototype = {
537
- constructor: Context,
538
-
539
- reset: function(skipTempReset) {
540
- this.prev = 0;
541
- this.next = 0;
542
- // Resetting context._sent for legacy support of Babel's
543
- // function.sent implementation.
544
- this.sent = this._sent = undefined$1;
545
- this.done = false;
546
- this.delegate = null;
547
-
548
- this.method = "next";
549
- this.arg = undefined$1;
550
-
551
- this.tryEntries.forEach(resetTryEntry);
552
-
553
- if (!skipTempReset) {
554
- for (var name in this) {
555
- // Not sure about the optimal order of these conditions:
556
- if (name.charAt(0) === "t" &&
557
- hasOwn.call(this, name) &&
558
- !isNaN(+name.slice(1))) {
559
- this[name] = undefined$1;
560
- }
561
- }
562
- }
563
- },
564
-
565
- stop: function() {
566
- this.done = true;
567
-
568
- var rootEntry = this.tryEntries[0];
569
- var rootRecord = rootEntry.completion;
570
- if (rootRecord.type === "throw") {
571
- throw rootRecord.arg;
572
- }
573
-
574
- return this.rval;
575
- },
576
-
577
- dispatchException: function(exception) {
578
- if (this.done) {
579
- throw exception;
580
- }
581
-
582
- var context = this;
583
- function handle(loc, caught) {
584
- record.type = "throw";
585
- record.arg = exception;
586
- context.next = loc;
587
-
588
- if (caught) {
589
- // If the dispatched exception was caught by a catch block,
590
- // then let that catch block handle the exception normally.
591
- context.method = "next";
592
- context.arg = undefined$1;
593
- }
594
-
595
- return !! caught;
596
- }
597
-
598
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
599
- var entry = this.tryEntries[i];
600
- var record = entry.completion;
601
-
602
- if (entry.tryLoc === "root") {
603
- // Exception thrown outside of any try block that could handle
604
- // it, so set the completion value of the entire function to
605
- // throw the exception.
606
- return handle("end");
607
- }
608
-
609
- if (entry.tryLoc <= this.prev) {
610
- var hasCatch = hasOwn.call(entry, "catchLoc");
611
- var hasFinally = hasOwn.call(entry, "finallyLoc");
612
-
613
- if (hasCatch && hasFinally) {
614
- if (this.prev < entry.catchLoc) {
615
- return handle(entry.catchLoc, true);
616
- } else if (this.prev < entry.finallyLoc) {
617
- return handle(entry.finallyLoc);
618
- }
619
-
620
- } else if (hasCatch) {
621
- if (this.prev < entry.catchLoc) {
622
- return handle(entry.catchLoc, true);
623
- }
624
-
625
- } else if (hasFinally) {
626
- if (this.prev < entry.finallyLoc) {
627
- return handle(entry.finallyLoc);
628
- }
629
-
630
- } else {
631
- throw new Error("try statement without catch or finally");
632
- }
633
- }
634
- }
635
- },
636
-
637
- abrupt: function(type, arg) {
638
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
639
- var entry = this.tryEntries[i];
640
- if (entry.tryLoc <= this.prev &&
641
- hasOwn.call(entry, "finallyLoc") &&
642
- this.prev < entry.finallyLoc) {
643
- var finallyEntry = entry;
644
- break;
645
- }
646
- }
647
-
648
- if (finallyEntry &&
649
- (type === "break" ||
650
- type === "continue") &&
651
- finallyEntry.tryLoc <= arg &&
652
- arg <= finallyEntry.finallyLoc) {
653
- // Ignore the finally entry if control is not jumping to a
654
- // location outside the try/catch block.
655
- finallyEntry = null;
656
- }
657
-
658
- var record = finallyEntry ? finallyEntry.completion : {};
659
- record.type = type;
660
- record.arg = arg;
661
-
662
- if (finallyEntry) {
663
- this.method = "next";
664
- this.next = finallyEntry.finallyLoc;
665
- return ContinueSentinel;
666
- }
667
-
668
- return this.complete(record);
669
- },
670
-
671
- complete: function(record, afterLoc) {
672
- if (record.type === "throw") {
673
- throw record.arg;
674
- }
675
-
676
- if (record.type === "break" ||
677
- record.type === "continue") {
678
- this.next = record.arg;
679
- } else if (record.type === "return") {
680
- this.rval = this.arg = record.arg;
681
- this.method = "return";
682
- this.next = "end";
683
- } else if (record.type === "normal" && afterLoc) {
684
- this.next = afterLoc;
685
- }
686
-
687
- return ContinueSentinel;
688
- },
689
-
690
- finish: function(finallyLoc) {
691
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
692
- var entry = this.tryEntries[i];
693
- if (entry.finallyLoc === finallyLoc) {
694
- this.complete(entry.completion, entry.afterLoc);
695
- resetTryEntry(entry);
696
- return ContinueSentinel;
697
- }
698
- }
699
- },
700
-
701
- "catch": function(tryLoc) {
702
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
703
- var entry = this.tryEntries[i];
704
- if (entry.tryLoc === tryLoc) {
705
- var record = entry.completion;
706
- if (record.type === "throw") {
707
- var thrown = record.arg;
708
- resetTryEntry(entry);
709
- }
710
- return thrown;
711
- }
712
- }
713
-
714
- // The context.catch method must only be called with a location
715
- // argument that corresponds to a known catch block.
716
- throw new Error("illegal catch attempt");
717
- },
718
-
719
- delegateYield: function(iterable, resultName, nextLoc) {
720
- this.delegate = {
721
- iterator: values(iterable),
722
- resultName: resultName,
723
- nextLoc: nextLoc
724
- };
725
-
726
- if (this.method === "next") {
727
- // Deliberately forget the last sent value so that we don't
728
- // accidentally pass it on to the delegate.
729
- this.arg = undefined$1;
730
- }
731
-
732
- return ContinueSentinel;
733
- }
734
- };
735
-
736
- // Regardless of whether this script is executing as a CommonJS module
737
- // or not, return the runtime object so that we can declare the variable
738
- // regeneratorRuntime in the outer scope, which allows this module to be
739
- // injected easily by `bin/regenerator --include-runtime script.js`.
740
- return exports$1;
741
-
742
- }(
743
- // If this script is executing as a CommonJS module, use module.exports
744
- // as the regeneratorRuntime namespace. Otherwise create a new empty
745
- // object. Either way, the resulting object will be used to initialize
746
- // the regeneratorRuntime variable at the top of this file.
747
- module.exports
748
- ));
749
-
750
- try {
751
- regeneratorRuntime = runtime;
752
- } catch (accidentalStrictMode) {
753
- // This module should not be running in strict mode, so the above
754
- // assignment should always work unless something is misconfigured. Just
755
- // in case runtime.js accidentally runs in strict mode, in modern engines
756
- // we can explicitly access globalThis. In older engines we can escape
757
- // strict mode using a global Function call. This could conceivably fail
758
- // if a Content Security Policy forbids using Function, but in that case
759
- // the proper solution is to fix the accidental strict mode problem. If
760
- // you've misconfigured your bundler to force strict mode and applied a
761
- // CSP to forbid Function, and you're not willing to fix either of those
762
- // problems, please detail your unique predicament in a GitHub issue.
763
- if (typeof globalThis === "object") {
764
- globalThis.regeneratorRuntime = runtime;
765
- } else {
766
- Function("r", "regeneratorRuntime = r")(runtime);
767
- }
768
- }
769
- } (runtime));
770
- return runtime.exports;
771
- }
772
-
773
- export { requireRuntime as __require };