暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

tslib.js 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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 __metadata;
  20. var __awaiter;
  21. var __generator;
  22. var __exportStar;
  23. var __values;
  24. var __read;
  25. var __spread;
  26. var __spreadArrays;
  27. var __spreadArray;
  28. var __await;
  29. var __asyncGenerator;
  30. var __asyncDelegator;
  31. var __asyncValues;
  32. var __makeTemplateObject;
  33. var __importStar;
  34. var __importDefault;
  35. var __classPrivateFieldGet;
  36. var __classPrivateFieldSet;
  37. var __classPrivateFieldIn;
  38. var __createBinding;
  39. (function (factory) {
  40. var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
  41. if (typeof define === "function" && define.amd) {
  42. define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
  43. }
  44. else if (typeof module === "object" && typeof module.exports === "object") {
  45. factory(createExporter(root, createExporter(module.exports)));
  46. }
  47. else {
  48. factory(createExporter(root));
  49. }
  50. function createExporter(exports, previous) {
  51. if (exports !== root) {
  52. if (typeof Object.create === "function") {
  53. Object.defineProperty(exports, "__esModule", { value: true });
  54. }
  55. else {
  56. exports.__esModule = true;
  57. }
  58. }
  59. return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
  60. }
  61. })
  62. (function (exporter) {
  63. var extendStatics = Object.setPrototypeOf ||
  64. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  65. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  66. __extends = function (d, b) {
  67. if (typeof b !== "function" && b !== null)
  68. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  69. extendStatics(d, b);
  70. function __() { this.constructor = d; }
  71. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  72. };
  73. __assign = Object.assign || function (t) {
  74. for (var s, i = 1, n = arguments.length; i < n; i++) {
  75. s = arguments[i];
  76. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  77. }
  78. return t;
  79. };
  80. __rest = function (s, e) {
  81. var t = {};
  82. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  83. t[p] = s[p];
  84. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  85. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  86. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  87. t[p[i]] = s[p[i]];
  88. }
  89. return t;
  90. };
  91. __decorate = function (decorators, target, key, desc) {
  92. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  93. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  94. 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;
  95. return c > 3 && r && Object.defineProperty(target, key, r), r;
  96. };
  97. __param = function (paramIndex, decorator) {
  98. return function (target, key) { decorator(target, key, paramIndex); }
  99. };
  100. __metadata = function (metadataKey, metadataValue) {
  101. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  102. };
  103. __awaiter = function (thisArg, _arguments, P, generator) {
  104. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  105. return new (P || (P = Promise))(function (resolve, reject) {
  106. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  107. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  108. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  109. step((generator = generator.apply(thisArg, _arguments || [])).next());
  110. });
  111. };
  112. __generator = function (thisArg, body) {
  113. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  114. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  115. function verb(n) { return function (v) { return step([n, v]); }; }
  116. function step(op) {
  117. if (f) throw new TypeError("Generator is already executing.");
  118. while (g && (g = 0, op[0] && (_ = 0)), _) try {
  119. 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;
  120. if (y = 0, t) op = [op[0] & 2, t.value];
  121. switch (op[0]) {
  122. case 0: case 1: t = op; break;
  123. case 4: _.label++; return { value: op[1], done: false };
  124. case 5: _.label++; y = op[1]; op = [0]; continue;
  125. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  126. default:
  127. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  128. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  129. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  130. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  131. if (t[2]) _.ops.pop();
  132. _.trys.pop(); continue;
  133. }
  134. op = body.call(thisArg, _);
  135. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  136. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  137. }
  138. };
  139. __exportStar = function(m, o) {
  140. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
  141. };
  142. __createBinding = Object.create ? (function(o, m, k, k2) {
  143. if (k2 === undefined) k2 = k;
  144. var desc = Object.getOwnPropertyDescriptor(m, k);
  145. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  146. desc = { enumerable: true, get: function() { return m[k]; } };
  147. }
  148. Object.defineProperty(o, k2, desc);
  149. }) : (function(o, m, k, k2) {
  150. if (k2 === undefined) k2 = k;
  151. o[k2] = m[k];
  152. });
  153. __values = function (o) {
  154. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  155. if (m) return m.call(o);
  156. if (o && typeof o.length === "number") return {
  157. next: function () {
  158. if (o && i >= o.length) o = void 0;
  159. return { value: o && o[i++], done: !o };
  160. }
  161. };
  162. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  163. };
  164. __read = function (o, n) {
  165. var m = typeof Symbol === "function" && o[Symbol.iterator];
  166. if (!m) return o;
  167. var i = m.call(o), r, ar = [], e;
  168. try {
  169. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  170. }
  171. catch (error) { e = { error: error }; }
  172. finally {
  173. try {
  174. if (r && !r.done && (m = i["return"])) m.call(i);
  175. }
  176. finally { if (e) throw e.error; }
  177. }
  178. return ar;
  179. };
  180. /** @deprecated */
  181. __spread = function () {
  182. for (var ar = [], i = 0; i < arguments.length; i++)
  183. ar = ar.concat(__read(arguments[i]));
  184. return ar;
  185. };
  186. /** @deprecated */
  187. __spreadArrays = function () {
  188. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  189. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  190. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  191. r[k] = a[j];
  192. return r;
  193. };
  194. __spreadArray = function (to, from, pack) {
  195. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  196. if (ar || !(i in from)) {
  197. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  198. ar[i] = from[i];
  199. }
  200. }
  201. return to.concat(ar || Array.prototype.slice.call(from));
  202. };
  203. __await = function (v) {
  204. return this instanceof __await ? (this.v = v, this) : new __await(v);
  205. };
  206. __asyncGenerator = function (thisArg, _arguments, generator) {
  207. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  208. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  209. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  210. 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); }); }; }
  211. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  212. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  213. function fulfill(value) { resume("next", value); }
  214. function reject(value) { resume("throw", value); }
  215. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  216. };
  217. __asyncDelegator = function (o) {
  218. var i, p;
  219. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  220. function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
  221. };
  222. __asyncValues = function (o) {
  223. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  224. var m = o[Symbol.asyncIterator], i;
  225. 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);
  226. 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); }); }; }
  227. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  228. };
  229. __makeTemplateObject = function (cooked, raw) {
  230. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  231. return cooked;
  232. };
  233. var __setModuleDefault = Object.create ? (function(o, v) {
  234. Object.defineProperty(o, "default", { enumerable: true, value: v });
  235. }) : function(o, v) {
  236. o["default"] = v;
  237. };
  238. __importStar = function (mod) {
  239. if (mod && mod.__esModule) return mod;
  240. var result = {};
  241. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  242. __setModuleDefault(result, mod);
  243. return result;
  244. };
  245. __importDefault = function (mod) {
  246. return (mod && mod.__esModule) ? mod : { "default": mod };
  247. };
  248. __classPrivateFieldGet = function (receiver, state, kind, f) {
  249. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  250. 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");
  251. return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
  252. };
  253. __classPrivateFieldSet = function (receiver, state, value, kind, f) {
  254. if (kind === "m") throw new TypeError("Private method is not writable");
  255. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  256. 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");
  257. return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
  258. };
  259. __classPrivateFieldIn = function (state, receiver) {
  260. if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
  261. return typeof state === "function" ? receiver === state : state.has(receiver);
  262. };
  263. exporter("__extends", __extends);
  264. exporter("__assign", __assign);
  265. exporter("__rest", __rest);
  266. exporter("__decorate", __decorate);
  267. exporter("__param", __param);
  268. exporter("__metadata", __metadata);
  269. exporter("__awaiter", __awaiter);
  270. exporter("__generator", __generator);
  271. exporter("__exportStar", __exportStar);
  272. exporter("__createBinding", __createBinding);
  273. exporter("__values", __values);
  274. exporter("__read", __read);
  275. exporter("__spread", __spread);
  276. exporter("__spreadArrays", __spreadArrays);
  277. exporter("__spreadArray", __spreadArray);
  278. exporter("__await", __await);
  279. exporter("__asyncGenerator", __asyncGenerator);
  280. exporter("__asyncDelegator", __asyncDelegator);
  281. exporter("__asyncValues", __asyncValues);
  282. exporter("__makeTemplateObject", __makeTemplateObject);
  283. exporter("__importStar", __importStar);
  284. exporter("__importDefault", __importDefault);
  285. exporter("__classPrivateFieldGet", __classPrivateFieldGet);
  286. exporter("__classPrivateFieldSet", __classPrivateFieldSet);
  287. exporter("__classPrivateFieldIn", __classPrivateFieldIn);
  288. });