regeneratorRuntime.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. var _typeof = require("./typeof.js")["default"];
  2. var _Object$defineProperty = require("core-js-pure/features/object/define-property.js");
  3. var _Symbol = require("core-js-pure/features/symbol/index.js");
  4. var _Object$create = require("core-js-pure/features/object/create.js");
  5. var _Object$getPrototypeOf = require("core-js-pure/features/object/get-prototype-of.js");
  6. var _forEachInstanceProperty = require("core-js-pure/features/instance/for-each.js");
  7. var _pushInstanceProperty = require("core-js-pure/features/instance/push.js");
  8. var _Object$setPrototypeOf = require("core-js-pure/features/object/set-prototype-of.js");
  9. var _Promise = require("core-js-pure/features/promise/index.js");
  10. var _reverseInstanceProperty = require("core-js-pure/features/instance/reverse.js");
  11. var _sliceInstanceProperty = require("core-js-pure/features/instance/slice.js");
  12. function _regeneratorRuntime() {
  13. "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  14. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  15. return e;
  16. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17. var t,
  18. e = {},
  19. r = Object.prototype,
  20. n = r.hasOwnProperty,
  21. o = _Object$defineProperty || function (t, e, r) {
  22. t[e] = r.value;
  23. },
  24. i = "function" == typeof _Symbol ? _Symbol : {},
  25. a = i.iterator || "@@iterator",
  26. c = i.asyncIterator || "@@asyncIterator",
  27. u = i.toStringTag || "@@toStringTag";
  28. function define(t, e, r) {
  29. return _Object$defineProperty(t, e, {
  30. value: r,
  31. enumerable: !0,
  32. configurable: !0,
  33. writable: !0
  34. }), t[e];
  35. }
  36. try {
  37. define({}, "");
  38. } catch (t) {
  39. define = function define(t, e, r) {
  40. return t[e] = r;
  41. };
  42. }
  43. function wrap(t, e, r, n) {
  44. var i = e && e.prototype instanceof Generator ? e : Generator,
  45. a = _Object$create(i.prototype),
  46. c = new Context(n || []);
  47. return o(a, "_invoke", {
  48. value: makeInvokeMethod(t, r, c)
  49. }), a;
  50. }
  51. function tryCatch(t, e, r) {
  52. try {
  53. return {
  54. type: "normal",
  55. arg: t.call(e, r)
  56. };
  57. } catch (t) {
  58. return {
  59. type: "throw",
  60. arg: t
  61. };
  62. }
  63. }
  64. e.wrap = wrap;
  65. var h = "suspendedStart",
  66. l = "suspendedYield",
  67. f = "executing",
  68. s = "completed",
  69. y = {};
  70. function Generator() {}
  71. function GeneratorFunction() {}
  72. function GeneratorFunctionPrototype() {}
  73. var p = {};
  74. define(p, a, function () {
  75. return this;
  76. });
  77. var d = _Object$getPrototypeOf,
  78. v = d && d(d(values([])));
  79. v && v !== r && n.call(v, a) && (p = v);
  80. var g = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(p);
  81. function defineIteratorMethods(t) {
  82. var _context;
  83. _forEachInstanceProperty(_context = ["next", "throw", "return"]).call(_context, function (e) {
  84. define(t, e, function (t) {
  85. return this._invoke(e, t);
  86. });
  87. });
  88. }
  89. function AsyncIterator(t, e) {
  90. function invoke(r, o, i, a) {
  91. var c = tryCatch(t[r], t, o);
  92. if ("throw" !== c.type) {
  93. var u = c.arg,
  94. h = u.value;
  95. return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
  96. invoke("next", t, i, a);
  97. }, function (t) {
  98. invoke("throw", t, i, a);
  99. }) : e.resolve(h).then(function (t) {
  100. u.value = t, i(u);
  101. }, function (t) {
  102. return invoke("throw", t, i, a);
  103. });
  104. }
  105. a(c.arg);
  106. }
  107. var r;
  108. o(this, "_invoke", {
  109. value: function value(t, n) {
  110. function callInvokeWithMethodAndArg() {
  111. return new e(function (e, r) {
  112. invoke(t, n, e, r);
  113. });
  114. }
  115. return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  116. }
  117. });
  118. }
  119. function makeInvokeMethod(e, r, n) {
  120. var o = h;
  121. return function (i, a) {
  122. if (o === f) throw Error("Generator is already running");
  123. if (o === s) {
  124. if ("throw" === i) throw a;
  125. return {
  126. value: t,
  127. done: !0
  128. };
  129. }
  130. for (n.method = i, n.arg = a;;) {
  131. var c = n.delegate;
  132. if (c) {
  133. var u = maybeInvokeDelegate(c, n);
  134. if (u) {
  135. if (u === y) continue;
  136. return u;
  137. }
  138. }
  139. if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
  140. if (o === h) throw o = s, n.arg;
  141. n.dispatchException(n.arg);
  142. } else "return" === n.method && n.abrupt("return", n.arg);
  143. o = f;
  144. var p = tryCatch(e, r, n);
  145. if ("normal" === p.type) {
  146. if (o = n.done ? s : l, p.arg === y) continue;
  147. return {
  148. value: p.arg,
  149. done: n.done
  150. };
  151. }
  152. "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
  153. }
  154. };
  155. }
  156. function maybeInvokeDelegate(e, r) {
  157. var n = r.method,
  158. o = e.iterator[n];
  159. if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
  160. var i = tryCatch(o, e.iterator, r.arg);
  161. if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
  162. var a = i.arg;
  163. return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
  164. }
  165. function pushTryEntry(t) {
  166. var _context2;
  167. var e = {
  168. tryLoc: t[0]
  169. };
  170. 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), _pushInstanceProperty(_context2 = this.tryEntries).call(_context2, e);
  171. }
  172. function resetTryEntry(t) {
  173. var e = t.completion || {};
  174. e.type = "normal", delete e.arg, t.completion = e;
  175. }
  176. function Context(t) {
  177. this.tryEntries = [{
  178. tryLoc: "root"
  179. }], _forEachInstanceProperty(t).call(t, pushTryEntry, this), this.reset(!0);
  180. }
  181. function values(e) {
  182. if (e || "" === e) {
  183. var r = e[a];
  184. if (r) return r.call(e);
  185. if ("function" == typeof e.next) return e;
  186. if (!isNaN(e.length)) {
  187. var o = -1,
  188. i = function next() {
  189. for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
  190. return next.value = t, next.done = !0, next;
  191. };
  192. return i.next = i;
  193. }
  194. }
  195. throw new TypeError(_typeof(e) + " is not iterable");
  196. }
  197. return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
  198. value: GeneratorFunctionPrototype,
  199. configurable: !0
  200. }), o(GeneratorFunctionPrototype, "constructor", {
  201. value: GeneratorFunction,
  202. configurable: !0
  203. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
  204. var e = "function" == typeof t && t.constructor;
  205. return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
  206. }, e.mark = function (t) {
  207. return _Object$setPrototypeOf ? _Object$setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = _Object$create(g), t;
  208. }, e.awrap = function (t) {
  209. return {
  210. __await: t
  211. };
  212. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
  213. return this;
  214. }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
  215. void 0 === i && (i = _Promise);
  216. var a = new AsyncIterator(wrap(t, r, n, o), i);
  217. return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
  218. return t.done ? t.value : a.next();
  219. });
  220. }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
  221. return this;
  222. }), define(g, "toString", function () {
  223. return "[object Generator]";
  224. }), e.keys = function (t) {
  225. var e = Object(t),
  226. r = [];
  227. for (var n in e) _pushInstanceProperty(r).call(r, n);
  228. return _reverseInstanceProperty(r).call(r), function next() {
  229. for (; r.length;) {
  230. var t = r.pop();
  231. if (t in e) return next.value = t, next.done = !1, next;
  232. }
  233. return next.done = !0, next;
  234. };
  235. }, e.values = values, Context.prototype = {
  236. constructor: Context,
  237. reset: function reset(e) {
  238. var _context3;
  239. if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, _forEachInstanceProperty(_context3 = this.tryEntries).call(_context3, resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+_sliceInstanceProperty(r).call(r, 1)) && (this[r] = t);
  240. },
  241. stop: function stop() {
  242. this.done = !0;
  243. var t = this.tryEntries[0].completion;
  244. if ("throw" === t.type) throw t.arg;
  245. return this.rval;
  246. },
  247. dispatchException: function dispatchException(e) {
  248. if (this.done) throw e;
  249. var r = this;
  250. function handle(n, o) {
  251. return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
  252. }
  253. for (var o = this.tryEntries.length - 1; o >= 0; --o) {
  254. var i = this.tryEntries[o],
  255. a = i.completion;
  256. if ("root" === i.tryLoc) return handle("end");
  257. if (i.tryLoc <= this.prev) {
  258. var c = n.call(i, "catchLoc"),
  259. u = n.call(i, "finallyLoc");
  260. if (c && u) {
  261. if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
  262. if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
  263. } else if (c) {
  264. if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
  265. } else {
  266. if (!u) throw Error("try statement without catch or finally");
  267. if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
  268. }
  269. }
  270. }
  271. },
  272. abrupt: function abrupt(t, e) {
  273. for (var r = this.tryEntries.length - 1; r >= 0; --r) {
  274. var o = this.tryEntries[r];
  275. if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
  276. var i = o;
  277. break;
  278. }
  279. }
  280. i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
  281. var a = i ? i.completion : {};
  282. return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
  283. },
  284. complete: function complete(t, e) {
  285. if ("throw" === t.type) throw t.arg;
  286. return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
  287. },
  288. finish: function finish(t) {
  289. for (var e = this.tryEntries.length - 1; e >= 0; --e) {
  290. var r = this.tryEntries[e];
  291. if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
  292. }
  293. },
  294. "catch": function _catch(t) {
  295. for (var e = this.tryEntries.length - 1; e >= 0; --e) {
  296. var r = this.tryEntries[e];
  297. if (r.tryLoc === t) {
  298. var n = r.completion;
  299. if ("throw" === n.type) {
  300. var o = n.arg;
  301. resetTryEntry(r);
  302. }
  303. return o;
  304. }
  305. }
  306. throw Error("illegal catch attempt");
  307. },
  308. delegateYield: function delegateYield(e, r, n) {
  309. return this.delegate = {
  310. iterator: values(e),
  311. resultName: r,
  312. nextLoc: n
  313. }, "next" === this.method && (this.arg = t), y;
  314. }
  315. }, e;
  316. }
  317. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;