@plasmicapp/loader-nextjs 1.0.212 → 1.0.214

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.
@@ -15,65 +15,52 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
15
15
  reject(error);
16
16
  return;
17
17
  }
18
-
19
18
  if (info.done) {
20
19
  resolve(value);
21
20
  } else {
22
21
  Promise.resolve(value).then(_next, _throw);
23
22
  }
24
23
  }
25
-
26
24
  function _asyncToGenerator(fn) {
27
25
  return function () {
28
26
  var self = this,
29
- args = arguments;
27
+ args = arguments;
30
28
  return new Promise(function (resolve, reject) {
31
29
  var gen = fn.apply(self, args);
32
-
33
30
  function _next(value) {
34
31
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
35
32
  }
36
-
37
33
  function _throw(err) {
38
34
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
39
35
  }
40
-
41
36
  _next(undefined);
42
37
  });
43
38
  };
44
39
  }
45
-
46
40
  function _extends() {
47
- _extends = Object.assign || function (target) {
41
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
48
42
  for (var i = 1; i < arguments.length; i++) {
49
43
  var source = arguments[i];
50
-
51
44
  for (var key in source) {
52
45
  if (Object.prototype.hasOwnProperty.call(source, key)) {
53
46
  target[key] = source[key];
54
47
  }
55
48
  }
56
49
  }
57
-
58
50
  return target;
59
51
  };
60
-
61
52
  return _extends.apply(this, arguments);
62
53
  }
63
-
64
54
  function _inheritsLoose(subClass, superClass) {
65
55
  subClass.prototype = Object.create(superClass.prototype);
66
56
  subClass.prototype.constructor = subClass;
67
-
68
57
  _setPrototypeOf(subClass, superClass);
69
58
  }
70
-
71
59
  function _setPrototypeOf(o, p) {
72
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
60
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
73
61
  o.__proto__ = p;
74
62
  return o;
75
63
  };
76
-
77
64
  return _setPrototypeOf(o, p);
78
65
  }
79
66
 
@@ -88,17 +75,16 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
88
75
  * This source code is licensed under the MIT license found in the
89
76
  * LICENSE file in the root directory of this source tree.
90
77
  */
78
+
91
79
  var runtime = function (exports) {
92
80
 
93
81
  var Op = Object.prototype;
94
82
  var hasOwn = Op.hasOwnProperty;
95
83
  var undefined$1; // More compressible than void 0.
96
-
97
84
  var $Symbol = typeof Symbol === "function" ? Symbol : {};
98
85
  var iteratorSymbol = $Symbol.iterator || "@@iterator";
99
86
  var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
100
87
  var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
101
-
102
88
  function define(obj, key, value) {
103
89
  Object.defineProperty(obj, key, {
104
90
  value: value,
@@ -108,7 +94,6 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
108
94
  });
109
95
  return obj[key];
110
96
  }
111
-
112
97
  try {
113
98
  // IE 8 has a broken Object.defineProperty that only works on DOM objects.
114
99
  define({}, "");
@@ -117,19 +102,20 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
117
102
  return obj[key] = value;
118
103
  };
119
104
  }
120
-
121
105
  function wrap(innerFn, outerFn, self, tryLocsList) {
122
106
  // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
123
107
  var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
124
108
  var generator = Object.create(protoGenerator.prototype);
125
- var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
126
- // .throw, and .return methods.
109
+ var context = new Context(tryLocsList || []);
127
110
 
111
+ // The ._invoke method unifies the implementations of the .next,
112
+ // .throw, and .return methods.
128
113
  generator._invoke = makeInvokeMethod(innerFn, self, context);
129
114
  return generator;
130
115
  }
116
+ exports.wrap = wrap;
131
117
 
132
- exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
118
+ // Try/catch helper to minimize deoptimizations. Returns a completion
133
119
  // record like context.tryEntries[i].completion. This interface could
134
120
  // have been (and was previously) designed to take a closure to be
135
121
  // invoked without arguments, but in all the cases we care about we
@@ -139,7 +125,6 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
139
125
  // in every case, so we don't have to touch the arguments object. The
140
126
  // only additional allocation required is the completion record, which
141
127
  // has a stable shape and so hopefully should be cheap to allocate.
142
-
143
128
  function tryCatch(fn, obj, arg) {
144
129
  try {
145
130
  return {
@@ -153,46 +138,44 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
153
138
  };
154
139
  }
155
140
  }
156
-
157
141
  var GenStateSuspendedStart = "suspendedStart";
158
142
  var GenStateSuspendedYield = "suspendedYield";
159
143
  var GenStateExecuting = "executing";
160
- var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
144
+ var GenStateCompleted = "completed";
145
+
146
+ // Returning this object from the innerFn has the same effect as
161
147
  // breaking out of the dispatch switch statement.
148
+ var ContinueSentinel = {};
162
149
 
163
- var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
150
+ // Dummy constructor functions that we use as the .constructor and
164
151
  // .constructor.prototype properties for functions that return Generator
165
152
  // objects. For full spec compliance, you may wish to configure your
166
153
  // minifier not to mangle the names of these two functions.
167
-
168
154
  function Generator() {}
169
-
170
155
  function GeneratorFunction() {}
156
+ function GeneratorFunctionPrototype() {}
171
157
 
172
- function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
158
+ // This is a polyfill for %IteratorPrototype% for environments that
173
159
  // don't natively support it.
174
-
175
-
176
160
  var IteratorPrototype = {};
177
161
  define(IteratorPrototype, iteratorSymbol, function () {
178
162
  return this;
179
163
  });
180
164
  var getProto = Object.getPrototypeOf;
181
165
  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
182
-
183
166
  if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
184
167
  // This environment has a native %IteratorPrototype%; use it instead
185
168
  // of the polyfill.
186
169
  IteratorPrototype = NativeIteratorPrototype;
187
170
  }
188
-
189
171
  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
190
172
  GeneratorFunction.prototype = GeneratorFunctionPrototype;
191
173
  define(Gp, "constructor", GeneratorFunctionPrototype);
192
174
  define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
193
- GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
194
- // Iterator interface in terms of a single ._invoke method.
175
+ GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
195
176
 
177
+ // Helper for defining the .next, .throw, and .return methods of the
178
+ // Iterator interface in terms of a single ._invoke method.
196
179
  function defineIteratorMethods(prototype) {
197
180
  ["next", "throw", "return"].forEach(function (method) {
198
181
  define(prototype, method, function (arg) {
@@ -200,14 +183,13 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
200
183
  });
201
184
  });
202
185
  }
203
-
204
186
  exports.isGeneratorFunction = function (genFun) {
205
187
  var ctor = typeof genFun === "function" && genFun.constructor;
206
- return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
188
+ return ctor ? ctor === GeneratorFunction ||
189
+ // For the native GeneratorFunction constructor, the best we can
207
190
  // do is to check its .name property.
208
191
  (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
209
192
  };
210
-
211
193
  exports.mark = function (genFun) {
212
194
  if (Object.setPrototypeOf) {
213
195
  Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
@@ -215,31 +197,27 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
215
197
  genFun.__proto__ = GeneratorFunctionPrototype;
216
198
  define(genFun, toStringTagSymbol, "GeneratorFunction");
217
199
  }
218
-
219
200
  genFun.prototype = Object.create(Gp);
220
201
  return genFun;
221
- }; // Within the body of any async function, `await x` is transformed to
202
+ };
203
+
204
+ // Within the body of any async function, `await x` is transformed to
222
205
  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
223
206
  // `hasOwn.call(value, "__await")` to determine if the yielded value is
224
207
  // meant to be awaited.
225
-
226
-
227
208
  exports.awrap = function (arg) {
228
209
  return {
229
210
  __await: arg
230
211
  };
231
212
  };
232
-
233
213
  function AsyncIterator(generator, PromiseImpl) {
234
214
  function invoke(method, arg, resolve, reject) {
235
215
  var record = tryCatch(generator[method], generator, arg);
236
-
237
216
  if (record.type === "throw") {
238
217
  reject(record.arg);
239
218
  } else {
240
219
  var result = record.arg;
241
220
  var value = result.value;
242
-
243
221
  if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
244
222
  return PromiseImpl.resolve(value.__await).then(function (value) {
245
223
  invoke("next", value, resolve, reject);
@@ -247,7 +225,6 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
247
225
  invoke("throw", err, resolve, reject);
248
226
  });
249
227
  }
250
-
251
228
  return PromiseImpl.resolve(value).then(function (unwrapped) {
252
229
  // When a yielded Promise is resolved, its final value becomes
253
230
  // the .value of the Promise<{value,done}> result for the
@@ -261,17 +238,15 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
261
238
  });
262
239
  }
263
240
  }
264
-
265
241
  var previousPromise;
266
-
267
242
  function enqueue(method, arg) {
268
243
  function callInvokeWithMethodAndArg() {
269
244
  return new PromiseImpl(function (resolve, reject) {
270
245
  invoke(method, arg, resolve, reject);
271
246
  });
272
247
  }
273
-
274
- return previousPromise = // If enqueue has been called before, then we want to wait until
248
+ return previousPromise =
249
+ // If enqueue has been called before, then we want to wait until
275
250
  // all previous Promises have been resolved before calling invoke,
276
251
  // so that results are always delivered in the correct order. If
277
252
  // enqueue has not been called before, then it is important to
@@ -283,24 +258,25 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
283
258
  // execute code before the first await. Since we implement simple
284
259
  // async functions in terms of async generators, it is especially
285
260
  // important to get this right, even though it requires care.
286
- previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
261
+ previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
262
+ // Avoid propagating failures to Promises returned by later
287
263
  // invocations of the iterator.
288
264
  callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
289
- } // Define the unified helper method that is used to implement .next,
290
- // .throw, and .return (see defineIteratorMethods).
291
-
265
+ }
292
266
 
267
+ // Define the unified helper method that is used to implement .next,
268
+ // .throw, and .return (see defineIteratorMethods).
293
269
  this._invoke = enqueue;
294
270
  }
295
-
296
271
  defineIteratorMethods(AsyncIterator.prototype);
297
272
  define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
298
273
  return this;
299
274
  });
300
- exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
275
+ exports.AsyncIterator = AsyncIterator;
276
+
277
+ // Note that simple async functions are implemented on top of
301
278
  // AsyncIterator objects; they just return a Promise for the value of
302
279
  // the final result produced by the iterator.
303
-
304
280
  exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
305
281
  if (PromiseImpl === void 0) PromiseImpl = Promise;
306
282
  var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
@@ -309,39 +285,32 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
309
285
  return result.done ? result.value : iter.next();
310
286
  });
311
287
  };
312
-
313
288
  function makeInvokeMethod(innerFn, self, context) {
314
289
  var state = GenStateSuspendedStart;
315
290
  return function invoke(method, arg) {
316
291
  if (state === GenStateExecuting) {
317
292
  throw new Error("Generator is already running");
318
293
  }
319
-
320
294
  if (state === GenStateCompleted) {
321
295
  if (method === "throw") {
322
296
  throw arg;
323
- } // Be forgiving, per 25.3.3.3.3 of the spec:
324
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
325
-
297
+ }
326
298
 
299
+ // Be forgiving, per 25.3.3.3.3 of the spec:
300
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
327
301
  return doneResult();
328
302
  }
329
-
330
303
  context.method = method;
331
304
  context.arg = arg;
332
-
333
305
  while (true) {
334
306
  var delegate = context.delegate;
335
-
336
307
  if (delegate) {
337
308
  var delegateResult = maybeInvokeDelegate(delegate, context);
338
-
339
309
  if (delegateResult) {
340
310
  if (delegateResult === ContinueSentinel) continue;
341
311
  return delegateResult;
342
312
  }
343
313
  }
344
-
345
314
  if (context.method === "next") {
346
315
  // Setting context._sent for legacy support of Babel's
347
316
  // function.sent implementation.
@@ -351,51 +320,44 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
351
320
  state = GenStateCompleted;
352
321
  throw context.arg;
353
322
  }
354
-
355
323
  context.dispatchException(context.arg);
356
324
  } else if (context.method === "return") {
357
325
  context.abrupt("return", context.arg);
358
326
  }
359
-
360
327
  state = GenStateExecuting;
361
328
  var record = tryCatch(innerFn, self, context);
362
-
363
329
  if (record.type === "normal") {
364
330
  // If an exception is thrown from innerFn, we leave state ===
365
331
  // GenStateExecuting and loop back for another invocation.
366
332
  state = context.done ? GenStateCompleted : GenStateSuspendedYield;
367
-
368
333
  if (record.arg === ContinueSentinel) {
369
334
  continue;
370
335
  }
371
-
372
336
  return {
373
337
  value: record.arg,
374
338
  done: context.done
375
339
  };
376
340
  } else if (record.type === "throw") {
377
- state = GenStateCompleted; // Dispatch the exception by looping back around to the
341
+ state = GenStateCompleted;
342
+ // Dispatch the exception by looping back around to the
378
343
  // context.dispatchException(context.arg) call above.
379
-
380
344
  context.method = "throw";
381
345
  context.arg = record.arg;
382
346
  }
383
347
  }
384
348
  };
385
- } // Call delegate.iterator[context.method](context.arg) and handle the
349
+ }
350
+
351
+ // Call delegate.iterator[context.method](context.arg) and handle the
386
352
  // result, either by returning a { value, done } result from the
387
353
  // delegate iterator, or by modifying context.method and context.arg,
388
354
  // setting context.delegate to null, and returning the ContinueSentinel.
389
-
390
-
391
355
  function maybeInvokeDelegate(delegate, context) {
392
356
  var method = delegate.iterator[context.method];
393
-
394
357
  if (method === undefined$1) {
395
358
  // A .throw or .return when the delegate iterator has no .throw
396
359
  // method always terminates the yield* loop.
397
360
  context.delegate = null;
398
-
399
361
  if (context.method === "throw") {
400
362
  // Note: ["return"] must be used for ES3 parsing compatibility.
401
363
  if (delegate.iterator["return"]) {
@@ -404,51 +366,45 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
404
366
  context.method = "return";
405
367
  context.arg = undefined$1;
406
368
  maybeInvokeDelegate(delegate, context);
407
-
408
369
  if (context.method === "throw") {
409
370
  // If maybeInvokeDelegate(context) changed context.method from
410
371
  // "return" to "throw", let that override the TypeError below.
411
372
  return ContinueSentinel;
412
373
  }
413
374
  }
414
-
415
375
  context.method = "throw";
416
376
  context.arg = new TypeError("The iterator does not provide a 'throw' method");
417
377
  }
418
-
419
378
  return ContinueSentinel;
420
379
  }
421
-
422
380
  var record = tryCatch(method, delegate.iterator, context.arg);
423
-
424
381
  if (record.type === "throw") {
425
382
  context.method = "throw";
426
383
  context.arg = record.arg;
427
384
  context.delegate = null;
428
385
  return ContinueSentinel;
429
386
  }
430
-
431
387
  var info = record.arg;
432
-
433
388
  if (!info) {
434
389
  context.method = "throw";
435
390
  context.arg = new TypeError("iterator result is not an object");
436
391
  context.delegate = null;
437
392
  return ContinueSentinel;
438
393
  }
439
-
440
394
  if (info.done) {
441
395
  // Assign the result of the finished delegate to the temporary
442
396
  // variable specified by delegate.resultName (see delegateYield).
443
- context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
397
+ context[delegate.resultName] = info.value;
444
398
 
445
- context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
399
+ // Resume execution at the desired location (see delegateYield).
400
+ context.next = delegate.nextLoc;
401
+
402
+ // If context.method was "throw" but the delegate handled the
446
403
  // exception, let the outer generator proceed normally. If
447
404
  // context.method was "next", forget context.arg since it has been
448
405
  // "consumed" by the delegate iterator. If context.method was
449
406
  // "return", allow the original .return call to continue in the
450
407
  // outer generator.
451
-
452
408
  if (context.method !== "return") {
453
409
  context.method = "next";
454
410
  context.arg = undefined$1;
@@ -456,54 +412,49 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
456
412
  } else {
457
413
  // Re-yield the result returned by the delegate method.
458
414
  return info;
459
- } // The delegate iterator is finished, so forget it and continue with
460
- // the outer generator.
461
-
415
+ }
462
416
 
417
+ // The delegate iterator is finished, so forget it and continue with
418
+ // the outer generator.
463
419
  context.delegate = null;
464
420
  return ContinueSentinel;
465
- } // Define Generator.prototype.{next,throw,return} in terms of the
466
- // unified ._invoke helper method.
467
-
421
+ }
468
422
 
423
+ // Define Generator.prototype.{next,throw,return} in terms of the
424
+ // unified ._invoke helper method.
469
425
  defineIteratorMethods(Gp);
470
- define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
426
+ define(Gp, toStringTagSymbol, "Generator");
427
+
428
+ // A Generator should always return itself as the iterator object when the
471
429
  // @@iterator function is called on it. Some browsers' implementations of the
472
430
  // iterator prototype chain incorrectly implement this, causing the Generator
473
431
  // object to not be returned from this call. This ensures that doesn't happen.
474
432
  // See https://github.com/facebook/regenerator/issues/274 for more details.
475
-
476
433
  define(Gp, iteratorSymbol, function () {
477
434
  return this;
478
435
  });
479
436
  define(Gp, "toString", function () {
480
437
  return "[object Generator]";
481
438
  });
482
-
483
439
  function pushTryEntry(locs) {
484
440
  var entry = {
485
441
  tryLoc: locs[0]
486
442
  };
487
-
488
443
  if (1 in locs) {
489
444
  entry.catchLoc = locs[1];
490
445
  }
491
-
492
446
  if (2 in locs) {
493
447
  entry.finallyLoc = locs[2];
494
448
  entry.afterLoc = locs[3];
495
449
  }
496
-
497
450
  this.tryEntries.push(entry);
498
451
  }
499
-
500
452
  function resetTryEntry(entry) {
501
453
  var record = entry.completion || {};
502
454
  record.type = "normal";
503
455
  delete record.arg;
504
456
  entry.completion = record;
505
457
  }
506
-
507
458
  function Context(tryLocsList) {
508
459
  // The root entry object (effectively a try statement without a catch
509
460
  // or a finally block) gives us a place to store values thrown from
@@ -514,97 +465,84 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
514
465
  tryLocsList.forEach(pushTryEntry, this);
515
466
  this.reset(true);
516
467
  }
517
-
518
468
  exports.keys = function (object) {
519
469
  var keys = [];
520
-
521
470
  for (var key in object) {
522
471
  keys.push(key);
523
472
  }
473
+ keys.reverse();
524
474
 
525
- keys.reverse(); // Rather than returning an object with a next method, we keep
475
+ // Rather than returning an object with a next method, we keep
526
476
  // things simple and return the next function itself.
527
-
528
477
  return function next() {
529
478
  while (keys.length) {
530
479
  var key = keys.pop();
531
-
532
480
  if (key in object) {
533
481
  next.value = key;
534
482
  next.done = false;
535
483
  return next;
536
484
  }
537
- } // To avoid creating an additional object, we just hang the .value
485
+ }
486
+
487
+ // To avoid creating an additional object, we just hang the .value
538
488
  // and .done properties off the next function object itself. This
539
489
  // also ensures that the minifier will not anonymize the function.
540
-
541
-
542
490
  next.done = true;
543
491
  return next;
544
492
  };
545
493
  };
546
-
547
494
  function values(iterable) {
548
495
  if (iterable) {
549
496
  var iteratorMethod = iterable[iteratorSymbol];
550
-
551
497
  if (iteratorMethod) {
552
498
  return iteratorMethod.call(iterable);
553
499
  }
554
-
555
500
  if (typeof iterable.next === "function") {
556
501
  return iterable;
557
502
  }
558
-
559
503
  if (!isNaN(iterable.length)) {
560
504
  var i = -1,
561
- next = function next() {
562
- while (++i < iterable.length) {
563
- if (hasOwn.call(iterable, i)) {
564
- next.value = iterable[i];
565
- next.done = false;
566
- return next;
505
+ next = function next() {
506
+ while (++i < iterable.length) {
507
+ if (hasOwn.call(iterable, i)) {
508
+ next.value = iterable[i];
509
+ next.done = false;
510
+ return next;
511
+ }
567
512
  }
568
- }
569
-
570
- next.value = undefined$1;
571
- next.done = true;
572
- return next;
573
- };
574
-
513
+ next.value = undefined$1;
514
+ next.done = true;
515
+ return next;
516
+ };
575
517
  return next.next = next;
576
518
  }
577
- } // Return an iterator with no values.
578
-
519
+ }
579
520
 
521
+ // Return an iterator with no values.
580
522
  return {
581
523
  next: doneResult
582
524
  };
583
525
  }
584
-
585
526
  exports.values = values;
586
-
587
527
  function doneResult() {
588
528
  return {
589
529
  value: undefined$1,
590
530
  done: true
591
531
  };
592
532
  }
593
-
594
533
  Context.prototype = {
595
534
  constructor: Context,
596
535
  reset: function reset(skipTempReset) {
597
536
  this.prev = 0;
598
- this.next = 0; // Resetting context._sent for legacy support of Babel's
537
+ this.next = 0;
538
+ // Resetting context._sent for legacy support of Babel's
599
539
  // function.sent implementation.
600
-
601
540
  this.sent = this._sent = undefined$1;
602
541
  this.done = false;
603
542
  this.delegate = null;
604
543
  this.method = "next";
605
544
  this.arg = undefined$1;
606
545
  this.tryEntries.forEach(resetTryEntry);
607
-
608
546
  if (!skipTempReset) {
609
547
  for (var name in this) {
610
548
  // Not sure about the optimal order of these conditions:
@@ -618,50 +556,40 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
618
556
  this.done = true;
619
557
  var rootEntry = this.tryEntries[0];
620
558
  var rootRecord = rootEntry.completion;
621
-
622
559
  if (rootRecord.type === "throw") {
623
560
  throw rootRecord.arg;
624
561
  }
625
-
626
562
  return this.rval;
627
563
  },
628
564
  dispatchException: function dispatchException(exception) {
629
565
  if (this.done) {
630
566
  throw exception;
631
567
  }
632
-
633
568
  var context = this;
634
-
635
569
  function handle(loc, caught) {
636
570
  record.type = "throw";
637
571
  record.arg = exception;
638
572
  context.next = loc;
639
-
640
573
  if (caught) {
641
574
  // If the dispatched exception was caught by a catch block,
642
575
  // then let that catch block handle the exception normally.
643
576
  context.method = "next";
644
577
  context.arg = undefined$1;
645
578
  }
646
-
647
579
  return !!caught;
648
580
  }
649
-
650
581
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
651
582
  var entry = this.tryEntries[i];
652
583
  var record = entry.completion;
653
-
654
584
  if (entry.tryLoc === "root") {
655
585
  // Exception thrown outside of any try block that could handle
656
586
  // it, so set the completion value of the entire function to
657
587
  // throw the exception.
658
588
  return handle("end");
659
589
  }
660
-
661
590
  if (entry.tryLoc <= this.prev) {
662
591
  var hasCatch = hasOwn.call(entry, "catchLoc");
663
592
  var hasFinally = hasOwn.call(entry, "finallyLoc");
664
-
665
593
  if (hasCatch && hasFinally) {
666
594
  if (this.prev < entry.catchLoc) {
667
595
  return handle(entry.catchLoc, true);
@@ -685,36 +613,30 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
685
613
  abrupt: function abrupt(type, arg) {
686
614
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
687
615
  var entry = this.tryEntries[i];
688
-
689
616
  if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
690
617
  var finallyEntry = entry;
691
618
  break;
692
619
  }
693
620
  }
694
-
695
621
  if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
696
622
  // Ignore the finally entry if control is not jumping to a
697
623
  // location outside the try/catch block.
698
624
  finallyEntry = null;
699
625
  }
700
-
701
626
  var record = finallyEntry ? finallyEntry.completion : {};
702
627
  record.type = type;
703
628
  record.arg = arg;
704
-
705
629
  if (finallyEntry) {
706
630
  this.method = "next";
707
631
  this.next = finallyEntry.finallyLoc;
708
632
  return ContinueSentinel;
709
633
  }
710
-
711
634
  return this.complete(record);
712
635
  },
713
636
  complete: function complete(record, afterLoc) {
714
637
  if (record.type === "throw") {
715
638
  throw record.arg;
716
639
  }
717
-
718
640
  if (record.type === "break" || record.type === "continue") {
719
641
  this.next = record.arg;
720
642
  } else if (record.type === "return") {
@@ -724,13 +646,11 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
724
646
  } else if (record.type === "normal" && afterLoc) {
725
647
  this.next = afterLoc;
726
648
  }
727
-
728
649
  return ContinueSentinel;
729
650
  },
730
651
  finish: function finish(finallyLoc) {
731
652
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
732
653
  var entry = this.tryEntries[i];
733
-
734
654
  if (entry.finallyLoc === finallyLoc) {
735
655
  this.complete(entry.completion, entry.afterLoc);
736
656
  resetTryEntry(entry);
@@ -741,21 +661,18 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
741
661
  "catch": function _catch(tryLoc) {
742
662
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
743
663
  var entry = this.tryEntries[i];
744
-
745
664
  if (entry.tryLoc === tryLoc) {
746
665
  var record = entry.completion;
747
-
748
666
  if (record.type === "throw") {
749
667
  var thrown = record.arg;
750
668
  resetTryEntry(entry);
751
669
  }
752
-
753
670
  return thrown;
754
671
  }
755
- } // The context.catch method must only be called with a location
756
- // argument that corresponds to a known catch block.
757
-
672
+ }
758
673
 
674
+ // The context.catch method must only be called with a location
675
+ // argument that corresponds to a known catch block.
759
676
  throw new Error("illegal catch attempt");
760
677
  },
761
678
  delegateYield: function delegateYield(iterable, resultName, nextLoc) {
@@ -764,27 +681,26 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
764
681
  resultName: resultName,
765
682
  nextLoc: nextLoc
766
683
  };
767
-
768
684
  if (this.method === "next") {
769
685
  // Deliberately forget the last sent value so that we don't
770
686
  // accidentally pass it on to the delegate.
771
687
  this.arg = undefined$1;
772
688
  }
773
-
774
689
  return ContinueSentinel;
775
690
  }
776
- }; // Regardless of whether this script is executing as a CommonJS module
691
+ };
692
+
693
+ // Regardless of whether this script is executing as a CommonJS module
777
694
  // or not, return the runtime object so that we can declare the variable
778
695
  // regeneratorRuntime in the outer scope, which allows this module to be
779
696
  // injected easily by `bin/regenerator --include-runtime script.js`.
780
-
781
697
  return exports;
782
- }( // If this script is executing as a CommonJS module, use module.exports
698
+ }(
699
+ // If this script is executing as a CommonJS module, use module.exports
783
700
  // as the regeneratorRuntime namespace. Otherwise create a new empty
784
701
  // object. Either way, the resulting object will be used to initialize
785
702
  // the regeneratorRuntime variable at the top of this file.
786
703
  module.exports );
787
-
788
704
  try {
789
705
  regeneratorRuntime = runtime;
790
706
  } catch (accidentalStrictMode) {
@@ -807,19 +723,16 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
807
723
  });
808
724
 
809
725
  var secretRequire;
810
-
811
726
  try {
812
727
  // Secretly use require without webpack knowing
813
728
  secretRequire = /*#__PURE__*/eval('require');
814
729
  } catch (err) {
815
730
  secretRequire = undefined;
816
731
  }
817
-
818
732
  function serverRequire(module) {
819
733
  if (!secretRequire) {
820
734
  throw new Error("Unexpected serverRequire() -- can only do this from a Node server!");
821
735
  }
822
-
823
736
  return secretRequire(module);
824
737
  }
825
738
  function serverRequireFs() {
@@ -831,9 +744,7 @@ var FileCache = /*#__PURE__*/function () {
831
744
  this.filePath = filePath;
832
745
  console.log('USING cache', this.filePath);
833
746
  }
834
-
835
747
  var _proto = FileCache.prototype;
836
-
837
748
  _proto.get = /*#__PURE__*/function () {
838
749
  var _get = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
839
750
  var fs, data;
@@ -847,20 +758,16 @@ var FileCache = /*#__PURE__*/function () {
847
758
  return fs.promises.mkdir(path.dirname(this.filePath), {
848
759
  recursive: true
849
760
  });
850
-
851
761
  case 4:
852
762
  _context.next = 6;
853
763
  return fs.promises.readFile(this.filePath);
854
-
855
764
  case 6:
856
765
  data = _context.sent.toString();
857
766
  return _context.abrupt("return", JSON.parse(data));
858
-
859
767
  case 10:
860
768
  _context.prev = 10;
861
769
  _context.t0 = _context["catch"](1);
862
770
  return _context.abrupt("return", undefined);
863
-
864
771
  case 13:
865
772
  case "end":
866
773
  return _context.stop();
@@ -868,14 +775,11 @@ var FileCache = /*#__PURE__*/function () {
868
775
  }
869
776
  }, _callee, this, [[1, 10]]);
870
777
  }));
871
-
872
778
  function get() {
873
779
  return _get.apply(this, arguments);
874
780
  }
875
-
876
781
  return get;
877
782
  }();
878
-
879
783
  _proto.set = /*#__PURE__*/function () {
880
784
  var _set = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(data) {
881
785
  var fs;
@@ -887,16 +791,13 @@ var FileCache = /*#__PURE__*/function () {
887
791
  _context2.prev = 1;
888
792
  _context2.next = 4;
889
793
  return fs.promises.writeFile(this.filePath, JSON.stringify(data));
890
-
891
794
  case 4:
892
795
  _context2.next = 9;
893
796
  break;
894
-
895
797
  case 6:
896
798
  _context2.prev = 6;
897
799
  _context2.t0 = _context2["catch"](1);
898
800
  console.warn("Error writing to Plasmic cache: " + _context2.t0);
899
-
900
801
  case 9:
901
802
  case "end":
902
803
  return _context2.stop();
@@ -904,29 +805,23 @@ var FileCache = /*#__PURE__*/function () {
904
805
  }
905
806
  }, _callee2, this, [[1, 6]]);
906
807
  }));
907
-
908
808
  function set(_x) {
909
809
  return _set.apply(this, arguments);
910
810
  }
911
-
912
811
  return set;
913
812
  }();
914
-
915
813
  _proto.clear = function clear() {
916
814
  var fs = serverRequireFs();
917
-
918
815
  try {
919
816
  fs.unlinkSync(this.filePath);
920
817
  } catch (err) {}
921
818
  };
922
-
923
819
  return FileCache;
924
820
  }();
925
821
  function makeCache(opts) {
926
822
  var cacheDir = path.resolve(process.cwd(), '.next', '.plasmic');
927
823
  var cachePath = path.join(cacheDir, "plasmic-" + [].concat(opts.projects.map(function (p) {
928
824
  var _p$version;
929
-
930
825
  return p.id + "@" + ((_p$version = p.version) != null ? _p$version : '');
931
826
  })).sort().join('-') + (opts.preview ? '-preview' : '') + "-cache.json");
932
827
  return new FileCache(cachePath);
@@ -934,13 +829,10 @@ function makeCache(opts) {
934
829
 
935
830
  var NextJsPlasmicComponentLoader = /*#__PURE__*/function (_PlasmicComponentLoad) {
936
831
  _inheritsLoose(NextJsPlasmicComponentLoader, _PlasmicComponentLoad);
937
-
938
832
  function NextJsPlasmicComponentLoader(internal) {
939
833
  return _PlasmicComponentLoad.call(this, internal) || this;
940
834
  }
941
-
942
835
  var _proto = NextJsPlasmicComponentLoader.prototype;
943
-
944
836
  _proto.getActiveVariation = /*#__PURE__*/function () {
945
837
  var _getActiveVariation = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(opts) {
946
838
  var extractBuiltinTraits;
@@ -950,43 +842,36 @@ var NextJsPlasmicComponentLoader = /*#__PURE__*/function (_PlasmicComponentLoad)
950
842
  case 0:
951
843
  extractBuiltinTraits = function extractBuiltinTraits() {
952
844
  var _opts$req$url, _opts$req, _opts$req$headers$hos, _opts$req2;
953
-
954
845
  var url = new URL((_opts$req$url = (_opts$req = opts.req) == null ? void 0 : _opts$req.url) != null ? _opts$req$url : '/', "https://" + ((_opts$req$headers$hos = (_opts$req2 = opts.req) == null ? void 0 : _opts$req2.headers.host) != null ? _opts$req$headers$hos : 'server.side'));
955
846
  return {
956
847
  pageUrl: url.href
957
848
  };
958
849
  };
959
-
960
850
  return _context.abrupt("return", this._getActiveVariation({
961
851
  traits: _extends({}, extractBuiltinTraits(), opts.traits),
962
852
  getKnownValue: function getKnownValue(key) {
963
853
  if (opts.known) {
964
854
  return opts.known[key];
965
855
  } else {
966
- var _opts$req$cookies$, _opts$req3;
967
-
968
- return (_opts$req$cookies$ = (_opts$req3 = opts.req) == null ? void 0 : _opts$req3.cookies["plasmic:" + key]) != null ? _opts$req$cookies$ : undefined;
856
+ var _opts$req$cookies, _opts$req3;
857
+ return (_opts$req$cookies = (_opts$req3 = opts.req) == null ? void 0 : _opts$req3.cookies["plasmic:" + key]) != null ? _opts$req$cookies : undefined;
969
858
  }
970
859
  },
971
860
  updateKnownValue: function updateKnownValue(key, value) {
972
861
  if (opts.res) {
973
862
  var _opts$res$getHeader, _opts$res, _opts$res2;
974
-
975
863
  var cookie = "plasmic:" + key + "=" + value;
976
864
  var resCookie = (_opts$res$getHeader = (_opts$res = opts.res) == null ? void 0 : _opts$res.getHeader('Set-Cookie')) != null ? _opts$res$getHeader : [];
977
865
  var newCookies = [];
978
-
979
866
  if (Array.isArray(resCookie)) {
980
867
  newCookies = [].concat(resCookie, ["plasmic:" + key + "=" + value]);
981
868
  } else {
982
869
  newCookies = ["" + resCookie, cookie];
983
870
  }
984
-
985
871
  (_opts$res2 = opts.res) == null ? void 0 : _opts$res2.setHeader('Set-Cookie', newCookies);
986
872
  }
987
873
  }
988
874
  }));
989
-
990
875
  case 2:
991
876
  case "end":
992
877
  return _context.stop();
@@ -994,22 +879,17 @@ var NextJsPlasmicComponentLoader = /*#__PURE__*/function (_PlasmicComponentLoad)
994
879
  }
995
880
  }, _callee, this);
996
881
  }));
997
-
998
882
  function getActiveVariation(_x) {
999
883
  return _getActiveVariation.apply(this, arguments);
1000
884
  }
1001
-
1002
885
  return getActiveVariation;
1003
886
  }();
1004
-
1005
887
  return NextJsPlasmicComponentLoader;
1006
888
  }(PlasmicComponentLoader);
1007
-
1008
889
  var initPlasmicLoaderNext = function initPlasmicLoaderNext(opts) {
1009
890
  var internal = new InternalPlasmicComponentLoader(opts);
1010
891
  return new NextJsPlasmicComponentLoader(internal);
1011
892
  };
1012
-
1013
893
  function initPlasmicLoader(opts) {
1014
894
  var isBrowser = typeof window !== 'undefined';
1015
895
  var isProd = process.env.NODE_ENV === 'production';
@@ -1029,34 +909,28 @@ function initPlasmicLoader(opts) {
1029
909
  'next/link': NextLink,
1030
910
  'next/router': NextRouter
1031
911
  });
1032
-
1033
912
  if (!isProd) {
1034
913
  var stringOpts = JSON.stringify(opts);
1035
-
1036
914
  if (process.env.PLASMIC_OPTS && process.env.PLASMIC_OPTS !== stringOpts) {
1037
915
  console.warn("PLASMIC: We detected that you created a new PlasmicLoader with different configurations. You may need to restart your dev server.\n");
1038
916
  }
1039
-
1040
917
  process.env.PLASMIC_OPTS = stringOpts;
1041
918
  }
1042
-
1043
919
  if (cache) {
1044
920
  if (!isProd) {
1045
921
  if (process.env.PLASMIC_WATCHED !== 'true') {
1046
922
  process.env.PLASMIC_WATCHED = 'true';
1047
- console.log("Subscribing to Plasmic changes..."); // Import using serverRequire, so webpack doesn't bundle us into client bundle
1048
-
923
+ console.log("Subscribing to Plasmic changes...");
924
+ // Import using serverRequire, so webpack doesn't bundle us into client bundle
1049
925
  var PlasmicRemoteChangeWatcher = serverRequire('@plasmicapp/watcher').PlasmicRemoteChangeWatcher;
1050
926
  var watcher = new PlasmicRemoteChangeWatcher({
1051
927
  projects: opts.projects,
1052
928
  host: opts.host
1053
929
  });
1054
-
1055
930
  var clearCache = function clearCache() {
1056
931
  cache.clear();
1057
932
  loader.clearCache();
1058
933
  };
1059
-
1060
934
  watcher.subscribe({
1061
935
  onUpdate: function onUpdate() {
1062
936
  if (opts.preview) {
@@ -1075,7 +949,6 @@ function initPlasmicLoader(opts) {
1075
949
  loader.clearCache();
1076
950
  }
1077
951
  }
1078
-
1079
952
  return loader;
1080
953
  }
1081
954
  function PlasmicRootProvider(props) {