UNPKG

23.4 kBJavaScriptView Raw
1/******************************************************************************
2Copyright (c) Microsoft Corporation.
3
4Permission to use, copy, modify, and/or distribute this software for any
5purpose with or without fee is hereby granted.
6
7THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13PERFORMANCE OF THIS SOFTWARE.
14***************************************************************************** */
15/* global global, define, Symbol, Reflect, Promise, SuppressedError, Iterator */
16var __extends;
17var __assign;
18var __rest;
19var __decorate;
20var __param;
21var __esDecorate;
22var __runInitializers;
23var __propKey;
24var __setFunctionName;
25var __metadata;
26var __awaiter;
27var __generator;
28var __exportStar;
29var __values;
30var __read;
31var __spread;
32var __spreadArrays;
33var __spreadArray;
34var __await;
35var __asyncGenerator;
36var __asyncDelegator;
37var __asyncValues;
38var __makeTemplateObject;
39var __importStar;
40var __importDefault;
41var __classPrivateFieldGet;
42var __classPrivateFieldSet;
43var __classPrivateFieldIn;
44var __createBinding;
45var __addDisposableResource;
46var __disposeResources;
47var __rewriteRelativeImportExtension;
48(function (factory) {
49 var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
50 if (typeof define === "function" && define.amd) {
51 define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
52 }
53 else if (typeof module === "object" && typeof module.exports === "object") {
54 factory(createExporter(root, createExporter(module.exports)));
55 }
56 else {
57 factory(createExporter(root));
58 }
59 function createExporter(exports, previous) {
60 if (exports !== root) {
61 if (typeof Object.create === "function") {
62 Object.defineProperty(exports, "__esModule", { value: true });
63 }
64 else {
65 exports.__esModule = true;
66 }
67 }
68 return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
69 }
70})
71(function (exporter) {
72 var extendStatics = Object.setPrototypeOf ||
73 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
74 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
75
76 __extends = function (d, b) {
77 if (typeof b !== "function" && b !== null)
78 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
79 extendStatics(d, b);
80 function __() { this.constructor = d; }
81 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
82 };
83
84 __assign = Object.assign || function (t) {
85 for (var s, i = 1, n = arguments.length; i < n; i++) {
86 s = arguments[i];
87 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
88 }
89 return t;
90 };
91
92 __rest = function (s, e) {
93 var t = {};
94 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
95 t[p] = s[p];
96 if (s != null && typeof Object.getOwnPropertySymbols === "function")
97 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
98 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
99 t[p[i]] = s[p[i]];
100 }
101 return t;
102 };
103
104 __decorate = function (decorators, target, key, desc) {
105 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
106 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
107 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
108 return c > 3 && r && Object.defineProperty(target, key, r), r;
109 };
110
111 __param = function (paramIndex, decorator) {
112 return function (target, key) { decorator(target, key, paramIndex); }
113 };
114
115 __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
116 function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
117 var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
118 var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
119 var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
120 var _, done = false;
121 for (var i = decorators.length - 1; i >= 0; i--) {
122 var context = {};
123 for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
124 for (var p in contextIn.access) context.access[p] = contextIn.access[p];
125 context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
126 var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
127 if (kind === "accessor") {
128 if (result === void 0) continue;
129 if (result === null || typeof result !== "object") throw new TypeError("Object expected");
130 if (_ = accept(result.get)) descriptor.get = _;
131 if (_ = accept(result.set)) descriptor.set = _;
132 if (_ = accept(result.init)) initializers.unshift(_);
133 }
134 else if (_ = accept(result)) {
135 if (kind === "field") initializers.unshift(_);
136 else descriptor[key] = _;
137 }
138 }
139 if (target) Object.defineProperty(target, contextIn.name, descriptor);
140 done = true;
141 };
142
143 __runInitializers = function (thisArg, initializers, value) {
144 var useValue = arguments.length > 2;
145 for (var i = 0; i < initializers.length; i++) {
146 value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
147 }
148 return useValue ? value : void 0;
149 };
150
151 __propKey = function (x) {
152 return typeof x === "symbol" ? x : "".concat(x);
153 };
154
155 __setFunctionName = function (f, name, prefix) {
156 if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
157 return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
158 };
159
160 __metadata = function (metadataKey, metadataValue) {
161 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
162 };
163
164 __awaiter = function (thisArg, _arguments, P, generator) {
165 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
166 return new (P || (P = Promise))(function (resolve, reject) {
167 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
168 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
169 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
170 step((generator = generator.apply(thisArg, _arguments || [])).next());
171 });
172 };
173
174 __generator = function (thisArg, body) {
175 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
176 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
177 function verb(n) { return function (v) { return step([n, v]); }; }
178 function step(op) {
179 if (f) throw new TypeError("Generator is already executing.");
180 while (g && (g = 0, op[0] && (_ = 0)), _) try {
181 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
182 if (y = 0, t) op = [op[0] & 2, t.value];
183 switch (op[0]) {
184 case 0: case 1: t = op; break;
185 case 4: _.label++; return { value: op[1], done: false };
186 case 5: _.label++; y = op[1]; op = [0]; continue;
187 case 7: op = _.ops.pop(); _.trys.pop(); continue;
188 default:
189 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
190 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
191 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
192 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
193 if (t[2]) _.ops.pop();
194 _.trys.pop(); continue;
195 }
196 op = body.call(thisArg, _);
197 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
198 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
199 }
200 };
201
202 __exportStar = function(m, o) {
203 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
204 };
205
206 __createBinding = Object.create ? (function(o, m, k, k2) {
207 if (k2 === undefined) k2 = k;
208 var desc = Object.getOwnPropertyDescriptor(m, k);
209 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
210 desc = { enumerable: true, get: function() { return m[k]; } };
211 }
212 Object.defineProperty(o, k2, desc);
213 }) : (function(o, m, k, k2) {
214 if (k2 === undefined) k2 = k;
215 o[k2] = m[k];
216 });
217
218 __values = function (o) {
219 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
220 if (m) return m.call(o);
221 if (o && typeof o.length === "number") return {
222 next: function () {
223 if (o && i >= o.length) o = void 0;
224 return { value: o && o[i++], done: !o };
225 }
226 };
227 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
228 };
229
230 __read = function (o, n) {
231 var m = typeof Symbol === "function" && o[Symbol.iterator];
232 if (!m) return o;
233 var i = m.call(o), r, ar = [], e;
234 try {
235 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
236 }
237 catch (error) { e = { error: error }; }
238 finally {
239 try {
240 if (r && !r.done && (m = i["return"])) m.call(i);
241 }
242 finally { if (e) throw e.error; }
243 }
244 return ar;
245 };
246
247 /** @deprecated */
248 __spread = function () {
249 for (var ar = [], i = 0; i < arguments.length; i++)
250 ar = ar.concat(__read(arguments[i]));
251 return ar;
252 };
253
254 /** @deprecated */
255 __spreadArrays = function () {
256 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
257 for (var r = Array(s), k = 0, i = 0; i < il; i++)
258 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
259 r[k] = a[j];
260 return r;
261 };
262
263 __spreadArray = function (to, from, pack) {
264 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
265 if (ar || !(i in from)) {
266 if (!ar) ar = Array.prototype.slice.call(from, 0, i);
267 ar[i] = from[i];
268 }
269 }
270 return to.concat(ar || Array.prototype.slice.call(from));
271 };
272
273 __await = function (v) {
274 return this instanceof __await ? (this.v = v, this) : new __await(v);
275 };
276
277 __asyncGenerator = function (thisArg, _arguments, generator) {
278 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
279 var g = generator.apply(thisArg, _arguments || []), i, q = [];
280 return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
281 function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
282 function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
283 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
284 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
285 function fulfill(value) { resume("next", value); }
286 function reject(value) { resume("throw", value); }
287 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
288 };
289
290 __asyncDelegator = function (o) {
291 var i, p;
292 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
293 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
294 };
295
296 __asyncValues = function (o) {
297 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
298 var m = o[Symbol.asyncIterator], i;
299 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
300 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
301 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
302 };
303
304 __makeTemplateObject = function (cooked, raw) {
305 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
306 return cooked;
307 };
308
309 var __setModuleDefault = Object.create ? (function(o, v) {
310 Object.defineProperty(o, "default", { enumerable: true, value: v });
311 }) : function(o, v) {
312 o["default"] = v;
313 };
314
315 var ownKeys = function(o) {
316 ownKeys = Object.getOwnPropertyNames || function (o) {
317 var ar = [];
318 for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
319 return ar;
320 };
321 return ownKeys(o);
322 };
323
324 __importStar = function (mod) {
325 if (mod && mod.__esModule) return mod;
326 var result = {};
327 if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
328 __setModuleDefault(result, mod);
329 return result;
330 };
331
332 __importDefault = function (mod) {
333 return (mod && mod.__esModule) ? mod : { "default": mod };
334 };
335
336 __classPrivateFieldGet = function (receiver, state, kind, f) {
337 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
338 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
339 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
340 };
341
342 __classPrivateFieldSet = function (receiver, state, value, kind, f) {
343 if (kind === "m") throw new TypeError("Private method is not writable");
344 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
345 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
346 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
347 };
348
349 __classPrivateFieldIn = function (state, receiver) {
350 if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
351 return typeof state === "function" ? receiver === state : state.has(receiver);
352 };
353
354 __addDisposableResource = function (env, value, async) {
355 if (value !== null && value !== void 0) {
356 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
357 var dispose, inner;
358 if (async) {
359 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
360 dispose = value[Symbol.asyncDispose];
361 }
362 if (dispose === void 0) {
363 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
364 dispose = value[Symbol.dispose];
365 if (async) inner = dispose;
366 }
367 if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
368 if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
369 env.stack.push({ value: value, dispose: dispose, async: async });
370 }
371 else if (async) {
372 env.stack.push({ async: true });
373 }
374 return value;
375 };
376
377 var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
378 var e = new Error(message);
379 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
380 };
381
382 __disposeResources = function (env) {
383 function fail(e) {
384 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
385 env.hasError = true;
386 }
387 var r, s = 0;
388 function next() {
389 while (r = env.stack.pop()) {
390 try {
391 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
392 if (r.dispose) {
393 var result = r.dispose.call(r.value);
394 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
395 }
396 else s |= 1;
397 }
398 catch (e) {
399 fail(e);
400 }
401 }
402 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
403 if (env.hasError) throw env.error;
404 }
405 return next();
406 };
407
408 __rewriteRelativeImportExtension = function (path, preserveJsx) {
409 if (typeof path === "string" && /^\.\.?\//.test(path)) {
410 return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
411 return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
412 });
413 }
414 return path;
415 };
416
417 exporter("__extends", __extends);
418 exporter("__assign", __assign);
419 exporter("__rest", __rest);
420 exporter("__decorate", __decorate);
421 exporter("__param", __param);
422 exporter("__esDecorate", __esDecorate);
423 exporter("__runInitializers", __runInitializers);
424 exporter("__propKey", __propKey);
425 exporter("__setFunctionName", __setFunctionName);
426 exporter("__metadata", __metadata);
427 exporter("__awaiter", __awaiter);
428 exporter("__generator", __generator);
429 exporter("__exportStar", __exportStar);
430 exporter("__createBinding", __createBinding);
431 exporter("__values", __values);
432 exporter("__read", __read);
433 exporter("__spread", __spread);
434 exporter("__spreadArrays", __spreadArrays);
435 exporter("__spreadArray", __spreadArray);
436 exporter("__await", __await);
437 exporter("__asyncGenerator", __asyncGenerator);
438 exporter("__asyncDelegator", __asyncDelegator);
439 exporter("__asyncValues", __asyncValues);
440 exporter("__makeTemplateObject", __makeTemplateObject);
441 exporter("__importStar", __importStar);
442 exporter("__importDefault", __importDefault);
443 exporter("__classPrivateFieldGet", __classPrivateFieldGet);
444 exporter("__classPrivateFieldSet", __classPrivateFieldSet);
445 exporter("__classPrivateFieldIn", __classPrivateFieldIn);
446 exporter("__addDisposableResource", __addDisposableResource);
447 exporter("__disposeResources", __disposeResources);
448 exporter("__rewriteRelativeImportExtension", __rewriteRelativeImportExtension);
449});
450
4510 && (module.exports = {
452 __extends: __extends,
453 __assign: __assign,
454 __rest: __rest,
455 __decorate: __decorate,
456 __param: __param,
457 __esDecorate: __esDecorate,
458 __runInitializers: __runInitializers,
459 __propKey: __propKey,
460 __setFunctionName: __setFunctionName,
461 __metadata: __metadata,
462 __awaiter: __awaiter,
463 __generator: __generator,
464 __exportStar: __exportStar,
465 __createBinding: __createBinding,
466 __values: __values,
467 __read: __read,
468 __spread: __spread,
469 __spreadArrays: __spreadArrays,
470 __spreadArray: __spreadArray,
471 __await: __await,
472 __asyncGenerator: __asyncGenerator,
473 __asyncDelegator: __asyncDelegator,
474 __asyncValues: __asyncValues,
475 __makeTemplateObject: __makeTemplateObject,
476 __importStar: __importStar,
477 __importDefault: __importDefault,
478 __classPrivateFieldGet: __classPrivateFieldGet,
479 __classPrivateFieldSet: __classPrivateFieldSet,
480 __classPrivateFieldIn: __classPrivateFieldIn,
481 __addDisposableResource: __addDisposableResource,
482 __disposeResources: __disposeResources,
483 __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,
484});