You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4938 lines
210 KiB
4938 lines
210 KiB
define(["@grafana/data","@grafana/runtime","@grafana/ui","app/core/app_events","app/core/core","lodash","react"], (__WEBPACK_EXTERNAL_MODULE__grafana_data__, __WEBPACK_EXTERNAL_MODULE__grafana_runtime__, __WEBPACK_EXTERNAL_MODULE__grafana_ui__, __WEBPACK_EXTERNAL_MODULE_grafana_app_core_app_events__, __WEBPACK_EXTERNAL_MODULE_grafana_app_core_core__, __WEBPACK_EXTERNAL_MODULE_lodash__, __WEBPACK_EXTERNAL_MODULE_react__) => { return /******/ (() => { // webpackBootstrap |
|
/******/ var __webpack_modules__ = ({ |
|
|
|
/***/ "./icons.ts": |
|
/*!******************!*\ |
|
!*** ./icons.ts ***! |
|
\******************/ |
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "CLOSE_ICON_BASE_64": () => (/* binding */ CLOSE_ICON_BASE_64), |
|
/* harmony export */ "DOWNLOAD_ICON_BASE_64": () => (/* binding */ DOWNLOAD_ICON_BASE_64), |
|
/* harmony export */ "SELECT_ICON_BASE_64": () => (/* binding */ SELECT_ICON_BASE_64), |
|
/* harmony export */ "UNSELECT_ICON_BASE_64": () => (/* binding */ UNSELECT_ICON_BASE_64) |
|
/* harmony export */ }); |
|
var CLOSE_ICON_BASE_64 = 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACJSURBVHgB7ZPRCcAgDESv0lWc0zhC53OIjmAVUpCSamL76YEoyfFIiAGWfldK6SwnKHyhep9xJ3iPcqgH5RyxV1VlBWYJypXVHMEiCaqBbRhAy3W3B76j954wq6ZSVZsOY+WXt6i9l2ymGTlUq0VpOcIqaQC96Zth01DN1zBBefVI4SNp9Za+6wLcH6DKFrfpxgAAAABJRU5ErkJggg=='; |
|
var DOWNLOAD_ICON_BASE_64 = 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADlSURBVHgB3ZPNDYJAEIVnN96lBA7A2RIsATuQiiwBSrAD7MAjCZBACXqFwPomMRtEwMVwgZeQhfn5mNnMEG1CaZoeiqKwTWJ3JkFCiEtVVU+8+r9iJRlKSrk3iqOFtWJglmXHf3yDwCRJbBxxnudh34cRYluMMbKGcgWNCIlnjEuIJ1JK2WzDWeKb7YHjONEsYBf6kTABY+mWuYX+3Xiex9UFU7D3FllfwLqueQvi/h8ZCtBprDLY703T6A0yWj2ArmSoxedQV4jSSz5xj4pmCi0/NKfrwNz5bdtaNENciOu6N1qNXhzZXHMb9Q+nAAAAAElFTkSuQmCC'; |
|
var UNSELECT_ICON_BASE_64 = 'PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIxNSIgaGVpZ2h0PSIxNSIgcng9IjEuNSIgZmlsbD0iIzExMTIxNiIgc3Ryb2tlPSIjMkQyRTM0Ii8+Cjwvc3ZnPgo='; |
|
var SELECT_ICON_BASE_64 = 'PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiByeD0iMiIgZmlsbD0iIzRBNzFEMiIvPgo8cGF0aCBkPSJNNS45ODI2NCAxMi41MjE3QzUuNzczOTUgMTIuNTIxNyA1LjU4MjY0IDEyLjQ1MjIgNS40MjYxMiAxMi4yOTU2TDEuOTY1MjUgOC44MzQ3NkMxLjY1MjIxIDguNTIxNzIgMS42NTIyMSA4LjAzNDc2IDEuOTY1MjUgNy43MjE3MkMyLjI3ODI5IDcuNDA4NjcgMi43NjUyNSA3LjQwODY3IDMuMDc4MjkgNy43MjE3Mkw2LjAwMDAzIDEwLjYyNjFMMTIuOTM5MiAzLjcwNDMzQzEzLjI1MjIgMy4zOTEyOCAxMy43MzkyIDMuMzkxMjggMTQuMDUyMiAzLjcwNDMzQzE0LjM2NTMgNC4wMTczNyAxNC4zNjUzIDQuNTA0MzMgMTQuMDUyMiA0LjgxNzM3TDYuNTU2NTYgMTIuMjk1NkM2LjM4MjY0IDEyLjQ1MjIgNi4xOTEzNCAxMi41MjE3IDUuOTgyNjQgMTIuNTIxN1YxMi41MjE3WiIgZmlsbD0iI0ZFRkZGRiIvPgo8L3N2Zz4K'; |
|
|
|
/***/ }), |
|
|
|
/***/ "./panels/corpglory-dataexporter-panel/components/Panel.tsx": |
|
/*!******************************************************************!*\ |
|
!*** ./panels/corpglory-dataexporter-panel/components/Panel.tsx ***! |
|
\******************************************************************/ |
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "Panel": () => (/* binding */ Panel) |
|
/* harmony export */ }); |
|
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./panels/corpglory-dataexporter-panel/types.ts"); |
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utils */ "./utils/index.ts"); |
|
/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../icons */ "./icons.ts"); |
|
/* harmony import */ var _services_api_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../services/api_service */ "./services/api_service.ts"); |
|
/* harmony import */ var _services_grafana_backend_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../services/grafana_backend_service */ "./services/grafana_backend_service.ts"); |
|
/* harmony import */ var grafana_app_core_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! grafana/app/core/core */ "grafana/app/core/core"); |
|
/* harmony import */ var grafana_app_core_core__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(grafana_app_core_core__WEBPACK_IMPORTED_MODULE_5__); |
|
/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @grafana/ui */ "@grafana/ui"); |
|
/* harmony import */ var _grafana_ui__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_grafana_ui__WEBPACK_IMPORTED_MODULE_6__); |
|
/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @grafana/data */ "@grafana/data"); |
|
/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_grafana_data__WEBPACK_IMPORTED_MODULE_7__); |
|
/* harmony import */ var _grafana_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @grafana/runtime */ "@grafana/runtime"); |
|
/* harmony import */ var _grafana_runtime__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_grafana_runtime__WEBPACK_IMPORTED_MODULE_8__); |
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react */ "react"); |
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_9__); |
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash */ "lodash"); |
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__); |
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } |
|
var _LoadingPlaceholder, _LoadingPlaceholder2; |
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } |
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } |
|
function _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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } |
|
function 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); } } |
|
function _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); }); }; } |
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
|
function _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); } |
|
function _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; } |
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } |
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Panel(_ref) { |
|
var _queries$filter; |
|
var width = _ref.width, |
|
height = _ref.height, |
|
timeRange = _ref.timeRange, |
|
eventBus = _ref.eventBus; |
|
// TODO: Dashboard type |
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_9__.useState)(null), |
|
_useState2 = _slicedToArray(_useState, 2), |
|
dashboard = _useState2[0], |
|
setDashboard = _useState2[1]; |
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_9__.useState)(null), |
|
_useState4 = _slicedToArray(_useState3, 2), |
|
datasources = _useState4[0], |
|
setDatasources = _useState4[1]; |
|
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_9__.useState)(null), |
|
_useState6 = _slicedToArray(_useState5, 2), |
|
tasks = _useState6[0], |
|
setTasks = _useState6[1]; |
|
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_9__.useState)(null), |
|
_useState8 = _slicedToArray(_useState7, 2), |
|
queries = _useState8[0], |
|
setQueries = _useState8[1]; |
|
var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_9__.useState)(null), |
|
_useState10 = _slicedToArray(_useState9, 2), |
|
tasksDataFrame = _useState10[0], |
|
setTasksDataFrame = _useState10[1]; |
|
var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_9__.useState)(null), |
|
_useState12 = _slicedToArray(_useState11, 2), |
|
queriesDataFrame = _useState12[0], |
|
setQueriesDataFrame = _useState12[1]; |
|
var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_9__.useState)(false), |
|
_useState14 = _slicedToArray(_useState13, 2), |
|
isModalOpen = _useState14[0], |
|
setModalVisibility = _useState14[1]; |
|
(0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(function () { |
|
function getCurrentDashboard() { |
|
return _getCurrentDashboard.apply(this, arguments); |
|
} |
|
function _getCurrentDashboard() { |
|
_getCurrentDashboard = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { |
|
var currentDashboardUid; |
|
return _regeneratorRuntime().wrap(function _callee$(_context) { |
|
while (1) { |
|
switch (_context.prev = _context.next) { |
|
case 0: |
|
currentDashboardUid = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.getDashboardUid)(window.location.toString()); |
|
return _context.abrupt("return", (0,_services_grafana_backend_service__WEBPACK_IMPORTED_MODULE_4__.getDashboardByUid)(currentDashboardUid)); |
|
case 2: |
|
case "end": |
|
return _context.stop(); |
|
} |
|
} |
|
}, _callee); |
|
})); |
|
return _getCurrentDashboard.apply(this, arguments); |
|
} |
|
getCurrentDashboard().then(function (dash) { |
|
return setDashboard(dash.dashboard); |
|
})["catch"](function (err) { |
|
return console.error(err); |
|
}); |
|
}, []); |
|
(0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(function () { |
|
(0,_services_grafana_backend_service__WEBPACK_IMPORTED_MODULE_4__.getDatasources)().then(function (datasources) { |
|
return setDatasources(datasources); |
|
})["catch"](function (err) { |
|
return console.error(err); |
|
}); |
|
}, []); |
|
(0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(function () { |
|
if (!dashboard || !datasources) { |
|
return; |
|
} |
|
dashboard.panels.forEach(function (panel) { |
|
var _panel$datasource, _panel$targets; |
|
var queries = []; |
|
|
|
// @ts-ignore |
|
// TODO: move plugin id to const |
|
if (panel.type === 'corpglory-dataexporter-panel') { |
|
return; |
|
} |
|
if (!lodash__WEBPACK_IMPORTED_MODULE_10__.includes(lodash__WEBPACK_IMPORTED_MODULE_10__.values(_types__WEBPACK_IMPORTED_MODULE_0__.DatasourceType), (_panel$datasource = panel.datasource) === null || _panel$datasource === void 0 ? void 0 : _panel$datasource.type)) { |
|
return; |
|
} |
|
(_panel$targets = panel.targets) === null || _panel$targets === void 0 ? void 0 : _panel$targets.forEach(function (target) { |
|
var _target$datasource, _target$datasource2; |
|
console.log('uid', (_target$datasource = target.datasource) === null || _target$datasource === void 0 ? void 0 : _target$datasource.uid); |
|
var datasource = getDatasourceByUid((_target$datasource2 = target.datasource) === null || _target$datasource2 === void 0 ? void 0 : _target$datasource2.uid); |
|
if (!datasource) { |
|
return; |
|
} |
|
queries.push(_extends({}, target, { |
|
selected: false, |
|
panel: panel, |
|
datasource: datasource |
|
})); |
|
}); |
|
setQueries(queries); |
|
}); |
|
}, [dashboard, datasources]); // eslint-disable-line react-hooks/exhaustive-deps |
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(function () { |
|
if (tasks === null) { |
|
return; |
|
} |
|
var dataFrame = getDataFrameForTaskTable(tasks); |
|
setTasksDataFrame(dataFrame); |
|
}, [tasks]); // eslint-disable-line react-hooks/exhaustive-deps |
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(refresh, []); // eslint-disable-line react-hooks/exhaustive-deps |
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(function () { |
|
if (queries === null) { |
|
return; |
|
} |
|
setQueriesDataFrame(getDataFrameForQueriesTable(queries)); |
|
}, [queries]); // eslint-disable-line react-hooks/exhaustive-deps |
|
|
|
function refresh() { |
|
(0,_services_api_service__WEBPACK_IMPORTED_MODULE_3__.getTasks)().then(function (tasks) { |
|
setTasks(tasks); |
|
var _iterator = _createForOfIteratorHelper(tasks), |
|
_step; |
|
try { |
|
for (_iterator.s(); !(_step = _iterator.n()).done;) { |
|
var task = _step.value; |
|
// TODO: ExportStatus enum |
|
if (task.status === 'exporting') { |
|
setTimeout(refresh, 1000); |
|
return; |
|
} |
|
} |
|
} catch (err) { |
|
_iterator.e(err); |
|
} finally { |
|
_iterator.f(); |
|
} |
|
})["catch"](function (err) { |
|
return console.error(err); |
|
}); |
|
} |
|
eventBus.subscribe(_grafana_runtime__WEBPACK_IMPORTED_MODULE_8__.RefreshEvent, refresh); |
|
function getDatasourceByUid(uid) { |
|
if (lodash__WEBPACK_IMPORTED_MODULE_10__.isNil(uid)) { |
|
console.warn("uid is required to get datasource"); |
|
return undefined; |
|
} |
|
if (datasources === null) { |
|
console.warn("there is no datasources yet"); |
|
return undefined; |
|
} |
|
var datasource = lodash__WEBPACK_IMPORTED_MODULE_10__.find(datasources, function (datasource) { |
|
return datasource.uid === uid; |
|
}); |
|
if (!datasource) { |
|
console.warn("can't find datasource \"".concat(uid, "\"")); |
|
} |
|
return datasource; |
|
} |
|
function onAddTaskClick() { |
|
return _onAddTaskClick.apply(this, arguments); |
|
} |
|
function _onAddTaskClick() { |
|
_onAddTaskClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { |
|
var selectedQueries, timerange; |
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) { |
|
while (1) { |
|
switch (_context2.prev = _context2.next) { |
|
case 0: |
|
selectedQueries = lodash__WEBPACK_IMPORTED_MODULE_10__.filter(queries, function (query) { |
|
return query.selected; |
|
}); // TODO: timerange picker |
|
timerange = [timeRange.from.unix(), timeRange.to.unix()]; // TODO: move this function to API Service |
|
_context2.next = 4; |
|
return (0,_services_api_service__WEBPACK_IMPORTED_MODULE_3__.queryApi)('/task', { |
|
method: 'POST', |
|
data: { |
|
from: timerange[0] * 1000, |
|
to: timerange[1] * 1000, |
|
// @ts-ignore |
|
username: grafana_app_core_core__WEBPACK_IMPORTED_MODULE_5__.contextSrv.user.name, |
|
tasks: selectedQueries, |
|
url: window.location.toString() |
|
} |
|
}); |
|
case 4: |
|
refresh(); |
|
onCloseModal(); |
|
unselectAllQueries(); |
|
case 7: |
|
case "end": |
|
return _context2.stop(); |
|
} |
|
} |
|
}, _callee2); |
|
})); |
|
return _onAddTaskClick.apply(this, arguments); |
|
} |
|
function unselectAllQueries() { |
|
if (queries === null) { |
|
return; |
|
} |
|
setQueries(queries.map(function (query) { |
|
return _extends({}, query, { |
|
selected: false |
|
}); |
|
})); |
|
} |
|
function openDatasourceModal() { |
|
setModalVisibility(true); |
|
} |
|
function onCloseModal() { |
|
setModalVisibility(false); |
|
unselectAllQueries(); |
|
} |
|
function getDataFrameForQueriesTable(configs) { |
|
var dataFrame = (0,_grafana_data__WEBPACK_IMPORTED_MODULE_7__.toDataFrame)({ |
|
name: 'A', |
|
fields: [{ |
|
name: 'Select', |
|
type: _grafana_data__WEBPACK_IMPORTED_MODULE_7__.FieldType.string, |
|
values: lodash__WEBPACK_IMPORTED_MODULE_10__.map(configs, function (config) { |
|
return "data:image/svg+xml;base64,".concat(config.selected ? _icons__WEBPACK_IMPORTED_MODULE_2__.SELECT_ICON_BASE_64 : _icons__WEBPACK_IMPORTED_MODULE_2__.UNSELECT_ICON_BASE_64); |
|
}), |
|
config: { |
|
custom: { |
|
filterable: false, |
|
displayMode: 'image' |
|
}, |
|
links: [{ |
|
targetBlank: false, |
|
title: 'Select', |
|
url: '#', |
|
onClick: function onClick(event) { |
|
return onDatasourceSelectClick(event); |
|
} |
|
}] |
|
} |
|
}, { |
|
name: 'Panel', |
|
type: _grafana_data__WEBPACK_IMPORTED_MODULE_7__.FieldType.string, |
|
values: lodash__WEBPACK_IMPORTED_MODULE_10__.map(configs, function (config) { |
|
return config.panel.title; |
|
}) |
|
}, { |
|
name: 'RefId', |
|
type: _grafana_data__WEBPACK_IMPORTED_MODULE_7__.FieldType.string, |
|
values: lodash__WEBPACK_IMPORTED_MODULE_10__.map(configs, function (config) { |
|
return config.refId; |
|
}) |
|
}, { |
|
name: 'Datasource', |
|
type: _grafana_data__WEBPACK_IMPORTED_MODULE_7__.FieldType.string, |
|
values: lodash__WEBPACK_IMPORTED_MODULE_10__.map(configs, function (config) { |
|
return config.datasource.name; |
|
}) |
|
}] |
|
}); |
|
var dataFrames = (0,_grafana_data__WEBPACK_IMPORTED_MODULE_7__.applyFieldOverrides)({ |
|
data: [dataFrame], |
|
fieldConfig: { |
|
overrides: [], |
|
defaults: {} |
|
}, |
|
theme: (0,_grafana_data__WEBPACK_IMPORTED_MODULE_7__.createTheme)(), |
|
replaceVariables: function replaceVariables(value) { |
|
return value; |
|
} |
|
}); |
|
return dataFrames[0]; |
|
} |
|
function getDataFrameForTaskTable(configs) { |
|
var dataFrame = (0,_grafana_data__WEBPACK_IMPORTED_MODULE_7__.toDataFrame)({ |
|
name: 'A', |
|
fields: [{ |
|
name: 'Time', |
|
type: _grafana_data__WEBPACK_IMPORTED_MODULE_7__.FieldType.number, |
|
values: lodash__WEBPACK_IMPORTED_MODULE_10__.map(configs, function (config) { |
|
return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.convertTimestampToDate)(config.timestamp); |
|
}) |
|
}, { |
|
name: 'User', |
|
type: _grafana_data__WEBPACK_IMPORTED_MODULE_7__.FieldType.string, |
|
values: lodash__WEBPACK_IMPORTED_MODULE_10__.map(configs, function (config) { |
|
return config.username; |
|
}) |
|
}, { |
|
name: 'Datasource', |
|
type: _grafana_data__WEBPACK_IMPORTED_MODULE_7__.FieldType.string, |
|
values: lodash__WEBPACK_IMPORTED_MODULE_10__.map(configs, function (config) { |
|
var _getDatasourceByUid, _config$datasourceRef; |
|
return (_getDatasourceByUid = getDatasourceByUid((_config$datasourceRef = config.datasourceRef) === null || _config$datasourceRef === void 0 ? void 0 : _config$datasourceRef.uid)) === null || _getDatasourceByUid === void 0 ? void 0 : _getDatasourceByUid.name; |
|
}) |
|
}, { |
|
name: 'Exported Rows', |
|
type: _grafana_data__WEBPACK_IMPORTED_MODULE_7__.FieldType.number, |
|
values: lodash__WEBPACK_IMPORTED_MODULE_10__.map(configs, function (config) { |
|
return config.rowsCount; |
|
}) |
|
}, { |
|
name: 'Progress', |
|
type: _grafana_data__WEBPACK_IMPORTED_MODULE_7__.FieldType.string, |
|
values: lodash__WEBPACK_IMPORTED_MODULE_10__.map(configs, function (config) { |
|
return "".concat((config.progress * 100).toFixed(0), "%"); |
|
}) |
|
}, { |
|
name: 'Status', |
|
type: _grafana_data__WEBPACK_IMPORTED_MODULE_7__.FieldType.string, |
|
values: lodash__WEBPACK_IMPORTED_MODULE_10__.map(configs, function (config) { |
|
return config.status; |
|
}) |
|
}, { |
|
name: 'Download CSV', |
|
type: _grafana_data__WEBPACK_IMPORTED_MODULE_7__.FieldType.string, |
|
values: lodash__WEBPACK_IMPORTED_MODULE_10__.map(configs, function () { |
|
return "data:image/png;base64,".concat(_icons__WEBPACK_IMPORTED_MODULE_2__.DOWNLOAD_ICON_BASE_64); |
|
}), |
|
config: { |
|
custom: { |
|
filterable: false, |
|
displayMode: 'image' |
|
}, |
|
links: [{ |
|
targetBlank: false, |
|
title: 'Download', |
|
url: '#', |
|
onClick: function onClick(event) { |
|
return onDownloadClick(event); |
|
} |
|
}] |
|
} |
|
}, { |
|
name: 'Delete task', |
|
type: _grafana_data__WEBPACK_IMPORTED_MODULE_7__.FieldType.string, |
|
values: lodash__WEBPACK_IMPORTED_MODULE_10__.map(configs, function () { |
|
return "data:image/png;base64,".concat(_icons__WEBPACK_IMPORTED_MODULE_2__.CLOSE_ICON_BASE_64); |
|
}), |
|
config: { |
|
custom: { |
|
filterable: false, |
|
displayMode: 'image' |
|
}, |
|
links: [{ |
|
targetBlank: false, |
|
title: 'Delete', |
|
url: '#', |
|
onClick: function onClick(event) { |
|
return onDeleteClick(event); |
|
} |
|
}] |
|
} |
|
}] |
|
}); |
|
var dataFrames = (0,_grafana_data__WEBPACK_IMPORTED_MODULE_7__.applyFieldOverrides)({ |
|
data: [dataFrame], |
|
fieldConfig: { |
|
overrides: [], |
|
defaults: {} |
|
}, |
|
theme: (0,_grafana_data__WEBPACK_IMPORTED_MODULE_7__.createTheme)(), |
|
replaceVariables: function replaceVariables(value) { |
|
return value; |
|
} |
|
}); |
|
return dataFrames[0]; |
|
} |
|
function onDeleteClick(_x2) { |
|
return _onDeleteClick.apply(this, arguments); |
|
} |
|
function _onDeleteClick() { |
|
_onDeleteClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) { |
|
var rowIndex, task, filteredTasks; |
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) { |
|
while (1) { |
|
switch (_context3.prev = _context3.next) { |
|
case 0: |
|
rowIndex = e.origin.rowIndex; |
|
task = lodash__WEBPACK_IMPORTED_MODULE_10__.find(tasks, function (task, idx) { |
|
return idx === rowIndex; |
|
}); |
|
_context3.next = 4; |
|
return (0,_services_api_service__WEBPACK_IMPORTED_MODULE_3__.deleteTask)(task === null || task === void 0 ? void 0 : task.filename); |
|
case 4: |
|
filteredTasks = lodash__WEBPACK_IMPORTED_MODULE_10__.filter(tasks, function (task, idx) { |
|
return idx !== rowIndex; |
|
}); |
|
setTasks(filteredTasks); |
|
case 6: |
|
case "end": |
|
return _context3.stop(); |
|
} |
|
} |
|
}, _callee3); |
|
})); |
|
return _onDeleteClick.apply(this, arguments); |
|
} |
|
function onDownloadClick(e) { |
|
var rowIndex = e.origin.rowIndex; |
|
var task = lodash__WEBPACK_IMPORTED_MODULE_10__.find(tasks, function (task, idx) { |
|
return idx === rowIndex; |
|
}); |
|
(0,_services_api_service__WEBPACK_IMPORTED_MODULE_3__.getStaticFile)(task === null || task === void 0 ? void 0 : task.filename); |
|
} |
|
function onDatasourceSelectClick(e) { |
|
if (queries === null) { |
|
return; |
|
} |
|
var rowIndex = e.origin.rowIndex; |
|
var updatedQueries = lodash__WEBPACK_IMPORTED_MODULE_10__.clone(queries); |
|
updatedQueries[rowIndex].selected = !updatedQueries[rowIndex].selected; |
|
setQueries(updatedQueries); |
|
} |
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement("div", null, tasksDataFrame === null ? // TODO: if datasource responds with error, display the error |
|
_LoadingPlaceholder || (_LoadingPlaceholder = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_6__.LoadingPlaceholder, { |
|
text: "Loading..." |
|
})) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_6__.Table, { |
|
width: width, |
|
height: height - 40, |
|
data: tasksDataFrame |
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_6__.HorizontalGroup, { |
|
justify: "flex-end" |
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_6__.Button, { |
|
variant: "primary", |
|
"aria-label": "Rich history button", |
|
icon: "plus", |
|
style: { |
|
marginTop: '8px' |
|
}, |
|
onClick: openDatasourceModal |
|
}, "Add Task"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_6__.Modal, { |
|
title: "Select Queries", |
|
isOpen: isModalOpen, |
|
onDismiss: onCloseModal |
|
}, queriesDataFrame === null ? // TODO: if datasource responds with error, display the error |
|
_LoadingPlaceholder2 || (_LoadingPlaceholder2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_6__.LoadingPlaceholder, { |
|
text: "Loading..." |
|
})) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_6__.Table, { |
|
width: width / 2 - 20, |
|
height: height - 40, |
|
data: queriesDataFrame |
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_6__.HorizontalGroup, { |
|
justify: "flex-end" |
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_grafana_ui__WEBPACK_IMPORTED_MODULE_6__.Button, { |
|
variant: "primary", |
|
"aria-label": "Add task button", |
|
style: { |
|
marginTop: '8px' |
|
}, |
|
onClick: onAddTaskClick |
|
// TODO: move to function |
|
, |
|
disabled: !(queries !== null && queries !== void 0 && (_queries$filter = queries.filter(function (query) { |
|
return query.selected; |
|
})) !== null && _queries$filter !== void 0 && _queries$filter.length) |
|
}, "Add Task"))))))); |
|
} |
|
|
|
/***/ }), |
|
|
|
/***/ "./panels/corpglory-dataexporter-panel/types.ts": |
|
/*!******************************************************!*\ |
|
!*** ./panels/corpglory-dataexporter-panel/types.ts ***! |
|
\******************************************************/ |
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "DatasourceType": () => (/* binding */ DatasourceType) |
|
/* harmony export */ }); |
|
var DatasourceType; |
|
(function (DatasourceType) { |
|
DatasourceType["INFLUXDB"] = "influxdb"; |
|
DatasourceType["GRAPHITE"] = "graphite"; |
|
DatasourceType["PROMETHEUS"] = "prometheus"; |
|
DatasourceType["POSTGRES"] = "postgres"; |
|
DatasourceType["ELASTICSEARCH"] = "elasticsearch"; |
|
DatasourceType["MYSQL"] = "mysql"; |
|
})(DatasourceType || (DatasourceType = {})); |
|
|
|
/***/ }), |
|
|
|
/***/ "./services/api_service.ts": |
|
/*!*********************************!*\ |
|
!*** ./services/api_service.ts ***! |
|
\*********************************/ |
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "API_HOST": () => (/* binding */ API_HOST), |
|
/* harmony export */ "API_PATH_PREFIX": () => (/* binding */ API_PATH_PREFIX), |
|
/* harmony export */ "API_PROXY_PREFIX": () => (/* binding */ API_PROXY_PREFIX), |
|
/* harmony export */ "deleteTask": () => (/* binding */ deleteTask), |
|
/* harmony export */ "getStaticFile": () => (/* binding */ getStaticFile), |
|
/* harmony export */ "getTasks": () => (/* binding */ getTasks), |
|
/* harmony export */ "queryApi": () => (/* binding */ queryApi) |
|
/* harmony export */ }); |
|
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "../node_modules/axios/lib/axios.js"); |
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash"); |
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); |
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } |
|
function _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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } |
|
function 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); } } |
|
function _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); }); }; } |
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } |
|
|
|
|
|
var API_HOST = "".concat(window.location.protocol, "//").concat(window.location.host, "/"); |
|
var API_PROXY_PREFIX = 'api/plugin-proxy/corpglory-dataexporter-app'; |
|
var API_PATH_PREFIX = '/api'; |
|
var instance = axios__WEBPACK_IMPORTED_MODULE_1__["default"].create(); |
|
instance.interceptors.request.use(function (config) { |
|
config.validateStatus = function (status) { |
|
return status >= 200 && status < 300; // default |
|
}; |
|
|
|
return _extends({}, config); |
|
}); |
|
var queryApi = /*#__PURE__*/function () { |
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(path, config) { |
|
var _config$method, method, params, data, validateStatus, url, response; |
|
return _regeneratorRuntime().wrap(function _callee$(_context) { |
|
while (1) { |
|
switch (_context.prev = _context.next) { |
|
case 0: |
|
_config$method = config.method, method = _config$method === void 0 ? 'GET' : _config$method, params = config.params, data = config.data, validateStatus = config.validateStatus; |
|
url = "".concat(API_PROXY_PREFIX).concat(API_PATH_PREFIX).concat(path); |
|
_context.next = 4; |
|
return instance({ |
|
method: method, |
|
url: url, |
|
params: params, |
|
data: data, |
|
validateStatus: validateStatus |
|
}); |
|
case 4: |
|
response = _context.sent; |
|
return _context.abrupt("return", response.data); |
|
case 6: |
|
case "end": |
|
return _context.stop(); |
|
} |
|
} |
|
}, _callee); |
|
})); |
|
return function queryApi(_x, _x2) { |
|
return _ref.apply(this, arguments); |
|
}; |
|
}(); |
|
function getTasks() { |
|
return _getTasks.apply(this, arguments); |
|
} |
|
function _getTasks() { |
|
_getTasks = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { |
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) { |
|
while (1) { |
|
switch (_context2.prev = _context2.next) { |
|
case 0: |
|
return _context2.abrupt("return", queryApi('/task', {})); |
|
case 1: |
|
case "end": |
|
return _context2.stop(); |
|
} |
|
} |
|
}, _callee2); |
|
})); |
|
return _getTasks.apply(this, arguments); |
|
} |
|
function deleteTask(_x3) { |
|
return _deleteTask.apply(this, arguments); |
|
} |
|
function _deleteTask() { |
|
_deleteTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(filename) { |
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) { |
|
while (1) { |
|
switch (_context3.prev = _context3.next) { |
|
case 0: |
|
if (!lodash__WEBPACK_IMPORTED_MODULE_0__.isEmpty(filename)) { |
|
_context3.next = 3; |
|
break; |
|
} |
|
console.warn("can't delete task without filename"); |
|
return _context3.abrupt("return"); |
|
case 3: |
|
_context3.next = 5; |
|
return queryApi('/task', { |
|
method: 'DELETE', |
|
data: { |
|
filename: filename |
|
} |
|
}); |
|
case 5: |
|
case "end": |
|
return _context3.stop(); |
|
} |
|
} |
|
}, _callee3); |
|
})); |
|
return _deleteTask.apply(this, arguments); |
|
} |
|
function getStaticFile(_x4) { |
|
return _getStaticFile.apply(this, arguments); |
|
} |
|
function _getStaticFile() { |
|
_getStaticFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(filename) { |
|
var respData, href, link; |
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) { |
|
while (1) { |
|
switch (_context4.prev = _context4.next) { |
|
case 0: |
|
if (!lodash__WEBPACK_IMPORTED_MODULE_0__.isEmpty(filename)) { |
|
_context4.next = 3; |
|
break; |
|
} |
|
console.warn("can't download file without name"); |
|
return _context4.abrupt("return"); |
|
case 3: |
|
_context4.next = 5; |
|
return queryApi("/static/".concat(filename, ".csv"), {}); |
|
case 5: |
|
respData = _context4.sent; |
|
// TODO: check if resp exists |
|
// create file link in browser's memory |
|
href = URL.createObjectURL(new Blob([respData], { |
|
type: 'text/csv' |
|
})); // create "a" HTML element with href to file & click |
|
link = document.createElement('a'); |
|
link.href = href; |
|
link.setAttribute('download', "".concat(filename, ".csv")); |
|
document.body.appendChild(link); |
|
link.click(); |
|
|
|
// clean up "a" element & remove ObjectURL |
|
document.body.removeChild(link); |
|
URL.revokeObjectURL(href); |
|
case 14: |
|
case "end": |
|
return _context4.stop(); |
|
} |
|
} |
|
}, _callee4); |
|
})); |
|
return _getStaticFile.apply(this, arguments); |
|
} |
|
|
|
/***/ }), |
|
|
|
/***/ "./services/grafana_backend_service.ts": |
|
/*!*********************************************!*\ |
|
!*** ./services/grafana_backend_service.ts ***! |
|
\*********************************************/ |
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "getDashboardByUid": () => (/* binding */ getDashboardByUid), |
|
/* harmony export */ "getDatasources": () => (/* binding */ getDatasources) |
|
/* harmony export */ }); |
|
/* harmony import */ var _grafana_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @grafana/runtime */ "@grafana/runtime"); |
|
/* harmony import */ var _grafana_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_grafana_runtime__WEBPACK_IMPORTED_MODULE_0__); |
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } |
|
function _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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } |
|
function 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); } } |
|
function _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); }); }; } |
|
|
|
function getDatasources() { |
|
return _getDatasources.apply(this, arguments); |
|
} |
|
function _getDatasources() { |
|
_getDatasources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { |
|
var backendSrv; |
|
return _regeneratorRuntime().wrap(function _callee$(_context) { |
|
while (1) { |
|
switch (_context.prev = _context.next) { |
|
case 0: |
|
backendSrv = (0,_grafana_runtime__WEBPACK_IMPORTED_MODULE_0__.getBackendSrv)(); |
|
return _context.abrupt("return", backendSrv.get("/api/datasources")); |
|
case 2: |
|
case "end": |
|
return _context.stop(); |
|
} |
|
} |
|
}, _callee); |
|
})); |
|
return _getDatasources.apply(this, arguments); |
|
} |
|
function getDashboardByUid(_x) { |
|
return _getDashboardByUid.apply(this, arguments); |
|
} |
|
function _getDashboardByUid() { |
|
_getDashboardByUid = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(uid) { |
|
var backendSrv; |
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) { |
|
while (1) { |
|
switch (_context2.prev = _context2.next) { |
|
case 0: |
|
backendSrv = (0,_grafana_runtime__WEBPACK_IMPORTED_MODULE_0__.getBackendSrv)(); |
|
return _context2.abrupt("return", backendSrv.get("/api/dashboards/uid/".concat(uid))); |
|
case 2: |
|
case "end": |
|
return _context2.stop(); |
|
} |
|
} |
|
}, _callee2); |
|
})); |
|
return _getDashboardByUid.apply(this, arguments); |
|
} |
|
|
|
/***/ }), |
|
|
|
/***/ "./utils/index.ts": |
|
/*!************************!*\ |
|
!*** ./utils/index.ts ***! |
|
\************************/ |
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "convertTimestampToDate": () => (/* binding */ convertTimestampToDate), |
|
/* harmony export */ "getDashboardUid": () => (/* binding */ getDashboardUid), |
|
/* harmony export */ "openNotification": () => (/* binding */ openNotification) |
|
/* harmony export */ }); |
|
/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @grafana/data */ "@grafana/data"); |
|
/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_grafana_data__WEBPACK_IMPORTED_MODULE_0__); |
|
/* harmony import */ var grafana_app_core_app_events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! grafana/app/core/app_events */ "grafana/app/core/app_events"); |
|
/* harmony import */ var grafana_app_core_app_events__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(grafana_app_core_app_events__WEBPACK_IMPORTED_MODULE_1__); |
|
|
|
// @ts-ignore |
|
|
|
function openNotification(message) { |
|
grafana_app_core_app_events__WEBPACK_IMPORTED_MODULE_1___default().emit(_grafana_data__WEBPACK_IMPORTED_MODULE_0__.AppEvents.alertSuccess, [message]); |
|
} |
|
function getDashboardUid(url) { |
|
var matches = new URL(url).pathname.match(/\/d\/([^/]+)/); |
|
if (!matches) { |
|
throw new Error("Couldn't parse uid from ".concat(url)); |
|
} else { |
|
return matches[1]; |
|
} |
|
} |
|
function convertTimestampToDate(timestamp) { |
|
var options = { |
|
year: 'numeric', |
|
month: 'short', |
|
day: 'numeric', |
|
hour: 'numeric', |
|
minute: 'numeric', |
|
second: 'numeric' |
|
}; |
|
return new Date(timestamp).toLocaleString('en-GB', options); |
|
} |
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/node_modules/form-data/lib/browser.js": |
|
/*!*******************************************************************!*\ |
|
!*** ../node_modules/axios/node_modules/form-data/lib/browser.js ***! |
|
\*******************************************************************/ |
|
/***/ ((module) => { |
|
|
|
/* eslint-env browser */ |
|
module.exports = typeof self == 'object' ? self.FormData : window.FormData; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "@grafana/data": |
|
/*!********************************!*\ |
|
!*** external "@grafana/data" ***! |
|
\********************************/ |
|
/***/ ((module) => { |
|
|
|
"use strict"; |
|
module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_data__; |
|
|
|
/***/ }), |
|
|
|
/***/ "@grafana/runtime": |
|
/*!***********************************!*\ |
|
!*** external "@grafana/runtime" ***! |
|
\***********************************/ |
|
/***/ ((module) => { |
|
|
|
"use strict"; |
|
module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_runtime__; |
|
|
|
/***/ }), |
|
|
|
/***/ "@grafana/ui": |
|
/*!******************************!*\ |
|
!*** external "@grafana/ui" ***! |
|
\******************************/ |
|
/***/ ((module) => { |
|
|
|
"use strict"; |
|
module.exports = __WEBPACK_EXTERNAL_MODULE__grafana_ui__; |
|
|
|
/***/ }), |
|
|
|
/***/ "grafana/app/core/app_events": |
|
/*!**************************************!*\ |
|
!*** external "app/core/app_events" ***! |
|
\**************************************/ |
|
/***/ ((module) => { |
|
|
|
"use strict"; |
|
module.exports = __WEBPACK_EXTERNAL_MODULE_grafana_app_core_app_events__; |
|
|
|
/***/ }), |
|
|
|
/***/ "grafana/app/core/core": |
|
/*!********************************!*\ |
|
!*** external "app/core/core" ***! |
|
\********************************/ |
|
/***/ ((module) => { |
|
|
|
"use strict"; |
|
module.exports = __WEBPACK_EXTERNAL_MODULE_grafana_app_core_core__; |
|
|
|
/***/ }), |
|
|
|
/***/ "lodash": |
|
/*!*************************!*\ |
|
!*** external "lodash" ***! |
|
\*************************/ |
|
/***/ ((module) => { |
|
|
|
"use strict"; |
|
module.exports = __WEBPACK_EXTERNAL_MODULE_lodash__; |
|
|
|
/***/ }), |
|
|
|
/***/ "react": |
|
/*!************************!*\ |
|
!*** external "react" ***! |
|
\************************/ |
|
/***/ ((module) => { |
|
|
|
"use strict"; |
|
module.exports = __WEBPACK_EXTERNAL_MODULE_react__; |
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/adapters/adapters.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/axios/lib/adapters/adapters.js ***! |
|
\******************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http.js */ "../node_modules/axios/lib/helpers/null.js"); |
|
/* harmony import */ var _xhr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./xhr.js */ "../node_modules/axios/lib/adapters/xhr.js"); |
|
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/AxiosError.js */ "../node_modules/axios/lib/core/AxiosError.js"); |
|
|
|
|
|
|
|
|
|
|
|
const knownAdapters = { |
|
http: _http_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
xhr: _xhr_js__WEBPACK_IMPORTED_MODULE_1__["default"] |
|
} |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(knownAdapters, (fn, value) => { |
|
if(fn) { |
|
try { |
|
Object.defineProperty(fn, 'name', {value}); |
|
} catch (e) { |
|
// eslint-disable-next-line no-empty |
|
} |
|
Object.defineProperty(fn, 'adapterName', {value}); |
|
} |
|
}); |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ |
|
getAdapter: (adapters) => { |
|
adapters = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isArray(adapters) ? adapters : [adapters]; |
|
|
|
const {length} = adapters; |
|
let nameOrAdapter; |
|
let adapter; |
|
|
|
for (let i = 0; i < length; i++) { |
|
nameOrAdapter = adapters[i]; |
|
if((adapter = _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) { |
|
break; |
|
} |
|
} |
|
|
|
if (!adapter) { |
|
if (adapter === false) { |
|
throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]( |
|
`Adapter ${nameOrAdapter} is not supported by the environment`, |
|
'ERR_NOT_SUPPORT' |
|
); |
|
} |
|
|
|
throw new Error( |
|
_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].hasOwnProp(knownAdapters, nameOrAdapter) ? |
|
`Adapter '${nameOrAdapter}' is not available in the build` : |
|
`Unknown adapter '${nameOrAdapter}'` |
|
); |
|
} |
|
|
|
if (!_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isFunction(adapter)) { |
|
throw new TypeError('adapter is not a function'); |
|
} |
|
|
|
return adapter; |
|
}, |
|
adapters: knownAdapters |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/adapters/xhr.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/axios/lib/adapters/xhr.js ***! |
|
\*************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../core/settle.js */ "../node_modules/axios/lib/core/settle.js"); |
|
/* harmony import */ var _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./../helpers/cookies.js */ "../node_modules/axios/lib/helpers/cookies.js"); |
|
/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../helpers/buildURL.js */ "../node_modules/axios/lib/helpers/buildURL.js"); |
|
/* harmony import */ var _core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/buildFullPath.js */ "../node_modules/axios/lib/core/buildFullPath.js"); |
|
/* harmony import */ var _helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../helpers/isURLSameOrigin.js */ "../node_modules/axios/lib/helpers/isURLSameOrigin.js"); |
|
/* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../defaults/transitional.js */ "../node_modules/axios/lib/defaults/transitional.js"); |
|
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/AxiosError.js */ "../node_modules/axios/lib/core/AxiosError.js"); |
|
/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "../node_modules/axios/lib/cancel/CanceledError.js"); |
|
/* harmony import */ var _helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../helpers/parseProtocol.js */ "../node_modules/axios/lib/helpers/parseProtocol.js"); |
|
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../platform/index.js */ "../node_modules/axios/lib/platform/browser/index.js"); |
|
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "../node_modules/axios/lib/core/AxiosHeaders.js"); |
|
/* harmony import */ var _helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/speedometer.js */ "../node_modules/axios/lib/helpers/speedometer.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function progressEventReducer(listener, isDownloadStream) { |
|
let bytesNotified = 0; |
|
const _speedometer = (0,_helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(50, 250); |
|
|
|
return e => { |
|
const loaded = e.loaded; |
|
const total = e.lengthComputable ? e.total : undefined; |
|
const progressBytes = loaded - bytesNotified; |
|
const rate = _speedometer(progressBytes); |
|
const inRange = loaded <= total; |
|
|
|
bytesNotified = loaded; |
|
|
|
const data = { |
|
loaded, |
|
total, |
|
progress: total ? (loaded / total) : undefined, |
|
bytes: progressBytes, |
|
rate: rate ? rate : undefined, |
|
estimated: rate && total && inRange ? (total - loaded) / rate : undefined, |
|
event: e |
|
}; |
|
|
|
data[isDownloadStream ? 'download' : 'upload'] = true; |
|
|
|
listener(data); |
|
}; |
|
} |
|
|
|
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isXHRAdapterSupported && function (config) { |
|
return new Promise(function dispatchXhrRequest(resolve, reject) { |
|
let requestData = config.data; |
|
const requestHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(config.headers).normalize(); |
|
const responseType = config.responseType; |
|
let onCanceled; |
|
function done() { |
|
if (config.cancelToken) { |
|
config.cancelToken.unsubscribe(onCanceled); |
|
} |
|
|
|
if (config.signal) { |
|
config.signal.removeEventListener('abort', onCanceled); |
|
} |
|
} |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isFormData(requestData) && (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserWebWorkerEnv)) { |
|
requestHeaders.setContentType(false); // Let the browser set it |
|
} |
|
|
|
let request = new XMLHttpRequest(); |
|
|
|
// HTTP basic authentication |
|
if (config.auth) { |
|
const username = config.auth.username || ''; |
|
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; |
|
requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); |
|
} |
|
|
|
const fullPath = (0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(config.baseURL, config.url); |
|
|
|
request.open(config.method.toUpperCase(), (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_5__["default"])(fullPath, config.params, config.paramsSerializer), true); |
|
|
|
// Set the request timeout in MS |
|
request.timeout = config.timeout; |
|
|
|
function onloadend() { |
|
if (!request) { |
|
return; |
|
} |
|
// Prepare the response |
|
const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from( |
|
'getAllResponseHeaders' in request && request.getAllResponseHeaders() |
|
); |
|
const responseData = !responseType || responseType === 'text' || responseType === 'json' ? |
|
request.responseText : request.response; |
|
const response = { |
|
data: responseData, |
|
status: request.status, |
|
statusText: request.statusText, |
|
headers: responseHeaders, |
|
config, |
|
request |
|
}; |
|
|
|
(0,_core_settle_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function _resolve(value) { |
|
resolve(value); |
|
done(); |
|
}, function _reject(err) { |
|
reject(err); |
|
done(); |
|
}, response); |
|
|
|
// Clean up request |
|
request = null; |
|
} |
|
|
|
if ('onloadend' in request) { |
|
// Use onloadend if available |
|
request.onloadend = onloadend; |
|
} else { |
|
// Listen for ready state to emulate onloadend |
|
request.onreadystatechange = function handleLoad() { |
|
if (!request || request.readyState !== 4) { |
|
return; |
|
} |
|
|
|
// The request errored out and we didn't get a response, this will be |
|
// handled by onerror instead |
|
// With one exception: request that using file: protocol, most browsers |
|
// will return status as 0 even though it's a successful request |
|
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { |
|
return; |
|
} |
|
// readystate handler is calling before onerror or ontimeout handlers, |
|
// so we should call onloadend on the next 'tick' |
|
setTimeout(onloadend); |
|
}; |
|
} |
|
|
|
// Handle browser request cancellation (as opposed to a manual cancellation) |
|
request.onabort = function handleAbort() { |
|
if (!request) { |
|
return; |
|
} |
|
|
|
reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, config, request)); |
|
|
|
// Clean up request |
|
request = null; |
|
}; |
|
|
|
// Handle low level network errors |
|
request.onerror = function handleError() { |
|
// Real errors are hidden from us by the browser |
|
// onerror should only fire if it's a network error |
|
reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ERR_NETWORK, config, request)); |
|
|
|
// Clean up request |
|
request = null; |
|
}; |
|
|
|
// Handle timeout |
|
request.ontimeout = function handleTimeout() { |
|
let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; |
|
const transitional = config.transitional || _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_8__["default"]; |
|
if (config.timeoutErrorMessage) { |
|
timeoutErrorMessage = config.timeoutErrorMessage; |
|
} |
|
reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]( |
|
timeoutErrorMessage, |
|
transitional.clarifyTimeoutError ? _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ETIMEDOUT : _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, |
|
config, |
|
request)); |
|
|
|
// Clean up request |
|
request = null; |
|
}; |
|
|
|
// Add xsrf header |
|
// This is only done if running in a standard browser environment. |
|
// Specifically not if we're in a web worker, or react-native. |
|
if (_platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].isStandardBrowserEnv) { |
|
// Add xsrf header |
|
const xsrfValue = (config.withCredentials || (0,_helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_9__["default"])(fullPath)) |
|
&& config.xsrfCookieName && _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_10__["default"].read(config.xsrfCookieName); |
|
|
|
if (xsrfValue) { |
|
requestHeaders.set(config.xsrfHeaderName, xsrfValue); |
|
} |
|
} |
|
|
|
// Remove Content-Type if data is undefined |
|
requestData === undefined && requestHeaders.setContentType(null); |
|
|
|
// Add headers to the request |
|
if ('setRequestHeader' in request) { |
|
_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { |
|
request.setRequestHeader(key, val); |
|
}); |
|
} |
|
|
|
// Add withCredentials to request if needed |
|
if (!_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isUndefined(config.withCredentials)) { |
|
request.withCredentials = !!config.withCredentials; |
|
} |
|
|
|
// Add responseType to request if needed |
|
if (responseType && responseType !== 'json') { |
|
request.responseType = config.responseType; |
|
} |
|
|
|
// Handle progress if needed |
|
if (typeof config.onDownloadProgress === 'function') { |
|
request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); |
|
} |
|
|
|
// Not all browsers support upload events |
|
if (typeof config.onUploadProgress === 'function' && request.upload) { |
|
request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); |
|
} |
|
|
|
if (config.cancelToken || config.signal) { |
|
// Handle cancellation |
|
// eslint-disable-next-line func-names |
|
onCanceled = cancel => { |
|
if (!request) { |
|
return; |
|
} |
|
reject(!cancel || cancel.type ? new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_11__["default"](null, config, request) : cancel); |
|
request.abort(); |
|
request = null; |
|
}; |
|
|
|
config.cancelToken && config.cancelToken.subscribe(onCanceled); |
|
if (config.signal) { |
|
config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); |
|
} |
|
} |
|
|
|
const protocol = (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_12__["default"])(fullPath); |
|
|
|
if (protocol && _platform_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].protocols.indexOf(protocol) === -1) { |
|
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)); |
|
return; |
|
} |
|
|
|
|
|
// Send the request |
|
request.send(requestData || null); |
|
}); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/axios.js": |
|
/*!******************************************!*\ |
|
!*** ../node_modules/axios/lib/axios.js ***! |
|
\******************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "../node_modules/axios/lib/utils.js"); |
|
/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/bind.js */ "../node_modules/axios/lib/helpers/bind.js"); |
|
/* harmony import */ var _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/Axios.js */ "../node_modules/axios/lib/core/Axios.js"); |
|
/* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core/mergeConfig.js */ "../node_modules/axios/lib/core/mergeConfig.js"); |
|
/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaults/index.js */ "../node_modules/axios/lib/defaults/index.js"); |
|
/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers/formDataToJSON.js */ "../node_modules/axios/lib/helpers/formDataToJSON.js"); |
|
/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cancel/CanceledError.js */ "../node_modules/axios/lib/cancel/CanceledError.js"); |
|
/* harmony import */ var _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cancel/CancelToken.js */ "../node_modules/axios/lib/cancel/CancelToken.js"); |
|
/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./cancel/isCancel.js */ "../node_modules/axios/lib/cancel/isCancel.js"); |
|
/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./env/data.js */ "../node_modules/axios/lib/env/data.js"); |
|
/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/toFormData.js */ "../node_modules/axios/lib/helpers/toFormData.js"); |
|
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./core/AxiosError.js */ "../node_modules/axios/lib/core/AxiosError.js"); |
|
/* harmony import */ var _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/spread.js */ "../node_modules/axios/lib/helpers/spread.js"); |
|
/* harmony import */ var _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/isAxiosError.js */ "../node_modules/axios/lib/helpers/isAxiosError.js"); |
|
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./core/AxiosHeaders.js */ "../node_modules/axios/lib/core/AxiosHeaders.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
* Create an instance of Axios |
|
* |
|
* @param {Object} defaultConfig The default config for the instance |
|
* |
|
* @returns {Axios} A new instance of Axios |
|
*/ |
|
function createInstance(defaultConfig) { |
|
const context = new _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"](defaultConfig); |
|
const instance = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.request, context); |
|
|
|
// Copy axios.prototype to instance |
|
_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype, context, {allOwnKeys: true}); |
|
|
|
// Copy context to instance |
|
_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].extend(instance, context, null, {allOwnKeys: true}); |
|
|
|
// Factory for creating new instances |
|
instance.create = function create(instanceConfig) { |
|
return createInstance((0,_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"])(defaultConfig, instanceConfig)); |
|
}; |
|
|
|
return instance; |
|
} |
|
|
|
// Create the default instance to be exported |
|
const axios = createInstance(_defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"]); |
|
|
|
// Expose Axios class to allow class inheritance |
|
axios.Axios = _core_Axios_js__WEBPACK_IMPORTED_MODULE_0__["default"]; |
|
|
|
// Expose Cancel & CancelToken |
|
axios.CanceledError = _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_5__["default"]; |
|
axios.CancelToken = _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_6__["default"]; |
|
axios.isCancel = _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_7__["default"]; |
|
axios.VERSION = _env_data_js__WEBPACK_IMPORTED_MODULE_8__.VERSION; |
|
axios.toFormData = _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_9__["default"]; |
|
|
|
// Expose AxiosError class |
|
axios.AxiosError = _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_10__["default"]; |
|
|
|
// alias for CanceledError for backward compatibility |
|
axios.Cancel = axios.CanceledError; |
|
|
|
// Expose all/spread |
|
axios.all = function all(promises) { |
|
return Promise.all(promises); |
|
}; |
|
|
|
axios.spread = _helpers_spread_js__WEBPACK_IMPORTED_MODULE_11__["default"]; |
|
|
|
// Expose isAxiosError |
|
axios.isAxiosError = _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_12__["default"]; |
|
|
|
// Expose mergeConfig |
|
axios.mergeConfig = _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"]; |
|
|
|
axios.AxiosHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_13__["default"]; |
|
|
|
axios.formToJSON = thing => (0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_14__["default"])(_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isHTMLForm(thing) ? new FormData(thing) : thing); |
|
|
|
axios.default = axios; |
|
|
|
// this module should only have a default export |
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (axios); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/cancel/CancelToken.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/axios/lib/cancel/CancelToken.js ***! |
|
\*******************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CanceledError.js */ "../node_modules/axios/lib/cancel/CanceledError.js"); |
|
|
|
|
|
|
|
|
|
/** |
|
* A `CancelToken` is an object that can be used to request cancellation of an operation. |
|
* |
|
* @param {Function} executor The executor function. |
|
* |
|
* @returns {CancelToken} |
|
*/ |
|
class CancelToken { |
|
constructor(executor) { |
|
if (typeof executor !== 'function') { |
|
throw new TypeError('executor must be a function.'); |
|
} |
|
|
|
let resolvePromise; |
|
|
|
this.promise = new Promise(function promiseExecutor(resolve) { |
|
resolvePromise = resolve; |
|
}); |
|
|
|
const token = this; |
|
|
|
// eslint-disable-next-line func-names |
|
this.promise.then(cancel => { |
|
if (!token._listeners) return; |
|
|
|
let i = token._listeners.length; |
|
|
|
while (i-- > 0) { |
|
token._listeners[i](cancel); |
|
} |
|
token._listeners = null; |
|
}); |
|
|
|
// eslint-disable-next-line func-names |
|
this.promise.then = onfulfilled => { |
|
let _resolve; |
|
// eslint-disable-next-line func-names |
|
const promise = new Promise(resolve => { |
|
token.subscribe(resolve); |
|
_resolve = resolve; |
|
}).then(onfulfilled); |
|
|
|
promise.cancel = function reject() { |
|
token.unsubscribe(_resolve); |
|
}; |
|
|
|
return promise; |
|
}; |
|
|
|
executor(function cancel(message, config, request) { |
|
if (token.reason) { |
|
// Cancellation has already been requested |
|
return; |
|
} |
|
|
|
token.reason = new _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](message, config, request); |
|
resolvePromise(token.reason); |
|
}); |
|
} |
|
|
|
/** |
|
* Throws a `CanceledError` if cancellation has been requested. |
|
*/ |
|
throwIfRequested() { |
|
if (this.reason) { |
|
throw this.reason; |
|
} |
|
} |
|
|
|
/** |
|
* Subscribe to the cancel signal |
|
*/ |
|
|
|
subscribe(listener) { |
|
if (this.reason) { |
|
listener(this.reason); |
|
return; |
|
} |
|
|
|
if (this._listeners) { |
|
this._listeners.push(listener); |
|
} else { |
|
this._listeners = [listener]; |
|
} |
|
} |
|
|
|
/** |
|
* Unsubscribe from the cancel signal |
|
*/ |
|
|
|
unsubscribe(listener) { |
|
if (!this._listeners) { |
|
return; |
|
} |
|
const index = this._listeners.indexOf(listener); |
|
if (index !== -1) { |
|
this._listeners.splice(index, 1); |
|
} |
|
} |
|
|
|
/** |
|
* Returns an object that contains a new `CancelToken` and a function that, when called, |
|
* cancels the `CancelToken`. |
|
*/ |
|
static source() { |
|
let cancel; |
|
const token = new CancelToken(function executor(c) { |
|
cancel = c; |
|
}); |
|
return { |
|
token, |
|
cancel |
|
}; |
|
} |
|
} |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CancelToken); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/cancel/CanceledError.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/axios/lib/cancel/CanceledError.js ***! |
|
\*********************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/AxiosError.js */ "../node_modules/axios/lib/core/AxiosError.js"); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
* A `CanceledError` is an object that is thrown when an operation is canceled. |
|
* |
|
* @param {string=} message The message. |
|
* @param {Object=} config The config. |
|
* @param {Object=} request The request. |
|
* |
|
* @returns {CanceledError} The created error. |
|
*/ |
|
function CanceledError(message, config, request) { |
|
// eslint-disable-next-line no-eq-null,eqeqeq |
|
_core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, message == null ? 'canceled' : message, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_CANCELED, config, request); |
|
this.name = 'CanceledError'; |
|
} |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].inherits(CanceledError, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"], { |
|
__CANCEL__: true |
|
}); |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CanceledError); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/cancel/isCancel.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/axios/lib/cancel/isCancel.js ***! |
|
\****************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ isCancel) |
|
/* harmony export */ }); |
|
|
|
|
|
function isCancel(value) { |
|
return !!(value && value.__CANCEL__); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/core/Axios.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/axios/lib/core/Axios.js ***! |
|
\***********************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/buildURL.js */ "../node_modules/axios/lib/helpers/buildURL.js"); |
|
/* harmony import */ var _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InterceptorManager.js */ "../node_modules/axios/lib/core/InterceptorManager.js"); |
|
/* harmony import */ var _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dispatchRequest.js */ "../node_modules/axios/lib/core/dispatchRequest.js"); |
|
/* harmony import */ var _mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mergeConfig.js */ "../node_modules/axios/lib/core/mergeConfig.js"); |
|
/* harmony import */ var _buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./buildFullPath.js */ "../node_modules/axios/lib/core/buildFullPath.js"); |
|
/* harmony import */ var _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/validator.js */ "../node_modules/axios/lib/helpers/validator.js"); |
|
/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AxiosHeaders.js */ "../node_modules/axios/lib/core/AxiosHeaders.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const validators = _helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].validators; |
|
|
|
/** |
|
* Create a new instance of Axios |
|
* |
|
* @param {Object} instanceConfig The default config for the instance |
|
* |
|
* @return {Axios} A new instance of Axios |
|
*/ |
|
class Axios { |
|
constructor(instanceConfig) { |
|
this.defaults = instanceConfig; |
|
this.interceptors = { |
|
request: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"](), |
|
response: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_1__["default"]() |
|
}; |
|
} |
|
|
|
/** |
|
* Dispatch a request |
|
* |
|
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) |
|
* @param {?Object} config |
|
* |
|
* @returns {Promise} The Promise to be fulfilled |
|
*/ |
|
request(configOrUrl, config) { |
|
/*eslint no-param-reassign:0*/ |
|
// Allow for axios('example/url'[, config]) a la fetch API |
|
if (typeof configOrUrl === 'string') { |
|
config = config || {}; |
|
config.url = configOrUrl; |
|
} else { |
|
config = configOrUrl || {}; |
|
} |
|
|
|
config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); |
|
|
|
const {transitional, paramsSerializer, headers} = config; |
|
|
|
if (transitional !== undefined) { |
|
_helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(transitional, { |
|
silentJSONParsing: validators.transitional(validators.boolean), |
|
forcedJSONParsing: validators.transitional(validators.boolean), |
|
clarifyTimeoutError: validators.transitional(validators.boolean) |
|
}, false); |
|
} |
|
|
|
if (paramsSerializer !== undefined) { |
|
_helpers_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"].assertOptions(paramsSerializer, { |
|
encode: validators.function, |
|
serialize: validators.function |
|
}, true); |
|
} |
|
|
|
// Set config.method |
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase(); |
|
|
|
let contextHeaders; |
|
|
|
// Flatten headers |
|
contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].merge( |
|
headers.common, |
|
headers[config.method] |
|
); |
|
|
|
contextHeaders && _utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach( |
|
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], |
|
(method) => { |
|
delete headers[method]; |
|
} |
|
); |
|
|
|
config.headers = _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].concat(contextHeaders, headers); |
|
|
|
// filter out skipped interceptors |
|
const requestInterceptorChain = []; |
|
let synchronousRequestInterceptors = true; |
|
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { |
|
if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { |
|
return; |
|
} |
|
|
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; |
|
|
|
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); |
|
}); |
|
|
|
const responseInterceptorChain = []; |
|
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { |
|
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); |
|
}); |
|
|
|
let promise; |
|
let i = 0; |
|
let len; |
|
|
|
if (!synchronousRequestInterceptors) { |
|
const chain = [_dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].bind(this), undefined]; |
|
chain.unshift.apply(chain, requestInterceptorChain); |
|
chain.push.apply(chain, responseInterceptorChain); |
|
len = chain.length; |
|
|
|
promise = Promise.resolve(config); |
|
|
|
while (i < len) { |
|
promise = promise.then(chain[i++], chain[i++]); |
|
} |
|
|
|
return promise; |
|
} |
|
|
|
len = requestInterceptorChain.length; |
|
|
|
let newConfig = config; |
|
|
|
i = 0; |
|
|
|
while (i < len) { |
|
const onFulfilled = requestInterceptorChain[i++]; |
|
const onRejected = requestInterceptorChain[i++]; |
|
try { |
|
newConfig = onFulfilled(newConfig); |
|
} catch (error) { |
|
onRejected.call(this, error); |
|
break; |
|
} |
|
} |
|
|
|
try { |
|
promise = _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_5__["default"].call(this, newConfig); |
|
} catch (error) { |
|
return Promise.reject(error); |
|
} |
|
|
|
i = 0; |
|
len = responseInterceptorChain.length; |
|
|
|
while (i < len) { |
|
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); |
|
} |
|
|
|
return promise; |
|
} |
|
|
|
getUri(config) { |
|
config = (0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this.defaults, config); |
|
const fullPath = (0,_buildFullPath_js__WEBPACK_IMPORTED_MODULE_6__["default"])(config.baseURL, config.url); |
|
return (0,_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_7__["default"])(fullPath, config.params, config.paramsSerializer); |
|
} |
|
} |
|
|
|
// Provide aliases for supported request methods |
|
_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { |
|
/*eslint func-names:0*/ |
|
Axios.prototype[method] = function(url, config) { |
|
return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { |
|
method, |
|
url, |
|
data: (config || {}).data |
|
})); |
|
}; |
|
}); |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_3__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { |
|
/*eslint func-names:0*/ |
|
|
|
function generateHTTPMethod(isForm) { |
|
return function httpMethod(url, data, config) { |
|
return this.request((0,_mergeConfig_js__WEBPACK_IMPORTED_MODULE_2__["default"])(config || {}, { |
|
method, |
|
headers: isForm ? { |
|
'Content-Type': 'multipart/form-data' |
|
} : {}, |
|
url, |
|
data |
|
})); |
|
}; |
|
} |
|
|
|
Axios.prototype[method] = generateHTTPMethod(); |
|
|
|
Axios.prototype[method + 'Form'] = generateHTTPMethod(true); |
|
}); |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Axios); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/core/AxiosError.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/axios/lib/core/AxiosError.js ***! |
|
\****************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
|
|
|
|
|
|
|
|
/** |
|
* Create an Error with the specified message, config, error code, request and response. |
|
* |
|
* @param {string} message The error message. |
|
* @param {string} [code] The error code (for example, 'ECONNABORTED'). |
|
* @param {Object} [config] The config. |
|
* @param {Object} [request] The request. |
|
* @param {Object} [response] The response. |
|
* |
|
* @returns {Error} The created error. |
|
*/ |
|
function AxiosError(message, code, config, request, response) { |
|
Error.call(this); |
|
|
|
if (Error.captureStackTrace) { |
|
Error.captureStackTrace(this, this.constructor); |
|
} else { |
|
this.stack = (new Error()).stack; |
|
} |
|
|
|
this.message = message; |
|
this.name = 'AxiosError'; |
|
code && (this.code = code); |
|
config && (this.config = config); |
|
request && (this.request = request); |
|
response && (this.response = response); |
|
} |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].inherits(AxiosError, Error, { |
|
toJSON: function toJSON() { |
|
return { |
|
// Standard |
|
message: this.message, |
|
name: this.name, |
|
// Microsoft |
|
description: this.description, |
|
number: this.number, |
|
// Mozilla |
|
fileName: this.fileName, |
|
lineNumber: this.lineNumber, |
|
columnNumber: this.columnNumber, |
|
stack: this.stack, |
|
// Axios |
|
config: _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toJSONObject(this.config), |
|
code: this.code, |
|
status: this.response && this.response.status ? this.response.status : null |
|
}; |
|
} |
|
}); |
|
|
|
const prototype = AxiosError.prototype; |
|
const descriptors = {}; |
|
|
|
[ |
|
'ERR_BAD_OPTION_VALUE', |
|
'ERR_BAD_OPTION', |
|
'ECONNABORTED', |
|
'ETIMEDOUT', |
|
'ERR_NETWORK', |
|
'ERR_FR_TOO_MANY_REDIRECTS', |
|
'ERR_DEPRECATED', |
|
'ERR_BAD_RESPONSE', |
|
'ERR_BAD_REQUEST', |
|
'ERR_CANCELED', |
|
'ERR_NOT_SUPPORT', |
|
'ERR_INVALID_URL' |
|
// eslint-disable-next-line func-names |
|
].forEach(code => { |
|
descriptors[code] = {value: code}; |
|
}); |
|
|
|
Object.defineProperties(AxiosError, descriptors); |
|
Object.defineProperty(prototype, 'isAxiosError', {value: true}); |
|
|
|
// eslint-disable-next-line func-names |
|
AxiosError.from = (error, code, config, request, response, customProps) => { |
|
const axiosError = Object.create(prototype); |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(error, axiosError, function filter(obj) { |
|
return obj !== Error.prototype; |
|
}, prop => { |
|
return prop !== 'isAxiosError'; |
|
}); |
|
|
|
AxiosError.call(axiosError, error.message, code, config, request, response); |
|
|
|
axiosError.cause = error; |
|
|
|
axiosError.name = error.name; |
|
|
|
customProps && Object.assign(axiosError, customProps); |
|
|
|
return axiosError; |
|
}; |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosError); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/core/AxiosHeaders.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/axios/lib/core/AxiosHeaders.js ***! |
|
\******************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
/* harmony import */ var _helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/parseHeaders.js */ "../node_modules/axios/lib/helpers/parseHeaders.js"); |
|
|
|
|
|
|
|
|
|
|
|
const $internals = Symbol('internals'); |
|
|
|
function normalizeHeader(header) { |
|
return header && String(header).trim().toLowerCase(); |
|
} |
|
|
|
function normalizeValue(value) { |
|
if (value === false || value == null) { |
|
return value; |
|
} |
|
|
|
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.map(normalizeValue) : String(value); |
|
} |
|
|
|
function parseTokens(str) { |
|
const tokens = Object.create(null); |
|
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; |
|
let match; |
|
|
|
while ((match = tokensRE.exec(str))) { |
|
tokens[match[1]] = match[2]; |
|
} |
|
|
|
return tokens; |
|
} |
|
|
|
function isValidHeaderName(str) { |
|
return /^[-_a-zA-Z]+$/.test(str.trim()); |
|
} |
|
|
|
function matchHeaderValue(context, value, header, filter) { |
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(filter)) { |
|
return filter.call(this, value, header); |
|
} |
|
|
|
if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(value)) return; |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(filter)) { |
|
return value.indexOf(filter) !== -1; |
|
} |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(filter)) { |
|
return filter.test(value); |
|
} |
|
} |
|
|
|
function formatHeader(header) { |
|
return header.trim() |
|
.toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { |
|
return char.toUpperCase() + str; |
|
}); |
|
} |
|
|
|
function buildAccessors(obj, header) { |
|
const accessorName = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toCamelCase(' ' + header); |
|
|
|
['get', 'set', 'has'].forEach(methodName => { |
|
Object.defineProperty(obj, methodName + accessorName, { |
|
value: function(arg1, arg2, arg3) { |
|
return this[methodName].call(this, header, arg1, arg2, arg3); |
|
}, |
|
configurable: true |
|
}); |
|
}); |
|
} |
|
|
|
class AxiosHeaders { |
|
constructor(headers) { |
|
headers && this.set(headers); |
|
} |
|
|
|
set(header, valueOrRewrite, rewrite) { |
|
const self = this; |
|
|
|
function setHeader(_value, _header, _rewrite) { |
|
const lHeader = normalizeHeader(_header); |
|
|
|
if (!lHeader) { |
|
throw new Error('header name must be a non-empty string'); |
|
} |
|
|
|
const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, lHeader); |
|
|
|
if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { |
|
self[key || _header] = normalizeValue(_value); |
|
} |
|
} |
|
|
|
const setHeaders = (headers, _rewrite) => |
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(header) || header instanceof this.constructor) { |
|
setHeaders(header, valueOrRewrite) |
|
} else if(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { |
|
setHeaders((0,_helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"])(header), valueOrRewrite); |
|
} else { |
|
header != null && setHeader(valueOrRewrite, header, rewrite); |
|
} |
|
|
|
return this; |
|
} |
|
|
|
get(header, parser) { |
|
header = normalizeHeader(header); |
|
|
|
if (header) { |
|
const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); |
|
|
|
if (key) { |
|
const value = this[key]; |
|
|
|
if (!parser) { |
|
return value; |
|
} |
|
|
|
if (parser === true) { |
|
return parseTokens(value); |
|
} |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(parser)) { |
|
return parser.call(this, value, key); |
|
} |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(parser)) { |
|
return parser.exec(value); |
|
} |
|
|
|
throw new TypeError('parser must be boolean|regexp|function'); |
|
} |
|
} |
|
} |
|
|
|
has(header, matcher) { |
|
header = normalizeHeader(header); |
|
|
|
if (header) { |
|
const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); |
|
|
|
return !!(key && (!matcher || matchHeaderValue(this, this[key], key, matcher))); |
|
} |
|
|
|
return false; |
|
} |
|
|
|
delete(header, matcher) { |
|
const self = this; |
|
let deleted = false; |
|
|
|
function deleteHeader(_header) { |
|
_header = normalizeHeader(_header); |
|
|
|
if (_header) { |
|
const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, _header); |
|
|
|
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { |
|
delete self[key]; |
|
|
|
deleted = true; |
|
} |
|
} |
|
} |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header)) { |
|
header.forEach(deleteHeader); |
|
} else { |
|
deleteHeader(header); |
|
} |
|
|
|
return deleted; |
|
} |
|
|
|
clear() { |
|
return Object.keys(this).forEach(this.delete.bind(this)); |
|
} |
|
|
|
normalize(format) { |
|
const self = this; |
|
const headers = {}; |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { |
|
const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(headers, header); |
|
|
|
if (key) { |
|
self[key] = normalizeValue(value); |
|
delete self[header]; |
|
return; |
|
} |
|
|
|
const normalized = format ? formatHeader(header) : String(header).trim(); |
|
|
|
if (normalized !== header) { |
|
delete self[header]; |
|
} |
|
|
|
self[normalized] = normalizeValue(value); |
|
|
|
headers[normalized] = true; |
|
}); |
|
|
|
return this; |
|
} |
|
|
|
concat(...targets) { |
|
return this.constructor.concat(this, ...targets); |
|
} |
|
|
|
toJSON(asStrings) { |
|
const obj = Object.create(null); |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { |
|
value != null && value !== false && (obj[header] = asStrings && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.join(', ') : value); |
|
}); |
|
|
|
return obj; |
|
} |
|
|
|
[Symbol.iterator]() { |
|
return Object.entries(this.toJSON())[Symbol.iterator](); |
|
} |
|
|
|
toString() { |
|
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); |
|
} |
|
|
|
get [Symbol.toStringTag]() { |
|
return 'AxiosHeaders'; |
|
} |
|
|
|
static from(thing) { |
|
return thing instanceof this ? thing : new this(thing); |
|
} |
|
|
|
static concat(first, ...targets) { |
|
const computed = new this(first); |
|
|
|
targets.forEach((target) => computed.set(target)); |
|
|
|
return computed; |
|
} |
|
|
|
static accessor(header) { |
|
const internals = this[$internals] = (this[$internals] = { |
|
accessors: {} |
|
}); |
|
|
|
const accessors = internals.accessors; |
|
const prototype = this.prototype; |
|
|
|
function defineAccessor(_header) { |
|
const lHeader = normalizeHeader(_header); |
|
|
|
if (!accessors[lHeader]) { |
|
buildAccessors(prototype, _header); |
|
accessors[lHeader] = true; |
|
} |
|
} |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); |
|
|
|
return this; |
|
} |
|
} |
|
|
|
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent']); |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders.prototype); |
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders); |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosHeaders); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/core/InterceptorManager.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/axios/lib/core/InterceptorManager.js ***! |
|
\************************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
|
|
|
|
|
|
|
|
class InterceptorManager { |
|
constructor() { |
|
this.handlers = []; |
|
} |
|
|
|
/** |
|
* Add a new interceptor to the stack |
|
* |
|
* @param {Function} fulfilled The function to handle `then` for a `Promise` |
|
* @param {Function} rejected The function to handle `reject` for a `Promise` |
|
* |
|
* @return {Number} An ID used to remove interceptor later |
|
*/ |
|
use(fulfilled, rejected, options) { |
|
this.handlers.push({ |
|
fulfilled, |
|
rejected, |
|
synchronous: options ? options.synchronous : false, |
|
runWhen: options ? options.runWhen : null |
|
}); |
|
return this.handlers.length - 1; |
|
} |
|
|
|
/** |
|
* Remove an interceptor from the stack |
|
* |
|
* @param {Number} id The ID that was returned by `use` |
|
* |
|
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise |
|
*/ |
|
eject(id) { |
|
if (this.handlers[id]) { |
|
this.handlers[id] = null; |
|
} |
|
} |
|
|
|
/** |
|
* Clear all interceptors from the stack |
|
* |
|
* @returns {void} |
|
*/ |
|
clear() { |
|
if (this.handlers) { |
|
this.handlers = []; |
|
} |
|
} |
|
|
|
/** |
|
* Iterate over all the registered interceptors |
|
* |
|
* This method is particularly useful for skipping over any |
|
* interceptors that may have become `null` calling `eject`. |
|
* |
|
* @param {Function} fn The function to call for each interceptor |
|
* |
|
* @returns {void} |
|
*/ |
|
forEach(fn) { |
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this.handlers, function forEachHandler(h) { |
|
if (h !== null) { |
|
fn(h); |
|
} |
|
}); |
|
} |
|
} |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InterceptorManager); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/core/buildFullPath.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/axios/lib/core/buildFullPath.js ***! |
|
\*******************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ buildFullPath) |
|
/* harmony export */ }); |
|
/* harmony import */ var _helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/isAbsoluteURL.js */ "../node_modules/axios/lib/helpers/isAbsoluteURL.js"); |
|
/* harmony import */ var _helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/combineURLs.js */ "../node_modules/axios/lib/helpers/combineURLs.js"); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
* Creates a new URL by combining the baseURL with the requestedURL, |
|
* only when the requestedURL is not already an absolute URL. |
|
* If the requestURL is absolute, this function returns the requestedURL untouched. |
|
* |
|
* @param {string} baseURL The base URL |
|
* @param {string} requestedURL Absolute or relative URL to combine |
|
* |
|
* @returns {string} The combined full path |
|
*/ |
|
function buildFullPath(baseURL, requestedURL) { |
|
if (baseURL && !(0,_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__["default"])(requestedURL)) { |
|
return (0,_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__["default"])(baseURL, requestedURL); |
|
} |
|
return requestedURL; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/core/dispatchRequest.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/axios/lib/core/dispatchRequest.js ***! |
|
\*********************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ dispatchRequest) |
|
/* harmony export */ }); |
|
/* harmony import */ var _transformData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transformData.js */ "../node_modules/axios/lib/core/transformData.js"); |
|
/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cancel/isCancel.js */ "../node_modules/axios/lib/cancel/isCancel.js"); |
|
/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../defaults/index.js */ "../node_modules/axios/lib/defaults/index.js"); |
|
/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "../node_modules/axios/lib/cancel/CanceledError.js"); |
|
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "../node_modules/axios/lib/core/AxiosHeaders.js"); |
|
/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../adapters/adapters.js */ "../node_modules/axios/lib/adapters/adapters.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
* Throws a `CanceledError` if cancellation has been requested. |
|
* |
|
* @param {Object} config The config that is to be used for the request |
|
* |
|
* @returns {void} |
|
*/ |
|
function throwIfCancellationRequested(config) { |
|
if (config.cancelToken) { |
|
config.cancelToken.throwIfRequested(); |
|
} |
|
|
|
if (config.signal && config.signal.aborted) { |
|
throw new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](null, config); |
|
} |
|
} |
|
|
|
/** |
|
* Dispatch a request to the server using the configured adapter. |
|
* |
|
* @param {object} config The config that is to be used for the request |
|
* |
|
* @returns {Promise} The Promise to be fulfilled |
|
*/ |
|
function dispatchRequest(config) { |
|
throwIfCancellationRequested(config); |
|
|
|
config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(config.headers); |
|
|
|
// Transform request data |
|
config.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( |
|
config, |
|
config.transformRequest |
|
); |
|
|
|
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { |
|
config.headers.setContentType('application/x-www-form-urlencoded', false); |
|
} |
|
|
|
const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_3__["default"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].adapter); |
|
|
|
return adapter(config).then(function onAdapterResolution(response) { |
|
throwIfCancellationRequested(config); |
|
|
|
// Transform response data |
|
response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( |
|
config, |
|
config.transformResponse, |
|
response |
|
); |
|
|
|
response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(response.headers); |
|
|
|
return response; |
|
}, function onAdapterRejection(reason) { |
|
if (!(0,_cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_5__["default"])(reason)) { |
|
throwIfCancellationRequested(config); |
|
|
|
// Transform response data |
|
if (reason && reason.response) { |
|
reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_2__["default"].call( |
|
config, |
|
config.transformResponse, |
|
reason.response |
|
); |
|
reason.response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(reason.response.headers); |
|
} |
|
} |
|
|
|
return Promise.reject(reason); |
|
}); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/core/mergeConfig.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/axios/lib/core/mergeConfig.js ***! |
|
\*****************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ mergeConfig) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosHeaders.js */ "../node_modules/axios/lib/core/AxiosHeaders.js"); |
|
|
|
|
|
|
|
|
|
|
|
const headersToObject = (thing) => thing instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? thing.toJSON() : thing; |
|
|
|
/** |
|
* Config-specific merge-function which creates a new config-object |
|
* by merging two configuration objects together. |
|
* |
|
* @param {Object} config1 |
|
* @param {Object} config2 |
|
* |
|
* @returns {Object} New object resulting from merging config2 to config1 |
|
*/ |
|
function mergeConfig(config1, config2) { |
|
// eslint-disable-next-line no-param-reassign |
|
config2 = config2 || {}; |
|
const config = {}; |
|
|
|
function getMergedValue(target, source, caseless) { |
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { |
|
return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge.call({caseless}, target, source); |
|
} else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isPlainObject(source)) { |
|
return _utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].merge({}, source); |
|
} else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isArray(source)) { |
|
return source.slice(); |
|
} |
|
return source; |
|
} |
|
|
|
// eslint-disable-next-line consistent-return |
|
function mergeDeepProperties(a, b, caseless) { |
|
if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { |
|
return getMergedValue(a, b, caseless); |
|
} else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { |
|
return getMergedValue(undefined, a, caseless); |
|
} |
|
} |
|
|
|
// eslint-disable-next-line consistent-return |
|
function valueFromConfig2(a, b) { |
|
if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { |
|
return getMergedValue(undefined, b); |
|
} |
|
} |
|
|
|
// eslint-disable-next-line consistent-return |
|
function defaultToConfig2(a, b) { |
|
if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(b)) { |
|
return getMergedValue(undefined, b); |
|
} else if (!_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(a)) { |
|
return getMergedValue(undefined, a); |
|
} |
|
} |
|
|
|
// eslint-disable-next-line consistent-return |
|
function mergeDirectKeys(a, b, prop) { |
|
if (prop in config2) { |
|
return getMergedValue(a, b); |
|
} else if (prop in config1) { |
|
return getMergedValue(undefined, a); |
|
} |
|
} |
|
|
|
const mergeMap = { |
|
url: valueFromConfig2, |
|
method: valueFromConfig2, |
|
data: valueFromConfig2, |
|
baseURL: defaultToConfig2, |
|
transformRequest: defaultToConfig2, |
|
transformResponse: defaultToConfig2, |
|
paramsSerializer: defaultToConfig2, |
|
timeout: defaultToConfig2, |
|
timeoutMessage: defaultToConfig2, |
|
withCredentials: defaultToConfig2, |
|
adapter: defaultToConfig2, |
|
responseType: defaultToConfig2, |
|
xsrfCookieName: defaultToConfig2, |
|
xsrfHeaderName: defaultToConfig2, |
|
onUploadProgress: defaultToConfig2, |
|
onDownloadProgress: defaultToConfig2, |
|
decompress: defaultToConfig2, |
|
maxContentLength: defaultToConfig2, |
|
maxBodyLength: defaultToConfig2, |
|
beforeRedirect: defaultToConfig2, |
|
transport: defaultToConfig2, |
|
httpAgent: defaultToConfig2, |
|
httpsAgent: defaultToConfig2, |
|
cancelToken: defaultToConfig2, |
|
socketPath: defaultToConfig2, |
|
responseEncoding: defaultToConfig2, |
|
validateStatus: mergeDirectKeys, |
|
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) |
|
}; |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { |
|
const merge = mergeMap[prop] || mergeDeepProperties; |
|
const configValue = merge(config1[prop], config2[prop], prop); |
|
(_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); |
|
}); |
|
|
|
return config; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/core/settle.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/axios/lib/core/settle.js ***! |
|
\************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ settle) |
|
/* harmony export */ }); |
|
/* harmony import */ var _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosError.js */ "../node_modules/axios/lib/core/AxiosError.js"); |
|
|
|
|
|
|
|
|
|
/** |
|
* Resolve or reject a Promise based on response status. |
|
* |
|
* @param {Function} resolve A function that resolves the promise. |
|
* @param {Function} reject A function that rejects the promise. |
|
* @param {object} response The response. |
|
* |
|
* @returns {object} The response. |
|
*/ |
|
function settle(resolve, reject, response) { |
|
const validateStatus = response.config.validateStatus; |
|
if (!response.status || !validateStatus || validateStatus(response.status)) { |
|
resolve(response); |
|
} else { |
|
reject(new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"]( |
|
'Request failed with status code ' + response.status, |
|
[_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_REQUEST, _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], |
|
response.config, |
|
response.request, |
|
response |
|
)); |
|
} |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/core/transformData.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/axios/lib/core/transformData.js ***! |
|
\*******************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ transformData) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../defaults/index.js */ "../node_modules/axios/lib/defaults/index.js"); |
|
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "../node_modules/axios/lib/core/AxiosHeaders.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
* Transform the data for a request or a response |
|
* |
|
* @param {Array|Function} fns A single function or Array of functions |
|
* @param {?Object} response The response object |
|
* |
|
* @returns {*} The resulting transformed data |
|
*/ |
|
function transformData(fns, response) { |
|
const config = this || _defaults_index_js__WEBPACK_IMPORTED_MODULE_0__["default"]; |
|
const context = response || config; |
|
const headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(context.headers); |
|
let data = context.data; |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].forEach(fns, function transform(fn) { |
|
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); |
|
}); |
|
|
|
headers.normalize(); |
|
|
|
return data; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/defaults/index.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/axios/lib/defaults/index.js ***! |
|
\***************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/AxiosError.js */ "../node_modules/axios/lib/core/AxiosError.js"); |
|
/* harmony import */ var _transitional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transitional.js */ "../node_modules/axios/lib/defaults/transitional.js"); |
|
/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/toFormData.js */ "../node_modules/axios/lib/helpers/toFormData.js"); |
|
/* harmony import */ var _helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/toURLEncodedForm.js */ "../node_modules/axios/lib/helpers/toURLEncodedForm.js"); |
|
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../platform/index.js */ "../node_modules/axios/lib/platform/browser/index.js"); |
|
/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/formDataToJSON.js */ "../node_modules/axios/lib/helpers/formDataToJSON.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const DEFAULT_CONTENT_TYPE = { |
|
'Content-Type': undefined |
|
}; |
|
|
|
/** |
|
* It takes a string, tries to parse it, and if it fails, it returns the stringified version |
|
* of the input |
|
* |
|
* @param {any} rawValue - The value to be stringified. |
|
* @param {Function} parser - A function that parses a string into a JavaScript object. |
|
* @param {Function} encoder - A function that takes a value and returns a string. |
|
* |
|
* @returns {string} A stringified version of the rawValue. |
|
*/ |
|
function stringifySafely(rawValue, parser, encoder) { |
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(rawValue)) { |
|
try { |
|
(parser || JSON.parse)(rawValue); |
|
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].trim(rawValue); |
|
} catch (e) { |
|
if (e.name !== 'SyntaxError') { |
|
throw e; |
|
} |
|
} |
|
} |
|
|
|
return (encoder || JSON.stringify)(rawValue); |
|
} |
|
|
|
const defaults = { |
|
|
|
transitional: _transitional_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
|
|
|
adapter: ['xhr', 'http'], |
|
|
|
transformRequest: [function transformRequest(data, headers) { |
|
const contentType = headers.getContentType() || ''; |
|
const hasJSONContentType = contentType.indexOf('application/json') > -1; |
|
const isObjectPayload = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(data); |
|
|
|
if (isObjectPayload && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHTMLForm(data)) { |
|
data = new FormData(data); |
|
} |
|
|
|
const isFormData = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(data); |
|
|
|
if (isFormData) { |
|
if (!hasJSONContentType) { |
|
return data; |
|
} |
|
return hasJSONContentType ? JSON.stringify((0,_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data)) : data; |
|
} |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(data) || |
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(data) || |
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStream(data) || |
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFile(data) || |
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(data) |
|
) { |
|
return data; |
|
} |
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBufferView(data)) { |
|
return data.buffer; |
|
} |
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(data)) { |
|
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); |
|
return data.toString(); |
|
} |
|
|
|
let isFileList; |
|
|
|
if (isObjectPayload) { |
|
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { |
|
return (0,_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_3__["default"])(data, this.formSerializer).toString(); |
|
} |
|
|
|
if ((isFileList = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { |
|
const _FormData = this.env && this.env.FormData; |
|
|
|
return (0,_helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_4__["default"])( |
|
isFileList ? {'files[]': data} : data, |
|
_FormData && new _FormData(), |
|
this.formSerializer |
|
); |
|
} |
|
} |
|
|
|
if (isObjectPayload || hasJSONContentType ) { |
|
headers.setContentType('application/json', false); |
|
return stringifySafely(data); |
|
} |
|
|
|
return data; |
|
}], |
|
|
|
transformResponse: [function transformResponse(data) { |
|
const transitional = this.transitional || defaults.transitional; |
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing; |
|
const JSONRequested = this.responseType === 'json'; |
|
|
|
if (data && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { |
|
const silentJSONParsing = transitional && transitional.silentJSONParsing; |
|
const strictJSONParsing = !silentJSONParsing && JSONRequested; |
|
|
|
try { |
|
return JSON.parse(data); |
|
} catch (e) { |
|
if (strictJSONParsing) { |
|
if (e.name === 'SyntaxError') { |
|
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); |
|
} |
|
throw e; |
|
} |
|
} |
|
} |
|
|
|
return data; |
|
}], |
|
|
|
/** |
|
* A timeout in milliseconds to abort a request. If set to 0 (default) a |
|
* timeout is not created. |
|
*/ |
|
timeout: 0, |
|
|
|
xsrfCookieName: 'XSRF-TOKEN', |
|
xsrfHeaderName: 'X-XSRF-TOKEN', |
|
|
|
maxContentLength: -1, |
|
maxBodyLength: -1, |
|
|
|
env: { |
|
FormData: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.FormData, |
|
Blob: _platform_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].classes.Blob |
|
}, |
|
|
|
validateStatus: function validateStatus(status) { |
|
return status >= 200 && status < 300; |
|
}, |
|
|
|
headers: { |
|
common: { |
|
'Accept': 'application/json, text/plain, */*' |
|
} |
|
} |
|
}; |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { |
|
defaults.headers[method] = {}; |
|
}); |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { |
|
defaults.headers[method] = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge(DEFAULT_CONTENT_TYPE); |
|
}); |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defaults); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/defaults/transitional.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/axios/lib/defaults/transitional.js ***! |
|
\**********************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
|
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ |
|
silentJSONParsing: true, |
|
forcedJSONParsing: true, |
|
clarifyTimeoutError: false |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/env/classes/FormData.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/axios/lib/env/classes/FormData.js ***! |
|
\*********************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var form_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! form-data */ "../node_modules/axios/node_modules/form-data/lib/browser.js"); |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (form_data__WEBPACK_IMPORTED_MODULE_0__); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/env/data.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/axios/lib/env/data.js ***! |
|
\*********************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "VERSION": () => (/* binding */ VERSION) |
|
/* harmony export */ }); |
|
const VERSION = "1.2.1"; |
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/AxiosURLSearchParams.js": |
|
/*!*****************************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/AxiosURLSearchParams.js ***! |
|
\*****************************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "../node_modules/axios/lib/helpers/toFormData.js"); |
|
|
|
|
|
|
|
|
|
/** |
|
* It encodes a string by replacing all characters that are not in the unreserved set with |
|
* their percent-encoded equivalents |
|
* |
|
* @param {string} str - The string to encode. |
|
* |
|
* @returns {string} The encoded string. |
|
*/ |
|
function encode(str) { |
|
const charMap = { |
|
'!': '%21', |
|
"'": '%27', |
|
'(': '%28', |
|
')': '%29', |
|
'~': '%7E', |
|
'%20': '+', |
|
'%00': '\x00' |
|
}; |
|
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { |
|
return charMap[match]; |
|
}); |
|
} |
|
|
|
/** |
|
* It takes a params object and converts it to a FormData object |
|
* |
|
* @param {Object<string, any>} params - The parameters to be converted to a FormData object. |
|
* @param {Object<string, any>} options - The options object passed to the Axios constructor. |
|
* |
|
* @returns {void} |
|
*/ |
|
function AxiosURLSearchParams(params, options) { |
|
this._pairs = []; |
|
|
|
params && (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, this, options); |
|
} |
|
|
|
const prototype = AxiosURLSearchParams.prototype; |
|
|
|
prototype.append = function append(name, value) { |
|
this._pairs.push([name, value]); |
|
}; |
|
|
|
prototype.toString = function toString(encoder) { |
|
const _encode = encoder ? function(value) { |
|
return encoder.call(this, value, encode); |
|
} : encode; |
|
|
|
return this._pairs.map(function each(pair) { |
|
return _encode(pair[0]) + '=' + _encode(pair[1]); |
|
}, '').join('&'); |
|
}; |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AxiosURLSearchParams); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/bind.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/bind.js ***! |
|
\*************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ bind) |
|
/* harmony export */ }); |
|
|
|
|
|
function bind(fn, thisArg) { |
|
return function wrap() { |
|
return fn.apply(thisArg, arguments); |
|
}; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/buildURL.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/buildURL.js ***! |
|
\*****************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ buildURL) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ "../node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
* It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their |
|
* URI encoded counterparts |
|
* |
|
* @param {string} val The value to be encoded. |
|
* |
|
* @returns {string} The encoded value. |
|
*/ |
|
function encode(val) { |
|
return encodeURIComponent(val). |
|
replace(/%3A/gi, ':'). |
|
replace(/%24/g, '$'). |
|
replace(/%2C/gi, ','). |
|
replace(/%20/g, '+'). |
|
replace(/%5B/gi, '['). |
|
replace(/%5D/gi, ']'); |
|
} |
|
|
|
/** |
|
* Build a URL by appending params to the end |
|
* |
|
* @param {string} url The base of the url (e.g., http://www.google.com) |
|
* @param {object} [params] The params to be appended |
|
* @param {?object} options |
|
* |
|
* @returns {string} The formatted url |
|
*/ |
|
function buildURL(url, params, options) { |
|
/*eslint no-param-reassign:0*/ |
|
if (!params) { |
|
return url; |
|
} |
|
|
|
const _encode = options && options.encode || encode; |
|
|
|
const serializeFn = options && options.serialize; |
|
|
|
let serializedParams; |
|
|
|
if (serializeFn) { |
|
serializedParams = serializeFn(params, options); |
|
} else { |
|
serializedParams = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(params) ? |
|
params.toString() : |
|
new _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__["default"](params, options).toString(_encode); |
|
} |
|
|
|
if (serializedParams) { |
|
const hashmarkIndex = url.indexOf("#"); |
|
|
|
if (hashmarkIndex !== -1) { |
|
url = url.slice(0, hashmarkIndex); |
|
} |
|
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; |
|
} |
|
|
|
return url; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/combineURLs.js": |
|
/*!********************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/combineURLs.js ***! |
|
\********************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ combineURLs) |
|
/* harmony export */ }); |
|
|
|
|
|
/** |
|
* Creates a new URL by combining the specified URLs |
|
* |
|
* @param {string} baseURL The base URL |
|
* @param {string} relativeURL The relative URL |
|
* |
|
* @returns {string} The combined URL |
|
*/ |
|
function combineURLs(baseURL, relativeURL) { |
|
return relativeURL |
|
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') |
|
: baseURL; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/cookies.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/cookies.js ***! |
|
\****************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "../node_modules/axios/lib/platform/browser/index.js"); |
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStandardBrowserEnv ? |
|
|
|
// Standard browser envs support document.cookie |
|
(function standardBrowserEnv() { |
|
return { |
|
write: function write(name, value, expires, path, domain, secure) { |
|
const cookie = []; |
|
cookie.push(name + '=' + encodeURIComponent(value)); |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNumber(expires)) { |
|
cookie.push('expires=' + new Date(expires).toGMTString()); |
|
} |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(path)) { |
|
cookie.push('path=' + path); |
|
} |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(domain)) { |
|
cookie.push('domain=' + domain); |
|
} |
|
|
|
if (secure === true) { |
|
cookie.push('secure'); |
|
} |
|
|
|
document.cookie = cookie.join('; '); |
|
}, |
|
|
|
read: function read(name) { |
|
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); |
|
return (match ? decodeURIComponent(match[3]) : null); |
|
}, |
|
|
|
remove: function remove(name) { |
|
this.write(name, '', Date.now() - 86400000); |
|
} |
|
}; |
|
})() : |
|
|
|
// Non standard browser env (web workers, react-native) lack needed support. |
|
(function nonStandardBrowserEnv() { |
|
return { |
|
write: function write() {}, |
|
read: function read() { return null; }, |
|
remove: function remove() {} |
|
}; |
|
})()); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/formDataToJSON.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/formDataToJSON.js ***! |
|
\***********************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
|
|
|
|
|
|
|
|
/** |
|
* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] |
|
* |
|
* @param {string} name - The name of the property to get. |
|
* |
|
* @returns An array of strings. |
|
*/ |
|
function parsePropPath(name) { |
|
// foo[x][y][z] |
|
// foo.x.y.z |
|
// foo-x-y-z |
|
// foo x y z |
|
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].matchAll(/\w+|\[(\w*)]/g, name).map(match => { |
|
return match[0] === '[]' ? '' : match[1] || match[0]; |
|
}); |
|
} |
|
|
|
/** |
|
* Convert an array to an object. |
|
* |
|
* @param {Array<any>} arr - The array to convert to an object. |
|
* |
|
* @returns An object with the same keys and values as the array. |
|
*/ |
|
function arrayToObject(arr) { |
|
const obj = {}; |
|
const keys = Object.keys(arr); |
|
let i; |
|
const len = keys.length; |
|
let key; |
|
for (i = 0; i < len; i++) { |
|
key = keys[i]; |
|
obj[key] = arr[key]; |
|
} |
|
return obj; |
|
} |
|
|
|
/** |
|
* It takes a FormData object and returns a JavaScript object |
|
* |
|
* @param {string} formData The FormData object to convert to JSON. |
|
* |
|
* @returns {Object<string, any> | null} The converted object. |
|
*/ |
|
function formDataToJSON(formData) { |
|
function buildPath(path, value, target, index) { |
|
let name = path[index++]; |
|
const isNumericKey = Number.isFinite(+name); |
|
const isLast = index >= path.length; |
|
name = !name && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target) ? target.length : name; |
|
|
|
if (isLast) { |
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(target, name)) { |
|
target[name] = [target[name], value]; |
|
} else { |
|
target[name] = value; |
|
} |
|
|
|
return !isNumericKey; |
|
} |
|
|
|
if (!target[name] || !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(target[name])) { |
|
target[name] = []; |
|
} |
|
|
|
const result = buildPath(path, value, target[name], index); |
|
|
|
if (result && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target[name])) { |
|
target[name] = arrayToObject(target[name]); |
|
} |
|
|
|
return !isNumericKey; |
|
} |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(formData) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(formData.entries)) { |
|
const obj = {}; |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEachEntry(formData, (name, value) => { |
|
buildPath(parsePropPath(name), value, obj, 0); |
|
}); |
|
|
|
return obj; |
|
} |
|
|
|
return null; |
|
} |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (formDataToJSON); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/isAbsoluteURL.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/isAbsoluteURL.js ***! |
|
\**********************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ isAbsoluteURL) |
|
/* harmony export */ }); |
|
|
|
|
|
/** |
|
* Determines whether the specified URL is absolute |
|
* |
|
* @param {string} url The URL to test |
|
* |
|
* @returns {boolean} True if the specified URL is absolute, otherwise false |
|
*/ |
|
function isAbsoluteURL(url) { |
|
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). |
|
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed |
|
// by any combination of letters, digits, plus, period, or hyphen. |
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/isAxiosError.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/isAxiosError.js ***! |
|
\*********************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ isAxiosError) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
|
|
|
|
|
|
|
|
/** |
|
* Determines whether the payload is an error thrown by Axios |
|
* |
|
* @param {*} payload The value to test |
|
* |
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false |
|
*/ |
|
function isAxiosError(payload) { |
|
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(payload) && (payload.isAxiosError === true); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/isURLSameOrigin.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/isURLSameOrigin.js ***! |
|
\************************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../platform/index.js */ "../node_modules/axios/lib/platform/browser/index.js"); |
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStandardBrowserEnv ? |
|
|
|
// Standard browser envs have full support of the APIs needed to test |
|
// whether the request URL is of the same origin as current location. |
|
(function standardBrowserEnv() { |
|
const msie = /(msie|trident)/i.test(navigator.userAgent); |
|
const urlParsingNode = document.createElement('a'); |
|
let originURL; |
|
|
|
/** |
|
* Parse a URL to discover it's components |
|
* |
|
* @param {String} url The URL to be parsed |
|
* @returns {Object} |
|
*/ |
|
function resolveURL(url) { |
|
let href = url; |
|
|
|
if (msie) { |
|
// IE needs attribute set twice to normalize properties |
|
urlParsingNode.setAttribute('href', href); |
|
href = urlParsingNode.href; |
|
} |
|
|
|
urlParsingNode.setAttribute('href', href); |
|
|
|
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils |
|
return { |
|
href: urlParsingNode.href, |
|
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', |
|
host: urlParsingNode.host, |
|
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', |
|
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', |
|
hostname: urlParsingNode.hostname, |
|
port: urlParsingNode.port, |
|
pathname: (urlParsingNode.pathname.charAt(0) === '/') ? |
|
urlParsingNode.pathname : |
|
'/' + urlParsingNode.pathname |
|
}; |
|
} |
|
|
|
originURL = resolveURL(window.location.href); |
|
|
|
/** |
|
* Determine if a URL shares the same origin as the current location |
|
* |
|
* @param {String} requestURL The URL to test |
|
* @returns {boolean} True if URL shares the same origin, otherwise false |
|
*/ |
|
return function isURLSameOrigin(requestURL) { |
|
const parsed = (_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].isString(requestURL)) ? resolveURL(requestURL) : requestURL; |
|
return (parsed.protocol === originURL.protocol && |
|
parsed.host === originURL.host); |
|
}; |
|
})() : |
|
|
|
// Non standard browser envs (web workers, react-native) lack needed support. |
|
(function nonStandardBrowserEnv() { |
|
return function isURLSameOrigin() { |
|
return true; |
|
}; |
|
})()); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/null.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/null.js ***! |
|
\*************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
// eslint-disable-next-line strict |
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (null); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/parseHeaders.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/parseHeaders.js ***! |
|
\*********************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
|
|
|
|
|
|
|
|
// RawAxiosHeaders whose duplicates are ignored by node |
|
// c.f. https://nodejs.org/api/http.html#http_message_headers |
|
const ignoreDuplicateOf = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toObjectSet([ |
|
'age', 'authorization', 'content-length', 'content-type', 'etag', |
|
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', |
|
'last-modified', 'location', 'max-forwards', 'proxy-authorization', |
|
'referer', 'retry-after', 'user-agent' |
|
]); |
|
|
|
/** |
|
* Parse headers into an object |
|
* |
|
* ``` |
|
* Date: Wed, 27 Aug 2014 08:58:49 GMT |
|
* Content-Type: application/json |
|
* Connection: keep-alive |
|
* Transfer-Encoding: chunked |
|
* ``` |
|
* |
|
* @param {String} rawHeaders Headers needing to be parsed |
|
* |
|
* @returns {Object} Headers parsed into an object |
|
*/ |
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (rawHeaders => { |
|
const parsed = {}; |
|
let key; |
|
let val; |
|
let i; |
|
|
|
rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { |
|
i = line.indexOf(':'); |
|
key = line.substring(0, i).trim().toLowerCase(); |
|
val = line.substring(i + 1).trim(); |
|
|
|
if (!key || (parsed[key] && ignoreDuplicateOf[key])) { |
|
return; |
|
} |
|
|
|
if (key === 'set-cookie') { |
|
if (parsed[key]) { |
|
parsed[key].push(val); |
|
} else { |
|
parsed[key] = [val]; |
|
} |
|
} else { |
|
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; |
|
} |
|
}); |
|
|
|
return parsed; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/parseProtocol.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/parseProtocol.js ***! |
|
\**********************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ parseProtocol) |
|
/* harmony export */ }); |
|
|
|
|
|
function parseProtocol(url) { |
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); |
|
return match && match[1] || ''; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/speedometer.js": |
|
/*!********************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/speedometer.js ***! |
|
\********************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
|
|
|
|
/** |
|
* Calculate data maxRate |
|
* @param {Number} [samplesCount= 10] |
|
* @param {Number} [min= 1000] |
|
* @returns {Function} |
|
*/ |
|
function speedometer(samplesCount, min) { |
|
samplesCount = samplesCount || 10; |
|
const bytes = new Array(samplesCount); |
|
const timestamps = new Array(samplesCount); |
|
let head = 0; |
|
let tail = 0; |
|
let firstSampleTS; |
|
|
|
min = min !== undefined ? min : 1000; |
|
|
|
return function push(chunkLength) { |
|
const now = Date.now(); |
|
|
|
const startedAt = timestamps[tail]; |
|
|
|
if (!firstSampleTS) { |
|
firstSampleTS = now; |
|
} |
|
|
|
bytes[head] = chunkLength; |
|
timestamps[head] = now; |
|
|
|
let i = tail; |
|
let bytesCount = 0; |
|
|
|
while (i !== head) { |
|
bytesCount += bytes[i++]; |
|
i = i % samplesCount; |
|
} |
|
|
|
head = (head + 1) % samplesCount; |
|
|
|
if (head === tail) { |
|
tail = (tail + 1) % samplesCount; |
|
} |
|
|
|
if (now - firstSampleTS < min) { |
|
return; |
|
} |
|
|
|
const passed = startedAt && now - startedAt; |
|
|
|
return passed ? Math.round(bytesCount * 1000 / passed) : undefined; |
|
}; |
|
} |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (speedometer); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/spread.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/spread.js ***! |
|
\***************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ spread) |
|
/* harmony export */ }); |
|
|
|
|
|
/** |
|
* Syntactic sugar for invoking a function and expanding an array for arguments. |
|
* |
|
* Common use case would be to use `Function.prototype.apply`. |
|
* |
|
* ```js |
|
* function f(x, y, z) {} |
|
* var args = [1, 2, 3]; |
|
* f.apply(null, args); |
|
* ``` |
|
* |
|
* With `spread` this example can be re-written. |
|
* |
|
* ```js |
|
* spread(function(x, y, z) {})([1, 2, 3]); |
|
* ``` |
|
* |
|
* @param {Function} callback |
|
* |
|
* @returns {Function} |
|
*/ |
|
function spread(callback) { |
|
return function wrap(arr) { |
|
return callback.apply(null, arr); |
|
}; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/toFormData.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/toFormData.js ***! |
|
\*******************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosError.js */ "../node_modules/axios/lib/core/AxiosError.js"); |
|
/* harmony import */ var _env_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../env/classes/FormData.js */ "../node_modules/axios/lib/env/classes/FormData.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
* Determines if the given thing is a array or js object. |
|
* |
|
* @param {string} thing - The object or array to be visited. |
|
* |
|
* @returns {boolean} |
|
*/ |
|
function isVisitable(thing) { |
|
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(thing) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(thing); |
|
} |
|
|
|
/** |
|
* It removes the brackets from the end of a string |
|
* |
|
* @param {string} key - The key of the parameter. |
|
* |
|
* @returns {string} the key without the brackets. |
|
*/ |
|
function removeBrackets(key) { |
|
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]') ? key.slice(0, -2) : key; |
|
} |
|
|
|
/** |
|
* It takes a path, a key, and a boolean, and returns a string |
|
* |
|
* @param {string} path - The path to the current key. |
|
* @param {string} key - The key of the current object being iterated over. |
|
* @param {string} dots - If true, the key will be rendered with dots instead of brackets. |
|
* |
|
* @returns {string} The path to the current key. |
|
*/ |
|
function renderKey(path, key, dots) { |
|
if (!path) return key; |
|
return path.concat(key).map(function each(token, i) { |
|
// eslint-disable-next-line no-param-reassign |
|
token = removeBrackets(token); |
|
return !dots && i ? '[' + token + ']' : token; |
|
}).join(dots ? '.' : ''); |
|
} |
|
|
|
/** |
|
* If the array is an array and none of its elements are visitable, then it's a flat array. |
|
* |
|
* @param {Array<any>} arr - The array to check |
|
* |
|
* @returns {boolean} |
|
*/ |
|
function isFlatArray(arr) { |
|
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(arr) && !arr.some(isVisitable); |
|
} |
|
|
|
const predicates = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"], {}, null, function filter(prop) { |
|
return /^is[A-Z]/.test(prop); |
|
}); |
|
|
|
/** |
|
* If the thing is a FormData object, return true, otherwise return false. |
|
* |
|
* @param {unknown} thing - The thing to check. |
|
* |
|
* @returns {boolean} |
|
*/ |
|
function isSpecCompliant(thing) { |
|
return thing && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]; |
|
} |
|
|
|
/** |
|
* Convert a data object to FormData |
|
* |
|
* @param {Object} obj |
|
* @param {?Object} [formData] |
|
* @param {?Object} [options] |
|
* @param {Function} [options.visitor] |
|
* @param {Boolean} [options.metaTokens = true] |
|
* @param {Boolean} [options.dots = false] |
|
* @param {?Boolean} [options.indexes = false] |
|
* |
|
* @returns {Object} |
|
**/ |
|
|
|
/** |
|
* It converts an object into a FormData object |
|
* |
|
* @param {Object<any, any>} obj - The object to convert to form data. |
|
* @param {string} formData - The FormData object to append to. |
|
* @param {Object<string, any>} options |
|
* |
|
* @returns |
|
*/ |
|
function toFormData(obj, formData, options) { |
|
if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { |
|
throw new TypeError('target must be an object'); |
|
} |
|
|
|
// eslint-disable-next-line no-param-reassign |
|
formData = formData || new (_env_classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"] || FormData)(); |
|
|
|
// eslint-disable-next-line no-param-reassign |
|
options = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(options, { |
|
metaTokens: true, |
|
dots: false, |
|
indexes: false |
|
}, false, function defined(option, source) { |
|
// eslint-disable-next-line no-eq-null,eqeqeq |
|
return !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(source[option]); |
|
}); |
|
|
|
const metaTokens = options.metaTokens; |
|
// eslint-disable-next-line no-use-before-define |
|
const visitor = options.visitor || defaultVisitor; |
|
const dots = options.dots; |
|
const indexes = options.indexes; |
|
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; |
|
const useBlob = _Blob && isSpecCompliant(formData); |
|
|
|
if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(visitor)) { |
|
throw new TypeError('visitor must be a function'); |
|
} |
|
|
|
function convertValue(value) { |
|
if (value === null) return ''; |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isDate(value)) { |
|
return value.toISOString(); |
|
} |
|
|
|
if (!useBlob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(value)) { |
|
throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_2__["default"]('Blob is not supported. Use a Buffer instead.'); |
|
} |
|
|
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isTypedArray(value)) { |
|
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); |
|
} |
|
|
|
return value; |
|
} |
|
|
|
/** |
|
* Default visitor. |
|
* |
|
* @param {*} value |
|
* @param {String|Number} key |
|
* @param {Array<String|Number>} path |
|
* @this {FormData} |
|
* |
|
* @returns {boolean} return true to visit the each prop of the value recursively |
|
*/ |
|
function defaultVisitor(value, key, path) { |
|
let arr = value; |
|
|
|
if (value && !path && typeof value === 'object') { |
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '{}')) { |
|
// eslint-disable-next-line no-param-reassign |
|
key = metaTokens ? key : key.slice(0, -2); |
|
// eslint-disable-next-line no-param-reassign |
|
value = JSON.stringify(value); |
|
} else if ( |
|
(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) && isFlatArray(value)) || |
|
(_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)) |
|
)) { |
|
// eslint-disable-next-line no-param-reassign |
|
key = removeBrackets(key); |
|
|
|
arr.forEach(function each(el, index) { |
|
!(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && formData.append( |
|
// eslint-disable-next-line no-nested-ternary |
|
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), |
|
convertValue(el) |
|
); |
|
}); |
|
return false; |
|
} |
|
} |
|
|
|
if (isVisitable(value)) { |
|
return true; |
|
} |
|
|
|
formData.append(renderKey(path, key, dots), convertValue(value)); |
|
|
|
return false; |
|
} |
|
|
|
const stack = []; |
|
|
|
const exposedHelpers = Object.assign(predicates, { |
|
defaultVisitor, |
|
convertValue, |
|
isVisitable |
|
}); |
|
|
|
function build(value, path) { |
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(value)) return; |
|
|
|
if (stack.indexOf(value) !== -1) { |
|
throw Error('Circular reference detected in ' + path.join('.')); |
|
} |
|
|
|
stack.push(value); |
|
|
|
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(value, function each(el, key) { |
|
const result = !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && visitor.call( |
|
formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(key) ? key.trim() : key, path, exposedHelpers |
|
); |
|
|
|
if (result === true) { |
|
build(el, path ? path.concat(key) : [key]); |
|
} |
|
}); |
|
|
|
stack.pop(); |
|
} |
|
|
|
if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { |
|
throw new TypeError('data must be an object'); |
|
} |
|
|
|
build(obj); |
|
|
|
return formData; |
|
} |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toFormData); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/toURLEncodedForm.js": |
|
/*!*************************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/toURLEncodedForm.js ***! |
|
\*************************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (/* binding */ toURLEncodedForm) |
|
/* harmony export */ }); |
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "../node_modules/axios/lib/utils.js"); |
|
/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "../node_modules/axios/lib/helpers/toFormData.js"); |
|
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ "../node_modules/axios/lib/platform/browser/index.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
function toURLEncodedForm(data, options) { |
|
return (0,_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].classes.URLSearchParams(), Object.assign({ |
|
visitor: function(value, key, path, helpers) { |
|
if (_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].isNode && _utils_js__WEBPACK_IMPORTED_MODULE_2__["default"].isBuffer(value)) { |
|
this.append(key, value.toString('base64')); |
|
return false; |
|
} |
|
|
|
return helpers.defaultVisitor.apply(this, arguments); |
|
} |
|
}, options)); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/helpers/validator.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/axios/lib/helpers/validator.js ***! |
|
\******************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env/data.js */ "../node_modules/axios/lib/env/data.js"); |
|
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "../node_modules/axios/lib/core/AxiosError.js"); |
|
|
|
|
|
|
|
|
|
|
|
const validators = {}; |
|
|
|
// eslint-disable-next-line func-names |
|
['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { |
|
validators[type] = function validator(thing) { |
|
return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; |
|
}; |
|
}); |
|
|
|
const deprecatedWarnings = {}; |
|
|
|
/** |
|
* Transitional option validator |
|
* |
|
* @param {function|boolean?} validator - set to false if the transitional option has been removed |
|
* @param {string?} version - deprecated version / removed since version |
|
* @param {string?} message - some message with additional info |
|
* |
|
* @returns {function} |
|
*/ |
|
validators.transitional = function transitional(validator, version, message) { |
|
function formatMessage(opt, desc) { |
|
return '[Axios v' + _env_data_js__WEBPACK_IMPORTED_MODULE_0__.VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); |
|
} |
|
|
|
// eslint-disable-next-line func-names |
|
return (value, opt, opts) => { |
|
if (validator === false) { |
|
throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]( |
|
formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), |
|
_core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_DEPRECATED |
|
); |
|
} |
|
|
|
if (version && !deprecatedWarnings[opt]) { |
|
deprecatedWarnings[opt] = true; |
|
// eslint-disable-next-line no-console |
|
console.warn( |
|
formatMessage( |
|
opt, |
|
' has been deprecated since v' + version + ' and will be removed in the near future' |
|
) |
|
); |
|
} |
|
|
|
return validator ? validator(value, opt, opts) : true; |
|
}; |
|
}; |
|
|
|
/** |
|
* Assert object's properties type |
|
* |
|
* @param {object} options |
|
* @param {object} schema |
|
* @param {boolean?} allowUnknown |
|
* |
|
* @returns {object} |
|
*/ |
|
|
|
function assertOptions(options, schema, allowUnknown) { |
|
if (typeof options !== 'object') { |
|
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); |
|
} |
|
const keys = Object.keys(options); |
|
let i = keys.length; |
|
while (i-- > 0) { |
|
const opt = keys[i]; |
|
const validator = schema[opt]; |
|
if (validator) { |
|
const value = options[opt]; |
|
const result = value === undefined || validator(value, opt, options); |
|
if (result !== true) { |
|
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); |
|
} |
|
continue; |
|
} |
|
if (allowUnknown !== true) { |
|
throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('Unknown option ' + opt, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION); |
|
} |
|
} |
|
} |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ |
|
assertOptions, |
|
validators |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/platform/browser/classes/FormData.js": |
|
/*!**********************************************************************!*\ |
|
!*** ../node_modules/axios/lib/platform/browser/classes/FormData.js ***! |
|
\**********************************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
|
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FormData); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js": |
|
/*!*****************************************************************************!*\ |
|
!*** ../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js ***! |
|
\*****************************************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../helpers/AxiosURLSearchParams.js */ "../node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); |
|
|
|
|
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/platform/browser/index.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/axios/lib/platform/browser/index.js ***! |
|
\***********************************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classes/URLSearchParams.js */ "../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js"); |
|
/* harmony import */ var _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classes/FormData.js */ "../node_modules/axios/lib/platform/browser/classes/FormData.js"); |
|
|
|
|
|
|
|
/** |
|
* Determine if we're running in a standard browser environment |
|
* |
|
* This allows axios to run in a web worker, and react-native. |
|
* Both environments support XMLHttpRequest, but not fully standard globals. |
|
* |
|
* web workers: |
|
* typeof window -> undefined |
|
* typeof document -> undefined |
|
* |
|
* react-native: |
|
* navigator.product -> 'ReactNative' |
|
* nativescript |
|
* navigator.product -> 'NativeScript' or 'NS' |
|
* |
|
* @returns {boolean} |
|
*/ |
|
const isStandardBrowserEnv = (() => { |
|
let product; |
|
if (typeof navigator !== 'undefined' && ( |
|
(product = navigator.product) === 'ReactNative' || |
|
product === 'NativeScript' || |
|
product === 'NS') |
|
) { |
|
return false; |
|
} |
|
|
|
return typeof window !== 'undefined' && typeof document !== 'undefined'; |
|
})(); |
|
|
|
/** |
|
* Determine if we're running in a standard browser webWorker environment |
|
* |
|
* Although the `isStandardBrowserEnv` method indicates that |
|
* `allows axios to run in a web worker`, the WebWorker will still be |
|
* filtered out due to its judgment standard |
|
* `typeof window !== 'undefined' && typeof document !== 'undefined'`. |
|
* This leads to a problem when axios post `FormData` in webWorker |
|
*/ |
|
const isStandardBrowserWebWorkerEnv = (() => { |
|
return ( |
|
typeof WorkerGlobalScope !== 'undefined' && |
|
self instanceof WorkerGlobalScope && |
|
typeof self.importScripts === 'function' |
|
); |
|
})(); |
|
|
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ |
|
isBrowser: true, |
|
classes: { |
|
URLSearchParams: _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
FormData: _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
|
Blob |
|
}, |
|
isStandardBrowserEnv, |
|
isStandardBrowserWebWorkerEnv, |
|
protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/axios/lib/utils.js": |
|
/*!******************************************!*\ |
|
!*** ../node_modules/axios/lib/utils.js ***! |
|
\******************************************/ |
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
|
/* harmony export */ }); |
|
/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/bind.js */ "../node_modules/axios/lib/helpers/bind.js"); |
|
|
|
|
|
|
|
|
|
// utils is a library of generic helper functions non-specific to axios |
|
|
|
const {toString} = Object.prototype; |
|
const {getPrototypeOf} = Object; |
|
|
|
const kindOf = (cache => thing => { |
|
const str = toString.call(thing); |
|
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); |
|
})(Object.create(null)); |
|
|
|
const kindOfTest = (type) => { |
|
type = type.toLowerCase(); |
|
return (thing) => kindOf(thing) === type |
|
} |
|
|
|
const typeOfTest = type => thing => typeof thing === type; |
|
|
|
/** |
|
* Determine if a value is an Array |
|
* |
|
* @param {Object} val The value to test |
|
* |
|
* @returns {boolean} True if value is an Array, otherwise false |
|
*/ |
|
const {isArray} = Array; |
|
|
|
/** |
|
* Determine if a value is undefined |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if the value is undefined, otherwise false |
|
*/ |
|
const isUndefined = typeOfTest('undefined'); |
|
|
|
/** |
|
* Determine if a value is a Buffer |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if value is a Buffer, otherwise false |
|
*/ |
|
function isBuffer(val) { |
|
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) |
|
&& isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); |
|
} |
|
|
|
/** |
|
* Determine if a value is an ArrayBuffer |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if value is an ArrayBuffer, otherwise false |
|
*/ |
|
const isArrayBuffer = kindOfTest('ArrayBuffer'); |
|
|
|
|
|
/** |
|
* Determine if a value is a view on an ArrayBuffer |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false |
|
*/ |
|
function isArrayBufferView(val) { |
|
let result; |
|
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { |
|
result = ArrayBuffer.isView(val); |
|
} else { |
|
result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Determine if a value is a String |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if value is a String, otherwise false |
|
*/ |
|
const isString = typeOfTest('string'); |
|
|
|
/** |
|
* Determine if a value is a Function |
|
* |
|
* @param {*} val The value to test |
|
* @returns {boolean} True if value is a Function, otherwise false |
|
*/ |
|
const isFunction = typeOfTest('function'); |
|
|
|
/** |
|
* Determine if a value is a Number |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if value is a Number, otherwise false |
|
*/ |
|
const isNumber = typeOfTest('number'); |
|
|
|
/** |
|
* Determine if a value is an Object |
|
* |
|
* @param {*} thing The value to test |
|
* |
|
* @returns {boolean} True if value is an Object, otherwise false |
|
*/ |
|
const isObject = (thing) => thing !== null && typeof thing === 'object'; |
|
|
|
/** |
|
* Determine if a value is a Boolean |
|
* |
|
* @param {*} thing The value to test |
|
* @returns {boolean} True if value is a Boolean, otherwise false |
|
*/ |
|
const isBoolean = thing => thing === true || thing === false; |
|
|
|
/** |
|
* Determine if a value is a plain Object |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if value is a plain Object, otherwise false |
|
*/ |
|
const isPlainObject = (val) => { |
|
if (kindOf(val) !== 'object') { |
|
return false; |
|
} |
|
|
|
const prototype = getPrototypeOf(val); |
|
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); |
|
} |
|
|
|
/** |
|
* Determine if a value is a Date |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if value is a Date, otherwise false |
|
*/ |
|
const isDate = kindOfTest('Date'); |
|
|
|
/** |
|
* Determine if a value is a File |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if value is a File, otherwise false |
|
*/ |
|
const isFile = kindOfTest('File'); |
|
|
|
/** |
|
* Determine if a value is a Blob |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if value is a Blob, otherwise false |
|
*/ |
|
const isBlob = kindOfTest('Blob'); |
|
|
|
/** |
|
* Determine if a value is a FileList |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if value is a File, otherwise false |
|
*/ |
|
const isFileList = kindOfTest('FileList'); |
|
|
|
/** |
|
* Determine if a value is a Stream |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if value is a Stream, otherwise false |
|
*/ |
|
const isStream = (val) => isObject(val) && isFunction(val.pipe); |
|
|
|
/** |
|
* Determine if a value is a FormData |
|
* |
|
* @param {*} thing The value to test |
|
* |
|
* @returns {boolean} True if value is an FormData, otherwise false |
|
*/ |
|
const isFormData = (thing) => { |
|
const pattern = '[object FormData]'; |
|
return thing && ( |
|
(typeof FormData === 'function' && thing instanceof FormData) || |
|
toString.call(thing) === pattern || |
|
(isFunction(thing.toString) && thing.toString() === pattern) |
|
); |
|
} |
|
|
|
/** |
|
* Determine if a value is a URLSearchParams object |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if value is a URLSearchParams object, otherwise false |
|
*/ |
|
const isURLSearchParams = kindOfTest('URLSearchParams'); |
|
|
|
/** |
|
* Trim excess whitespace off the beginning and end of a string |
|
* |
|
* @param {String} str The String to trim |
|
* |
|
* @returns {String} The String freed of excess whitespace |
|
*/ |
|
const trim = (str) => str.trim ? |
|
str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); |
|
|
|
/** |
|
* Iterate over an Array or an Object invoking a function for each item. |
|
* |
|
* If `obj` is an Array callback will be called passing |
|
* the value, index, and complete array for each item. |
|
* |
|
* If 'obj' is an Object callback will be called passing |
|
* the value, key, and complete object for each property. |
|
* |
|
* @param {Object|Array} obj The object to iterate |
|
* @param {Function} fn The callback to invoke for each item |
|
* |
|
* @param {Boolean} [allOwnKeys = false] |
|
* @returns {any} |
|
*/ |
|
function forEach(obj, fn, {allOwnKeys = false} = {}) { |
|
// Don't bother if no value provided |
|
if (obj === null || typeof obj === 'undefined') { |
|
return; |
|
} |
|
|
|
let i; |
|
let l; |
|
|
|
// Force an array if not already something iterable |
|
if (typeof obj !== 'object') { |
|
/*eslint no-param-reassign:0*/ |
|
obj = [obj]; |
|
} |
|
|
|
if (isArray(obj)) { |
|
// Iterate over array values |
|
for (i = 0, l = obj.length; i < l; i++) { |
|
fn.call(null, obj[i], i, obj); |
|
} |
|
} else { |
|
// Iterate over object keys |
|
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); |
|
const len = keys.length; |
|
let key; |
|
|
|
for (i = 0; i < len; i++) { |
|
key = keys[i]; |
|
fn.call(null, obj[key], key, obj); |
|
} |
|
} |
|
} |
|
|
|
function findKey(obj, key) { |
|
key = key.toLowerCase(); |
|
const keys = Object.keys(obj); |
|
let i = keys.length; |
|
let _key; |
|
while (i-- > 0) { |
|
_key = keys[i]; |
|
if (key === _key.toLowerCase()) { |
|
return _key; |
|
} |
|
} |
|
return null; |
|
} |
|
|
|
const _global = typeof self === "undefined" ? typeof global === "undefined" ? undefined : global : self; |
|
|
|
const isContextDefined = (context) => !isUndefined(context) && context !== _global; |
|
|
|
/** |
|
* Accepts varargs expecting each argument to be an object, then |
|
* immutably merges the properties of each object and returns result. |
|
* |
|
* When multiple objects contain the same key the later object in |
|
* the arguments list will take precedence. |
|
* |
|
* Example: |
|
* |
|
* ```js |
|
* var result = merge({foo: 123}, {foo: 456}); |
|
* console.log(result.foo); // outputs 456 |
|
* ``` |
|
* |
|
* @param {Object} obj1 Object to merge |
|
* |
|
* @returns {Object} Result of all merge properties |
|
*/ |
|
function merge(/* obj1, obj2, obj3, ... */) { |
|
const {caseless} = isContextDefined(this) && this || {}; |
|
const result = {}; |
|
const assignValue = (val, key) => { |
|
const targetKey = caseless && findKey(result, key) || key; |
|
if (isPlainObject(result[targetKey]) && isPlainObject(val)) { |
|
result[targetKey] = merge(result[targetKey], val); |
|
} else if (isPlainObject(val)) { |
|
result[targetKey] = merge({}, val); |
|
} else if (isArray(val)) { |
|
result[targetKey] = val.slice(); |
|
} else { |
|
result[targetKey] = val; |
|
} |
|
} |
|
|
|
for (let i = 0, l = arguments.length; i < l; i++) { |
|
arguments[i] && forEach(arguments[i], assignValue); |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Extends object a by mutably adding to it the properties of object b. |
|
* |
|
* @param {Object} a The object to be extended |
|
* @param {Object} b The object to copy properties from |
|
* @param {Object} thisArg The object to bind function to |
|
* |
|
* @param {Boolean} [allOwnKeys] |
|
* @returns {Object} The resulting value of object a |
|
*/ |
|
const extend = (a, b, thisArg, {allOwnKeys}= {}) => { |
|
forEach(b, (val, key) => { |
|
if (thisArg && isFunction(val)) { |
|
a[key] = (0,_helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(val, thisArg); |
|
} else { |
|
a[key] = val; |
|
} |
|
}, {allOwnKeys}); |
|
return a; |
|
} |
|
|
|
/** |
|
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) |
|
* |
|
* @param {string} content with BOM |
|
* |
|
* @returns {string} content value without BOM |
|
*/ |
|
const stripBOM = (content) => { |
|
if (content.charCodeAt(0) === 0xFEFF) { |
|
content = content.slice(1); |
|
} |
|
return content; |
|
} |
|
|
|
/** |
|
* Inherit the prototype methods from one constructor into another |
|
* @param {function} constructor |
|
* @param {function} superConstructor |
|
* @param {object} [props] |
|
* @param {object} [descriptors] |
|
* |
|
* @returns {void} |
|
*/ |
|
const inherits = (constructor, superConstructor, props, descriptors) => { |
|
constructor.prototype = Object.create(superConstructor.prototype, descriptors); |
|
constructor.prototype.constructor = constructor; |
|
Object.defineProperty(constructor, 'super', { |
|
value: superConstructor.prototype |
|
}); |
|
props && Object.assign(constructor.prototype, props); |
|
} |
|
|
|
/** |
|
* Resolve object with deep prototype chain to a flat object |
|
* @param {Object} sourceObj source object |
|
* @param {Object} [destObj] |
|
* @param {Function|Boolean} [filter] |
|
* @param {Function} [propFilter] |
|
* |
|
* @returns {Object} |
|
*/ |
|
const toFlatObject = (sourceObj, destObj, filter, propFilter) => { |
|
let props; |
|
let i; |
|
let prop; |
|
const merged = {}; |
|
|
|
destObj = destObj || {}; |
|
// eslint-disable-next-line no-eq-null,eqeqeq |
|
if (sourceObj == null) return destObj; |
|
|
|
do { |
|
props = Object.getOwnPropertyNames(sourceObj); |
|
i = props.length; |
|
while (i-- > 0) { |
|
prop = props[i]; |
|
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { |
|
destObj[prop] = sourceObj[prop]; |
|
merged[prop] = true; |
|
} |
|
} |
|
sourceObj = filter !== false && getPrototypeOf(sourceObj); |
|
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); |
|
|
|
return destObj; |
|
} |
|
|
|
/** |
|
* Determines whether a string ends with the characters of a specified string |
|
* |
|
* @param {String} str |
|
* @param {String} searchString |
|
* @param {Number} [position= 0] |
|
* |
|
* @returns {boolean} |
|
*/ |
|
const endsWith = (str, searchString, position) => { |
|
str = String(str); |
|
if (position === undefined || position > str.length) { |
|
position = str.length; |
|
} |
|
position -= searchString.length; |
|
const lastIndex = str.indexOf(searchString, position); |
|
return lastIndex !== -1 && lastIndex === position; |
|
} |
|
|
|
|
|
/** |
|
* Returns new array from array like object or null if failed |
|
* |
|
* @param {*} [thing] |
|
* |
|
* @returns {?Array} |
|
*/ |
|
const toArray = (thing) => { |
|
if (!thing) return null; |
|
if (isArray(thing)) return thing; |
|
let i = thing.length; |
|
if (!isNumber(i)) return null; |
|
const arr = new Array(i); |
|
while (i-- > 0) { |
|
arr[i] = thing[i]; |
|
} |
|
return arr; |
|
} |
|
|
|
/** |
|
* Checking if the Uint8Array exists and if it does, it returns a function that checks if the |
|
* thing passed in is an instance of Uint8Array |
|
* |
|
* @param {TypedArray} |
|
* |
|
* @returns {Array} |
|
*/ |
|
// eslint-disable-next-line func-names |
|
const isTypedArray = (TypedArray => { |
|
// eslint-disable-next-line func-names |
|
return thing => { |
|
return TypedArray && thing instanceof TypedArray; |
|
}; |
|
})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); |
|
|
|
/** |
|
* For each entry in the object, call the function with the key and value. |
|
* |
|
* @param {Object<any, any>} obj - The object to iterate over. |
|
* @param {Function} fn - The function to call for each entry. |
|
* |
|
* @returns {void} |
|
*/ |
|
const forEachEntry = (obj, fn) => { |
|
const generator = obj && obj[Symbol.iterator]; |
|
|
|
const iterator = generator.call(obj); |
|
|
|
let result; |
|
|
|
while ((result = iterator.next()) && !result.done) { |
|
const pair = result.value; |
|
fn.call(obj, pair[0], pair[1]); |
|
} |
|
} |
|
|
|
/** |
|
* It takes a regular expression and a string, and returns an array of all the matches |
|
* |
|
* @param {string} regExp - The regular expression to match against. |
|
* @param {string} str - The string to search. |
|
* |
|
* @returns {Array<boolean>} |
|
*/ |
|
const matchAll = (regExp, str) => { |
|
let matches; |
|
const arr = []; |
|
|
|
while ((matches = regExp.exec(str)) !== null) { |
|
arr.push(matches); |
|
} |
|
|
|
return arr; |
|
} |
|
|
|
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ |
|
const isHTMLForm = kindOfTest('HTMLFormElement'); |
|
|
|
const toCamelCase = str => { |
|
return str.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g, |
|
function replacer(m, p1, p2) { |
|
return p1.toUpperCase() + p2; |
|
} |
|
); |
|
}; |
|
|
|
/* Creating a function that will check if an object has a property. */ |
|
const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); |
|
|
|
/** |
|
* Determine if a value is a RegExp object |
|
* |
|
* @param {*} val The value to test |
|
* |
|
* @returns {boolean} True if value is a RegExp object, otherwise false |
|
*/ |
|
const isRegExp = kindOfTest('RegExp'); |
|
|
|
const reduceDescriptors = (obj, reducer) => { |
|
const descriptors = Object.getOwnPropertyDescriptors(obj); |
|
const reducedDescriptors = {}; |
|
|
|
forEach(descriptors, (descriptor, name) => { |
|
if (reducer(descriptor, name, obj) !== false) { |
|
reducedDescriptors[name] = descriptor; |
|
} |
|
}); |
|
|
|
Object.defineProperties(obj, reducedDescriptors); |
|
} |
|
|
|
/** |
|
* Makes all methods read-only |
|
* @param {Object} obj |
|
*/ |
|
|
|
const freezeMethods = (obj) => { |
|
reduceDescriptors(obj, (descriptor, name) => { |
|
// skip restricted props in strict mode |
|
if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { |
|
return false; |
|
} |
|
|
|
const value = obj[name]; |
|
|
|
if (!isFunction(value)) return; |
|
|
|
descriptor.enumerable = false; |
|
|
|
if ('writable' in descriptor) { |
|
descriptor.writable = false; |
|
return; |
|
} |
|
|
|
if (!descriptor.set) { |
|
descriptor.set = () => { |
|
throw Error('Can not rewrite read-only method \'' + name + '\''); |
|
}; |
|
} |
|
}); |
|
} |
|
|
|
const toObjectSet = (arrayOrString, delimiter) => { |
|
const obj = {}; |
|
|
|
const define = (arr) => { |
|
arr.forEach(value => { |
|
obj[value] = true; |
|
}); |
|
} |
|
|
|
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); |
|
|
|
return obj; |
|
} |
|
|
|
const noop = () => {} |
|
|
|
const toFiniteNumber = (value, defaultValue) => { |
|
value = +value; |
|
return Number.isFinite(value) ? value : defaultValue; |
|
} |
|
|
|
const toJSONObject = (obj) => { |
|
const stack = new Array(10); |
|
|
|
const visit = (source, i) => { |
|
|
|
if (isObject(source)) { |
|
if (stack.indexOf(source) >= 0) { |
|
return; |
|
} |
|
|
|
if(!('toJSON' in source)) { |
|
stack[i] = source; |
|
const target = isArray(source) ? [] : {}; |
|
|
|
forEach(source, (value, key) => { |
|
const reducedValue = visit(value, i + 1); |
|
!isUndefined(reducedValue) && (target[key] = reducedValue); |
|
}); |
|
|
|
stack[i] = undefined; |
|
|
|
return target; |
|
} |
|
} |
|
|
|
return source; |
|
} |
|
|
|
return visit(obj, 0); |
|
} |
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ |
|
isArray, |
|
isArrayBuffer, |
|
isBuffer, |
|
isFormData, |
|
isArrayBufferView, |
|
isString, |
|
isNumber, |
|
isBoolean, |
|
isObject, |
|
isPlainObject, |
|
isUndefined, |
|
isDate, |
|
isFile, |
|
isBlob, |
|
isRegExp, |
|
isFunction, |
|
isStream, |
|
isURLSearchParams, |
|
isTypedArray, |
|
isFileList, |
|
forEach, |
|
merge, |
|
extend, |
|
trim, |
|
stripBOM, |
|
inherits, |
|
toFlatObject, |
|
kindOf, |
|
kindOfTest, |
|
endsWith, |
|
toArray, |
|
forEachEntry, |
|
matchAll, |
|
isHTMLForm, |
|
hasOwnProperty, |
|
hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection |
|
reduceDescriptors, |
|
freezeMethods, |
|
toObjectSet, |
|
toCamelCase, |
|
noop, |
|
toFiniteNumber, |
|
findKey, |
|
global: _global, |
|
isContextDefined, |
|
toJSONObject |
|
}); |
|
|
|
|
|
/***/ }) |
|
|
|
/******/ }); |
|
/************************************************************************/ |
|
/******/ // The module cache |
|
/******/ var __webpack_module_cache__ = {}; |
|
/******/ |
|
/******/ // The require function |
|
/******/ function __webpack_require__(moduleId) { |
|
/******/ // Check if module is in cache |
|
/******/ var cachedModule = __webpack_module_cache__[moduleId]; |
|
/******/ if (cachedModule !== undefined) { |
|
/******/ return cachedModule.exports; |
|
/******/ } |
|
/******/ // Create a new module (and put it into the cache) |
|
/******/ var module = __webpack_module_cache__[moduleId] = { |
|
/******/ // no module.id needed |
|
/******/ // no module.loaded needed |
|
/******/ exports: {} |
|
/******/ }; |
|
/******/ |
|
/******/ // Execute the module function |
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
|
/******/ |
|
/******/ // Return the exports of the module |
|
/******/ return module.exports; |
|
/******/ } |
|
/******/ |
|
/************************************************************************/ |
|
/******/ /* webpack/runtime/compat get default export */ |
|
/******/ (() => { |
|
/******/ // getDefaultExport function for compatibility with non-harmony modules |
|
/******/ __webpack_require__.n = (module) => { |
|
/******/ var getter = module && module.__esModule ? |
|
/******/ () => (module['default']) : |
|
/******/ () => (module); |
|
/******/ __webpack_require__.d(getter, { a: getter }); |
|
/******/ return getter; |
|
/******/ }; |
|
/******/ })(); |
|
/******/ |
|
/******/ /* webpack/runtime/define property getters */ |
|
/******/ (() => { |
|
/******/ // define getter functions for harmony exports |
|
/******/ __webpack_require__.d = (exports, definition) => { |
|
/******/ for(var key in definition) { |
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
|
/******/ } |
|
/******/ } |
|
/******/ }; |
|
/******/ })(); |
|
/******/ |
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
|
/******/ (() => { |
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
|
/******/ })(); |
|
/******/ |
|
/******/ /* webpack/runtime/make namespace object */ |
|
/******/ (() => { |
|
/******/ // define __esModule on exports |
|
/******/ __webpack_require__.r = (exports) => { |
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
|
/******/ } |
|
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
|
/******/ }; |
|
/******/ })(); |
|
/******/ |
|
/************************************************************************/ |
|
var __webpack_exports__ = {}; |
|
// This entry need to be wrapped in an IIFE because it need to be in strict mode. |
|
(() => { |
|
"use strict"; |
|
/*!*******************************************************!*\ |
|
!*** ./panels/corpglory-dataexporter-panel/module.ts ***! |
|
\*******************************************************/ |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
|
/* harmony export */ "plugin": () => (/* binding */ plugin) |
|
/* harmony export */ }); |
|
/* harmony import */ var _components_Panel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components/Panel */ "./panels/corpglory-dataexporter-panel/components/Panel.tsx"); |
|
/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @grafana/data */ "@grafana/data"); |
|
/* harmony import */ var _grafana_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_grafana_data__WEBPACK_IMPORTED_MODULE_1__); |
|
|
|
|
|
var plugin = new _grafana_data__WEBPACK_IMPORTED_MODULE_1__.PanelPlugin(_components_Panel__WEBPACK_IMPORTED_MODULE_0__.Panel); |
|
})(); |
|
|
|
/******/ return __webpack_exports__; |
|
/******/ })() |
|
; |
|
});; |
|
//# sourceMappingURL=module.js.map
|