@plasmicpkgs/plasmic-basic-components 0.0.175 → 0.0.176

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.
@@ -3,6 +3,307 @@ import registerComponent from '@plasmicapp/host/registerComponent';
3
3
  import React, { createElement, useRef, useEffect, useContext, useState, Suspense } from 'react';
4
4
  import { isPlasmicPrepass } from '@plasmicapp/query';
5
5
 
6
+ function _regeneratorRuntime() {
7
+ _regeneratorRuntime = function () {
8
+ return e;
9
+ };
10
+ var t,
11
+ e = {},
12
+ r = Object.prototype,
13
+ n = r.hasOwnProperty,
14
+ o = Object.defineProperty || function (t, e, r) {
15
+ t[e] = r.value;
16
+ },
17
+ i = "function" == typeof Symbol ? Symbol : {},
18
+ a = i.iterator || "@@iterator",
19
+ c = i.asyncIterator || "@@asyncIterator",
20
+ u = i.toStringTag || "@@toStringTag";
21
+ function define(t, e, r) {
22
+ return Object.defineProperty(t, e, {
23
+ value: r,
24
+ enumerable: !0,
25
+ configurable: !0,
26
+ writable: !0
27
+ }), t[e];
28
+ }
29
+ try {
30
+ define({}, "");
31
+ } catch (t) {
32
+ define = function (t, e, r) {
33
+ return t[e] = r;
34
+ };
35
+ }
36
+ function wrap(t, e, r, n) {
37
+ var i = e && e.prototype instanceof Generator ? e : Generator,
38
+ a = Object.create(i.prototype),
39
+ c = new Context(n || []);
40
+ return o(a, "_invoke", {
41
+ value: makeInvokeMethod(t, r, c)
42
+ }), a;
43
+ }
44
+ function tryCatch(t, e, r) {
45
+ try {
46
+ return {
47
+ type: "normal",
48
+ arg: t.call(e, r)
49
+ };
50
+ } catch (t) {
51
+ return {
52
+ type: "throw",
53
+ arg: t
54
+ };
55
+ }
56
+ }
57
+ e.wrap = wrap;
58
+ var h = "suspendedStart",
59
+ l = "suspendedYield",
60
+ f = "executing",
61
+ s = "completed",
62
+ y = {};
63
+ function Generator() {}
64
+ function GeneratorFunction() {}
65
+ function GeneratorFunctionPrototype() {}
66
+ var p = {};
67
+ define(p, a, function () {
68
+ return this;
69
+ });
70
+ var d = Object.getPrototypeOf,
71
+ v = d && d(d(values([])));
72
+ v && v !== r && n.call(v, a) && (p = v);
73
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
74
+ function defineIteratorMethods(t) {
75
+ ["next", "throw", "return"].forEach(function (e) {
76
+ define(t, e, function (t) {
77
+ return this._invoke(e, t);
78
+ });
79
+ });
80
+ }
81
+ function AsyncIterator(t, e) {
82
+ function invoke(r, o, i, a) {
83
+ var c = tryCatch(t[r], t, o);
84
+ if ("throw" !== c.type) {
85
+ var u = c.arg,
86
+ h = u.value;
87
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
88
+ invoke("next", t, i, a);
89
+ }, function (t) {
90
+ invoke("throw", t, i, a);
91
+ }) : e.resolve(h).then(function (t) {
92
+ u.value = t, i(u);
93
+ }, function (t) {
94
+ return invoke("throw", t, i, a);
95
+ });
96
+ }
97
+ a(c.arg);
98
+ }
99
+ var r;
100
+ o(this, "_invoke", {
101
+ value: function (t, n) {
102
+ function callInvokeWithMethodAndArg() {
103
+ return new e(function (e, r) {
104
+ invoke(t, n, e, r);
105
+ });
106
+ }
107
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
108
+ }
109
+ });
110
+ }
111
+ function makeInvokeMethod(e, r, n) {
112
+ var o = h;
113
+ return function (i, a) {
114
+ if (o === f) throw new Error("Generator is already running");
115
+ if (o === s) {
116
+ if ("throw" === i) throw a;
117
+ return {
118
+ value: t,
119
+ done: !0
120
+ };
121
+ }
122
+ for (n.method = i, n.arg = a;;) {
123
+ var c = n.delegate;
124
+ if (c) {
125
+ var u = maybeInvokeDelegate(c, n);
126
+ if (u) {
127
+ if (u === y) continue;
128
+ return u;
129
+ }
130
+ }
131
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
132
+ if (o === h) throw o = s, n.arg;
133
+ n.dispatchException(n.arg);
134
+ } else "return" === n.method && n.abrupt("return", n.arg);
135
+ o = f;
136
+ var p = tryCatch(e, r, n);
137
+ if ("normal" === p.type) {
138
+ if (o = n.done ? s : l, p.arg === y) continue;
139
+ return {
140
+ value: p.arg,
141
+ done: n.done
142
+ };
143
+ }
144
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
145
+ }
146
+ };
147
+ }
148
+ function maybeInvokeDelegate(e, r) {
149
+ var n = r.method,
150
+ o = e.iterator[n];
151
+ 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;
152
+ var i = tryCatch(o, e.iterator, r.arg);
153
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
154
+ var a = i.arg;
155
+ 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);
156
+ }
157
+ function pushTryEntry(t) {
158
+ var e = {
159
+ tryLoc: t[0]
160
+ };
161
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
162
+ }
163
+ function resetTryEntry(t) {
164
+ var e = t.completion || {};
165
+ e.type = "normal", delete e.arg, t.completion = e;
166
+ }
167
+ function Context(t) {
168
+ this.tryEntries = [{
169
+ tryLoc: "root"
170
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
171
+ }
172
+ function values(e) {
173
+ if (e || "" === e) {
174
+ var r = e[a];
175
+ if (r) return r.call(e);
176
+ if ("function" == typeof e.next) return e;
177
+ if (!isNaN(e.length)) {
178
+ var o = -1,
179
+ i = function next() {
180
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
181
+ return next.value = t, next.done = !0, next;
182
+ };
183
+ return i.next = i;
184
+ }
185
+ }
186
+ throw new TypeError(typeof e + " is not iterable");
187
+ }
188
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
189
+ value: GeneratorFunctionPrototype,
190
+ configurable: !0
191
+ }), o(GeneratorFunctionPrototype, "constructor", {
192
+ value: GeneratorFunction,
193
+ configurable: !0
194
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
195
+ var e = "function" == typeof t && t.constructor;
196
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
197
+ }, e.mark = function (t) {
198
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
199
+ }, e.awrap = function (t) {
200
+ return {
201
+ __await: t
202
+ };
203
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
204
+ return this;
205
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
206
+ void 0 === i && (i = Promise);
207
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
208
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
209
+ return t.done ? t.value : a.next();
210
+ });
211
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
212
+ return this;
213
+ }), define(g, "toString", function () {
214
+ return "[object Generator]";
215
+ }), e.keys = function (t) {
216
+ var e = Object(t),
217
+ r = [];
218
+ for (var n in e) r.push(n);
219
+ return r.reverse(), function next() {
220
+ for (; r.length;) {
221
+ var t = r.pop();
222
+ if (t in e) return next.value = t, next.done = !1, next;
223
+ }
224
+ return next.done = !0, next;
225
+ };
226
+ }, e.values = values, Context.prototype = {
227
+ constructor: Context,
228
+ reset: function (e) {
229
+ 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);
230
+ },
231
+ stop: function () {
232
+ this.done = !0;
233
+ var t = this.tryEntries[0].completion;
234
+ if ("throw" === t.type) throw t.arg;
235
+ return this.rval;
236
+ },
237
+ dispatchException: function (e) {
238
+ if (this.done) throw e;
239
+ var r = this;
240
+ function handle(n, o) {
241
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
242
+ }
243
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
244
+ var i = this.tryEntries[o],
245
+ a = i.completion;
246
+ if ("root" === i.tryLoc) return handle("end");
247
+ if (i.tryLoc <= this.prev) {
248
+ var c = n.call(i, "catchLoc"),
249
+ u = n.call(i, "finallyLoc");
250
+ if (c && u) {
251
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
252
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
253
+ } else if (c) {
254
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
255
+ } else {
256
+ if (!u) throw new Error("try statement without catch or finally");
257
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
258
+ }
259
+ }
260
+ }
261
+ },
262
+ abrupt: function (t, e) {
263
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
264
+ var o = this.tryEntries[r];
265
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
266
+ var i = o;
267
+ break;
268
+ }
269
+ }
270
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
271
+ var a = i ? i.completion : {};
272
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
273
+ },
274
+ complete: function (t, e) {
275
+ if ("throw" === t.type) throw t.arg;
276
+ 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;
277
+ },
278
+ finish: function (t) {
279
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
280
+ var r = this.tryEntries[e];
281
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
282
+ }
283
+ },
284
+ catch: function (t) {
285
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
286
+ var r = this.tryEntries[e];
287
+ if (r.tryLoc === t) {
288
+ var n = r.completion;
289
+ if ("throw" === n.type) {
290
+ var o = n.arg;
291
+ resetTryEntry(r);
292
+ }
293
+ return o;
294
+ }
295
+ }
296
+ throw new Error("illegal catch attempt");
297
+ },
298
+ delegateYield: function (e, r, n) {
299
+ return this.delegate = {
300
+ iterator: values(e),
301
+ resultName: r,
302
+ nextLoc: n
303
+ }, "next" === this.method && (this.arg = t), y;
304
+ }
305
+ }, e;
306
+ }
6
307
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
7
308
  try {
8
309
  var info = gen[key](arg);
@@ -146,7 +447,7 @@ function DynamicRepeater(_ref4) {
146
447
  data = _ref4.data;
147
448
  // Defaults to an array of three items.
148
449
  var finalData = (_ref5 = data != null ? data : useSelector$1(selector)) != null ? _ref5 : [1, 2, 3];
149
- return React.createElement(React.Fragment, null, finalData == null ? void 0 : finalData.map == null ? void 0 : finalData.map(function (item, index) {
450
+ return React.createElement(React.Fragment, null, finalData == null || finalData.map == null ? void 0 : finalData.map(function (item, index) {
150
451
  var _applySelector2;
151
452
  return React.createElement(DataProvider$1, {
152
453
  key: (_applySelector2 = applySelector$1(item, keySelector)) != null ? _applySelector2 : index,
@@ -291,664 +592,6 @@ function registerDynamicImage(loader, customDynamicImageMeta) {
291
592
  }
292
593
  }
293
594
 
294
- function createCommonjsModule(fn, module) {
295
- return module = { exports: {} }, fn(module, module.exports), module.exports;
296
- }
297
-
298
- var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
299
- /**
300
- * Copyright (c) 2014-present, Facebook, Inc.
301
- *
302
- * This source code is licensed under the MIT license found in the
303
- * LICENSE file in the root directory of this source tree.
304
- */
305
-
306
- var runtime = function (exports) {
307
-
308
- var Op = Object.prototype;
309
- var hasOwn = Op.hasOwnProperty;
310
- var undefined$1; // More compressible than void 0.
311
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
312
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
313
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
314
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
315
- function define(obj, key, value) {
316
- Object.defineProperty(obj, key, {
317
- value: value,
318
- enumerable: true,
319
- configurable: true,
320
- writable: true
321
- });
322
- return obj[key];
323
- }
324
- try {
325
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
326
- define({}, "");
327
- } catch (err) {
328
- define = function define(obj, key, value) {
329
- return obj[key] = value;
330
- };
331
- }
332
- function wrap(innerFn, outerFn, self, tryLocsList) {
333
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
334
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
335
- var generator = Object.create(protoGenerator.prototype);
336
- var context = new Context(tryLocsList || []);
337
-
338
- // The ._invoke method unifies the implementations of the .next,
339
- // .throw, and .return methods.
340
- generator._invoke = makeInvokeMethod(innerFn, self, context);
341
- return generator;
342
- }
343
- exports.wrap = wrap;
344
-
345
- // Try/catch helper to minimize deoptimizations. Returns a completion
346
- // record like context.tryEntries[i].completion. This interface could
347
- // have been (and was previously) designed to take a closure to be
348
- // invoked without arguments, but in all the cases we care about we
349
- // already have an existing method we want to call, so there's no need
350
- // to create a new function object. We can even get away with assuming
351
- // the method takes exactly one argument, since that happens to be true
352
- // in every case, so we don't have to touch the arguments object. The
353
- // only additional allocation required is the completion record, which
354
- // has a stable shape and so hopefully should be cheap to allocate.
355
- function tryCatch(fn, obj, arg) {
356
- try {
357
- return {
358
- type: "normal",
359
- arg: fn.call(obj, arg)
360
- };
361
- } catch (err) {
362
- return {
363
- type: "throw",
364
- arg: err
365
- };
366
- }
367
- }
368
- var GenStateSuspendedStart = "suspendedStart";
369
- var GenStateSuspendedYield = "suspendedYield";
370
- var GenStateExecuting = "executing";
371
- var GenStateCompleted = "completed";
372
-
373
- // Returning this object from the innerFn has the same effect as
374
- // breaking out of the dispatch switch statement.
375
- var ContinueSentinel = {};
376
-
377
- // Dummy constructor functions that we use as the .constructor and
378
- // .constructor.prototype properties for functions that return Generator
379
- // objects. For full spec compliance, you may wish to configure your
380
- // minifier not to mangle the names of these two functions.
381
- function Generator() {}
382
- function GeneratorFunction() {}
383
- function GeneratorFunctionPrototype() {}
384
-
385
- // This is a polyfill for %IteratorPrototype% for environments that
386
- // don't natively support it.
387
- var IteratorPrototype = {};
388
- define(IteratorPrototype, iteratorSymbol, function () {
389
- return this;
390
- });
391
- var getProto = Object.getPrototypeOf;
392
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
393
- if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
394
- // This environment has a native %IteratorPrototype%; use it instead
395
- // of the polyfill.
396
- IteratorPrototype = NativeIteratorPrototype;
397
- }
398
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
399
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
400
- define(Gp, "constructor", GeneratorFunctionPrototype);
401
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
402
- GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
403
-
404
- // Helper for defining the .next, .throw, and .return methods of the
405
- // Iterator interface in terms of a single ._invoke method.
406
- function defineIteratorMethods(prototype) {
407
- ["next", "throw", "return"].forEach(function (method) {
408
- define(prototype, method, function (arg) {
409
- return this._invoke(method, arg);
410
- });
411
- });
412
- }
413
- exports.isGeneratorFunction = function (genFun) {
414
- var ctor = typeof genFun === "function" && genFun.constructor;
415
- return ctor ? ctor === GeneratorFunction ||
416
- // For the native GeneratorFunction constructor, the best we can
417
- // do is to check its .name property.
418
- (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
419
- };
420
- exports.mark = function (genFun) {
421
- if (Object.setPrototypeOf) {
422
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
423
- } else {
424
- genFun.__proto__ = GeneratorFunctionPrototype;
425
- define(genFun, toStringTagSymbol, "GeneratorFunction");
426
- }
427
- genFun.prototype = Object.create(Gp);
428
- return genFun;
429
- };
430
-
431
- // Within the body of any async function, `await x` is transformed to
432
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
433
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
434
- // meant to be awaited.
435
- exports.awrap = function (arg) {
436
- return {
437
- __await: arg
438
- };
439
- };
440
- function AsyncIterator(generator, PromiseImpl) {
441
- function invoke(method, arg, resolve, reject) {
442
- var record = tryCatch(generator[method], generator, arg);
443
- if (record.type === "throw") {
444
- reject(record.arg);
445
- } else {
446
- var result = record.arg;
447
- var value = result.value;
448
- if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
449
- return PromiseImpl.resolve(value.__await).then(function (value) {
450
- invoke("next", value, resolve, reject);
451
- }, function (err) {
452
- invoke("throw", err, resolve, reject);
453
- });
454
- }
455
- return PromiseImpl.resolve(value).then(function (unwrapped) {
456
- // When a yielded Promise is resolved, its final value becomes
457
- // the .value of the Promise<{value,done}> result for the
458
- // current iteration.
459
- result.value = unwrapped;
460
- resolve(result);
461
- }, function (error) {
462
- // If a rejected Promise was yielded, throw the rejection back
463
- // into the async generator function so it can be handled there.
464
- return invoke("throw", error, resolve, reject);
465
- });
466
- }
467
- }
468
- var previousPromise;
469
- function enqueue(method, arg) {
470
- function callInvokeWithMethodAndArg() {
471
- return new PromiseImpl(function (resolve, reject) {
472
- invoke(method, arg, resolve, reject);
473
- });
474
- }
475
- return previousPromise =
476
- // If enqueue has been called before, then we want to wait until
477
- // all previous Promises have been resolved before calling invoke,
478
- // so that results are always delivered in the correct order. If
479
- // enqueue has not been called before, then it is important to
480
- // call invoke immediately, without waiting on a callback to fire,
481
- // so that the async generator function has the opportunity to do
482
- // any necessary setup in a predictable way. This predictability
483
- // is why the Promise constructor synchronously invokes its
484
- // executor callback, and why async functions synchronously
485
- // execute code before the first await. Since we implement simple
486
- // async functions in terms of async generators, it is especially
487
- // important to get this right, even though it requires care.
488
- previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
489
- // Avoid propagating failures to Promises returned by later
490
- // invocations of the iterator.
491
- callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
492
- }
493
-
494
- // Define the unified helper method that is used to implement .next,
495
- // .throw, and .return (see defineIteratorMethods).
496
- this._invoke = enqueue;
497
- }
498
- defineIteratorMethods(AsyncIterator.prototype);
499
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
500
- return this;
501
- });
502
- exports.AsyncIterator = AsyncIterator;
503
-
504
- // Note that simple async functions are implemented on top of
505
- // AsyncIterator objects; they just return a Promise for the value of
506
- // the final result produced by the iterator.
507
- exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
508
- if (PromiseImpl === void 0) PromiseImpl = Promise;
509
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
510
- return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
511
- : iter.next().then(function (result) {
512
- return result.done ? result.value : iter.next();
513
- });
514
- };
515
- function makeInvokeMethod(innerFn, self, context) {
516
- var state = GenStateSuspendedStart;
517
- return function invoke(method, arg) {
518
- if (state === GenStateExecuting) {
519
- throw new Error("Generator is already running");
520
- }
521
- if (state === GenStateCompleted) {
522
- if (method === "throw") {
523
- throw arg;
524
- }
525
-
526
- // Be forgiving, per 25.3.3.3.3 of the spec:
527
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
528
- return doneResult();
529
- }
530
- context.method = method;
531
- context.arg = arg;
532
- while (true) {
533
- var delegate = context.delegate;
534
- if (delegate) {
535
- var delegateResult = maybeInvokeDelegate(delegate, context);
536
- if (delegateResult) {
537
- if (delegateResult === ContinueSentinel) continue;
538
- return delegateResult;
539
- }
540
- }
541
- if (context.method === "next") {
542
- // Setting context._sent for legacy support of Babel's
543
- // function.sent implementation.
544
- context.sent = context._sent = context.arg;
545
- } else if (context.method === "throw") {
546
- if (state === GenStateSuspendedStart) {
547
- state = GenStateCompleted;
548
- throw context.arg;
549
- }
550
- context.dispatchException(context.arg);
551
- } else if (context.method === "return") {
552
- context.abrupt("return", context.arg);
553
- }
554
- state = GenStateExecuting;
555
- var record = tryCatch(innerFn, self, context);
556
- if (record.type === "normal") {
557
- // If an exception is thrown from innerFn, we leave state ===
558
- // GenStateExecuting and loop back for another invocation.
559
- state = context.done ? GenStateCompleted : GenStateSuspendedYield;
560
- if (record.arg === ContinueSentinel) {
561
- continue;
562
- }
563
- return {
564
- value: record.arg,
565
- done: context.done
566
- };
567
- } else if (record.type === "throw") {
568
- state = GenStateCompleted;
569
- // Dispatch the exception by looping back around to the
570
- // context.dispatchException(context.arg) call above.
571
- context.method = "throw";
572
- context.arg = record.arg;
573
- }
574
- }
575
- };
576
- }
577
-
578
- // Call delegate.iterator[context.method](context.arg) and handle the
579
- // result, either by returning a { value, done } result from the
580
- // delegate iterator, or by modifying context.method and context.arg,
581
- // setting context.delegate to null, and returning the ContinueSentinel.
582
- function maybeInvokeDelegate(delegate, context) {
583
- var method = delegate.iterator[context.method];
584
- if (method === undefined$1) {
585
- // A .throw or .return when the delegate iterator has no .throw
586
- // method always terminates the yield* loop.
587
- context.delegate = null;
588
- if (context.method === "throw") {
589
- // Note: ["return"] must be used for ES3 parsing compatibility.
590
- if (delegate.iterator["return"]) {
591
- // If the delegate iterator has a return method, give it a
592
- // chance to clean up.
593
- context.method = "return";
594
- context.arg = undefined$1;
595
- maybeInvokeDelegate(delegate, context);
596
- if (context.method === "throw") {
597
- // If maybeInvokeDelegate(context) changed context.method from
598
- // "return" to "throw", let that override the TypeError below.
599
- return ContinueSentinel;
600
- }
601
- }
602
- context.method = "throw";
603
- context.arg = new TypeError("The iterator does not provide a 'throw' method");
604
- }
605
- return ContinueSentinel;
606
- }
607
- var record = tryCatch(method, delegate.iterator, context.arg);
608
- if (record.type === "throw") {
609
- context.method = "throw";
610
- context.arg = record.arg;
611
- context.delegate = null;
612
- return ContinueSentinel;
613
- }
614
- var info = record.arg;
615
- if (!info) {
616
- context.method = "throw";
617
- context.arg = new TypeError("iterator result is not an object");
618
- context.delegate = null;
619
- return ContinueSentinel;
620
- }
621
- if (info.done) {
622
- // Assign the result of the finished delegate to the temporary
623
- // variable specified by delegate.resultName (see delegateYield).
624
- context[delegate.resultName] = info.value;
625
-
626
- // Resume execution at the desired location (see delegateYield).
627
- context.next = delegate.nextLoc;
628
-
629
- // If context.method was "throw" but the delegate handled the
630
- // exception, let the outer generator proceed normally. If
631
- // context.method was "next", forget context.arg since it has been
632
- // "consumed" by the delegate iterator. If context.method was
633
- // "return", allow the original .return call to continue in the
634
- // outer generator.
635
- if (context.method !== "return") {
636
- context.method = "next";
637
- context.arg = undefined$1;
638
- }
639
- } else {
640
- // Re-yield the result returned by the delegate method.
641
- return info;
642
- }
643
-
644
- // The delegate iterator is finished, so forget it and continue with
645
- // the outer generator.
646
- context.delegate = null;
647
- return ContinueSentinel;
648
- }
649
-
650
- // Define Generator.prototype.{next,throw,return} in terms of the
651
- // unified ._invoke helper method.
652
- defineIteratorMethods(Gp);
653
- define(Gp, toStringTagSymbol, "Generator");
654
-
655
- // A Generator should always return itself as the iterator object when the
656
- // @@iterator function is called on it. Some browsers' implementations of the
657
- // iterator prototype chain incorrectly implement this, causing the Generator
658
- // object to not be returned from this call. This ensures that doesn't happen.
659
- // See https://github.com/facebook/regenerator/issues/274 for more details.
660
- define(Gp, iteratorSymbol, function () {
661
- return this;
662
- });
663
- define(Gp, "toString", function () {
664
- return "[object Generator]";
665
- });
666
- function pushTryEntry(locs) {
667
- var entry = {
668
- tryLoc: locs[0]
669
- };
670
- if (1 in locs) {
671
- entry.catchLoc = locs[1];
672
- }
673
- if (2 in locs) {
674
- entry.finallyLoc = locs[2];
675
- entry.afterLoc = locs[3];
676
- }
677
- this.tryEntries.push(entry);
678
- }
679
- function resetTryEntry(entry) {
680
- var record = entry.completion || {};
681
- record.type = "normal";
682
- delete record.arg;
683
- entry.completion = record;
684
- }
685
- function Context(tryLocsList) {
686
- // The root entry object (effectively a try statement without a catch
687
- // or a finally block) gives us a place to store values thrown from
688
- // locations where there is no enclosing try statement.
689
- this.tryEntries = [{
690
- tryLoc: "root"
691
- }];
692
- tryLocsList.forEach(pushTryEntry, this);
693
- this.reset(true);
694
- }
695
- exports.keys = function (object) {
696
- var keys = [];
697
- for (var key in object) {
698
- keys.push(key);
699
- }
700
- keys.reverse();
701
-
702
- // Rather than returning an object with a next method, we keep
703
- // things simple and return the next function itself.
704
- return function next() {
705
- while (keys.length) {
706
- var key = keys.pop();
707
- if (key in object) {
708
- next.value = key;
709
- next.done = false;
710
- return next;
711
- }
712
- }
713
-
714
- // To avoid creating an additional object, we just hang the .value
715
- // and .done properties off the next function object itself. This
716
- // also ensures that the minifier will not anonymize the function.
717
- next.done = true;
718
- return next;
719
- };
720
- };
721
- function values(iterable) {
722
- if (iterable) {
723
- var iteratorMethod = iterable[iteratorSymbol];
724
- if (iteratorMethod) {
725
- return iteratorMethod.call(iterable);
726
- }
727
- if (typeof iterable.next === "function") {
728
- return iterable;
729
- }
730
- if (!isNaN(iterable.length)) {
731
- var i = -1,
732
- next = function next() {
733
- while (++i < iterable.length) {
734
- if (hasOwn.call(iterable, i)) {
735
- next.value = iterable[i];
736
- next.done = false;
737
- return next;
738
- }
739
- }
740
- next.value = undefined$1;
741
- next.done = true;
742
- return next;
743
- };
744
- return next.next = next;
745
- }
746
- }
747
-
748
- // Return an iterator with no values.
749
- return {
750
- next: doneResult
751
- };
752
- }
753
- exports.values = values;
754
- function doneResult() {
755
- return {
756
- value: undefined$1,
757
- done: true
758
- };
759
- }
760
- Context.prototype = {
761
- constructor: Context,
762
- reset: function reset(skipTempReset) {
763
- this.prev = 0;
764
- this.next = 0;
765
- // Resetting context._sent for legacy support of Babel's
766
- // function.sent implementation.
767
- this.sent = this._sent = undefined$1;
768
- this.done = false;
769
- this.delegate = null;
770
- this.method = "next";
771
- this.arg = undefined$1;
772
- this.tryEntries.forEach(resetTryEntry);
773
- if (!skipTempReset) {
774
- for (var name in this) {
775
- // Not sure about the optimal order of these conditions:
776
- if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
777
- this[name] = undefined$1;
778
- }
779
- }
780
- }
781
- },
782
- stop: function stop() {
783
- this.done = true;
784
- var rootEntry = this.tryEntries[0];
785
- var rootRecord = rootEntry.completion;
786
- if (rootRecord.type === "throw") {
787
- throw rootRecord.arg;
788
- }
789
- return this.rval;
790
- },
791
- dispatchException: function dispatchException(exception) {
792
- if (this.done) {
793
- throw exception;
794
- }
795
- var context = this;
796
- function handle(loc, caught) {
797
- record.type = "throw";
798
- record.arg = exception;
799
- context.next = loc;
800
- if (caught) {
801
- // If the dispatched exception was caught by a catch block,
802
- // then let that catch block handle the exception normally.
803
- context.method = "next";
804
- context.arg = undefined$1;
805
- }
806
- return !!caught;
807
- }
808
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
809
- var entry = this.tryEntries[i];
810
- var record = entry.completion;
811
- if (entry.tryLoc === "root") {
812
- // Exception thrown outside of any try block that could handle
813
- // it, so set the completion value of the entire function to
814
- // throw the exception.
815
- return handle("end");
816
- }
817
- if (entry.tryLoc <= this.prev) {
818
- var hasCatch = hasOwn.call(entry, "catchLoc");
819
- var hasFinally = hasOwn.call(entry, "finallyLoc");
820
- if (hasCatch && hasFinally) {
821
- if (this.prev < entry.catchLoc) {
822
- return handle(entry.catchLoc, true);
823
- } else if (this.prev < entry.finallyLoc) {
824
- return handle(entry.finallyLoc);
825
- }
826
- } else if (hasCatch) {
827
- if (this.prev < entry.catchLoc) {
828
- return handle(entry.catchLoc, true);
829
- }
830
- } else if (hasFinally) {
831
- if (this.prev < entry.finallyLoc) {
832
- return handle(entry.finallyLoc);
833
- }
834
- } else {
835
- throw new Error("try statement without catch or finally");
836
- }
837
- }
838
- }
839
- },
840
- abrupt: function abrupt(type, arg) {
841
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
842
- var entry = this.tryEntries[i];
843
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
844
- var finallyEntry = entry;
845
- break;
846
- }
847
- }
848
- if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
849
- // Ignore the finally entry if control is not jumping to a
850
- // location outside the try/catch block.
851
- finallyEntry = null;
852
- }
853
- var record = finallyEntry ? finallyEntry.completion : {};
854
- record.type = type;
855
- record.arg = arg;
856
- if (finallyEntry) {
857
- this.method = "next";
858
- this.next = finallyEntry.finallyLoc;
859
- return ContinueSentinel;
860
- }
861
- return this.complete(record);
862
- },
863
- complete: function complete(record, afterLoc) {
864
- if (record.type === "throw") {
865
- throw record.arg;
866
- }
867
- if (record.type === "break" || record.type === "continue") {
868
- this.next = record.arg;
869
- } else if (record.type === "return") {
870
- this.rval = this.arg = record.arg;
871
- this.method = "return";
872
- this.next = "end";
873
- } else if (record.type === "normal" && afterLoc) {
874
- this.next = afterLoc;
875
- }
876
- return ContinueSentinel;
877
- },
878
- finish: function finish(finallyLoc) {
879
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
880
- var entry = this.tryEntries[i];
881
- if (entry.finallyLoc === finallyLoc) {
882
- this.complete(entry.completion, entry.afterLoc);
883
- resetTryEntry(entry);
884
- return ContinueSentinel;
885
- }
886
- }
887
- },
888
- "catch": function _catch(tryLoc) {
889
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
890
- var entry = this.tryEntries[i];
891
- if (entry.tryLoc === tryLoc) {
892
- var record = entry.completion;
893
- if (record.type === "throw") {
894
- var thrown = record.arg;
895
- resetTryEntry(entry);
896
- }
897
- return thrown;
898
- }
899
- }
900
-
901
- // The context.catch method must only be called with a location
902
- // argument that corresponds to a known catch block.
903
- throw new Error("illegal catch attempt");
904
- },
905
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
906
- this.delegate = {
907
- iterator: values(iterable),
908
- resultName: resultName,
909
- nextLoc: nextLoc
910
- };
911
- if (this.method === "next") {
912
- // Deliberately forget the last sent value so that we don't
913
- // accidentally pass it on to the delegate.
914
- this.arg = undefined$1;
915
- }
916
- return ContinueSentinel;
917
- }
918
- };
919
-
920
- // Regardless of whether this script is executing as a CommonJS module
921
- // or not, return the runtime object so that we can declare the variable
922
- // regeneratorRuntime in the outer scope, which allows this module to be
923
- // injected easily by `bin/regenerator --include-runtime script.js`.
924
- return exports;
925
- }(
926
- // If this script is executing as a CommonJS module, use module.exports
927
- // as the regeneratorRuntime namespace. Otherwise create a new empty
928
- // object. Either way, the resulting object will be used to initialize
929
- // the regeneratorRuntime variable at the top of this file.
930
- module.exports );
931
- try {
932
- regeneratorRuntime = runtime;
933
- } catch (accidentalStrictMode) {
934
- // This module should not be running in strict mode, so the above
935
- // assignment should always work unless something is misconfigured. Just
936
- // in case runtime.js accidentally runs in strict mode, in modern engines
937
- // we can explicitly access globalThis. In older engines we can escape
938
- // strict mode using a global Function call. This could conceivably fail
939
- // if a Content Security Policy forbids using Function, but in that case
940
- // the proper solution is to fix the accidental strict mode problem. If
941
- // you've misconfigured your bundler to force strict mode and applied a
942
- // CSP to forbid Function, and you're not willing to fix either of those
943
- // problems, please detail your unique predicament in a GitHub issue.
944
- if (typeof globalThis === "object") {
945
- globalThis.regeneratorRuntime = runtime;
946
- } else {
947
- Function("r", "regeneratorRuntime = r")(runtime);
948
- }
949
- }
950
- });
951
-
952
595
  function ensure(x) {
953
596
  if (x === null || x === undefined) {
954
597
  debugger;
@@ -982,58 +625,54 @@ function Embed(_ref) {
982
625
  return;
983
626
  }
984
627
  // Load scripts sequentially one at a time, since later scripts can depend on earlier ones.
985
- _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
628
+ _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
986
629
  var _loop, _i, _Array$from;
987
- return runtime_1.wrap(function _callee$(_context2) {
988
- while (1) {
989
- switch (_context2.prev = _context2.next) {
990
- case 0:
991
- _loop = /*#__PURE__*/runtime_1.mark(function _loop() {
992
- var oldScript, newScript;
993
- return runtime_1.wrap(function _loop$(_context) {
994
- while (1) {
995
- switch (_context.prev = _context.next) {
996
- case 0:
997
- oldScript = _Array$from[_i];
998
- newScript = document.createElement("script"); // This doesn't actually have the effect we want, we need to explicitly wait on the load event, since all
999
- // dynamically injected scripts are always async.
1000
- newScript.async = false;
1001
- Array.from(oldScript.attributes).forEach(function (attr) {
1002
- return newScript.setAttribute(attr.name, attr.value);
1003
- });
1004
- newScript.appendChild(document.createTextNode(oldScript.innerHTML));
1005
- ensure(oldScript.parentNode).replaceChild(newScript, oldScript);
1006
- // Only scripts with src will ever fire a load event.
1007
- if (!newScript.src) {
1008
- _context.next = 9;
1009
- break;
1010
- }
1011
- _context.next = 9;
1012
- return new Promise(function (resolve) {
1013
- return newScript.addEventListener("load", resolve);
1014
- });
1015
- case 9:
1016
- case "end":
1017
- return _context.stop();
630
+ return _regeneratorRuntime().wrap(function _callee$(_context2) {
631
+ while (1) switch (_context2.prev = _context2.next) {
632
+ case 0:
633
+ _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
634
+ var oldScript, newScript;
635
+ return _regeneratorRuntime().wrap(function _loop$(_context) {
636
+ while (1) switch (_context.prev = _context.next) {
637
+ case 0:
638
+ oldScript = _Array$from[_i];
639
+ newScript = document.createElement("script"); // This doesn't actually have the effect we want, we need to explicitly wait on the load event, since all
640
+ // dynamically injected scripts are always async.
641
+ newScript.async = false;
642
+ Array.from(oldScript.attributes).forEach(function (attr) {
643
+ return newScript.setAttribute(attr.name, attr.value);
644
+ });
645
+ newScript.appendChild(document.createTextNode(oldScript.innerHTML));
646
+ ensure(oldScript.parentNode).replaceChild(newScript, oldScript);
647
+ // Only scripts with src will ever fire a load event.
648
+ if (!newScript.src) {
649
+ _context.next = 9;
650
+ break;
1018
651
  }
1019
- }
1020
- }, _loop);
1021
- });
1022
- _i = 0, _Array$from = Array.from(ensure(rootElt.current).querySelectorAll("script"));
1023
- case 2:
1024
- if (!(_i < _Array$from.length)) {
1025
- _context2.next = 7;
1026
- break;
1027
- }
1028
- return _context2.delegateYield(_loop(), "t0", 4);
1029
- case 4:
1030
- _i++;
1031
- _context2.next = 2;
652
+ _context.next = 9;
653
+ return new Promise(function (resolve) {
654
+ return newScript.addEventListener("load", resolve);
655
+ });
656
+ case 9:
657
+ case "end":
658
+ return _context.stop();
659
+ }
660
+ }, _loop);
661
+ });
662
+ _i = 0, _Array$from = Array.from(ensure(rootElt.current).querySelectorAll("script"));
663
+ case 2:
664
+ if (!(_i < _Array$from.length)) {
665
+ _context2.next = 7;
1032
666
  break;
1033
- case 7:
1034
- case "end":
1035
- return _context2.stop();
1036
- }
667
+ }
668
+ return _context2.delegateYield(_loop(), "t0", 4);
669
+ case 4:
670
+ _i++;
671
+ _context2.next = 2;
672
+ break;
673
+ case 7:
674
+ case "end":
675
+ return _context2.stop();
1037
676
  }
1038
677
  }, _callee);
1039
678
  }))();
@@ -1459,7 +1098,7 @@ function ConditionGuardOnNotSatisfied(_ref) {
1459
1098
  React.useEffect(function () {
1460
1099
  if (!ref.current) {
1461
1100
  ref.current = true;
1462
- onNotSatisfied == null ? void 0 : onNotSatisfied();
1101
+ onNotSatisfied == null || onNotSatisfied();
1463
1102
  }
1464
1103
  }, [onNotSatisfied]);
1465
1104
  return null;
@@ -1469,7 +1108,7 @@ function isCurrentLocationInSkipPaths(skipPaths) {
1469
1108
  var pathname = window.location.pathname;
1470
1109
  // Ignore search params
1471
1110
  var currentPath = window.location.origin + pathname;
1472
- var plasmicPathname = globalThis == null ? void 0 : (_globalThis$__PLASMIC = globalThis["__PLASMIC_STUDIO_PATH"]) == null ? void 0 : _globalThis$__PLASMIC.call(globalThis);
1111
+ var plasmicPathname = globalThis == null || (_globalThis$__PLASMIC = globalThis["__PLASMIC_STUDIO_PATH"]) == null ? void 0 : _globalThis$__PLASMIC.call(globalThis);
1473
1112
  return skipPaths == null ? void 0 : skipPaths.some(function (_ref2) {
1474
1113
  var path = _ref2.path;
1475
1114
  return path === pathname || path === currentPath || path === plasmicPathname;
@@ -1537,9 +1176,9 @@ function SideEffect(_ref) {
1537
1176
  onMount = _ref.onMount,
1538
1177
  onUnmount = _ref.onUnmount;
1539
1178
  React.useEffect(function () {
1540
- onMount == null ? void 0 : onMount();
1179
+ onMount == null || onMount();
1541
1180
  return function () {
1542
- onUnmount == null ? void 0 : onUnmount();
1181
+ onUnmount == null || onUnmount();
1543
1182
  };
1544
1183
  }, deps != null ? deps : []);
1545
1184
  return null;