diff --git a/main.js b/main.js old mode 100755 new mode 100644 index 21ec05a..752b3fb --- a/main.js +++ b/main.js @@ -1,2812 +1,5 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __markAsModule = (target) => __defProp(target, "__esModule", {value: true}); -var __commonJS = (callback, module2) => () => { - if (!module2) { - module2 = {exports: {}}; - callback(module2.exports, module2); - } - return module2.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, {get: all[name], enumerable: true}); -}; -var __exportStar = (target, module2, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key of __getOwnPropNames(module2)) - if (!__hasOwnProp.call(target, key) && key !== "default") - __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable}); - } - return target; -}; -var __toModule = (module2) => { - return __exportStar(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2); -}; - -// node_modules/axios/lib/helpers/bind.js -var require_bind = __commonJS((exports2, module2) => { - "use strict"; - module2.exports = function bind(fn, thisArg) { - return function wrap() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - return fn.apply(thisArg, args); - }; - }; -}); - -// node_modules/axios/lib/utils.js -var require_utils = __commonJS((exports2, module2) => { - "use strict"; - var bind = require_bind(); - var toString = Object.prototype.toString; - function isArray(val) { - return toString.call(val) === "[object Array]"; - } - function isUndefined(val) { - return typeof val === "undefined"; - } - function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val); - } - function isArrayBuffer(val) { - return toString.call(val) === "[object ArrayBuffer]"; - } - function isFormData(val) { - return typeof FormData !== "undefined" && val instanceof FormData; - } - function isArrayBufferView(val) { - var result; - if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { - result = ArrayBuffer.isView(val); - } else { - result = val && val.buffer && val.buffer instanceof ArrayBuffer; - } - return result; - } - function isString(val) { - return typeof val === "string"; - } - function isNumber(val) { - return typeof val === "number"; - } - function isObject(val) { - return val !== null && typeof val === "object"; - } - function isPlainObject(val) { - if (toString.call(val) !== "[object Object]") { - return false; - } - var prototype = Object.getPrototypeOf(val); - return prototype === null || prototype === Object.prototype; - } - function isDate(val) { - return toString.call(val) === "[object Date]"; - } - function isFile(val) { - return toString.call(val) === "[object File]"; - } - function isBlob(val) { - return toString.call(val) === "[object Blob]"; - } - function isFunction(val) { - return toString.call(val) === "[object Function]"; - } - function isStream(val) { - return isObject(val) && isFunction(val.pipe); - } - function isURLSearchParams(val) { - return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams; - } - function trim(str) { - return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ""); - } - function isStandardBrowserEnv() { - if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) { - return false; - } - return typeof window !== "undefined" && typeof document !== "undefined"; - } - function forEach(obj, fn) { - if (obj === null || typeof obj === "undefined") { - return; - } - if (typeof obj !== "object") { - obj = [obj]; - } - if (isArray(obj)) { - for (var i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - fn.call(null, obj[key], key, obj); - } - } - } - } - function merge() { - var result = {}; - function assignValue(val, key) { - if (isPlainObject(result[key]) && isPlainObject(val)) { - result[key] = merge(result[key], val); - } else if (isPlainObject(val)) { - result[key] = merge({}, val); - } else if (isArray(val)) { - result[key] = val.slice(); - } else { - result[key] = val; - } - } - for (var i = 0, l = arguments.length; i < l; i++) { - forEach(arguments[i], assignValue); - } - return result; - } - function extend(a, b, thisArg) { - forEach(b, function assignValue(val, key) { - if (thisArg && typeof val === "function") { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }); - return a; - } - function stripBOM(content) { - if (content.charCodeAt(0) === 65279) { - content = content.slice(1); - } - return content; - } - module2.exports = { - isArray, - isArrayBuffer, - isBuffer, - isFormData, - isArrayBufferView, - isString, - isNumber, - isObject, - isPlainObject, - isUndefined, - isDate, - isFile, - isBlob, - isFunction, - isStream, - isURLSearchParams, - isStandardBrowserEnv, - forEach, - merge, - extend, - trim, - stripBOM - }; -}); - -// node_modules/axios/lib/helpers/buildURL.js -var require_buildURL = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - function encode(val) { - return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); - } - module2.exports = function buildURL(url, params, paramsSerializer) { - if (!params) { - return url; - } - var serializedParams; - if (paramsSerializer) { - serializedParams = paramsSerializer(params); - } else if (utils.isURLSearchParams(params)) { - serializedParams = params.toString(); - } else { - var parts = []; - utils.forEach(params, function serialize(val, key) { - if (val === null || typeof val === "undefined") { - return; - } - if (utils.isArray(val)) { - key = key + "[]"; - } else { - val = [val]; - } - utils.forEach(val, function parseValue(v) { - if (utils.isDate(v)) { - v = v.toISOString(); - } else if (utils.isObject(v)) { - v = JSON.stringify(v); - } - parts.push(encode(key) + "=" + encode(v)); - }); - }); - serializedParams = parts.join("&"); - } - if (serializedParams) { - var hashmarkIndex = url.indexOf("#"); - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams; - } - return url; - }; -}); - -// node_modules/axios/lib/core/InterceptorManager.js -var require_InterceptorManager = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - function InterceptorManager() { - this.handlers = []; - } - InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled, - rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; - }; - InterceptorManager.prototype.eject = function eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } - }; - InterceptorManager.prototype.forEach = function forEach(fn) { - utils.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); - }; - module2.exports = InterceptorManager; -}); - -// node_modules/axios/lib/helpers/normalizeHeaderName.js -var require_normalizeHeaderName = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - module2.exports = function normalizeHeaderName(headers, normalizedName) { - utils.forEach(headers, function processHeader(value, name) { - if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { - headers[normalizedName] = value; - delete headers[name]; - } - }); - }; -}); - -// node_modules/axios/lib/core/enhanceError.js -var require_enhanceError = __commonJS((exports2, module2) => { - "use strict"; - module2.exports = function enhanceError(error, config, code, request, response) { - error.config = config; - if (code) { - error.code = code; - } - error.request = request; - error.response = response; - error.isAxiosError = true; - error.toJSON = function toJSON() { - return { - message: this.message, - name: this.name, - description: this.description, - number: this.number, - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - config: this.config, - code: this.code - }; - }; - return error; - }; -}); - -// node_modules/axios/lib/core/createError.js -var require_createError = __commonJS((exports2, module2) => { - "use strict"; - var enhanceError = require_enhanceError(); - module2.exports = function createError(message, config, code, request, response) { - var error = new Error(message); - return enhanceError(error, config, code, request, response); - }; -}); - -// node_modules/axios/lib/core/settle.js -var require_settle = __commonJS((exports2, module2) => { - "use strict"; - var createError = require_createError(); - module2.exports = function settle(resolve, reject, response) { - var validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(createError("Request failed with status code " + response.status, response.config, null, response.request, response)); - } - }; -}); - -// node_modules/axios/lib/helpers/cookies.js -var require_cookies = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - module2.exports = utils.isStandardBrowserEnv() ? function standardBrowserEnv() { - return { - write: function write(name, value, expires, path, domain, secure) { - var cookie = []; - cookie.push(name + "=" + encodeURIComponent(value)); - if (utils.isNumber(expires)) { - cookie.push("expires=" + new Date(expires).toGMTString()); - } - if (utils.isString(path)) { - cookie.push("path=" + path); - } - if (utils.isString(domain)) { - cookie.push("domain=" + domain); - } - if (secure === true) { - cookie.push("secure"); - } - document.cookie = cookie.join("; "); - }, - read: function read(name) { - var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)")); - return match ? decodeURIComponent(match[3]) : null; - }, - remove: function remove(name) { - this.write(name, "", Date.now() - 864e5); - } - }; - }() : function nonStandardBrowserEnv() { - return { - write: function write() { - }, - read: function read() { - return null; - }, - remove: function remove() { - } - }; - }(); -}); - -// node_modules/axios/lib/helpers/isAbsoluteURL.js -var require_isAbsoluteURL = __commonJS((exports2, module2) => { - "use strict"; - module2.exports = function isAbsoluteURL(url) { - return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); - }; -}); - -// node_modules/axios/lib/helpers/combineURLs.js -var require_combineURLs = __commonJS((exports2, module2) => { - "use strict"; - module2.exports = function combineURLs(baseURL, relativeURL) { - return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; - }; -}); - -// node_modules/axios/lib/core/buildFullPath.js -var require_buildFullPath = __commonJS((exports2, module2) => { - "use strict"; - var isAbsoluteURL = require_isAbsoluteURL(); - var combineURLs = require_combineURLs(); - module2.exports = function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; - }; -}); - -// node_modules/axios/lib/helpers/parseHeaders.js -var require_parseHeaders = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - var ignoreDuplicateOf = [ - "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" - ]; - module2.exports = function parseHeaders(headers) { - var parsed = {}; - var key; - var val; - var i; - if (!headers) { - return parsed; - } - utils.forEach(headers.split("\n"), function parser(line) { - i = line.indexOf(":"); - key = utils.trim(line.substr(0, i)).toLowerCase(); - val = utils.trim(line.substr(i + 1)); - if (key) { - if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { - return; - } - if (key === "set-cookie") { - parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); - } else { - parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; - } - } - }); - return parsed; - }; -}); - -// node_modules/axios/lib/helpers/isURLSameOrigin.js -var require_isURLSameOrigin = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - module2.exports = utils.isStandardBrowserEnv() ? function standardBrowserEnv() { - var msie = /(msie|trident)/i.test(navigator.userAgent); - var urlParsingNode = document.createElement("a"); - var originURL; - function resolveURL(url) { - var href = url; - if (msie) { - urlParsingNode.setAttribute("href", href); - href = urlParsingNode.href; - } - urlParsingNode.setAttribute("href", href); - 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); - return function isURLSameOrigin(requestURL) { - var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL; - return parsed.protocol === originURL.protocol && parsed.host === originURL.host; - }; - }() : function nonStandardBrowserEnv() { - return function isURLSameOrigin() { - return true; - }; - }(); -}); - -// node_modules/axios/lib/adapters/xhr.js -var require_xhr = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - var settle = require_settle(); - var cookies = require_cookies(); - var buildURL = require_buildURL(); - var buildFullPath = require_buildFullPath(); - var parseHeaders = require_parseHeaders(); - var isURLSameOrigin = require_isURLSameOrigin(); - var createError = require_createError(); - module2.exports = function xhrAdapter(config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - var requestData = config.data; - var requestHeaders = config.headers; - var responseType = config.responseType; - if (utils.isFormData(requestData)) { - delete requestHeaders["Content-Type"]; - } - var request = new XMLHttpRequest(); - if (config.auth) { - var username = config.auth.username || ""; - var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ""; - requestHeaders.Authorization = "Basic " + btoa(username + ":" + password); - } - var fullPath = buildFullPath(config.baseURL, config.url); - request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); - request.timeout = config.timeout; - function onloadend() { - if (!request) { - return; - } - var responseHeaders = "getAllResponseHeaders" in request ? parseHeaders(request.getAllResponseHeaders()) : null; - var responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config, - request - }; - settle(resolve, reject, response); - request = null; - } - if ("onloadend" in request) { - request.onloadend = onloadend; - } else { - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { - return; - } - setTimeout(onloadend); - }; - } - request.onabort = function handleAbort() { - if (!request) { - return; - } - reject(createError("Request aborted", config, "ECONNABORTED", request)); - request = null; - }; - request.onerror = function handleError() { - reject(createError("Network Error", config, null, request)); - request = null; - }; - request.ontimeout = function handleTimeout() { - var timeoutErrorMessage = "timeout of " + config.timeout + "ms exceeded"; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - reject(createError(timeoutErrorMessage, config, config.transitional && config.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", request)); - request = null; - }; - if (utils.isStandardBrowserEnv()) { - var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : void 0; - if (xsrfValue) { - requestHeaders[config.xsrfHeaderName] = xsrfValue; - } - } - if ("setRequestHeader" in request) { - utils.forEach(requestHeaders, function setRequestHeader(val, key) { - if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") { - delete requestHeaders[key]; - } else { - request.setRequestHeader(key, val); - } - }); - } - if (!utils.isUndefined(config.withCredentials)) { - request.withCredentials = !!config.withCredentials; - } - if (responseType && responseType !== "json") { - request.responseType = config.responseType; - } - if (typeof config.onDownloadProgress === "function") { - request.addEventListener("progress", config.onDownloadProgress); - } - if (typeof config.onUploadProgress === "function" && request.upload) { - request.upload.addEventListener("progress", config.onUploadProgress); - } - if (config.cancelToken) { - config.cancelToken.promise.then(function onCanceled(cancel) { - if (!request) { - return; - } - request.abort(); - reject(cancel); - request = null; - }); - } - if (!requestData) { - requestData = null; - } - request.send(requestData); - }); - }; -}); - -// node_modules/ms/index.js -var require_ms = __commonJS((exports2, module2) => { - var s = 1e3; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - module2.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === "string" && val.length > 0) { - return parse(val); - } else if (type === "number" && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val)); - }; - function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || "ms").toLowerCase(); - switch (type) { - case "years": - case "year": - case "yrs": - case "yr": - case "y": - return n * y; - case "weeks": - case "week": - case "w": - return n * w; - case "days": - case "day": - case "d": - return n * d; - case "hours": - case "hour": - case "hrs": - case "hr": - case "h": - return n * h; - case "minutes": - case "minute": - case "mins": - case "min": - case "m": - return n * m; - case "seconds": - case "second": - case "secs": - case "sec": - case "s": - return n * s; - case "milliseconds": - case "millisecond": - case "msecs": - case "msec": - case "ms": - return n; - default: - return void 0; - } - } - function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + "d"; - } - if (msAbs >= h) { - return Math.round(ms / h) + "h"; - } - if (msAbs >= m) { - return Math.round(ms / m) + "m"; - } - if (msAbs >= s) { - return Math.round(ms / s) + "s"; - } - return ms + "ms"; - } - function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, "day"); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, "hour"); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, "minute"); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, "second"); - } - return ms + " ms"; - } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); - } -}); - -// node_modules/debug/src/common.js -var require_common = __commonJS((exports2, module2) => { - function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require_ms(); - createDebug.destroy = destroy; - Object.keys(env).forEach((key) => { - createDebug[key] = env[key]; - }); - createDebug.names = []; - createDebug.skips = []; - createDebug.formatters = {}; - function selectColor(namespace) { - let hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; - } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug(...args) { - if (!debug.enabled) { - return; - } - const self = debug; - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - if (typeof args[0] !== "string") { - args.unshift("%O"); - } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val = args[index]; - match = formatter.call(self, val); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self, args); - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; - Object.defineProperty(debug, "enabled", { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - return enabledCache; - }, - set: (v) => { - enableOverride = v; - } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug); - } - return debug; - } - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - createDebug.names = []; - createDebug.skips = []; - let i; - const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); - const len = split.length; - for (i = 0; i < len; i++) { - if (!split[i]) { - continue; - } - namespaces = split[i].replace(/\*/g, ".*?"); - if (namespaces[0] === "-") { - createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$")); - } else { - createDebug.names.push(new RegExp("^" + namespaces + "$")); - } - } - } - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace) - ].join(","); - createDebug.enable(""); - return namespaces; - } - function enabled(name) { - if (name[name.length - 1] === "*") { - return true; - } - let i; - let len; - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - return false; - } - function toNamespace(regexp) { - return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*"); - } - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - function destroy() { - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - createDebug.enable(createDebug.load()); - return createDebug; - } - module2.exports = setup; -}); - -// node_modules/debug/src/browser.js -var require_browser = __commonJS((exports2, module2) => { - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load; - exports2.useColors = useColors; - exports2.storage = localstorage(); - exports2.destroy = (() => { - let warned = false; - return () => { - if (!warned) { - warned = true; - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - }; - })(); - exports2.colors = [ - "#0000CC", - "#0000FF", - "#0033CC", - "#0033FF", - "#0066CC", - "#0066FF", - "#0099CC", - "#0099FF", - "#00CC00", - "#00CC33", - "#00CC66", - "#00CC99", - "#00CCCC", - "#00CCFF", - "#3300CC", - "#3300FF", - "#3333CC", - "#3333FF", - "#3366CC", - "#3366FF", - "#3399CC", - "#3399FF", - "#33CC00", - "#33CC33", - "#33CC66", - "#33CC99", - "#33CCCC", - "#33CCFF", - "#6600CC", - "#6600FF", - "#6633CC", - "#6633FF", - "#66CC00", - "#66CC33", - "#9900CC", - "#9900FF", - "#9933CC", - "#9933FF", - "#99CC00", - "#99CC33", - "#CC0000", - "#CC0033", - "#CC0066", - "#CC0099", - "#CC00CC", - "#CC00FF", - "#CC3300", - "#CC3333", - "#CC3366", - "#CC3399", - "#CC33CC", - "#CC33FF", - "#CC6600", - "#CC6633", - "#CC9900", - "#CC9933", - "#CCCC00", - "#CCCC33", - "#FF0000", - "#FF0033", - "#FF0066", - "#FF0099", - "#FF00CC", - "#FF00FF", - "#FF3300", - "#FF3333", - "#FF3366", - "#FF3399", - "#FF33CC", - "#FF33FF", - "#FF6600", - "#FF6633", - "#FF9900", - "#FF9933", - "#FFCC00", - "#FFCC33" - ]; - function useColors() { - if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { - return true; - } - if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - function formatArgs(args) { - args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); - if (!this.useColors) { - return; - } - const c = "color: " + this.color; - args.splice(1, 0, c, "color: inherit"); - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c); - } - exports2.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error) { - } - } - function load() { - let r; - try { - r = exports2.storage.getItem("debug"); - } catch (error) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; - } - return r; - } - function localstorage() { - try { - return localStorage; - } catch (error) { - } - } - module2.exports = require_common()(exports2); - var {formatters} = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error) { - return "[UnexpectedJSONParseError]: " + error.message; - } - }; -}); - -// node_modules/follow-redirects/debug.js -var require_debug = __commonJS((exports2, module2) => { - var debug; - module2.exports = function() { - if (!debug) { - try { - debug = require_browser()("follow-redirects"); - } catch (error) { - } - if (typeof debug !== "function") { - debug = function() { - }; - } - } - debug.apply(null, arguments); - }; -}); - -// node_modules/follow-redirects/index.js -var require_follow_redirects = __commonJS((exports2, module2) => { - var url = require("url"); - var URL = url.URL; - var http = require("http"); - var https = require("https"); - var Writable = require("stream").Writable; - var assert = require("assert"); - var debug = require_debug(); - var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; - var eventHandlers = Object.create(null); - events.forEach(function(event) { - eventHandlers[event] = function(arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; - }); - var InvalidUrlError = createErrorType("ERR_INVALID_URL", "Invalid URL", TypeError); - var RedirectionError = createErrorType("ERR_FR_REDIRECTION_FAILURE", "Redirected request failed"); - var TooManyRedirectsError = createErrorType("ERR_FR_TOO_MANY_REDIRECTS", "Maximum number of redirects exceeded"); - var MaxBodyLengthExceededError = createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED", "Request body larger than maxBodyLength limit"); - var WriteAfterEndError = createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); - function RedirectableRequest(options, responseCallback) { - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; - if (responseCallback) { - this.on("response", responseCallback); - } - var self = this; - this._onNativeResponse = function(response) { - self._processResponse(response); - }; - this._performRequest(); - } - RedirectableRequest.prototype = Object.create(Writable.prototype); - RedirectableRequest.prototype.abort = function() { - abortRequest(this._currentRequest); - this.emit("abort"); - }; - RedirectableRequest.prototype.write = function(data, encoding, callback) { - if (this._ending) { - throw new WriteAfterEndError(); - } - if (!isString(data) && !isBuffer(data)) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - if (data.length === 0) { - if (callback) { - callback(); - } - return; - } - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({data, encoding}); - this._currentRequest.write(data, encoding, callback); - } else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } - }; - RedirectableRequest.prototype.end = function(data, encoding, callback) { - if (isFunction(data)) { - callback = data; - data = encoding = null; - } else if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } else { - var self = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function() { - self._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } - }; - RedirectableRequest.prototype.setHeader = function(name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); - }; - RedirectableRequest.prototype.removeHeader = function(name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); - }; - RedirectableRequest.prototype.setTimeout = function(msecs, callback) { - var self = this; - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); - } - function startTimer(socket) { - if (self._timeout) { - clearTimeout(self._timeout); - } - self._timeout = setTimeout(function() { - self.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); - } - function clearTimer() { - if (self._timeout) { - clearTimeout(self._timeout); - self._timeout = null; - } - self.removeListener("abort", clearTimer); - self.removeListener("error", clearTimer); - self.removeListener("response", clearTimer); - if (callback) { - self.removeListener("timeout", callback); - } - if (!self.socket) { - self._currentRequest.removeListener("socket", startTimer); - } - } - if (callback) { - this.on("timeout", callback); - } - if (this.socket) { - startTimer(this.socket); - } else { - this._currentRequest.once("socket", startTimer); - } - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); - return this; - }; - [ - "flushHeaders", - "getHeader", - "setNoDelay", - "setSocketKeepAlive" - ].forEach(function(method) { - RedirectableRequest.prototype[method] = function(a, b) { - return this._currentRequest[method](a, b); - }; - }); - ["aborted", "connection", "socket"].forEach(function(property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function() { - return this._currentRequest[property]; - } - }); - }); - RedirectableRequest.prototype._sanitizeOptions = function(options) { - if (!options.headers) { - options.headers = {}; - } - if (options.host) { - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } - }; - RedirectableRequest.prototype._performRequest = function() { - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - this.emit("error", new TypeError("Unsupported protocol " + protocol)); - return; - } - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; - } - var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); - } - this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : this._options.path; - if (this._isRedirect) { - var i = 0; - var self = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - if (request === self._currentRequest) { - if (error) { - self.emit("error", error); - } else if (i < buffers.length) { - var buffer = buffers[i++]; - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } else if (self._ended) { - request.end(); - } - } - })(); - } - }; - RedirectableRequest.prototype._processResponse = function(response) { - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode - }); - } - var location = response.headers.location; - if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); - this._requestBodyBuffers = []; - return; - } - abortRequest(this._currentRequest); - response.destroy(); - if (++this._redirectCount > this._options.maxRedirects) { - this.emit("error", new TooManyRedirectsError()); - return; - } - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - Host: response.req.getHeader("host") - }, this._options.headers); - } - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); - var currentUrlParts = url.parse(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, {host: currentHost})); - var redirectUrl; - try { - redirectUrl = url.resolve(currentUrl, location); - } catch (cause) { - this.emit("error", new RedirectionError({cause})); - return; - } - debug("redirecting to", redirectUrl); - this._isRedirect = true; - var redirectUrlParts = url.parse(redirectUrl); - Object.assign(this._options, redirectUrlParts); - if (redirectUrlParts.protocol !== currentUrlParts.protocol && redirectUrlParts.protocol !== "https:" || redirectUrlParts.host !== currentHost && !isSubdomain(redirectUrlParts.host, currentHost)) { - removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); - } - if (isFunction(beforeRedirect)) { - var responseDetails = { - headers: response.headers, - statusCode - }; - var requestDetails = { - url: currentUrl, - method, - headers: requestHeaders - }; - try { - beforeRedirect(this._options, responseDetails, requestDetails); - } catch (err) { - this.emit("error", err); - return; - } - this._sanitizeOptions(this._options); - } - try { - this._performRequest(); - } catch (cause) { - this.emit("error", new RedirectionError({cause})); - } - }; - function wrap(protocols) { - var exports3 = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024 - }; - var nativeProtocols = {}; - Object.keys(protocols).forEach(function(scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports3[scheme] = Object.create(nativeProtocol); - function request(input, options, callback) { - if (isString(input)) { - var parsed; - try { - parsed = urlToOptions(new URL(input)); - } catch (err) { - parsed = url.parse(input); - } - if (!isString(parsed.protocol)) { - throw new InvalidUrlError({input}); - } - input = parsed; - } else if (URL && input instanceof URL) { - input = urlToOptions(input); - } else { - callback = options; - options = input; - input = {protocol}; - } - if (isFunction(options)) { - callback = options; - options = null; - } - options = Object.assign({ - maxRedirects: exports3.maxRedirects, - maxBodyLength: exports3.maxBodyLength - }, input, options); - options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { - options.hostname = "::1"; - } - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); - } - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } - Object.defineProperties(wrappedProtocol, { - request: {value: request, configurable: true, enumerable: true, writable: true}, - get: {value: get, configurable: true, enumerable: true, writable: true} - }); - }); - return exports3; - } - function noop() { - } - function urlToOptions(urlObject) { - var options = { - protocol: urlObject.protocol, - hostname: urlObject.hostname.startsWith("[") ? urlObject.hostname.slice(1, -1) : urlObject.hostname, - hash: urlObject.hash, - search: urlObject.search, - pathname: urlObject.pathname, - path: urlObject.pathname + urlObject.search, - href: urlObject.href - }; - if (urlObject.port !== "") { - options.port = Number(urlObject.port); - } - return options; - } - function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } - } - return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim(); - } - function createErrorType(code, message, baseClass) { - function CustomError(properties) { - Error.captureStackTrace(this, this.constructor); - Object.assign(this, properties || {}); - this.code = code; - this.message = this.cause ? message + ": " + this.cause.message : message; - } - CustomError.prototype = new (baseClass || Error)(); - CustomError.prototype.constructor = CustomError; - CustomError.prototype.name = "Error [" + code + "]"; - return CustomError; - } - function abortRequest(request) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop); - request.abort(); - } - function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); - var dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); - } - function isString(value) { - return typeof value === "string" || value instanceof String; - } - function isFunction(value) { - return typeof value === "function"; - } - function isBuffer(value) { - return typeof value === "object" && "length" in value; - } - module2.exports = wrap({http, https}); - module2.exports.wrap = wrap; -}); - -// node_modules/axios/package.json -var require_package = __commonJS((exports2, module2) => { - module2.exports = { - name: "axios", - version: "0.21.4", - description: "Promise based HTTP client for the browser and node.js", - main: "index.js", - scripts: { - test: "grunt test", - start: "node ./sandbox/server.js", - build: "NODE_ENV=production grunt build", - preversion: "npm test", - version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json", - postversion: "git push && git push --tags", - examples: "node ./examples/server.js", - coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", - fix: "eslint --fix lib/**/*.js" - }, - repository: { - type: "git", - url: "https://github.com/axios/axios.git" - }, - keywords: [ - "xhr", - "http", - "ajax", - "promise", - "node" - ], - author: "Matt Zabriskie", - license: "MIT", - bugs: { - url: "https://github.com/axios/axios/issues" - }, - homepage: "https://axios-http.com", - devDependencies: { - coveralls: "^3.0.0", - "es6-promise": "^4.2.4", - grunt: "^1.3.0", - "grunt-banner": "^0.6.0", - "grunt-cli": "^1.2.0", - "grunt-contrib-clean": "^1.1.0", - "grunt-contrib-watch": "^1.0.0", - "grunt-eslint": "^23.0.0", - "grunt-karma": "^4.0.0", - "grunt-mocha-test": "^0.13.3", - "grunt-ts": "^6.0.0-beta.19", - "grunt-webpack": "^4.0.2", - "istanbul-instrumenter-loader": "^1.0.0", - "jasmine-core": "^2.4.1", - karma: "^6.3.2", - "karma-chrome-launcher": "^3.1.0", - "karma-firefox-launcher": "^2.1.0", - "karma-jasmine": "^1.1.1", - "karma-jasmine-ajax": "^0.1.13", - "karma-safari-launcher": "^1.0.0", - "karma-sauce-launcher": "^4.3.6", - "karma-sinon": "^1.0.5", - "karma-sourcemap-loader": "^0.3.8", - "karma-webpack": "^4.0.2", - "load-grunt-tasks": "^3.5.2", - minimist: "^1.2.0", - mocha: "^8.2.1", - sinon: "^4.5.0", - "terser-webpack-plugin": "^4.2.3", - typescript: "^4.0.5", - "url-search-params": "^0.10.0", - webpack: "^4.44.2", - "webpack-dev-server": "^3.11.0" - }, - browser: { - "./lib/adapters/http.js": "./lib/adapters/xhr.js" - }, - jsdelivr: "dist/axios.min.js", - unpkg: "dist/axios.min.js", - typings: "./index.d.ts", - dependencies: { - "follow-redirects": "^1.14.0" - }, - bundlesize: [ - { - path: "./dist/axios.min.js", - threshold: "5kB" - } - ] - }; -}); - -// node_modules/axios/lib/adapters/http.js -var require_http = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - var settle = require_settle(); - var buildFullPath = require_buildFullPath(); - var buildURL = require_buildURL(); - var http = require("http"); - var https = require("https"); - var httpFollow = require_follow_redirects().http; - var httpsFollow = require_follow_redirects().https; - var url = require("url"); - var zlib = require("zlib"); - var pkg = require_package(); - var createError = require_createError(); - var enhanceError = require_enhanceError(); - var isHttps = /https:?/; - function setProxy(options, proxy, location) { - options.hostname = proxy.host; - options.host = proxy.host; - options.port = proxy.port; - options.path = location; - if (proxy.auth) { - var base64 = Buffer.from(proxy.auth.username + ":" + proxy.auth.password, "utf8").toString("base64"); - options.headers["Proxy-Authorization"] = "Basic " + base64; - } - options.beforeRedirect = function beforeRedirect(redirection) { - redirection.headers.host = redirection.host; - setProxy(redirection, proxy, redirection.href); - }; - } - module2.exports = function httpAdapter(config) { - return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { - var resolve = function resolve2(value) { - resolvePromise(value); - }; - var reject = function reject2(value) { - rejectPromise(value); - }; - var data = config.data; - var headers = config.headers; - if ("User-Agent" in headers || "user-agent" in headers) { - if (!headers["User-Agent"] && !headers["user-agent"]) { - delete headers["User-Agent"]; - delete headers["user-agent"]; - } - } else { - headers["User-Agent"] = "axios/" + pkg.version; - } - if (data && !utils.isStream(data)) { - if (Buffer.isBuffer(data)) { - } else if (utils.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils.isString(data)) { - data = Buffer.from(data, "utf-8"); - } else { - return reject(createError("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", config)); - } - headers["Content-Length"] = data.length; - } - var auth = void 0; - if (config.auth) { - var username = config.auth.username || ""; - var password = config.auth.password || ""; - auth = username + ":" + password; - } - var fullPath = buildFullPath(config.baseURL, config.url); - var parsed = url.parse(fullPath); - var protocol = parsed.protocol || "http:"; - if (!auth && parsed.auth) { - var urlAuth = parsed.auth.split(":"); - var urlUsername = urlAuth[0] || ""; - var urlPassword = urlAuth[1] || ""; - auth = urlUsername + ":" + urlPassword; - } - if (auth) { - delete headers.Authorization; - } - var isHttpsRequest = isHttps.test(protocol); - var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; - var options = { - path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ""), - method: config.method.toUpperCase(), - headers, - agent, - agents: {http: config.httpAgent, https: config.httpsAgent}, - auth - }; - if (config.socketPath) { - options.socketPath = config.socketPath; - } else { - options.hostname = parsed.hostname; - options.port = parsed.port; - } - var proxy = config.proxy; - if (!proxy && proxy !== false) { - var proxyEnv = protocol.slice(0, -1) + "_proxy"; - var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; - if (proxyUrl) { - var parsedProxyUrl = url.parse(proxyUrl); - var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; - var shouldProxy = true; - if (noProxyEnv) { - var noProxy = noProxyEnv.split(",").map(function trim(s) { - return s.trim(); - }); - shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { - if (!proxyElement) { - return false; - } - if (proxyElement === "*") { - return true; - } - if (proxyElement[0] === "." && parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { - return true; - } - return parsed.hostname === proxyElement; - }); - } - if (shouldProxy) { - proxy = { - host: parsedProxyUrl.hostname, - port: parsedProxyUrl.port, - protocol: parsedProxyUrl.protocol - }; - if (parsedProxyUrl.auth) { - var proxyUrlAuth = parsedProxyUrl.auth.split(":"); - proxy.auth = { - username: proxyUrlAuth[0], - password: proxyUrlAuth[1] - }; - } - } - } - } - if (proxy) { - options.headers.host = parsed.hostname + (parsed.port ? ":" + parsed.port : ""); - setProxy(options, proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path); - } - var transport; - var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); - if (config.transport) { - transport = config.transport; - } else if (config.maxRedirects === 0) { - transport = isHttpsProxy ? https : http; - } else { - if (config.maxRedirects) { - options.maxRedirects = config.maxRedirects; - } - transport = isHttpsProxy ? httpsFollow : httpFollow; - } - if (config.maxBodyLength > -1) { - options.maxBodyLength = config.maxBodyLength; - } - var req = transport.request(options, function handleResponse(res) { - if (req.aborted) - return; - var stream = res; - var lastRequest = res.req || req; - if (res.statusCode !== 204 && lastRequest.method !== "HEAD" && config.decompress !== false) { - switch (res.headers["content-encoding"]) { - case "gzip": - case "compress": - case "deflate": - stream = stream.pipe(zlib.createUnzip()); - delete res.headers["content-encoding"]; - break; - } - } - var response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: res.headers, - config, - request: lastRequest - }; - if (config.responseType === "stream") { - response.data = stream; - settle(resolve, reject, response); - } else { - var responseBuffer = []; - var totalResponseBytes = 0; - stream.on("data", function handleStreamData(chunk) { - responseBuffer.push(chunk); - totalResponseBytes += chunk.length; - if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { - stream.destroy(); - reject(createError("maxContentLength size of " + config.maxContentLength + " exceeded", config, null, lastRequest)); - } - }); - stream.on("error", function handleStreamError(err) { - if (req.aborted) - return; - reject(enhanceError(err, config, null, lastRequest)); - }); - stream.on("end", function handleStreamEnd() { - var responseData = Buffer.concat(responseBuffer); - if (config.responseType !== "arraybuffer") { - responseData = responseData.toString(config.responseEncoding); - if (!config.responseEncoding || config.responseEncoding === "utf8") { - responseData = utils.stripBOM(responseData); - } - } - response.data = responseData; - settle(resolve, reject, response); - }); - } - }); - req.on("error", function handleRequestError(err) { - if (req.aborted && err.code !== "ERR_FR_TOO_MANY_REDIRECTS") - return; - reject(enhanceError(err, config, null, req)); - }); - if (config.timeout) { - var timeout = parseInt(config.timeout, 10); - if (isNaN(timeout)) { - reject(createError("error trying to parse `config.timeout` to int", config, "ERR_PARSE_TIMEOUT", req)); - return; - } - req.setTimeout(timeout, function handleRequestTimeout() { - req.abort(); - reject(createError("timeout of " + timeout + "ms exceeded", config, config.transitional && config.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", req)); - }); - } - if (config.cancelToken) { - config.cancelToken.promise.then(function onCanceled(cancel) { - if (req.aborted) - return; - req.abort(); - reject(cancel); - }); - } - if (utils.isStream(data)) { - data.on("error", function handleStreamError(err) { - reject(enhanceError(err, config, null, req)); - }).pipe(req); - } else { - req.end(data); - } - }); - }; -}); - -// node_modules/axios/lib/defaults.js -var require_defaults = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - var normalizeHeaderName = require_normalizeHeaderName(); - var enhanceError = require_enhanceError(); - var DEFAULT_CONTENT_TYPE = { - "Content-Type": "application/x-www-form-urlencoded" - }; - function setContentTypeIfUnset(headers, value) { - if (!utils.isUndefined(headers) && utils.isUndefined(headers["Content-Type"])) { - headers["Content-Type"] = value; - } - } - function getDefaultAdapter() { - var adapter; - if (typeof XMLHttpRequest !== "undefined") { - adapter = require_xhr(); - } else if (typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]") { - adapter = require_http(); - } - return adapter; - } - function stringifySafely(rawValue, parser, encoder) { - if (utils.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils.trim(rawValue); - } catch (e) { - if (e.name !== "SyntaxError") { - throw e; - } - } - } - return (encoder || JSON.stringify)(rawValue); - } - var defaults = { - transitional: { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false - }, - adapter: getDefaultAdapter(), - transformRequest: [function transformRequest(data, headers) { - normalizeHeaderName(headers, "Accept"); - normalizeHeaderName(headers, "Content-Type"); - if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8"); - return data.toString(); - } - if (utils.isObject(data) || headers && headers["Content-Type"] === "application/json") { - setContentTypeIfUnset(headers, "application/json"); - return stringifySafely(data); - } - return data; - }], - transformResponse: [function transformResponse(data) { - var transitional = this.transitional; - var silentJSONParsing = transitional && transitional.silentJSONParsing; - var forcedJSONParsing = transitional && transitional.forcedJSONParsing; - var strictJSONParsing = !silentJSONParsing && this.responseType === "json"; - if (strictJSONParsing || forcedJSONParsing && utils.isString(data) && data.length) { - try { - return JSON.parse(data); - } catch (e) { - if (strictJSONParsing) { - if (e.name === "SyntaxError") { - throw enhanceError(e, this, "E_JSON_PARSE"); - } - throw e; - } - } - } - return data; - }], - timeout: 0, - xsrfCookieName: "XSRF-TOKEN", - xsrfHeaderName: "X-XSRF-TOKEN", - maxContentLength: -1, - maxBodyLength: -1, - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - } - }; - defaults.headers = { - common: { - Accept: "application/json, text/plain, */*" - } - }; - utils.forEach(["delete", "get", "head"], function forEachMethodNoData(method) { - defaults.headers[method] = {}; - }); - utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { - defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); - }); - module2.exports = defaults; -}); - -// node_modules/axios/lib/core/transformData.js -var require_transformData = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - var defaults = require_defaults(); - module2.exports = function transformData(data, headers, fns) { - var context = this || defaults; - utils.forEach(fns, function transform(fn) { - data = fn.call(context, data, headers); - }); - return data; - }; -}); - -// node_modules/axios/lib/cancel/isCancel.js -var require_isCancel = __commonJS((exports2, module2) => { - "use strict"; - module2.exports = function isCancel(value) { - return !!(value && value.__CANCEL__); - }; -}); - -// node_modules/axios/lib/core/dispatchRequest.js -var require_dispatchRequest = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - var transformData = require_transformData(); - var isCancel = require_isCancel(); - var defaults = require_defaults(); - function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } - } - module2.exports = function dispatchRequest(config) { - throwIfCancellationRequested(config); - config.headers = config.headers || {}; - config.data = transformData.call(config, config.data, config.headers, config.transformRequest); - config.headers = utils.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers); - utils.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function cleanHeaderConfig(method) { - delete config.headers[method]; - }); - var adapter = config.adapter || defaults.adapter; - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - response.data = transformData.call(config, response.data, response.headers, config.transformResponse); - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - if (reason && reason.response) { - reason.response.data = transformData.call(config, reason.response.data, reason.response.headers, config.transformResponse); - } - } - return Promise.reject(reason); - }); - }; -}); - -// node_modules/axios/lib/core/mergeConfig.js -var require_mergeConfig = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - module2.exports = function mergeConfig(config1, config2) { - config2 = config2 || {}; - var config = {}; - var valueFromConfig2Keys = ["url", "method", "data"]; - var mergeDeepPropertiesKeys = ["headers", "auth", "proxy", "params"]; - var defaultToConfig2Keys = [ - "baseURL", - "transformRequest", - "transformResponse", - "paramsSerializer", - "timeout", - "timeoutMessage", - "withCredentials", - "adapter", - "responseType", - "xsrfCookieName", - "xsrfHeaderName", - "onUploadProgress", - "onDownloadProgress", - "decompress", - "maxContentLength", - "maxBodyLength", - "maxRedirects", - "transport", - "httpAgent", - "httpsAgent", - "cancelToken", - "socketPath", - "responseEncoding" - ]; - var directMergeKeys = ["validateStatus"]; - function getMergedValue(target, source) { - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { - return utils.merge(target, source); - } else if (utils.isPlainObject(source)) { - return utils.merge({}, source); - } else if (utils.isArray(source)) { - return source.slice(); - } - return source; - } - function mergeDeepProperties(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(void 0, config1[prop]); - } - } - utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(void 0, config2[prop]); - } - }); - utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); - utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(void 0, config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(void 0, config1[prop]); - } - }); - utils.forEach(directMergeKeys, function merge(prop) { - if (prop in config2) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (prop in config1) { - config[prop] = getMergedValue(void 0, config1[prop]); - } - }); - var axiosKeys = valueFromConfig2Keys.concat(mergeDeepPropertiesKeys).concat(defaultToConfig2Keys).concat(directMergeKeys); - var otherKeys = Object.keys(config1).concat(Object.keys(config2)).filter(function filterAxiosKeys(key) { - return axiosKeys.indexOf(key) === -1; - }); - utils.forEach(otherKeys, mergeDeepProperties); - return config; - }; -}); - -// node_modules/axios/lib/helpers/validator.js -var require_validator = __commonJS((exports2, module2) => { - "use strict"; - var pkg = require_package(); - var validators = {}; - ["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i) { - validators[type] = function validator(thing) { - return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type; - }; - }); - var deprecatedWarnings = {}; - var currentVerArr = pkg.version.split("."); - function isOlderVersion(version, thanVersion) { - var pkgVersionArr = thanVersion ? thanVersion.split(".") : currentVerArr; - var destVer = version.split("."); - for (var i = 0; i < 3; i++) { - if (pkgVersionArr[i] > destVer[i]) { - return true; - } else if (pkgVersionArr[i] < destVer[i]) { - return false; - } - } - return false; - } - validators.transitional = function transitional(validator, version, message) { - var isDeprecated = version && isOlderVersion(version); - function formatMessage(opt, desc) { - return "[Axios v" + pkg.version + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : ""); - } - return function(value, opt, opts) { - if (validator === false) { - throw new Error(formatMessage(opt, " has been removed in " + version)); - } - if (isDeprecated && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - 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; - }; - }; - function assertOptions(options, schema, allowUnknown) { - if (typeof options !== "object") { - throw new TypeError("options must be an object"); - } - var keys = Object.keys(options); - var i = keys.length; - while (i-- > 0) { - var opt = keys[i]; - var validator = schema[opt]; - if (validator) { - var value = options[opt]; - var result = value === void 0 || validator(value, opt, options); - if (result !== true) { - throw new TypeError("option " + opt + " must be " + result); - } - continue; - } - if (allowUnknown !== true) { - throw Error("Unknown option " + opt); - } - } - } - module2.exports = { - isOlderVersion, - assertOptions, - validators - }; -}); - -// node_modules/axios/lib/core/Axios.js -var require_Axios = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - var buildURL = require_buildURL(); - var InterceptorManager = require_InterceptorManager(); - var dispatchRequest = require_dispatchRequest(); - var mergeConfig = require_mergeConfig(); - var validator = require_validator(); - var validators = validator.validators; - function Axios(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; - } - Axios.prototype.request = function request(config) { - if (typeof config === "string") { - config = arguments[1] || {}; - config.url = arguments[0]; - } else { - config = config || {}; - } - config = mergeConfig(this.defaults, config); - if (config.method) { - config.method = config.method.toLowerCase(); - } else if (this.defaults.method) { - config.method = this.defaults.method.toLowerCase(); - } else { - config.method = "get"; - } - var transitional = config.transitional; - if (transitional !== void 0) { - validator.assertOptions(transitional, { - silentJSONParsing: validators.transitional(validators.boolean, "1.0.0"), - forcedJSONParsing: validators.transitional(validators.boolean, "1.0.0"), - clarifyTimeoutError: validators.transitional(validators.boolean, "1.0.0") - }, false); - } - var requestInterceptorChain = []; - var 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); - }); - var responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - var promise; - if (!synchronousRequestInterceptors) { - var chain = [dispatchRequest, void 0]; - Array.prototype.unshift.apply(chain, requestInterceptorChain); - chain = chain.concat(responseInterceptorChain); - promise = Promise.resolve(config); - while (chain.length) { - promise = promise.then(chain.shift(), chain.shift()); - } - return promise; - } - var newConfig = config; - while (requestInterceptorChain.length) { - var onFulfilled = requestInterceptorChain.shift(); - var onRejected = requestInterceptorChain.shift(); - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected(error); - break; - } - } - try { - promise = dispatchRequest(newConfig); - } catch (error) { - return Promise.reject(error); - } - while (responseInterceptorChain.length) { - promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); - } - return promise; - }; - Axios.prototype.getUri = function getUri(config) { - config = mergeConfig(this.defaults, config); - return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ""); - }; - utils.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) { - Axios.prototype[method] = function(url, config) { - return this.request(mergeConfig(config || {}, { - method, - url, - data: (config || {}).data - })); - }; - }); - utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { - Axios.prototype[method] = function(url, data, config) { - return this.request(mergeConfig(config || {}, { - method, - url, - data - })); - }; - }); - module2.exports = Axios; -}); - -// node_modules/axios/lib/cancel/Cancel.js -var require_Cancel = __commonJS((exports2, module2) => { - "use strict"; - function Cancel(message) { - this.message = message; - } - Cancel.prototype.toString = function toString() { - return "Cancel" + (this.message ? ": " + this.message : ""); - }; - Cancel.prototype.__CANCEL__ = true; - module2.exports = Cancel; -}); - -// node_modules/axios/lib/cancel/CancelToken.js -var require_CancelToken = __commonJS((exports2, module2) => { - "use strict"; - var Cancel = require_Cancel(); - function CancelToken(executor) { - if (typeof executor !== "function") { - throw new TypeError("executor must be a function."); - } - var resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - var token = this; - executor(function cancel(message) { - if (token.reason) { - return; - } - token.reason = new Cancel(message); - resolvePromise(token.reason); - }); - } - CancelToken.prototype.throwIfRequested = function throwIfRequested() { - if (this.reason) { - throw this.reason; - } - }; - CancelToken.source = function source() { - var cancel; - var token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token, - cancel - }; - }; - module2.exports = CancelToken; -}); - -// node_modules/axios/lib/helpers/spread.js -var require_spread = __commonJS((exports2, module2) => { - "use strict"; - module2.exports = function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; - }; -}); - -// node_modules/axios/lib/helpers/isAxiosError.js -var require_isAxiosError = __commonJS((exports2, module2) => { - "use strict"; - module2.exports = function isAxiosError(payload) { - return typeof payload === "object" && payload.isAxiosError === true; - }; -}); - -// node_modules/axios/lib/axios.js -var require_axios = __commonJS((exports2, module2) => { - "use strict"; - var utils = require_utils(); - var bind = require_bind(); - var Axios = require_Axios(); - var mergeConfig = require_mergeConfig(); - var defaults = require_defaults(); - function createInstance(defaultConfig) { - var context = new Axios(defaultConfig); - var instance = bind(Axios.prototype.request, context); - utils.extend(instance, Axios.prototype, context); - utils.extend(instance, context); - return instance; - } - var axios2 = createInstance(defaults); - axios2.Axios = Axios; - axios2.create = function create(instanceConfig) { - return createInstance(mergeConfig(axios2.defaults, instanceConfig)); - }; - axios2.Cancel = require_Cancel(); - axios2.CancelToken = require_CancelToken(); - axios2.isCancel = require_isCancel(); - axios2.all = function all(promises) { - return Promise.all(promises); - }; - axios2.spread = require_spread(); - axios2.isAxiosError = require_isAxiosError(); - module2.exports = axios2; - module2.exports.default = axios2; -}); - -// node_modules/axios/index.js -var require_axios2 = __commonJS((exports2, module2) => { - module2.exports = require_axios(); -}); - -// node_modules/object-path/index.js -var require_object_path = __commonJS((exports2, module2) => { - (function(root, factory) { - "use strict"; - if (typeof module2 === "object" && typeof module2.exports === "object") { - module2.exports = factory(); - } else if (typeof define === "function" && define.amd) { - define([], factory); - } else { - root.objectPath = factory(); - } - })(exports2, function() { - "use strict"; - var toStr = Object.prototype.toString; - function hasOwnProperty(obj, prop) { - if (obj == null) { - return false; - } - return Object.prototype.hasOwnProperty.call(obj, prop); - } - function isEmpty(value) { - if (!value) { - return true; - } - if (isArray(value) && value.length === 0) { - return true; - } else if (typeof value !== "string") { - for (var i in value) { - if (hasOwnProperty(value, i)) { - return false; - } - } - return true; - } - return false; - } - function toString(type) { - return toStr.call(type); - } - function isObject(obj) { - return typeof obj === "object" && toString(obj) === "[object Object]"; - } - var isArray = Array.isArray || function(obj) { - return toStr.call(obj) === "[object Array]"; - }; - function isBoolean(obj) { - return typeof obj === "boolean" || toString(obj) === "[object Boolean]"; - } - function getKey(key) { - var intKey = parseInt(key); - if (intKey.toString() === key) { - return intKey; - } - return key; - } - function factory(options) { - options = options || {}; - var objectPath2 = function(obj) { - return Object.keys(objectPath2).reduce(function(proxy, prop) { - if (prop === "create") { - return proxy; - } - if (typeof objectPath2[prop] === "function") { - proxy[prop] = objectPath2[prop].bind(objectPath2, obj); - } - return proxy; - }, {}); - }; - var hasShallowProperty; - if (options.includeInheritedProps) { - hasShallowProperty = function() { - return true; - }; - } else { - hasShallowProperty = function(obj, prop) { - return typeof prop === "number" && Array.isArray(obj) || hasOwnProperty(obj, prop); - }; - } - function getShallowProperty(obj, prop) { - if (hasShallowProperty(obj, prop)) { - return obj[prop]; - } - } - var getShallowPropertySafely; - if (options.includeInheritedProps) { - getShallowPropertySafely = function(obj, currentPath) { - if (typeof currentPath !== "string" && typeof currentPath !== "number") { - currentPath = String(currentPath); - } - var currentValue = getShallowProperty(obj, currentPath); - if (currentPath === "__proto__" || currentPath === "prototype" || currentPath === "constructor" && typeof currentValue === "function") { - throw new Error("For security reasons, object's magic properties cannot be set"); - } - return currentValue; - }; - } else { - getShallowPropertySafely = function(obj, currentPath) { - return getShallowProperty(obj, currentPath); - }; - } - function set(obj, path, value, doNotReplace) { - if (typeof path === "number") { - path = [path]; - } - if (!path || path.length === 0) { - return obj; - } - if (typeof path === "string") { - return set(obj, path.split(".").map(getKey), value, doNotReplace); - } - var currentPath = path[0]; - var currentValue = getShallowPropertySafely(obj, currentPath); - if (path.length === 1) { - if (currentValue === void 0 || !doNotReplace) { - obj[currentPath] = value; - } - return currentValue; - } - if (currentValue === void 0) { - if (typeof path[1] === "number") { - obj[currentPath] = []; - } else { - obj[currentPath] = {}; - } - } - return set(obj[currentPath], path.slice(1), value, doNotReplace); - } - objectPath2.has = function(obj, path) { - if (typeof path === "number") { - path = [path]; - } else if (typeof path === "string") { - path = path.split("."); - } - if (!path || path.length === 0) { - return !!obj; - } - for (var i = 0; i < path.length; i++) { - var j = getKey(path[i]); - if (typeof j === "number" && isArray(obj) && j < obj.length || (options.includeInheritedProps ? j in Object(obj) : hasOwnProperty(obj, j))) { - obj = obj[j]; - } else { - return false; - } - } - return true; - }; - objectPath2.ensureExists = function(obj, path, value) { - return set(obj, path, value, true); - }; - objectPath2.set = function(obj, path, value, doNotReplace) { - return set(obj, path, value, doNotReplace); - }; - objectPath2.insert = function(obj, path, value, at) { - var arr = objectPath2.get(obj, path); - at = ~~at; - if (!isArray(arr)) { - arr = []; - objectPath2.set(obj, path, arr); - } - arr.splice(at, 0, value); - }; - objectPath2.empty = function(obj, path) { - if (isEmpty(path)) { - return void 0; - } - if (obj == null) { - return void 0; - } - var value, i; - if (!(value = objectPath2.get(obj, path))) { - return void 0; - } - if (typeof value === "string") { - return objectPath2.set(obj, path, ""); - } else if (isBoolean(value)) { - return objectPath2.set(obj, path, false); - } else if (typeof value === "number") { - return objectPath2.set(obj, path, 0); - } else if (isArray(value)) { - value.length = 0; - } else if (isObject(value)) { - for (i in value) { - if (hasShallowProperty(value, i)) { - delete value[i]; - } - } - } else { - return objectPath2.set(obj, path, null); - } - }; - objectPath2.push = function(obj, path) { - var arr = objectPath2.get(obj, path); - if (!isArray(arr)) { - arr = []; - objectPath2.set(obj, path, arr); - } - arr.push.apply(arr, Array.prototype.slice.call(arguments, 2)); - }; - objectPath2.coalesce = function(obj, paths, defaultValue) { - var value; - for (var i = 0, len = paths.length; i < len; i++) { - if ((value = objectPath2.get(obj, paths[i])) !== void 0) { - return value; - } - } - return defaultValue; - }; - objectPath2.get = function(obj, path, defaultValue) { - if (typeof path === "number") { - path = [path]; - } - if (!path || path.length === 0) { - return obj; - } - if (obj == null) { - return defaultValue; - } - if (typeof path === "string") { - return objectPath2.get(obj, path.split("."), defaultValue); - } - var currentPath = getKey(path[0]); - var nextObj = getShallowPropertySafely(obj, currentPath); - if (nextObj === void 0) { - return defaultValue; - } - if (path.length === 1) { - return nextObj; - } - return objectPath2.get(obj[currentPath], path.slice(1), defaultValue); - }; - objectPath2.del = function del(obj, path) { - if (typeof path === "number") { - path = [path]; - } - if (obj == null) { - return obj; - } - if (isEmpty(path)) { - return obj; - } - if (typeof path === "string") { - return objectPath2.del(obj, path.split(".")); - } - var currentPath = getKey(path[0]); - getShallowPropertySafely(obj, currentPath); - if (!hasShallowProperty(obj, currentPath)) { - return obj; - } - if (path.length === 1) { - if (isArray(obj)) { - obj.splice(currentPath, 1); - } else { - delete obj[currentPath]; - } - } else { - return objectPath2.del(obj[currentPath], path.slice(1)); - } - return obj; - }; - return objectPath2; - } - var mod = factory(); - mod.create = factory; - mod.withInheritedProps = factory({includeInheritedProps: true}); - return mod; - }); -}); - -// src/main.ts -__markAsModule(exports); -__export(exports, { - default: () => main_default -}); -var import_obsidian2 = __toModule(require("obsidian")); -var import_axios = __toModule(require_axios2()); -var import_object_path = __toModule(require_object_path()); - -// src/settings-tab.ts -var import_obsidian = __toModule(require("obsidian")); -var CloudinaryUploaderSettingTab = class extends import_obsidian.PluginSettingTab { - constructor(app, plugin) { - super(app, plugin); - this.plugin = plugin; - } - display() { - const {containerEl} = this; - containerEl.empty(); - containerEl.createEl("h3", {text: "Cloudinary Settings"}); - new import_obsidian.Setting(containerEl).setName("Cloud Name").setDesc("The name of your Cloudinary Cloud Account").addText((text) => { - text.setPlaceholder("").setValue(this.plugin.settings.cloudName).onChange(async (value) => { - this.plugin.settings.cloudName = value; - await this.plugin.saveSettings(); - }); - }); - new import_obsidian.Setting(containerEl).setName("Cloudinary Upload Template").setDesc("Cloudinary Upload Preference string").addText((text) => { - text.setPlaceholder("").setValue(this.plugin.settings.uploadPreset).onChange(async (value) => { - try { - this.plugin.settings.uploadPreset = value; - await this.plugin.saveSettings(); - } catch (e) { - console.log(e); - } - }); - }); - new import_obsidian.Setting(containerEl).setName("Cloudinary Upload Folder").setDesc("Folder name to use in Cloudinary. Note, this will be ignored if you have a folder set in your Cloudinary Upload Preset").addText((text) => { - text.setPlaceholder("obsidian").setValue(this.plugin.settings.folder).onChange(async (value) => { - try { - this.plugin.settings.folder = value; - await this.plugin.saveSettings(); - } catch (e) { - console.log(e); - } - }); - }); - containerEl.createEl("h4", {text: "URL Manipulations / Transformation"}); - let textFragment = document.createDocumentFragment(); - let link = document.createElement("a"); - const linkTransformation = document.createElement("a"); - linkTransformation.text = "transformation limits "; - linkTransformation.href = "https://cloudinary.com/documentation/transformation_counts"; - textFragment.append("The settings below are meant for default image transformations. As they only touch the resulting URL, this should not cause any upload errors, however, if syntax is incorrect, your images will not be referenced correctly (won't render). Be mindful of your Cloudinary "); - textFragment.append(linkTransformation); - textFragment.append(" and use the "); - link.href = "https://cloudinary.com/documentation/transformation_reference"; - link.text = " Cloudinary documentation"; - textFragment.append(link); - textFragment.append(" for guidance."); - containerEl.createEl("p", {text: textFragment}); - textFragment = document.createDocumentFragment(); - link = document.createElement("a"); - link.href = "https://cloudinary.com/documentation/image_optimization#automatic_format_selection_f_auto"; - link.text = "f_auto option"; - textFragment.append("Enable the "); - textFragment.append(link); - textFragment.append(" for uploads"); - new import_obsidian.Setting(containerEl).setName("f_auto Option").setDesc(textFragment).addToggle((toggle) => { - toggle.setValue(this.plugin.settings.f_auto).onChange(async (value) => { - try { - this.plugin.settings.f_auto = value; - await this.plugin.saveSettings(); - } catch (e) { - console.log(e); - } - }); - }); - textFragment = document.createDocumentFragment(); - link = document.createElement("a"); - link.href = "https://cloudinary.com/documentation/transformation_reference"; - link.text = "View Cloudinary's transformation reference for guidance."; - textFragment.append("Add a comma-delimited default set of transformations to your uploads. You do NOT need to include f_auto here if already enabled above. "); - textFragment.append(link); - new import_obsidian.Setting(containerEl).setName("Default Transformation Parameters").setDesc(textFragment).addText((text) => { - text.setPlaceholder("w_150,h_150").setValue(this.plugin.settings.transformParams).onChange(async (value) => { - try { - this.plugin.settings.transformParams = value; - await this.plugin.saveSettings(); - } catch (e) { - console.log(e); - } - }); - }); - } -}; -var settings_tab_default = CloudinaryUploaderSettingTab; - -// src/main.ts -var DEFAULT_SETTINGS = { - cloudName: null, - uploadPreset: null, - folder: null, - f_auto: false, - transformParams: null -}; -var CloudinaryUploader = class extends import_obsidian2.Plugin { - setupPasteHandler() { - this.registerEvent(this.app.workspace.on("editor-paste", async (evt, editor) => { - const {files} = evt.clipboardData; - if (files.length > 0) { - if (this.settings.cloudName && this.settings.uploadPreset && files[0].type.startsWith("image")) { - evt.preventDefault(); - for (let file of files) { - const randomString = (Math.random() * 10086).toString(36).substr(0, 8); - const pastePlaceText = `![uploading...](${randomString}) -`; - editor.replaceSelection(pastePlaceText); - const formData = new FormData(); - formData.append("file", file); - formData.append("upload_preset", this.settings.uploadPreset); - formData.append("folder", this.settings.folder); - (0, import_axios.default)({ - url: `https://api.cloudinary.com/v1_1/${this.settings.cloudName}/auto/upload`, - method: "POST", - data: formData - }).then((res) => { - console.log(res); - let url = import_object_path.default.get(res.data, "secure_url"); - let imgMarkdownText = ""; - if (this.settings.transformParams) { - const splitURL = url.split("/upload/", 2); - let modifiedURL = ""; - modifiedURL = splitURL[0] += "/upload/" + this.settings.transformParams + "/" + splitURL[1]; - imgMarkdownText = `![](${modifiedURL})`; - url = modifiedURL; - } - if (this.settings.f_auto) { - const splitURL = url.split("/upload/", 2); - let modifiedURL = ""; - modifiedURL = splitURL[0] += "/upload/f_auto/" + splitURL[1]; - imgMarkdownText = `![](${modifiedURL})`; - } else { - imgMarkdownText = `![](${url})`; - } - this.replaceText(editor, pastePlaceText, imgMarkdownText); - }, (err) => { - new import_obsidian2.Notice(err, 5e3); - console.log(err); - }); - } - } - } - })); - } - replaceText(editor, target, replacement) { - target = target.trim(); - let lines = []; - for (let i = 0; i < editor.lineCount(); i++) { - lines.push(editor.getLine(i)); - } - for (let i = 0; i < lines.length; i++) { - const ch = lines[i].indexOf(target); - if (ch !== -1) { - const from = {line: i, ch}; - const to = {line: i, ch: ch + target.length}; - editor.replaceRange(replacement, from, to); - break; - } - } - } - async onload() { - console.log("loading Cloudinary Uploader"); - await this.loadSettings(); - this.setupPasteHandler(); - this.addSettingTab(new settings_tab_default(this.app, this)); - } - onunload() { - console.log("unloading Cloudinary Uploader"); - } - async loadSettings() { - this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); - } - async saveSettings() { - await this.saveData(this.settings); - } -}; -var main_default = CloudinaryUploader; +var Ir=Object.create,ne=Object.defineProperty,jr=Object.getPrototypeOf,Mr=Object.prototype.hasOwnProperty,zr=Object.getOwnPropertyNames,Vr=Object.getOwnPropertyDescriptor;var lt=t=>ne(t,"__esModule",{value:!0});var v=(t,e)=>()=>(e||(e={exports:{}},t(e.exports,e)),e.exports),Wr=(t,e)=>{for(var r in e)ne(t,r,{get:e[r],enumerable:!0})},$r=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of zr(e))!Mr.call(t,n)&&n!=="default"&&ne(t,n,{get:()=>e[n],enumerable:!(r=Vr(e,n))||r.enumerable});return t},se=t=>$r(lt(ne(t!=null?Ir(jr(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var xe=v((ys,ct)=>{"use strict";ct.exports=function(e,r){return function(){for(var s=new Array(arguments.length),i=0;i{"use strict";var Jr=xe(),D=Object.prototype.toString;function Re(t){return D.call(t)==="[object Array]"}function _e(t){return typeof t=="undefined"}function Kr(t){return t!==null&&!_e(t)&&t.constructor!==null&&!_e(t.constructor)&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Xr(t){return D.call(t)==="[object ArrayBuffer]"}function Gr(t){return typeof FormData!="undefined"&&t instanceof FormData}function Yr(t){var e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&t.buffer instanceof ArrayBuffer,e}function Zr(t){return typeof t=="string"}function Qr(t){return typeof t=="number"}function ft(t){return t!==null&&typeof t=="object"}function ie(t){if(D.call(t)!=="[object Object]")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function en(t){return D.call(t)==="[object Date]"}function tn(t){return D.call(t)==="[object File]"}function rn(t){return D.call(t)==="[object Blob]"}function ht(t){return D.call(t)==="[object Function]"}function nn(t){return ft(t)&&ht(t.pipe)}function sn(t){return typeof URLSearchParams!="undefined"&&t instanceof URLSearchParams}function on(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function an(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function qe(t,e){if(!(t===null||typeof t=="undefined"))if(typeof t!="object"&&(t=[t]),Re(t))for(var r=0,n=t.length;r{"use strict";var I=S();function mt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}pt.exports=function(e,r,n){if(!r)return e;var s;if(n)s=n(r);else if(I.isURLSearchParams(r))s=r.toString();else{var i=[];I.forEach(r,function(u,g){u===null||typeof u=="undefined"||(I.isArray(u)?g=g+"[]":u=[u],I.forEach(u,function(l){I.isDate(l)?l=l.toISOString():I.isObject(l)&&(l=JSON.stringify(l)),i.push(mt(g)+"="+mt(l))}))}),s=i.join("&")}if(s){var o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}});var vt=v((bs,gt)=>{"use strict";var cn=S();function ae(){this.handlers=[]}ae.prototype.use=function(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};ae.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};ae.prototype.forEach=function(e){cn.forEach(this.handlers,function(n){n!==null&&e(n)})};gt.exports=ae});var Ct=v((Es,yt)=>{"use strict";var dn=S();yt.exports=function(e,r){dn.forEach(e,function(s,i){i!==r&&i.toUpperCase()===r.toUpperCase()&&(e[r]=s,delete e[i])})}});var ue=v((xs,wt)=>{"use strict";wt.exports=function(e,r,n,s,i){return e.config=r,n&&(e.code=n),e.request=s,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}});var le=v((Rs,bt)=>{"use strict";var fn=ue();bt.exports=function(e,r,n,s,i){var o=new Error(e);return fn(o,r,n,s,i)}});var Ue=v((_s,Et)=>{"use strict";var hn=le();Et.exports=function(e,r,n){var s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):r(hn("Request failed with status code "+n.status,n.config,null,n.request,n))}});var Rt=v((qs,xt)=>{"use strict";var ce=S();xt.exports=ce.isStandardBrowserEnv()?function(){return{write:function(r,n,s,i,o,d){var u=[];u.push(r+"="+encodeURIComponent(n)),ce.isNumber(s)&&u.push("expires="+new Date(s).toGMTString()),ce.isString(i)&&u.push("path="+i),ce.isString(o)&&u.push("domain="+o),d===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(r){var n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var qt=v((Ss,_t)=>{"use strict";_t.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}});var Ut=v((Us,St)=>{"use strict";St.exports=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e}});var Fe=v((Fs,Ft)=>{"use strict";var pn=qt(),mn=Ut();Ft.exports=function(e,r){return e&&!pn(r)?mn(e,r):r}});var Ot=v((Ts,Tt)=>{"use strict";var Te=S(),gn=["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"];Tt.exports=function(e){var r={},n,s,i;return e&&Te.forEach(e.split(` +`),function(d){if(i=d.indexOf(":"),n=Te.trim(d.substr(0,i)).toLowerCase(),s=Te.trim(d.substr(i+1)),n){if(r[n]&&gn.indexOf(n)>=0)return;n==="set-cookie"?r[n]=(r[n]?r[n]:[]).concat([s]):r[n]=r[n]?r[n]+", "+s:s}}),r}});var Nt=v((Os,At)=>{"use strict";var Pt=S();At.exports=Pt.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function s(i){var o=i;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=s(window.location.href),function(o){var d=Pt.isString(o)?s(o):o;return d.protocol===n.protocol&&d.host===n.host}}():function(){return function(){return!0}}()});var Dt=v((As,Lt)=>{"use strict";var de=S(),vn=Ue(),yn=Rt(),Cn=oe(),wn=Fe(),bn=Ot(),En=Nt(),Oe=le();Lt.exports=function(e){return new Promise(function(n,s){var i=e.data,o=e.headers,d=e.responseType;de.isFormData(i)&&delete o["Content-Type"];var u=new XMLHttpRequest;if(e.auth){var g=e.auth.username||"",a=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(g+":"+a)}var l=wn(e.baseURL,e.url);u.open(e.method.toUpperCase(),Cn(l,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function p(){if(!!u){var E="getAllResponseHeaders"in u?bn(u.getAllResponseHeaders()):null,b=!d||d==="text"||d==="json"?u.responseText:u.response,f={data:b,status:u.status,statusText:u.statusText,headers:E,config:e,request:u};vn(n,s,f),u=null}}if("onloadend"in u?u.onloadend=p:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(p)},u.onabort=function(){!u||(s(Oe("Request aborted",e,"ECONNABORTED",u)),u=null)},u.onerror=function(){s(Oe("Network Error",e,null,u)),u=null},u.ontimeout=function(){var b="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(b=e.timeoutErrorMessage),s(Oe(b,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},de.isStandardBrowserEnv()){var m=(e.withCredentials||En(l))&&e.xsrfCookieName?yn.read(e.xsrfCookieName):void 0;m&&(o[e.xsrfHeaderName]=m)}"setRequestHeader"in u&&de.forEach(o,function(b,f){typeof i=="undefined"&&f.toLowerCase()==="content-type"?delete o[f]:u.setRequestHeader(f,b)}),de.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),d&&d!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(b){!u||(u.abort(),s(b),u=null)}),i||(i=null),u.send(i)})}});var kt=v((Ps,Bt)=>{var j=1e3,M=j*60,z=M*60,B=z*24,xn=B*7,Rn=B*365.25;Bt.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return _n(t);if(r==="number"&&isFinite(t))return e.long?Sn(t):qn(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function _n(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!!e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Rn;case"weeks":case"week":case"w":return r*xn;case"days":case"day":case"d":return r*B;case"hours":case"hour":case"hrs":case"hr":case"h":return r*z;case"minutes":case"minute":case"mins":case"min":case"m":return r*M;case"seconds":case"second":case"secs":case"sec":case"s":return r*j;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function qn(t){var e=Math.abs(t);return e>=B?Math.round(t/B)+"d":e>=z?Math.round(t/z)+"h":e>=M?Math.round(t/M)+"m":e>=j?Math.round(t/j)+"s":t+"ms"}function Sn(t){var e=Math.abs(t);return e>=B?fe(t,e,B,"day"):e>=z?fe(t,e,z,"hour"):e>=M?fe(t,e,M,"minute"):e>=j?fe(t,e,j,"second"):t+" ms"}function fe(t,e,r,n){var s=e>=r*1.5;return Math.round(t/r)+" "+n+(s?"s":"")}});var It=v((Ns,Ht)=>{function Un(t){r.debug=r,r.default=r,r.coerce=u,r.disable=i,r.enable=s,r.enabled=o,r.humanize=kt(),r.destroy=g,Object.keys(t).forEach(a=>{r[a]=t[a]}),r.names=[],r.skips=[],r.formatters={};function e(a){let l=0;for(let p=0;p{if(H==="%%")return"%";C++;let P=r.formatters[Z];if(typeof P=="function"){let Q=f[C];H=P.call(c,Q),f.splice(C,1),C--}return H}),r.formatArgs.call(c,f),(c.log||r.log).apply(c,f)}return b.namespace=a,b.useColors=r.useColors(),b.color=r.selectColor(a),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(m!==r.namespaces&&(m=r.namespaces,E=r.enabled(a)),E),set:f=>{p=f}}),typeof r.init=="function"&&r.init(b),b}function n(a,l){let p=r(this.namespace+(typeof l=="undefined"?":":l)+a);return p.log=this.log,p}function s(a){r.save(a),r.namespaces=a,r.names=[],r.skips=[];let l,p=(typeof a=="string"?a:"").split(/[\s,]+/),m=p.length;for(l=0;l"-"+l)].join(",");return r.enable(""),a}function o(a){if(a[a.length-1]==="*")return!0;let l,p;for(l=0,p=r.skips.length;l{T.formatArgs=Fn;T.save=Tn;T.load=On;T.useColors=An;T.storage=Pn();T.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();T.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function An(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Fn(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+he.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(r++,s==="%c"&&(n=r))}),t.splice(n,0,e)}T.log=console.debug||console.log||(()=>{});function Tn(t){try{t?T.storage.setItem("debug",t):T.storage.removeItem("debug")}catch(e){}}function On(){let t;try{t=T.storage.getItem("debug")}catch(e){}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function Pn(){try{return localStorage}catch(t){}}he.exports=It()(T);var{formatters:Nn}=he.exports;Nn.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var zt=v((Ls,Mt)=>{var W;Mt.exports=function(){if(!W){try{W=jt()("follow-redirects")}catch(t){}typeof W!="function"&&(W=function(){})}W.apply(null,arguments)}});var Ve=v((Ds,Ae)=>{var $=require("url"),J=$.URL,Ln=require("http"),Dn=require("https"),Pe=require("stream").Writable,Ne=require("assert"),Vt=zt(),Le=!1;try{Ne(new J)}catch(t){Le=t.code==="ERR_INVALID_URL"}var Bn=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],De=["abort","aborted","connect","error","socket","timeout"],Be=Object.create(null);De.forEach(function(t){Be[t]=function(e,r,n){this._redirectable.emit(t,e,r,n)}});var ke=K("ERR_INVALID_URL","Invalid URL",TypeError),He=K("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),kn=K("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",He),Hn=K("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),In=K("ERR_STREAM_WRITE_AFTER_END","write after end"),jn=Pe.prototype.destroy||Wt;function U(t,e){Pe.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var r=this;this._onNativeResponse=function(n){try{r._processResponse(n)}catch(s){r.emit("error",s instanceof He?s:new He({cause:s}))}},this._performRequest()}U.prototype=Object.create(Pe.prototype);U.prototype.abort=function(){Ie(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};U.prototype.destroy=function(t){return Ie(this._currentRequest,t),jn.call(this,t),this};U.prototype.write=function(t,e,r){if(this._ending)throw new In;if(!k(t)&&!Mn(t))throw new TypeError("data should be a string, Buffer or Uint8Array");if(X(e)&&(r=e,e=null),t.length===0){r&&r();return}this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,r)):(this.emit("error",new Hn),this.abort())};U.prototype.end=function(t,e,r){if(X(t)?(r=t,t=e=null):X(e)&&(r=e,e=null),!t)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var n=this,s=this._currentRequest;this.write(t,e,function(){n._ended=!0,s.end(null,null,r)}),this._ending=!0}};U.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e)};U.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t)};U.prototype.setTimeout=function(t,e){var r=this;function n(o){o.setTimeout(t),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function s(o){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),i()},t),n(o)}function i(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",i),r.removeListener("error",i),r.removeListener("response",i),r.removeListener("close",i),e&&r.removeListener("timeout",e),r.socket||r._currentRequest.removeListener("socket",s)}return e&&this.on("timeout",e),this.socket?s(this.socket):this._currentRequest.once("socket",s),this.on("socket",n),this.on("abort",i),this.on("error",i),this.on("response",i),this.on("close",i),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(t){U.prototype[t]=function(e,r){return this._currentRequest[t](e,r)}});["aborted","connection","socket"].forEach(function(t){Object.defineProperty(U.prototype,t,{get:function(){return this._currentRequest[t]}})});U.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e))}};U.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(!e)throw new TypeError("Unsupported protocol "+t);if(this._options.agents){var r=t.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=e.request(this._options,this._onNativeResponse);n._redirectable=this;for(var s of De)n.on(s,Be[s]);if(this._currentUrl=/^\//.test(this._options.path)?$.format(this._options):this._options.path,this._isRedirect){var i=0,o=this,d=this._requestBodyBuffers;(function u(g){if(n===o._currentRequest)if(g)o.emit("error",g);else if(i=400){t.responseUrl=this._currentUrl,t.redirects=this._redirects,this.emit("response",t),this._requestBodyBuffers=[];return}if(Ie(this._currentRequest),t.destroy(),++this._redirectCount>this._options.maxRedirects)throw new kn;var n,s=this._options.beforeRedirect;s&&(n=Object.assign({Host:t.req.getHeader("host")},this._options.headers));var i=this._options.method;((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],ze(/^content-/i,this._options.headers));var o=ze(/^host$/i,this._options.headers),d=je(this._currentUrl),u=o||d.host,g=/^\w+:/.test(r)?this._currentUrl:$.format(Object.assign(d,{host:u})),a=zn(r,g);if(Vt("redirecting to",a.href),this._isRedirect=!0,Me(a,this._options),(a.protocol!==d.protocol&&a.protocol!=="https:"||a.host!==u&&!Vn(a.host,u))&&ze(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),X(s)){var l={headers:t.headers,statusCode:e},p={url:g,method:i,headers:n};s(this._options,l,p),this._sanitizeOptions(this._options)}this._performRequest()};function Jt(t){var e={maxRedirects:21,maxBodyLength:10*1024*1024},r={};return Object.keys(t).forEach(function(n){var s=n+":",i=r[s]=t[n],o=e[n]=Object.create(i);function d(g,a,l){return Wn(g)?g=Me(g):k(g)?g=Me(je(g)):(l=a,a=$t(g),g={protocol:s}),X(a)&&(l=a,a=null),a=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},g,a),a.nativeProtocols=r,!k(a.host)&&!k(a.hostname)&&(a.hostname="::1"),Ne.equal(a.protocol,s,"protocol mismatch"),Vt("options",a),new U(a,l)}function u(g,a,l){var p=o.request(g,a,l);return p.end(),p}Object.defineProperties(o,{request:{value:d,configurable:!0,enumerable:!0,writable:!0},get:{value:u,configurable:!0,enumerable:!0,writable:!0}})}),e}function Wt(){}function je(t){var e;if(Le)e=new J(t);else if(e=$t($.parse(t)),!k(e.protocol))throw new ke({input:t});return e}function zn(t,e){return Le?new J(t,e):je($.resolve(e,t))}function $t(t){if(/^\[/.test(t.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(t.hostname))throw new ke({input:t.href||t});if(/^\[/.test(t.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(t.host))throw new ke({input:t.href||t});return t}function Me(t,e){var r=e||{};for(var n of Bn)r[n]=t[n];return r.hostname.startsWith("[")&&(r.hostname=r.hostname.slice(1,-1)),r.port!==""&&(r.port=Number(r.port)),r.path=r.search?r.pathname+r.search:r.pathname,r}function ze(t,e){var r;for(var n in e)t.test(n)&&(r=e[n],delete e[n]);return r===null||typeof r=="undefined"?void 0:String(r).trim()}function K(t,e,r){function n(s){Error.captureStackTrace(this,this.constructor),Object.assign(this,s||{}),this.code=t,this.message=this.cause?e+": "+this.cause.message:e}return n.prototype=new(r||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+t+"]",enumerable:!1}}),n}function Ie(t,e){for(var r of De)t.removeListener(r,Be[r]);t.on("error",Wt),t.destroy(e)}function Vn(t,e){Ne(k(t)&&k(e));var r=t.length-e.length-1;return r>0&&t[r]==="."&&t.endsWith(e)}function k(t){return typeof t=="string"||t instanceof String}function X(t){return typeof t=="function"}function Mn(t){return typeof t=="object"&&"length"in t}function Wn(t){return J&&t instanceof J}Ae.exports=Jt({http:Ln,https:Dn});Ae.exports.wrap=Jt});var We=v((Bs,Kt)=>{Kt.exports={name:"axios",version:"0.21.4",description:"Promise based HTTP client for the browser and node.js",main:"index.js",scripts:{test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},repository:{type:"git",url:"https://github.com/axios/axios.git"},keywords:["xhr","http","ajax","promise","node"],author:"Matt Zabriskie",license:"MIT",bugs:{url:"https://github.com/axios/axios/issues"},homepage:"https://axios-http.com",devDependencies:{coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},browser:{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},jsdelivr:"dist/axios.min.js",unpkg:"dist/axios.min.js",typings:"./index.d.ts",dependencies:{"follow-redirects":"^1.14.0"},bundlesize:[{path:"./dist/axios.min.js",threshold:"5kB"}]}});var er=v((ks,Xt)=>{"use strict";var G=S(),Gt=Ue(),$n=Fe(),Jn=oe(),Kn=require("http"),Xn=require("https"),Gn=Ve().http,Yn=Ve().https,Yt=require("url"),Zn=require("zlib"),Qn=We(),pe=le(),$e=ue(),Zt=/https:?/;function Qt(t,e,r){if(t.hostname=e.host,t.host=e.host,t.port=e.port,t.path=r,e.auth){var n=Buffer.from(e.auth.username+":"+e.auth.password,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+n}t.beforeRedirect=function(i){i.headers.host=i.host,Qt(i,e,i.href)}}Xt.exports=function(e){return new Promise(function(n,s){var i=function(w){n(w)},o=function(w){s(w)},d=e.data,u=e.headers;if("User-Agent"in u||"user-agent"in u?!u["User-Agent"]&&!u["user-agent"]&&(delete u["User-Agent"],delete u["user-agent"]):u["User-Agent"]="axios/"+Qn.version,d&&!G.isStream(d)){if(!Buffer.isBuffer(d))if(G.isArrayBuffer(d))d=Buffer.from(new Uint8Array(d));else if(G.isString(d))d=Buffer.from(d,"utf-8");else return o(pe("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));u["Content-Length"]=d.length}var g=void 0;if(e.auth){var a=e.auth.username||"",l=e.auth.password||"";g=a+":"+l}var p=$n(e.baseURL,e.url),m=Yt.parse(p),E=m.protocol||"http:";if(!g&&m.auth){var b=m.auth.split(":"),f=b[0]||"",c=b[1]||"";g=f+":"+c}g&&delete u.Authorization;var h=Zt.test(E),y=h?e.httpsAgent:e.httpAgent,C={path:Jn(m.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method.toUpperCase(),headers:u,agent:y,agents:{http:e.httpAgent,https:e.httpsAgent},auth:g};e.socketPath?C.socketPath=e.socketPath:(C.hostname=m.hostname,C.port=m.port);var _=e.proxy;if(!_&&_!==!1){var H=E.slice(0,-1)+"_proxy",Z=process.env[H]||process.env[H.toUpperCase()];if(Z){var P=Yt.parse(Z),Q=process.env.no_proxy||process.env.NO_PROXY,nt=!0;if(Q){var Hr=Q.split(",").map(function(w){return w.trim()});nt=!Hr.some(function(w){return w?w==="*"||w[0]==="."&&m.hostname.substr(m.hostname.length-w.length)===w?!0:m.hostname===w:!1})}if(nt&&(_={host:P.hostname,port:P.port,protocol:P.protocol},P.auth)){var st=P.auth.split(":");_.auth={username:st[0],password:st[1]}}}}_&&(C.headers.host=m.hostname+(m.port?":"+m.port:""),Qt(C,_,E+"//"+m.hostname+(m.port?":"+m.port:"")+C.path));var ee,it=h&&(_?Zt.test(_.protocol):!0);e.transport?ee=e.transport:e.maxRedirects===0?ee=it?Xn:Kn:(e.maxRedirects&&(C.maxRedirects=e.maxRedirects),ee=it?Yn:Gn),e.maxBodyLength>-1&&(C.maxBodyLength=e.maxBodyLength);var q=ee.request(C,function(w){if(!q.aborted){var L=w,te=w.req||q;if(w.statusCode!==204&&te.method!=="HEAD"&&e.decompress!==!1)switch(w.headers["content-encoding"]){case"gzip":case"compress":case"deflate":L=L.pipe(Zn.createUnzip()),delete w.headers["content-encoding"];break}var re={status:w.statusCode,statusText:w.statusMessage,headers:w.headers,config:e,request:te};if(e.responseType==="stream")re.data=L,Gt(i,o,re);else{var ot=[],at=0;L.on("data",function(A){ot.push(A),at+=A.length,e.maxContentLength>-1&&at>e.maxContentLength&&(L.destroy(),o(pe("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,te)))}),L.on("error",function(A){q.aborted||o($e(A,e,null,te))}),L.on("end",function(){var A=Buffer.concat(ot);e.responseType!=="arraybuffer"&&(A=A.toString(e.responseEncoding),(!e.responseEncoding||e.responseEncoding==="utf8")&&(A=G.stripBOM(A))),re.data=A,Gt(i,o,re)})}}});if(q.on("error",function(w){q.aborted&&w.code!=="ERR_FR_TOO_MANY_REDIRECTS"||o($e(w,e,null,q))}),e.timeout){var Ee=parseInt(e.timeout,10);if(isNaN(Ee)){o(pe("error trying to parse `config.timeout` to int",e,"ERR_PARSE_TIMEOUT",q));return}q.setTimeout(Ee,function(){q.abort(),o(pe("timeout of "+Ee+"ms exceeded",e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",q))})}e.cancelToken&&e.cancelToken.promise.then(function(w){q.aborted||(q.abort(),o(w))}),G.isStream(d)?d.on("error",function(w){o($e(w,e,null,q))}).pipe(q):q.end(d)})}});var ge=v((Hs,tr)=>{"use strict";var x=S(),rr=Ct(),es=ue(),ts={"Content-Type":"application/x-www-form-urlencoded"};function nr(t,e){!x.isUndefined(t)&&x.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function rs(){var t;return typeof XMLHttpRequest!="undefined"?t=Dt():typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]"&&(t=er()),t}function ns(t,e,r){if(x.isString(t))try{return(e||JSON.parse)(t),x.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var me={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:rs(),transformRequest:[function(e,r){return rr(r,"Accept"),rr(r,"Content-Type"),x.isFormData(e)||x.isArrayBuffer(e)||x.isBuffer(e)||x.isStream(e)||x.isFile(e)||x.isBlob(e)?e:x.isArrayBufferView(e)?e.buffer:x.isURLSearchParams(e)?(nr(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):x.isObject(e)||r&&r["Content-Type"]==="application/json"?(nr(r,"application/json"),ns(e)):e}],transformResponse:[function(e){var r=this.transitional,n=r&&r.silentJSONParsing,s=r&&r.forcedJSONParsing,i=!n&&this.responseType==="json";if(i||s&&x.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(i)throw o.name==="SyntaxError"?es(o,this,"E_JSON_PARSE"):o}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};me.headers={common:{Accept:"application/json, text/plain, */*"}};x.forEach(["delete","get","head"],function(e){me.headers[e]={}});x.forEach(["post","put","patch"],function(e){me.headers[e]=x.merge(ts)});tr.exports=me});var ir=v((Is,sr)=>{"use strict";var ss=S(),is=ge();sr.exports=function(e,r,n){var s=this||is;return ss.forEach(n,function(o){e=o.call(s,e,r)}),e}});var Je=v((js,or)=>{"use strict";or.exports=function(e){return!!(e&&e.__CANCEL__)}});var lr=v((Ms,ar)=>{"use strict";var ur=S(),Ke=ir(),os=Je(),as=ge();function Xe(t){t.cancelToken&&t.cancelToken.throwIfRequested()}ar.exports=function(e){Xe(e),e.headers=e.headers||{},e.data=Ke.call(e,e.data,e.headers,e.transformRequest),e.headers=ur.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),ur.forEach(["delete","get","head","post","put","patch","common"],function(s){delete e.headers[s]});var r=e.adapter||as.adapter;return r(e).then(function(s){return Xe(e),s.data=Ke.call(e,s.data,s.headers,e.transformResponse),s},function(s){return os(s)||(Xe(e),s&&s.response&&(s.response.data=Ke.call(e,s.response.data,s.response.headers,e.transformResponse))),Promise.reject(s)})}});var Ge=v((zs,cr)=>{"use strict";var R=S();cr.exports=function(e,r){r=r||{};var n={},s=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],d=["validateStatus"];function u(p,m){return R.isPlainObject(p)&&R.isPlainObject(m)?R.merge(p,m):R.isPlainObject(m)?R.merge({},m):R.isArray(m)?m.slice():m}function g(p){R.isUndefined(r[p])?R.isUndefined(e[p])||(n[p]=u(void 0,e[p])):n[p]=u(e[p],r[p])}R.forEach(s,function(m){R.isUndefined(r[m])||(n[m]=u(void 0,r[m]))}),R.forEach(i,g),R.forEach(o,function(m){R.isUndefined(r[m])?R.isUndefined(e[m])||(n[m]=u(void 0,e[m])):n[m]=u(void 0,r[m])}),R.forEach(d,function(m){m in r?n[m]=u(e[m],r[m]):m in e&&(n[m]=u(void 0,e[m]))});var a=s.concat(i).concat(o).concat(d),l=Object.keys(e).concat(Object.keys(r)).filter(function(m){return a.indexOf(m)===-1});return R.forEach(l,g),n}});var mr=v((Vs,dr)=>{"use strict";var fr=We(),Ye={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){Ye[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var hr={},us=fr.version.split(".");function pr(t,e){for(var r=e?e.split("."):us,n=t.split("."),s=0;s<3;s++){if(r[s]>n[s])return!0;if(r[s]0;){var i=n[s],o=e[i];if(o){var d=t[i],u=d===void 0||o(d,i,t);if(u!==!0)throw new TypeError("option "+i+" must be "+u);continue}if(r!==!0)throw Error("Unknown option "+i)}}dr.exports={isOlderVersion:pr,assertOptions:ls,validators:Ye}});var br=v((Ws,gr)=>{"use strict";var vr=S(),cs=oe(),yr=vt(),Cr=lr(),ve=Ge(),wr=mr(),V=wr.validators;function Y(t){this.defaults=t,this.interceptors={request:new yr,response:new yr}}Y.prototype.request=function(e){typeof e=="string"?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=ve(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;r!==void 0&&wr.assertOptions(r,{silentJSONParsing:V.transitional(V.boolean,"1.0.0"),forcedJSONParsing:V.transitional(V.boolean,"1.0.0"),clarifyTimeoutError:V.transitional(V.boolean,"1.0.0")},!1);var n=[],s=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(e)===!1||(s=s&&p.synchronous,n.unshift(p.fulfilled,p.rejected))});var i=[];this.interceptors.response.forEach(function(p){i.push(p.fulfilled,p.rejected)});var o;if(!s){var d=[Cr,void 0];for(Array.prototype.unshift.apply(d,n),d=d.concat(i),o=Promise.resolve(e);d.length;)o=o.then(d.shift(),d.shift());return o}for(var u=e;n.length;){var g=n.shift(),a=n.shift();try{u=g(u)}catch(l){a(l);break}}try{o=Cr(u)}catch(l){return Promise.reject(l)}for(;i.length;)o=o.then(i.shift(),i.shift());return o};Y.prototype.getUri=function(e){return e=ve(this.defaults,e),cs(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};vr.forEach(["delete","get","head","options"],function(e){Y.prototype[e]=function(r,n){return this.request(ve(n||{},{method:e,url:r,data:(n||{}).data}))}});vr.forEach(["post","put","patch"],function(e){Y.prototype[e]=function(r,n,s){return this.request(ve(s||{},{method:e,url:r,data:n}))}});gr.exports=Y});var Qe=v(($s,Er)=>{"use strict";function Ze(t){this.message=t}Ze.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};Ze.prototype.__CANCEL__=!0;Er.exports=Ze});var Rr=v((Js,xr)=>{"use strict";var ds=Qe();function ye(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(s){e=s});var r=this;t(function(s){r.reason||(r.reason=new ds(s),e(r.reason))})}ye.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};ye.source=function(){var e,r=new ye(function(s){e=s});return{token:r,cancel:e}};xr.exports=ye});var qr=v((Ks,_r)=>{"use strict";_r.exports=function(e){return function(n){return e.apply(null,n)}}});var Ur=v((Xs,Sr)=>{"use strict";Sr.exports=function(e){return typeof e=="object"&&e.isAxiosError===!0}});var Or=v((Gs,et)=>{"use strict";var Fr=S(),fs=xe(),Ce=br(),hs=Ge(),ps=ge();function Tr(t){var e=new Ce(t),r=fs(Ce.prototype.request,e);return Fr.extend(r,Ce.prototype,e),Fr.extend(r,e),r}var O=Tr(ps);O.Axios=Ce;O.create=function(e){return Tr(hs(O.defaults,e))};O.Cancel=Qe();O.CancelToken=Rr();O.isCancel=Je();O.all=function(e){return Promise.all(e)};O.spread=qr();O.isAxiosError=Ur();et.exports=O;et.exports.default=O});var Pr=v((Ys,Ar)=>{Ar.exports=Or()});var Lr=v((Nr,we)=>{(function(t,e){"use strict";typeof we=="object"&&typeof we.exports=="object"?we.exports=e():typeof define=="function"&&define.amd?define([],e):t.objectPath=e()})(Nr,function(){"use strict";var t=Object.prototype.toString;function e(a,l){return a==null?!1:Object.prototype.hasOwnProperty.call(a,l)}function r(a){if(!a||i(a)&&a.length===0)return!0;if(typeof a!="string"){for(var l in a)if(e(a,l))return!1;return!0}return!1}function n(a){return t.call(a)}function s(a){return typeof a=="object"&&n(a)==="[object Object]"}var i=Array.isArray||function(a){return t.call(a)==="[object Array]"};function o(a){return typeof a=="boolean"||n(a)==="[object Boolean]"}function d(a){var l=parseInt(a);return l.toString()===a?l:a}function u(a){a=a||{};var l=function(f){return Object.keys(l).reduce(function(c,h){return h==="create"||typeof l[h]=="function"&&(c[h]=l[h].bind(l,f)),c},{})},p;a.includeInheritedProps?p=function(){return!0}:p=function(f,c){return typeof c=="number"&&Array.isArray(f)||e(f,c)};function m(f,c){if(p(f,c))return f[c]}var E;a.includeInheritedProps?E=function(f,c){typeof c!="string"&&typeof c!="number"&&(c=String(c));var h=m(f,c);if(c==="__proto__"||c==="prototype"||c==="constructor"&&typeof h=="function")throw new Error("For security reasons, object's magic properties cannot be set");return h}:E=function(f,c){return m(f,c)};function b(f,c,h,y){if(typeof c=="number"&&(c=[c]),!c||c.length===0)return f;if(typeof c=="string")return b(f,c.split(".").map(d),h,y);var C=c[0],_=E(f,C);return c.length===1?((_===void 0||!y)&&(f[C]=h),_):(_===void 0&&(typeof c[1]=="number"?f[C]=[]:f[C]={}),b(f[C],c.slice(1),h,y))}return l.has=function(f,c){if(typeof c=="number"?c=[c]:typeof c=="string"&&(c=c.split(".")),!c||c.length===0)return!!f;for(var h=0;hgs});var be=se(require("obsidian")),Br=se(Pr()),kr=se(Lr());var F=se(require("obsidian")),tt=class extends F.PluginSettingTab{constructor(e,r){super(e,r);this.plugin=r}display(){let{containerEl:e}=this;e.empty(),e.createEl("h3",{text:"Cloudinary Settings"}),new F.Setting(e).setName("Cloud Name").setDesc("The name of your Cloudinary Cloud Account").addText(i=>{i.setPlaceholder("").setValue(this.plugin.settings.cloudName).onChange(async o=>{this.plugin.settings.cloudName=o,await this.plugin.saveSettings()})}),new F.Setting(e).setName("Cloudinary Upload Template").setDesc("Cloudinary Upload Preference string").addText(i=>{i.setPlaceholder("").setValue(this.plugin.settings.uploadPreset).onChange(async o=>{try{this.plugin.settings.uploadPreset=o,await this.plugin.saveSettings()}catch(d){console.log(d)}})}),new F.Setting(e).setName("Cloudinary Upload Folder").setDesc("Folder name to use in Cloudinary. Note, this will be ignored if you have a folder set in your Cloudinary Upload Preset").addText(i=>{i.setPlaceholder("obsidian").setValue(this.plugin.settings.folder).onChange(async o=>{try{this.plugin.settings.folder=o,await this.plugin.saveSettings()}catch(d){console.log(d)}})}),e.createEl("h4",{text:"Paste Behaviour"}),new F.Setting(e).setName("Upload on Clipboard Copy/Paste").setDesc("Upload files on a copy/paste from clipboard").addToggle(i=>{i.setValue(this.plugin.settings.clipboardUpload).onChange(async o=>{try{this.plugin.settings.clipboardUpload=o,await this.plugin.saveSettings()}catch(d){console.log(d)}})}),new F.Setting(e).setName("Upload on Drag/Drop").setDesc("Upload files on a drag/drop").addToggle(i=>{i.setValue(this.plugin.settings.dropUpload).onChange(async o=>{try{this.plugin.settings.dropUpload=o,await this.plugin.saveSettings()}catch(d){console.log(d)}})}),e.createEl("h4",{text:"URL Manipulations / Transformation"});let r=document.createDocumentFragment(),n=document.createElement("a"),s=document.createElement("a");s.text="transformation limits ",s.href="https://cloudinary.com/documentation/transformation_counts",r.append("The settings below are meant for default image transformations. As they only touch the resulting URL, this should not cause any upload errors, however, if syntax is incorrect, your images will not be referenced correctly (won't render). Be mindful of your Cloudinary "),r.append(s),r.append(" and use the "),n.href="https://cloudinary.com/documentation/transformation_reference",n.text=" Cloudinary documentation",r.append(n),r.append(" for guidance."),e.createEl("p",{text:r}),r=document.createDocumentFragment(),n=document.createElement("a"),n.href="https://cloudinary.com/documentation/image_optimization#automatic_format_selection_f_auto",n.text="f_auto option",r.append("Enable the "),r.append(n),r.append(" for uploads"),new F.Setting(e).setName("f_auto Option").setDesc(r).addToggle(i=>{i.setValue(this.plugin.settings.f_auto).onChange(async o=>{try{this.plugin.settings.f_auto=o,await this.plugin.saveSettings()}catch(d){console.log(d)}})}),r=document.createDocumentFragment(),n=document.createElement("a"),n.href="https://cloudinary.com/documentation/transformation_reference",n.text="View Cloudinary's transformation reference for guidance.",r.append("Add a comma-delimited default set of transformations to your uploads. You do NOT need to include f_auto here if already enabled above. "),r.append(n),new F.Setting(e).setName("Default Transformation Parameters").setDesc(r).addText(i=>{i.setPlaceholder("w_150,h_150").setValue(this.plugin.settings.transformParams).onChange(async o=>{try{this.plugin.settings.transformParams=o,await this.plugin.saveSettings()}catch(d){console.log(d)}})}),e.createEl("h4",{text:"Enabled File Types"}),r=document.createDocumentFragment(),r.append("Choose which file types are uploaded to Cloudinary. Disabled types are ignored"),e.createEl("p",{text:r}),new F.Setting(e).setName("Upload Images").addToggle(i=>{i.setValue(this.plugin.settings.imageUpload).onChange(async o=>{try{this.plugin.settings.imageUpload=o,await this.plugin.saveSettings()}catch(d){console.log(d)}})}),new F.Setting(e).setName("Upload Audio").addToggle(i=>{i.setValue(this.plugin.settings.audioUpload).onChange(async o=>{try{this.plugin.settings.audioUpload=o,await this.plugin.saveSettings()}catch(d){console.log(d)}})}),new F.Setting(e).setName("Upload Video").addToggle(i=>{i.setValue(this.plugin.settings.videoUpload).onChange(async o=>{try{this.plugin.settings.videoUpload=o,await this.plugin.saveSettings()}catch(d){console.log(d)}})}),new F.Setting(e).setName("Upload Raw Files").setDesc("Raw files are those files that are not necessarily media files, but Cloudinary will still accept for upload").addToggle(i=>{i.setValue(this.plugin.settings.rawUpload).onChange(async o=>{try{this.plugin.settings.rawUpload=o,await this.plugin.saveSettings()}catch(d){console.log(d)}})})}},Dr=tt;var ms={cloudName:null,uploadPreset:null,folder:null,f_auto:!1,transformParams:null,dropUpload:!1,clipboardUpload:!0,imageUpload:!0,audioUpload:!1,videoUpload:!1,rawUpload:!1},rt=class extends be.Plugin{constructor(){super(...arguments);this.pasteHandler=async(e,r)=>{let{files:n}=e.clipboardData;await this.uploadFiles(n,e,r)};this.dropHandler=async(e,r)=>{let{files:n}=e.dataTransfer;await this.uploadFiles(n,e,r)};this.uploadFiles=async(e,r,n)=>{if(e.length>0&&(this.settings.audioUpload&&e[0].type.startsWith("audio")||this.settings.videoUpload&&e[0].type.startsWith("video")||this.settings.imageUpload&&e[0].type.startsWith("image")||this.settings.rawUpload&&!e[0].type.startsWith("image")&&!e[0].type.startsWith("audio")&&!e[0].type.startsWith("video"))&&(r.preventDefault(),this.settings.cloudName&&this.settings.uploadPreset))for(let s of e){let o=`![uploading...](${(Math.random()*10086).toString(36).substr(0,8)}) +`;n.replaceSelection(o);let d=new FormData;d.append("file",s),d.append("upload_preset",this.settings.uploadPreset),d.append("folder",this.settings.folder),(0,Br.default)({url:`https://api.cloudinary.com/v1_1/${this.settings.cloudName}/auto/upload`,method:"POST",data:d}).then(u=>{console.log(u);let g=kr.default.get(u.data,"secure_url"),a="";if(this.settings.transformParams){let l=g.split("/upload/",2);g=l[0]+="/upload/"+this.settings.transformParams+"/"+l[1],a=`![](${g})`}if(this.settings.f_auto){let l=g.split("/upload/",2);g=l[0]+="/upload/f_auto/"+l[1],a=`![](${g})`}else a=`![](${g})`;e[0].type.startsWith("audio")?a=` +`:e[0].type.startsWith("video")&&(a=` +`),this.replaceText(n,o,a)},u=>{new be.Notice("There was something wrong with the upload. PLease check your cloud name and template name before trying again "+u,5e3),console.log(u)})}}}clearHandlers(){this.app.workspace.off("editor-paste",this.pasteHandler),this.app.workspace.off("editor-drop",this.dropHandler)}setupHandlers(){this.settings.clipboardUpload?this.registerEvent(this.app.workspace.on("editor-paste",this.pasteHandler)):this.app.workspace.off("editor-paste",this.pasteHandler),this.settings.dropUpload?this.registerEvent(this.app.workspace.on("editor-drop",this.dropHandler)):this.app.workspace.off("editor-drop",this.dropHandler)}replaceText(e,r,n){r=r.trim();let s=[];for(let i=0;i