@plasmicpkgs/plasmic-query 0.0.2 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plasmic-query.cjs.development.js +596 -620
- package/dist/plasmic-query.cjs.development.js.map +1 -1
- package/dist/plasmic-query.cjs.production.min.js +1 -1
- package/dist/plasmic-query.cjs.production.min.js.map +1 -1
- package/dist/plasmic-query.esm.js +595 -619
- package/dist/plasmic-query.esm.js.map +1 -1
- package/package.json +4 -4
|
@@ -6,7 +6,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
6
6
|
|
|
7
7
|
var registerComponent = _interopDefault(require('@plasmicapp/host/registerComponent'));
|
|
8
8
|
var query = require('@plasmicapp/query');
|
|
9
|
-
var
|
|
9
|
+
var host = require('@plasmicapp/host');
|
|
10
10
|
var React = _interopDefault(require('react'));
|
|
11
11
|
|
|
12
12
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -64,200 +64,198 @@ function createCommonjsModule(fn, module) {
|
|
|
64
64
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
var runtime_1 = createCommonjsModule(function (module) {
|
|
68
|
-
/**
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
try {
|
|
95
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
96
|
-
define({}, "");
|
|
97
|
-
} catch (err) {
|
|
98
|
-
define = function(obj, key, value) {
|
|
99
|
-
return obj[key] = value;
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
104
|
-
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
105
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
106
|
-
var generator = Object.create(protoGenerator.prototype);
|
|
107
|
-
var context = new Context(tryLocsList || []);
|
|
108
|
-
|
|
109
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
110
|
-
// .throw, and .return methods.
|
|
111
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
67
|
+
var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
68
|
+
/**
|
|
69
|
+
* Copyright (c) 2014-present, Facebook, Inc.
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the MIT license found in the
|
|
72
|
+
* LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/
|
|
74
|
+
var runtime = function (exports) {
|
|
75
|
+
|
|
76
|
+
var Op = Object.prototype;
|
|
77
|
+
var hasOwn = Op.hasOwnProperty;
|
|
78
|
+
var undefined$1; // More compressible than void 0.
|
|
79
|
+
|
|
80
|
+
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
81
|
+
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
82
|
+
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
83
|
+
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
84
|
+
|
|
85
|
+
function define(obj, key, value) {
|
|
86
|
+
Object.defineProperty(obj, key, {
|
|
87
|
+
value: value,
|
|
88
|
+
enumerable: true,
|
|
89
|
+
configurable: true,
|
|
90
|
+
writable: true
|
|
91
|
+
});
|
|
92
|
+
return obj[key];
|
|
93
|
+
}
|
|
112
94
|
|
|
113
|
-
return generator;
|
|
114
|
-
}
|
|
115
|
-
exports.wrap = wrap;
|
|
116
|
-
|
|
117
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
118
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
119
|
-
// have been (and was previously) designed to take a closure to be
|
|
120
|
-
// invoked without arguments, but in all the cases we care about we
|
|
121
|
-
// already have an existing method we want to call, so there's no need
|
|
122
|
-
// to create a new function object. We can even get away with assuming
|
|
123
|
-
// the method takes exactly one argument, since that happens to be true
|
|
124
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
125
|
-
// only additional allocation required is the completion record, which
|
|
126
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
127
|
-
function tryCatch(fn, obj, arg) {
|
|
128
95
|
try {
|
|
129
|
-
|
|
96
|
+
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
97
|
+
define({}, "");
|
|
130
98
|
} catch (err) {
|
|
131
|
-
|
|
99
|
+
define = function define(obj, key, value) {
|
|
100
|
+
return obj[key] = value;
|
|
101
|
+
};
|
|
132
102
|
}
|
|
133
|
-
}
|
|
134
103
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
// breaking out of the dispatch switch statement.
|
|
142
|
-
var ContinueSentinel = {};
|
|
143
|
-
|
|
144
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
145
|
-
// .constructor.prototype properties for functions that return Generator
|
|
146
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
147
|
-
// minifier not to mangle the names of these two functions.
|
|
148
|
-
function Generator() {}
|
|
149
|
-
function GeneratorFunction() {}
|
|
150
|
-
function GeneratorFunctionPrototype() {}
|
|
151
|
-
|
|
152
|
-
// This is a polyfill for %IteratorPrototype% for environments that
|
|
153
|
-
// don't natively support it.
|
|
154
|
-
var IteratorPrototype = {};
|
|
155
|
-
IteratorPrototype[iteratorSymbol] = function () {
|
|
156
|
-
return this;
|
|
157
|
-
};
|
|
104
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
105
|
+
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
106
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
107
|
+
var generator = Object.create(protoGenerator.prototype);
|
|
108
|
+
var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
|
|
109
|
+
// .throw, and .return methods.
|
|
158
110
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
NativeIteratorPrototype !== Op &&
|
|
163
|
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
164
|
-
// This environment has a native %IteratorPrototype%; use it instead
|
|
165
|
-
// of the polyfill.
|
|
166
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
167
|
-
}
|
|
111
|
+
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
112
|
+
return generator;
|
|
113
|
+
}
|
|
168
114
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
115
|
+
exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
|
|
116
|
+
// record like context.tryEntries[i].completion. This interface could
|
|
117
|
+
// have been (and was previously) designed to take a closure to be
|
|
118
|
+
// invoked without arguments, but in all the cases we care about we
|
|
119
|
+
// already have an existing method we want to call, so there's no need
|
|
120
|
+
// to create a new function object. We can even get away with assuming
|
|
121
|
+
// the method takes exactly one argument, since that happens to be true
|
|
122
|
+
// in every case, so we don't have to touch the arguments object. The
|
|
123
|
+
// only additional allocation required is the completion record, which
|
|
124
|
+
// has a stable shape and so hopefully should be cheap to allocate.
|
|
125
|
+
|
|
126
|
+
function tryCatch(fn, obj, arg) {
|
|
127
|
+
try {
|
|
128
|
+
return {
|
|
129
|
+
type: "normal",
|
|
130
|
+
arg: fn.call(obj, arg)
|
|
131
|
+
};
|
|
132
|
+
} catch (err) {
|
|
133
|
+
return {
|
|
134
|
+
type: "throw",
|
|
135
|
+
arg: err
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
var GenStateSuspendedStart = "suspendedStart";
|
|
141
|
+
var GenStateSuspendedYield = "suspendedYield";
|
|
142
|
+
var GenStateExecuting = "executing";
|
|
143
|
+
var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
|
|
144
|
+
// breaking out of the dispatch switch statement.
|
|
145
|
+
|
|
146
|
+
var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
|
|
147
|
+
// .constructor.prototype properties for functions that return Generator
|
|
148
|
+
// objects. For full spec compliance, you may wish to configure your
|
|
149
|
+
// minifier not to mangle the names of these two functions.
|
|
150
|
+
|
|
151
|
+
function Generator() {}
|
|
152
|
+
|
|
153
|
+
function GeneratorFunction() {}
|
|
154
|
+
|
|
155
|
+
function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
|
|
156
|
+
// don't natively support it.
|
|
188
157
|
|
|
189
|
-
exports.isGeneratorFunction = function(genFun) {
|
|
190
|
-
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
191
|
-
return ctor
|
|
192
|
-
? ctor === GeneratorFunction ||
|
|
193
|
-
// For the native GeneratorFunction constructor, the best we can
|
|
194
|
-
// do is to check its .name property.
|
|
195
|
-
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
196
|
-
: false;
|
|
197
|
-
};
|
|
198
158
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
159
|
+
var IteratorPrototype = {};
|
|
160
|
+
|
|
161
|
+
IteratorPrototype[iteratorSymbol] = function () {
|
|
162
|
+
return this;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
var getProto = Object.getPrototypeOf;
|
|
166
|
+
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
167
|
+
|
|
168
|
+
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
169
|
+
// This environment has a native %IteratorPrototype%; use it instead
|
|
170
|
+
// of the polyfill.
|
|
171
|
+
IteratorPrototype = NativeIteratorPrototype;
|
|
205
172
|
}
|
|
206
|
-
genFun.prototype = Object.create(Gp);
|
|
207
|
-
return genFun;
|
|
208
|
-
};
|
|
209
173
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
return { __await: arg };
|
|
216
|
-
};
|
|
174
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
175
|
+
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
|
176
|
+
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
|
177
|
+
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
|
|
178
|
+
// Iterator interface in terms of a single ._invoke method.
|
|
217
179
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
180
|
+
function defineIteratorMethods(prototype) {
|
|
181
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
182
|
+
define(prototype, method, function (arg) {
|
|
183
|
+
return this._invoke(method, arg);
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
exports.isGeneratorFunction = function (genFun) {
|
|
189
|
+
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
190
|
+
return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
|
|
191
|
+
// do is to check its .name property.
|
|
192
|
+
(ctor.displayName || ctor.name) === "GeneratorFunction" : false;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
exports.mark = function (genFun) {
|
|
196
|
+
if (Object.setPrototypeOf) {
|
|
197
|
+
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
223
198
|
} else {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
199
|
+
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
200
|
+
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
genFun.prototype = Object.create(Gp);
|
|
204
|
+
return genFun;
|
|
205
|
+
}; // Within the body of any async function, `await x` is transformed to
|
|
206
|
+
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
207
|
+
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
208
|
+
// meant to be awaited.
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
exports.awrap = function (arg) {
|
|
212
|
+
return {
|
|
213
|
+
__await: arg
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
218
|
+
function invoke(method, arg, resolve, reject) {
|
|
219
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
220
|
+
|
|
221
|
+
if (record.type === "throw") {
|
|
222
|
+
reject(record.arg);
|
|
223
|
+
} else {
|
|
224
|
+
var result = record.arg;
|
|
225
|
+
var value = result.value;
|
|
226
|
+
|
|
227
|
+
if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
|
|
228
|
+
return PromiseImpl.resolve(value.__await).then(function (value) {
|
|
229
|
+
invoke("next", value, resolve, reject);
|
|
230
|
+
}, function (err) {
|
|
231
|
+
invoke("throw", err, resolve, reject);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
236
|
+
// When a yielded Promise is resolved, its final value becomes
|
|
237
|
+
// the .value of the Promise<{value,done}> result for the
|
|
238
|
+
// current iteration.
|
|
239
|
+
result.value = unwrapped;
|
|
240
|
+
resolve(result);
|
|
241
|
+
}, function (error) {
|
|
242
|
+
// If a rejected Promise was yielded, throw the rejection back
|
|
243
|
+
// into the async generator function so it can be handled there.
|
|
244
|
+
return invoke("throw", error, resolve, reject);
|
|
233
245
|
});
|
|
234
246
|
}
|
|
235
|
-
|
|
236
|
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
237
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
238
|
-
// the .value of the Promise<{value,done}> result for the
|
|
239
|
-
// current iteration.
|
|
240
|
-
result.value = unwrapped;
|
|
241
|
-
resolve(result);
|
|
242
|
-
}, function(error) {
|
|
243
|
-
// If a rejected Promise was yielded, throw the rejection back
|
|
244
|
-
// into the async generator function so it can be handled there.
|
|
245
|
-
return invoke("throw", error, resolve, reject);
|
|
246
|
-
});
|
|
247
247
|
}
|
|
248
|
-
}
|
|
249
248
|
|
|
250
|
-
|
|
249
|
+
var previousPromise;
|
|
251
250
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
251
|
+
function enqueue(method, arg) {
|
|
252
|
+
function callInvokeWithMethodAndArg() {
|
|
253
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
254
|
+
invoke(method, arg, resolve, reject);
|
|
255
|
+
});
|
|
256
|
+
}
|
|
258
257
|
|
|
259
|
-
|
|
260
|
-
// If enqueue has been called before, then we want to wait until
|
|
258
|
+
return previousPromise = // If enqueue has been called before, then we want to wait until
|
|
261
259
|
// all previous Promises have been resolved before calling invoke,
|
|
262
260
|
// so that results are always delivered in the correct order. If
|
|
263
261
|
// enqueue has not been called before, then it is important to
|
|
@@ -269,551 +267,529 @@ var runtime = (function (exports) {
|
|
|
269
267
|
// execute code before the first await. Since we implement simple
|
|
270
268
|
// async functions in terms of async generators, it is especially
|
|
271
269
|
// important to get this right, even though it requires care.
|
|
272
|
-
previousPromise ? previousPromise.then(
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
270
|
+
previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
|
|
271
|
+
// invocations of the iterator.
|
|
272
|
+
callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
273
|
+
} // Define the unified helper method that is used to implement .next,
|
|
274
|
+
// .throw, and .return (see defineIteratorMethods).
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
this._invoke = enqueue;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
|
|
281
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
282
|
-
this._invoke = enqueue;
|
|
283
|
-
}
|
|
280
|
+
defineIteratorMethods(AsyncIterator.prototype);
|
|
284
281
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
};
|
|
289
|
-
exports.AsyncIterator = AsyncIterator;
|
|
290
|
-
|
|
291
|
-
// Note that simple async functions are implemented on top of
|
|
292
|
-
// AsyncIterator objects; they just return a Promise for the value of
|
|
293
|
-
// the final result produced by the iterator.
|
|
294
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
295
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
296
|
-
|
|
297
|
-
var iter = new AsyncIterator(
|
|
298
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
299
|
-
PromiseImpl
|
|
300
|
-
);
|
|
301
|
-
|
|
302
|
-
return exports.isGeneratorFunction(outerFn)
|
|
303
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
304
|
-
: iter.next().then(function(result) {
|
|
305
|
-
return result.done ? result.value : iter.next();
|
|
306
|
-
});
|
|
307
|
-
};
|
|
282
|
+
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
283
|
+
return this;
|
|
284
|
+
};
|
|
308
285
|
|
|
309
|
-
|
|
310
|
-
|
|
286
|
+
exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
|
|
287
|
+
// AsyncIterator objects; they just return a Promise for the value of
|
|
288
|
+
// the final result produced by the iterator.
|
|
311
289
|
|
|
312
|
-
|
|
313
|
-
if (
|
|
314
|
-
|
|
315
|
-
|
|
290
|
+
exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
291
|
+
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
292
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
293
|
+
return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
|
|
294
|
+
: iter.next().then(function (result) {
|
|
295
|
+
return result.done ? result.value : iter.next();
|
|
296
|
+
});
|
|
297
|
+
};
|
|
316
298
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
299
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
300
|
+
var state = GenStateSuspendedStart;
|
|
301
|
+
return function invoke(method, arg) {
|
|
302
|
+
if (state === GenStateExecuting) {
|
|
303
|
+
throw new Error("Generator is already running");
|
|
320
304
|
}
|
|
321
305
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
306
|
+
if (state === GenStateCompleted) {
|
|
307
|
+
if (method === "throw") {
|
|
308
|
+
throw arg;
|
|
309
|
+
} // Be forgiving, per 25.3.3.3.3 of the spec:
|
|
310
|
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
326
311
|
|
|
327
|
-
context.method = method;
|
|
328
|
-
context.arg = arg;
|
|
329
312
|
|
|
330
|
-
|
|
331
|
-
var delegate = context.delegate;
|
|
332
|
-
if (delegate) {
|
|
333
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
334
|
-
if (delegateResult) {
|
|
335
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
336
|
-
return delegateResult;
|
|
337
|
-
}
|
|
313
|
+
return doneResult();
|
|
338
314
|
}
|
|
339
315
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
// function.sent implementation.
|
|
343
|
-
context.sent = context._sent = context.arg;
|
|
316
|
+
context.method = method;
|
|
317
|
+
context.arg = arg;
|
|
344
318
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
319
|
+
while (true) {
|
|
320
|
+
var delegate = context.delegate;
|
|
321
|
+
|
|
322
|
+
if (delegate) {
|
|
323
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
324
|
+
|
|
325
|
+
if (delegateResult) {
|
|
326
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
327
|
+
return delegateResult;
|
|
328
|
+
}
|
|
349
329
|
}
|
|
350
330
|
|
|
351
|
-
|
|
331
|
+
if (context.method === "next") {
|
|
332
|
+
// Setting context._sent for legacy support of Babel's
|
|
333
|
+
// function.sent implementation.
|
|
334
|
+
context.sent = context._sent = context.arg;
|
|
335
|
+
} else if (context.method === "throw") {
|
|
336
|
+
if (state === GenStateSuspendedStart) {
|
|
337
|
+
state = GenStateCompleted;
|
|
338
|
+
throw context.arg;
|
|
339
|
+
}
|
|
352
340
|
|
|
353
|
-
|
|
354
|
-
context.
|
|
355
|
-
|
|
341
|
+
context.dispatchException(context.arg);
|
|
342
|
+
} else if (context.method === "return") {
|
|
343
|
+
context.abrupt("return", context.arg);
|
|
344
|
+
}
|
|
356
345
|
|
|
357
|
-
|
|
346
|
+
state = GenStateExecuting;
|
|
347
|
+
var record = tryCatch(innerFn, self, context);
|
|
358
348
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
state = context.done
|
|
364
|
-
? GenStateCompleted
|
|
365
|
-
: GenStateSuspendedYield;
|
|
349
|
+
if (record.type === "normal") {
|
|
350
|
+
// If an exception is thrown from innerFn, we leave state ===
|
|
351
|
+
// GenStateExecuting and loop back for another invocation.
|
|
352
|
+
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
|
|
366
353
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
354
|
+
if (record.arg === ContinueSentinel) {
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
370
357
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
358
|
+
return {
|
|
359
|
+
value: record.arg,
|
|
360
|
+
done: context.done
|
|
361
|
+
};
|
|
362
|
+
} else if (record.type === "throw") {
|
|
363
|
+
state = GenStateCompleted; // Dispatch the exception by looping back around to the
|
|
364
|
+
// context.dispatchException(context.arg) call above.
|
|
365
|
+
|
|
366
|
+
context.method = "throw";
|
|
367
|
+
context.arg = record.arg;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
} // Call delegate.iterator[context.method](context.arg) and handle the
|
|
372
|
+
// result, either by returning a { value, done } result from the
|
|
373
|
+
// delegate iterator, or by modifying context.method and context.arg,
|
|
374
|
+
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
378
|
+
var method = delegate.iterator[context.method];
|
|
379
|
+
|
|
380
|
+
if (method === undefined$1) {
|
|
381
|
+
// A .throw or .return when the delegate iterator has no .throw
|
|
382
|
+
// method always terminates the yield* loop.
|
|
383
|
+
context.delegate = null;
|
|
384
|
+
|
|
385
|
+
if (context.method === "throw") {
|
|
386
|
+
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
387
|
+
if (delegate.iterator["return"]) {
|
|
388
|
+
// If the delegate iterator has a return method, give it a
|
|
389
|
+
// chance to clean up.
|
|
390
|
+
context.method = "return";
|
|
391
|
+
context.arg = undefined$1;
|
|
392
|
+
maybeInvokeDelegate(delegate, context);
|
|
393
|
+
|
|
394
|
+
if (context.method === "throw") {
|
|
395
|
+
// If maybeInvokeDelegate(context) changed context.method from
|
|
396
|
+
// "return" to "throw", let that override the TypeError below.
|
|
397
|
+
return ContinueSentinel;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
375
400
|
|
|
376
|
-
} else if (record.type === "throw") {
|
|
377
|
-
state = GenStateCompleted;
|
|
378
|
-
// Dispatch the exception by looping back around to the
|
|
379
|
-
// context.dispatchException(context.arg) call above.
|
|
380
401
|
context.method = "throw";
|
|
381
|
-
context.arg =
|
|
402
|
+
context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
382
403
|
}
|
|
404
|
+
|
|
405
|
+
return ContinueSentinel;
|
|
383
406
|
}
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
407
|
|
|
387
|
-
|
|
388
|
-
// result, either by returning a { value, done } result from the
|
|
389
|
-
// delegate iterator, or by modifying context.method and context.arg,
|
|
390
|
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
391
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
392
|
-
var method = delegate.iterator[context.method];
|
|
393
|
-
if (method === undefined$1) {
|
|
394
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
395
|
-
// method always terminates the yield* loop.
|
|
396
|
-
context.delegate = null;
|
|
408
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
397
409
|
|
|
398
|
-
if (
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
context.arg = undefined$1;
|
|
405
|
-
maybeInvokeDelegate(delegate, context);
|
|
410
|
+
if (record.type === "throw") {
|
|
411
|
+
context.method = "throw";
|
|
412
|
+
context.arg = record.arg;
|
|
413
|
+
context.delegate = null;
|
|
414
|
+
return ContinueSentinel;
|
|
415
|
+
}
|
|
406
416
|
|
|
407
|
-
|
|
408
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
409
|
-
// "return" to "throw", let that override the TypeError below.
|
|
410
|
-
return ContinueSentinel;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
417
|
+
var info = record.arg;
|
|
413
418
|
|
|
419
|
+
if (!info) {
|
|
414
420
|
context.method = "throw";
|
|
415
|
-
context.arg = new TypeError(
|
|
416
|
-
|
|
421
|
+
context.arg = new TypeError("iterator result is not an object");
|
|
422
|
+
context.delegate = null;
|
|
423
|
+
return ContinueSentinel;
|
|
417
424
|
}
|
|
418
425
|
|
|
419
|
-
|
|
420
|
-
|
|
426
|
+
if (info.done) {
|
|
427
|
+
// Assign the result of the finished delegate to the temporary
|
|
428
|
+
// variable specified by delegate.resultName (see delegateYield).
|
|
429
|
+
context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
|
|
421
430
|
|
|
422
|
-
|
|
431
|
+
context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
|
|
432
|
+
// exception, let the outer generator proceed normally. If
|
|
433
|
+
// context.method was "next", forget context.arg since it has been
|
|
434
|
+
// "consumed" by the delegate iterator. If context.method was
|
|
435
|
+
// "return", allow the original .return call to continue in the
|
|
436
|
+
// outer generator.
|
|
423
437
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
438
|
+
if (context.method !== "return") {
|
|
439
|
+
context.method = "next";
|
|
440
|
+
context.arg = undefined$1;
|
|
441
|
+
}
|
|
442
|
+
} else {
|
|
443
|
+
// Re-yield the result returned by the delegate method.
|
|
444
|
+
return info;
|
|
445
|
+
} // The delegate iterator is finished, so forget it and continue with
|
|
446
|
+
// the outer generator.
|
|
430
447
|
|
|
431
|
-
var info = record.arg;
|
|
432
448
|
|
|
433
|
-
if (! info) {
|
|
434
|
-
context.method = "throw";
|
|
435
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
436
449
|
context.delegate = null;
|
|
437
450
|
return ContinueSentinel;
|
|
438
|
-
}
|
|
451
|
+
} // Define Generator.prototype.{next,throw,return} in terms of the
|
|
452
|
+
// unified ._invoke helper method.
|
|
439
453
|
|
|
440
|
-
if (info.done) {
|
|
441
|
-
// Assign the result of the finished delegate to the temporary
|
|
442
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
443
|
-
context[delegate.resultName] = info.value;
|
|
444
|
-
|
|
445
|
-
// Resume execution at the desired location (see delegateYield).
|
|
446
|
-
context.next = delegate.nextLoc;
|
|
447
|
-
|
|
448
|
-
// If context.method was "throw" but the delegate handled the
|
|
449
|
-
// exception, let the outer generator proceed normally. If
|
|
450
|
-
// context.method was "next", forget context.arg since it has been
|
|
451
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
452
|
-
// "return", allow the original .return call to continue in the
|
|
453
|
-
// outer generator.
|
|
454
|
-
if (context.method !== "return") {
|
|
455
|
-
context.method = "next";
|
|
456
|
-
context.arg = undefined$1;
|
|
457
|
-
}
|
|
458
454
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
455
|
+
defineIteratorMethods(Gp);
|
|
456
|
+
define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
|
|
457
|
+
// @@iterator function is called on it. Some browsers' implementations of the
|
|
458
|
+
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
459
|
+
// object to not be returned from this call. This ensures that doesn't happen.
|
|
460
|
+
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
463
461
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
return ContinueSentinel;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
471
|
-
// unified ._invoke helper method.
|
|
472
|
-
defineIteratorMethods(Gp);
|
|
462
|
+
Gp[iteratorSymbol] = function () {
|
|
463
|
+
return this;
|
|
464
|
+
};
|
|
473
465
|
|
|
474
|
-
|
|
466
|
+
Gp.toString = function () {
|
|
467
|
+
return "[object Generator]";
|
|
468
|
+
};
|
|
475
469
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
481
|
-
Gp[iteratorSymbol] = function() {
|
|
482
|
-
return this;
|
|
483
|
-
};
|
|
470
|
+
function pushTryEntry(locs) {
|
|
471
|
+
var entry = {
|
|
472
|
+
tryLoc: locs[0]
|
|
473
|
+
};
|
|
484
474
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
475
|
+
if (1 in locs) {
|
|
476
|
+
entry.catchLoc = locs[1];
|
|
477
|
+
}
|
|
488
478
|
|
|
489
|
-
|
|
490
|
-
|
|
479
|
+
if (2 in locs) {
|
|
480
|
+
entry.finallyLoc = locs[2];
|
|
481
|
+
entry.afterLoc = locs[3];
|
|
482
|
+
}
|
|
491
483
|
|
|
492
|
-
|
|
493
|
-
entry.catchLoc = locs[1];
|
|
484
|
+
this.tryEntries.push(entry);
|
|
494
485
|
}
|
|
495
486
|
|
|
496
|
-
|
|
497
|
-
entry.
|
|
498
|
-
|
|
487
|
+
function resetTryEntry(entry) {
|
|
488
|
+
var record = entry.completion || {};
|
|
489
|
+
record.type = "normal";
|
|
490
|
+
delete record.arg;
|
|
491
|
+
entry.completion = record;
|
|
499
492
|
}
|
|
500
493
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
function Context(tryLocsList) {
|
|
512
|
-
// The root entry object (effectively a try statement without a catch
|
|
513
|
-
// or a finally block) gives us a place to store values thrown from
|
|
514
|
-
// locations where there is no enclosing try statement.
|
|
515
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
516
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
517
|
-
this.reset(true);
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
exports.keys = function(object) {
|
|
521
|
-
var keys = [];
|
|
522
|
-
for (var key in object) {
|
|
523
|
-
keys.push(key);
|
|
494
|
+
function Context(tryLocsList) {
|
|
495
|
+
// The root entry object (effectively a try statement without a catch
|
|
496
|
+
// or a finally block) gives us a place to store values thrown from
|
|
497
|
+
// locations where there is no enclosing try statement.
|
|
498
|
+
this.tryEntries = [{
|
|
499
|
+
tryLoc: "root"
|
|
500
|
+
}];
|
|
501
|
+
tryLocsList.forEach(pushTryEntry, this);
|
|
502
|
+
this.reset(true);
|
|
524
503
|
}
|
|
525
|
-
keys.reverse();
|
|
526
|
-
|
|
527
|
-
// Rather than returning an object with a next method, we keep
|
|
528
|
-
// things simple and return the next function itself.
|
|
529
|
-
return function next() {
|
|
530
|
-
while (keys.length) {
|
|
531
|
-
var key = keys.pop();
|
|
532
|
-
if (key in object) {
|
|
533
|
-
next.value = key;
|
|
534
|
-
next.done = false;
|
|
535
|
-
return next;
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
504
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
// also ensures that the minifier will not anonymize the function.
|
|
542
|
-
next.done = true;
|
|
543
|
-
return next;
|
|
544
|
-
};
|
|
545
|
-
};
|
|
505
|
+
exports.keys = function (object) {
|
|
506
|
+
var keys = [];
|
|
546
507
|
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
550
|
-
if (iteratorMethod) {
|
|
551
|
-
return iteratorMethod.call(iterable);
|
|
508
|
+
for (var key in object) {
|
|
509
|
+
keys.push(key);
|
|
552
510
|
}
|
|
553
511
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
if (!isNaN(iterable.length)) {
|
|
559
|
-
var i = -1, next = function next() {
|
|
560
|
-
while (++i < iterable.length) {
|
|
561
|
-
if (hasOwn.call(iterable, i)) {
|
|
562
|
-
next.value = iterable[i];
|
|
563
|
-
next.done = false;
|
|
564
|
-
return next;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
512
|
+
keys.reverse(); // Rather than returning an object with a next method, we keep
|
|
513
|
+
// things simple and return the next function itself.
|
|
567
514
|
|
|
568
|
-
|
|
569
|
-
|
|
515
|
+
return function next() {
|
|
516
|
+
while (keys.length) {
|
|
517
|
+
var key = keys.pop();
|
|
570
518
|
|
|
571
|
-
|
|
572
|
-
|
|
519
|
+
if (key in object) {
|
|
520
|
+
next.value = key;
|
|
521
|
+
next.done = false;
|
|
522
|
+
return next;
|
|
523
|
+
}
|
|
524
|
+
} // To avoid creating an additional object, we just hang the .value
|
|
525
|
+
// and .done properties off the next function object itself. This
|
|
526
|
+
// also ensures that the minifier will not anonymize the function.
|
|
573
527
|
|
|
574
|
-
return next.next = next;
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
528
|
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
529
|
+
next.done = true;
|
|
530
|
+
return next;
|
|
531
|
+
};
|
|
532
|
+
};
|
|
582
533
|
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
534
|
+
function values(iterable) {
|
|
535
|
+
if (iterable) {
|
|
536
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
586
537
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
reset: function(skipTempReset) {
|
|
591
|
-
this.prev = 0;
|
|
592
|
-
this.next = 0;
|
|
593
|
-
// Resetting context._sent for legacy support of Babel's
|
|
594
|
-
// function.sent implementation.
|
|
595
|
-
this.sent = this._sent = undefined$1;
|
|
596
|
-
this.done = false;
|
|
597
|
-
this.delegate = null;
|
|
598
|
-
|
|
599
|
-
this.method = "next";
|
|
600
|
-
this.arg = undefined$1;
|
|
601
|
-
|
|
602
|
-
this.tryEntries.forEach(resetTryEntry);
|
|
603
|
-
|
|
604
|
-
if (!skipTempReset) {
|
|
605
|
-
for (var name in this) {
|
|
606
|
-
// Not sure about the optimal order of these conditions:
|
|
607
|
-
if (name.charAt(0) === "t" &&
|
|
608
|
-
hasOwn.call(this, name) &&
|
|
609
|
-
!isNaN(+name.slice(1))) {
|
|
610
|
-
this[name] = undefined$1;
|
|
611
|
-
}
|
|
538
|
+
if (iteratorMethod) {
|
|
539
|
+
return iteratorMethod.call(iterable);
|
|
612
540
|
}
|
|
613
|
-
}
|
|
614
|
-
},
|
|
615
|
-
|
|
616
|
-
stop: function() {
|
|
617
|
-
this.done = true;
|
|
618
|
-
|
|
619
|
-
var rootEntry = this.tryEntries[0];
|
|
620
|
-
var rootRecord = rootEntry.completion;
|
|
621
|
-
if (rootRecord.type === "throw") {
|
|
622
|
-
throw rootRecord.arg;
|
|
623
|
-
}
|
|
624
541
|
|
|
625
|
-
|
|
626
|
-
|
|
542
|
+
if (typeof iterable.next === "function") {
|
|
543
|
+
return iterable;
|
|
544
|
+
}
|
|
627
545
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
546
|
+
if (!isNaN(iterable.length)) {
|
|
547
|
+
var i = -1,
|
|
548
|
+
next = function next() {
|
|
549
|
+
while (++i < iterable.length) {
|
|
550
|
+
if (hasOwn.call(iterable, i)) {
|
|
551
|
+
next.value = iterable[i];
|
|
552
|
+
next.done = false;
|
|
553
|
+
return next;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
632
556
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
context.next = loc;
|
|
557
|
+
next.value = undefined$1;
|
|
558
|
+
next.done = true;
|
|
559
|
+
return next;
|
|
560
|
+
};
|
|
638
561
|
|
|
639
|
-
|
|
640
|
-
// If the dispatched exception was caught by a catch block,
|
|
641
|
-
// then let that catch block handle the exception normally.
|
|
642
|
-
context.method = "next";
|
|
643
|
-
context.arg = undefined$1;
|
|
562
|
+
return next.next = next;
|
|
644
563
|
}
|
|
564
|
+
} // Return an iterator with no values.
|
|
645
565
|
|
|
646
|
-
return !! caught;
|
|
647
|
-
}
|
|
648
566
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
567
|
+
return {
|
|
568
|
+
next: doneResult
|
|
569
|
+
};
|
|
570
|
+
}
|
|
652
571
|
|
|
653
|
-
|
|
654
|
-
// Exception thrown outside of any try block that could handle
|
|
655
|
-
// it, so set the completion value of the entire function to
|
|
656
|
-
// throw the exception.
|
|
657
|
-
return handle("end");
|
|
658
|
-
}
|
|
572
|
+
exports.values = values;
|
|
659
573
|
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
574
|
+
function doneResult() {
|
|
575
|
+
return {
|
|
576
|
+
value: undefined$1,
|
|
577
|
+
done: true
|
|
578
|
+
};
|
|
579
|
+
}
|
|
663
580
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
581
|
+
Context.prototype = {
|
|
582
|
+
constructor: Context,
|
|
583
|
+
reset: function reset(skipTempReset) {
|
|
584
|
+
this.prev = 0;
|
|
585
|
+
this.next = 0; // Resetting context._sent for legacy support of Babel's
|
|
586
|
+
// function.sent implementation.
|
|
670
587
|
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
588
|
+
this.sent = this._sent = undefined$1;
|
|
589
|
+
this.done = false;
|
|
590
|
+
this.delegate = null;
|
|
591
|
+
this.method = "next";
|
|
592
|
+
this.arg = undefined$1;
|
|
593
|
+
this.tryEntries.forEach(resetTryEntry);
|
|
675
594
|
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
595
|
+
if (!skipTempReset) {
|
|
596
|
+
for (var name in this) {
|
|
597
|
+
// Not sure about the optimal order of these conditions:
|
|
598
|
+
if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
|
|
599
|
+
this[name] = undefined$1;
|
|
679
600
|
}
|
|
680
|
-
|
|
681
|
-
} else {
|
|
682
|
-
throw new Error("try statement without catch or finally");
|
|
683
601
|
}
|
|
684
602
|
}
|
|
685
|
-
}
|
|
686
|
-
|
|
603
|
+
},
|
|
604
|
+
stop: function stop() {
|
|
605
|
+
this.done = true;
|
|
606
|
+
var rootEntry = this.tryEntries[0];
|
|
607
|
+
var rootRecord = rootEntry.completion;
|
|
608
|
+
|
|
609
|
+
if (rootRecord.type === "throw") {
|
|
610
|
+
throw rootRecord.arg;
|
|
611
|
+
}
|
|
687
612
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
if (
|
|
692
|
-
|
|
693
|
-
this.prev < entry.finallyLoc) {
|
|
694
|
-
var finallyEntry = entry;
|
|
695
|
-
break;
|
|
613
|
+
return this.rval;
|
|
614
|
+
},
|
|
615
|
+
dispatchException: function dispatchException(exception) {
|
|
616
|
+
if (this.done) {
|
|
617
|
+
throw exception;
|
|
696
618
|
}
|
|
697
|
-
}
|
|
698
619
|
|
|
699
|
-
|
|
700
|
-
(type === "break" ||
|
|
701
|
-
type === "continue") &&
|
|
702
|
-
finallyEntry.tryLoc <= arg &&
|
|
703
|
-
arg <= finallyEntry.finallyLoc) {
|
|
704
|
-
// Ignore the finally entry if control is not jumping to a
|
|
705
|
-
// location outside the try/catch block.
|
|
706
|
-
finallyEntry = null;
|
|
707
|
-
}
|
|
620
|
+
var context = this;
|
|
708
621
|
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
622
|
+
function handle(loc, caught) {
|
|
623
|
+
record.type = "throw";
|
|
624
|
+
record.arg = exception;
|
|
625
|
+
context.next = loc;
|
|
712
626
|
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
627
|
+
if (caught) {
|
|
628
|
+
// If the dispatched exception was caught by a catch block,
|
|
629
|
+
// then let that catch block handle the exception normally.
|
|
630
|
+
context.method = "next";
|
|
631
|
+
context.arg = undefined$1;
|
|
632
|
+
}
|
|
718
633
|
|
|
719
|
-
|
|
720
|
-
|
|
634
|
+
return !!caught;
|
|
635
|
+
}
|
|
721
636
|
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
}
|
|
637
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
638
|
+
var entry = this.tryEntries[i];
|
|
639
|
+
var record = entry.completion;
|
|
726
640
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
this.next = "end";
|
|
734
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
735
|
-
this.next = afterLoc;
|
|
736
|
-
}
|
|
641
|
+
if (entry.tryLoc === "root") {
|
|
642
|
+
// Exception thrown outside of any try block that could handle
|
|
643
|
+
// it, so set the completion value of the entire function to
|
|
644
|
+
// throw the exception.
|
|
645
|
+
return handle("end");
|
|
646
|
+
}
|
|
737
647
|
|
|
738
|
-
|
|
739
|
-
|
|
648
|
+
if (entry.tryLoc <= this.prev) {
|
|
649
|
+
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
650
|
+
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
651
|
+
|
|
652
|
+
if (hasCatch && hasFinally) {
|
|
653
|
+
if (this.prev < entry.catchLoc) {
|
|
654
|
+
return handle(entry.catchLoc, true);
|
|
655
|
+
} else if (this.prev < entry.finallyLoc) {
|
|
656
|
+
return handle(entry.finallyLoc);
|
|
657
|
+
}
|
|
658
|
+
} else if (hasCatch) {
|
|
659
|
+
if (this.prev < entry.catchLoc) {
|
|
660
|
+
return handle(entry.catchLoc, true);
|
|
661
|
+
}
|
|
662
|
+
} else if (hasFinally) {
|
|
663
|
+
if (this.prev < entry.finallyLoc) {
|
|
664
|
+
return handle(entry.finallyLoc);
|
|
665
|
+
}
|
|
666
|
+
} else {
|
|
667
|
+
throw new Error("try statement without catch or finally");
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
abrupt: function abrupt(type, arg) {
|
|
673
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
674
|
+
var entry = this.tryEntries[i];
|
|
675
|
+
|
|
676
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
677
|
+
var finallyEntry = entry;
|
|
678
|
+
break;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
740
681
|
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
682
|
+
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
|
|
683
|
+
// Ignore the finally entry if control is not jumping to a
|
|
684
|
+
// location outside the try/catch block.
|
|
685
|
+
finallyEntry = null;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
689
|
+
record.type = type;
|
|
690
|
+
record.arg = arg;
|
|
691
|
+
|
|
692
|
+
if (finallyEntry) {
|
|
693
|
+
this.method = "next";
|
|
694
|
+
this.next = finallyEntry.finallyLoc;
|
|
747
695
|
return ContinueSentinel;
|
|
748
696
|
}
|
|
749
|
-
}
|
|
750
|
-
},
|
|
751
697
|
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
if (
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
698
|
+
return this.complete(record);
|
|
699
|
+
},
|
|
700
|
+
complete: function complete(record, afterLoc) {
|
|
701
|
+
if (record.type === "throw") {
|
|
702
|
+
throw record.arg;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
if (record.type === "break" || record.type === "continue") {
|
|
706
|
+
this.next = record.arg;
|
|
707
|
+
} else if (record.type === "return") {
|
|
708
|
+
this.rval = this.arg = record.arg;
|
|
709
|
+
this.method = "return";
|
|
710
|
+
this.next = "end";
|
|
711
|
+
} else if (record.type === "normal" && afterLoc) {
|
|
712
|
+
this.next = afterLoc;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
return ContinueSentinel;
|
|
716
|
+
},
|
|
717
|
+
finish: function finish(finallyLoc) {
|
|
718
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
719
|
+
var entry = this.tryEntries[i];
|
|
720
|
+
|
|
721
|
+
if (entry.finallyLoc === finallyLoc) {
|
|
722
|
+
this.complete(entry.completion, entry.afterLoc);
|
|
759
723
|
resetTryEntry(entry);
|
|
724
|
+
return ContinueSentinel;
|
|
760
725
|
}
|
|
761
|
-
return thrown;
|
|
762
726
|
}
|
|
763
|
-
}
|
|
727
|
+
},
|
|
728
|
+
"catch": function _catch(tryLoc) {
|
|
729
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
730
|
+
var entry = this.tryEntries[i];
|
|
764
731
|
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
throw new Error("illegal catch attempt");
|
|
768
|
-
},
|
|
732
|
+
if (entry.tryLoc === tryLoc) {
|
|
733
|
+
var record = entry.completion;
|
|
769
734
|
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
nextLoc: nextLoc
|
|
775
|
-
};
|
|
735
|
+
if (record.type === "throw") {
|
|
736
|
+
var thrown = record.arg;
|
|
737
|
+
resetTryEntry(entry);
|
|
738
|
+
}
|
|
776
739
|
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
//
|
|
780
|
-
|
|
781
|
-
}
|
|
740
|
+
return thrown;
|
|
741
|
+
}
|
|
742
|
+
} // The context.catch method must only be called with a location
|
|
743
|
+
// argument that corresponds to a known catch block.
|
|
782
744
|
|
|
783
|
-
return ContinueSentinel;
|
|
784
|
-
}
|
|
785
|
-
};
|
|
786
745
|
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
746
|
+
throw new Error("illegal catch attempt");
|
|
747
|
+
},
|
|
748
|
+
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
|
749
|
+
this.delegate = {
|
|
750
|
+
iterator: values(iterable),
|
|
751
|
+
resultName: resultName,
|
|
752
|
+
nextLoc: nextLoc
|
|
753
|
+
};
|
|
792
754
|
|
|
793
|
-
|
|
794
|
-
|
|
755
|
+
if (this.method === "next") {
|
|
756
|
+
// Deliberately forget the last sent value so that we don't
|
|
757
|
+
// accidentally pass it on to the delegate.
|
|
758
|
+
this.arg = undefined$1;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
return ContinueSentinel;
|
|
762
|
+
}
|
|
763
|
+
}; // Regardless of whether this script is executing as a CommonJS module
|
|
764
|
+
// or not, return the runtime object so that we can declare the variable
|
|
765
|
+
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
766
|
+
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
767
|
+
|
|
768
|
+
return exports;
|
|
769
|
+
}( // If this script is executing as a CommonJS module, use module.exports
|
|
795
770
|
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
796
771
|
// object. Either way, the resulting object will be used to initialize
|
|
797
772
|
// the regeneratorRuntime variable at the top of this file.
|
|
798
|
-
module.exports
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
}
|
|
773
|
+
module.exports );
|
|
774
|
+
|
|
775
|
+
try {
|
|
776
|
+
regeneratorRuntime = runtime;
|
|
777
|
+
} catch (accidentalStrictMode) {
|
|
778
|
+
// This module should not be running in strict mode, so the above
|
|
779
|
+
// assignment should always work unless something is misconfigured. Just
|
|
780
|
+
// in case runtime.js accidentally runs in strict mode, we can escape
|
|
781
|
+
// strict mode using a global Function call. This could conceivably fail
|
|
782
|
+
// if a Content Security Policy forbids using Function, but in that case
|
|
783
|
+
// the proper solution is to fix the accidental strict mode problem. If
|
|
784
|
+
// you've misconfigured your bundler to force strict mode and applied a
|
|
785
|
+
// CSP to forbid Function, and you're not willing to fix either of those
|
|
786
|
+
// problems, please detail your unique predicament in a GitHub issue.
|
|
787
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
788
|
+
}
|
|
815
789
|
});
|
|
816
790
|
|
|
791
|
+
var _excluded = ["queryKey", "children", "spinner", "previewSpinner", "errorDisplay", "previewErrorDisplay", "dataName"];
|
|
792
|
+
|
|
817
793
|
function performFetch(_x) {
|
|
818
794
|
return _performFetch.apply(this, arguments);
|
|
819
795
|
}
|
|
@@ -875,7 +851,7 @@ function DataFetcher(_ref2) {
|
|
|
875
851
|
spinner = _ref2.spinner,
|
|
876
852
|
errorDisplay = _ref2.errorDisplay,
|
|
877
853
|
dataName = _ref2.dataName,
|
|
878
|
-
fetchProps = _objectWithoutPropertiesLoose(_ref2,
|
|
854
|
+
fetchProps = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
879
855
|
|
|
880
856
|
var query$1 = query.usePlasmicQueryData(queryKey != null ? queryKey : JSON.stringify(fetchProps), function () {
|
|
881
857
|
return performFetch(fetchProps);
|
|
@@ -886,7 +862,7 @@ function DataFetcher(_ref2) {
|
|
|
886
862
|
} else if ("error" in query$1) {
|
|
887
863
|
return React.createElement(React.Fragment, null, errorDisplay != null ? errorDisplay : null);
|
|
888
864
|
} else {
|
|
889
|
-
return React.createElement(
|
|
865
|
+
return React.createElement(host.DataProvider, {
|
|
890
866
|
name: dataName != null ? dataName : queryKey,
|
|
891
867
|
data: query$1.data
|
|
892
868
|
}, children);
|