@plasmicpkgs/plasmic-yotpo 0.0.88 → 0.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plasmic-yotpo.cjs.development.js +130 -335
- package/dist/plasmic-yotpo.cjs.development.js.map +1 -1
- package/dist/plasmic-yotpo.cjs.production.min.js +1 -1
- package/dist/plasmic-yotpo.cjs.production.min.js.map +1 -1
- package/dist/plasmic-yotpo.esm.js +130 -335
- package/dist/plasmic-yotpo.esm.js.map +1 -1
- package/package.json +3 -3
|
@@ -29,306 +29,113 @@ function _asyncToGenerator(n) {
|
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return o(a, "_invoke", {
|
|
67
|
-
value: makeInvokeMethod(t, r, c)
|
|
68
|
-
}), a;
|
|
69
|
-
}
|
|
70
|
-
function tryCatch(t, e, r) {
|
|
71
|
-
try {
|
|
72
|
-
return {
|
|
73
|
-
type: "normal",
|
|
74
|
-
arg: t.call(e, r)
|
|
75
|
-
};
|
|
76
|
-
} catch (t) {
|
|
77
|
-
return {
|
|
78
|
-
type: "throw",
|
|
79
|
-
arg: t
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
e.wrap = wrap;
|
|
84
|
-
var h = "suspendedStart",
|
|
85
|
-
l = "suspendedYield",
|
|
86
|
-
f = "executing",
|
|
87
|
-
s = "completed",
|
|
88
|
-
y = {};
|
|
89
|
-
function Generator() {}
|
|
90
|
-
function GeneratorFunction() {}
|
|
91
|
-
function GeneratorFunctionPrototype() {}
|
|
92
|
-
var p = {};
|
|
93
|
-
define(p, a, function () {
|
|
94
|
-
return this;
|
|
95
|
-
});
|
|
96
|
-
var d = Object.getPrototypeOf,
|
|
97
|
-
v = d && d(d(values([])));
|
|
98
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
99
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
100
|
-
function defineIteratorMethods(t) {
|
|
101
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
102
|
-
define(t, e, function (t) {
|
|
103
|
-
return this._invoke(e, t);
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
function AsyncIterator(t, e) {
|
|
108
|
-
function invoke(r, o, i, a) {
|
|
109
|
-
var c = tryCatch(t[r], t, o);
|
|
110
|
-
if ("throw" !== c.type) {
|
|
111
|
-
var u = c.arg,
|
|
112
|
-
h = u.value;
|
|
113
|
-
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
114
|
-
invoke("next", t, i, a);
|
|
115
|
-
}, function (t) {
|
|
116
|
-
invoke("throw", t, i, a);
|
|
117
|
-
}) : e.resolve(h).then(function (t) {
|
|
118
|
-
u.value = t, i(u);
|
|
119
|
-
}, function (t) {
|
|
120
|
-
return invoke("throw", t, i, a);
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
a(c.arg);
|
|
124
|
-
}
|
|
125
|
-
var r;
|
|
126
|
-
o(this, "_invoke", {
|
|
127
|
-
value: function (t, n) {
|
|
128
|
-
function callInvokeWithMethodAndArg() {
|
|
129
|
-
return new e(function (e, r) {
|
|
130
|
-
invoke(t, n, e, r);
|
|
131
|
-
});
|
|
32
|
+
function _regenerator() {
|
|
33
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
34
|
+
var e,
|
|
35
|
+
t,
|
|
36
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
37
|
+
n = r.iterator || "@@iterator",
|
|
38
|
+
o = r.toStringTag || "@@toStringTag";
|
|
39
|
+
function i(r, n, o, i) {
|
|
40
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
41
|
+
u = Object.create(c.prototype);
|
|
42
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
43
|
+
var i,
|
|
44
|
+
c,
|
|
45
|
+
u,
|
|
46
|
+
f = 0,
|
|
47
|
+
p = o || [],
|
|
48
|
+
y = !1,
|
|
49
|
+
G = {
|
|
50
|
+
p: 0,
|
|
51
|
+
n: 0,
|
|
52
|
+
v: e,
|
|
53
|
+
a: d,
|
|
54
|
+
f: d.bind(e, 4),
|
|
55
|
+
d: function (t, r) {
|
|
56
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
function d(r, n) {
|
|
60
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
61
|
+
var o,
|
|
62
|
+
i = p[t],
|
|
63
|
+
d = G.p,
|
|
64
|
+
l = i[2];
|
|
65
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
132
66
|
}
|
|
133
|
-
|
|
67
|
+
if (o || r > 1) return a;
|
|
68
|
+
throw y = !0, n;
|
|
134
69
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
70
|
+
return function (o, p, l) {
|
|
71
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
72
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
73
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
74
|
+
try {
|
|
75
|
+
if (f = 2, i) {
|
|
76
|
+
if (c || (o = "next"), t = i[o]) {
|
|
77
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
78
|
+
if (!t.done) return t;
|
|
79
|
+
u = t.value, c < 2 && (c = 0);
|
|
80
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
81
|
+
i = e;
|
|
82
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
83
|
+
} catch (t) {
|
|
84
|
+
i = e, c = 1, u = t;
|
|
85
|
+
} finally {
|
|
86
|
+
f = 1;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
143
89
|
return {
|
|
144
90
|
value: t,
|
|
145
|
-
done:
|
|
91
|
+
done: y
|
|
146
92
|
};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
var c = n.delegate;
|
|
150
|
-
if (c) {
|
|
151
|
-
var u = maybeInvokeDelegate(c, n);
|
|
152
|
-
if (u) {
|
|
153
|
-
if (u === y) continue;
|
|
154
|
-
return u;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
158
|
-
if (o === h) throw o = s, n.arg;
|
|
159
|
-
n.dispatchException(n.arg);
|
|
160
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
161
|
-
o = f;
|
|
162
|
-
var p = tryCatch(e, r, n);
|
|
163
|
-
if ("normal" === p.type) {
|
|
164
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
165
|
-
return {
|
|
166
|
-
value: p.arg,
|
|
167
|
-
done: n.done
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
function maybeInvokeDelegate(e, r) {
|
|
175
|
-
var n = r.method,
|
|
176
|
-
o = e.iterator[n];
|
|
177
|
-
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;
|
|
178
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
179
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
180
|
-
var a = i.arg;
|
|
181
|
-
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);
|
|
182
|
-
}
|
|
183
|
-
function pushTryEntry(t) {
|
|
184
|
-
var e = {
|
|
185
|
-
tryLoc: t[0]
|
|
186
|
-
};
|
|
187
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
188
|
-
}
|
|
189
|
-
function resetTryEntry(t) {
|
|
190
|
-
var e = t.completion || {};
|
|
191
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
192
|
-
}
|
|
193
|
-
function Context(t) {
|
|
194
|
-
this.tryEntries = [{
|
|
195
|
-
tryLoc: "root"
|
|
196
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
93
|
+
};
|
|
94
|
+
}(r, o, i), !0), u;
|
|
197
95
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
return i.next = i;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
96
|
+
var a = {};
|
|
97
|
+
function Generator() {}
|
|
98
|
+
function GeneratorFunction() {}
|
|
99
|
+
function GeneratorFunctionPrototype() {}
|
|
100
|
+
t = Object.getPrototypeOf;
|
|
101
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
102
|
+
return this;
|
|
103
|
+
}), t),
|
|
104
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
105
|
+
function f(e) {
|
|
106
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
213
107
|
}
|
|
214
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
215
|
-
value: GeneratorFunctionPrototype,
|
|
216
|
-
configurable: !0
|
|
217
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
218
|
-
value: GeneratorFunction,
|
|
219
|
-
configurable: !0
|
|
220
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
221
|
-
var e = "function" == typeof t && t.constructor;
|
|
222
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
223
|
-
}, e.mark = function (t) {
|
|
224
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
225
|
-
}, e.awrap = function (t) {
|
|
226
|
-
return {
|
|
227
|
-
__await: t
|
|
228
|
-
};
|
|
229
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
108
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
230
109
|
return this;
|
|
231
|
-
}),
|
|
232
|
-
void 0 === i && (i = Promise);
|
|
233
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
234
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
235
|
-
return t.done ? t.value : a.next();
|
|
236
|
-
});
|
|
237
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
238
|
-
return this;
|
|
239
|
-
}), define(g, "toString", function () {
|
|
110
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
240
111
|
return "[object Generator]";
|
|
241
|
-
}),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
return r.reverse(), function next() {
|
|
246
|
-
for (; r.length;) {
|
|
247
|
-
var t = r.pop();
|
|
248
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
249
|
-
}
|
|
250
|
-
return next.done = !0, next;
|
|
112
|
+
}), (_regenerator = function () {
|
|
113
|
+
return {
|
|
114
|
+
w: i,
|
|
115
|
+
m: f
|
|
251
116
|
};
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
function handle(n, o) {
|
|
267
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
268
|
-
}
|
|
269
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
270
|
-
var i = this.tryEntries[o],
|
|
271
|
-
a = i.completion;
|
|
272
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
273
|
-
if (i.tryLoc <= this.prev) {
|
|
274
|
-
var c = n.call(i, "catchLoc"),
|
|
275
|
-
u = n.call(i, "finallyLoc");
|
|
276
|
-
if (c && u) {
|
|
277
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
278
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
279
|
-
} else if (c) {
|
|
280
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
281
|
-
} else {
|
|
282
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
283
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
abrupt: function (t, e) {
|
|
289
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
290
|
-
var o = this.tryEntries[r];
|
|
291
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
292
|
-
var i = o;
|
|
293
|
-
break;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
297
|
-
var a = i ? i.completion : {};
|
|
298
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
299
|
-
},
|
|
300
|
-
complete: function (t, e) {
|
|
301
|
-
if ("throw" === t.type) throw t.arg;
|
|
302
|
-
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;
|
|
303
|
-
},
|
|
304
|
-
finish: function (t) {
|
|
305
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
306
|
-
var r = this.tryEntries[e];
|
|
307
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
308
|
-
}
|
|
309
|
-
},
|
|
310
|
-
catch: function (t) {
|
|
311
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
312
|
-
var r = this.tryEntries[e];
|
|
313
|
-
if (r.tryLoc === t) {
|
|
314
|
-
var n = r.completion;
|
|
315
|
-
if ("throw" === n.type) {
|
|
316
|
-
var o = n.arg;
|
|
317
|
-
resetTryEntry(r);
|
|
318
|
-
}
|
|
319
|
-
return o;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
throw Error("illegal catch attempt");
|
|
323
|
-
},
|
|
324
|
-
delegateYield: function (e, r, n) {
|
|
325
|
-
return this.delegate = {
|
|
326
|
-
iterator: values(e),
|
|
327
|
-
resultName: r,
|
|
328
|
-
nextLoc: n
|
|
329
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
117
|
+
})();
|
|
118
|
+
}
|
|
119
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
120
|
+
var i = Object.defineProperty;
|
|
121
|
+
try {
|
|
122
|
+
i({}, "", {});
|
|
123
|
+
} catch (e) {
|
|
124
|
+
i = 0;
|
|
125
|
+
}
|
|
126
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
127
|
+
function o(r, n) {
|
|
128
|
+
_regeneratorDefine(e, r, function (e) {
|
|
129
|
+
return this._invoke(r, n, e);
|
|
130
|
+
});
|
|
330
131
|
}
|
|
331
|
-
|
|
132
|
+
r ? i ? i(e, r, {
|
|
133
|
+
value: n,
|
|
134
|
+
enumerable: !t,
|
|
135
|
+
configurable: !t,
|
|
136
|
+
writable: !t
|
|
137
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
138
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
332
139
|
}
|
|
333
140
|
|
|
334
141
|
function ensure(x) {
|
|
@@ -430,10 +237,10 @@ function YotpoReviews(_ref2) {
|
|
|
430
237
|
document.body.removeChild(script);
|
|
431
238
|
};
|
|
432
239
|
}, [creds]);
|
|
433
|
-
var _usePlasmicQueryData = usePlasmicQueryData(cacheKey + "/reviews", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
240
|
+
var _usePlasmicQueryData = usePlasmicQueryData(cacheKey + "/reviews", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
434
241
|
var options, res;
|
|
435
|
-
return
|
|
436
|
-
while (1) switch (_context.
|
|
242
|
+
return _regenerator().w(function (_context) {
|
|
243
|
+
while (1) switch (_context.n) {
|
|
437
244
|
case 0:
|
|
438
245
|
options = {
|
|
439
246
|
method: "GET",
|
|
@@ -442,29 +249,26 @@ function YotpoReviews(_ref2) {
|
|
|
442
249
|
"Content-Type": "application/json"
|
|
443
250
|
}
|
|
444
251
|
};
|
|
445
|
-
_context.
|
|
252
|
+
_context.n = 1;
|
|
446
253
|
return fetch("https://api.yotpo.com/v1/apps/" + creds.appKey + "/reviews?utoken=" + creds.uToken, options);
|
|
447
|
-
case
|
|
448
|
-
res = _context.
|
|
449
|
-
return _context.
|
|
450
|
-
case 5:
|
|
451
|
-
case "end":
|
|
452
|
-
return _context.stop();
|
|
254
|
+
case 1:
|
|
255
|
+
res = _context.v;
|
|
256
|
+
return _context.a(2, res.json());
|
|
453
257
|
}
|
|
454
258
|
}, _callee);
|
|
455
259
|
}))),
|
|
456
260
|
reviewsData = _usePlasmicQueryData.data;
|
|
457
|
-
var _usePlasmicQueryData2 = usePlasmicQueryData(cacheKey + "/review", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
261
|
+
var _usePlasmicQueryData2 = usePlasmicQueryData(cacheKey + "/review", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
458
262
|
var options, res;
|
|
459
|
-
return
|
|
460
|
-
while (1) switch (_context2.
|
|
263
|
+
return _regenerator().w(function (_context2) {
|
|
264
|
+
while (1) switch (_context2.n) {
|
|
461
265
|
case 0:
|
|
462
266
|
if (reviewId) {
|
|
463
|
-
_context2.
|
|
267
|
+
_context2.n = 1;
|
|
464
268
|
break;
|
|
465
269
|
}
|
|
466
|
-
return _context2.
|
|
467
|
-
case
|
|
270
|
+
return _context2.a(2, undefined);
|
|
271
|
+
case 1:
|
|
468
272
|
options = {
|
|
469
273
|
method: "GET",
|
|
470
274
|
headers: {
|
|
@@ -472,14 +276,11 @@ function YotpoReviews(_ref2) {
|
|
|
472
276
|
"Content-Type": "application/json"
|
|
473
277
|
}
|
|
474
278
|
};
|
|
475
|
-
_context2.
|
|
279
|
+
_context2.n = 2;
|
|
476
280
|
return fetch("https://api.yotpo.com/reviews/" + reviewId + "?utoken=" + creds.uToken, options);
|
|
477
|
-
case
|
|
478
|
-
res = _context2.
|
|
479
|
-
return _context2.
|
|
480
|
-
case 7:
|
|
481
|
-
case "end":
|
|
482
|
-
return _context2.stop();
|
|
281
|
+
case 2:
|
|
282
|
+
res = _context2.v;
|
|
283
|
+
return _context2.a(2, res.json());
|
|
483
284
|
}
|
|
484
285
|
}, _callee2);
|
|
485
286
|
}))),
|
|
@@ -570,10 +371,10 @@ function YotpoStarRating(_ref5) {
|
|
|
570
371
|
document.body.removeChild(script);
|
|
571
372
|
};
|
|
572
373
|
}, [creds]);
|
|
573
|
-
var _usePlasmicQueryData3 = usePlasmicQueryData(cacheKey + "/starReviews", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
374
|
+
var _usePlasmicQueryData3 = usePlasmicQueryData(cacheKey + "/starReviews", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
574
375
|
var options, res;
|
|
575
|
-
return
|
|
576
|
-
while (1) switch (_context3.
|
|
376
|
+
return _regenerator().w(function (_context3) {
|
|
377
|
+
while (1) switch (_context3.n) {
|
|
577
378
|
case 0:
|
|
578
379
|
options = {
|
|
579
380
|
method: "GET",
|
|
@@ -582,29 +383,26 @@ function YotpoStarRating(_ref5) {
|
|
|
582
383
|
"Content-Type": "application/json"
|
|
583
384
|
}
|
|
584
385
|
};
|
|
585
|
-
_context3.
|
|
386
|
+
_context3.n = 1;
|
|
586
387
|
return fetch("https://api.yotpo.com/v1/apps/" + creds.appKey + "/reviews?utoken=" + creds.uToken, options);
|
|
587
|
-
case
|
|
588
|
-
res = _context3.
|
|
589
|
-
return _context3.
|
|
590
|
-
case 5:
|
|
591
|
-
case "end":
|
|
592
|
-
return _context3.stop();
|
|
388
|
+
case 1:
|
|
389
|
+
res = _context3.v;
|
|
390
|
+
return _context3.a(2, res.json());
|
|
593
391
|
}
|
|
594
392
|
}, _callee3);
|
|
595
393
|
}))),
|
|
596
394
|
reviews = _usePlasmicQueryData3.data;
|
|
597
|
-
var _usePlasmicQueryData4 = usePlasmicQueryData(cacheKey + "/starReview", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
395
|
+
var _usePlasmicQueryData4 = usePlasmicQueryData(cacheKey + "/starReview", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
598
396
|
var options, res;
|
|
599
|
-
return
|
|
600
|
-
while (1) switch (_context4.
|
|
397
|
+
return _regenerator().w(function (_context4) {
|
|
398
|
+
while (1) switch (_context4.n) {
|
|
601
399
|
case 0:
|
|
602
400
|
if (productId) {
|
|
603
|
-
_context4.
|
|
401
|
+
_context4.n = 1;
|
|
604
402
|
break;
|
|
605
403
|
}
|
|
606
|
-
return _context4.
|
|
607
|
-
case
|
|
404
|
+
return _context4.a(2, undefined);
|
|
405
|
+
case 1:
|
|
608
406
|
options = {
|
|
609
407
|
method: "GET",
|
|
610
408
|
headers: {
|
|
@@ -612,14 +410,11 @@ function YotpoStarRating(_ref5) {
|
|
|
612
410
|
"Content-Type": "application/json"
|
|
613
411
|
}
|
|
614
412
|
};
|
|
615
|
-
_context4.
|
|
413
|
+
_context4.n = 2;
|
|
616
414
|
return fetch("https://api.yotpo.com/reviews/" + productId + "?utoken=" + creds.uToken, options);
|
|
617
|
-
case
|
|
618
|
-
res = _context4.
|
|
619
|
-
return _context4.
|
|
620
|
-
case 7:
|
|
621
|
-
case "end":
|
|
622
|
-
return _context4.stop();
|
|
415
|
+
case 2:
|
|
416
|
+
res = _context4.v;
|
|
417
|
+
return _context4.a(2, res.json());
|
|
623
418
|
}
|
|
624
419
|
}, _callee4);
|
|
625
420
|
}))),
|