@plasmicpkgs/plasmic-yotpo 0.0.4 → 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.
@@ -11,694 +11,337 @@ var React__default = _interopDefault(React);
11
11
  var query = require('@plasmicapp/query');
12
12
  var L = _interopDefault(require('lodash'));
13
13
 
14
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
14
+ function _regeneratorRuntime() {
15
+ _regeneratorRuntime = function () {
16
+ return e;
17
+ };
18
+ var t,
19
+ e = {},
20
+ r = Object.prototype,
21
+ n = r.hasOwnProperty,
22
+ o = Object.defineProperty || function (t, e, r) {
23
+ t[e] = r.value;
24
+ },
25
+ i = "function" == typeof Symbol ? Symbol : {},
26
+ a = i.iterator || "@@iterator",
27
+ c = i.asyncIterator || "@@asyncIterator",
28
+ u = i.toStringTag || "@@toStringTag";
29
+ function define(t, e, r) {
30
+ return Object.defineProperty(t, e, {
31
+ value: r,
32
+ enumerable: !0,
33
+ configurable: !0,
34
+ writable: !0
35
+ }), t[e];
36
+ }
15
37
  try {
16
- var info = gen[key](arg);
17
- var value = info.value;
18
- } catch (error) {
19
- reject(error);
20
- return;
38
+ define({}, "");
39
+ } catch (t) {
40
+ define = function (t, e, r) {
41
+ return t[e] = r;
42
+ };
21
43
  }
22
- if (info.done) {
23
- resolve(value);
24
- } else {
25
- Promise.resolve(value).then(_next, _throw);
44
+ function wrap(t, e, r, n) {
45
+ var i = e && e.prototype instanceof Generator ? e : Generator,
46
+ a = Object.create(i.prototype),
47
+ c = new Context(n || []);
48
+ return o(a, "_invoke", {
49
+ value: makeInvokeMethod(t, r, c)
50
+ }), a;
26
51
  }
27
- }
28
- function _asyncToGenerator(fn) {
29
- return function () {
30
- var self = this,
31
- args = arguments;
32
- return new Promise(function (resolve, reject) {
33
- var gen = fn.apply(self, args);
34
- function _next(value) {
35
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
36
- }
37
- function _throw(err) {
38
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
39
- }
40
- _next(undefined);
41
- });
42
- };
43
- }
44
-
45
- function createCommonjsModule(fn, module) {
46
- return module = { exports: {} }, fn(module, module.exports), module.exports;
47
- }
48
-
49
- var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
50
- /**
51
- * Copyright (c) 2014-present, Facebook, Inc.
52
- *
53
- * This source code is licensed under the MIT license found in the
54
- * LICENSE file in the root directory of this source tree.
55
- */
56
-
57
- var runtime = function (exports) {
58
-
59
- var Op = Object.prototype;
60
- var hasOwn = Op.hasOwnProperty;
61
- var undefined$1; // More compressible than void 0.
62
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
63
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
64
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
65
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
66
- function define(obj, key, value) {
67
- Object.defineProperty(obj, key, {
68
- value: value,
69
- enumerable: true,
70
- configurable: true,
71
- writable: true
72
- });
73
- return obj[key];
74
- }
52
+ function tryCatch(t, e, r) {
75
53
  try {
76
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
77
- define({}, "");
78
- } catch (err) {
79
- define = function define(obj, key, value) {
80
- return obj[key] = value;
54
+ return {
55
+ type: "normal",
56
+ arg: t.call(e, r)
57
+ };
58
+ } catch (t) {
59
+ return {
60
+ type: "throw",
61
+ arg: t
81
62
  };
82
63
  }
83
- function wrap(innerFn, outerFn, self, tryLocsList) {
84
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
85
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
86
- var generator = Object.create(protoGenerator.prototype);
87
- var context = new Context(tryLocsList || []);
88
-
89
- // The ._invoke method unifies the implementations of the .next,
90
- // .throw, and .return methods.
91
- generator._invoke = makeInvokeMethod(innerFn, self, context);
92
- return generator;
93
- }
94
- exports.wrap = wrap;
95
-
96
- // Try/catch helper to minimize deoptimizations. Returns a completion
97
- // record like context.tryEntries[i].completion. This interface could
98
- // have been (and was previously) designed to take a closure to be
99
- // invoked without arguments, but in all the cases we care about we
100
- // already have an existing method we want to call, so there's no need
101
- // to create a new function object. We can even get away with assuming
102
- // the method takes exactly one argument, since that happens to be true
103
- // in every case, so we don't have to touch the arguments object. The
104
- // only additional allocation required is the completion record, which
105
- // has a stable shape and so hopefully should be cheap to allocate.
106
- function tryCatch(fn, obj, arg) {
107
- try {
108
- return {
109
- type: "normal",
110
- arg: fn.call(obj, arg)
111
- };
112
- } catch (err) {
113
- return {
114
- type: "throw",
115
- arg: err
116
- };
117
- }
118
- }
119
- var GenStateSuspendedStart = "suspendedStart";
120
- var GenStateSuspendedYield = "suspendedYield";
121
- var GenStateExecuting = "executing";
122
- var GenStateCompleted = "completed";
123
-
124
- // Returning this object from the innerFn has the same effect as
125
- // breaking out of the dispatch switch statement.
126
- var ContinueSentinel = {};
127
-
128
- // Dummy constructor functions that we use as the .constructor and
129
- // .constructor.prototype properties for functions that return Generator
130
- // objects. For full spec compliance, you may wish to configure your
131
- // minifier not to mangle the names of these two functions.
132
- function Generator() {}
133
- function GeneratorFunction() {}
134
- function GeneratorFunctionPrototype() {}
135
-
136
- // This is a polyfill for %IteratorPrototype% for environments that
137
- // don't natively support it.
138
- var IteratorPrototype = {};
139
- define(IteratorPrototype, iteratorSymbol, function () {
140
- return this;
64
+ }
65
+ e.wrap = wrap;
66
+ var h = "suspendedStart",
67
+ l = "suspendedYield",
68
+ f = "executing",
69
+ s = "completed",
70
+ y = {};
71
+ function Generator() {}
72
+ function GeneratorFunction() {}
73
+ function GeneratorFunctionPrototype() {}
74
+ var p = {};
75
+ define(p, a, function () {
76
+ return this;
77
+ });
78
+ var d = Object.getPrototypeOf,
79
+ v = d && d(d(values([])));
80
+ v && v !== r && n.call(v, a) && (p = v);
81
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
82
+ function defineIteratorMethods(t) {
83
+ ["next", "throw", "return"].forEach(function (e) {
84
+ define(t, e, function (t) {
85
+ return this._invoke(e, t);
86
+ });
141
87
  });
142
- var getProto = Object.getPrototypeOf;
143
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
144
- if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
145
- // This environment has a native %IteratorPrototype%; use it instead
146
- // of the polyfill.
147
- IteratorPrototype = NativeIteratorPrototype;
148
- }
149
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
150
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
151
- define(Gp, "constructor", GeneratorFunctionPrototype);
152
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
153
- GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
154
-
155
- // Helper for defining the .next, .throw, and .return methods of the
156
- // Iterator interface in terms of a single ._invoke method.
157
- function defineIteratorMethods(prototype) {
158
- ["next", "throw", "return"].forEach(function (method) {
159
- define(prototype, method, function (arg) {
160
- return this._invoke(method, arg);
88
+ }
89
+ function AsyncIterator(t, e) {
90
+ function invoke(r, o, i, a) {
91
+ var c = tryCatch(t[r], t, o);
92
+ if ("throw" !== c.type) {
93
+ var u = c.arg,
94
+ h = u.value;
95
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
96
+ invoke("next", t, i, a);
97
+ }, function (t) {
98
+ invoke("throw", t, i, a);
99
+ }) : e.resolve(h).then(function (t) {
100
+ u.value = t, i(u);
101
+ }, function (t) {
102
+ return invoke("throw", t, i, a);
161
103
  });
162
- });
163
- }
164
- exports.isGeneratorFunction = function (genFun) {
165
- var ctor = typeof genFun === "function" && genFun.constructor;
166
- return ctor ? ctor === GeneratorFunction ||
167
- // For the native GeneratorFunction constructor, the best we can
168
- // do is to check its .name property.
169
- (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
170
- };
171
- exports.mark = function (genFun) {
172
- if (Object.setPrototypeOf) {
173
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
174
- } else {
175
- genFun.__proto__ = GeneratorFunctionPrototype;
176
- define(genFun, toStringTagSymbol, "GeneratorFunction");
177
- }
178
- genFun.prototype = Object.create(Gp);
179
- return genFun;
180
- };
181
-
182
- // Within the body of any async function, `await x` is transformed to
183
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
184
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
185
- // meant to be awaited.
186
- exports.awrap = function (arg) {
187
- return {
188
- __await: arg
189
- };
190
- };
191
- function AsyncIterator(generator, PromiseImpl) {
192
- function invoke(method, arg, resolve, reject) {
193
- var record = tryCatch(generator[method], generator, arg);
194
- if (record.type === "throw") {
195
- reject(record.arg);
196
- } else {
197
- var result = record.arg;
198
- var value = result.value;
199
- if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
200
- return PromiseImpl.resolve(value.__await).then(function (value) {
201
- invoke("next", value, resolve, reject);
202
- }, function (err) {
203
- invoke("throw", err, resolve, reject);
204
- });
205
- }
206
- return PromiseImpl.resolve(value).then(function (unwrapped) {
207
- // When a yielded Promise is resolved, its final value becomes
208
- // the .value of the Promise<{value,done}> result for the
209
- // current iteration.
210
- result.value = unwrapped;
211
- resolve(result);
212
- }, function (error) {
213
- // If a rejected Promise was yielded, throw the rejection back
214
- // into the async generator function so it can be handled there.
215
- return invoke("throw", error, resolve, reject);
216
- });
217
- }
218
104
  }
219
- var previousPromise;
220
- function enqueue(method, arg) {
105
+ a(c.arg);
106
+ }
107
+ var r;
108
+ o(this, "_invoke", {
109
+ value: function (t, n) {
221
110
  function callInvokeWithMethodAndArg() {
222
- return new PromiseImpl(function (resolve, reject) {
223
- invoke(method, arg, resolve, reject);
111
+ return new e(function (e, r) {
112
+ invoke(t, n, e, r);
224
113
  });
225
114
  }
226
- return previousPromise =
227
- // If enqueue has been called before, then we want to wait until
228
- // all previous Promises have been resolved before calling invoke,
229
- // so that results are always delivered in the correct order. If
230
- // enqueue has not been called before, then it is important to
231
- // call invoke immediately, without waiting on a callback to fire,
232
- // so that the async generator function has the opportunity to do
233
- // any necessary setup in a predictable way. This predictability
234
- // is why the Promise constructor synchronously invokes its
235
- // executor callback, and why async functions synchronously
236
- // execute code before the first await. Since we implement simple
237
- // async functions in terms of async generators, it is especially
238
- // important to get this right, even though it requires care.
239
- previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
240
- // Avoid propagating failures to Promises returned by later
241
- // invocations of the iterator.
242
- callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
115
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
243
116
  }
244
-
245
- // Define the unified helper method that is used to implement .next,
246
- // .throw, and .return (see defineIteratorMethods).
247
- this._invoke = enqueue;
248
- }
249
- defineIteratorMethods(AsyncIterator.prototype);
250
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
251
- return this;
252
117
  });
253
- exports.AsyncIterator = AsyncIterator;
254
-
255
- // Note that simple async functions are implemented on top of
256
- // AsyncIterator objects; they just return a Promise for the value of
257
- // the final result produced by the iterator.
258
- exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
259
- if (PromiseImpl === void 0) PromiseImpl = Promise;
260
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
261
- return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
262
- : iter.next().then(function (result) {
263
- return result.done ? result.value : iter.next();
264
- });
265
- };
266
- function makeInvokeMethod(innerFn, self, context) {
267
- var state = GenStateSuspendedStart;
268
- return function invoke(method, arg) {
269
- if (state === GenStateExecuting) {
270
- throw new Error("Generator is already running");
271
- }
272
- if (state === GenStateCompleted) {
273
- if (method === "throw") {
274
- throw arg;
275
- }
276
-
277
- // Be forgiving, per 25.3.3.3.3 of the spec:
278
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
279
- return doneResult();
280
- }
281
- context.method = method;
282
- context.arg = arg;
283
- while (true) {
284
- var delegate = context.delegate;
285
- if (delegate) {
286
- var delegateResult = maybeInvokeDelegate(delegate, context);
287
- if (delegateResult) {
288
- if (delegateResult === ContinueSentinel) continue;
289
- return delegateResult;
290
- }
291
- }
292
- if (context.method === "next") {
293
- // Setting context._sent for legacy support of Babel's
294
- // function.sent implementation.
295
- context.sent = context._sent = context.arg;
296
- } else if (context.method === "throw") {
297
- if (state === GenStateSuspendedStart) {
298
- state = GenStateCompleted;
299
- throw context.arg;
300
- }
301
- context.dispatchException(context.arg);
302
- } else if (context.method === "return") {
303
- context.abrupt("return", context.arg);
304
- }
305
- state = GenStateExecuting;
306
- var record = tryCatch(innerFn, self, context);
307
- if (record.type === "normal") {
308
- // If an exception is thrown from innerFn, we leave state ===
309
- // GenStateExecuting and loop back for another invocation.
310
- state = context.done ? GenStateCompleted : GenStateSuspendedYield;
311
- if (record.arg === ContinueSentinel) {
312
- continue;
313
- }
314
- return {
315
- value: record.arg,
316
- done: context.done
317
- };
318
- } else if (record.type === "throw") {
319
- state = GenStateCompleted;
320
- // Dispatch the exception by looping back around to the
321
- // context.dispatchException(context.arg) call above.
322
- context.method = "throw";
323
- context.arg = record.arg;
118
+ }
119
+ function makeInvokeMethod(e, r, n) {
120
+ var o = h;
121
+ return function (i, a) {
122
+ if (o === f) throw new Error("Generator is already running");
123
+ if (o === s) {
124
+ if ("throw" === i) throw a;
125
+ return {
126
+ value: t,
127
+ done: !0
128
+ };
129
+ }
130
+ for (n.method = i, n.arg = a;;) {
131
+ var c = n.delegate;
132
+ if (c) {
133
+ var u = maybeInvokeDelegate(c, n);
134
+ if (u) {
135
+ if (u === y) continue;
136
+ return u;
324
137
  }
325
138
  }
326
- };
327
- }
328
-
329
- // Call delegate.iterator[context.method](context.arg) and handle the
330
- // result, either by returning a { value, done } result from the
331
- // delegate iterator, or by modifying context.method and context.arg,
332
- // setting context.delegate to null, and returning the ContinueSentinel.
333
- function maybeInvokeDelegate(delegate, context) {
334
- var method = delegate.iterator[context.method];
335
- if (method === undefined$1) {
336
- // A .throw or .return when the delegate iterator has no .throw
337
- // method always terminates the yield* loop.
338
- context.delegate = null;
339
- if (context.method === "throw") {
340
- // Note: ["return"] must be used for ES3 parsing compatibility.
341
- if (delegate.iterator["return"]) {
342
- // If the delegate iterator has a return method, give it a
343
- // chance to clean up.
344
- context.method = "return";
345
- context.arg = undefined$1;
346
- maybeInvokeDelegate(delegate, context);
347
- if (context.method === "throw") {
348
- // If maybeInvokeDelegate(context) changed context.method from
349
- // "return" to "throw", let that override the TypeError below.
350
- return ContinueSentinel;
351
- }
352
- }
353
- context.method = "throw";
354
- context.arg = new TypeError("The iterator does not provide a 'throw' method");
139
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
140
+ if (o === h) throw o = s, n.arg;
141
+ n.dispatchException(n.arg);
142
+ } else "return" === n.method && n.abrupt("return", n.arg);
143
+ o = f;
144
+ var p = tryCatch(e, r, n);
145
+ if ("normal" === p.type) {
146
+ if (o = n.done ? s : l, p.arg === y) continue;
147
+ return {
148
+ value: p.arg,
149
+ done: n.done
150
+ };
355
151
  }
356
- return ContinueSentinel;
357
- }
358
- var record = tryCatch(method, delegate.iterator, context.arg);
359
- if (record.type === "throw") {
360
- context.method = "throw";
361
- context.arg = record.arg;
362
- context.delegate = null;
363
- return ContinueSentinel;
152
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
364
153
  }
365
- var info = record.arg;
366
- if (!info) {
367
- context.method = "throw";
368
- context.arg = new TypeError("iterator result is not an object");
369
- context.delegate = null;
370
- return ContinueSentinel;
371
- }
372
- if (info.done) {
373
- // Assign the result of the finished delegate to the temporary
374
- // variable specified by delegate.resultName (see delegateYield).
375
- context[delegate.resultName] = info.value;
376
-
377
- // Resume execution at the desired location (see delegateYield).
378
- context.next = delegate.nextLoc;
379
-
380
- // If context.method was "throw" but the delegate handled the
381
- // exception, let the outer generator proceed normally. If
382
- // context.method was "next", forget context.arg since it has been
383
- // "consumed" by the delegate iterator. If context.method was
384
- // "return", allow the original .return call to continue in the
385
- // outer generator.
386
- if (context.method !== "return") {
387
- context.method = "next";
388
- context.arg = undefined$1;
389
- }
390
- } else {
391
- // Re-yield the result returned by the delegate method.
392
- return info;
154
+ };
155
+ }
156
+ function maybeInvokeDelegate(e, r) {
157
+ var n = r.method,
158
+ o = e.iterator[n];
159
+ 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;
160
+ var i = tryCatch(o, e.iterator, r.arg);
161
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
162
+ var a = i.arg;
163
+ 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);
164
+ }
165
+ function pushTryEntry(t) {
166
+ var e = {
167
+ tryLoc: t[0]
168
+ };
169
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
170
+ }
171
+ function resetTryEntry(t) {
172
+ var e = t.completion || {};
173
+ e.type = "normal", delete e.arg, t.completion = e;
174
+ }
175
+ function Context(t) {
176
+ this.tryEntries = [{
177
+ tryLoc: "root"
178
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
179
+ }
180
+ function values(e) {
181
+ if (e || "" === e) {
182
+ var r = e[a];
183
+ if (r) return r.call(e);
184
+ if ("function" == typeof e.next) return e;
185
+ if (!isNaN(e.length)) {
186
+ var o = -1,
187
+ i = function next() {
188
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
189
+ return next.value = t, next.done = !0, next;
190
+ };
191
+ return i.next = i;
393
192
  }
394
-
395
- // The delegate iterator is finished, so forget it and continue with
396
- // the outer generator.
397
- context.delegate = null;
398
- return ContinueSentinel;
399
193
  }
400
-
401
- // Define Generator.prototype.{next,throw,return} in terms of the
402
- // unified ._invoke helper method.
403
- defineIteratorMethods(Gp);
404
- define(Gp, toStringTagSymbol, "Generator");
405
-
406
- // A Generator should always return itself as the iterator object when the
407
- // @@iterator function is called on it. Some browsers' implementations of the
408
- // iterator prototype chain incorrectly implement this, causing the Generator
409
- // object to not be returned from this call. This ensures that doesn't happen.
410
- // See https://github.com/facebook/regenerator/issues/274 for more details.
411
- define(Gp, iteratorSymbol, function () {
412
- return this;
413
- });
414
- define(Gp, "toString", function () {
415
- return "[object Generator]";
194
+ throw new TypeError(typeof e + " is not iterable");
195
+ }
196
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
197
+ value: GeneratorFunctionPrototype,
198
+ configurable: !0
199
+ }), o(GeneratorFunctionPrototype, "constructor", {
200
+ value: GeneratorFunction,
201
+ configurable: !0
202
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
203
+ var e = "function" == typeof t && t.constructor;
204
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
205
+ }, e.mark = function (t) {
206
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
207
+ }, e.awrap = function (t) {
208
+ return {
209
+ __await: t
210
+ };
211
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
212
+ return this;
213
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
214
+ void 0 === i && (i = Promise);
215
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
216
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
217
+ return t.done ? t.value : a.next();
416
218
  });
417
- function pushTryEntry(locs) {
418
- var entry = {
419
- tryLoc: locs[0]
420
- };
421
- if (1 in locs) {
422
- entry.catchLoc = locs[1];
423
- }
424
- if (2 in locs) {
425
- entry.finallyLoc = locs[2];
426
- entry.afterLoc = locs[3];
219
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
220
+ return this;
221
+ }), define(g, "toString", function () {
222
+ return "[object Generator]";
223
+ }), e.keys = function (t) {
224
+ var e = Object(t),
225
+ r = [];
226
+ for (var n in e) r.push(n);
227
+ return r.reverse(), function next() {
228
+ for (; r.length;) {
229
+ var t = r.pop();
230
+ if (t in e) return next.value = t, next.done = !1, next;
427
231
  }
428
- this.tryEntries.push(entry);
429
- }
430
- function resetTryEntry(entry) {
431
- var record = entry.completion || {};
432
- record.type = "normal";
433
- delete record.arg;
434
- entry.completion = record;
435
- }
436
- function Context(tryLocsList) {
437
- // The root entry object (effectively a try statement without a catch
438
- // or a finally block) gives us a place to store values thrown from
439
- // locations where there is no enclosing try statement.
440
- this.tryEntries = [{
441
- tryLoc: "root"
442
- }];
443
- tryLocsList.forEach(pushTryEntry, this);
444
- this.reset(true);
445
- }
446
- exports.keys = function (object) {
447
- var keys = [];
448
- for (var key in object) {
449
- keys.push(key);
450
- }
451
- keys.reverse();
452
-
453
- // Rather than returning an object with a next method, we keep
454
- // things simple and return the next function itself.
455
- return function next() {
456
- while (keys.length) {
457
- var key = keys.pop();
458
- if (key in object) {
459
- next.value = key;
460
- next.done = false;
461
- return next;
462
- }
463
- }
464
-
465
- // To avoid creating an additional object, we just hang the .value
466
- // and .done properties off the next function object itself. This
467
- // also ensures that the minifier will not anonymize the function.
468
- next.done = true;
469
- return next;
470
- };
232
+ return next.done = !0, next;
471
233
  };
472
- function values(iterable) {
473
- if (iterable) {
474
- var iteratorMethod = iterable[iteratorSymbol];
475
- if (iteratorMethod) {
476
- return iteratorMethod.call(iterable);
477
- }
478
- if (typeof iterable.next === "function") {
479
- return iterable;
480
- }
481
- if (!isNaN(iterable.length)) {
482
- var i = -1,
483
- next = function next() {
484
- while (++i < iterable.length) {
485
- if (hasOwn.call(iterable, i)) {
486
- next.value = iterable[i];
487
- next.done = false;
488
- return next;
489
- }
490
- }
491
- next.value = undefined$1;
492
- next.done = true;
493
- return next;
494
- };
495
- return next.next = next;
496
- }
234
+ }, e.values = values, Context.prototype = {
235
+ constructor: Context,
236
+ reset: function (e) {
237
+ 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);
238
+ },
239
+ stop: function () {
240
+ this.done = !0;
241
+ var t = this.tryEntries[0].completion;
242
+ if ("throw" === t.type) throw t.arg;
243
+ return this.rval;
244
+ },
245
+ dispatchException: function (e) {
246
+ if (this.done) throw e;
247
+ var r = this;
248
+ function handle(n, o) {
249
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
497
250
  }
498
-
499
- // Return an iterator with no values.
500
- return {
501
- next: doneResult
502
- };
503
- }
504
- exports.values = values;
505
- function doneResult() {
506
- return {
507
- value: undefined$1,
508
- done: true
509
- };
510
- }
511
- Context.prototype = {
512
- constructor: Context,
513
- reset: function reset(skipTempReset) {
514
- this.prev = 0;
515
- this.next = 0;
516
- // Resetting context._sent for legacy support of Babel's
517
- // function.sent implementation.
518
- this.sent = this._sent = undefined$1;
519
- this.done = false;
520
- this.delegate = null;
521
- this.method = "next";
522
- this.arg = undefined$1;
523
- this.tryEntries.forEach(resetTryEntry);
524
- if (!skipTempReset) {
525
- for (var name in this) {
526
- // Not sure about the optimal order of these conditions:
527
- if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
528
- this[name] = undefined$1;
529
- }
530
- }
531
- }
532
- },
533
- stop: function stop() {
534
- this.done = true;
535
- var rootEntry = this.tryEntries[0];
536
- var rootRecord = rootEntry.completion;
537
- if (rootRecord.type === "throw") {
538
- throw rootRecord.arg;
539
- }
540
- return this.rval;
541
- },
542
- dispatchException: function dispatchException(exception) {
543
- if (this.done) {
544
- throw exception;
545
- }
546
- var context = this;
547
- function handle(loc, caught) {
548
- record.type = "throw";
549
- record.arg = exception;
550
- context.next = loc;
551
- if (caught) {
552
- // If the dispatched exception was caught by a catch block,
553
- // then let that catch block handle the exception normally.
554
- context.method = "next";
555
- context.arg = undefined$1;
556
- }
557
- return !!caught;
558
- }
559
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
560
- var entry = this.tryEntries[i];
561
- var record = entry.completion;
562
- if (entry.tryLoc === "root") {
563
- // Exception thrown outside of any try block that could handle
564
- // it, so set the completion value of the entire function to
565
- // throw the exception.
566
- return handle("end");
567
- }
568
- if (entry.tryLoc <= this.prev) {
569
- var hasCatch = hasOwn.call(entry, "catchLoc");
570
- var hasFinally = hasOwn.call(entry, "finallyLoc");
571
- if (hasCatch && hasFinally) {
572
- if (this.prev < entry.catchLoc) {
573
- return handle(entry.catchLoc, true);
574
- } else if (this.prev < entry.finallyLoc) {
575
- return handle(entry.finallyLoc);
576
- }
577
- } else if (hasCatch) {
578
- if (this.prev < entry.catchLoc) {
579
- return handle(entry.catchLoc, true);
580
- }
581
- } else if (hasFinally) {
582
- if (this.prev < entry.finallyLoc) {
583
- return handle(entry.finallyLoc);
584
- }
585
- } else {
586
- throw new Error("try statement without catch or finally");
587
- }
251
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
252
+ var i = this.tryEntries[o],
253
+ a = i.completion;
254
+ if ("root" === i.tryLoc) return handle("end");
255
+ if (i.tryLoc <= this.prev) {
256
+ var c = n.call(i, "catchLoc"),
257
+ u = n.call(i, "finallyLoc");
258
+ if (c && u) {
259
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
260
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
261
+ } else if (c) {
262
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
263
+ } else {
264
+ if (!u) throw new Error("try statement without catch or finally");
265
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
588
266
  }
589
267
  }
590
- },
591
- abrupt: function abrupt(type, arg) {
592
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
593
- var entry = this.tryEntries[i];
594
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
595
- var finallyEntry = entry;
596
- break;
597
- }
598
- }
599
- if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
600
- // Ignore the finally entry if control is not jumping to a
601
- // location outside the try/catch block.
602
- finallyEntry = null;
603
- }
604
- var record = finallyEntry ? finallyEntry.completion : {};
605
- record.type = type;
606
- record.arg = arg;
607
- if (finallyEntry) {
608
- this.method = "next";
609
- this.next = finallyEntry.finallyLoc;
610
- return ContinueSentinel;
611
- }
612
- return this.complete(record);
613
- },
614
- complete: function complete(record, afterLoc) {
615
- if (record.type === "throw") {
616
- throw record.arg;
617
- }
618
- if (record.type === "break" || record.type === "continue") {
619
- this.next = record.arg;
620
- } else if (record.type === "return") {
621
- this.rval = this.arg = record.arg;
622
- this.method = "return";
623
- this.next = "end";
624
- } else if (record.type === "normal" && afterLoc) {
625
- this.next = afterLoc;
626
- }
627
- return ContinueSentinel;
628
- },
629
- finish: function finish(finallyLoc) {
630
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
631
- var entry = this.tryEntries[i];
632
- if (entry.finallyLoc === finallyLoc) {
633
- this.complete(entry.completion, entry.afterLoc);
634
- resetTryEntry(entry);
635
- return ContinueSentinel;
636
- }
268
+ }
269
+ },
270
+ abrupt: function (t, e) {
271
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
272
+ var o = this.tryEntries[r];
273
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
274
+ var i = o;
275
+ break;
637
276
  }
638
- },
639
- "catch": function _catch(tryLoc) {
640
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
641
- var entry = this.tryEntries[i];
642
- if (entry.tryLoc === tryLoc) {
643
- var record = entry.completion;
644
- if (record.type === "throw") {
645
- var thrown = record.arg;
646
- resetTryEntry(entry);
647
- }
648
- return thrown;
277
+ }
278
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
279
+ var a = i ? i.completion : {};
280
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
281
+ },
282
+ complete: function (t, e) {
283
+ if ("throw" === t.type) throw t.arg;
284
+ 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;
285
+ },
286
+ finish: function (t) {
287
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
288
+ var r = this.tryEntries[e];
289
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
290
+ }
291
+ },
292
+ catch: function (t) {
293
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
294
+ var r = this.tryEntries[e];
295
+ if (r.tryLoc === t) {
296
+ var n = r.completion;
297
+ if ("throw" === n.type) {
298
+ var o = n.arg;
299
+ resetTryEntry(r);
649
300
  }
301
+ return o;
650
302
  }
651
-
652
- // The context.catch method must only be called with a location
653
- // argument that corresponds to a known catch block.
654
- throw new Error("illegal catch attempt");
655
- },
656
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
657
- this.delegate = {
658
- iterator: values(iterable),
659
- resultName: resultName,
660
- nextLoc: nextLoc
661
- };
662
- if (this.method === "next") {
663
- // Deliberately forget the last sent value so that we don't
664
- // accidentally pass it on to the delegate.
665
- this.arg = undefined$1;
666
- }
667
- return ContinueSentinel;
668
303
  }
669
- };
670
-
671
- // Regardless of whether this script is executing as a CommonJS module
672
- // or not, return the runtime object so that we can declare the variable
673
- // regeneratorRuntime in the outer scope, which allows this module to be
674
- // injected easily by `bin/regenerator --include-runtime script.js`.
675
- return exports;
676
- }(
677
- // If this script is executing as a CommonJS module, use module.exports
678
- // as the regeneratorRuntime namespace. Otherwise create a new empty
679
- // object. Either way, the resulting object will be used to initialize
680
- // the regeneratorRuntime variable at the top of this file.
681
- module.exports );
682
- try {
683
- regeneratorRuntime = runtime;
684
- } catch (accidentalStrictMode) {
685
- // This module should not be running in strict mode, so the above
686
- // assignment should always work unless something is misconfigured. Just
687
- // in case runtime.js accidentally runs in strict mode, in modern engines
688
- // we can explicitly access globalThis. In older engines we can escape
689
- // strict mode using a global Function call. This could conceivably fail
690
- // if a Content Security Policy forbids using Function, but in that case
691
- // the proper solution is to fix the accidental strict mode problem. If
692
- // you've misconfigured your bundler to force strict mode and applied a
693
- // CSP to forbid Function, and you're not willing to fix either of those
694
- // problems, please detail your unique predicament in a GitHub issue.
695
- if (typeof globalThis === "object") {
696
- globalThis.regeneratorRuntime = runtime;
697
- } else {
698
- Function("r", "regeneratorRuntime = r")(runtime);
304
+ throw new Error("illegal catch attempt");
305
+ },
306
+ delegateYield: function (e, r, n) {
307
+ return this.delegate = {
308
+ iterator: values(e),
309
+ resultName: r,
310
+ nextLoc: n
311
+ }, "next" === this.method && (this.arg = t), y;
699
312
  }
313
+ }, e;
314
+ }
315
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
316
+ try {
317
+ var info = gen[key](arg);
318
+ var value = info.value;
319
+ } catch (error) {
320
+ reject(error);
321
+ return;
700
322
  }
701
- });
323
+ if (info.done) {
324
+ resolve(value);
325
+ } else {
326
+ Promise.resolve(value).then(_next, _throw);
327
+ }
328
+ }
329
+ function _asyncToGenerator(fn) {
330
+ return function () {
331
+ var self = this,
332
+ args = arguments;
333
+ return new Promise(function (resolve, reject) {
334
+ var gen = fn.apply(self, args);
335
+ function _next(value) {
336
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
337
+ }
338
+ function _throw(err) {
339
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
340
+ }
341
+ _next(undefined);
342
+ });
343
+ };
344
+ }
702
345
 
703
346
  function ensure(x) {
704
347
  if (x === null || x === undefined) {
@@ -756,7 +399,7 @@ var YotpoReviewsMeta = {
756
399
  type: "choice",
757
400
  options: function options(props, ctx) {
758
401
  var _ctx$reviews$map, _ctx$reviews;
759
- return (_ctx$reviews$map = ctx == null ? void 0 : (_ctx$reviews = ctx.reviews) == null ? void 0 : _ctx$reviews.map(function (item) {
402
+ return (_ctx$reviews$map = ctx == null || (_ctx$reviews = ctx.reviews) == null ? void 0 : _ctx$reviews.map(function (item) {
760
403
  return {
761
404
  label: item == null ? void 0 : item.name,
762
405
  value: item == null ? void 0 : item.id
@@ -799,60 +442,56 @@ function YotpoReviews(_ref2) {
799
442
  document.body.removeChild(script);
800
443
  };
801
444
  }, [creds]);
802
- var _usePlasmicQueryData = query.usePlasmicQueryData(cacheKey + "/reviews", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
445
+ var _usePlasmicQueryData = query.usePlasmicQueryData(cacheKey + "/reviews", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
803
446
  var options, res;
804
- return runtime_1.wrap(function _callee$(_context) {
805
- while (1) {
806
- switch (_context.prev = _context.next) {
807
- case 0:
808
- options = {
809
- method: "GET",
810
- headers: {
811
- accept: "application/json",
812
- "Content-Type": "application/json"
813
- }
814
- };
815
- _context.next = 3;
816
- return fetch("https://api.yotpo.com/v1/apps/" + creds.appKey + "/reviews?utoken=" + creds.uToken, options);
817
- case 3:
818
- res = _context.sent;
819
- return _context.abrupt("return", res.json());
820
- case 5:
821
- case "end":
822
- return _context.stop();
823
- }
447
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
448
+ while (1) switch (_context.prev = _context.next) {
449
+ case 0:
450
+ options = {
451
+ method: "GET",
452
+ headers: {
453
+ accept: "application/json",
454
+ "Content-Type": "application/json"
455
+ }
456
+ };
457
+ _context.next = 3;
458
+ return fetch("https://api.yotpo.com/v1/apps/" + creds.appKey + "/reviews?utoken=" + creds.uToken, options);
459
+ case 3:
460
+ res = _context.sent;
461
+ return _context.abrupt("return", res.json());
462
+ case 5:
463
+ case "end":
464
+ return _context.stop();
824
465
  }
825
466
  }, _callee);
826
467
  }))),
827
468
  reviewsData = _usePlasmicQueryData.data;
828
- var _usePlasmicQueryData2 = query.usePlasmicQueryData(cacheKey + "/review", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
469
+ var _usePlasmicQueryData2 = query.usePlasmicQueryData(cacheKey + "/review", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
829
470
  var options, res;
830
- return runtime_1.wrap(function _callee2$(_context2) {
831
- while (1) {
832
- switch (_context2.prev = _context2.next) {
833
- case 0:
834
- if (reviewId) {
835
- _context2.next = 2;
836
- break;
471
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
472
+ while (1) switch (_context2.prev = _context2.next) {
473
+ case 0:
474
+ if (reviewId) {
475
+ _context2.next = 2;
476
+ break;
477
+ }
478
+ return _context2.abrupt("return", undefined);
479
+ case 2:
480
+ options = {
481
+ method: "GET",
482
+ headers: {
483
+ accept: "application/json",
484
+ "Content-Type": "application/json"
837
485
  }
838
- return _context2.abrupt("return", undefined);
839
- case 2:
840
- options = {
841
- method: "GET",
842
- headers: {
843
- accept: "application/json",
844
- "Content-Type": "application/json"
845
- }
846
- };
847
- _context2.next = 5;
848
- return fetch("https://api.yotpo.com/reviews/" + reviewId + "?utoken=" + creds.uToken, options);
849
- case 5:
850
- res = _context2.sent;
851
- return _context2.abrupt("return", res.json());
852
- case 7:
853
- case "end":
854
- return _context2.stop();
855
- }
486
+ };
487
+ _context2.next = 5;
488
+ return fetch("https://api.yotpo.com/reviews/" + reviewId + "?utoken=" + creds.uToken, options);
489
+ case 5:
490
+ res = _context2.sent;
491
+ return _context2.abrupt("return", res.json());
492
+ case 7:
493
+ case "end":
494
+ return _context2.stop();
856
495
  }
857
496
  }, _callee2);
858
497
  }))),
@@ -863,7 +502,7 @@ function YotpoReviews(_ref2) {
863
502
  var data = Object.values(reviewsData).map(function (item) {
864
503
  return item;
865
504
  });
866
- setControlContextData == null ? void 0 : setControlContextData({
505
+ setControlContextData == null || setControlContextData({
867
506
  reviews: data[0] || []
868
507
  });
869
508
  if (!creds.uToken || !creds.appKey) {
@@ -912,7 +551,7 @@ var YotpoStarRatingMeta = {
912
551
  type: "choice",
913
552
  options: function options(props, ctx) {
914
553
  var _ctx$reviews$map2, _ctx$reviews2;
915
- return (_ctx$reviews$map2 = ctx == null ? void 0 : (_ctx$reviews2 = ctx.reviews) == null ? void 0 : _ctx$reviews2.map(function (item) {
554
+ return (_ctx$reviews$map2 = ctx == null || (_ctx$reviews2 = ctx.reviews) == null ? void 0 : _ctx$reviews2.map(function (item) {
916
555
  return {
917
556
  label: item == null ? void 0 : item.name,
918
557
  value: item == null ? void 0 : item.id
@@ -943,60 +582,56 @@ function YotpoStarRating(_ref5) {
943
582
  document.body.removeChild(script);
944
583
  };
945
584
  }, [creds]);
946
- var _usePlasmicQueryData3 = query.usePlasmicQueryData(cacheKey + "/starReviews", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
585
+ var _usePlasmicQueryData3 = query.usePlasmicQueryData(cacheKey + "/starReviews", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
947
586
  var options, res;
948
- return runtime_1.wrap(function _callee3$(_context3) {
949
- while (1) {
950
- switch (_context3.prev = _context3.next) {
951
- case 0:
952
- options = {
953
- method: "GET",
954
- headers: {
955
- accept: "application/json",
956
- "Content-Type": "application/json"
957
- }
958
- };
959
- _context3.next = 3;
960
- return fetch("https://api.yotpo.com/v1/apps/" + creds.appKey + "/reviews?utoken=" + creds.uToken, options);
961
- case 3:
962
- res = _context3.sent;
963
- return _context3.abrupt("return", res.json());
964
- case 5:
965
- case "end":
966
- return _context3.stop();
967
- }
587
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
588
+ while (1) switch (_context3.prev = _context3.next) {
589
+ case 0:
590
+ options = {
591
+ method: "GET",
592
+ headers: {
593
+ accept: "application/json",
594
+ "Content-Type": "application/json"
595
+ }
596
+ };
597
+ _context3.next = 3;
598
+ return fetch("https://api.yotpo.com/v1/apps/" + creds.appKey + "/reviews?utoken=" + creds.uToken, options);
599
+ case 3:
600
+ res = _context3.sent;
601
+ return _context3.abrupt("return", res.json());
602
+ case 5:
603
+ case "end":
604
+ return _context3.stop();
968
605
  }
969
606
  }, _callee3);
970
607
  }))),
971
608
  reviews = _usePlasmicQueryData3.data;
972
- var _usePlasmicQueryData4 = query.usePlasmicQueryData(cacheKey + "/starReview", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
609
+ var _usePlasmicQueryData4 = query.usePlasmicQueryData(cacheKey + "/starReview", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
973
610
  var options, res;
974
- return runtime_1.wrap(function _callee4$(_context4) {
975
- while (1) {
976
- switch (_context4.prev = _context4.next) {
977
- case 0:
978
- if (productId) {
979
- _context4.next = 2;
980
- break;
611
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
612
+ while (1) switch (_context4.prev = _context4.next) {
613
+ case 0:
614
+ if (productId) {
615
+ _context4.next = 2;
616
+ break;
617
+ }
618
+ return _context4.abrupt("return", undefined);
619
+ case 2:
620
+ options = {
621
+ method: "GET",
622
+ headers: {
623
+ accept: "application/json",
624
+ "Content-Type": "application/json"
981
625
  }
982
- return _context4.abrupt("return", undefined);
983
- case 2:
984
- options = {
985
- method: "GET",
986
- headers: {
987
- accept: "application/json",
988
- "Content-Type": "application/json"
989
- }
990
- };
991
- _context4.next = 5;
992
- return fetch("https://api.yotpo.com/reviews/" + productId + "?utoken=" + creds.uToken, options);
993
- case 5:
994
- res = _context4.sent;
995
- return _context4.abrupt("return", res.json());
996
- case 7:
997
- case "end":
998
- return _context4.stop();
999
- }
626
+ };
627
+ _context4.next = 5;
628
+ return fetch("https://api.yotpo.com/reviews/" + productId + "?utoken=" + creds.uToken, options);
629
+ case 5:
630
+ res = _context4.sent;
631
+ return _context4.abrupt("return", res.json());
632
+ case 7:
633
+ case "end":
634
+ return _context4.stop();
1000
635
  }
1001
636
  }, _callee4);
1002
637
  }))),
@@ -1010,7 +645,7 @@ function YotpoStarRating(_ref5) {
1010
645
  var data = Object.values(reviews).map(function (item) {
1011
646
  return item;
1012
647
  });
1013
- setControlContextData == null ? void 0 : setControlContextData({
648
+ setControlContextData == null || setControlContextData({
1014
649
  reviews: data[0] || []
1015
650
  });
1016
651
  if (!review) {