@plasmicapp/data-sources 0.1.21 → 0.1.23

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