@plasmicpkgs/commerce-local 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/dist/commerce-local.cjs.development.js +590 -622
- package/dist/commerce-local.cjs.development.js.map +1 -1
- package/dist/commerce-local.cjs.production.min.js +1 -1
- package/dist/commerce-local.cjs.production.min.js.map +1 -1
- package/dist/commerce-local.esm.js +590 -622
- package/dist/commerce-local.esm.js.map +1 -1
- package/package.json +4 -3
|
@@ -105,201 +105,198 @@ function createCommonjsModule(fn, module) {
|
|
|
105
105
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
var runtime_1 = createCommonjsModule(function (module) {
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
try {
|
|
136
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
137
|
-
define({}, "");
|
|
138
|
-
} catch (err) {
|
|
139
|
-
define = function(obj, key, value) {
|
|
140
|
-
return obj[key] = value;
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
145
|
-
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
146
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
147
|
-
var generator = Object.create(protoGenerator.prototype);
|
|
148
|
-
var context = new Context(tryLocsList || []);
|
|
149
|
-
|
|
150
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
151
|
-
// .throw, and .return methods.
|
|
152
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
108
|
+
var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
109
|
+
/**
|
|
110
|
+
* Copyright (c) 2014-present, Facebook, Inc.
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the MIT license found in the
|
|
113
|
+
* LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/
|
|
115
|
+
var runtime = function (exports) {
|
|
116
|
+
|
|
117
|
+
var Op = Object.prototype;
|
|
118
|
+
var hasOwn = Op.hasOwnProperty;
|
|
119
|
+
var undefined$1; // More compressible than void 0.
|
|
120
|
+
|
|
121
|
+
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
122
|
+
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
123
|
+
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
124
|
+
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
125
|
+
|
|
126
|
+
function define(obj, key, value) {
|
|
127
|
+
Object.defineProperty(obj, key, {
|
|
128
|
+
value: value,
|
|
129
|
+
enumerable: true,
|
|
130
|
+
configurable: true,
|
|
131
|
+
writable: true
|
|
132
|
+
});
|
|
133
|
+
return obj[key];
|
|
134
|
+
}
|
|
153
135
|
|
|
154
|
-
return generator;
|
|
155
|
-
}
|
|
156
|
-
exports.wrap = wrap;
|
|
157
|
-
|
|
158
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
159
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
160
|
-
// have been (and was previously) designed to take a closure to be
|
|
161
|
-
// invoked without arguments, but in all the cases we care about we
|
|
162
|
-
// already have an existing method we want to call, so there's no need
|
|
163
|
-
// to create a new function object. We can even get away with assuming
|
|
164
|
-
// the method takes exactly one argument, since that happens to be true
|
|
165
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
166
|
-
// only additional allocation required is the completion record, which
|
|
167
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
168
|
-
function tryCatch(fn, obj, arg) {
|
|
169
136
|
try {
|
|
170
|
-
|
|
137
|
+
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
138
|
+
define({}, "");
|
|
171
139
|
} catch (err) {
|
|
172
|
-
|
|
140
|
+
define = function define(obj, key, value) {
|
|
141
|
+
return obj[key] = value;
|
|
142
|
+
};
|
|
173
143
|
}
|
|
174
|
-
}
|
|
175
144
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
// breaking out of the dispatch switch statement.
|
|
183
|
-
var ContinueSentinel = {};
|
|
184
|
-
|
|
185
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
186
|
-
// .constructor.prototype properties for functions that return Generator
|
|
187
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
188
|
-
// minifier not to mangle the names of these two functions.
|
|
189
|
-
function Generator() {}
|
|
190
|
-
function GeneratorFunction() {}
|
|
191
|
-
function GeneratorFunctionPrototype() {}
|
|
192
|
-
|
|
193
|
-
// This is a polyfill for %IteratorPrototype% for environments that
|
|
194
|
-
// don't natively support it.
|
|
195
|
-
var IteratorPrototype = {};
|
|
196
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
197
|
-
return this;
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
var getProto = Object.getPrototypeOf;
|
|
201
|
-
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
202
|
-
if (NativeIteratorPrototype &&
|
|
203
|
-
NativeIteratorPrototype !== Op &&
|
|
204
|
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
205
|
-
// This environment has a native %IteratorPrototype%; use it instead
|
|
206
|
-
// of the polyfill.
|
|
207
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
208
|
-
}
|
|
145
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
146
|
+
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
147
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
148
|
+
var generator = Object.create(protoGenerator.prototype);
|
|
149
|
+
var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
|
|
150
|
+
// .throw, and .return methods.
|
|
209
151
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
214
|
-
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
215
|
-
GeneratorFunction.displayName = define(
|
|
216
|
-
GeneratorFunctionPrototype,
|
|
217
|
-
toStringTagSymbol,
|
|
218
|
-
"GeneratorFunction"
|
|
219
|
-
);
|
|
220
|
-
|
|
221
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
222
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
223
|
-
function defineIteratorMethods(prototype) {
|
|
224
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
225
|
-
define(prototype, method, function(arg) {
|
|
226
|
-
return this._invoke(method, arg);
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
}
|
|
152
|
+
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
153
|
+
return generator;
|
|
154
|
+
}
|
|
230
155
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
156
|
+
exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
|
|
157
|
+
// record like context.tryEntries[i].completion. This interface could
|
|
158
|
+
// have been (and was previously) designed to take a closure to be
|
|
159
|
+
// invoked without arguments, but in all the cases we care about we
|
|
160
|
+
// already have an existing method we want to call, so there's no need
|
|
161
|
+
// to create a new function object. We can even get away with assuming
|
|
162
|
+
// the method takes exactly one argument, since that happens to be true
|
|
163
|
+
// in every case, so we don't have to touch the arguments object. The
|
|
164
|
+
// only additional allocation required is the completion record, which
|
|
165
|
+
// has a stable shape and so hopefully should be cheap to allocate.
|
|
166
|
+
|
|
167
|
+
function tryCatch(fn, obj, arg) {
|
|
168
|
+
try {
|
|
169
|
+
return {
|
|
170
|
+
type: "normal",
|
|
171
|
+
arg: fn.call(obj, arg)
|
|
172
|
+
};
|
|
173
|
+
} catch (err) {
|
|
174
|
+
return {
|
|
175
|
+
type: "throw",
|
|
176
|
+
arg: err
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
var GenStateSuspendedStart = "suspendedStart";
|
|
182
|
+
var GenStateSuspendedYield = "suspendedYield";
|
|
183
|
+
var GenStateExecuting = "executing";
|
|
184
|
+
var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
|
|
185
|
+
// breaking out of the dispatch switch statement.
|
|
186
|
+
|
|
187
|
+
var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
|
|
188
|
+
// .constructor.prototype properties for functions that return Generator
|
|
189
|
+
// objects. For full spec compliance, you may wish to configure your
|
|
190
|
+
// minifier not to mangle the names of these two functions.
|
|
191
|
+
|
|
192
|
+
function Generator() {}
|
|
193
|
+
|
|
194
|
+
function GeneratorFunction() {}
|
|
195
|
+
|
|
196
|
+
function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
|
|
197
|
+
// don't natively support it.
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
var IteratorPrototype = {};
|
|
240
201
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
202
|
+
IteratorPrototype[iteratorSymbol] = function () {
|
|
203
|
+
return this;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
var getProto = Object.getPrototypeOf;
|
|
207
|
+
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
208
|
+
|
|
209
|
+
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
210
|
+
// This environment has a native %IteratorPrototype%; use it instead
|
|
211
|
+
// of the polyfill.
|
|
212
|
+
IteratorPrototype = NativeIteratorPrototype;
|
|
247
213
|
}
|
|
248
|
-
genFun.prototype = Object.create(Gp);
|
|
249
|
-
return genFun;
|
|
250
|
-
};
|
|
251
214
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
return { __await: arg };
|
|
258
|
-
};
|
|
215
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
216
|
+
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
|
217
|
+
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
|
218
|
+
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
|
|
219
|
+
// Iterator interface in terms of a single ._invoke method.
|
|
259
220
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
221
|
+
function defineIteratorMethods(prototype) {
|
|
222
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
223
|
+
define(prototype, method, function (arg) {
|
|
224
|
+
return this._invoke(method, arg);
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
exports.isGeneratorFunction = function (genFun) {
|
|
230
|
+
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
231
|
+
return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
|
|
232
|
+
// do is to check its .name property.
|
|
233
|
+
(ctor.displayName || ctor.name) === "GeneratorFunction" : false;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
exports.mark = function (genFun) {
|
|
237
|
+
if (Object.setPrototypeOf) {
|
|
238
|
+
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
265
239
|
} else {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
240
|
+
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
241
|
+
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
genFun.prototype = Object.create(Gp);
|
|
245
|
+
return genFun;
|
|
246
|
+
}; // Within the body of any async function, `await x` is transformed to
|
|
247
|
+
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
248
|
+
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
249
|
+
// meant to be awaited.
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
exports.awrap = function (arg) {
|
|
253
|
+
return {
|
|
254
|
+
__await: arg
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
259
|
+
function invoke(method, arg, resolve, reject) {
|
|
260
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
261
|
+
|
|
262
|
+
if (record.type === "throw") {
|
|
263
|
+
reject(record.arg);
|
|
264
|
+
} else {
|
|
265
|
+
var result = record.arg;
|
|
266
|
+
var value = result.value;
|
|
267
|
+
|
|
268
|
+
if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
|
|
269
|
+
return PromiseImpl.resolve(value.__await).then(function (value) {
|
|
270
|
+
invoke("next", value, resolve, reject);
|
|
271
|
+
}, function (err) {
|
|
272
|
+
invoke("throw", err, resolve, reject);
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
return PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
277
|
+
// When a yielded Promise is resolved, its final value becomes
|
|
278
|
+
// the .value of the Promise<{value,done}> result for the
|
|
279
|
+
// current iteration.
|
|
280
|
+
result.value = unwrapped;
|
|
281
|
+
resolve(result);
|
|
282
|
+
}, function (error) {
|
|
283
|
+
// If a rejected Promise was yielded, throw the rejection back
|
|
284
|
+
// into the async generator function so it can be handled there.
|
|
285
|
+
return invoke("throw", error, resolve, reject);
|
|
275
286
|
});
|
|
276
287
|
}
|
|
277
|
-
|
|
278
|
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
279
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
280
|
-
// the .value of the Promise<{value,done}> result for the
|
|
281
|
-
// current iteration.
|
|
282
|
-
result.value = unwrapped;
|
|
283
|
-
resolve(result);
|
|
284
|
-
}, function(error) {
|
|
285
|
-
// If a rejected Promise was yielded, throw the rejection back
|
|
286
|
-
// into the async generator function so it can be handled there.
|
|
287
|
-
return invoke("throw", error, resolve, reject);
|
|
288
|
-
});
|
|
289
288
|
}
|
|
290
|
-
}
|
|
291
289
|
|
|
292
|
-
|
|
290
|
+
var previousPromise;
|
|
293
291
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
292
|
+
function enqueue(method, arg) {
|
|
293
|
+
function callInvokeWithMethodAndArg() {
|
|
294
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
295
|
+
invoke(method, arg, resolve, reject);
|
|
296
|
+
});
|
|
297
|
+
}
|
|
300
298
|
|
|
301
|
-
|
|
302
|
-
// If enqueue has been called before, then we want to wait until
|
|
299
|
+
return previousPromise = // If enqueue has been called before, then we want to wait until
|
|
303
300
|
// all previous Promises have been resolved before calling invoke,
|
|
304
301
|
// so that results are always delivered in the correct order. If
|
|
305
302
|
// enqueue has not been called before, then it is important to
|
|
@@ -311,554 +308,525 @@ var runtime = (function (exports) {
|
|
|
311
308
|
// execute code before the first await. Since we implement simple
|
|
312
309
|
// async functions in terms of async generators, it is especially
|
|
313
310
|
// important to get this right, even though it requires care.
|
|
314
|
-
previousPromise ? previousPromise.then(
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
311
|
+
previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
|
|
312
|
+
// invocations of the iterator.
|
|
313
|
+
callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
314
|
+
} // Define the unified helper method that is used to implement .next,
|
|
315
|
+
// .throw, and .return (see defineIteratorMethods).
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
this._invoke = enqueue;
|
|
320
319
|
}
|
|
321
320
|
|
|
322
|
-
|
|
323
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
324
|
-
this._invoke = enqueue;
|
|
325
|
-
}
|
|
321
|
+
defineIteratorMethods(AsyncIterator.prototype);
|
|
326
322
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
});
|
|
331
|
-
exports.AsyncIterator = AsyncIterator;
|
|
332
|
-
|
|
333
|
-
// Note that simple async functions are implemented on top of
|
|
334
|
-
// AsyncIterator objects; they just return a Promise for the value of
|
|
335
|
-
// the final result produced by the iterator.
|
|
336
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
337
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
338
|
-
|
|
339
|
-
var iter = new AsyncIterator(
|
|
340
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
341
|
-
PromiseImpl
|
|
342
|
-
);
|
|
343
|
-
|
|
344
|
-
return exports.isGeneratorFunction(outerFn)
|
|
345
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
346
|
-
: iter.next().then(function(result) {
|
|
347
|
-
return result.done ? result.value : iter.next();
|
|
348
|
-
});
|
|
349
|
-
};
|
|
323
|
+
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
324
|
+
return this;
|
|
325
|
+
};
|
|
350
326
|
|
|
351
|
-
|
|
352
|
-
|
|
327
|
+
exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
|
|
328
|
+
// AsyncIterator objects; they just return a Promise for the value of
|
|
329
|
+
// the final result produced by the iterator.
|
|
353
330
|
|
|
354
|
-
|
|
355
|
-
if (
|
|
356
|
-
|
|
357
|
-
|
|
331
|
+
exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
332
|
+
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
333
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
334
|
+
return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
|
|
335
|
+
: iter.next().then(function (result) {
|
|
336
|
+
return result.done ? result.value : iter.next();
|
|
337
|
+
});
|
|
338
|
+
};
|
|
358
339
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
340
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
341
|
+
var state = GenStateSuspendedStart;
|
|
342
|
+
return function invoke(method, arg) {
|
|
343
|
+
if (state === GenStateExecuting) {
|
|
344
|
+
throw new Error("Generator is already running");
|
|
362
345
|
}
|
|
363
346
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
347
|
+
if (state === GenStateCompleted) {
|
|
348
|
+
if (method === "throw") {
|
|
349
|
+
throw arg;
|
|
350
|
+
} // Be forgiving, per 25.3.3.3.3 of the spec:
|
|
351
|
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
368
352
|
|
|
369
|
-
context.method = method;
|
|
370
|
-
context.arg = arg;
|
|
371
353
|
|
|
372
|
-
|
|
373
|
-
var delegate = context.delegate;
|
|
374
|
-
if (delegate) {
|
|
375
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
376
|
-
if (delegateResult) {
|
|
377
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
378
|
-
return delegateResult;
|
|
379
|
-
}
|
|
354
|
+
return doneResult();
|
|
380
355
|
}
|
|
381
356
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
// function.sent implementation.
|
|
385
|
-
context.sent = context._sent = context.arg;
|
|
357
|
+
context.method = method;
|
|
358
|
+
context.arg = arg;
|
|
386
359
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
360
|
+
while (true) {
|
|
361
|
+
var delegate = context.delegate;
|
|
362
|
+
|
|
363
|
+
if (delegate) {
|
|
364
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
365
|
+
|
|
366
|
+
if (delegateResult) {
|
|
367
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
368
|
+
return delegateResult;
|
|
369
|
+
}
|
|
391
370
|
}
|
|
392
371
|
|
|
393
|
-
|
|
372
|
+
if (context.method === "next") {
|
|
373
|
+
// Setting context._sent for legacy support of Babel's
|
|
374
|
+
// function.sent implementation.
|
|
375
|
+
context.sent = context._sent = context.arg;
|
|
376
|
+
} else if (context.method === "throw") {
|
|
377
|
+
if (state === GenStateSuspendedStart) {
|
|
378
|
+
state = GenStateCompleted;
|
|
379
|
+
throw context.arg;
|
|
380
|
+
}
|
|
394
381
|
|
|
395
|
-
|
|
396
|
-
context.
|
|
397
|
-
|
|
382
|
+
context.dispatchException(context.arg);
|
|
383
|
+
} else if (context.method === "return") {
|
|
384
|
+
context.abrupt("return", context.arg);
|
|
385
|
+
}
|
|
398
386
|
|
|
399
|
-
|
|
387
|
+
state = GenStateExecuting;
|
|
388
|
+
var record = tryCatch(innerFn, self, context);
|
|
400
389
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
state = context.done
|
|
406
|
-
? GenStateCompleted
|
|
407
|
-
: GenStateSuspendedYield;
|
|
390
|
+
if (record.type === "normal") {
|
|
391
|
+
// If an exception is thrown from innerFn, we leave state ===
|
|
392
|
+
// GenStateExecuting and loop back for another invocation.
|
|
393
|
+
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
|
|
408
394
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
395
|
+
if (record.arg === ContinueSentinel) {
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
412
398
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
399
|
+
return {
|
|
400
|
+
value: record.arg,
|
|
401
|
+
done: context.done
|
|
402
|
+
};
|
|
403
|
+
} else if (record.type === "throw") {
|
|
404
|
+
state = GenStateCompleted; // Dispatch the exception by looping back around to the
|
|
405
|
+
// context.dispatchException(context.arg) call above.
|
|
406
|
+
|
|
407
|
+
context.method = "throw";
|
|
408
|
+
context.arg = record.arg;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
} // Call delegate.iterator[context.method](context.arg) and handle the
|
|
413
|
+
// result, either by returning a { value, done } result from the
|
|
414
|
+
// delegate iterator, or by modifying context.method and context.arg,
|
|
415
|
+
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
419
|
+
var method = delegate.iterator[context.method];
|
|
420
|
+
|
|
421
|
+
if (method === undefined$1) {
|
|
422
|
+
// A .throw or .return when the delegate iterator has no .throw
|
|
423
|
+
// method always terminates the yield* loop.
|
|
424
|
+
context.delegate = null;
|
|
425
|
+
|
|
426
|
+
if (context.method === "throw") {
|
|
427
|
+
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
428
|
+
if (delegate.iterator["return"]) {
|
|
429
|
+
// If the delegate iterator has a return method, give it a
|
|
430
|
+
// chance to clean up.
|
|
431
|
+
context.method = "return";
|
|
432
|
+
context.arg = undefined$1;
|
|
433
|
+
maybeInvokeDelegate(delegate, context);
|
|
434
|
+
|
|
435
|
+
if (context.method === "throw") {
|
|
436
|
+
// If maybeInvokeDelegate(context) changed context.method from
|
|
437
|
+
// "return" to "throw", let that override the TypeError below.
|
|
438
|
+
return ContinueSentinel;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
417
441
|
|
|
418
|
-
} else if (record.type === "throw") {
|
|
419
|
-
state = GenStateCompleted;
|
|
420
|
-
// Dispatch the exception by looping back around to the
|
|
421
|
-
// context.dispatchException(context.arg) call above.
|
|
422
442
|
context.method = "throw";
|
|
423
|
-
context.arg =
|
|
443
|
+
context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
424
444
|
}
|
|
445
|
+
|
|
446
|
+
return ContinueSentinel;
|
|
425
447
|
}
|
|
426
|
-
};
|
|
427
|
-
}
|
|
428
448
|
|
|
429
|
-
|
|
430
|
-
// result, either by returning a { value, done } result from the
|
|
431
|
-
// delegate iterator, or by modifying context.method and context.arg,
|
|
432
|
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
433
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
434
|
-
var method = delegate.iterator[context.method];
|
|
435
|
-
if (method === undefined$1) {
|
|
436
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
437
|
-
// method always terminates the yield* loop.
|
|
438
|
-
context.delegate = null;
|
|
449
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
439
450
|
|
|
440
|
-
if (
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
context.arg = undefined$1;
|
|
447
|
-
maybeInvokeDelegate(delegate, context);
|
|
451
|
+
if (record.type === "throw") {
|
|
452
|
+
context.method = "throw";
|
|
453
|
+
context.arg = record.arg;
|
|
454
|
+
context.delegate = null;
|
|
455
|
+
return ContinueSentinel;
|
|
456
|
+
}
|
|
448
457
|
|
|
449
|
-
|
|
450
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
451
|
-
// "return" to "throw", let that override the TypeError below.
|
|
452
|
-
return ContinueSentinel;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
458
|
+
var info = record.arg;
|
|
455
459
|
|
|
460
|
+
if (!info) {
|
|
456
461
|
context.method = "throw";
|
|
457
|
-
context.arg = new TypeError(
|
|
458
|
-
|
|
462
|
+
context.arg = new TypeError("iterator result is not an object");
|
|
463
|
+
context.delegate = null;
|
|
464
|
+
return ContinueSentinel;
|
|
459
465
|
}
|
|
460
466
|
|
|
461
|
-
|
|
462
|
-
|
|
467
|
+
if (info.done) {
|
|
468
|
+
// Assign the result of the finished delegate to the temporary
|
|
469
|
+
// variable specified by delegate.resultName (see delegateYield).
|
|
470
|
+
context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
|
|
463
471
|
|
|
464
|
-
|
|
472
|
+
context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
|
|
473
|
+
// exception, let the outer generator proceed normally. If
|
|
474
|
+
// context.method was "next", forget context.arg since it has been
|
|
475
|
+
// "consumed" by the delegate iterator. If context.method was
|
|
476
|
+
// "return", allow the original .return call to continue in the
|
|
477
|
+
// outer generator.
|
|
465
478
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
479
|
+
if (context.method !== "return") {
|
|
480
|
+
context.method = "next";
|
|
481
|
+
context.arg = undefined$1;
|
|
482
|
+
}
|
|
483
|
+
} else {
|
|
484
|
+
// Re-yield the result returned by the delegate method.
|
|
485
|
+
return info;
|
|
486
|
+
} // The delegate iterator is finished, so forget it and continue with
|
|
487
|
+
// the outer generator.
|
|
472
488
|
|
|
473
|
-
var info = record.arg;
|
|
474
489
|
|
|
475
|
-
if (! info) {
|
|
476
|
-
context.method = "throw";
|
|
477
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
478
490
|
context.delegate = null;
|
|
479
491
|
return ContinueSentinel;
|
|
480
|
-
}
|
|
492
|
+
} // Define Generator.prototype.{next,throw,return} in terms of the
|
|
493
|
+
// unified ._invoke helper method.
|
|
481
494
|
|
|
482
|
-
if (info.done) {
|
|
483
|
-
// Assign the result of the finished delegate to the temporary
|
|
484
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
485
|
-
context[delegate.resultName] = info.value;
|
|
486
|
-
|
|
487
|
-
// Resume execution at the desired location (see delegateYield).
|
|
488
|
-
context.next = delegate.nextLoc;
|
|
489
|
-
|
|
490
|
-
// If context.method was "throw" but the delegate handled the
|
|
491
|
-
// exception, let the outer generator proceed normally. If
|
|
492
|
-
// context.method was "next", forget context.arg since it has been
|
|
493
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
494
|
-
// "return", allow the original .return call to continue in the
|
|
495
|
-
// outer generator.
|
|
496
|
-
if (context.method !== "return") {
|
|
497
|
-
context.method = "next";
|
|
498
|
-
context.arg = undefined$1;
|
|
499
|
-
}
|
|
500
495
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
496
|
+
defineIteratorMethods(Gp);
|
|
497
|
+
define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
|
|
498
|
+
// @@iterator function is called on it. Some browsers' implementations of the
|
|
499
|
+
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
500
|
+
// object to not be returned from this call. This ensures that doesn't happen.
|
|
501
|
+
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
505
502
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
return ContinueSentinel;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
513
|
-
// unified ._invoke helper method.
|
|
514
|
-
defineIteratorMethods(Gp);
|
|
503
|
+
Gp[iteratorSymbol] = function () {
|
|
504
|
+
return this;
|
|
505
|
+
};
|
|
515
506
|
|
|
516
|
-
|
|
507
|
+
Gp.toString = function () {
|
|
508
|
+
return "[object Generator]";
|
|
509
|
+
};
|
|
517
510
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
523
|
-
define(Gp, iteratorSymbol, function() {
|
|
524
|
-
return this;
|
|
525
|
-
});
|
|
511
|
+
function pushTryEntry(locs) {
|
|
512
|
+
var entry = {
|
|
513
|
+
tryLoc: locs[0]
|
|
514
|
+
};
|
|
526
515
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
516
|
+
if (1 in locs) {
|
|
517
|
+
entry.catchLoc = locs[1];
|
|
518
|
+
}
|
|
530
519
|
|
|
531
|
-
|
|
532
|
-
|
|
520
|
+
if (2 in locs) {
|
|
521
|
+
entry.finallyLoc = locs[2];
|
|
522
|
+
entry.afterLoc = locs[3];
|
|
523
|
+
}
|
|
533
524
|
|
|
534
|
-
|
|
535
|
-
entry.catchLoc = locs[1];
|
|
525
|
+
this.tryEntries.push(entry);
|
|
536
526
|
}
|
|
537
527
|
|
|
538
|
-
|
|
539
|
-
entry.
|
|
540
|
-
|
|
528
|
+
function resetTryEntry(entry) {
|
|
529
|
+
var record = entry.completion || {};
|
|
530
|
+
record.type = "normal";
|
|
531
|
+
delete record.arg;
|
|
532
|
+
entry.completion = record;
|
|
541
533
|
}
|
|
542
534
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
function Context(tryLocsList) {
|
|
554
|
-
// The root entry object (effectively a try statement without a catch
|
|
555
|
-
// or a finally block) gives us a place to store values thrown from
|
|
556
|
-
// locations where there is no enclosing try statement.
|
|
557
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
558
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
559
|
-
this.reset(true);
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
exports.keys = function(object) {
|
|
563
|
-
var keys = [];
|
|
564
|
-
for (var key in object) {
|
|
565
|
-
keys.push(key);
|
|
535
|
+
function Context(tryLocsList) {
|
|
536
|
+
// The root entry object (effectively a try statement without a catch
|
|
537
|
+
// or a finally block) gives us a place to store values thrown from
|
|
538
|
+
// locations where there is no enclosing try statement.
|
|
539
|
+
this.tryEntries = [{
|
|
540
|
+
tryLoc: "root"
|
|
541
|
+
}];
|
|
542
|
+
tryLocsList.forEach(pushTryEntry, this);
|
|
543
|
+
this.reset(true);
|
|
566
544
|
}
|
|
567
|
-
keys.reverse();
|
|
568
|
-
|
|
569
|
-
// Rather than returning an object with a next method, we keep
|
|
570
|
-
// things simple and return the next function itself.
|
|
571
|
-
return function next() {
|
|
572
|
-
while (keys.length) {
|
|
573
|
-
var key = keys.pop();
|
|
574
|
-
if (key in object) {
|
|
575
|
-
next.value = key;
|
|
576
|
-
next.done = false;
|
|
577
|
-
return next;
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
545
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
// also ensures that the minifier will not anonymize the function.
|
|
584
|
-
next.done = true;
|
|
585
|
-
return next;
|
|
586
|
-
};
|
|
587
|
-
};
|
|
546
|
+
exports.keys = function (object) {
|
|
547
|
+
var keys = [];
|
|
588
548
|
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
592
|
-
if (iteratorMethod) {
|
|
593
|
-
return iteratorMethod.call(iterable);
|
|
549
|
+
for (var key in object) {
|
|
550
|
+
keys.push(key);
|
|
594
551
|
}
|
|
595
552
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
}
|
|
553
|
+
keys.reverse(); // Rather than returning an object with a next method, we keep
|
|
554
|
+
// things simple and return the next function itself.
|
|
599
555
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
if (hasOwn.call(iterable, i)) {
|
|
604
|
-
next.value = iterable[i];
|
|
605
|
-
next.done = false;
|
|
606
|
-
return next;
|
|
607
|
-
}
|
|
608
|
-
}
|
|
556
|
+
return function next() {
|
|
557
|
+
while (keys.length) {
|
|
558
|
+
var key = keys.pop();
|
|
609
559
|
|
|
610
|
-
|
|
611
|
-
|
|
560
|
+
if (key in object) {
|
|
561
|
+
next.value = key;
|
|
562
|
+
next.done = false;
|
|
563
|
+
return next;
|
|
564
|
+
}
|
|
565
|
+
} // To avoid creating an additional object, we just hang the .value
|
|
566
|
+
// and .done properties off the next function object itself. This
|
|
567
|
+
// also ensures that the minifier will not anonymize the function.
|
|
612
568
|
|
|
613
|
-
return next;
|
|
614
|
-
};
|
|
615
569
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
// Return an iterator with no values.
|
|
621
|
-
return { next: doneResult };
|
|
622
|
-
}
|
|
623
|
-
exports.values = values;
|
|
570
|
+
next.done = true;
|
|
571
|
+
return next;
|
|
572
|
+
};
|
|
573
|
+
};
|
|
624
574
|
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
575
|
+
function values(iterable) {
|
|
576
|
+
if (iterable) {
|
|
577
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
628
578
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
reset: function(skipTempReset) {
|
|
633
|
-
this.prev = 0;
|
|
634
|
-
this.next = 0;
|
|
635
|
-
// Resetting context._sent for legacy support of Babel's
|
|
636
|
-
// function.sent implementation.
|
|
637
|
-
this.sent = this._sent = undefined$1;
|
|
638
|
-
this.done = false;
|
|
639
|
-
this.delegate = null;
|
|
640
|
-
|
|
641
|
-
this.method = "next";
|
|
642
|
-
this.arg = undefined$1;
|
|
643
|
-
|
|
644
|
-
this.tryEntries.forEach(resetTryEntry);
|
|
645
|
-
|
|
646
|
-
if (!skipTempReset) {
|
|
647
|
-
for (var name in this) {
|
|
648
|
-
// Not sure about the optimal order of these conditions:
|
|
649
|
-
if (name.charAt(0) === "t" &&
|
|
650
|
-
hasOwn.call(this, name) &&
|
|
651
|
-
!isNaN(+name.slice(1))) {
|
|
652
|
-
this[name] = undefined$1;
|
|
653
|
-
}
|
|
579
|
+
if (iteratorMethod) {
|
|
580
|
+
return iteratorMethod.call(iterable);
|
|
654
581
|
}
|
|
655
|
-
}
|
|
656
|
-
},
|
|
657
|
-
|
|
658
|
-
stop: function() {
|
|
659
|
-
this.done = true;
|
|
660
582
|
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
throw rootRecord.arg;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
return this.rval;
|
|
668
|
-
},
|
|
583
|
+
if (typeof iterable.next === "function") {
|
|
584
|
+
return iterable;
|
|
585
|
+
}
|
|
669
586
|
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
587
|
+
if (!isNaN(iterable.length)) {
|
|
588
|
+
var i = -1,
|
|
589
|
+
next = function next() {
|
|
590
|
+
while (++i < iterable.length) {
|
|
591
|
+
if (hasOwn.call(iterable, i)) {
|
|
592
|
+
next.value = iterable[i];
|
|
593
|
+
next.done = false;
|
|
594
|
+
return next;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
674
597
|
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
context.next = loc;
|
|
598
|
+
next.value = undefined$1;
|
|
599
|
+
next.done = true;
|
|
600
|
+
return next;
|
|
601
|
+
};
|
|
680
602
|
|
|
681
|
-
|
|
682
|
-
// If the dispatched exception was caught by a catch block,
|
|
683
|
-
// then let that catch block handle the exception normally.
|
|
684
|
-
context.method = "next";
|
|
685
|
-
context.arg = undefined$1;
|
|
603
|
+
return next.next = next;
|
|
686
604
|
}
|
|
605
|
+
} // Return an iterator with no values.
|
|
687
606
|
|
|
688
|
-
return !! caught;
|
|
689
|
-
}
|
|
690
607
|
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
608
|
+
return {
|
|
609
|
+
next: doneResult
|
|
610
|
+
};
|
|
611
|
+
}
|
|
694
612
|
|
|
695
|
-
|
|
696
|
-
// Exception thrown outside of any try block that could handle
|
|
697
|
-
// it, so set the completion value of the entire function to
|
|
698
|
-
// throw the exception.
|
|
699
|
-
return handle("end");
|
|
700
|
-
}
|
|
613
|
+
exports.values = values;
|
|
701
614
|
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
615
|
+
function doneResult() {
|
|
616
|
+
return {
|
|
617
|
+
value: undefined$1,
|
|
618
|
+
done: true
|
|
619
|
+
};
|
|
620
|
+
}
|
|
705
621
|
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
622
|
+
Context.prototype = {
|
|
623
|
+
constructor: Context,
|
|
624
|
+
reset: function reset(skipTempReset) {
|
|
625
|
+
this.prev = 0;
|
|
626
|
+
this.next = 0; // Resetting context._sent for legacy support of Babel's
|
|
627
|
+
// function.sent implementation.
|
|
712
628
|
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
629
|
+
this.sent = this._sent = undefined$1;
|
|
630
|
+
this.done = false;
|
|
631
|
+
this.delegate = null;
|
|
632
|
+
this.method = "next";
|
|
633
|
+
this.arg = undefined$1;
|
|
634
|
+
this.tryEntries.forEach(resetTryEntry);
|
|
717
635
|
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
636
|
+
if (!skipTempReset) {
|
|
637
|
+
for (var name in this) {
|
|
638
|
+
// Not sure about the optimal order of these conditions:
|
|
639
|
+
if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
|
|
640
|
+
this[name] = undefined$1;
|
|
721
641
|
}
|
|
722
|
-
|
|
723
|
-
} else {
|
|
724
|
-
throw new Error("try statement without catch or finally");
|
|
725
642
|
}
|
|
726
643
|
}
|
|
727
|
-
}
|
|
728
|
-
|
|
644
|
+
},
|
|
645
|
+
stop: function stop() {
|
|
646
|
+
this.done = true;
|
|
647
|
+
var rootEntry = this.tryEntries[0];
|
|
648
|
+
var rootRecord = rootEntry.completion;
|
|
649
|
+
|
|
650
|
+
if (rootRecord.type === "throw") {
|
|
651
|
+
throw rootRecord.arg;
|
|
652
|
+
}
|
|
729
653
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
if (
|
|
734
|
-
|
|
735
|
-
this.prev < entry.finallyLoc) {
|
|
736
|
-
var finallyEntry = entry;
|
|
737
|
-
break;
|
|
654
|
+
return this.rval;
|
|
655
|
+
},
|
|
656
|
+
dispatchException: function dispatchException(exception) {
|
|
657
|
+
if (this.done) {
|
|
658
|
+
throw exception;
|
|
738
659
|
}
|
|
739
|
-
}
|
|
740
660
|
|
|
741
|
-
|
|
742
|
-
(type === "break" ||
|
|
743
|
-
type === "continue") &&
|
|
744
|
-
finallyEntry.tryLoc <= arg &&
|
|
745
|
-
arg <= finallyEntry.finallyLoc) {
|
|
746
|
-
// Ignore the finally entry if control is not jumping to a
|
|
747
|
-
// location outside the try/catch block.
|
|
748
|
-
finallyEntry = null;
|
|
749
|
-
}
|
|
661
|
+
var context = this;
|
|
750
662
|
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
663
|
+
function handle(loc, caught) {
|
|
664
|
+
record.type = "throw";
|
|
665
|
+
record.arg = exception;
|
|
666
|
+
context.next = loc;
|
|
754
667
|
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
668
|
+
if (caught) {
|
|
669
|
+
// If the dispatched exception was caught by a catch block,
|
|
670
|
+
// then let that catch block handle the exception normally.
|
|
671
|
+
context.method = "next";
|
|
672
|
+
context.arg = undefined$1;
|
|
673
|
+
}
|
|
760
674
|
|
|
761
|
-
|
|
762
|
-
|
|
675
|
+
return !!caught;
|
|
676
|
+
}
|
|
763
677
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
}
|
|
678
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
679
|
+
var entry = this.tryEntries[i];
|
|
680
|
+
var record = entry.completion;
|
|
768
681
|
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
this.next = "end";
|
|
776
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
777
|
-
this.next = afterLoc;
|
|
778
|
-
}
|
|
682
|
+
if (entry.tryLoc === "root") {
|
|
683
|
+
// Exception thrown outside of any try block that could handle
|
|
684
|
+
// it, so set the completion value of the entire function to
|
|
685
|
+
// throw the exception.
|
|
686
|
+
return handle("end");
|
|
687
|
+
}
|
|
779
688
|
|
|
780
|
-
|
|
781
|
-
|
|
689
|
+
if (entry.tryLoc <= this.prev) {
|
|
690
|
+
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
691
|
+
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
782
692
|
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
693
|
+
if (hasCatch && hasFinally) {
|
|
694
|
+
if (this.prev < entry.catchLoc) {
|
|
695
|
+
return handle(entry.catchLoc, true);
|
|
696
|
+
} else if (this.prev < entry.finallyLoc) {
|
|
697
|
+
return handle(entry.finallyLoc);
|
|
698
|
+
}
|
|
699
|
+
} else if (hasCatch) {
|
|
700
|
+
if (this.prev < entry.catchLoc) {
|
|
701
|
+
return handle(entry.catchLoc, true);
|
|
702
|
+
}
|
|
703
|
+
} else if (hasFinally) {
|
|
704
|
+
if (this.prev < entry.finallyLoc) {
|
|
705
|
+
return handle(entry.finallyLoc);
|
|
706
|
+
}
|
|
707
|
+
} else {
|
|
708
|
+
throw new Error("try statement without catch or finally");
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
abrupt: function abrupt(type, arg) {
|
|
714
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
715
|
+
var entry = this.tryEntries[i];
|
|
716
|
+
|
|
717
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
718
|
+
var finallyEntry = entry;
|
|
719
|
+
break;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
|
|
724
|
+
// Ignore the finally entry if control is not jumping to a
|
|
725
|
+
// location outside the try/catch block.
|
|
726
|
+
finallyEntry = null;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
730
|
+
record.type = type;
|
|
731
|
+
record.arg = arg;
|
|
732
|
+
|
|
733
|
+
if (finallyEntry) {
|
|
734
|
+
this.method = "next";
|
|
735
|
+
this.next = finallyEntry.finallyLoc;
|
|
789
736
|
return ContinueSentinel;
|
|
790
737
|
}
|
|
791
|
-
}
|
|
792
|
-
},
|
|
793
738
|
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
if (
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
739
|
+
return this.complete(record);
|
|
740
|
+
},
|
|
741
|
+
complete: function complete(record, afterLoc) {
|
|
742
|
+
if (record.type === "throw") {
|
|
743
|
+
throw record.arg;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
if (record.type === "break" || record.type === "continue") {
|
|
747
|
+
this.next = record.arg;
|
|
748
|
+
} else if (record.type === "return") {
|
|
749
|
+
this.rval = this.arg = record.arg;
|
|
750
|
+
this.method = "return";
|
|
751
|
+
this.next = "end";
|
|
752
|
+
} else if (record.type === "normal" && afterLoc) {
|
|
753
|
+
this.next = afterLoc;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
return ContinueSentinel;
|
|
757
|
+
},
|
|
758
|
+
finish: function finish(finallyLoc) {
|
|
759
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
760
|
+
var entry = this.tryEntries[i];
|
|
761
|
+
|
|
762
|
+
if (entry.finallyLoc === finallyLoc) {
|
|
763
|
+
this.complete(entry.completion, entry.afterLoc);
|
|
801
764
|
resetTryEntry(entry);
|
|
765
|
+
return ContinueSentinel;
|
|
802
766
|
}
|
|
803
|
-
return thrown;
|
|
804
767
|
}
|
|
805
|
-
}
|
|
768
|
+
},
|
|
769
|
+
"catch": function _catch(tryLoc) {
|
|
770
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
771
|
+
var entry = this.tryEntries[i];
|
|
806
772
|
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
throw new Error("illegal catch attempt");
|
|
810
|
-
},
|
|
773
|
+
if (entry.tryLoc === tryLoc) {
|
|
774
|
+
var record = entry.completion;
|
|
811
775
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
nextLoc: nextLoc
|
|
817
|
-
};
|
|
776
|
+
if (record.type === "throw") {
|
|
777
|
+
var thrown = record.arg;
|
|
778
|
+
resetTryEntry(entry);
|
|
779
|
+
}
|
|
818
780
|
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
//
|
|
822
|
-
|
|
823
|
-
}
|
|
781
|
+
return thrown;
|
|
782
|
+
}
|
|
783
|
+
} // The context.catch method must only be called with a location
|
|
784
|
+
// argument that corresponds to a known catch block.
|
|
824
785
|
|
|
825
|
-
return ContinueSentinel;
|
|
826
|
-
}
|
|
827
|
-
};
|
|
828
786
|
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
787
|
+
throw new Error("illegal catch attempt");
|
|
788
|
+
},
|
|
789
|
+
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
|
790
|
+
this.delegate = {
|
|
791
|
+
iterator: values(iterable),
|
|
792
|
+
resultName: resultName,
|
|
793
|
+
nextLoc: nextLoc
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
if (this.method === "next") {
|
|
797
|
+
// Deliberately forget the last sent value so that we don't
|
|
798
|
+
// accidentally pass it on to the delegate.
|
|
799
|
+
this.arg = undefined$1;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
return ContinueSentinel;
|
|
803
|
+
}
|
|
804
|
+
}; // Regardless of whether this script is executing as a CommonJS module
|
|
805
|
+
// or not, return the runtime object so that we can declare the variable
|
|
806
|
+
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
807
|
+
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
834
808
|
|
|
835
|
-
|
|
836
|
-
// If this script is executing as a CommonJS module, use module.exports
|
|
809
|
+
return exports;
|
|
810
|
+
}( // If this script is executing as a CommonJS module, use module.exports
|
|
837
811
|
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
838
812
|
// object. Either way, the resulting object will be used to initialize
|
|
839
813
|
// the regeneratorRuntime variable at the top of this file.
|
|
840
|
-
module.exports
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
// CSP to forbid Function, and you're not willing to fix either of those
|
|
855
|
-
// problems, please detail your unique predicament in a GitHub issue.
|
|
856
|
-
if (typeof globalThis === "object") {
|
|
857
|
-
globalThis.regeneratorRuntime = runtime;
|
|
858
|
-
} else {
|
|
814
|
+
module.exports );
|
|
815
|
+
|
|
816
|
+
try {
|
|
817
|
+
regeneratorRuntime = runtime;
|
|
818
|
+
} catch (accidentalStrictMode) {
|
|
819
|
+
// This module should not be running in strict mode, so the above
|
|
820
|
+
// assignment should always work unless something is misconfigured. Just
|
|
821
|
+
// in case runtime.js accidentally runs in strict mode, we can escape
|
|
822
|
+
// strict mode using a global Function call. This could conceivably fail
|
|
823
|
+
// if a Content Security Policy forbids using Function, but in that case
|
|
824
|
+
// the proper solution is to fix the accidental strict mode problem. If
|
|
825
|
+
// you've misconfigured your bundler to force strict mode and applied a
|
|
826
|
+
// CSP to forbid Function, and you're not willing to fix either of those
|
|
827
|
+
// problems, please detail your unique predicament in a GitHub issue.
|
|
859
828
|
Function("r", "regeneratorRuntime = r")(runtime);
|
|
860
829
|
}
|
|
861
|
-
}
|
|
862
830
|
});
|
|
863
831
|
|
|
864
832
|
var fetcher = /*#__PURE__*/function () {
|