@plasmicpkgs/commerce 0.0.158 → 0.0.160

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.
@@ -6,6 +6,307 @@ import { GlobalActionsProvider, useSelector, DataProvider, PlasmicCanvasContext,
6
6
  import Cookies from 'js-cookie';
7
7
  import debounce from 'debounce';
8
8
 
9
+ function _regeneratorRuntime() {
10
+ _regeneratorRuntime = function () {
11
+ return e;
12
+ };
13
+ var t,
14
+ e = {},
15
+ r = Object.prototype,
16
+ n = r.hasOwnProperty,
17
+ o = Object.defineProperty || function (t, e, r) {
18
+ t[e] = r.value;
19
+ },
20
+ i = "function" == typeof Symbol ? Symbol : {},
21
+ a = i.iterator || "@@iterator",
22
+ c = i.asyncIterator || "@@asyncIterator",
23
+ u = i.toStringTag || "@@toStringTag";
24
+ function define(t, e, r) {
25
+ return Object.defineProperty(t, e, {
26
+ value: r,
27
+ enumerable: !0,
28
+ configurable: !0,
29
+ writable: !0
30
+ }), t[e];
31
+ }
32
+ try {
33
+ define({}, "");
34
+ } catch (t) {
35
+ define = function (t, e, r) {
36
+ return t[e] = r;
37
+ };
38
+ }
39
+ function wrap(t, e, r, n) {
40
+ var i = e && e.prototype instanceof Generator ? e : Generator,
41
+ a = Object.create(i.prototype),
42
+ c = new Context(n || []);
43
+ return o(a, "_invoke", {
44
+ value: makeInvokeMethod(t, r, c)
45
+ }), a;
46
+ }
47
+ function tryCatch(t, e, r) {
48
+ try {
49
+ return {
50
+ type: "normal",
51
+ arg: t.call(e, r)
52
+ };
53
+ } catch (t) {
54
+ return {
55
+ type: "throw",
56
+ arg: t
57
+ };
58
+ }
59
+ }
60
+ e.wrap = wrap;
61
+ var h = "suspendedStart",
62
+ l = "suspendedYield",
63
+ f = "executing",
64
+ s = "completed",
65
+ y = {};
66
+ function Generator() {}
67
+ function GeneratorFunction() {}
68
+ function GeneratorFunctionPrototype() {}
69
+ var p = {};
70
+ define(p, a, function () {
71
+ return this;
72
+ });
73
+ var d = Object.getPrototypeOf,
74
+ v = d && d(d(values([])));
75
+ v && v !== r && n.call(v, a) && (p = v);
76
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
77
+ function defineIteratorMethods(t) {
78
+ ["next", "throw", "return"].forEach(function (e) {
79
+ define(t, e, function (t) {
80
+ return this._invoke(e, t);
81
+ });
82
+ });
83
+ }
84
+ function AsyncIterator(t, e) {
85
+ function invoke(r, o, i, a) {
86
+ var c = tryCatch(t[r], t, o);
87
+ if ("throw" !== c.type) {
88
+ var u = c.arg,
89
+ h = u.value;
90
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
91
+ invoke("next", t, i, a);
92
+ }, function (t) {
93
+ invoke("throw", t, i, a);
94
+ }) : e.resolve(h).then(function (t) {
95
+ u.value = t, i(u);
96
+ }, function (t) {
97
+ return invoke("throw", t, i, a);
98
+ });
99
+ }
100
+ a(c.arg);
101
+ }
102
+ var r;
103
+ o(this, "_invoke", {
104
+ value: function (t, n) {
105
+ function callInvokeWithMethodAndArg() {
106
+ return new e(function (e, r) {
107
+ invoke(t, n, e, r);
108
+ });
109
+ }
110
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
111
+ }
112
+ });
113
+ }
114
+ function makeInvokeMethod(e, r, n) {
115
+ var o = h;
116
+ return function (i, a) {
117
+ if (o === f) throw new Error("Generator is already running");
118
+ if (o === s) {
119
+ if ("throw" === i) throw a;
120
+ return {
121
+ value: t,
122
+ done: !0
123
+ };
124
+ }
125
+ for (n.method = i, n.arg = a;;) {
126
+ var c = n.delegate;
127
+ if (c) {
128
+ var u = maybeInvokeDelegate(c, n);
129
+ if (u) {
130
+ if (u === y) continue;
131
+ return u;
132
+ }
133
+ }
134
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
135
+ if (o === h) throw o = s, n.arg;
136
+ n.dispatchException(n.arg);
137
+ } else "return" === n.method && n.abrupt("return", n.arg);
138
+ o = f;
139
+ var p = tryCatch(e, r, n);
140
+ if ("normal" === p.type) {
141
+ if (o = n.done ? s : l, p.arg === y) continue;
142
+ return {
143
+ value: p.arg,
144
+ done: n.done
145
+ };
146
+ }
147
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
148
+ }
149
+ };
150
+ }
151
+ function maybeInvokeDelegate(e, r) {
152
+ var n = r.method,
153
+ o = e.iterator[n];
154
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
155
+ var i = tryCatch(o, e.iterator, r.arg);
156
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
157
+ var a = i.arg;
158
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
159
+ }
160
+ function pushTryEntry(t) {
161
+ var e = {
162
+ tryLoc: t[0]
163
+ };
164
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
165
+ }
166
+ function resetTryEntry(t) {
167
+ var e = t.completion || {};
168
+ e.type = "normal", delete e.arg, t.completion = e;
169
+ }
170
+ function Context(t) {
171
+ this.tryEntries = [{
172
+ tryLoc: "root"
173
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
174
+ }
175
+ function values(e) {
176
+ if (e || "" === e) {
177
+ var r = e[a];
178
+ if (r) return r.call(e);
179
+ if ("function" == typeof e.next) return e;
180
+ if (!isNaN(e.length)) {
181
+ var o = -1,
182
+ i = function next() {
183
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
184
+ return next.value = t, next.done = !0, next;
185
+ };
186
+ return i.next = i;
187
+ }
188
+ }
189
+ throw new TypeError(typeof e + " is not iterable");
190
+ }
191
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
192
+ value: GeneratorFunctionPrototype,
193
+ configurable: !0
194
+ }), o(GeneratorFunctionPrototype, "constructor", {
195
+ value: GeneratorFunction,
196
+ configurable: !0
197
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
198
+ var e = "function" == typeof t && t.constructor;
199
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
200
+ }, e.mark = function (t) {
201
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
202
+ }, e.awrap = function (t) {
203
+ return {
204
+ __await: t
205
+ };
206
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
207
+ return this;
208
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
209
+ void 0 === i && (i = Promise);
210
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
211
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
212
+ return t.done ? t.value : a.next();
213
+ });
214
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
215
+ return this;
216
+ }), define(g, "toString", function () {
217
+ return "[object Generator]";
218
+ }), e.keys = function (t) {
219
+ var e = Object(t),
220
+ r = [];
221
+ for (var n in e) r.push(n);
222
+ return r.reverse(), function next() {
223
+ for (; r.length;) {
224
+ var t = r.pop();
225
+ if (t in e) return next.value = t, next.done = !1, next;
226
+ }
227
+ return next.done = !0, next;
228
+ };
229
+ }, e.values = values, Context.prototype = {
230
+ constructor: Context,
231
+ reset: function (e) {
232
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
233
+ },
234
+ stop: function () {
235
+ this.done = !0;
236
+ var t = this.tryEntries[0].completion;
237
+ if ("throw" === t.type) throw t.arg;
238
+ return this.rval;
239
+ },
240
+ dispatchException: function (e) {
241
+ if (this.done) throw e;
242
+ var r = this;
243
+ function handle(n, o) {
244
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
245
+ }
246
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
247
+ var i = this.tryEntries[o],
248
+ a = i.completion;
249
+ if ("root" === i.tryLoc) return handle("end");
250
+ if (i.tryLoc <= this.prev) {
251
+ var c = n.call(i, "catchLoc"),
252
+ u = n.call(i, "finallyLoc");
253
+ if (c && u) {
254
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
255
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
256
+ } else if (c) {
257
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
258
+ } else {
259
+ if (!u) throw new Error("try statement without catch or finally");
260
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
261
+ }
262
+ }
263
+ }
264
+ },
265
+ abrupt: function (t, e) {
266
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
267
+ var o = this.tryEntries[r];
268
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
269
+ var i = o;
270
+ break;
271
+ }
272
+ }
273
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
274
+ var a = i ? i.completion : {};
275
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
276
+ },
277
+ complete: function (t, e) {
278
+ if ("throw" === t.type) throw t.arg;
279
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
280
+ },
281
+ finish: function (t) {
282
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
283
+ var r = this.tryEntries[e];
284
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
285
+ }
286
+ },
287
+ catch: function (t) {
288
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
289
+ var r = this.tryEntries[e];
290
+ if (r.tryLoc === t) {
291
+ var n = r.completion;
292
+ if ("throw" === n.type) {
293
+ var o = n.arg;
294
+ resetTryEntry(r);
295
+ }
296
+ return o;
297
+ }
298
+ }
299
+ throw new Error("illegal catch attempt");
300
+ },
301
+ delegateYield: function (e, r, n) {
302
+ return this.delegate = {
303
+ iterator: values(e),
304
+ resultName: r,
305
+ nextLoc: n
306
+ }, "next" === this.method && (this.arg = t), y;
307
+ }
308
+ }, e;
309
+ }
9
310
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
10
311
  try {
11
312
  var info = gen[key](arg);
@@ -167,664 +468,6 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
167
468
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
168
469
  }
169
470
 
170
- function createCommonjsModule(fn, module) {
171
- return module = { exports: {} }, fn(module, module.exports), module.exports;
172
- }
173
-
174
- var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
175
- /**
176
- * Copyright (c) 2014-present, Facebook, Inc.
177
- *
178
- * This source code is licensed under the MIT license found in the
179
- * LICENSE file in the root directory of this source tree.
180
- */
181
-
182
- var runtime = function (exports) {
183
-
184
- var Op = Object.prototype;
185
- var hasOwn = Op.hasOwnProperty;
186
- var undefined$1; // More compressible than void 0.
187
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
188
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
189
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
190
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
191
- function define(obj, key, value) {
192
- Object.defineProperty(obj, key, {
193
- value: value,
194
- enumerable: true,
195
- configurable: true,
196
- writable: true
197
- });
198
- return obj[key];
199
- }
200
- try {
201
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
202
- define({}, "");
203
- } catch (err) {
204
- define = function define(obj, key, value) {
205
- return obj[key] = value;
206
- };
207
- }
208
- function wrap(innerFn, outerFn, self, tryLocsList) {
209
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
210
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
211
- var generator = Object.create(protoGenerator.prototype);
212
- var context = new Context(tryLocsList || []);
213
-
214
- // The ._invoke method unifies the implementations of the .next,
215
- // .throw, and .return methods.
216
- generator._invoke = makeInvokeMethod(innerFn, self, context);
217
- return generator;
218
- }
219
- exports.wrap = wrap;
220
-
221
- // Try/catch helper to minimize deoptimizations. Returns a completion
222
- // record like context.tryEntries[i].completion. This interface could
223
- // have been (and was previously) designed to take a closure to be
224
- // invoked without arguments, but in all the cases we care about we
225
- // already have an existing method we want to call, so there's no need
226
- // to create a new function object. We can even get away with assuming
227
- // the method takes exactly one argument, since that happens to be true
228
- // in every case, so we don't have to touch the arguments object. The
229
- // only additional allocation required is the completion record, which
230
- // has a stable shape and so hopefully should be cheap to allocate.
231
- function tryCatch(fn, obj, arg) {
232
- try {
233
- return {
234
- type: "normal",
235
- arg: fn.call(obj, arg)
236
- };
237
- } catch (err) {
238
- return {
239
- type: "throw",
240
- arg: err
241
- };
242
- }
243
- }
244
- var GenStateSuspendedStart = "suspendedStart";
245
- var GenStateSuspendedYield = "suspendedYield";
246
- var GenStateExecuting = "executing";
247
- var GenStateCompleted = "completed";
248
-
249
- // Returning this object from the innerFn has the same effect as
250
- // breaking out of the dispatch switch statement.
251
- var ContinueSentinel = {};
252
-
253
- // Dummy constructor functions that we use as the .constructor and
254
- // .constructor.prototype properties for functions that return Generator
255
- // objects. For full spec compliance, you may wish to configure your
256
- // minifier not to mangle the names of these two functions.
257
- function Generator() {}
258
- function GeneratorFunction() {}
259
- function GeneratorFunctionPrototype() {}
260
-
261
- // This is a polyfill for %IteratorPrototype% for environments that
262
- // don't natively support it.
263
- var IteratorPrototype = {};
264
- define(IteratorPrototype, iteratorSymbol, function () {
265
- return this;
266
- });
267
- var getProto = Object.getPrototypeOf;
268
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
269
- if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
270
- // This environment has a native %IteratorPrototype%; use it instead
271
- // of the polyfill.
272
- IteratorPrototype = NativeIteratorPrototype;
273
- }
274
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
275
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
276
- define(Gp, "constructor", GeneratorFunctionPrototype);
277
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
278
- GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
279
-
280
- // Helper for defining the .next, .throw, and .return methods of the
281
- // Iterator interface in terms of a single ._invoke method.
282
- function defineIteratorMethods(prototype) {
283
- ["next", "throw", "return"].forEach(function (method) {
284
- define(prototype, method, function (arg) {
285
- return this._invoke(method, arg);
286
- });
287
- });
288
- }
289
- exports.isGeneratorFunction = function (genFun) {
290
- var ctor = typeof genFun === "function" && genFun.constructor;
291
- return ctor ? ctor === GeneratorFunction ||
292
- // For the native GeneratorFunction constructor, the best we can
293
- // do is to check its .name property.
294
- (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
295
- };
296
- exports.mark = function (genFun) {
297
- if (Object.setPrototypeOf) {
298
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
299
- } else {
300
- genFun.__proto__ = GeneratorFunctionPrototype;
301
- define(genFun, toStringTagSymbol, "GeneratorFunction");
302
- }
303
- genFun.prototype = Object.create(Gp);
304
- return genFun;
305
- };
306
-
307
- // Within the body of any async function, `await x` is transformed to
308
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
309
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
310
- // meant to be awaited.
311
- exports.awrap = function (arg) {
312
- return {
313
- __await: arg
314
- };
315
- };
316
- function AsyncIterator(generator, PromiseImpl) {
317
- function invoke(method, arg, resolve, reject) {
318
- var record = tryCatch(generator[method], generator, arg);
319
- if (record.type === "throw") {
320
- reject(record.arg);
321
- } else {
322
- var result = record.arg;
323
- var value = result.value;
324
- if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
325
- return PromiseImpl.resolve(value.__await).then(function (value) {
326
- invoke("next", value, resolve, reject);
327
- }, function (err) {
328
- invoke("throw", err, resolve, reject);
329
- });
330
- }
331
- return PromiseImpl.resolve(value).then(function (unwrapped) {
332
- // When a yielded Promise is resolved, its final value becomes
333
- // the .value of the Promise<{value,done}> result for the
334
- // current iteration.
335
- result.value = unwrapped;
336
- resolve(result);
337
- }, function (error) {
338
- // If a rejected Promise was yielded, throw the rejection back
339
- // into the async generator function so it can be handled there.
340
- return invoke("throw", error, resolve, reject);
341
- });
342
- }
343
- }
344
- var previousPromise;
345
- function enqueue(method, arg) {
346
- function callInvokeWithMethodAndArg() {
347
- return new PromiseImpl(function (resolve, reject) {
348
- invoke(method, arg, resolve, reject);
349
- });
350
- }
351
- return previousPromise =
352
- // If enqueue has been called before, then we want to wait until
353
- // all previous Promises have been resolved before calling invoke,
354
- // so that results are always delivered in the correct order. If
355
- // enqueue has not been called before, then it is important to
356
- // call invoke immediately, without waiting on a callback to fire,
357
- // so that the async generator function has the opportunity to do
358
- // any necessary setup in a predictable way. This predictability
359
- // is why the Promise constructor synchronously invokes its
360
- // executor callback, and why async functions synchronously
361
- // execute code before the first await. Since we implement simple
362
- // async functions in terms of async generators, it is especially
363
- // important to get this right, even though it requires care.
364
- previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
365
- // Avoid propagating failures to Promises returned by later
366
- // invocations of the iterator.
367
- callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
368
- }
369
-
370
- // Define the unified helper method that is used to implement .next,
371
- // .throw, and .return (see defineIteratorMethods).
372
- this._invoke = enqueue;
373
- }
374
- defineIteratorMethods(AsyncIterator.prototype);
375
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
376
- return this;
377
- });
378
- exports.AsyncIterator = AsyncIterator;
379
-
380
- // Note that simple async functions are implemented on top of
381
- // AsyncIterator objects; they just return a Promise for the value of
382
- // the final result produced by the iterator.
383
- exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
384
- if (PromiseImpl === void 0) PromiseImpl = Promise;
385
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
386
- return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
387
- : iter.next().then(function (result) {
388
- return result.done ? result.value : iter.next();
389
- });
390
- };
391
- function makeInvokeMethod(innerFn, self, context) {
392
- var state = GenStateSuspendedStart;
393
- return function invoke(method, arg) {
394
- if (state === GenStateExecuting) {
395
- throw new Error("Generator is already running");
396
- }
397
- if (state === GenStateCompleted) {
398
- if (method === "throw") {
399
- throw arg;
400
- }
401
-
402
- // Be forgiving, per 25.3.3.3.3 of the spec:
403
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
404
- return doneResult();
405
- }
406
- context.method = method;
407
- context.arg = arg;
408
- while (true) {
409
- var delegate = context.delegate;
410
- if (delegate) {
411
- var delegateResult = maybeInvokeDelegate(delegate, context);
412
- if (delegateResult) {
413
- if (delegateResult === ContinueSentinel) continue;
414
- return delegateResult;
415
- }
416
- }
417
- if (context.method === "next") {
418
- // Setting context._sent for legacy support of Babel's
419
- // function.sent implementation.
420
- context.sent = context._sent = context.arg;
421
- } else if (context.method === "throw") {
422
- if (state === GenStateSuspendedStart) {
423
- state = GenStateCompleted;
424
- throw context.arg;
425
- }
426
- context.dispatchException(context.arg);
427
- } else if (context.method === "return") {
428
- context.abrupt("return", context.arg);
429
- }
430
- state = GenStateExecuting;
431
- var record = tryCatch(innerFn, self, context);
432
- if (record.type === "normal") {
433
- // If an exception is thrown from innerFn, we leave state ===
434
- // GenStateExecuting and loop back for another invocation.
435
- state = context.done ? GenStateCompleted : GenStateSuspendedYield;
436
- if (record.arg === ContinueSentinel) {
437
- continue;
438
- }
439
- return {
440
- value: record.arg,
441
- done: context.done
442
- };
443
- } else if (record.type === "throw") {
444
- state = GenStateCompleted;
445
- // Dispatch the exception by looping back around to the
446
- // context.dispatchException(context.arg) call above.
447
- context.method = "throw";
448
- context.arg = record.arg;
449
- }
450
- }
451
- };
452
- }
453
-
454
- // Call delegate.iterator[context.method](context.arg) and handle the
455
- // result, either by returning a { value, done } result from the
456
- // delegate iterator, or by modifying context.method and context.arg,
457
- // setting context.delegate to null, and returning the ContinueSentinel.
458
- function maybeInvokeDelegate(delegate, context) {
459
- var method = delegate.iterator[context.method];
460
- if (method === undefined$1) {
461
- // A .throw or .return when the delegate iterator has no .throw
462
- // method always terminates the yield* loop.
463
- context.delegate = null;
464
- if (context.method === "throw") {
465
- // Note: ["return"] must be used for ES3 parsing compatibility.
466
- if (delegate.iterator["return"]) {
467
- // If the delegate iterator has a return method, give it a
468
- // chance to clean up.
469
- context.method = "return";
470
- context.arg = undefined$1;
471
- maybeInvokeDelegate(delegate, context);
472
- if (context.method === "throw") {
473
- // If maybeInvokeDelegate(context) changed context.method from
474
- // "return" to "throw", let that override the TypeError below.
475
- return ContinueSentinel;
476
- }
477
- }
478
- context.method = "throw";
479
- context.arg = new TypeError("The iterator does not provide a 'throw' method");
480
- }
481
- return ContinueSentinel;
482
- }
483
- var record = tryCatch(method, delegate.iterator, context.arg);
484
- if (record.type === "throw") {
485
- context.method = "throw";
486
- context.arg = record.arg;
487
- context.delegate = null;
488
- return ContinueSentinel;
489
- }
490
- var info = record.arg;
491
- if (!info) {
492
- context.method = "throw";
493
- context.arg = new TypeError("iterator result is not an object");
494
- context.delegate = null;
495
- return ContinueSentinel;
496
- }
497
- if (info.done) {
498
- // Assign the result of the finished delegate to the temporary
499
- // variable specified by delegate.resultName (see delegateYield).
500
- context[delegate.resultName] = info.value;
501
-
502
- // Resume execution at the desired location (see delegateYield).
503
- context.next = delegate.nextLoc;
504
-
505
- // If context.method was "throw" but the delegate handled the
506
- // exception, let the outer generator proceed normally. If
507
- // context.method was "next", forget context.arg since it has been
508
- // "consumed" by the delegate iterator. If context.method was
509
- // "return", allow the original .return call to continue in the
510
- // outer generator.
511
- if (context.method !== "return") {
512
- context.method = "next";
513
- context.arg = undefined$1;
514
- }
515
- } else {
516
- // Re-yield the result returned by the delegate method.
517
- return info;
518
- }
519
-
520
- // The delegate iterator is finished, so forget it and continue with
521
- // the outer generator.
522
- context.delegate = null;
523
- return ContinueSentinel;
524
- }
525
-
526
- // Define Generator.prototype.{next,throw,return} in terms of the
527
- // unified ._invoke helper method.
528
- defineIteratorMethods(Gp);
529
- define(Gp, toStringTagSymbol, "Generator");
530
-
531
- // A Generator should always return itself as the iterator object when the
532
- // @@iterator function is called on it. Some browsers' implementations of the
533
- // iterator prototype chain incorrectly implement this, causing the Generator
534
- // object to not be returned from this call. This ensures that doesn't happen.
535
- // See https://github.com/facebook/regenerator/issues/274 for more details.
536
- define(Gp, iteratorSymbol, function () {
537
- return this;
538
- });
539
- define(Gp, "toString", function () {
540
- return "[object Generator]";
541
- });
542
- function pushTryEntry(locs) {
543
- var entry = {
544
- tryLoc: locs[0]
545
- };
546
- if (1 in locs) {
547
- entry.catchLoc = locs[1];
548
- }
549
- if (2 in locs) {
550
- entry.finallyLoc = locs[2];
551
- entry.afterLoc = locs[3];
552
- }
553
- this.tryEntries.push(entry);
554
- }
555
- function resetTryEntry(entry) {
556
- var record = entry.completion || {};
557
- record.type = "normal";
558
- delete record.arg;
559
- entry.completion = record;
560
- }
561
- function Context(tryLocsList) {
562
- // The root entry object (effectively a try statement without a catch
563
- // or a finally block) gives us a place to store values thrown from
564
- // locations where there is no enclosing try statement.
565
- this.tryEntries = [{
566
- tryLoc: "root"
567
- }];
568
- tryLocsList.forEach(pushTryEntry, this);
569
- this.reset(true);
570
- }
571
- exports.keys = function (object) {
572
- var keys = [];
573
- for (var key in object) {
574
- keys.push(key);
575
- }
576
- keys.reverse();
577
-
578
- // Rather than returning an object with a next method, we keep
579
- // things simple and return the next function itself.
580
- return function next() {
581
- while (keys.length) {
582
- var key = keys.pop();
583
- if (key in object) {
584
- next.value = key;
585
- next.done = false;
586
- return next;
587
- }
588
- }
589
-
590
- // To avoid creating an additional object, we just hang the .value
591
- // and .done properties off the next function object itself. This
592
- // also ensures that the minifier will not anonymize the function.
593
- next.done = true;
594
- return next;
595
- };
596
- };
597
- function values(iterable) {
598
- if (iterable) {
599
- var iteratorMethod = iterable[iteratorSymbol];
600
- if (iteratorMethod) {
601
- return iteratorMethod.call(iterable);
602
- }
603
- if (typeof iterable.next === "function") {
604
- return iterable;
605
- }
606
- if (!isNaN(iterable.length)) {
607
- var i = -1,
608
- next = function next() {
609
- while (++i < iterable.length) {
610
- if (hasOwn.call(iterable, i)) {
611
- next.value = iterable[i];
612
- next.done = false;
613
- return next;
614
- }
615
- }
616
- next.value = undefined$1;
617
- next.done = true;
618
- return next;
619
- };
620
- return next.next = next;
621
- }
622
- }
623
-
624
- // Return an iterator with no values.
625
- return {
626
- next: doneResult
627
- };
628
- }
629
- exports.values = values;
630
- function doneResult() {
631
- return {
632
- value: undefined$1,
633
- done: true
634
- };
635
- }
636
- Context.prototype = {
637
- constructor: Context,
638
- reset: function reset(skipTempReset) {
639
- this.prev = 0;
640
- this.next = 0;
641
- // Resetting context._sent for legacy support of Babel's
642
- // function.sent implementation.
643
- this.sent = this._sent = undefined$1;
644
- this.done = false;
645
- this.delegate = null;
646
- this.method = "next";
647
- this.arg = undefined$1;
648
- this.tryEntries.forEach(resetTryEntry);
649
- if (!skipTempReset) {
650
- for (var name in this) {
651
- // Not sure about the optimal order of these conditions:
652
- if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
653
- this[name] = undefined$1;
654
- }
655
- }
656
- }
657
- },
658
- stop: function stop() {
659
- this.done = true;
660
- var rootEntry = this.tryEntries[0];
661
- var rootRecord = rootEntry.completion;
662
- if (rootRecord.type === "throw") {
663
- throw rootRecord.arg;
664
- }
665
- return this.rval;
666
- },
667
- dispatchException: function dispatchException(exception) {
668
- if (this.done) {
669
- throw exception;
670
- }
671
- var context = this;
672
- function handle(loc, caught) {
673
- record.type = "throw";
674
- record.arg = exception;
675
- context.next = loc;
676
- if (caught) {
677
- // If the dispatched exception was caught by a catch block,
678
- // then let that catch block handle the exception normally.
679
- context.method = "next";
680
- context.arg = undefined$1;
681
- }
682
- return !!caught;
683
- }
684
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
685
- var entry = this.tryEntries[i];
686
- var record = entry.completion;
687
- if (entry.tryLoc === "root") {
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
- }
693
- if (entry.tryLoc <= this.prev) {
694
- var hasCatch = hasOwn.call(entry, "catchLoc");
695
- var hasFinally = hasOwn.call(entry, "finallyLoc");
696
- if (hasCatch && hasFinally) {
697
- if (this.prev < entry.catchLoc) {
698
- return handle(entry.catchLoc, true);
699
- } else if (this.prev < entry.finallyLoc) {
700
- return handle(entry.finallyLoc);
701
- }
702
- } else if (hasCatch) {
703
- if (this.prev < entry.catchLoc) {
704
- return handle(entry.catchLoc, true);
705
- }
706
- } else if (hasFinally) {
707
- if (this.prev < entry.finallyLoc) {
708
- return handle(entry.finallyLoc);
709
- }
710
- } else {
711
- throw new Error("try statement without catch or finally");
712
- }
713
- }
714
- }
715
- },
716
- abrupt: function abrupt(type, arg) {
717
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
718
- var entry = this.tryEntries[i];
719
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
720
- var finallyEntry = entry;
721
- break;
722
- }
723
- }
724
- if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
725
- // Ignore the finally entry if control is not jumping to a
726
- // location outside the try/catch block.
727
- finallyEntry = null;
728
- }
729
- var record = finallyEntry ? finallyEntry.completion : {};
730
- record.type = type;
731
- record.arg = arg;
732
- if (finallyEntry) {
733
- this.method = "next";
734
- this.next = finallyEntry.finallyLoc;
735
- return ContinueSentinel;
736
- }
737
- return this.complete(record);
738
- },
739
- complete: function complete(record, afterLoc) {
740
- if (record.type === "throw") {
741
- throw record.arg;
742
- }
743
- if (record.type === "break" || record.type === "continue") {
744
- this.next = record.arg;
745
- } else if (record.type === "return") {
746
- this.rval = this.arg = record.arg;
747
- this.method = "return";
748
- this.next = "end";
749
- } else if (record.type === "normal" && afterLoc) {
750
- this.next = afterLoc;
751
- }
752
- return ContinueSentinel;
753
- },
754
- finish: function finish(finallyLoc) {
755
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
756
- var entry = this.tryEntries[i];
757
- if (entry.finallyLoc === finallyLoc) {
758
- this.complete(entry.completion, entry.afterLoc);
759
- resetTryEntry(entry);
760
- return ContinueSentinel;
761
- }
762
- }
763
- },
764
- "catch": function _catch(tryLoc) {
765
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
766
- var entry = this.tryEntries[i];
767
- if (entry.tryLoc === tryLoc) {
768
- var record = entry.completion;
769
- if (record.type === "throw") {
770
- var thrown = record.arg;
771
- resetTryEntry(entry);
772
- }
773
- return thrown;
774
- }
775
- }
776
-
777
- // The context.catch method must only be called with a location
778
- // argument that corresponds to a known catch block.
779
- throw new Error("illegal catch attempt");
780
- },
781
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
782
- this.delegate = {
783
- iterator: values(iterable),
784
- resultName: resultName,
785
- nextLoc: nextLoc
786
- };
787
- if (this.method === "next") {
788
- // Deliberately forget the last sent value so that we don't
789
- // accidentally pass it on to the delegate.
790
- this.arg = undefined$1;
791
- }
792
- return ContinueSentinel;
793
- }
794
- };
795
-
796
- // Regardless of whether this script is executing as a CommonJS module
797
- // or not, return the runtime object so that we can declare the variable
798
- // regeneratorRuntime in the outer scope, which allows this module to be
799
- // injected easily by `bin/regenerator --include-runtime script.js`.
800
- return exports;
801
- }(
802
- // If this script is executing as a CommonJS module, use module.exports
803
- // as the regeneratorRuntime namespace. Otherwise create a new empty
804
- // object. Either way, the resulting object will be used to initialize
805
- // the regeneratorRuntime variable at the top of this file.
806
- module.exports );
807
- try {
808
- regeneratorRuntime = runtime;
809
- } catch (accidentalStrictMode) {
810
- // This module should not be running in strict mode, so the above
811
- // assignment should always work unless something is misconfigured. Just
812
- // in case runtime.js accidentally runs in strict mode, in modern engines
813
- // we can explicitly access globalThis. In older engines we can escape
814
- // strict mode using a global Function call. This could conceivably fail
815
- // if a Content Security Policy forbids using Function, but in that case
816
- // the proper solution is to fix the accidental strict mode problem. If
817
- // you've misconfigured your bundler to force strict mode and applied a
818
- // CSP to forbid Function, and you're not willing to fix either of those
819
- // problems, please detail your unique predicament in a GitHub issue.
820
- if (typeof globalThis === "object") {
821
- globalThis.regeneratorRuntime = runtime;
822
- } else {
823
- Function("r", "regeneratorRuntime = r")(runtime);
824
- }
825
- }
826
- });
827
-
828
471
  var _excluded = ["children"];
829
472
  var Commerce = /*#__PURE__*/createContext({});
830
473
  function CoreCommerceProvider(_ref) {
@@ -914,58 +557,54 @@ var FetcherError = /*#__PURE__*/function (_CommerceError2) {
914
557
  }(CommerceError);
915
558
 
916
559
  var useData = function useData(options, input, fetcherFn, swrOptions, provider) {
560
+ var _ref;
917
561
  var hookInput = Array.isArray(input) ? input : Object.entries(input);
918
- var fetcher = /*#__PURE__*/function () {
919
- var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(url, query, method) {
562
+ var fetcher = function fetcher(_x, _x2, _x3) {
563
+ return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url, query, method) {
920
564
  var _len,
921
565
  args,
922
566
  _key,
923
567
  _args = arguments;
924
- return runtime_1.wrap(function _callee$(_context) {
925
- while (1) {
926
- switch (_context.prev = _context.next) {
927
- case 0:
928
- _context.prev = 0;
929
- for (_len = _args.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
930
- args[_key - 3] = _args[_key];
931
- }
932
- _context.next = 4;
933
- return options.fetcher({
934
- options: {
935
- url: url,
936
- query: query,
937
- method: method
938
- },
939
- // Transform the input array into an object
940
- input: args.reduce(function (obj, val, i) {
941
- obj[hookInput[i][0]] = val;
942
- return obj;
943
- }, {}),
944
- fetch: fetcherFn,
945
- provider: provider
946
- });
947
- case 4:
948
- return _context.abrupt("return", _context.sent);
949
- case 7:
950
- _context.prev = 7;
951
- _context.t0 = _context["catch"](0);
952
- // SWR will not log errors, but any error that's not an instance
953
- // of CommerceError is not welcomed by this hook
954
- if (!(_context.t0 instanceof CommerceError)) {
955
- console.error(_context.t0);
956
- }
957
- throw _context.t0;
958
- case 11:
959
- case "end":
960
- return _context.stop();
961
- }
568
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
569
+ while (1) switch (_context.prev = _context.next) {
570
+ case 0:
571
+ _context.prev = 0;
572
+ for (_len = _args.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
573
+ args[_key - 3] = _args[_key];
574
+ }
575
+ _context.next = 4;
576
+ return options.fetcher({
577
+ options: {
578
+ url: url,
579
+ query: query,
580
+ method: method
581
+ },
582
+ // Transform the input array into an object
583
+ input: args.reduce(function (obj, val, i) {
584
+ obj[hookInput[i][0]] = val;
585
+ return obj;
586
+ }, {}),
587
+ fetch: fetcherFn,
588
+ provider: provider
589
+ });
590
+ case 4:
591
+ return _context.abrupt("return", _context.sent);
592
+ case 7:
593
+ _context.prev = 7;
594
+ _context.t0 = _context["catch"](0);
595
+ // SWR will not log errors, but any error that's not an instance
596
+ // of CommerceError is not welcomed by this hook
597
+ if (!(_context.t0 instanceof CommerceError)) {
598
+ console.error(_context.t0);
599
+ }
600
+ throw _context.t0;
601
+ case 11:
602
+ case "end":
603
+ return _context.stop();
962
604
  }
963
605
  }, _callee, null, [[0, 7]]);
964
- }));
965
- return function fetcher(_x, _x2, _x3) {
966
- return _ref.apply(this, arguments);
967
- };
968
- }();
606
+ }))).apply(this, arguments);
607
+ };
969
608
  var response = useMutablePlasmicQueryData(function () {
970
609
  var opts = options.fetchOptions;
971
610
  return opts ? [opts.url, opts.query, opts.method].concat(hookInput.map(function (e) {
@@ -1257,49 +896,45 @@ var addToCartButtonMeta = {
1257
896
  importName: "AddToCartButton"
1258
897
  };
1259
898
  function AddToCartButton(props) {
899
+ var _ref;
1260
900
  var children = props.children;
1261
901
  var product = useProduct();
1262
902
  var form = useFormContext();
1263
903
  var addItem = useAddItem();
1264
- var addToCart = /*#__PURE__*/function () {
1265
- var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
904
+ var addToCart = function addToCart() {
905
+ return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1266
906
  var _form$getValues$Produ;
1267
907
  var quantity, _form$getValues$Produ2, variantId;
1268
- return runtime_1.wrap(function _callee$(_context) {
1269
- while (1) {
1270
- switch (_context.prev = _context.next) {
1271
- case 0:
1272
- quantity = +((_form$getValues$Produ = form.getValues()["ProductQuantity"]) != null ? _form$getValues$Produ : 1);
1273
- if (!(isNaN(quantity) || quantity < 1)) {
1274
- _context.next = 3;
1275
- break;
1276
- }
1277
- throw new CommerceError({
1278
- message: "The item quantity has to be a valid integer greater than 0"
1279
- });
1280
- case 3:
1281
- if (!product) {
1282
- _context.next = 7;
1283
- break;
1284
- }
1285
- variantId = (_form$getValues$Produ2 = form.getValues()["ProductVariant"]) != null ? _form$getValues$Produ2 : product.variants[0].id;
908
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
909
+ while (1) switch (_context.prev = _context.next) {
910
+ case 0:
911
+ quantity = +((_form$getValues$Produ = form.getValues()["ProductQuantity"]) != null ? _form$getValues$Produ : 1);
912
+ if (!(isNaN(quantity) || quantity < 1)) {
913
+ _context.next = 3;
914
+ break;
915
+ }
916
+ throw new CommerceError({
917
+ message: "The item quantity has to be a valid integer greater than 0"
918
+ });
919
+ case 3:
920
+ if (!product) {
1286
921
  _context.next = 7;
1287
- return addItem({
1288
- productId: product.id,
1289
- variantId: variantId,
1290
- quantity: quantity
1291
- });
1292
- case 7:
1293
- case "end":
1294
- return _context.stop();
1295
- }
922
+ break;
923
+ }
924
+ variantId = (_form$getValues$Produ2 = form.getValues()["ProductVariant"]) != null ? _form$getValues$Produ2 : product.variants[0].id;
925
+ _context.next = 7;
926
+ return addItem({
927
+ productId: product.id,
928
+ variantId: variantId,
929
+ quantity: quantity
930
+ });
931
+ case 7:
932
+ case "end":
933
+ return _context.stop();
1296
934
  }
1297
935
  }, _callee);
1298
- }));
1299
- return function addToCart() {
1300
- return _ref.apply(this, arguments);
1301
- };
1302
- }();
936
+ }))).apply(this, arguments);
937
+ };
1303
938
  return React.isValidElement(children) ? React.cloneElement(children, {
1304
939
  onClick: function onClick(e) {
1305
940
  if (children.props.onClick && typeof children.props.onClick === "function") {
@@ -1316,39 +951,35 @@ function registerAddToCartButton(loader, customAddToCartButtonMeta) {
1316
951
  doRegisterComponent(AddToCartButton, customAddToCartButtonMeta != null ? customAddToCartButtonMeta : addToCartButtonMeta);
1317
952
  }
1318
953
 
1319
- var fetcher$3 = /*#__PURE__*/function () {
1320
- var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref) {
954
+ var _ref2;
955
+ var fetcher$3 = function fetcher(_x) {
956
+ return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
1321
957
  var options, cartId, fetch;
1322
- return runtime_1.wrap(function _callee$(_context) {
1323
- while (1) {
1324
- switch (_context.prev = _context.next) {
1325
- case 0:
1326
- options = _ref.options, cartId = _ref.input.cartId, fetch = _ref.fetch;
1327
- if (!cartId) {
1328
- _context.next = 7;
1329
- break;
1330
- }
1331
- _context.next = 4;
1332
- return fetch(options);
1333
- case 4:
1334
- _context.t0 = _context.sent;
1335
- _context.next = 8;
958
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
959
+ while (1) switch (_context.prev = _context.next) {
960
+ case 0:
961
+ options = _ref.options, cartId = _ref.input.cartId, fetch = _ref.fetch;
962
+ if (!cartId) {
963
+ _context.next = 7;
1336
964
  break;
1337
- case 7:
1338
- _context.t0 = null;
1339
- case 8:
1340
- return _context.abrupt("return", _context.t0);
1341
- case 9:
1342
- case "end":
1343
- return _context.stop();
1344
- }
965
+ }
966
+ _context.next = 4;
967
+ return fetch(options);
968
+ case 4:
969
+ _context.t0 = _context.sent;
970
+ _context.next = 8;
971
+ break;
972
+ case 7:
973
+ _context.t0 = null;
974
+ case 8:
975
+ return _context.abrupt("return", _context.t0);
976
+ case 9:
977
+ case "end":
978
+ return _context.stop();
1345
979
  }
1346
980
  }, _callee);
1347
- }));
1348
- return function fetcher(_x) {
1349
- return _ref2.apply(this, arguments);
1350
- };
1351
- }();
981
+ }))).apply(this, arguments);
982
+ };
1352
983
  var fn$3 = function fn(provider) {
1353
984
  var _provider$cart;
1354
985
  return (_provider$cart = provider.cart) == null ? void 0 : _provider$cart.useCart;
@@ -1616,7 +1247,7 @@ function CategoryCollection(props) {
1616
1247
  categories = _useCategories2.data,
1617
1248
  isLoading = _useCategories2.isLoading;
1618
1249
  if (allCategories) {
1619
- setControlContextData == null ? void 0 : setControlContextData({
1250
+ setControlContextData == null || setControlContextData({
1620
1251
  categories: allCategories
1621
1252
  });
1622
1253
  }
@@ -1862,7 +1493,7 @@ function ProductBox(props) {
1862
1493
  return setProductSearch(value);
1863
1494
  }, 300), []);
1864
1495
  if (allProducts) {
1865
- setControlContextData == null ? void 0 : setControlContextData({
1496
+ setControlContextData == null || setControlContextData({
1866
1497
  products: allProducts.products,
1867
1498
  onSearch: onSearch
1868
1499
  });
@@ -1974,7 +1605,7 @@ var productCollectionMeta = {
1974
1605
  },
1975
1606
  defaultValueHint: function defaultValueHint(props, ctx) {
1976
1607
  var _ctx$categoryCtx;
1977
- return ctx == null ? void 0 : (_ctx$categoryCtx = ctx.categoryCtx) == null ? void 0 : _ctx$categoryCtx.name;
1608
+ return ctx == null || (_ctx$categoryCtx = ctx.categoryCtx) == null ? void 0 : _ctx$categoryCtx.name;
1978
1609
  },
1979
1610
  readOnly: function readOnly(props, ctx) {
1980
1611
  return !!(ctx != null && ctx.categoryCtx);
@@ -2077,7 +1708,7 @@ function ProductCollection(props) {
2077
1708
  var features = useCommerceExtraFeatures();
2078
1709
  var primaryCategory = usePrimaryCategory();
2079
1710
  if (categories && brands) {
2080
- setControlContextData == null ? void 0 : setControlContextData({
1711
+ setControlContextData == null || setControlContextData({
2081
1712
  categories: categories,
2082
1713
  brands: brands,
2083
1714
  features: features,
@@ -2188,7 +1819,7 @@ var ProductMedia = /*#__PURE__*/React.forwardRef(function (props, ref) {
2188
1819
  setControlContextData = props.setControlContextData;
2189
1820
  var product = useProduct();
2190
1821
  var mediaContext = useProductMediaContext();
2191
- setControlContextData == null ? void 0 : setControlContextData({
1822
+ setControlContextData == null || setControlContextData({
2192
1823
  inMediaContext: mediaContext !== undefined
2193
1824
  });
2194
1825
  var image = product == null ? void 0 : product.images[mediaContext != null ? mediaContext : mediaIndex];
@@ -2476,7 +2107,7 @@ function ProductVariantPicker(props) {
2476
2107
  return React.createElement(Controller, {
2477
2108
  name: "ProductVariant",
2478
2109
  control: form == null ? void 0 : form.control,
2479
- defaultValue: product == null ? void 0 : (_product$variants$fin = product.variants.find(function (v) {
2110
+ defaultValue: product == null || (_product$variants$fin = product.variants.find(function (v) {
2480
2111
  return v.price === product.price.value;
2481
2112
  })) == null ? void 0 : _product$variants$fin.id,
2482
2113
  render: function render(_ref) {