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