tslib.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. /******************************************************************************
  2. Copyright (c) Microsoft Corporation.
  3. Permission to use, copy, modify, and/or distribute this software for any
  4. purpose with or without fee is hereby granted.
  5. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  6. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  7. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  8. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  9. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  10. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  11. PERFORMANCE OF THIS SOFTWARE.
  12. ***************************************************************************** */
  13. /* global global, define, System, Reflect, Promise */
  14. var __extends;
  15. var __assign;
  16. var __rest;
  17. var __decorate;
  18. var __param;
  19. var __esDecorate;
  20. var __runInitializers;
  21. var __propKey;
  22. var __setFunctionName;
  23. var __metadata;
  24. var __awaiter;
  25. var __generator;
  26. var __exportStar;
  27. var __values;
  28. var __read;
  29. var __spread;
  30. var __spreadArrays;
  31. var __spreadArray;
  32. var __await;
  33. var __asyncGenerator;
  34. var __asyncDelegator;
  35. var __asyncValues;
  36. var __makeTemplateObject;
  37. var __importStar;
  38. var __importDefault;
  39. var __classPrivateFieldGet;
  40. var __classPrivateFieldSet;
  41. var __classPrivateFieldIn;
  42. var __createBinding;
  43. (function (factory) {
  44. var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
  45. if (typeof define === "function" && define.amd) {
  46. define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
  47. }
  48. else if (typeof module === "object" && typeof module.exports === "object") {
  49. factory(createExporter(root, createExporter(module.exports)));
  50. }
  51. else {
  52. factory(createExporter(root));
  53. }
  54. function createExporter(exports, previous) {
  55. if (exports !== root) {
  56. if (typeof Object.create === "function") {
  57. Object.defineProperty(exports, "__esModule", { value: true });
  58. }
  59. else {
  60. exports.__esModule = true;
  61. }
  62. }
  63. return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
  64. }
  65. })
  66. (function (exporter) {
  67. var extendStatics = Object.setPrototypeOf ||
  68. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  69. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  70. __extends = function (d, b) {
  71. if (typeof b !== "function" && b !== null)
  72. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  73. extendStatics(d, b);
  74. function __() { this.constructor = d; }
  75. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  76. };
  77. __assign = Object.assign || function (t) {
  78. for (var s, i = 1, n = arguments.length; i < n; i++) {
  79. s = arguments[i];
  80. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  81. }
  82. return t;
  83. };
  84. __rest = function (s, e) {
  85. var t = {};
  86. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  87. t[p] = s[p];
  88. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  89. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  90. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  91. t[p[i]] = s[p[i]];
  92. }
  93. return t;
  94. };
  95. __decorate = function (decorators, target, key, desc) {
  96. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  97. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  98. 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;
  99. return c > 3 && r && Object.defineProperty(target, key, r), r;
  100. };
  101. __param = function (paramIndex, decorator) {
  102. return function (target, key) { decorator(target, key, paramIndex); }
  103. };
  104. __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  105. function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
  106. var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  107. var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  108. var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  109. var _, done = false;
  110. for (var i = decorators.length - 1; i >= 0; i--) {
  111. var context = {};
  112. for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
  113. for (var p in contextIn.access) context.access[p] = contextIn.access[p];
  114. context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
  115. var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
  116. if (kind === "accessor") {
  117. if (result === void 0) continue;
  118. if (result === null || typeof result !== "object") throw new TypeError("Object expected");
  119. if (_ = accept(result.get)) descriptor.get = _;
  120. if (_ = accept(result.set)) descriptor.set = _;
  121. if (_ = accept(result.init)) initializers.push(_);
  122. }
  123. else if (_ = accept(result)) {
  124. if (kind === "field") initializers.push(_);
  125. else descriptor[key] = _;
  126. }
  127. }
  128. if (target) Object.defineProperty(target, contextIn.name, descriptor);
  129. done = true;
  130. };
  131. __runInitializers = function (thisArg, initializers, value) {
  132. var useValue = arguments.length > 2;
  133. for (var i = 0; i < initializers.length; i++) {
  134. value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  135. }
  136. return useValue ? value : void 0;
  137. };
  138. __propKey = function (x) {
  139. return typeof x === "symbol" ? x : "".concat(x);
  140. };
  141. __setFunctionName = function (f, name, prefix) {
  142. if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
  143. return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
  144. };
  145. __metadata = function (metadataKey, metadataValue) {
  146. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  147. };
  148. __awaiter = function (thisArg, _arguments, P, generator) {
  149. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  150. return new (P || (P = Promise))(function (resolve, reject) {
  151. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  152. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  153. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  154. step((generator = generator.apply(thisArg, _arguments || [])).next());
  155. });
  156. };
  157. __generator = function (thisArg, body) {
  158. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  159. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  160. function verb(n) { return function (v) { return step([n, v]); }; }
  161. function step(op) {
  162. if (f) throw new TypeError("Generator is already executing.");
  163. while (g && (g = 0, op[0] && (_ = 0)), _) try {
  164. 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;
  165. if (y = 0, t) op = [op[0] & 2, t.value];
  166. switch (op[0]) {
  167. case 0: case 1: t = op; break;
  168. case 4: _.label++; return { value: op[1], done: false };
  169. case 5: _.label++; y = op[1]; op = [0]; continue;
  170. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  171. default:
  172. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  173. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  174. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  175. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  176. if (t[2]) _.ops.pop();
  177. _.trys.pop(); continue;
  178. }
  179. op = body.call(thisArg, _);
  180. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  181. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  182. }
  183. };
  184. __exportStar = function(m, o) {
  185. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
  186. };
  187. __createBinding = Object.create ? (function(o, m, k, k2) {
  188. if (k2 === undefined) k2 = k;
  189. var desc = Object.getOwnPropertyDescriptor(m, k);
  190. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  191. desc = { enumerable: true, get: function() { return m[k]; } };
  192. }
  193. Object.defineProperty(o, k2, desc);
  194. }) : (function(o, m, k, k2) {
  195. if (k2 === undefined) k2 = k;
  196. o[k2] = m[k];
  197. });
  198. __values = function (o) {
  199. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  200. if (m) return m.call(o);
  201. if (o && typeof o.length === "number") return {
  202. next: function () {
  203. if (o && i >= o.length) o = void 0;
  204. return { value: o && o[i++], done: !o };
  205. }
  206. };
  207. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  208. };
  209. __read = function (o, n) {
  210. var m = typeof Symbol === "function" && o[Symbol.iterator];
  211. if (!m) return o;
  212. var i = m.call(o), r, ar = [], e;
  213. try {
  214. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  215. }
  216. catch (error) { e = { error: error }; }
  217. finally {
  218. try {
  219. if (r && !r.done && (m = i["return"])) m.call(i);
  220. }
  221. finally { if (e) throw e.error; }
  222. }
  223. return ar;
  224. };
  225. /** @deprecated */
  226. __spread = function () {
  227. for (var ar = [], i = 0; i < arguments.length; i++)
  228. ar = ar.concat(__read(arguments[i]));
  229. return ar;
  230. };
  231. /** @deprecated */
  232. __spreadArrays = function () {
  233. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  234. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  235. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  236. r[k] = a[j];
  237. return r;
  238. };
  239. __spreadArray = function (to, from, pack) {
  240. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  241. if (ar || !(i in from)) {
  242. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  243. ar[i] = from[i];
  244. }
  245. }
  246. return to.concat(ar || Array.prototype.slice.call(from));
  247. };
  248. __await = function (v) {
  249. return this instanceof __await ? (this.v = v, this) : new __await(v);
  250. };
  251. __asyncGenerator = function (thisArg, _arguments, generator) {
  252. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  253. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  254. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  255. function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
  256. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  257. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  258. function fulfill(value) { resume("next", value); }
  259. function reject(value) { resume("throw", value); }
  260. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  261. };
  262. __asyncDelegator = function (o) {
  263. var i, p;
  264. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  265. 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; }
  266. };
  267. __asyncValues = function (o) {
  268. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  269. var m = o[Symbol.asyncIterator], i;
  270. 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);
  271. 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); }); }; }
  272. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  273. };
  274. __makeTemplateObject = function (cooked, raw) {
  275. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  276. return cooked;
  277. };
  278. var __setModuleDefault = Object.create ? (function(o, v) {
  279. Object.defineProperty(o, "default", { enumerable: true, value: v });
  280. }) : function(o, v) {
  281. o["default"] = v;
  282. };
  283. __importStar = function (mod) {
  284. if (mod && mod.__esModule) return mod;
  285. var result = {};
  286. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  287. __setModuleDefault(result, mod);
  288. return result;
  289. };
  290. __importDefault = function (mod) {
  291. return (mod && mod.__esModule) ? mod : { "default": mod };
  292. };
  293. __classPrivateFieldGet = function (receiver, state, kind, f) {
  294. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  295. 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");
  296. return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
  297. };
  298. __classPrivateFieldSet = function (receiver, state, value, kind, f) {
  299. if (kind === "m") throw new TypeError("Private method is not writable");
  300. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  301. 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");
  302. return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
  303. };
  304. __classPrivateFieldIn = function (state, receiver) {
  305. if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
  306. return typeof state === "function" ? receiver === state : state.has(receiver);
  307. };
  308. exporter("__extends", __extends);
  309. exporter("__assign", __assign);
  310. exporter("__rest", __rest);
  311. exporter("__decorate", __decorate);
  312. exporter("__param", __param);
  313. exporter("__esDecorate", __esDecorate);
  314. exporter("__runInitializers", __runInitializers);
  315. exporter("__propKey", __propKey);
  316. exporter("__setFunctionName", __setFunctionName);
  317. exporter("__metadata", __metadata);
  318. exporter("__awaiter", __awaiter);
  319. exporter("__generator", __generator);
  320. exporter("__exportStar", __exportStar);
  321. exporter("__createBinding", __createBinding);
  322. exporter("__values", __values);
  323. exporter("__read", __read);
  324. exporter("__spread", __spread);
  325. exporter("__spreadArrays", __spreadArrays);
  326. exporter("__spreadArray", __spreadArray);
  327. exporter("__await", __await);
  328. exporter("__asyncGenerator", __asyncGenerator);
  329. exporter("__asyncDelegator", __asyncDelegator);
  330. exporter("__asyncValues", __asyncValues);
  331. exporter("__makeTemplateObject", __makeTemplateObject);
  332. exporter("__importStar", __importStar);
  333. exporter("__importDefault", __importDefault);
  334. exporter("__classPrivateFieldGet", __classPrivateFieldGet);
  335. exporter("__classPrivateFieldSet", __classPrivateFieldSet);
  336. exporter("__classPrivateFieldIn", __classPrivateFieldIn);
  337. });