regeneratorRuntime.js 9.8 KB

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