@weapnl/js-junction 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +3 -3
- package/dist/index.js +124 -25
- package/index.d.ts +6 -6
- package/package.json +1 -1
- package/src/builder/model.js +19 -3
- package/src/connection.js +4 -4
- package/src/request.js +4 -1
- package/src/response/responseEventsHandler.js +4 -2
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ return /******/ (() => { // webpackBootstrap
|
|
|
26
26
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
27
27
|
|
|
28
28
|
"use strict";
|
|
29
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Api)\n/* harmony export */ });\n/* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./request */ \"./src/request.js\");\n/* harmony import */ var _batch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./batch */ \"./src/batch.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\nvar Api = /*#__PURE__*/function () {\n function Api() {\n _classCallCheck(this, Api);\n this.setHeader('X-Requested-With', 'XMLHttpRequest');\n this._requests = [];\n this.host('/').suffix('');\n this._onSuccess = null;\n this._onError = null;\n this._onValidationError = null;\n this._onUnauthorized = null;\n this._onForbidden = null;\n this._onFinished = null;\n this._onCancelled = null;\n }\n\n /**\n * @param {string} host\n *\n * @returns {this} The current instance.\n */\n _createClass(Api, [{\n key: \"host\",\n value: function host(_host) {\n this._host = _host;\n return this;\n }\n\n /**\n * @param {string} suffix\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"suffix\",\n value: function suffix(_suffix) {\n if (!_.startsWith(_suffix, '/') && _suffix) {\n _suffix = \"/\".concat(_suffix);\n }\n this._suffix = _suffix;\n return this;\n }\n\n /**\n * @returns {string} Url containing the host and suffix.\n */\n }, {\n key: \"baseUrl\",\n get: function get() {\n var url = '';\n if (this._host) url += this._host;\n if (this._suffix) url += this._suffix;\n return url;\n }\n\n /**\n * @param {Request} request\n */\n }, {\n key: \"cancelRunning\",\n value: function cancelRunning(request) {\n var _this$_requests$reque;\n if (!request.key) {\n return;\n }\n (_this$_requests$reque = this._requests[request.key]) === null || _this$_requests$reque === void 0 || _this$_requests$reque.cancel();\n this._requests[request.key] = request;\n }\n\n /**\n * @param {Request} request\n */\n }, {\n key: \"removeRequest\",\n value: function removeRequest(request) {\n if (!request.key) {\n return;\n }\n if (request.response.isFinished) {\n delete this._requests[request.key];\n }\n }\n\n /**\n * @param {string} uri\n *\n * @returns {Request} The created request.\n */\n }, {\n key: \"request\",\n value: function request(uri) {\n if (!uri) throw new Error(\"Request url is empty.\");\n if (!_.startsWith(uri, '/')) {\n uri = \"/\".concat(uri);\n }\n var request = new _request__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n request.setUrl(uri).setApi(this);\n if (this._onSuccess) request.onSuccess(this._onSuccess);\n if (this._onError) request.onError(this._onError);\n if (this._onValidationError) request.onValidationError(this._onValidationError);\n if (this._onUnauthorized) request.onUnauthorized(this._onUnauthorized);\n if (this._onForbidden) request.onForbidden(this._onForbidden);\n if (this._onFinished) request.onFinished(this._onFinished);\n if (this._onCancelled) request.onCancelled(this._onCancelled);\n return request;\n }\n\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"cancelRequests\",\n value: function cancelRequests() {\n this._requests.forEach(function (request) {\n request.cancel();\n });\n this._requests = [];\n return this;\n }\n\n /**\n * @param {array} requests\n * @returns Batch\n */\n }, {\n key: \"batch\",\n value: function batch(requests) {\n return new _batch__WEBPACK_IMPORTED_MODULE_1__[\"default\"](requests);\n }\n\n /**\n * @param {string} token\n */\n }, {\n key: \"setBearer\",\n value: function setBearer(token) {\n this.setHeader('Authorization', 'Bearer ' + token);\n }\n }, {\n key: \"resetBearer\",\n value: function resetBearer() {\n this.removeHeader('Authorization');\n }\n\n /**\n * @param {string} token\n */\n }, {\n key: \"setCsrf\",\n value: function setCsrf(token) {\n this.setHeader('X-CSRF-TOKEN', token);\n }\n }, {\n key: \"resetCsrf\",\n value: function resetCsrf() {\n this.removeHeader('X-CSRF-TOKEN');\n }\n\n /**\n * @param {string} key\n * @param {string} value\n */\n }, {\n key: \"setHeader\",\n value: function setHeader(key, value) {\n axios__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaults.headers.common[key] = value;\n }\n\n /**\n * @param {string} key\n */\n }, {\n key: \"removeHeader\",\n value: function removeHeader(key) {\n delete axios__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaults.headers.common[key];\n }\n\n /**\n * Set the default 'onSuccess' event handler.\n *\n * @param {function(Response.data)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onSuccess\",\n value: function onSuccess() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onSuccess = callback;\n return this;\n }\n\n /**\n * Set the default 'onError' event handler.\n *\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onError\",\n value: function onError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onError = callback;\n return this;\n }\n\n /**\n * Set the default 'onValidationError' event handler.\n *\n * @param {function(Response.validation)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onValidationError\",\n value: function onValidationError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onValidationError = callback;\n return this;\n }\n\n /**\n * Set the default 'onUnauthorized' event handler.\n *\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onUnauthorized\",\n value: function onUnauthorized() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onUnauthorized = callback;\n return this;\n }\n\n /**\n * Set the default 'onForbidden' event handler.\n *\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onForbidden\",\n value: function onForbidden() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onForbidden = callback;\n return this;\n }\n\n /**\n * Set the default 'onFinished' event handler.\n *\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onFinished\",\n value: function onFinished() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onFinished = callback;\n return this;\n }\n\n /**\n * Set the default 'onCancelled' event handler.\n *\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onCancelled\",\n value: function onCancelled() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onCancelled = callback;\n return this;\n }\n\n /**\n * @param {function(Response)} onSuccess\n * @param {function(Error)} onError\n *\n * @returns {this}\n */\n }, {\n key: \"responseInterceptors\",\n value: function responseInterceptors() {\n var onSuccess = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n var onError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};\n axios__WEBPACK_IMPORTED_MODULE_2__[\"default\"].interceptors.response.use(function (response) {\n onSuccess(response);\n return response;\n }, function (error) {\n onError(error);\n return Promise.reject(error);\n });\n return this;\n }\n }]);\n return Api;\n}();\n\n\n//# sourceURL=webpack://Api/./src/api.js?");
|
|
29
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Api)\n/* harmony export */ });\n/* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./request */ \"./src/request.js\");\n/* harmony import */ var _batch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./batch */ \"./src/batch.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var _mixins_responseEventsMixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mixins/responseEventsMixin */ \"./src/mixins/responseEventsMixin.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\n\n\n/**\n * @mixes responseEventsMixin\n */\nvar Api = /*#__PURE__*/function () {\n function Api() {\n _classCallCheck(this, Api);\n this.setHeader('X-Requested-With', 'XMLHttpRequest');\n this._requests = [];\n this.host('/').suffix('');\n this._initResponseEvents();\n }\n\n /**\n * @param {string} host\n *\n * @returns {this} The current instance.\n */\n _createClass(Api, [{\n key: \"host\",\n value: function host(_host) {\n this._host = _host;\n return this;\n }\n\n /**\n * @param {string} suffix\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"suffix\",\n value: function suffix(_suffix) {\n if (!_.startsWith(_suffix, '/') && _suffix) {\n _suffix = \"/\".concat(_suffix);\n }\n this._suffix = _suffix;\n return this;\n }\n\n /**\n * @returns {string} Url containing the host and suffix.\n */\n }, {\n key: \"baseUrl\",\n get: function get() {\n var url = '';\n if (this._host) url += this._host;\n if (this._suffix) url += this._suffix;\n return url;\n }\n\n /**\n * @param {Request} request\n */\n }, {\n key: \"cancelRunning\",\n value: function cancelRunning(request) {\n var _this$_requests$reque;\n if (!request.key) {\n return;\n }\n (_this$_requests$reque = this._requests[request.key]) === null || _this$_requests$reque === void 0 || _this$_requests$reque.cancel();\n this._requests[request.key] = request;\n }\n\n /**\n * @param {Request} request\n */\n }, {\n key: \"removeRequest\",\n value: function removeRequest(request) {\n if (!request.key) {\n return;\n }\n if (request.response.isFinished) {\n delete this._requests[request.key];\n }\n }\n\n /**\n * @param {string} uri\n *\n * @returns {Request} The created request.\n */\n }, {\n key: \"request\",\n value: function request(uri) {\n if (!uri) throw new Error(\"Request url is empty.\");\n if (!_.startsWith(uri, '/')) {\n uri = \"/\".concat(uri);\n }\n var request = new _request__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n request.setUrl(uri).setApi(this);\n return request;\n }\n\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"cancelRequests\",\n value: function cancelRequests() {\n this._requests.forEach(function (request) {\n request.cancel();\n });\n this._requests = [];\n return this;\n }\n\n /**\n * @param {array} requests\n * @returns Batch\n */\n }, {\n key: \"batch\",\n value: function batch(requests) {\n return new _batch__WEBPACK_IMPORTED_MODULE_1__[\"default\"](requests);\n }\n\n /**\n * @param {string} token\n */\n }, {\n key: \"setBearer\",\n value: function setBearer(token) {\n this.setHeader('Authorization', 'Bearer ' + token);\n }\n }, {\n key: \"resetBearer\",\n value: function resetBearer() {\n this.removeHeader('Authorization');\n }\n\n /**\n * @param {string} token\n */\n }, {\n key: \"setCsrf\",\n value: function setCsrf(token) {\n this.setHeader('X-CSRF-TOKEN', token);\n }\n }, {\n key: \"resetCsrf\",\n value: function resetCsrf() {\n this.removeHeader('X-CSRF-TOKEN');\n }\n\n /**\n * @param {string} key\n * @param {string} value\n */\n }, {\n key: \"setHeader\",\n value: function setHeader(key, value) {\n axios__WEBPACK_IMPORTED_MODULE_3__[\"default\"].defaults.headers.common[key] = value;\n }\n\n /**\n * @param {string} key\n */\n }, {\n key: \"removeHeader\",\n value: function removeHeader(key) {\n delete axios__WEBPACK_IMPORTED_MODULE_3__[\"default\"].defaults.headers.common[key];\n }\n\n /**\n * @param {function(Response)} onSuccess\n * @param {function(Error)} onError\n *\n * @returns {this}\n */\n }, {\n key: \"responseInterceptors\",\n value: function responseInterceptors() {\n var onSuccess = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n var onError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};\n axios__WEBPACK_IMPORTED_MODULE_3__[\"default\"].interceptors.response.use(function (response) {\n onSuccess(response);\n return response;\n }, function (error) {\n onError(error);\n return Promise.reject(error);\n });\n return this;\n }\n }]);\n return Api;\n}();\n\nObject.assign(Api.prototype, _mixins_responseEventsMixin__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n//# sourceURL=webpack://Api/./src/api.js?");
|
|
30
30
|
|
|
31
31
|
/***/ }),
|
|
32
32
|
|
|
@@ -59,7 +59,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
59
59
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
60
60
|
|
|
61
61
|
"use strict";
|
|
62
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Model)\n/* harmony export */ });\n/* harmony import */ var _properties_accessors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./properties/accessors */ \"./src/builder/properties/accessors.js\");\n/* harmony import */ var _properties_attributes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./properties/attributes */ \"./src/builder/properties/attributes.js\");\n/* harmony import */ var _properties_counts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./properties/counts */ \"./src/builder/properties/counts.js\");\n/* harmony import */ var _properties_relations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./properties/relations */ \"./src/builder/properties/relations.js\");\n/* harmony import */ var _properties_mediaCollections__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./properties/mediaCollections */ \"./src/builder/properties/mediaCollections.js\");\n/* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../request */ \"./src/request.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; 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; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; 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); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; 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; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\nvar Model = /*#__PURE__*/function (_Request) {\n _inherits(Model, _Request);\n var _super = _createSuper(Model);\n function Model() {\n var _this;\n var defaults = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, Model);\n _this = _super.call(this);\n _this._accessors = new _properties_accessors__WEBPACK_IMPORTED_MODULE_0__[\"default\"](_assertThisInitialized(_this));\n _this._attributes = new _properties_attributes__WEBPACK_IMPORTED_MODULE_1__[\"default\"](_assertThisInitialized(_this));\n _this._counts = new _properties_counts__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assertThisInitialized(_this));\n _this._relations = new _properties_relations__WEBPACK_IMPORTED_MODULE_3__[\"default\"](_assertThisInitialized(_this));\n _this._mediaCollections = new _properties_mediaCollections__WEBPACK_IMPORTED_MODULE_4__[\"default\"](_assertThisInitialized(_this));\n _this.setApi(api);\n _this.fill(defaults);\n return _this;\n }\n\n /**\n * Create an instance of the model for the given json object.\n *\n * @param {Object} json\n *\n * @returns {this} An instance of the model.\n */\n _createClass(Model, [{\n key: \"toJson\",\n value:\n /**\n * Convert the attributes of the current instance to json.\n *\n * @return {Object} The attributes of the current instance as json object.\n */\n function toJson() {\n return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, this._accessors.toJson(this)), this._attributes.toJson(this)), this._counts.toJson(this)), this._relations.toJson(this)), this._mediaCollections.toJson(this));\n }\n\n /**\n * @param values\n * @returns {this}\n */\n }, {\n key: \"fill\",\n value: function fill() {\n var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this._attributes.set(this, values);\n this._relations.set(this, values);\n return this;\n }\n\n /**\n * The accessors of the model which were appended on the api side.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"_identifier\",\n get:\n /**\n * @returns {int} Identifier attribute name of the model.\n */\n function get() {\n return _.get(this, 'id');\n }\n\n /**\n * Get a list of models.\n *\n * @returns {this[]} List of models.\n */\n }, {\n key: \"index\",\n value: function () {\n var _index = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this2 = this;\n var items;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n this._connection.cancelRunning(this);\n _context.next = 3;\n return this._connection.post(this._queryString() + '/index', this.bodyParameters);\n case 3:\n this._response = _context.sent;\n this._connection.removeRequest(this);\n if (this._response.data) {\n items = _.map(this._response.data.items, function (item) {\n return _this2.constructor.fromJson(item);\n });\n }\n _context.next = 8;\n return this.triggerResponseEvents(this._response, items);\n case 8:\n return _context.abrupt(\"return\", items);\n case 9:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function index() {\n return _index.apply(this, arguments);\n }\n return index;\n }()\n /**\n * Get a single model.\n *\n * @param {int} [identifier]\n *\n * @returns {this} Model found for the given id.\n */\n }, {\n key: \"show\",\n value: function () {\n var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(identifier) {\n var _identifier;\n var item;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n (_identifier = identifier) !== null && _identifier !== void 0 ? _identifier : identifier = this._identifier;\n if (identifier) {\n _context2.next = 3;\n break;\n }\n return _context2.abrupt(\"return\", null);\n case 3:\n this._connection.cancelRunning(this);\n _context2.next = 6;\n return this._connection.post(this._queryString(identifier) + '/show', this.bodyParameters);\n case 6:\n this._response = _context2.sent;\n this._connection.removeRequest(this);\n if (this._response.data) {\n item = this.constructor.fromJson(this._response.data);\n }\n _context2.next = 11;\n return this.triggerResponseEvents(this._response, item);\n case 11:\n return _context2.abrupt(\"return\", item);\n case 12:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function show(_x) {\n return _show.apply(this, arguments);\n }\n return show;\n }()\n /**\n * Create an model.\n *\n * @param {Object} [extraData] Extra data to send to the API\n *\n * @returns {this} The created model.\n */\n }, {\n key: \"store\",\n value: function () {\n var _store = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var extraData,\n item,\n _args3 = arguments;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n extraData = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};\n this._connection.cancelRunning(this);\n _context3.next = 4;\n return this._connection.post(this._queryString(), _objectSpread(_objectSpread(_objectSpread({}, this._attributes.toJson(this)), this._mediaCollections.toJson(this)), extraData));\n case 4:\n this._response = _context3.sent;\n this._connection.removeRequest(this);\n if (this._response.data) {\n item = this.constructor.fromJson(this._response.data);\n }\n _context3.next = 9;\n return this.triggerResponseEvents(this._response, item);\n case 9:\n return _context3.abrupt(\"return\", item);\n case 10:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function store() {\n return _store.apply(this, arguments);\n }\n return store;\n }()\n /**\n * Update the current model.\n *\n * @param {Object} [extraData] Extra data to send to the API\n *\n * @returns {this} The updated model.\n */\n }, {\n key: \"update\",\n value: function () {\n var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var extraData,\n item,\n _args4 = arguments;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n extraData = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};\n this._connection.cancelRunning(this);\n _context4.next = 4;\n return this._connection.put(this._queryString(this._identifier), _objectSpread(_objectSpread(_objectSpread({}, this._attributes.toJson(this)), this._mediaCollections.toJson(this)), extraData));\n case 4:\n this._response = _context4.sent;\n this._connection.removeRequest(this);\n if (this._response.data) {\n item = this.constructor.fromJson(this._response.data);\n }\n _context4.next = 9;\n return this.triggerResponseEvents(this._response, item);\n case 9:\n return _context4.abrupt(\"return\", item);\n case 10:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function update() {\n return _update.apply(this, arguments);\n }\n return update;\n }()\n /**\n * Delete the current model.\n *\n * @returns {boolean} Whether the deletion was successful.\n */\n }, {\n key: \"destroy\",\n value: function () {\n var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n this._connection.cancelRunning(this);\n _context5.next = 3;\n return this._connection[\"delete\"](this._queryString(this._identifier));\n case 3:\n this._response = _context5.sent;\n this._connection.removeRequest(this);\n _context5.next = 7;\n return this.triggerResponseEvents(this._response);\n case 7:\n return _context5.abrupt(\"return\", !!this._response.data);\n case 8:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function destroy() {\n return _destroy.apply(this, arguments);\n }\n return destroy;\n }()\n /**\n * Upload an temporary media file to the API.\n *\n * @param {array|File} [files] The uploaded file or files.\n * @param {string} [collection] The name of the file collection.\n *\n * @returns {array} The received media ids.\n */\n }, {\n key: \"upload\",\n value: function () {\n var _upload = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(files, collection) {\n var _this$_media;\n var filesArray, request;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n (_this$_media = this._media) !== null && _this$_media !== void 0 ? _this$_media : this._media = {};\n filesArray = (Array.isArray(files) ? files : [files]).filter(function (value) {\n return value !== null;\n });\n if (!(filesArray.length === 0)) {\n _context6.next = 5;\n break;\n }\n this._media[collection] = {};\n return _context6.abrupt(\"return\");\n case 5:\n _context6.next = 7;\n return this.storeFiles({\n files: _.flatMapDeep(filesArray)\n }, {}, '/media/upload');\n case 7:\n request = _context6.sent;\n this._media[collection] = request._response.data;\n return _context6.abrupt(\"return\", request._response.data);\n case 10:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function upload(_x2, _x3) {\n return _upload.apply(this, arguments);\n }\n return upload;\n }()\n /**\n * Save the current model. Based on the value of the identifier `store` or `update` will be called.\n *\n * @param {Object} [extraData] Extra data to send to the API\n *\n * @returns {this} The created or updated model.\n */\n }, {\n key: \"save\",\n value: function () {\n var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {\n var extraData,\n _args7 = arguments;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n extraData = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};\n return _context7.abrupt(\"return\", !this._identifier ? this.store(extraData) : this.update(extraData));\n case 2:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function save() {\n return _save.apply(this, arguments);\n }\n return save;\n }()\n /**\n * @returns {this} The new clone of the current model.\n */\n }, {\n key: \"clone\",\n value: function clone() {\n return this.constructor.fromJson(this.toJson());\n }\n\n /**\n * Generate the query string for this model.\n * @private\n *\n * @param {int} [identifier] The identifier of the model.\n *\n * @returns {string} The querystring for the model.\n */\n }, {\n key: \"_queryString\",\n value: function _queryString(identifier) {\n return this.constructor.endpoint + (identifier ? \"/\".concat(identifier) : '');\n }\n }], [{\n key: \"fromJson\",\n value: function fromJson(json) {\n var instance = new this();\n instance._accessors.fromJson(instance, json);\n instance._attributes.fromJson(instance, json);\n instance._counts.fromJson(instance, json);\n instance._relations.fromJson(instance, json);\n return instance;\n }\n }, {\n key: \"accessors\",\n value: function accessors() {\n return {};\n }\n\n /**\n * The attributes of the model.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"attributes\",\n value: function attributes() {\n return {};\n }\n\n /**\n * The counts of relations of the model.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"counts\",\n value: function counts() {\n return {};\n }\n\n /**\n * The relations of the model.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"relations\",\n value: function relations() {\n return {};\n }\n\n /**\n * The media collections of the model\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"mediaCollections\",\n value: function mediaCollections() {\n return {};\n }\n\n /**\n * @returns {string} Endpoint of the model for the API.\n */\n }, {\n key: \"endpoint\",\n get: function get() {\n throw new Error('No endpoint defined in the model.');\n }\n }]);\n return Model;\n}(_request__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n\n\n//# sourceURL=webpack://Api/./src/builder/model.js?");
|
|
62
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Model)\n/* harmony export */ });\n/* harmony import */ var _properties_accessors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./properties/accessors */ \"./src/builder/properties/accessors.js\");\n/* harmony import */ var _properties_attributes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./properties/attributes */ \"./src/builder/properties/attributes.js\");\n/* harmony import */ var _properties_counts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./properties/counts */ \"./src/builder/properties/counts.js\");\n/* harmony import */ var _properties_relations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./properties/relations */ \"./src/builder/properties/relations.js\");\n/* harmony import */ var _properties_mediaCollections__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./properties/mediaCollections */ \"./src/builder/properties/mediaCollections.js\");\n/* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../request */ \"./src/request.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; 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; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; 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); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; 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; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\nvar Model = /*#__PURE__*/function (_Request) {\n _inherits(Model, _Request);\n var _super = _createSuper(Model);\n function Model() {\n var _this;\n var defaults = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, Model);\n _this = _super.call(this);\n _this._accessors = new _properties_accessors__WEBPACK_IMPORTED_MODULE_0__[\"default\"](_assertThisInitialized(_this));\n _this._attributes = new _properties_attributes__WEBPACK_IMPORTED_MODULE_1__[\"default\"](_assertThisInitialized(_this));\n _this._counts = new _properties_counts__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assertThisInitialized(_this));\n _this._relations = new _properties_relations__WEBPACK_IMPORTED_MODULE_3__[\"default\"](_assertThisInitialized(_this));\n _this._mediaCollections = new _properties_mediaCollections__WEBPACK_IMPORTED_MODULE_4__[\"default\"](_assertThisInitialized(_this));\n _this.setApi(api);\n _this.fill(defaults);\n return _this;\n }\n\n /**\n * Create an instance of the model for the given json object.\n *\n * @param {Object} json\n *\n * @returns {this} An instance of the model.\n */\n _createClass(Model, [{\n key: \"toJson\",\n value:\n /**\n * Convert the attributes of the current instance to json.\n *\n * @return {Object} The attributes of the current instance as json object.\n */\n function toJson() {\n return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, this._accessors.toJson(this)), this._attributes.toJson(this)), this._counts.toJson(this)), this._relations.toJson(this)), this._mediaCollections.toJson(this));\n }\n\n /**\n * @param values\n * @returns {this}\n */\n }, {\n key: \"fill\",\n value: function fill() {\n var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this._attributes.set(this, values);\n this._relations.set(this, values);\n return this;\n }\n\n /**\n * The accessors of the model which were appended on the api side.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"_identifier\",\n get:\n /**\n * @returns {int} Identifier attribute name of the model.\n */\n function get() {\n return _.get(this, 'id');\n }\n\n /**\n * Get a list of models.\n *\n * @returns {this[]} List of models.\n */\n }, {\n key: \"index\",\n value: function () {\n var _index = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this2 = this;\n var items, responseEventsHandler;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n this._connection.cancelRunning(this);\n _context.next = 3;\n return this._connection.post(this._queryString() + '/index', this.bodyParameters);\n case 3:\n this._response = _context.sent;\n this._connection.removeRequest(this);\n if (this._response.data) {\n items = _.map(this._response.data.items, function (item) {\n return _this2.constructor.fromJson(item);\n });\n }\n responseEventsHandler = this._createResponseEventsHandler();\n responseEventsHandler.setOnSuccessData(items);\n _context.next = 10;\n return responseEventsHandler.triggerResponseEvents(this._response);\n case 10:\n this.clearAllCallbacks();\n return _context.abrupt(\"return\", items);\n case 12:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function index() {\n return _index.apply(this, arguments);\n }\n return index;\n }()\n /**\n * Get a single model.\n *\n * @param {int} [identifier]\n *\n * @returns {this} Model found for the given id.\n */\n }, {\n key: \"show\",\n value: function () {\n var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(identifier) {\n var _identifier;\n var item, responseEventsHandler;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n (_identifier = identifier) !== null && _identifier !== void 0 ? _identifier : identifier = this._identifier;\n if (identifier) {\n _context2.next = 3;\n break;\n }\n return _context2.abrupt(\"return\", null);\n case 3:\n this._connection.cancelRunning(this);\n _context2.next = 6;\n return this._connection.post(this._queryString(identifier) + '/show', this.bodyParameters);\n case 6:\n this._response = _context2.sent;\n this._connection.removeRequest(this);\n if (this._response.data) {\n item = this.constructor.fromJson(this._response.data);\n }\n responseEventsHandler = this._createResponseEventsHandler();\n responseEventsHandler.setOnSuccessData(item);\n _context2.next = 13;\n return responseEventsHandler.triggerResponseEvents(this._response);\n case 13:\n this.clearAllCallbacks();\n return _context2.abrupt(\"return\", item);\n case 15:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function show(_x) {\n return _show.apply(this, arguments);\n }\n return show;\n }()\n /**\n * Create an model.\n *\n * @param {Object} [extraData] Extra data to send to the API\n *\n * @returns {this} The created model.\n */\n }, {\n key: \"store\",\n value: function () {\n var _store = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var _ref;\n var extraData,\n item,\n responseEventsHandler,\n _args3 = arguments;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n extraData = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};\n this._connection.cancelRunning(this);\n _context3.next = 4;\n return this._connection.post(this._queryString(), _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, this._attributes.toJson(this)), this._mediaCollections.toJson(this)), (_ref = _).merge.apply(_ref, _toConsumableArray(this._customParameters))), extraData));\n case 4:\n this._response = _context3.sent;\n this._connection.removeRequest(this);\n if (this._response.data) {\n item = this.constructor.fromJson(this._response.data);\n }\n responseEventsHandler = this._createResponseEventsHandler();\n responseEventsHandler.setOnSuccessData(item);\n _context3.next = 11;\n return responseEventsHandler.triggerResponseEvents(this._response);\n case 11:\n this.clearAllCallbacks();\n return _context3.abrupt(\"return\", item);\n case 13:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function store() {\n return _store.apply(this, arguments);\n }\n return store;\n }()\n /**\n * Update the current model.\n *\n * @param {Object} [extraData] Extra data to send to the API\n *\n * @returns {this} The updated model.\n */\n }, {\n key: \"update\",\n value: function () {\n var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _ref2;\n var extraData,\n item,\n responseEventsHandler,\n _args4 = arguments;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n extraData = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};\n this._connection.cancelRunning(this);\n _context4.next = 4;\n return this._connection.put(this._queryString(this._identifier), _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, this._attributes.toJson(this)), this._mediaCollections.toJson(this)), (_ref2 = _).merge.apply(_ref2, _toConsumableArray(this._customParameters))), extraData));\n case 4:\n this._response = _context4.sent;\n this._connection.removeRequest(this);\n if (this._response.data) {\n item = this.constructor.fromJson(this._response.data);\n }\n responseEventsHandler = this._createResponseEventsHandler();\n responseEventsHandler.setOnSuccessData(item);\n _context4.next = 11;\n return responseEventsHandler.triggerResponseEvents(this._response);\n case 11:\n this.clearAllCallbacks();\n return _context4.abrupt(\"return\", item);\n case 13:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function update() {\n return _update.apply(this, arguments);\n }\n return update;\n }()\n /**\n * Delete the current model.\n *\n * @param {Object} [extraData] Extra data to send to the API\n *\n * @returns {boolean} Whether the deletion was successful.\n */\n }, {\n key: \"destroy\",\n value: function () {\n var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n var _ref3;\n var extraData,\n responseEventsHandler,\n _args5 = arguments;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n extraData = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};\n this._connection.cancelRunning(this);\n _context5.next = 4;\n return this._connection[\"delete\"](this._queryString(this._identifier), _objectSpread(_objectSpread({}, (_ref3 = _).merge.apply(_ref3, _toConsumableArray(this._customParameters))), extraData));\n case 4:\n this._response = _context5.sent;\n this._connection.removeRequest(this);\n responseEventsHandler = this._createResponseEventsHandler();\n _context5.next = 9;\n return responseEventsHandler.triggerResponseEvents(this._response);\n case 9:\n this.clearAllCallbacks();\n return _context5.abrupt(\"return\", !!this._response.data);\n case 11:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function destroy() {\n return _destroy.apply(this, arguments);\n }\n return destroy;\n }()\n /**\n * Upload an temporary media file to the API.\n *\n * @param {array|File} [files] The uploaded file or files.\n * @param {string} [collection] The name of the file collection.\n *\n * @returns {array} The received media ids.\n */\n }, {\n key: \"upload\",\n value: function () {\n var _upload = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(files, collection) {\n var _this$_media;\n var filesArray, request;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n (_this$_media = this._media) !== null && _this$_media !== void 0 ? _this$_media : this._media = {};\n filesArray = (Array.isArray(files) ? files : [files]).filter(function (value) {\n return value !== null;\n });\n if (!(filesArray.length === 0)) {\n _context6.next = 5;\n break;\n }\n this._media[collection] = {};\n return _context6.abrupt(\"return\");\n case 5:\n _context6.next = 7;\n return this.storeFiles({\n files: _.flatMapDeep(filesArray)\n }, {}, '/media/upload');\n case 7:\n request = _context6.sent;\n this._media[collection] = request._response.data;\n return _context6.abrupt(\"return\", request._response.data);\n case 10:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function upload(_x2, _x3) {\n return _upload.apply(this, arguments);\n }\n return upload;\n }()\n /**\n * Save the current model. Based on the value of the identifier `store` or `update` will be called.\n *\n * @param {Object} [extraData] Extra data to send to the API\n *\n * @returns {this} The created or updated model.\n */\n }, {\n key: \"save\",\n value: function () {\n var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {\n var extraData,\n _args7 = arguments;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n extraData = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};\n return _context7.abrupt(\"return\", !this._identifier ? this.store(extraData) : this.update(extraData));\n case 2:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function save() {\n return _save.apply(this, arguments);\n }\n return save;\n }()\n /**\n * @returns {this} The new clone of the current model.\n */\n }, {\n key: \"clone\",\n value: function clone() {\n return this.constructor.fromJson(this.toJson());\n }\n\n /**\n * Generate the query string for this model.\n * @private\n *\n * @param {int} [identifier] The identifier of the model.\n *\n * @returns {string} The querystring for the model.\n */\n }, {\n key: \"_queryString\",\n value: function _queryString(identifier) {\n return this.constructor.endpoint + (identifier ? \"/\".concat(identifier) : '');\n }\n }], [{\n key: \"fromJson\",\n value: function fromJson(json) {\n var instance = new this();\n instance._accessors.fromJson(instance, json);\n instance._attributes.fromJson(instance, json);\n instance._counts.fromJson(instance, json);\n instance._relations.fromJson(instance, json);\n return instance;\n }\n }, {\n key: \"accessors\",\n value: function accessors() {\n return {};\n }\n\n /**\n * The attributes of the model.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"attributes\",\n value: function attributes() {\n return {};\n }\n\n /**\n * The counts of relations of the model.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"counts\",\n value: function counts() {\n return {};\n }\n\n /**\n * The relations of the model.\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"relations\",\n value: function relations() {\n return {};\n }\n\n /**\n * The media collections of the model\n *\n * @returns {Object.<any, Object>}\n */\n }, {\n key: \"mediaCollections\",\n value: function mediaCollections() {\n return {};\n }\n\n /**\n * @returns {string} Endpoint of the model for the API.\n */\n }, {\n key: \"endpoint\",\n get: function get() {\n throw new Error('No endpoint defined in the model.');\n }\n }]);\n return Model;\n}(_request__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n\n\n//# sourceURL=webpack://Api/./src/builder/model.js?");
|
|
63
63
|
|
|
64
64
|
/***/ }),
|
|
65
65
|
|
|
@@ -125,7 +125,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
125
125
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
126
126
|
|
|
127
127
|
"use strict";
|
|
128
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Connection)\n/* harmony export */ });\n/* harmony import */ var _response__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./response */ \"./src/response.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; 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; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; 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); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; 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; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\nvar Connection = /*#__PURE__*/function () {\n function Connection() {\n _classCallCheck(this, Connection);\n this._abortController = null;\n this._config = {};\n this._api = null;\n this.running = false;\n this.canceled = false;\n this.failed = false;\n }\n _createClass(Connection, [{\n key: \"cancel\",\n value: function cancel() {\n if (!this._abortController || !this.running) return this;\n this._abortController.abort();\n this.canceled = true;\n }\n }, {\n key: \"cancelRunning\",\n value: function cancelRunning(request) {\n this._api.cancelRunning(request);\n }\n }, {\n key: \"removeRequest\",\n value: function removeRequest(request) {\n this._api.removeRequest(request);\n }\n }, {\n key: \"getConfig\",\n value: function getConfig() {\n return this._config;\n }\n }, {\n key: \"setConfig\",\n value: function setConfig(config) {\n this._config = config;\n }\n }, {\n key: \"setApi\",\n value: function setApi(api) {\n this._api = api;\n }\n }, {\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(query, params) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", this._execute(query, 'get', params));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function get(_x, _x2) {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(query, data) {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", this._execute(query, 'post', data));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function post(_x3, _x4) {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(query, params) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", this._execute(query, 'put', params));\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function put(_x5, _x6) {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(query) {\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt(\"return\", this._execute(query, 'delete'));\n case 1:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _delete(_x7) {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n }, {\n key: \"_execute\",\n value: function () {\n var _execute2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(url, method, data) {\n var _this = this;\n var config, request, response;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n this.running = true;\n if (!_.startsWith(url, '/')) {\n url = \"/\".concat(url);\n }\n config = _objectSpread(_objectSpread({\n url: (this._api ? this._api.baseUrl : api.baseUrl) + url,\n method: method\n }, _defineProperty({}, method === 'get' ? 'params' : 'data', data)), {}, {\n signal: (this._abortController = new AbortController()).signal\n });\n request = (0,axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Object.assign(config, this._config));\n response = new _response__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n _context5.next = 7;\n return request.then(function (axiosResponse) {\n response.setAxiosResponse(axiosResponse);\n })[\"catch\"](function (axiosError) {\n _this.failed = true;\n response.setAxiosError(axiosError);\n })[\"finally\"](function () {\n _this.running = false;\n });\n case 7:\n return _context5.abrupt(\"return\", response);\n case 8:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function _execute(_x8, _x9, _x10) {\n return _execute2.apply(this, arguments);\n }\n return _execute;\n }()\n }]);\n return Connection;\n}();\n\n\n//# sourceURL=webpack://Api/./src/connection.js?");
|
|
128
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Connection)\n/* harmony export */ });\n/* harmony import */ var _response__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./response */ \"./src/response.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; 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; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; 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); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; 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; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\nvar Connection = /*#__PURE__*/function () {\n function Connection() {\n _classCallCheck(this, Connection);\n this._abortController = null;\n this._config = {};\n this._api = null;\n this.running = false;\n this.canceled = false;\n this.failed = false;\n }\n _createClass(Connection, [{\n key: \"cancel\",\n value: function cancel() {\n if (!this._abortController || !this.running) return this;\n this._abortController.abort();\n this.canceled = true;\n }\n }, {\n key: \"cancelRunning\",\n value: function cancelRunning(request) {\n this._api.cancelRunning(request);\n }\n }, {\n key: \"removeRequest\",\n value: function removeRequest(request) {\n this._api.removeRequest(request);\n }\n }, {\n key: \"getConfig\",\n value: function getConfig() {\n return this._config;\n }\n }, {\n key: \"setConfig\",\n value: function setConfig(config) {\n this._config = config;\n }\n }, {\n key: \"setApi\",\n value: function setApi(api) {\n this._api = api;\n }\n }, {\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(query, params) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt(\"return\", this._execute(query, 'get', params));\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function get(_x, _x2) {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(query, data) {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", this._execute(query, 'post', data));\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function post(_x3, _x4) {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(query, data) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", this._execute(query, 'put', data));\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function put(_x5, _x6) {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(query, data) {\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt(\"return\", this._execute(query, 'delete', data));\n case 1:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _delete(_x7, _x8) {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n }, {\n key: \"_execute\",\n value: function () {\n var _execute2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(url, method, data) {\n var _this = this;\n var config, request, response;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n this.running = true;\n if (!_.startsWith(url, '/')) {\n url = \"/\".concat(url);\n }\n config = _objectSpread(_objectSpread({\n url: (this._api ? this._api.baseUrl : api.baseUrl) + url,\n method: method\n }, _defineProperty({}, method === 'get' ? 'params' : 'data', data)), {}, {\n signal: (this._abortController = new AbortController()).signal\n });\n request = (0,axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Object.assign(config, this._config));\n response = new _response__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n _context5.next = 7;\n return request.then(function (axiosResponse) {\n response.setAxiosResponse(axiosResponse);\n })[\"catch\"](function (axiosError) {\n _this.failed = true;\n response.setAxiosError(axiosError);\n })[\"finally\"](function () {\n _this.running = false;\n });\n case 7:\n return _context5.abrupt(\"return\", response);\n case 8:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function _execute(_x9, _x10, _x11) {\n return _execute2.apply(this, arguments);\n }\n return _execute;\n }()\n }]);\n return Connection;\n}();\n\n\n//# sourceURL=webpack://Api/./src/connection.js?");
|
|
129
129
|
|
|
130
130
|
/***/ }),
|
|
131
131
|
|
|
@@ -316,6 +316,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
316
316
|
|
|
317
317
|
/***/ }),
|
|
318
318
|
|
|
319
|
+
/***/ "./src/mixins/responseEventsMixin.js":
|
|
320
|
+
/*!*******************************************!*\
|
|
321
|
+
!*** ./src/mixins/responseEventsMixin.js ***!
|
|
322
|
+
\*******************************************/
|
|
323
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
324
|
+
|
|
325
|
+
"use strict";
|
|
326
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _response_responseEvents__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../response/responseEvents */ \"./src/response/responseEvents.js\");\n\n\n/**\n * @mixin responseEventsMixin\n */\nvar responseEventsMixin = {\n /**\n * Constructor of the mixin.\n *\n * @private\n */\n _initResponseEvents: function _initResponseEvents() {\n this._responseEvents = new _response_responseEvents__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n },\n /**\n * Add `onSuccess` callback to be called after the request.\n *\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n onSuccess: function onSuccess() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._responseEvents.addOnSuccessCallback(callback);\n return this;\n },\n /**\n * Add `onError` callback to be called after the request.\n *\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n onError: function onError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._responseEvents.addOnErrorCallback(callback);\n return this;\n },\n /**\n * Add `onValidationError` callback to be called after the request.\n *\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n onValidationError: function onValidationError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._responseEvents.addOnValidationErrorCallback(callback);\n return this;\n },\n /**\n * Add `onUnauthorized` callback to be called after the request.\n *\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n onUnauthorized: function onUnauthorized() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._responseEvents.addOnUnauthorizedCallback(callback);\n return this;\n },\n /**\n * Add `onForbidden` callback to be called after the request.\n *\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n onForbidden: function onForbidden() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._responseEvents.addOnForbiddenCallback(callback);\n return this;\n },\n /**\n * Add `onFinished` callback to be called after the request.\n *\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n onFinished: function onFinished() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._responseEvents.addOnFinishedCallback(callback);\n return this;\n },\n /**\n * Add `onCancelled` callback to be called after the request.\n *\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n onCancelled: function onCancelled() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._responseEvents.addOnCancelledCallback(callback);\n return this;\n },\n /**\n * Clears all callbacks.\n *\n * @returns {this} The current instance.\n */\n clearAllCallbacks: function clearAllCallbacks() {\n this._responseEvents.clearAllCallbacks();\n return this;\n },\n /**\n * Clears all `onSuccess` callbacks.\n *\n * @returns {this} The current instance.\n */\n clearOnSuccessCallbacks: function clearOnSuccessCallbacks() {\n this._responseEvents.clearOnSuccessCallbacks();\n return this;\n },\n /**\n * Clears all `onError` callbacks.\n *\n * @returns {this} The current instance.\n */\n clearOnErrorCallbacks: function clearOnErrorCallbacks() {\n this._responseEvents.clearOnErrorCallbacks();\n return this;\n },\n /**\n * Clears all `onValidationError` callbacks.\n *\n * @returns {this} The current instance.\n */\n clearOnValidationErrorCallbacks: function clearOnValidationErrorCallbacks() {\n this._responseEvents.clearOnValidationErrorCallbacks();\n return this;\n },\n /**\n * Clears all `onUnauthorized` callbacks.\n *\n * @returns {this} The current instance.\n */\n clearOnUnauthorizedCallbacks: function clearOnUnauthorizedCallbacks() {\n this._responseEvents.clearOnUnauthorizedCallbacks();\n return this;\n },\n /**\n * Clears all `onForbidden` callbacks.\n *\n * @returns {this} The current instance.\n */\n clearOnForbiddenCallbacks: function clearOnForbiddenCallbacks() {\n this._responseEvents.clearOnForbiddenCallbacks();\n return this;\n },\n /**\n * Clears all `onFinished` callbacks.\n *\n * @returns {this} The current instance.\n */\n clearOnFinishedCallbacks: function clearOnFinishedCallbacks() {\n this._responseEvents.clearOnFinishedCallbacks();\n return this;\n },\n /**\n * Clears all `onCancelled` callbacks.\n *\n * @returns {this} The current instance.\n */\n clearOnCancelledCallbacks: function clearOnCancelledCallbacks() {\n this._responseEvents.clearOnCancelledCallbacks();\n return this;\n }\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (responseEventsMixin);\n\n//# sourceURL=webpack://Api/./src/mixins/responseEventsMixin.js?");
|
|
327
|
+
|
|
328
|
+
/***/ }),
|
|
329
|
+
|
|
319
330
|
/***/ "./src/modifiers/appends.js":
|
|
320
331
|
/*!**********************************!*\
|
|
321
332
|
!*** ./src/modifiers/appends.js ***!
|
|
@@ -367,7 +378,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
367
378
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
368
379
|
|
|
369
380
|
"use strict";
|
|
370
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Request)\n/* harmony export */ });\n/* harmony import */ var _request_action__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./request/action */ \"./src/request/action.js\");\n/* harmony import */ var _connection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./connection */ \"./src/connection.js\");\n/* harmony import */ var _filters_filters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filters/filters */ \"./src/filters/filters.js\");\n/* harmony import */ var _modifiers_modifiers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modifiers/modifiers */ \"./src/modifiers/modifiers.js\");\n/* harmony import */ var _request_pagination__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./request/pagination */ \"./src/request/pagination.js\");\n/* harmony import */ var _mixins_actionMixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mixins/actionMixin */ \"./src/mixins/actionMixin.js\");\n/* harmony import */ var _mixins_filterMixin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mixins/filterMixin */ \"./src/mixins/filterMixin.js\");\n/* harmony import */ var _mixins_modifierMixin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./mixins/modifierMixin */ \"./src/mixins/modifierMixin.js\");\n/* harmony import */ var _mixins_paginationMixin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./mixins/paginationMixin */ \"./src/mixins/paginationMixin.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; 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; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; 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); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; 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; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\n\n\n\n\n\n\n\n/**\n * @mixes actionMixin\n * @mixes filterMixin\n * @mixes modifierMixin\n * @mixes paginationMixin\n */\nvar Request = /*#__PURE__*/function () {\n function Request() {\n _classCallCheck(this, Request);\n this.url = null;\n this._action = new _request_action__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n this._filters = new _filters_filters__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n this._modifiers = new _modifiers_modifiers__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n this._pagination = new _request_pagination__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n this._customParameters = [];\n this._onSuccessCallbacks = [];\n this._onErrorCallbacks = [];\n this._onValidationErrorCallbacks = [];\n this._onUnauthorizedCallbacks = [];\n this._onForbiddenCallbacks = [];\n this._onFinishedCallbacks = [];\n this._onCancelledCallbacks = [];\n this._connection = new _connection__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this._response = null;\n this.key = null;\n }\n _createClass(Request, [{\n key: \"setKey\",\n value: function setKey(key) {\n this.key = key;\n return this;\n }\n }, {\n key: \"response\",\n get: function get() {\n return this._response;\n }\n\n /**\n * @param {string} url\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"setUrl\",\n value: function setUrl(url) {\n this.url = url;\n return this;\n }\n\n /**\n * @param {object} config\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"setConfig\",\n value: function setConfig(config) {\n this._connection.setConfig(_.merge(this._connection.getConfig(), config));\n return this;\n }\n\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"cancel\",\n value: function cancel() {\n this._connection.cancel();\n return this;\n }\n\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this$url;\n var url;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n url = (_this$url = this.url) !== null && _this$url !== void 0 ? _this$url : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n _context.next = 4;\n return this._connection.get(url, this.bodyParameters);\n case 4:\n this._response = _context.sent;\n this._connection.removeRequest(this);\n _context.next = 8;\n return this.triggerResponseEvents(this._response);\n case 8:\n return _context.abrupt(\"return\", this);\n case 9:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function get() {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n /**\n * @param {Object} data\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var _this$url2;\n var data,\n url,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n data = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};\n url = (_this$url2 = this.url) !== null && _this$url2 !== void 0 ? _this$url2 : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n _context2.next = 5;\n return this._connection.post(url, _objectSpread(_objectSpread({}, data), this.bodyParameters));\n case 5:\n this._response = _context2.sent;\n this._connection.removeRequest(this);\n _context2.next = 9;\n return this.triggerResponseEvents(this._response);\n case 9:\n return _context2.abrupt(\"return\", this);\n case 10:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function post() {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n /**\n * @param {Object} data\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var _this$url3;\n var data,\n url,\n _args3 = arguments;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n data = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};\n url = (_this$url3 = this.url) !== null && _this$url3 !== void 0 ? _this$url3 : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n _context3.next = 5;\n return this._connection.put(url, _objectSpread(_objectSpread({}, data), this.bodyParameters));\n case 5:\n this._response = _context3.sent;\n this._connection.removeRequest(this);\n _context3.next = 9;\n return this.triggerResponseEvents(this._response);\n case 9:\n return _context3.abrupt(\"return\", this);\n case 10:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function put() {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _this$url4;\n var url;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n url = (_this$url4 = this.url) !== null && _this$url4 !== void 0 ? _this$url4 : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n _context4.next = 4;\n return this._connection[\"delete\"](url);\n case 4:\n this._response = _context4.sent;\n this._connection.removeRequest(this);\n _context4.next = 8;\n return this.triggerResponseEvents(this._response);\n case 8:\n return _context4.abrupt(\"return\", this);\n case 9:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _delete() {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n /**\n * @param {Object} files\n * @param {Object} data\n * @param {string|null} url\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"storeFiles\",\n value: function () {\n var _storeFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n var _ref;\n var files,\n data,\n url,\n queryUrl,\n formData,\n _args5 = arguments;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n files = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};\n data = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};\n url = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : null;\n queryUrl = (_ref = url !== null && url !== void 0 ? url : this.url) !== null && _ref !== void 0 ? _ref : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n this.setConfig({\n headers: {\n 'Content-Type': 'multipart/form-data'\n }\n });\n formData = this._createFormData(_.merge({}, files, data));\n if (!_.isEmpty(this.bodyParameters)) {\n queryUrl = \"\".concat(queryUrl, \"?\").concat(this.bodyParameters);\n }\n _context5.next = 10;\n return this._connection.post(queryUrl, formData);\n case 10:\n this._response = _context5.sent;\n this._connection.removeRequest(this);\n this.setConfig({\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n _context5.next = 15;\n return this.triggerResponseEvents(this._response);\n case 15:\n return _context5.abrupt(\"return\", this);\n case 16:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function storeFiles() {\n return _storeFiles.apply(this, arguments);\n }\n return storeFiles;\n }()\n /**\n * @returns {Object} Filter and modifier query parameters.\n */\n }, {\n key: \"bodyParameters\",\n get: function get() {\n var _ref2, _ref3;\n return (_ref2 = _).merge.apply(_ref2, _toConsumableArray(_.compact([this._filters.toObject(), this._modifiers.toObject(), this._pagination.toObject(), this._action.toObject(), (_ref3 = _).merge.apply(_ref3, _toConsumableArray(this._customParameters))])));\n }\n\n /**\n * @param {function(Response.data)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onSuccess\",\n value: function onSuccess() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onSuccessCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onError\",\n value: function onError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onErrorCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function(Response.validation)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onValidationError\",\n value: function onValidationError() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onValidationErrorCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onUnauthorized\",\n value: function onUnauthorized() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onUnauthorizedCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onForbidden\",\n value: function onForbidden() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onForbiddenCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onFinished\",\n value: function onFinished() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onFinishedCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function(Response)} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"onCancelled\",\n value: function onCancelled() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onCancelledCallbacks.push(callback);\n return this;\n }\n\n /**\n * Clears all `onSuccess` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnSuccessCallbacks\",\n value: function clearOnSuccessCallbacks() {\n this._onSuccessCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onError` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnErrorCallbacks\",\n value: function clearOnErrorCallbacks() {\n this._onErrorCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onValidationError` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnValidationErrorCallbacks\",\n value: function clearOnValidationErrorCallbacks() {\n this._onValidationErrorCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onUnauthorized` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnUnauthorizedCallbacks\",\n value: function clearOnUnauthorizedCallbacks() {\n this._onUnauthorizedCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onForbidden` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnForbiddenCallbacks\",\n value: function clearOnForbiddenCallbacks() {\n this._onForbiddenCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onFinished` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnFinishedCallbacks\",\n value: function clearOnFinishedCallbacks() {\n this._onFinishedCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onCancelled` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnCancelledCallbacks\",\n value: function clearOnCancelledCallbacks() {\n this._onCancelledCallbacks = [];\n return this;\n }\n\n /**\n * @param {Response} response\n * @param {*} successResponse\n */\n }, {\n key: \"triggerResponseEvents\",\n value: function () {\n var _triggerResponseEvents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(response) {\n var successResponse,\n executeCallbacks,\n validation,\n _args7 = arguments;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n executeCallbacks = function _executeCallbacks(callbacks) {\n for (var _len = arguments.length, data = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n data[_key - 1] = arguments[_key];\n }\n return Promise.all(callbacks.map( /*#__PURE__*/function () {\n var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(callback) {\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return callback.apply(void 0, data);\n case 2:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6);\n }));\n return function (_x2) {\n return _ref4.apply(this, arguments);\n };\n }()));\n };\n successResponse = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : null;\n if (!(response.statusCode >= 200 && response.statusCode < 300)) {\n _context7.next = 7;\n break;\n }\n _context7.next = 5;\n return executeCallbacks.apply(void 0, [this._onSuccessCallbacks].concat(_toConsumableArray([successResponse, response.data].filter(function (value) {\n return !!value;\n }))));\n case 5:\n _context7.next = 24;\n break;\n case 7:\n _context7.t0 = response.statusCode;\n _context7.next = _context7.t0 === 401 ? 10 : _context7.t0 === 403 ? 13 : _context7.t0 === 422 ? 16 : 21;\n break;\n case 10:\n _context7.next = 12;\n return executeCallbacks(this._onUnauthorizedCallbacks, response);\n case 12:\n return _context7.abrupt(\"break\", 24);\n case 13:\n _context7.next = 15;\n return executeCallbacks(this._onForbiddenCallbacks, response);\n case 15:\n return _context7.abrupt(\"break\", 24);\n case 16:\n validation = {\n message: response.validation.message,\n errors: {}\n };\n _.each(response.validation.errors, function (value, key) {\n return _.set(validation.errors, key, value);\n });\n _context7.next = 20;\n return executeCallbacks(this._onValidationErrorCallbacks, validation);\n case 20:\n return _context7.abrupt(\"break\", 24);\n case 21:\n _context7.next = 23;\n return executeCallbacks(this._onErrorCallbacks, response);\n case 23:\n return _context7.abrupt(\"break\", 24);\n case 24:\n if (!response.isFinished) {\n _context7.next = 27;\n break;\n }\n _context7.next = 27;\n return executeCallbacks(this._onFinishedCallbacks, response);\n case 27:\n if (!response.isCancelled) {\n _context7.next = 30;\n break;\n }\n _context7.next = 30;\n return executeCallbacks(this._onCancelledCallbacks, response);\n case 30:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function triggerResponseEvents(_x) {\n return _triggerResponseEvents.apply(this, arguments);\n }\n return triggerResponseEvents;\n }()\n /**\n * Add custom parameters to the request.\n *\n * @param {Object} parameters\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"customParameters\",\n value: function customParameters() {\n var parameters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this._customParameters.push(parameters);\n return this;\n }\n\n /**\n * Convert data to FormData.\n *\n * @param {Object} data\n *\n * @returns {FormData}\n */\n }, {\n key: \"_createFormData\",\n value: function _createFormData() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var formData = new FormData();\n function appendFormData(data, name) {\n name = name || '';\n if (data instanceof File) {\n formData.append(name, data);\n } else if (data === true || data === false) {\n formData.append(name, data ? '1' : '0');\n } else if (_.isArray(data) || _.isObject(data)) {\n if (_.size(data) <= 0) {\n formData.append(name, '');\n } else {\n _.forOwn(data, function (dataItem, key) {\n var newName = name === '' ? key : name + '[' + key + ']';\n appendFormData(dataItem, newName);\n });\n }\n } else {\n formData.append(name, data);\n }\n }\n appendFormData(data);\n return formData;\n }\n\n /**\n * @param {Api} api\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"setApi\",\n value: function setApi(api) {\n this._connection.setApi(api);\n return this;\n }\n }]);\n return Request;\n}();\n\nObject.assign(Request.prototype, _mixins_actionMixin__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\nObject.assign(Request.prototype, _mixins_filterMixin__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\nObject.assign(Request.prototype, _mixins_modifierMixin__WEBPACK_IMPORTED_MODULE_7__[\"default\"]);\nObject.assign(Request.prototype, _mixins_paginationMixin__WEBPACK_IMPORTED_MODULE_8__[\"default\"]);\n\n//# sourceURL=webpack://Api/./src/request.js?");
|
|
381
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Request)\n/* harmony export */ });\n/* harmony import */ var _request_action__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./request/action */ \"./src/request/action.js\");\n/* harmony import */ var _connection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./connection */ \"./src/connection.js\");\n/* harmony import */ var _filters_filters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filters/filters */ \"./src/filters/filters.js\");\n/* harmony import */ var _modifiers_modifiers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modifiers/modifiers */ \"./src/modifiers/modifiers.js\");\n/* harmony import */ var _request_pagination__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./request/pagination */ \"./src/request/pagination.js\");\n/* harmony import */ var _mixins_actionMixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mixins/actionMixin */ \"./src/mixins/actionMixin.js\");\n/* harmony import */ var _mixins_filterMixin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mixins/filterMixin */ \"./src/mixins/filterMixin.js\");\n/* harmony import */ var _mixins_modifierMixin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./mixins/modifierMixin */ \"./src/mixins/modifierMixin.js\");\n/* harmony import */ var _mixins_paginationMixin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./mixins/paginationMixin */ \"./src/mixins/paginationMixin.js\");\n/* harmony import */ var _mixins_responseEventsMixin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./mixins/responseEventsMixin */ \"./src/mixins/responseEventsMixin.js\");\n/* harmony import */ var _response_responseEventsHandler__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./response/responseEventsHandler */ \"./src/response/responseEventsHandler.js\");\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; 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; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; 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); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; 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; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @mixes actionMixin\n * @mixes filterMixin\n * @mixes modifierMixin\n * @mixes paginationMixin\n * @mixes responseEventsMixin\n */\nvar Request = /*#__PURE__*/function () {\n function Request() {\n _classCallCheck(this, Request);\n this.url = null;\n this._action = new _request_action__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n this._filters = new _filters_filters__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n this._modifiers = new _modifiers_modifiers__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n this._pagination = new _request_pagination__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n this._customParameters = [];\n this._initResponseEvents();\n this._connection = new _connection__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this._response = null;\n this.key = null;\n }\n _createClass(Request, [{\n key: \"setKey\",\n value: function setKey(key) {\n this.key = key;\n return this;\n }\n }, {\n key: \"response\",\n get: function get() {\n return this._response;\n }\n\n /**\n * @param {string} url\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"setUrl\",\n value: function setUrl(url) {\n this.url = url;\n return this;\n }\n\n /**\n * @param {object} config\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"setConfig\",\n value: function setConfig(config) {\n this._connection.setConfig(_.merge(this._connection.getConfig(), config));\n return this;\n }\n\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"cancel\",\n value: function cancel() {\n this._connection.cancel();\n return this;\n }\n\n /**\n * @returns {this} The current instance.\n */\n }, {\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this$url;\n var url, responseEventsHandler;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n url = (_this$url = this.url) !== null && _this$url !== void 0 ? _this$url : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n _context.next = 4;\n return this._connection.get(url, this.bodyParameters);\n case 4:\n this._response = _context.sent;\n this._connection.removeRequest(this);\n responseEventsHandler = this._createResponseEventsHandler();\n _context.next = 9;\n return responseEventsHandler.triggerResponseEvents(this._response);\n case 9:\n this.clearAllCallbacks();\n return _context.abrupt(\"return\", this);\n case 11:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function get() {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n /**\n * @param {Object} data\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var _this$url2;\n var data,\n url,\n responseEventsHandler,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n data = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};\n url = (_this$url2 = this.url) !== null && _this$url2 !== void 0 ? _this$url2 : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n _context2.next = 5;\n return this._connection.post(url, _objectSpread(_objectSpread({}, data), this.bodyParameters));\n case 5:\n this._response = _context2.sent;\n this._connection.removeRequest(this);\n responseEventsHandler = this._createResponseEventsHandler();\n _context2.next = 10;\n return responseEventsHandler.triggerResponseEvents(this._response);\n case 10:\n this.clearAllCallbacks();\n return _context2.abrupt(\"return\", this);\n case 12:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function post() {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n /**\n * @param {Object} data\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var _this$url3;\n var data,\n url,\n responseEventsHandler,\n _args3 = arguments;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n data = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};\n url = (_this$url3 = this.url) !== null && _this$url3 !== void 0 ? _this$url3 : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n _context3.next = 5;\n return this._connection.put(url, _objectSpread(_objectSpread({}, data), this.bodyParameters));\n case 5:\n this._response = _context3.sent;\n this._connection.removeRequest(this);\n responseEventsHandler = this._createResponseEventsHandler();\n _context3.next = 10;\n return responseEventsHandler.triggerResponseEvents(this._response);\n case 10:\n this.clearAllCallbacks();\n return _context3.abrupt(\"return\", this);\n case 12:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function put() {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n /**\n * @param {Object} data\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var _this$url4;\n var data,\n url,\n responseEventsHandler,\n _args4 = arguments;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n data = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};\n url = (_this$url4 = this.url) !== null && _this$url4 !== void 0 ? _this$url4 : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n _context4.next = 5;\n return this._connection[\"delete\"](url, _objectSpread(_objectSpread({}, data), this.bodyParameters));\n case 5:\n this._response = _context4.sent;\n this._connection.removeRequest(this);\n responseEventsHandler = this._createResponseEventsHandler();\n _context4.next = 10;\n return responseEventsHandler.triggerResponseEvents(this._response);\n case 10:\n this.clearAllCallbacks();\n return _context4.abrupt(\"return\", this);\n case 12:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _delete() {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n /**\n * @param {Object} files\n * @param {Object} data\n * @param {string|null} url\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"storeFiles\",\n value: function () {\n var _storeFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n var _ref;\n var files,\n data,\n url,\n queryUrl,\n formData,\n responseEventsHandler,\n _args5 = arguments;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n files = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};\n data = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};\n url = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : null;\n queryUrl = (_ref = url !== null && url !== void 0 ? url : this.url) !== null && _ref !== void 0 ? _ref : this.constructor.endpoint;\n this._connection.cancelRunning(this);\n this.setConfig({\n headers: {\n 'Content-Type': 'multipart/form-data'\n }\n });\n formData = this._createFormData(_.merge({}, files, data));\n if (!_.isEmpty(this.bodyParameters)) {\n queryUrl = \"\".concat(queryUrl, \"?\").concat(this.bodyParameters);\n }\n _context5.next = 10;\n return this._connection.post(queryUrl, formData);\n case 10:\n this._response = _context5.sent;\n this._connection.removeRequest(this);\n this.setConfig({\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n responseEventsHandler = this._createResponseEventsHandler();\n _context5.next = 16;\n return responseEventsHandler.triggerResponseEvents(this._response);\n case 16:\n this.clearAllCallbacks();\n return _context5.abrupt(\"return\", this);\n case 18:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function storeFiles() {\n return _storeFiles.apply(this, arguments);\n }\n return storeFiles;\n }()\n /**\n * @returns {Object} Filter and modifier query parameters.\n */\n }, {\n key: \"bodyParameters\",\n get: function get() {\n var _ref2, _ref3;\n return (_ref2 = _).merge.apply(_ref2, _toConsumableArray(_.compact([this._filters.toObject(), this._modifiers.toObject(), this._pagination.toObject(), this._action.toObject(), (_ref3 = _).merge.apply(_ref3, _toConsumableArray(this._customParameters))])));\n }\n\n /**\n * @returns {ResponseEventsHandler}\n * @private\n */\n }, {\n key: \"_createResponseEventsHandler\",\n value: function _createResponseEventsHandler() {\n var responseEventsHandler = new _response_responseEventsHandler__WEBPACK_IMPORTED_MODULE_10__[\"default\"]();\n responseEventsHandler.addResponseEvents(this._connection._api._responseEvents);\n responseEventsHandler.addResponseEvents(this._responseEvents);\n return responseEventsHandler;\n }\n\n /**\n * Add custom parameters to the request.\n *\n * @param {Object} parameters\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"customParameters\",\n value: function customParameters() {\n var parameters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this._customParameters.push(parameters);\n return this;\n }\n\n /**\n * Convert data to FormData.\n *\n * @param {Object} data\n *\n * @returns {FormData}\n */\n }, {\n key: \"_createFormData\",\n value: function _createFormData() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var formData = new FormData();\n function appendFormData(data, name) {\n name = name || '';\n if (data instanceof File) {\n formData.append(name, data);\n } else if (data === true || data === false) {\n formData.append(name, data ? '1' : '0');\n } else if (_.isArray(data) || _.isObject(data)) {\n if (_.size(data) <= 0) {\n formData.append(name, '');\n } else {\n _.forOwn(data, function (dataItem, key) {\n var newName = name === '' ? key : name + '[' + key + ']';\n appendFormData(dataItem, newName);\n });\n }\n } else {\n formData.append(name, data);\n }\n }\n appendFormData(data);\n return formData;\n }\n\n /**\n * @param {Api} api\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"setApi\",\n value: function setApi(api) {\n this._connection.setApi(api);\n return this;\n }\n }]);\n return Request;\n}();\n\nObject.assign(Request.prototype, _mixins_actionMixin__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\nObject.assign(Request.prototype, _mixins_filterMixin__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\nObject.assign(Request.prototype, _mixins_modifierMixin__WEBPACK_IMPORTED_MODULE_7__[\"default\"]);\nObject.assign(Request.prototype, _mixins_paginationMixin__WEBPACK_IMPORTED_MODULE_8__[\"default\"]);\nObject.assign(Request.prototype, _mixins_responseEventsMixin__WEBPACK_IMPORTED_MODULE_9__[\"default\"]);\n\n//# sourceURL=webpack://Api/./src/request.js?");
|
|
371
382
|
|
|
372
383
|
/***/ }),
|
|
373
384
|
|
|
@@ -404,6 +415,28 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
404
415
|
|
|
405
416
|
/***/ }),
|
|
406
417
|
|
|
418
|
+
/***/ "./src/response/responseEvents.js":
|
|
419
|
+
/*!****************************************!*\
|
|
420
|
+
!*** ./src/response/responseEvents.js ***!
|
|
421
|
+
\****************************************/
|
|
422
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
423
|
+
|
|
424
|
+
"use strict";
|
|
425
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ResponseEvents)\n/* harmony export */ });\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar ResponseEvents = /*#__PURE__*/function () {\n function ResponseEvents() {\n _classCallCheck(this, ResponseEvents);\n this._onSuccessCallbacks = [];\n this._onErrorCallbacks = [];\n this._onValidationErrorCallbacks = [];\n this._onUnauthorizedCallbacks = [];\n this._onForbiddenCallbacks = [];\n this._onFinishedCallbacks = [];\n this._onCancelledCallbacks = [];\n }\n\n /**\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n _createClass(ResponseEvents, [{\n key: \"addOnSuccessCallback\",\n value: function addOnSuccessCallback() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onSuccessCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"addOnErrorCallback\",\n value: function addOnErrorCallback() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onErrorCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"addOnValidationErrorCallback\",\n value: function addOnValidationErrorCallback() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onValidationErrorCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"addOnUnauthorizedCallback\",\n value: function addOnUnauthorizedCallback() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onUnauthorizedCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"addOnForbiddenCallback\",\n value: function addOnForbiddenCallback() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onForbiddenCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"addOnFinishedCallback\",\n value: function addOnFinishedCallback() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onFinishedCallbacks.push(callback);\n return this;\n }\n\n /**\n * @param {function()} callback\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"addOnCancelledCallback\",\n value: function addOnCancelledCallback() {\n var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};\n this._onCancelledCallbacks.push(callback);\n return this;\n }\n\n /**\n * Clears all `onSuccess` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnSuccessCallbacks\",\n value: function clearOnSuccessCallbacks() {\n this._onSuccessCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onError` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnErrorCallbacks\",\n value: function clearOnErrorCallbacks() {\n this._onErrorCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onValidationError` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnValidationErrorCallbacks\",\n value: function clearOnValidationErrorCallbacks() {\n this._onValidationErrorCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onUnauthorized` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnUnauthorizedCallbacks\",\n value: function clearOnUnauthorizedCallbacks() {\n this._onUnauthorizedCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onForbidden` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnForbiddenCallbacks\",\n value: function clearOnForbiddenCallbacks() {\n this._onForbiddenCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onFinished` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnFinishedCallbacks\",\n value: function clearOnFinishedCallbacks() {\n this._onFinishedCallbacks = [];\n return this;\n }\n\n /**\n * Clears all `onCancelled` callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearOnCancelledCallbacks\",\n value: function clearOnCancelledCallbacks() {\n this._onCancelledCallbacks = [];\n return this;\n }\n\n /**\n * Clears all callbacks.\n *\n * @returns {this} The current instance.\n */\n }, {\n key: \"clearAllCallbacks\",\n value: function clearAllCallbacks() {\n this.clearOnSuccessCallbacks().clearOnErrorCallbacks().clearOnValidationErrorCallbacks().clearOnUnauthorizedCallbacks().clearOnForbiddenCallbacks().clearOnFinishedCallbacks().clearOnCancelledCallbacks();\n return this;\n }\n }]);\n return ResponseEvents;\n}();\n\n\n//# sourceURL=webpack://Api/./src/response/responseEvents.js?");
|
|
426
|
+
|
|
427
|
+
/***/ }),
|
|
428
|
+
|
|
429
|
+
/***/ "./src/response/responseEventsHandler.js":
|
|
430
|
+
/*!***********************************************!*\
|
|
431
|
+
!*** ./src/response/responseEventsHandler.js ***!
|
|
432
|
+
\***********************************************/
|
|
433
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
434
|
+
|
|
435
|
+
"use strict";
|
|
436
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ResponseEventsHandler)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; 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; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; 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); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; 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; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar ResponseEventsHandler = /*#__PURE__*/function () {\n function ResponseEventsHandler() {\n _classCallCheck(this, ResponseEventsHandler);\n this._responseEventsList = [];\n this._onSuccessData = null;\n }\n\n /**\n * @param {ResponseEvents} responseEvents\n * @returns {ResponseEventsHandler}\n */\n _createClass(ResponseEventsHandler, [{\n key: \"addResponseEvents\",\n value: function addResponseEvents(responseEvents) {\n this._responseEventsList.push(responseEvents);\n return this;\n }\n\n /**\n * @param {*} data\n * @returns {ResponseEventsHandler}\n */\n }, {\n key: \"setOnSuccessData\",\n value: function setOnSuccessData(data) {\n this._onSuccessData = data;\n return this;\n }\n\n /**\n * @param {Response} response\n */\n }, {\n key: \"triggerResponseEvents\",\n value: function () {\n var _triggerResponseEvents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(response) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(response.statusCode >= 200 && response.statusCode < 300)) {\n _context.next = 5;\n break;\n }\n _context.next = 3;\n return this._executeOnSuccessCallbacks(response);\n case 3:\n _context.next = 20;\n break;\n case 5:\n _context.t0 = response.statusCode;\n _context.next = _context.t0 === 401 ? 8 : _context.t0 === 403 ? 11 : _context.t0 === 422 ? 14 : 17;\n break;\n case 8:\n _context.next = 10;\n return this._executeOnUnauthorizedCallbacks(response);\n case 10:\n return _context.abrupt(\"break\", 20);\n case 11:\n _context.next = 13;\n return this._executeOnForbiddenCallbacks(response);\n case 13:\n return _context.abrupt(\"break\", 20);\n case 14:\n _context.next = 16;\n return this._executeOnValidationErrorCallbacks(response);\n case 16:\n return _context.abrupt(\"break\", 20);\n case 17:\n _context.next = 19;\n return this._executeOnErrorCallbacks(response);\n case 19:\n return _context.abrupt(\"break\", 20);\n case 20:\n if (!response.isFinished) {\n _context.next = 23;\n break;\n }\n _context.next = 23;\n return this._executeOnFinishedCallbacks(response);\n case 23:\n if (!response.isCancelled) {\n _context.next = 26;\n break;\n }\n _context.next = 26;\n return this._executeOnCancelledCallbacks(response);\n case 26:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function triggerResponseEvents(_x) {\n return _triggerResponseEvents.apply(this, arguments);\n }\n return triggerResponseEvents;\n }()\n /**\n * @param {function[]} callbacks\n * @param data\n * @returns {Promise}\n * @private\n */\n }, {\n key: \"_executeCallbacks\",\n value: function _executeCallbacks(callbacks) {\n for (var _len = arguments.length, data = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n data[_key - 1] = arguments[_key];\n }\n return Promise.all(callbacks.map( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(callback) {\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return callback.apply(void 0, data);\n case 2:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function (_x2) {\n return _ref.apply(this, arguments);\n };\n }()));\n }\n\n /**\n * @param {Response} response\n */\n }, {\n key: \"_executeOnSuccessCallbacks\",\n value: function () {\n var _executeOnSuccessCallbacks2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(response) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return this._executeCallbacks.apply(this, [this._responseEventsList.flatMap(function (responseEvent) {\n return responseEvent._onSuccessCallbacks;\n })].concat(_toConsumableArray([this._onSuccessData, response.data].filter(function (value) {\n return !!value;\n })), [response]));\n case 2:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function _executeOnSuccessCallbacks(_x3) {\n return _executeOnSuccessCallbacks2.apply(this, arguments);\n }\n return _executeOnSuccessCallbacks;\n }()\n /**\n * @param {Response} response\n */\n }, {\n key: \"_executeOnErrorCallbacks\",\n value: function () {\n var _executeOnErrorCallbacks2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(response) {\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return this._executeCallbacks(this._responseEventsList.flatMap(function (responseEvent) {\n return responseEvent._onErrorCallbacks;\n }), response);\n case 2:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _executeOnErrorCallbacks(_x4) {\n return _executeOnErrorCallbacks2.apply(this, arguments);\n }\n return _executeOnErrorCallbacks;\n }()\n /**\n * @param {Response} response\n */\n }, {\n key: \"_executeOnValidationErrorCallbacks\",\n value: function () {\n var _executeOnValidationErrorCallbacks2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(response) {\n var validation;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n validation = {\n message: response.validation.message,\n errors: {}\n };\n _.each(response.validation.errors, function (value, key) {\n return _.set(validation.errors, key, value);\n });\n _context5.next = 4;\n return this._executeCallbacks(this._responseEventsList.flatMap(function (responseEvent) {\n return responseEvent._onValidationErrorCallbacks;\n }), validation, response);\n case 4:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function _executeOnValidationErrorCallbacks(_x5) {\n return _executeOnValidationErrorCallbacks2.apply(this, arguments);\n }\n return _executeOnValidationErrorCallbacks;\n }()\n /**\n * @param {Response} response\n */\n }, {\n key: \"_executeOnUnauthorizedCallbacks\",\n value: function () {\n var _executeOnUnauthorizedCallbacks2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(response) {\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return this._executeCallbacks(this._responseEventsList.flatMap(function (responseEvent) {\n return responseEvent._onUnauthorizedCallbacks;\n }), response);\n case 2:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function _executeOnUnauthorizedCallbacks(_x6) {\n return _executeOnUnauthorizedCallbacks2.apply(this, arguments);\n }\n return _executeOnUnauthorizedCallbacks;\n }()\n /**\n * @param {Response} response\n */\n }, {\n key: \"_executeOnForbiddenCallbacks\",\n value: function () {\n var _executeOnForbiddenCallbacks2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(response) {\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n _context7.next = 2;\n return this._executeCallbacks(this._responseEventsList.flatMap(function (responseEvent) {\n return responseEvent._onForbiddenCallbacks;\n }), response);\n case 2:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function _executeOnForbiddenCallbacks(_x7) {\n return _executeOnForbiddenCallbacks2.apply(this, arguments);\n }\n return _executeOnForbiddenCallbacks;\n }()\n /**\n * @param {Response} response\n */\n }, {\n key: \"_executeOnFinishedCallbacks\",\n value: function () {\n var _executeOnFinishedCallbacks2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(response) {\n return _regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n _context8.next = 2;\n return this._executeCallbacks(this._responseEventsList.flatMap(function (responseEvent) {\n return responseEvent._onFinishedCallbacks;\n }), response);\n case 2:\n case \"end\":\n return _context8.stop();\n }\n }, _callee8, this);\n }));\n function _executeOnFinishedCallbacks(_x8) {\n return _executeOnFinishedCallbacks2.apply(this, arguments);\n }\n return _executeOnFinishedCallbacks;\n }()\n /**\n * @param {Response} response\n */\n }, {\n key: \"_executeOnCancelledCallbacks\",\n value: function () {\n var _executeOnCancelledCallbacks2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(response) {\n return _regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n _context9.next = 2;\n return this._executeCallbacks(this._responseEventsList.flatMap(function (responseEvent) {\n return responseEvent._onCancelledCallbacks;\n }), response);\n case 2:\n case \"end\":\n return _context9.stop();\n }\n }, _callee9, this);\n }));\n function _executeOnCancelledCallbacks(_x9) {\n return _executeOnCancelledCallbacks2.apply(this, arguments);\n }\n return _executeOnCancelledCallbacks;\n }()\n }]);\n return ResponseEventsHandler;\n}();\n\n\n//# sourceURL=webpack://Api/./src/response/responseEventsHandler.js?");
|
|
437
|
+
|
|
438
|
+
/***/ }),
|
|
439
|
+
|
|
407
440
|
/***/ "./src/utilities/format.js":
|
|
408
441
|
/*!*********************************!*\
|
|
409
442
|
!*** ./src/utilities/format.js ***!
|
|
@@ -3842,7 +3875,18 @@ eval("/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n
|
|
|
3842
3875
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
3843
3876
|
|
|
3844
3877
|
"use strict";
|
|
3845
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var
|
|
3878
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http.js */ \"./node_modules/axios/lib/helpers/null.js\");\n/* harmony import */ var _xhr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./xhr.js */ \"./node_modules/axios/lib/adapters/xhr.js\");\n/* harmony import */ var _fetch_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fetch.js */ \"./node_modules/axios/lib/adapters/fetch.js\");\n/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/AxiosError.js */ \"./node_modules/axios/lib/core/AxiosError.js\");\n\n\n\n\n\n\nconst knownAdapters = {\n http: _http_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n xhr: _xhr_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n fetch: {\n get: _fetch_js__WEBPACK_IMPORTED_MODULE_2__.getFetch,\n }\n}\n\n_utils_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => _utils_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isFunction(adapter) || adapter === null || adapter === false;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n getAdapter: (adapters, config) => {\n adapters = _utils_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"](`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter && (_utils_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isFunction(adapter) || (adapter = adapter.get(config)))) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"](\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n});\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/adapters/adapters.js?");
|
|
3879
|
+
|
|
3880
|
+
/***/ }),
|
|
3881
|
+
|
|
3882
|
+
/***/ "./node_modules/axios/lib/adapters/fetch.js":
|
|
3883
|
+
/*!**************************************************!*\
|
|
3884
|
+
!*** ./node_modules/axios/lib/adapters/fetch.js ***!
|
|
3885
|
+
\**************************************************/
|
|
3886
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
3887
|
+
|
|
3888
|
+
"use strict";
|
|
3889
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ getFetch: () => (/* binding */ getFetch)\n/* harmony export */ });\n/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ \"./node_modules/axios/lib/platform/index.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ \"./node_modules/axios/lib/core/AxiosError.js\");\n/* harmony import */ var _helpers_composeSignals_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/composeSignals.js */ \"./node_modules/axios/lib/helpers/composeSignals.js\");\n/* harmony import */ var _helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/trackStream.js */ \"./node_modules/axios/lib/helpers/trackStream.js\");\n/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ \"./node_modules/axios/lib/core/AxiosHeaders.js\");\n/* harmony import */ var _helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/progressEventReducer.js */ \"./node_modules/axios/lib/helpers/progressEventReducer.js\");\n/* harmony import */ var _helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/resolveConfig.js */ \"./node_modules/axios/lib/helpers/resolveConfig.js\");\n/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/settle.js */ \"./node_modules/axios/lib/core/settle.js\");\n\n\n\n\n\n\n\n\n\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst {isFunction} = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\n\nconst globalFetchAPI = (({fetch, Request, Response}) => ({\n fetch, Request, Response\n }))(_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].global);\n\nconst {\n ReadableStream, TextEncoder\n} = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].global;\n\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n}\n\nconst factory = (env) => {\n const {fetch, Request, Response} = Object.assign({}, globalFetchAPI, env);\n const isFetchSupported = isFunction(fetch);\n const isRequestSupported = isFunction(Request);\n const isResponseSupported = isFunction(Response);\n\n if (!isFetchSupported) {\n return false;\n }\n\n const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);\n\n const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Request(str).arrayBuffer())\n );\n\n const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n });\n\n const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&\n test(() => _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isReadableStream(new Response('').body));\n\n const resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n };\n\n isFetchSupported && ((() => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = (res, config) => {\n let method = res && res[type];\n\n if (method) {\n return method.call(res);\n }\n\n throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](`Response type '${type}' is not supported`, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ERR_NOT_SUPPORT, config);\n })\n });\n })());\n\n const getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isBlob(body)) {\n return body.size;\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isSpecCompliantForm(body)) {\n const _request = new Request(_platform_index_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArrayBufferView(body) || _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isURLSearchParams(body)) {\n body = body + '';\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n }\n\n const resolveBodyLength = async (headers, body) => {\n const length = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n }\n\n return async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = (0,_helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(config);\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = (0,_helpers_composeSignals_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request = null;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader)\n }\n\n if (_request.body) {\n const [onProgress, flush] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventDecorator)(\n requestContentLength,\n (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventReducer)((0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.asyncDecorator)(onUploadProgress))\n );\n\n data = (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_6__.trackStream)(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = isRequestSupported && \"credentials\" in Request.prototype;\n\n const resolvedOptions = {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n };\n\n request = isRequestSupported && new Request(url, resolvedOptions);\n\n let response = await (isRequestSupported ? fetch(request, fetchOptions) : fetch(url, resolvedOptions));\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventDecorator)(\n responseContentLength,\n (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.progressEventReducer)((0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_5__.asyncDecorator)(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n (0,_helpers_trackStream_js__WEBPACK_IMPORTED_MODULE_6__.trackStream)(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(resolve, reject, {\n data: responseData,\n headers: _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"].from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n })\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n throw Object.assign(\n new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].from(err, err && err.code, config, request);\n }\n }\n}\n\nconst seedCache = new Map();\n\nconst getFetch = (config) => {\n let env = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].merge.call({\n skipUndefined: true\n }, globalFetchAPI, config ? config.env : null);\n\n const {fetch, Request, Response} = env;\n\n const seeds = [\n Request, Response, fetch\n ];\n\n let len = seeds.length, i = len,\n seed, target, map = seedCache;\n\n while (i--) {\n seed = seeds[i];\n target = map.get(seed);\n\n target === undefined && map.set(seed, target = (i ? new Map() : factory(env)))\n\n map = target;\n }\n\n return target;\n};\n\nconst adapter = getFetch();\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (adapter);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/adapters/fetch.js?");
|
|
3846
3890
|
|
|
3847
3891
|
/***/ }),
|
|
3848
3892
|
|
|
@@ -3853,7 +3897,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
3853
3897
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
3854
3898
|
|
|
3855
3899
|
"use strict";
|
|
3856
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../core/settle.js */ \"./node_modules/axios/lib/core/settle.js\");\n/* harmony import */ var _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./../helpers/cookies.js */ \"./node_modules/axios/lib/helpers/cookies.js\");\n/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../helpers/buildURL.js */ \"./node_modules/axios/lib/helpers/buildURL.js\");\n/* harmony import */ var _core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/buildFullPath.js */ \"./node_modules/axios/lib/core/buildFullPath.js\");\n/* harmony import */ var _helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../helpers/isURLSameOrigin.js */ \"./node_modules/axios/lib/helpers/isURLSameOrigin.js\");\n/* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../defaults/transitional.js */ \"./node_modules/axios/lib/defaults/transitional.js\");\n/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/AxiosError.js */ \"./node_modules/axios/lib/core/AxiosError.js\");\n/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../cancel/CanceledError.js */ \"./node_modules/axios/lib/cancel/CanceledError.js\");\n/* harmony import */ var _helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../helpers/parseProtocol.js */ \"./node_modules/axios/lib/helpers/parseProtocol.js\");\n/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../platform/index.js */ \"./node_modules/axios/lib/platform/index.js\");\n/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ \"./node_modules/axios/lib/core/AxiosHeaders.js\");\n/* harmony import */ var _helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/speedometer.js */ \"./node_modules/axios/lib/helpers/speedometer.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = (0,_helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].from(config.headers).normalize();\n const responseType = config.responseType;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].isFormData(requestData)) {\n if (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].hasStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = (0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"](\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].ETIMEDOUT : _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].hasStandardBrowserEnv) {\n // Add xsrf header\n // regarding CVE-2023-45857 config.withCredentials condition was removed temporarily\n const xsrfValue = (0,_helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(fullPath) && config.xsrfCookieName && _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n _utils_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"](null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"])(fullPath);\n\n if (protocol && _platform_index_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].protocols.indexOf(protocol) === -1) {\n reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]('Unsupported protocol ' + protocol + ':', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n});\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/adapters/xhr.js?");
|
|
3900
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../core/settle.js */ \"./node_modules/axios/lib/core/settle.js\");\n/* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../defaults/transitional.js */ \"./node_modules/axios/lib/defaults/transitional.js\");\n/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/AxiosError.js */ \"./node_modules/axios/lib/core/AxiosError.js\");\n/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../cancel/CanceledError.js */ \"./node_modules/axios/lib/cancel/CanceledError.js\");\n/* harmony import */ var _helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../helpers/parseProtocol.js */ \"./node_modules/axios/lib/helpers/parseProtocol.js\");\n/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../platform/index.js */ \"./node_modules/axios/lib/platform/index.js\");\n/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ \"./node_modules/axios/lib/core/AxiosHeaders.js\");\n/* harmony import */ var _helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/progressEventReducer.js */ \"./node_modules/axios/lib/helpers/progressEventReducer.js\");\n/* harmony import */ var _helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/resolveConfig.js */ \"./node_modules/axios/lib/helpers/resolveConfig.js\");\n\n\n\n\n\n\n\n\n\n\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = (0,_helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(config);\n let requestData = _config.data;\n const requestHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n (0,_core_settle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError(event) {\n // Browsers deliver a ProgressEvent in XHR onerror\n // (message may be empty; when present, surface it)\n // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event\n const msg = event && event.message ? event.message : 'Network Error';\n const err = new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"](msg, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ERR_NETWORK, config, request);\n // attach the underlying event for consumers who want details\n err.event = event || null;\n reject(err);\n request = null;\n };\n \n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"](\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ETIMEDOUT : _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n _utils_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.progressEventReducer)(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_6__.progressEventReducer)(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"](null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_config.url);\n\n if (protocol && _platform_index_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"].protocols.indexOf(protocol) === -1) {\n reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]('Unsupported protocol ' + protocol + ':', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n});\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/adapters/xhr.js?");
|
|
3857
3901
|
|
|
3858
3902
|
/***/ }),
|
|
3859
3903
|
|
|
@@ -3875,7 +3919,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
3875
3919
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
3876
3920
|
|
|
3877
3921
|
"use strict";
|
|
3878
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CanceledError.js */ \"./node_modules/axios/lib/cancel/CanceledError.js\");\n\n\n\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CancelToken);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/cancel/CancelToken.js?");
|
|
3922
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CanceledError.js */ \"./node_modules/axios/lib/cancel/CanceledError.js\");\n\n\n\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CancelToken);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/cancel/CancelToken.js?");
|
|
3879
3923
|
|
|
3880
3924
|
/***/ }),
|
|
3881
3925
|
|
|
@@ -3908,7 +3952,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
3908
3952
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
3909
3953
|
|
|
3910
3954
|
"use strict";
|
|
3911
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/buildURL.js */ \"./node_modules/axios/lib/helpers/buildURL.js\");\n/* harmony import */ var _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InterceptorManager.js */ \"./node_modules/axios/lib/core/InterceptorManager.js\");\n/* harmony import */ var _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dispatchRequest.js */ \"./node_modules/axios/lib/core/dispatchRequest.js\");\n/* harmony import */ var _mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mergeConfig.js */ \"./node_modules/axios/lib/core/mergeConfig.js\");\n/* harmony import */ var _buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./buildFullPath.js */ \"./node_modules/axios/lib/core/buildFullPath.js\");\n/* harmony import */ var _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/validator.js */ \"./node_modules/axios/lib/helpers/validator.js\");\n/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AxiosHeaders.js */ \"./node_modules/axios/lib/core/AxiosHeaders.js\");\n\n\n\n\n\n\n\n\n\n\n\nconst validators = _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](),\n response: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (_utils_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].merge(\n headers.common,\n headers[config.method]\n );\n\n headers && _utils_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [_dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].bind(this), undefined];\n chain.unshift
|
|
3955
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/buildURL.js */ \"./node_modules/axios/lib/helpers/buildURL.js\");\n/* harmony import */ var _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InterceptorManager.js */ \"./node_modules/axios/lib/core/InterceptorManager.js\");\n/* harmony import */ var _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dispatchRequest.js */ \"./node_modules/axios/lib/core/dispatchRequest.js\");\n/* harmony import */ var _mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mergeConfig.js */ \"./node_modules/axios/lib/core/mergeConfig.js\");\n/* harmony import */ var _buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./buildFullPath.js */ \"./node_modules/axios/lib/core/buildFullPath.js\");\n/* harmony import */ var _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/validator.js */ \"./node_modules/axios/lib/helpers/validator.js\");\n/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AxiosHeaders.js */ \"./node_modules/axios/lib/core/AxiosHeaders.js\");\n\n\n\n\n\n\n\n\n\n\n\nconst validators = _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](),\n response: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (_utils_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].merge(\n headers.common,\n headers[config.method]\n );\n\n headers && _utils_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [_dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].bind(this), undefined];\n chain.unshift(...requestInterceptorChain);\n chain.push(...responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.defaults, config);\n const fullPath = (0,_buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(config.baseURL, config.url, config.allowAbsoluteUrls);\n return (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\n_utils_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\n_utils_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Axios);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/core/Axios.js?");
|
|
3912
3956
|
|
|
3913
3957
|
/***/ }),
|
|
3914
3958
|
|
|
@@ -3919,7 +3963,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
3919
3963
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
3920
3964
|
|
|
3921
3965
|
"use strict";
|
|
3922
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n\n\n\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response
|
|
3966
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n\n\n\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\n_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n const msg = error && error.message ? error.message : 'Error';\n\n // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)\n const errCode = code == null && error ? error.code : code;\n AxiosError.call(axiosError, msg, errCode, config, request, response);\n\n // Chain the original error on the standard field; non-enumerable to avoid JSON noise\n if (error && axiosError.cause == null) {\n Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });\n }\n\n axiosError.name = (error && error.name) || 'Error';\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosError);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/core/AxiosError.js?");
|
|
3923
3967
|
|
|
3924
3968
|
/***/ }),
|
|
3925
3969
|
|
|
@@ -3930,7 +3974,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
3930
3974
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
3931
3975
|
|
|
3932
3976
|
"use strict";
|
|
3933
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/parseHeaders.js */ \"./node_modules/axios/lib/helpers/parseHeaders.js\");\n\n\n\n\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isString(value)) return;\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders((0,_helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forEach(this, (value, header) => {\n const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\n_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\n_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].freezeMethods(AxiosHeaders);\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosHeaders);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/core/AxiosHeaders.js?");
|
|
3977
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/parseHeaders.js */ \"./node_modules/axios/lib/helpers/parseHeaders.js\");\n\n\n\n\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isString(value)) return;\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders((0,_helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(header), valueOrRewrite);\n } else if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isObject(header) && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isIterable(header)) {\n let obj = {}, dest, key;\n for (const entry of header) {\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(entry)) {\n throw TypeError('Object iterator must return a key-value pair');\n }\n\n obj[key = entry[0]] = (dest = obj[key]) ?\n (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];\n }\n\n setHeaders(obj, valueOrRewrite)\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forEach(this, (value, header) => {\n const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n getSetCookie() {\n return this.get(\"set-cookie\") || [];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\n_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\n_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].freezeMethods(AxiosHeaders);\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosHeaders);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/core/AxiosHeaders.js?");
|
|
3934
3978
|
|
|
3935
3979
|
/***/ }),
|
|
3936
3980
|
|
|
@@ -3952,7 +3996,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
3952
3996
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
3953
3997
|
|
|
3954
3998
|
"use strict";
|
|
3955
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ buildFullPath)\n/* harmony export */ });\n/* harmony import */ var _helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/isAbsoluteURL.js */ \"./node_modules/axios/lib/helpers/isAbsoluteURL.js\");\n/* harmony import */ var _helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/combineURLs.js */ \"./node_modules/axios/lib/helpers/combineURLs.js\");\n\n\n\n\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nfunction buildFullPath(baseURL, requestedURL) {\n
|
|
3999
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ buildFullPath)\n/* harmony export */ });\n/* harmony import */ var _helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/isAbsoluteURL.js */ \"./node_modules/axios/lib/helpers/isAbsoluteURL.js\");\n/* harmony import */ var _helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/combineURLs.js */ \"./node_modules/axios/lib/helpers/combineURLs.js\");\n\n\n\n\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nfunction buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n let isRelativeUrl = !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {\n return (0,_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(baseURL, requestedURL);\n }\n return requestedURL;\n}\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/core/buildFullPath.js?");
|
|
3956
4000
|
|
|
3957
4001
|
/***/ }),
|
|
3958
4002
|
|
|
@@ -3963,7 +4007,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
3963
4007
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
3964
4008
|
|
|
3965
4009
|
"use strict";
|
|
3966
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ dispatchRequest)\n/* harmony export */ });\n/* harmony import */ var _transformData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transformData.js */ \"./node_modules/axios/lib/core/transformData.js\");\n/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cancel/isCancel.js */ \"./node_modules/axios/lib/cancel/isCancel.js\");\n/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../defaults/index.js */ \"./node_modules/axios/lib/defaults/index.js\");\n/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cancel/CanceledError.js */ \"./node_modules/axios/lib/cancel/CanceledError.js\");\n/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ \"./node_modules/axios/lib/core/AxiosHeaders.js\");\n/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../adapters/adapters.js */ \"./node_modules/axios/lib/adapters/adapters.js\");\n\n\n\n\n\n\n\n\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nfunction dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].from(config.headers);\n\n // Transform request data\n config.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!(0,_cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/core/dispatchRequest.js?");
|
|
4010
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ dispatchRequest)\n/* harmony export */ });\n/* harmony import */ var _transformData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transformData.js */ \"./node_modules/axios/lib/core/transformData.js\");\n/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cancel/isCancel.js */ \"./node_modules/axios/lib/cancel/isCancel.js\");\n/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../defaults/index.js */ \"./node_modules/axios/lib/defaults/index.js\");\n/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cancel/CanceledError.js */ \"./node_modules/axios/lib/cancel/CanceledError.js\");\n/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ \"./node_modules/axios/lib/core/AxiosHeaders.js\");\n/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../adapters/adapters.js */ \"./node_modules/axios/lib/adapters/adapters.js\");\n\n\n\n\n\n\n\n\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nfunction dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].from(config.headers);\n\n // Transform request data\n config.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].adapter, config);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!(0,_cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/core/dispatchRequest.js?");
|
|
3967
4011
|
|
|
3968
4012
|
/***/ }),
|
|
3969
4013
|
|
|
@@ -3974,7 +4018,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
3974
4018
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
3975
4019
|
|
|
3976
4020
|
"use strict";
|
|
3977
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ mergeConfig)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosHeaders.js */ \"./node_modules/axios/lib/core/AxiosHeaders.js\");\n\n\n\n\n\nconst headersToObject = (thing) => thing instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] ? thing
|
|
4021
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ mergeConfig)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosHeaders.js */ \"./node_modules/axios/lib/core/AxiosHeaders.js\");\n\n\n\n\n\nconst headersToObject = (thing) => thing instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nfunction mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, prop, caseless) {\n if (_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isPlainObject(source)) {\n return _utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].merge.call({caseless}, target, source);\n } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isPlainObject(source)) {\n return _utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].merge({}, source);\n } else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, prop , caseless) {\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isUndefined(b)) {\n return getMergedValue(a, b, prop , caseless);\n } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isUndefined(a)) {\n return getMergedValue(undefined, a, prop , caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)\n };\n\n _utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/core/mergeConfig.js?");
|
|
3978
4022
|
|
|
3979
4023
|
/***/ }),
|
|
3980
4024
|
|
|
@@ -4007,7 +4051,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4007
4051
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4008
4052
|
|
|
4009
4053
|
"use strict";
|
|
4010
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/AxiosError.js */ \"./node_modules/axios/lib/core/AxiosError.js\");\n/* harmony import */ var _transitional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transitional.js */ \"./node_modules/axios/lib/defaults/transitional.js\");\n/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/toFormData.js */ \"./node_modules/axios/lib/helpers/toFormData.js\");\n/* harmony import */ var _helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/toURLEncodedForm.js */ \"./node_modules/axios/lib/helpers/toURLEncodedForm.js\");\n/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../platform/index.js */ \"./node_modules/axios/lib/platform/index.js\");\n/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/formDataToJSON.js */ \"./node_modules/axios/lib/helpers/formDataToJSON.js\");\n\n\n\n\n\n\n\n\n\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: _transitional_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isObject(data);\n\n if (isObjectPayload && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFormData(data);\n\n if (isFormData) {\n
|
|
4054
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/AxiosError.js */ \"./node_modules/axios/lib/core/AxiosError.js\");\n/* harmony import */ var _transitional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transitional.js */ \"./node_modules/axios/lib/defaults/transitional.js\");\n/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/toFormData.js */ \"./node_modules/axios/lib/helpers/toFormData.js\");\n/* harmony import */ var _helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/toURLEncodedForm.js */ \"./node_modules/axios/lib/helpers/toURLEncodedForm.js\");\n/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../platform/index.js */ \"./node_modules/axios/lib/platform/index.js\");\n/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/formDataToJSON.js */ \"./node_modules/axios/lib/helpers/formDataToJSON.js\");\n\n\n\n\n\n\n\n\n\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: _transitional_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isObject(data);\n\n if (isObjectPayload && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify((0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(data)) : data;\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArrayBuffer(data) ||\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isBuffer(data) ||\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isStream(data) ||\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFile(data) ||\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isBlob(data) ||\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isReadableStream(data)\n ) {\n return data;\n }\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArrayBufferView(data)) {\n return data.buffer;\n }\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(data, this.formSerializer).toString();\n }\n\n if ((isFileList = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return (0,_helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isResponse(data) || _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isReadableStream(data)) {\n return data;\n }\n\n if (data && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data, this.parseReviver);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].classes.FormData,\n Blob: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\n_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defaults);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/defaults/index.js?");
|
|
4011
4055
|
|
|
4012
4056
|
/***/ }),
|
|
4013
4057
|
|
|
@@ -4029,7 +4073,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4029
4073
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4030
4074
|
|
|
4031
4075
|
"use strict";
|
|
4032
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ VERSION: () => (/* binding */ VERSION)\n/* harmony export */ });\nconst VERSION = \"1.
|
|
4076
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ VERSION: () => (/* binding */ VERSION)\n/* harmony export */ });\nconst VERSION = \"1.12.0\";\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/env/data.js?");
|
|
4033
4077
|
|
|
4034
4078
|
/***/ }),
|
|
4035
4079
|
|
|
@@ -4073,7 +4117,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4073
4117
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4074
4118
|
|
|
4075
4119
|
"use strict";
|
|
4076
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ buildURL)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ \"./node_modules/axios/lib/helpers/AxiosURLSearchParams.js\");\n\n\n\n\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+')
|
|
4120
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ buildURL)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ \"./node_modules/axios/lib/helpers/AxiosURLSearchParams.js\");\n\n\n\n\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nfunction buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFunction(options)) {\n options = {\n serialize: options\n };\n } \n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isURLSearchParams(params) ?\n params.toString() :\n new _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/buildURL.js?");
|
|
4077
4121
|
|
|
4078
4122
|
/***/ }),
|
|
4079
4123
|
|
|
@@ -4084,7 +4128,18 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4084
4128
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4085
4129
|
|
|
4086
4130
|
"use strict";
|
|
4087
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ combineURLs)\n/* harmony export */ });\n\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nfunction combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(
|
|
4131
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ combineURLs)\n/* harmony export */ });\n\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nfunction combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/combineURLs.js?");
|
|
4132
|
+
|
|
4133
|
+
/***/ }),
|
|
4134
|
+
|
|
4135
|
+
/***/ "./node_modules/axios/lib/helpers/composeSignals.js":
|
|
4136
|
+
/*!**********************************************************!*\
|
|
4137
|
+
!*** ./node_modules/axios/lib/helpers/composeSignals.js ***!
|
|
4138
|
+
\**********************************************************/
|
|
4139
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4140
|
+
|
|
4141
|
+
"use strict";
|
|
4142
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../cancel/CanceledError.js */ \"./node_modules/axios/lib/cancel/CanceledError.js\");\n/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/AxiosError.js */ \"./node_modules/axios/lib/core/AxiosError.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n\n\n\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] ? err : new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](err instanceof Error ? err.message : err));\n }\n }\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](`timeout ${timeout} of ms exceeded`, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].ETIMEDOUT))\n }, timeout)\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n }\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => _utils_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].asap(unsubscribe);\n\n return signal;\n }\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (composeSignals);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/composeSignals.js?");
|
|
4088
4143
|
|
|
4089
4144
|
/***/ }),
|
|
4090
4145
|
|
|
@@ -4095,7 +4150,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4095
4150
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4096
4151
|
|
|
4097
4152
|
"use strict";
|
|
4098
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ \"./node_modules/axios/lib/platform/index.js\");\n\n\n\n
|
|
4153
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ \"./node_modules/axios/lib/platform/index.js\");\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n _utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n _utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isString(path) && cookie.push('path=' + path);\n\n _utils_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n });\n\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/cookies.js?");
|
|
4099
4154
|
|
|
4100
4155
|
/***/ }),
|
|
4101
4156
|
|
|
@@ -4106,7 +4161,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4106
4161
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4107
4162
|
|
|
4108
4163
|
"use strict";
|
|
4109
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n\n\n\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array<any>} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object<string, any> | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(target) ? target.length : name;\n\n if (isLast) {\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFormData(formData) && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFunction(formData.entries)) {\n const obj = {};\n\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (formDataToJSON);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/formDataToJSON.js?");
|
|
4164
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n\n\n\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array<any>} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object<string, any> | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(target) ? target.length : name;\n\n if (isLast) {\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFormData(formData) && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFunction(formData.entries)) {\n const obj = {};\n\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (formDataToJSON);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/formDataToJSON.js?");
|
|
4110
4165
|
|
|
4111
4166
|
/***/ }),
|
|
4112
4167
|
|
|
@@ -4139,7 +4194,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4139
4194
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4140
4195
|
|
|
4141
4196
|
"use strict";
|
|
4142
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var
|
|
4197
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ \"./node_modules/axios/lib/platform/index.js\");\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, _platform_index_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].origin),\n _platform_index_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].navigator && /(msie|trident)/i.test(_platform_index_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].navigator.userAgent)\n) : () => true);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/isURLSameOrigin.js?");
|
|
4143
4198
|
|
|
4144
4199
|
/***/ }),
|
|
4145
4200
|
|
|
@@ -4176,6 +4231,28 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4176
4231
|
|
|
4177
4232
|
/***/ }),
|
|
4178
4233
|
|
|
4234
|
+
/***/ "./node_modules/axios/lib/helpers/progressEventReducer.js":
|
|
4235
|
+
/*!****************************************************************!*\
|
|
4236
|
+
!*** ./node_modules/axios/lib/helpers/progressEventReducer.js ***!
|
|
4237
|
+
\****************************************************************/
|
|
4238
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4239
|
+
|
|
4240
|
+
"use strict";
|
|
4241
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ asyncDecorator: () => (/* binding */ asyncDecorator),\n/* harmony export */ progressEventDecorator: () => (/* binding */ progressEventDecorator),\n/* harmony export */ progressEventReducer: () => (/* binding */ progressEventReducer)\n/* harmony export */ });\n/* harmony import */ var _speedometer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./speedometer.js */ \"./node_modules/axios/lib/helpers/speedometer.js\");\n/* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./throttle.js */ \"./node_modules/axios/lib/helpers/throttle.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n\n\n\n\nconst progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = (0,_speedometer_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(50, 250);\n\n return (0,_throttle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nconst progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nconst asyncDecorator = (fn) => (...args) => _utils_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].asap(() => fn(...args));\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/progressEventReducer.js?");
|
|
4242
|
+
|
|
4243
|
+
/***/ }),
|
|
4244
|
+
|
|
4245
|
+
/***/ "./node_modules/axios/lib/helpers/resolveConfig.js":
|
|
4246
|
+
/*!*********************************************************!*\
|
|
4247
|
+
!*** ./node_modules/axios/lib/helpers/resolveConfig.js ***!
|
|
4248
|
+
\*********************************************************/
|
|
4249
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4250
|
+
|
|
4251
|
+
"use strict";
|
|
4252
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../platform/index.js */ \"./node_modules/axios/lib/platform/index.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isURLSameOrigin.js */ \"./node_modules/axios/lib/helpers/isURLSameOrigin.js\");\n/* harmony import */ var _cookies_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./cookies.js */ \"./node_modules/axios/lib/helpers/cookies.js\");\n/* harmony import */ var _core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/buildFullPath.js */ \"./node_modules/axios/lib/core/buildFullPath.js\");\n/* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/mergeConfig.js */ \"./node_modules/axios/lib/core/mergeConfig.js\");\n/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ \"./node_modules/axios/lib/core/AxiosHeaders.js\");\n/* harmony import */ var _buildURL_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./buildURL.js */ \"./node_modules/axios/lib/helpers/buildURL.js\");\n\n\n\n\n\n\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((config) => {\n const newConfig = (0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, config);\n\n let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;\n\n newConfig.headers = headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].from(headers);\n\n newConfig.url = (0,_buildURL_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])((0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].isFormData(data)) {\n if (_platform_index_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].hasStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // browser handles it\n } else if (_utils_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].isFunction(data.getHeaders)) {\n // Node.js FormData (like form-data package)\n const formHeaders = data.getHeaders();\n // Only set safe headers to avoid overwriting security headers\n const allowedHeaders = ['content-type', 'content-length'];\n Object.entries(formHeaders).forEach(([key, val]) => {\n if (allowedHeaders.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n }\n } \n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (_platform_index_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].hasStandardBrowserEnv) {\n withXSRFToken && _utils_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && (0,_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && _cookies_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n});\n\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/resolveConfig.js?");
|
|
4253
|
+
|
|
4254
|
+
/***/ }),
|
|
4255
|
+
|
|
4179
4256
|
/***/ "./node_modules/axios/lib/helpers/speedometer.js":
|
|
4180
4257
|
/*!*******************************************************!*\
|
|
4181
4258
|
!*** ./node_modules/axios/lib/helpers/speedometer.js ***!
|
|
@@ -4198,6 +4275,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4198
4275
|
|
|
4199
4276
|
/***/ }),
|
|
4200
4277
|
|
|
4278
|
+
/***/ "./node_modules/axios/lib/helpers/throttle.js":
|
|
4279
|
+
/*!****************************************************!*\
|
|
4280
|
+
!*** ./node_modules/axios/lib/helpers/throttle.js ***!
|
|
4281
|
+
\****************************************************/
|
|
4282
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4283
|
+
|
|
4284
|
+
"use strict";
|
|
4285
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn(...args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (throttle);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/throttle.js?");
|
|
4286
|
+
|
|
4287
|
+
/***/ }),
|
|
4288
|
+
|
|
4201
4289
|
/***/ "./node_modules/axios/lib/helpers/toFormData.js":
|
|
4202
4290
|
/*!******************************************************!*\
|
|
4203
4291
|
!*** ./node_modules/axios/lib/helpers/toFormData.js ***!
|
|
@@ -4205,7 +4293,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4205
4293
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4206
4294
|
|
|
4207
4295
|
"use strict";
|
|
4208
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ \"./node_modules/axios/lib/core/AxiosError.js\");\n/* harmony import */ var _platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/node/classes/FormData.js */ \"./node_modules/axios/lib/helpers/null.js\");\n\n\n\n\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\n\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isPlainObject(thing) || _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array<any>} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toFlatObject(_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object<any, any>} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object<string, any>} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (_platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isSpecCompliantForm(formData);\n\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isBlob(value)) {\n throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]('Blob is not supported. Use a Buffer instead.');\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArrayBuffer(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(value) && isFlatArray(value)) ||\n ((_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFileList(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].endsWith(key, '[]')) && (arr = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forEach(value, function each(el, key) {\n const result = !(_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isUndefined(el) || el === null) && visitor.call(\n formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toFormData);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/toFormData.js?");
|
|
4296
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ \"./node_modules/axios/lib/core/AxiosError.js\");\n/* harmony import */ var _platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/node/classes/FormData.js */ \"./node_modules/axios/lib/helpers/null.js\");\n\n\n\n\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\n\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isPlainObject(thing) || _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array<any>} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toFlatObject(_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object<any, any>} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object<string, any>} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (_platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isSpecCompliantForm(formData);\n\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isDate(value)) {\n return value.toISOString();\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isBlob(value)) {\n throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]('Blob is not supported. Use a Buffer instead.');\n }\n\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArrayBuffer(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isArray(value) && isFlatArray(value)) ||\n ((_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isFileList(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].endsWith(key, '[]')) && (arr = _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forEach(value, function each(el, key) {\n const result = !(_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isUndefined(el) || el === null) && visitor.call(\n formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toFormData);\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/toFormData.js?");
|
|
4209
4297
|
|
|
4210
4298
|
/***/ }),
|
|
4211
4299
|
|
|
@@ -4216,7 +4304,18 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4216
4304
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4217
4305
|
|
|
4218
4306
|
"use strict";
|
|
4219
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ toURLEncodedForm)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ \"./node_modules/axios/lib/helpers/toFormData.js\");\n/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ \"./node_modules/axios/lib/platform/index.js\");\n\n\n\n\n\n\nfunction toURLEncodedForm(data, options) {\n return (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].classes.URLSearchParams(),
|
|
4307
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ toURLEncodedForm)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/axios/lib/utils.js\");\n/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ \"./node_modules/axios/lib/helpers/toFormData.js\");\n/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ \"./node_modules/axios/lib/platform/index.js\");\n\n\n\n\n\n\nfunction toURLEncodedForm(data, options) {\n return (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].classes.URLSearchParams(), {\n visitor: function(value, key, path, helpers) {\n if (_platform_index_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isNode && _utils_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n },\n ...options\n });\n}\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/toURLEncodedForm.js?");
|
|
4308
|
+
|
|
4309
|
+
/***/ }),
|
|
4310
|
+
|
|
4311
|
+
/***/ "./node_modules/axios/lib/helpers/trackStream.js":
|
|
4312
|
+
/*!*******************************************************!*\
|
|
4313
|
+
!*** ./node_modules/axios/lib/helpers/trackStream.js ***!
|
|
4314
|
+
\*******************************************************/
|
|
4315
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4316
|
+
|
|
4317
|
+
"use strict";
|
|
4318
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ readBytes: () => (/* binding */ readBytes),\n/* harmony export */ streamChunk: () => (/* binding */ streamChunk),\n/* harmony export */ trackStream: () => (/* binding */ trackStream)\n/* harmony export */ });\n\nconst streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n}\n\nconst readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n}\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n}\n\nconst trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n }\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n}\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/trackStream.js?");
|
|
4220
4319
|
|
|
4221
4320
|
/***/ }),
|
|
4222
4321
|
|
|
@@ -4227,7 +4326,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4227
4326
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4228
4327
|
|
|
4229
4328
|
"use strict";
|
|
4230
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env/data.js */ \"./node_modules/axios/lib/env/data.js\");\n/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ \"./node_modules/axios/lib/core/AxiosError.js\");\n\n\n\n\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + _env_data_js__WEBPACK_IMPORTED_MODULE_0__.VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]('options must be an object', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]('option ' + opt + ' must be ' + result, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]('Unknown option ' + opt, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ERR_BAD_OPTION);\n }\n }\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n assertOptions,\n validators\n});\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/validator.js?");
|
|
4329
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env/data.js */ \"./node_modules/axios/lib/env/data.js\");\n/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ \"./node_modules/axios/lib/core/AxiosError.js\");\n\n\n\n\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + _env_data_js__WEBPACK_IMPORTED_MODULE_0__.VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n }\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]('options must be an object', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]('option ' + opt + ' must be ' + result, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]('Unknown option ' + opt, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ERR_BAD_OPTION);\n }\n }\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n assertOptions,\n validators\n});\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/helpers/validator.js?");
|
|
4231
4330
|
|
|
4232
4331
|
/***/ }),
|
|
4233
4332
|
|
|
@@ -4282,7 +4381,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4282
4381
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4283
4382
|
|
|
4284
4383
|
"use strict";
|
|
4285
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hasBrowserEnv: () => (/* binding */ hasBrowserEnv),\n/* harmony export */ hasStandardBrowserEnv: () => (/* binding */ hasStandardBrowserEnv),\n/* harmony export */ hasStandardBrowserWebWorkerEnv: () => (/* binding */ hasStandardBrowserWebWorkerEnv)\n/* harmony export */ });\nconst hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv =
|
|
4384
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hasBrowserEnv: () => (/* binding */ hasBrowserEnv),\n/* harmony export */ hasStandardBrowserEnv: () => (/* binding */ hasStandardBrowserEnv),\n/* harmony export */ hasStandardBrowserWebWorkerEnv: () => (/* binding */ hasStandardBrowserWebWorkerEnv),\n/* harmony export */ navigator: () => (/* binding */ _navigator),\n/* harmony export */ origin: () => (/* binding */ origin)\n/* harmony export */ });\nconst hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\n\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/platform/common/utils.js?");
|
|
4286
4385
|
|
|
4287
4386
|
/***/ }),
|
|
4288
4387
|
|
|
@@ -4304,7 +4403,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4304
4403
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4305
4404
|
|
|
4306
4405
|
"use strict";
|
|
4307
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/bind.js */ \"./node_modules/axios/lib/helpers/bind.js\");\n\n\n\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object<any, any>} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array<boolean>}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n});\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/utils.js?");
|
|
4406
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/bind.js */ \"./node_modules/axios/lib/helpers/bind.js\");\n\n\n\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\nconst {iterator, toStringTag} = Symbol;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);\n}\n\n/**\n * Determine if a value is an empty object (safely handles Buffers)\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an empty object, otherwise false\n */\nconst isEmptyObject = (val) => {\n // Early return for non-objects or Buffers to prevent RangeError\n if (!isObject(val) || isBuffer(val)) {\n return false;\n }\n\n try {\n return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n } catch (e) {\n // Fallback for any other objects that might cause RangeError with Object.keys()\n return false;\n }\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Buffer check\n if (isBuffer(obj)) {\n return;\n }\n\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n if (isBuffer(obj)){\n return null;\n }\n\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless, skipUndefined} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n if (!skipUndefined || !isUndefined(val)) {\n result[targetKey] = val;\n }\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object<any, any>} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array<boolean>}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n}\n\n\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n //Buffer check\n if (isBuffer(source)) {\n return source;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isEmptyObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable\n});\n\n\n//# sourceURL=webpack://Api/./node_modules/axios/lib/utils.js?");
|
|
4308
4407
|
|
|
4309
4408
|
/***/ })
|
|
4310
4409
|
|