commit 4146027cb7028d75a351ca9deeac2444eb1ffe4a Author: zznty <94796179+zznty@users.noreply.github.com> Date: Thu May 30 16:04:19 2024 +0700 1 diff --git a/parent_dir/node_modules/axios/lib/adapters/adapters.js b/parent_dir/node_modules/axios/lib/adapters/adapters.js new file mode 100644 index 0000000..e31fca1 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/adapters/adapters.js @@ -0,0 +1,59 @@ +import utils from '../utils.js'; +import httpAdapter from './http.js'; +import xhrAdapter from './xhr.js'; +import AxiosError from "../core/AxiosError.js"; + +const knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter +} + +utils.forEach(knownAdapters, (fn, value) => { + if(fn) { + try { + Object.defineProperty(fn, 'name', {value}); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', {value}); + } +}); + +export default { + getAdapter: (adapters) => { + adapters = utils.isArray(adapters) ? adapters : [adapters]; + + const {length} = adapters; + let nameOrAdapter; + let adapter; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + if((adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) { + break; + } + } + + if (!adapter) { + if (adapter === false) { + throw new AxiosError( + `Adapter ${nameOrAdapter} is not supported by the environment`, + 'ERR_NOT_SUPPORT' + ); + } + + throw new Error( + utils.hasOwnProp(knownAdapters, nameOrAdapter) ? + `Adapter '${nameOrAdapter}' is not available in the build` : + `Unknown adapter '${nameOrAdapter}'` + ); + } + + if (!utils.isFunction(adapter)) { + throw new TypeError('adapter is not a function'); + } + + return adapter; + }, + adapters: knownAdapters +} diff --git a/parent_dir/node_modules/axios/lib/adapters/xhr.js b/parent_dir/node_modules/axios/lib/adapters/xhr.js new file mode 100644 index 0000000..021da2a --- /dev/null +++ b/parent_dir/node_modules/axios/lib/adapters/xhr.js @@ -0,0 +1,249 @@ +'use strict'; + +import utils from './../utils.js'; +import settle from './../core/settle.js'; +import cookies from './../helpers/cookies.js'; +import buildURL from './../helpers/buildURL.js'; +import buildFullPath from '../core/buildFullPath.js'; +import isURLSameOrigin from './../helpers/isURLSameOrigin.js'; +import transitionalDefaults from '../defaults/transitional.js'; +import AxiosError from '../core/AxiosError.js'; +import CanceledError from '../cancel/CanceledError.js'; +import parseProtocol from '../helpers/parseProtocol.js'; +import platform from '../platform/index.js'; +import AxiosHeaders from '../core/AxiosHeaders.js'; +import speedometer from '../helpers/speedometer.js'; + +function progressEventReducer(listener, isDownloadStream) { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + + return e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e + }; + + data[isDownloadStream ? 'download' : 'upload'] = true; + + listener(data); + }; +} + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +export default isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + let requestData = config.data; + const requestHeaders = AxiosHeaders.from(config.headers).normalize(); + const responseType = config.responseType; + let onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + + if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) { + requestHeaders.setContentType(false); // Let the browser set it + } + + let request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + } + + const fullPath = buildFullPath(config.baseURL, config.url); + + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = AxiosHeaders.from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (platform.isStandardBrowserEnv) { + // Add xsrf header + const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) + && config.xsrfCookieName && cookies.read(config.xsrfCookieName); + + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); + } + } + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = parseProtocol(fullPath); + + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +} diff --git a/parent_dir/node_modules/axios/lib/axios.js b/parent_dir/node_modules/axios/lib/axios.js new file mode 100644 index 0000000..c97e062 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/axios.js @@ -0,0 +1,86 @@ +'use strict'; + +import utils from './utils.js'; +import bind from './helpers/bind.js'; +import Axios from './core/Axios.js'; +import mergeConfig from './core/mergeConfig.js'; +import defaults from './defaults/index.js'; +import formDataToJSON from './helpers/formDataToJSON.js'; +import CanceledError from './cancel/CanceledError.js'; +import CancelToken from './cancel/CancelToken.js'; +import isCancel from './cancel/isCancel.js'; +import {VERSION} from './env/data.js'; +import toFormData from './helpers/toFormData.js'; +import AxiosError from './core/AxiosError.js'; +import spread from './helpers/spread.js'; +import isAxiosError from './helpers/isAxiosError.js'; +import AxiosHeaders from "./core/AxiosHeaders.js"; +import HttpStatusCode from './helpers/HttpStatusCode.js'; + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new Axios(defaultConfig); + const instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context, {allOwnKeys: true}); + + // Copy context to instance + utils.extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Expose Cancel & CancelToken +axios.CanceledError = CanceledError; +axios.CancelToken = CancelToken; +axios.isCancel = isCancel; +axios.VERSION = VERSION; +axios.toFormData = toFormData; + +// Expose AxiosError class +axios.AxiosError = AxiosError; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = spread; + +// Expose isAxiosError +axios.isAxiosError = isAxiosError; + +// Expose mergeConfig +axios.mergeConfig = mergeConfig; + +axios.AxiosHeaders = AxiosHeaders; + +axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.HttpStatusCode = HttpStatusCode; + +axios.default = axios; + +// this module should only have a default export +export default axios diff --git a/parent_dir/node_modules/axios/lib/cancel/CancelToken.js b/parent_dir/node_modules/axios/lib/cancel/CancelToken.js new file mode 100644 index 0000000..20d8f68 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/cancel/CancelToken.js @@ -0,0 +1,121 @@ +'use strict'; + +import CanceledError from './CanceledError.js'; + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new CanceledError(message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +export default CancelToken; diff --git a/parent_dir/node_modules/axios/lib/cancel/CanceledError.js b/parent_dir/node_modules/axios/lib/cancel/CanceledError.js new file mode 100644 index 0000000..880066e --- /dev/null +++ b/parent_dir/node_modules/axios/lib/cancel/CanceledError.js @@ -0,0 +1,25 @@ +'use strict'; + +import AxiosError from '../core/AxiosError.js'; +import utils from '../utils.js'; + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +utils.inherits(CanceledError, AxiosError, { + __CANCEL__: true +}); + +export default CanceledError; diff --git a/parent_dir/node_modules/axios/lib/cancel/isCancel.js b/parent_dir/node_modules/axios/lib/cancel/isCancel.js new file mode 100644 index 0000000..a444a12 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/cancel/isCancel.js @@ -0,0 +1,5 @@ +'use strict'; + +export default function isCancel(value) { + return !!(value && value.__CANCEL__); +} diff --git a/parent_dir/node_modules/axios/lib/core/Axios.js b/parent_dir/node_modules/axios/lib/core/Axios.js new file mode 100644 index 0000000..7a6e6f5 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/core/Axios.js @@ -0,0 +1,203 @@ +'use strict'; + +import utils from './../utils.js'; +import buildURL from '../helpers/buildURL.js'; +import InterceptorManager from './InterceptorManager.js'; +import dispatchRequest from './dispatchRequest.js'; +import mergeConfig from './mergeConfig.js'; +import buildFullPath from './buildFullPath.js'; +import validator from '../helpers/validator.js'; +import AxiosHeaders from './AxiosHeaders.js'; + +const validators = validator.validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = mergeConfig(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer != null) { + if (utils.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + } + } else { + validator.assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + } + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + let contextHeaders; + + // Flatten headers + contextHeaders = headers && utils.merge( + headers.common, + headers[config.method] + ); + + contextHeaders && utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = AxiosHeaders.concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + i = 0; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = mergeConfig(this.defaults, config); + const fullPath = buildFullPath(config.baseURL, config.url); + return buildURL(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +export default Axios; diff --git a/parent_dir/node_modules/axios/lib/core/AxiosError.js b/parent_dir/node_modules/axios/lib/core/AxiosError.js new file mode 100644 index 0000000..7141a8c --- /dev/null +++ b/parent_dir/node_modules/axios/lib/core/AxiosError.js @@ -0,0 +1,100 @@ +'use strict'; + +import utils from '../utils.js'; + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); +} + +utils.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils.toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } +}); + +const prototype = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype); + + utils.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + AxiosError.call(axiosError, error.message, code, config, request, response); + + axiosError.cause = error; + + axiosError.name = error.name; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +export default AxiosError; diff --git a/parent_dir/node_modules/axios/lib/core/AxiosHeaders.js b/parent_dir/node_modules/axios/lib/core/AxiosHeaders.js new file mode 100644 index 0000000..361d340 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/core/AxiosHeaders.js @@ -0,0 +1,288 @@ +'use strict'; + +import utils from '../utils.js'; +import parseHeaders from '../helpers/parseHeaders.js'; + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return utils.isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils.isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!utils.isString(value)) return; + + if (utils.isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (utils.isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = utils.toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = utils.findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (utils.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite) + } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = utils.findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (utils.isFunction(parser)) { + return parser.call(this, value, key); + } + + if (utils.isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = utils.findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = utils.findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (utils.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + utils.forEach(this, (value, header) => { + const key = utils.findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + utils.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +utils.freezeMethods(AxiosHeaders.prototype); +utils.freezeMethods(AxiosHeaders); + +export default AxiosHeaders; diff --git a/parent_dir/node_modules/axios/lib/core/InterceptorManager.js b/parent_dir/node_modules/axios/lib/core/InterceptorManager.js new file mode 100644 index 0000000..6657a9d --- /dev/null +++ b/parent_dir/node_modules/axios/lib/core/InterceptorManager.js @@ -0,0 +1,71 @@ +'use strict'; + +import utils from './../utils.js'; + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +export default InterceptorManager; diff --git a/parent_dir/node_modules/axios/lib/core/buildFullPath.js b/parent_dir/node_modules/axios/lib/core/buildFullPath.js new file mode 100644 index 0000000..b60927c --- /dev/null +++ b/parent_dir/node_modules/axios/lib/core/buildFullPath.js @@ -0,0 +1,21 @@ +'use strict'; + +import isAbsoluteURL from '../helpers/isAbsoluteURL.js'; +import combineURLs from '../helpers/combineURLs.js'; + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +export default function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +} diff --git a/parent_dir/node_modules/axios/lib/core/dispatchRequest.js b/parent_dir/node_modules/axios/lib/core/dispatchRequest.js new file mode 100644 index 0000000..9e306aa --- /dev/null +++ b/parent_dir/node_modules/axios/lib/core/dispatchRequest.js @@ -0,0 +1,81 @@ +'use strict'; + +import transformData from './transformData.js'; +import isCancel from '../cancel/isCancel.js'; +import defaults from '../defaults/index.js'; +import CanceledError from '../cancel/CanceledError.js'; +import AxiosHeaders from '../core/AxiosHeaders.js'; +import adapters from "../adapters/adapters.js"; + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new CanceledError(null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +export default function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = AxiosHeaders.from(config.headers); + + // Transform request data + config.data = transformData.call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = adapters.getAdapter(config.adapter || defaults.adapter); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + config.transformResponse, + response + ); + + response.headers = AxiosHeaders.from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = AxiosHeaders.from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} diff --git a/parent_dir/node_modules/axios/lib/core/mergeConfig.js b/parent_dir/node_modules/axios/lib/core/mergeConfig.js new file mode 100644 index 0000000..2aee6b8 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/core/mergeConfig.js @@ -0,0 +1,105 @@ +'use strict'; + +import utils from '../utils.js'; +import AxiosHeaders from "./AxiosHeaders.js"; + +const headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +export default function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, caseless) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge.call({caseless}, target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!utils.isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!utils.isUndefined(a)) { + return getMergedValue(undefined, a, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils.isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils.isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + + utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} diff --git a/parent_dir/node_modules/axios/lib/core/settle.js b/parent_dir/node_modules/axios/lib/core/settle.js new file mode 100644 index 0000000..ac905c4 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/core/settle.js @@ -0,0 +1,27 @@ +'use strict'; + +import AxiosError from './AxiosError.js'; + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +export default function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError( + 'Request failed with status code ' + response.status, + [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} diff --git a/parent_dir/node_modules/axios/lib/core/transformData.js b/parent_dir/node_modules/axios/lib/core/transformData.js new file mode 100644 index 0000000..eeb5a8a --- /dev/null +++ b/parent_dir/node_modules/axios/lib/core/transformData.js @@ -0,0 +1,28 @@ +'use strict'; + +import utils from './../utils.js'; +import defaults from '../defaults/index.js'; +import AxiosHeaders from '../core/AxiosHeaders.js'; + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +export default function transformData(fns, response) { + const config = this || defaults; + const context = response || config; + const headers = AxiosHeaders.from(context.headers); + let data = context.data; + + utils.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} diff --git a/parent_dir/node_modules/axios/lib/defaults/index.js b/parent_dir/node_modules/axios/lib/defaults/index.js new file mode 100644 index 0000000..0b47602 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/defaults/index.js @@ -0,0 +1,166 @@ +'use strict'; + +import utils from '../utils.js'; +import AxiosError from '../core/AxiosError.js'; +import transitionalDefaults from './transitional.js'; +import toFormData from '../helpers/toFormData.js'; +import toURLEncodedForm from '../helpers/toURLEncodedForm.js'; +import platform from '../platform/index.js'; +import formDataToJSON from '../helpers/formDataToJSON.js'; + +const DEFAULT_CONTENT_TYPE = { + 'Content-Type': undefined +}; + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: transitionalDefaults, + + adapter: ['xhr', 'http'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = utils.isObject(data); + + if (isObjectPayload && utils.isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = utils.isFormData(data); + + if (isFormData) { + if (!hasJSONContentType) { + return data; + } + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + } + + if (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)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + + if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return toFormData( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + 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); +}); + +export default defaults; diff --git a/parent_dir/node_modules/axios/lib/defaults/transitional.js b/parent_dir/node_modules/axios/lib/defaults/transitional.js new file mode 100644 index 0000000..f891331 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/defaults/transitional.js @@ -0,0 +1,7 @@ +'use strict'; + +export default { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; diff --git a/parent_dir/node_modules/axios/lib/env/data.js b/parent_dir/node_modules/axios/lib/env/data.js new file mode 100644 index 0000000..dfce380 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/env/data.js @@ -0,0 +1 @@ +export const VERSION = "1.3.5"; \ No newline at end of file diff --git a/parent_dir/node_modules/axios/lib/helpers/AxiosURLSearchParams.js b/parent_dir/node_modules/axios/lib/helpers/AxiosURLSearchParams.js new file mode 100644 index 0000000..b9aa9f0 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/AxiosURLSearchParams.js @@ -0,0 +1,58 @@ +'use strict'; + +import toFormData from './toFormData.js'; + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && toFormData(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode); + } : encode; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +export default AxiosURLSearchParams; diff --git a/parent_dir/node_modules/axios/lib/helpers/HttpStatusCode.js b/parent_dir/node_modules/axios/lib/helpers/HttpStatusCode.js new file mode 100644 index 0000000..b3e7adc --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/HttpStatusCode.js @@ -0,0 +1,71 @@ +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); + +export default HttpStatusCode; diff --git a/parent_dir/node_modules/axios/lib/helpers/bind.js b/parent_dir/node_modules/axios/lib/helpers/bind.js new file mode 100644 index 0000000..b3aa83b --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/bind.js @@ -0,0 +1,7 @@ +'use strict'; + +export default function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} diff --git a/parent_dir/node_modules/axios/lib/helpers/buildURL.js b/parent_dir/node_modules/axios/lib/helpers/buildURL.js new file mode 100644 index 0000000..d769fdf --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/buildURL.js @@ -0,0 +1,63 @@ +'use strict'; + +import utils from '../utils.js'; +import AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js'; + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?object} options + * + * @returns {string} The formatted url + */ +export default function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils.isURLSearchParams(params) ? + params.toString() : + new AxiosURLSearchParams(params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} diff --git a/parent_dir/node_modules/axios/lib/helpers/combineURLs.js b/parent_dir/node_modules/axios/lib/helpers/combineURLs.js new file mode 100644 index 0000000..cba9a23 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/combineURLs.js @@ -0,0 +1,15 @@ +'use strict'; + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +export default function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} diff --git a/parent_dir/node_modules/axios/lib/helpers/cookies.js b/parent_dir/node_modules/axios/lib/helpers/cookies.js new file mode 100644 index 0000000..361493a --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/cookies.js @@ -0,0 +1,52 @@ +'use strict'; + +import utils from './../utils.js'; +import platform from '../platform/index.js'; + +export default platform.isStandardBrowserEnv ? + +// Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + const cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.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) { + const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + +// Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })(); diff --git a/parent_dir/node_modules/axios/lib/helpers/formDataToJSON.js b/parent_dir/node_modules/axios/lib/helpers/formDataToJSON.js new file mode 100644 index 0000000..f4581df --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/formDataToJSON.js @@ -0,0 +1,92 @@ +'use strict'; + +import utils from '../utils.js'; + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils.isArray(target) ? target.length : name; + + if (isLast) { + if (utils.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !utils.isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && utils.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (utils.isFormData(formData) && utils.isFunction(formData.entries)) { + const obj = {}; + + utils.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +export default formDataToJSON; diff --git a/parent_dir/node_modules/axios/lib/helpers/isAbsoluteURL.js b/parent_dir/node_modules/axios/lib/helpers/isAbsoluteURL.js new file mode 100644 index 0000000..4747a45 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/isAbsoluteURL.js @@ -0,0 +1,15 @@ +'use strict'; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +export default function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} diff --git a/parent_dir/node_modules/axios/lib/helpers/isAxiosError.js b/parent_dir/node_modules/axios/lib/helpers/isAxiosError.js new file mode 100644 index 0000000..da6cd63 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/isAxiosError.js @@ -0,0 +1,14 @@ +'use strict'; + +import utils from './../utils.js'; + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +export default function isAxiosError(payload) { + return utils.isObject(payload) && (payload.isAxiosError === true); +} diff --git a/parent_dir/node_modules/axios/lib/helpers/isURLSameOrigin.js b/parent_dir/node_modules/axios/lib/helpers/isURLSameOrigin.js new file mode 100644 index 0000000..18db03b --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/isURLSameOrigin.js @@ -0,0 +1,67 @@ +'use strict'; + +import utils from './../utils.js'; +import platform from '../platform/index.js'; + +export default platform.isStandardBrowserEnv ? + +// Standard browser envs have full support of the APIs needed to test +// whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement('a'); + let originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + let href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })(); diff --git a/parent_dir/node_modules/axios/lib/helpers/null.js b/parent_dir/node_modules/axios/lib/helpers/null.js new file mode 100644 index 0000000..b9f82c4 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/null.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line strict +export default null; diff --git a/parent_dir/node_modules/axios/lib/helpers/parseHeaders.js b/parent_dir/node_modules/axios/lib/helpers/parseHeaders.js new file mode 100644 index 0000000..50af948 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/parseHeaders.js @@ -0,0 +1,55 @@ +'use strict'; + +import utils from './../utils.js'; + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = utils.toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +export default rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}; diff --git a/parent_dir/node_modules/axios/lib/helpers/parseProtocol.js b/parent_dir/node_modules/axios/lib/helpers/parseProtocol.js new file mode 100644 index 0000000..586ec96 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/parseProtocol.js @@ -0,0 +1,6 @@ +'use strict'; + +export default function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} diff --git a/parent_dir/node_modules/axios/lib/helpers/speedometer.js b/parent_dir/node_modules/axios/lib/helpers/speedometer.js new file mode 100644 index 0000000..3b3c666 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/speedometer.js @@ -0,0 +1,55 @@ +'use strict'; + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +export default speedometer; diff --git a/parent_dir/node_modules/axios/lib/helpers/spread.js b/parent_dir/node_modules/axios/lib/helpers/spread.js new file mode 100644 index 0000000..13479cb --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/spread.js @@ -0,0 +1,28 @@ +'use strict'; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +export default function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} diff --git a/parent_dir/node_modules/axios/lib/helpers/toFormData.js b/parent_dir/node_modules/axios/lib/helpers/toFormData.js new file mode 100644 index 0000000..a41e966 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/toFormData.js @@ -0,0 +1,219 @@ +'use strict'; + +import utils from '../utils.js'; +import AxiosError from '../core/AxiosError.js'; +// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored +import PlatformFormData from '../platform/node/classes/FormData.js'; + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return utils.isPlainObject(thing) || utils.isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return utils.endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return utils.isArray(arr) && !arr.some(isVisitable); +} + +const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData(obj, formData, options) { + if (!utils.isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (PlatformFormData || FormData)(); + + // eslint-disable-next-line no-param-reassign + options = utils.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !utils.isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && utils.isSpecCompliantForm(formData); + + if (!utils.isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (utils.isDate(value)) { + return value.toISOString(); + } + + if (!useBlob && utils.isBlob(value)) { + throw new AxiosError('Blob is not supported. Use a Buffer instead.'); + } + + if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (utils.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (utils.isArray(value) && isFlatArray(value)) || + ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(utils.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (utils.isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + utils.forEach(value, function each(el, key) { + const result = !(utils.isUndefined(el) || el === null) && visitor.call( + formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!utils.isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +export default toFormData; diff --git a/parent_dir/node_modules/axios/lib/helpers/toURLEncodedForm.js b/parent_dir/node_modules/axios/lib/helpers/toURLEncodedForm.js new file mode 100644 index 0000000..988a38a --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/toURLEncodedForm.js @@ -0,0 +1,18 @@ +'use strict'; + +import utils from '../utils.js'; +import toFormData from './toFormData.js'; +import platform from '../platform/index.js'; + +export default function toURLEncodedForm(data, options) { + return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({ + visitor: function(value, key, path, helpers) { + if (platform.isNode && utils.isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); +} diff --git a/parent_dir/node_modules/axios/lib/helpers/validator.js b/parent_dir/node_modules/axios/lib/helpers/validator.js new file mode 100644 index 0000000..14b4696 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/helpers/validator.js @@ -0,0 +1,91 @@ +'use strict'; + +import {VERSION} from '../env/data.js'; +import AxiosError from '../core/AxiosError.js'; + +const validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new AxiosError( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + AxiosError.ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + } + } +} + +export default { + assertOptions, + validators +}; diff --git a/parent_dir/node_modules/axios/lib/platform/browser/classes/Blob.js b/parent_dir/node_modules/axios/lib/platform/browser/classes/Blob.js new file mode 100644 index 0000000..6c506c4 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/platform/browser/classes/Blob.js @@ -0,0 +1,3 @@ +'use strict' + +export default typeof Blob !== 'undefined' ? Blob : null diff --git a/parent_dir/node_modules/axios/lib/platform/browser/classes/FormData.js b/parent_dir/node_modules/axios/lib/platform/browser/classes/FormData.js new file mode 100644 index 0000000..f36d31b --- /dev/null +++ b/parent_dir/node_modules/axios/lib/platform/browser/classes/FormData.js @@ -0,0 +1,3 @@ +'use strict'; + +export default typeof FormData !== 'undefined' ? FormData : null; diff --git a/parent_dir/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js b/parent_dir/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js new file mode 100644 index 0000000..b7dae95 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js @@ -0,0 +1,4 @@ +'use strict'; + +import AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js'; +export default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; diff --git a/parent_dir/node_modules/axios/lib/platform/browser/index.js b/parent_dir/node_modules/axios/lib/platform/browser/index.js new file mode 100644 index 0000000..4d2203f --- /dev/null +++ b/parent_dir/node_modules/axios/lib/platform/browser/index.js @@ -0,0 +1,64 @@ +import URLSearchParams from './classes/URLSearchParams.js' +import FormData from './classes/FormData.js' +import Blob from './classes/Blob.js' + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const isStandardBrowserEnv = (() => { + let product; + if (typeof navigator !== 'undefined' && ( + (product = navigator.product) === 'ReactNative' || + product === 'NativeScript' || + product === 'NS') + ) { + return false; + } + + return typeof window !== 'undefined' && typeof document !== 'undefined'; +})(); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ + const isStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + + +export default { + isBrowser: true, + classes: { + URLSearchParams, + FormData, + Blob + }, + isStandardBrowserEnv, + isStandardBrowserWebWorkerEnv, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] +}; diff --git a/parent_dir/node_modules/axios/lib/utils.js b/parent_dir/node_modules/axios/lib/utils.js new file mode 100644 index 0000000..6a38872 --- /dev/null +++ b/parent_dir/node_modules/axios/lib/utils.js @@ -0,0 +1,711 @@ +'use strict'; + +import bind from './helpers/bind.js'; + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +} + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); +} + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + const pattern = '[object FormData]'; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || + toString.call(thing) === pattern || + (isFunction(thing.toString) && thing.toString() === pattern) + ); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; + } + } + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +} + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +} + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +} + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +} + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[Symbol.iterator]; + + const iterator = generator.call(obj); + + let result; + + while ((result = iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +} + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +} + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + if (reducer(descriptor, name, obj) !== false) { + reducedDescriptors[name] = descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +} + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +} + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + } + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +} + +const noop = () => {} + +const toFiniteNumber = (value, defaultValue) => { + value = +value; + return Number.isFinite(value) ? value : defaultValue; +} + +const ALPHA = 'abcdefghijklmnopqrstuvwxyz' + +const DIGIT = '0123456789'; + +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +} + +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + while (size--) { + str += alphabet[Math.random() * length|0] + } + + return str; +} + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + } + + return visit(obj, 0); +} + +export default { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + ALPHABET, + generateString, + isSpecCompliantForm, + toJSONObject +}; diff --git a/parent_dir/node_modules/bowser/src/bowser.js b/parent_dir/node_modules/bowser/src/bowser.js new file mode 100644 index 0000000..f79e6e0 --- /dev/null +++ b/parent_dir/node_modules/bowser/src/bowser.js @@ -0,0 +1,77 @@ +/*! + * Bowser - a browser detector + * https://github.com/lancedikson/bowser + * MIT License | (c) Dustin Diaz 2012-2015 + * MIT License | (c) Denis Demchenko 2015-2019 + */ +import Parser from './parser.js'; +import { + BROWSER_MAP, + ENGINE_MAP, + OS_MAP, + PLATFORMS_MAP, +} from './constants.js'; + +/** + * Bowser class. + * Keep it simple as much as it can be. + * It's supposed to work with collections of {@link Parser} instances + * rather then solve one-instance problems. + * All the one-instance stuff is located in Parser class. + * + * @class + * @classdesc Bowser is a static object, that provides an API to the Parsers + * @hideconstructor + */ +class Bowser { + /** + * Creates a {@link Parser} instance + * + * @param {String} UA UserAgent string + * @param {Boolean} [skipParsing=false] Will make the Parser postpone parsing until you ask it + * explicitly. Same as `skipParsing` for {@link Parser}. + * @returns {Parser} + * @throws {Error} when UA is not a String + * + * @example + * const parser = Bowser.getParser(window.navigator.userAgent); + * const result = parser.getResult(); + */ + static getParser(UA, skipParsing = false) { + if (typeof UA !== 'string') { + throw new Error('UserAgent should be a string'); + } + return new Parser(UA, skipParsing); + } + + /** + * Creates a {@link Parser} instance and runs {@link Parser.getResult} immediately + * + * @param UA + * @return {ParsedResult} + * + * @example + * const result = Bowser.parse(window.navigator.userAgent); + */ + static parse(UA) { + return (new Parser(UA)).getResult(); + } + + static get BROWSER_MAP() { + return BROWSER_MAP; + } + + static get ENGINE_MAP() { + return ENGINE_MAP; + } + + static get OS_MAP() { + return OS_MAP; + } + + static get PLATFORMS_MAP() { + return PLATFORMS_MAP; + } +} + +export default Bowser; diff --git a/parent_dir/node_modules/bowser/src/constants.js b/parent_dir/node_modules/bowser/src/constants.js new file mode 100644 index 0000000..f335032 --- /dev/null +++ b/parent_dir/node_modules/bowser/src/constants.js @@ -0,0 +1,116 @@ +// NOTE: this list must be up-to-date with browsers listed in +// test/acceptance/useragentstrings.yml +export const BROWSER_ALIASES_MAP = { + 'Amazon Silk': 'amazon_silk', + 'Android Browser': 'android', + Bada: 'bada', + BlackBerry: 'blackberry', + Chrome: 'chrome', + Chromium: 'chromium', + Electron: 'electron', + Epiphany: 'epiphany', + Firefox: 'firefox', + Focus: 'focus', + Generic: 'generic', + 'Google Search': 'google_search', + Googlebot: 'googlebot', + 'Internet Explorer': 'ie', + 'K-Meleon': 'k_meleon', + Maxthon: 'maxthon', + 'Microsoft Edge': 'edge', + 'MZ Browser': 'mz', + 'NAVER Whale Browser': 'naver', + Opera: 'opera', + 'Opera Coast': 'opera_coast', + PhantomJS: 'phantomjs', + Puffin: 'puffin', + QupZilla: 'qupzilla', + QQ: 'qq', + QQLite: 'qqlite', + Safari: 'safari', + Sailfish: 'sailfish', + 'Samsung Internet for Android': 'samsung_internet', + SeaMonkey: 'seamonkey', + Sleipnir: 'sleipnir', + Swing: 'swing', + Tizen: 'tizen', + 'UC Browser': 'uc', + Vivaldi: 'vivaldi', + 'WebOS Browser': 'webos', + WeChat: 'wechat', + 'Yandex Browser': 'yandex', + Roku: 'roku', +}; + +export const BROWSER_MAP = { + amazon_silk: 'Amazon Silk', + android: 'Android Browser', + bada: 'Bada', + blackberry: 'BlackBerry', + chrome: 'Chrome', + chromium: 'Chromium', + electron: 'Electron', + epiphany: 'Epiphany', + firefox: 'Firefox', + focus: 'Focus', + generic: 'Generic', + googlebot: 'Googlebot', + google_search: 'Google Search', + ie: 'Internet Explorer', + k_meleon: 'K-Meleon', + maxthon: 'Maxthon', + edge: 'Microsoft Edge', + mz: 'MZ Browser', + naver: 'NAVER Whale Browser', + opera: 'Opera', + opera_coast: 'Opera Coast', + phantomjs: 'PhantomJS', + puffin: 'Puffin', + qupzilla: 'QupZilla', + qq: 'QQ Browser', + qqlite: 'QQ Browser Lite', + safari: 'Safari', + sailfish: 'Sailfish', + samsung_internet: 'Samsung Internet for Android', + seamonkey: 'SeaMonkey', + sleipnir: 'Sleipnir', + swing: 'Swing', + tizen: 'Tizen', + uc: 'UC Browser', + vivaldi: 'Vivaldi', + webos: 'WebOS Browser', + wechat: 'WeChat', + yandex: 'Yandex Browser', +}; + +export const PLATFORMS_MAP = { + tablet: 'tablet', + mobile: 'mobile', + desktop: 'desktop', + tv: 'tv', +}; + +export const OS_MAP = { + WindowsPhone: 'Windows Phone', + Windows: 'Windows', + MacOS: 'macOS', + iOS: 'iOS', + Android: 'Android', + WebOS: 'WebOS', + BlackBerry: 'BlackBerry', + Bada: 'Bada', + Tizen: 'Tizen', + Linux: 'Linux', + ChromeOS: 'Chrome OS', + PlayStation4: 'PlayStation 4', + Roku: 'Roku', +}; + +export const ENGINE_MAP = { + EdgeHTML: 'EdgeHTML', + Blink: 'Blink', + Trident: 'Trident', + Presto: 'Presto', + Gecko: 'Gecko', + WebKit: 'WebKit', +}; diff --git a/parent_dir/node_modules/bowser/src/parser-browsers.js b/parent_dir/node_modules/bowser/src/parser-browsers.js new file mode 100644 index 0000000..ee7840c --- /dev/null +++ b/parent_dir/node_modules/bowser/src/parser-browsers.js @@ -0,0 +1,700 @@ +/** + * Browsers' descriptors + * + * The idea of descriptors is simple. You should know about them two simple things: + * 1. Every descriptor has a method or property called `test` and a `describe` method. + * 2. Order of descriptors is important. + * + * More details: + * 1. Method or property `test` serves as a way to detect whether the UA string + * matches some certain browser or not. The `describe` method helps to make a result + * object with params that show some browser-specific things: name, version, etc. + * 2. Order of descriptors is important because a Parser goes through them one by one + * in course. For example, if you insert Chrome's descriptor as the first one, + * more then a half of browsers will be described as Chrome, because they will pass + * the Chrome descriptor's test. + * + * Descriptor's `test` could be a property with an array of RegExps, where every RegExp + * will be applied to a UA string to test it whether it matches or not. + * If a descriptor has two or more regexps in the `test` array it tests them one by one + * with a logical sum operation. Parser stops if it has found any RegExp that matches the UA. + * + * Or `test` could be a method. In that case it gets a Parser instance and should + * return true/false to get the Parser know if this browser descriptor matches the UA or not. + */ + +import Utils from './utils.js'; + +const commonVersionIdentifier = /version\/(\d+(\.?_?\d+)+)/i; + +const browsersList = [ + /* Googlebot */ + { + test: [/googlebot/i], + describe(ua) { + const browser = { + name: 'Googlebot', + }; + const version = Utils.getFirstMatch(/googlebot\/(\d+(\.\d+))/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + + /* Opera < 13.0 */ + { + test: [/opera/i], + describe(ua) { + const browser = { + name: 'Opera', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + + /* Opera > 13.0 */ + { + test: [/opr\/|opios/i], + describe(ua) { + const browser = { + name: 'Opera', + }; + const version = Utils.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/SamsungBrowser/i], + describe(ua) { + const browser = { + name: 'Samsung Internet for Android', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/Whale/i], + describe(ua) { + const browser = { + name: 'NAVER Whale Browser', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/MZBrowser/i], + describe(ua) { + const browser = { + name: 'MZ Browser', + }; + const version = Utils.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/focus/i], + describe(ua) { + const browser = { + name: 'Focus', + }; + const version = Utils.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/swing/i], + describe(ua) { + const browser = { + name: 'Swing', + }; + const version = Utils.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/coast/i], + describe(ua) { + const browser = { + name: 'Opera Coast', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/opt\/\d+(?:.?_?\d+)+/i], + describe(ua) { + const browser = { + name: 'Opera Touch', + }; + const version = Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/yabrowser/i], + describe(ua) { + const browser = { + name: 'Yandex Browser', + }; + const version = Utils.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/ucbrowser/i], + describe(ua) { + const browser = { + name: 'UC Browser', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/Maxthon|mxios/i], + describe(ua) { + const browser = { + name: 'Maxthon', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/epiphany/i], + describe(ua) { + const browser = { + name: 'Epiphany', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/puffin/i], + describe(ua) { + const browser = { + name: 'Puffin', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/sleipnir/i], + describe(ua) { + const browser = { + name: 'Sleipnir', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/k-meleon/i], + describe(ua) { + const browser = { + name: 'K-Meleon', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/micromessenger/i], + describe(ua) { + const browser = { + name: 'WeChat', + }; + const version = Utils.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/qqbrowser/i], + describe(ua) { + const browser = { + name: (/qqbrowserlite/i).test(ua) ? 'QQ Browser Lite' : 'QQ Browser', + }; + const version = Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/msie|trident/i], + describe(ua) { + const browser = { + name: 'Internet Explorer', + }; + const version = Utils.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/\sedg\//i], + describe(ua) { + const browser = { + name: 'Microsoft Edge', + }; + + const version = Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/edg([ea]|ios)/i], + describe(ua) { + const browser = { + name: 'Microsoft Edge', + }; + + const version = Utils.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/vivaldi/i], + describe(ua) { + const browser = { + name: 'Vivaldi', + }; + const version = Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/seamonkey/i], + describe(ua) { + const browser = { + name: 'SeaMonkey', + }; + const version = Utils.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/sailfish/i], + describe(ua) { + const browser = { + name: 'Sailfish', + }; + + const version = Utils.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/silk/i], + describe(ua) { + const browser = { + name: 'Amazon Silk', + }; + const version = Utils.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/phantom/i], + describe(ua) { + const browser = { + name: 'PhantomJS', + }; + const version = Utils.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/slimerjs/i], + describe(ua) { + const browser = { + name: 'SlimerJS', + }; + const version = Utils.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/blackberry|\bbb\d+/i, /rim\stablet/i], + describe(ua) { + const browser = { + name: 'BlackBerry', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/(web|hpw)[o0]s/i], + describe(ua) { + const browser = { + name: 'WebOS Browser', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/bada/i], + describe(ua) { + const browser = { + name: 'Bada', + }; + const version = Utils.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/tizen/i], + describe(ua) { + const browser = { + name: 'Tizen', + }; + const version = Utils.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/qupzilla/i], + describe(ua) { + const browser = { + name: 'QupZilla', + }; + const version = Utils.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/firefox|iceweasel|fxios/i], + describe(ua) { + const browser = { + name: 'Firefox', + }; + const version = Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/electron/i], + describe(ua) { + const browser = { + name: 'Electron', + }; + const version = Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/MiuiBrowser/i], + describe(ua) { + const browser = { + name: 'Miui', + }; + const version = Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/chromium/i], + describe(ua) { + const browser = { + name: 'Chromium', + }; + const version = Utils.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/chrome|crios|crmo/i], + describe(ua) { + const browser = { + name: 'Chrome', + }; + const version = Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/GSA/i], + describe(ua) { + const browser = { + name: 'Google Search', + }; + const version = Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + + /* Android Browser */ + { + test(parser) { + const notLikeAndroid = !parser.test(/like android/i); + const butAndroid = parser.test(/android/i); + return notLikeAndroid && butAndroid; + }, + describe(ua) { + const browser = { + name: 'Android Browser', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + + /* PlayStation 4 */ + { + test: [/playstation 4/i], + describe(ua) { + const browser = { + name: 'PlayStation 4', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + + /* Safari */ + { + test: [/safari|applewebkit/i], + describe(ua) { + const browser = { + name: 'Safari', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + + /* Something else */ + { + test: [/.*/i], + describe(ua) { + /* Here we try to make sure that there are explicit details about the device + * in order to decide what regexp exactly we want to apply + * (as there is a specific decision based on that conclusion) + */ + const regexpWithoutDeviceSpec = /^(.*)\/(.*) /; + const regexpWithDeviceSpec = /^(.*)\/(.*)[ \t]\((.*)/; + const hasDeviceSpec = ua.search('\\(') !== -1; + const regexp = hasDeviceSpec ? regexpWithDeviceSpec : regexpWithoutDeviceSpec; + return { + name: Utils.getFirstMatch(regexp, ua), + version: Utils.getSecondMatch(regexp, ua), + }; + }, + }, +]; + +export default browsersList; diff --git a/parent_dir/node_modules/bowser/src/parser-engines.js b/parent_dir/node_modules/bowser/src/parser-engines.js new file mode 100644 index 0000000..d46d0e5 --- /dev/null +++ b/parent_dir/node_modules/bowser/src/parser-engines.js @@ -0,0 +1,120 @@ +import Utils from './utils.js'; +import { ENGINE_MAP } from './constants.js'; + +/* + * More specific goes first + */ +export default [ + /* EdgeHTML */ + { + test(parser) { + return parser.getBrowserName(true) === 'microsoft edge'; + }, + describe(ua) { + const isBlinkBased = /\sedg\//i.test(ua); + + // return blink if it's blink-based one + if (isBlinkBased) { + return { + name: ENGINE_MAP.Blink, + }; + } + + // otherwise match the version and return EdgeHTML + const version = Utils.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i, ua); + + return { + name: ENGINE_MAP.EdgeHTML, + version, + }; + }, + }, + + /* Trident */ + { + test: [/trident/i], + describe(ua) { + const engine = { + name: ENGINE_MAP.Trident, + }; + + const version = Utils.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + engine.version = version; + } + + return engine; + }, + }, + + /* Presto */ + { + test(parser) { + return parser.test(/presto/i); + }, + describe(ua) { + const engine = { + name: ENGINE_MAP.Presto, + }; + + const version = Utils.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + engine.version = version; + } + + return engine; + }, + }, + + /* Gecko */ + { + test(parser) { + const isGecko = parser.test(/gecko/i); + const likeGecko = parser.test(/like gecko/i); + return isGecko && !likeGecko; + }, + describe(ua) { + const engine = { + name: ENGINE_MAP.Gecko, + }; + + const version = Utils.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + engine.version = version; + } + + return engine; + }, + }, + + /* Blink */ + { + test: [/(apple)?webkit\/537\.36/i], + describe() { + return { + name: ENGINE_MAP.Blink, + }; + }, + }, + + /* WebKit */ + { + test: [/(apple)?webkit/i], + describe(ua) { + const engine = { + name: ENGINE_MAP.WebKit, + }; + + const version = Utils.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + engine.version = version; + } + + return engine; + }, + }, +]; diff --git a/parent_dir/node_modules/bowser/src/parser-os.js b/parent_dir/node_modules/bowser/src/parser-os.js new file mode 100644 index 0000000..4c516dd --- /dev/null +++ b/parent_dir/node_modules/bowser/src/parser-os.js @@ -0,0 +1,199 @@ +import Utils from './utils.js'; +import { OS_MAP } from './constants.js'; + +export default [ + /* Roku */ + { + test: [/Roku\/DVP/], + describe(ua) { + const version = Utils.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i, ua); + return { + name: OS_MAP.Roku, + version, + }; + }, + }, + + /* Windows Phone */ + { + test: [/windows phone/i], + describe(ua) { + const version = Utils.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i, ua); + return { + name: OS_MAP.WindowsPhone, + version, + }; + }, + }, + + /* Windows */ + { + test: [/windows /i], + describe(ua) { + const version = Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i, ua); + const versionName = Utils.getWindowsVersionName(version); + + return { + name: OS_MAP.Windows, + version, + versionName, + }; + }, + }, + + /* Firefox on iPad */ + { + test: [/Macintosh(.*?) FxiOS(.*?)\//], + describe(ua) { + const result = { + name: OS_MAP.iOS, + }; + const version = Utils.getSecondMatch(/(Version\/)(\d[\d.]+)/, ua); + if (version) { + result.version = version; + } + return result; + }, + }, + + /* macOS */ + { + test: [/macintosh/i], + describe(ua) { + const version = Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, ua).replace(/[_\s]/g, '.'); + const versionName = Utils.getMacOSVersionName(version); + + const os = { + name: OS_MAP.MacOS, + version, + }; + if (versionName) { + os.versionName = versionName; + } + return os; + }, + }, + + /* iOS */ + { + test: [/(ipod|iphone|ipad)/i], + describe(ua) { + const version = Utils.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i, ua).replace(/[_\s]/g, '.'); + + return { + name: OS_MAP.iOS, + version, + }; + }, + }, + + /* Android */ + { + test(parser) { + const notLikeAndroid = !parser.test(/like android/i); + const butAndroid = parser.test(/android/i); + return notLikeAndroid && butAndroid; + }, + describe(ua) { + const version = Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i, ua); + const versionName = Utils.getAndroidVersionName(version); + const os = { + name: OS_MAP.Android, + version, + }; + if (versionName) { + os.versionName = versionName; + } + return os; + }, + }, + + /* WebOS */ + { + test: [/(web|hpw)[o0]s/i], + describe(ua) { + const version = Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i, ua); + const os = { + name: OS_MAP.WebOS, + }; + + if (version && version.length) { + os.version = version; + } + return os; + }, + }, + + /* BlackBerry */ + { + test: [/blackberry|\bbb\d+/i, /rim\stablet/i], + describe(ua) { + const version = Utils.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i, ua) + || Utils.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i, ua) + || Utils.getFirstMatch(/\bbb(\d+)/i, ua); + + return { + name: OS_MAP.BlackBerry, + version, + }; + }, + }, + + /* Bada */ + { + test: [/bada/i], + describe(ua) { + const version = Utils.getFirstMatch(/bada\/(\d+(\.\d+)*)/i, ua); + + return { + name: OS_MAP.Bada, + version, + }; + }, + }, + + /* Tizen */ + { + test: [/tizen/i], + describe(ua) { + const version = Utils.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i, ua); + + return { + name: OS_MAP.Tizen, + version, + }; + }, + }, + + /* Linux */ + { + test: [/linux/i], + describe() { + return { + name: OS_MAP.Linux, + }; + }, + }, + + /* Chrome OS */ + { + test: [/CrOS/], + describe() { + return { + name: OS_MAP.ChromeOS, + }; + }, + }, + + /* Playstation 4 */ + { + test: [/PlayStation 4/], + describe(ua) { + const version = Utils.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i, ua); + return { + name: OS_MAP.PlayStation4, + version, + }; + }, + }, +]; diff --git a/parent_dir/node_modules/bowser/src/parser-platforms.js b/parent_dir/node_modules/bowser/src/parser-platforms.js new file mode 100644 index 0000000..48b1eb1 --- /dev/null +++ b/parent_dir/node_modules/bowser/src/parser-platforms.js @@ -0,0 +1,266 @@ +import Utils from './utils.js'; +import { PLATFORMS_MAP } from './constants.js'; + +/* + * Tablets go first since usually they have more specific + * signs to detect. + */ + +export default [ + /* Googlebot */ + { + test: [/googlebot/i], + describe() { + return { + type: 'bot', + vendor: 'Google', + }; + }, + }, + + /* Huawei */ + { + test: [/huawei/i], + describe(ua) { + const model = Utils.getFirstMatch(/(can-l01)/i, ua) && 'Nova'; + const platform = { + type: PLATFORMS_MAP.mobile, + vendor: 'Huawei', + }; + if (model) { + platform.model = model; + } + return platform; + }, + }, + + /* Nexus Tablet */ + { + test: [/nexus\s*(?:7|8|9|10).*/i], + describe() { + return { + type: PLATFORMS_MAP.tablet, + vendor: 'Nexus', + }; + }, + }, + + /* iPad */ + { + test: [/ipad/i], + describe() { + return { + type: PLATFORMS_MAP.tablet, + vendor: 'Apple', + model: 'iPad', + }; + }, + }, + + /* Firefox on iPad */ + { + test: [/Macintosh(.*?) FxiOS(.*?)\//], + describe() { + return { + type: PLATFORMS_MAP.tablet, + vendor: 'Apple', + model: 'iPad', + }; + }, + }, + + /* Amazon Kindle Fire */ + { + test: [/kftt build/i], + describe() { + return { + type: PLATFORMS_MAP.tablet, + vendor: 'Amazon', + model: 'Kindle Fire HD 7', + }; + }, + }, + + /* Another Amazon Tablet with Silk */ + { + test: [/silk/i], + describe() { + return { + type: PLATFORMS_MAP.tablet, + vendor: 'Amazon', + }; + }, + }, + + /* Tablet */ + { + test: [/tablet(?! pc)/i], + describe() { + return { + type: PLATFORMS_MAP.tablet, + }; + }, + }, + + /* iPod/iPhone */ + { + test(parser) { + const iDevice = parser.test(/ipod|iphone/i); + const likeIDevice = parser.test(/like (ipod|iphone)/i); + return iDevice && !likeIDevice; + }, + describe(ua) { + const model = Utils.getFirstMatch(/(ipod|iphone)/i, ua); + return { + type: PLATFORMS_MAP.mobile, + vendor: 'Apple', + model, + }; + }, + }, + + /* Nexus Mobile */ + { + test: [/nexus\s*[0-6].*/i, /galaxy nexus/i], + describe() { + return { + type: PLATFORMS_MAP.mobile, + vendor: 'Nexus', + }; + }, + }, + + /* Mobile */ + { + test: [/[^-]mobi/i], + describe() { + return { + type: PLATFORMS_MAP.mobile, + }; + }, + }, + + /* BlackBerry */ + { + test(parser) { + return parser.getBrowserName(true) === 'blackberry'; + }, + describe() { + return { + type: PLATFORMS_MAP.mobile, + vendor: 'BlackBerry', + }; + }, + }, + + /* Bada */ + { + test(parser) { + return parser.getBrowserName(true) === 'bada'; + }, + describe() { + return { + type: PLATFORMS_MAP.mobile, + }; + }, + }, + + /* Windows Phone */ + { + test(parser) { + return parser.getBrowserName() === 'windows phone'; + }, + describe() { + return { + type: PLATFORMS_MAP.mobile, + vendor: 'Microsoft', + }; + }, + }, + + /* Android Tablet */ + { + test(parser) { + const osMajorVersion = Number(String(parser.getOSVersion()).split('.')[0]); + return parser.getOSName(true) === 'android' && (osMajorVersion >= 3); + }, + describe() { + return { + type: PLATFORMS_MAP.tablet, + }; + }, + }, + + /* Android Mobile */ + { + test(parser) { + return parser.getOSName(true) === 'android'; + }, + describe() { + return { + type: PLATFORMS_MAP.mobile, + }; + }, + }, + + /* desktop */ + { + test(parser) { + return parser.getOSName(true) === 'macos'; + }, + describe() { + return { + type: PLATFORMS_MAP.desktop, + vendor: 'Apple', + }; + }, + }, + + /* Windows */ + { + test(parser) { + return parser.getOSName(true) === 'windows'; + }, + describe() { + return { + type: PLATFORMS_MAP.desktop, + }; + }, + }, + + /* Linux */ + { + test(parser) { + return parser.getOSName(true) === 'linux'; + }, + describe() { + return { + type: PLATFORMS_MAP.desktop, + }; + }, + }, + + /* PlayStation 4 */ + { + test(parser) { + return parser.getOSName(true) === 'playstation 4'; + }, + describe() { + return { + type: PLATFORMS_MAP.tv, + }; + }, + }, + + /* Roku */ + { + test(parser) { + return parser.getOSName(true) === 'roku'; + }, + describe() { + return { + type: PLATFORMS_MAP.tv, + }; + }, + }, +]; diff --git a/parent_dir/node_modules/bowser/src/parser.js b/parent_dir/node_modules/bowser/src/parser.js new file mode 100644 index 0000000..c87d0e1 --- /dev/null +++ b/parent_dir/node_modules/bowser/src/parser.js @@ -0,0 +1,496 @@ +import browserParsersList from './parser-browsers.js'; +import osParsersList from './parser-os.js'; +import platformParsersList from './parser-platforms.js'; +import enginesParsersList from './parser-engines.js'; +import Utils from './utils.js'; + +/** + * The main class that arranges the whole parsing process. + */ +class Parser { + /** + * Create instance of Parser + * + * @param {String} UA User-Agent string + * @param {Boolean} [skipParsing=false] parser can skip parsing in purpose of performance + * improvements if you need to make a more particular parsing + * like {@link Parser#parseBrowser} or {@link Parser#parsePlatform} + * + * @throw {Error} in case of empty UA String + * + * @constructor + */ + constructor(UA, skipParsing = false) { + if (UA === void (0) || UA === null || UA === '') { + throw new Error("UserAgent parameter can't be empty"); + } + + this._ua = UA; + + /** + * @typedef ParsedResult + * @property {Object} browser + * @property {String|undefined} [browser.name] + * Browser name, like `"Chrome"` or `"Internet Explorer"` + * @property {String|undefined} [browser.version] Browser version as a String `"12.01.45334.10"` + * @property {Object} os + * @property {String|undefined} [os.name] OS name, like `"Windows"` or `"macOS"` + * @property {String|undefined} [os.version] OS version, like `"NT 5.1"` or `"10.11.1"` + * @property {String|undefined} [os.versionName] OS name, like `"XP"` or `"High Sierra"` + * @property {Object} platform + * @property {String|undefined} [platform.type] + * platform type, can be either `"desktop"`, `"tablet"` or `"mobile"` + * @property {String|undefined} [platform.vendor] Vendor of the device, + * like `"Apple"` or `"Samsung"` + * @property {String|undefined} [platform.model] Device model, + * like `"iPhone"` or `"Kindle Fire HD 7"` + * @property {Object} engine + * @property {String|undefined} [engine.name] + * Can be any of this: `WebKit`, `Blink`, `Gecko`, `Trident`, `Presto`, `EdgeHTML` + * @property {String|undefined} [engine.version] String version of the engine + */ + this.parsedResult = {}; + + if (skipParsing !== true) { + this.parse(); + } + } + + /** + * Get UserAgent string of current Parser instance + * @return {String} User-Agent String of the current object + * + * @public + */ + getUA() { + return this._ua; + } + + /** + * Test a UA string for a regexp + * @param {RegExp} regex + * @return {Boolean} + */ + test(regex) { + return regex.test(this._ua); + } + + /** + * Get parsed browser object + * @return {Object} + */ + parseBrowser() { + this.parsedResult.browser = {}; + + const browserDescriptor = Utils.find(browserParsersList, (_browser) => { + if (typeof _browser.test === 'function') { + return _browser.test(this); + } + + if (_browser.test instanceof Array) { + return _browser.test.some(condition => this.test(condition)); + } + + throw new Error("Browser's test function is not valid"); + }); + + if (browserDescriptor) { + this.parsedResult.browser = browserDescriptor.describe(this.getUA()); + } + + return this.parsedResult.browser; + } + + /** + * Get parsed browser object + * @return {Object} + * + * @public + */ + getBrowser() { + if (this.parsedResult.browser) { + return this.parsedResult.browser; + } + + return this.parseBrowser(); + } + + /** + * Get browser's name + * @return {String} Browser's name or an empty string + * + * @public + */ + getBrowserName(toLowerCase) { + if (toLowerCase) { + return String(this.getBrowser().name).toLowerCase() || ''; + } + return this.getBrowser().name || ''; + } + + + /** + * Get browser's version + * @return {String} version of browser + * + * @public + */ + getBrowserVersion() { + return this.getBrowser().version; + } + + /** + * Get OS + * @return {Object} + * + * @example + * this.getOS(); + * { + * name: 'macOS', + * version: '10.11.12' + * } + */ + getOS() { + if (this.parsedResult.os) { + return this.parsedResult.os; + } + + return this.parseOS(); + } + + /** + * Parse OS and save it to this.parsedResult.os + * @return {*|{}} + */ + parseOS() { + this.parsedResult.os = {}; + + const os = Utils.find(osParsersList, (_os) => { + if (typeof _os.test === 'function') { + return _os.test(this); + } + + if (_os.test instanceof Array) { + return _os.test.some(condition => this.test(condition)); + } + + throw new Error("Browser's test function is not valid"); + }); + + if (os) { + this.parsedResult.os = os.describe(this.getUA()); + } + + return this.parsedResult.os; + } + + /** + * Get OS name + * @param {Boolean} [toLowerCase] return lower-cased value + * @return {String} name of the OS — macOS, Windows, Linux, etc. + */ + getOSName(toLowerCase) { + const { name } = this.getOS(); + + if (toLowerCase) { + return String(name).toLowerCase() || ''; + } + + return name || ''; + } + + /** + * Get OS version + * @return {String} full version with dots ('10.11.12', '5.6', etc) + */ + getOSVersion() { + return this.getOS().version; + } + + /** + * Get parsed platform + * @return {{}} + */ + getPlatform() { + if (this.parsedResult.platform) { + return this.parsedResult.platform; + } + + return this.parsePlatform(); + } + + /** + * Get platform name + * @param {Boolean} [toLowerCase=false] + * @return {*} + */ + getPlatformType(toLowerCase = false) { + const { type } = this.getPlatform(); + + if (toLowerCase) { + return String(type).toLowerCase() || ''; + } + + return type || ''; + } + + /** + * Get parsed platform + * @return {{}} + */ + parsePlatform() { + this.parsedResult.platform = {}; + + const platform = Utils.find(platformParsersList, (_platform) => { + if (typeof _platform.test === 'function') { + return _platform.test(this); + } + + if (_platform.test instanceof Array) { + return _platform.test.some(condition => this.test(condition)); + } + + throw new Error("Browser's test function is not valid"); + }); + + if (platform) { + this.parsedResult.platform = platform.describe(this.getUA()); + } + + return this.parsedResult.platform; + } + + /** + * Get parsed engine + * @return {{}} + */ + getEngine() { + if (this.parsedResult.engine) { + return this.parsedResult.engine; + } + + return this.parseEngine(); + } + + /** + * Get engines's name + * @return {String} Engines's name or an empty string + * + * @public + */ + getEngineName(toLowerCase) { + if (toLowerCase) { + return String(this.getEngine().name).toLowerCase() || ''; + } + return this.getEngine().name || ''; + } + + /** + * Get parsed platform + * @return {{}} + */ + parseEngine() { + this.parsedResult.engine = {}; + + const engine = Utils.find(enginesParsersList, (_engine) => { + if (typeof _engine.test === 'function') { + return _engine.test(this); + } + + if (_engine.test instanceof Array) { + return _engine.test.some(condition => this.test(condition)); + } + + throw new Error("Browser's test function is not valid"); + }); + + if (engine) { + this.parsedResult.engine = engine.describe(this.getUA()); + } + + return this.parsedResult.engine; + } + + /** + * Parse full information about the browser + * @returns {Parser} + */ + parse() { + this.parseBrowser(); + this.parseOS(); + this.parsePlatform(); + this.parseEngine(); + + return this; + } + + /** + * Get parsed result + * @return {ParsedResult} + */ + getResult() { + return Utils.assign({}, this.parsedResult); + } + + /** + * Check if parsed browser matches certain conditions + * + * @param {Object} checkTree It's one or two layered object, + * which can include a platform or an OS on the first layer + * and should have browsers specs on the bottom-laying layer + * + * @returns {Boolean|undefined} Whether the browser satisfies the set conditions or not. + * Returns `undefined` when the browser is no described in the checkTree object. + * + * @example + * const browser = Bowser.getParser(window.navigator.userAgent); + * if (browser.satisfies({chrome: '>118.01.1322' })) + * // or with os + * if (browser.satisfies({windows: { chrome: '>118.01.1322' } })) + * // or with platforms + * if (browser.satisfies({desktop: { chrome: '>118.01.1322' } })) + */ + satisfies(checkTree) { + const platformsAndOSes = {}; + let platformsAndOSCounter = 0; + const browsers = {}; + let browsersCounter = 0; + + const allDefinitions = Object.keys(checkTree); + + allDefinitions.forEach((key) => { + const currentDefinition = checkTree[key]; + if (typeof currentDefinition === 'string') { + browsers[key] = currentDefinition; + browsersCounter += 1; + } else if (typeof currentDefinition === 'object') { + platformsAndOSes[key] = currentDefinition; + platformsAndOSCounter += 1; + } + }); + + if (platformsAndOSCounter > 0) { + const platformsAndOSNames = Object.keys(platformsAndOSes); + const OSMatchingDefinition = Utils.find(platformsAndOSNames, name => (this.isOS(name))); + + if (OSMatchingDefinition) { + const osResult = this.satisfies(platformsAndOSes[OSMatchingDefinition]); + + if (osResult !== void 0) { + return osResult; + } + } + + const platformMatchingDefinition = Utils.find( + platformsAndOSNames, + name => (this.isPlatform(name)), + ); + if (platformMatchingDefinition) { + const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]); + + if (platformResult !== void 0) { + return platformResult; + } + } + } + + if (browsersCounter > 0) { + const browserNames = Object.keys(browsers); + const matchingDefinition = Utils.find(browserNames, name => (this.isBrowser(name, true))); + + if (matchingDefinition !== void 0) { + return this.compareVersion(browsers[matchingDefinition]); + } + } + + return undefined; + } + + /** + * Check if the browser name equals the passed string + * @param browserName The string to compare with the browser name + * @param [includingAlias=false] The flag showing whether alias will be included into comparison + * @returns {boolean} + */ + isBrowser(browserName, includingAlias = false) { + const defaultBrowserName = this.getBrowserName().toLowerCase(); + let browserNameLower = browserName.toLowerCase(); + const alias = Utils.getBrowserTypeByAlias(browserNameLower); + + if (includingAlias && alias) { + browserNameLower = alias.toLowerCase(); + } + return browserNameLower === defaultBrowserName; + } + + compareVersion(version) { + let expectedResults = [0]; + let comparableVersion = version; + let isLoose = false; + + const currentBrowserVersion = this.getBrowserVersion(); + + if (typeof currentBrowserVersion !== 'string') { + return void 0; + } + + if (version[0] === '>' || version[0] === '<') { + comparableVersion = version.substr(1); + if (version[1] === '=') { + isLoose = true; + comparableVersion = version.substr(2); + } else { + expectedResults = []; + } + if (version[0] === '>') { + expectedResults.push(1); + } else { + expectedResults.push(-1); + } + } else if (version[0] === '=') { + comparableVersion = version.substr(1); + } else if (version[0] === '~') { + isLoose = true; + comparableVersion = version.substr(1); + } + + return expectedResults.indexOf( + Utils.compareVersions(currentBrowserVersion, comparableVersion, isLoose), + ) > -1; + } + + isOS(osName) { + return this.getOSName(true) === String(osName).toLowerCase(); + } + + isPlatform(platformType) { + return this.getPlatformType(true) === String(platformType).toLowerCase(); + } + + isEngine(engineName) { + return this.getEngineName(true) === String(engineName).toLowerCase(); + } + + /** + * Is anything? Check if the browser is called "anything", + * the OS called "anything" or the platform called "anything" + * @param {String} anything + * @param [includingAlias=false] The flag showing whether alias will be included into comparison + * @returns {Boolean} + */ + is(anything, includingAlias = false) { + return this.isBrowser(anything, includingAlias) || this.isOS(anything) + || this.isPlatform(anything); + } + + /** + * Check if any of the given values satisfies this.is(anything) + * @param {String[]} anythings + * @returns {Boolean} + */ + some(anythings = []) { + return anythings.some(anything => this.is(anything)); + } +} + +export default Parser; diff --git a/parent_dir/node_modules/bowser/src/utils.js b/parent_dir/node_modules/bowser/src/utils.js new file mode 100644 index 0000000..d1174bf --- /dev/null +++ b/parent_dir/node_modules/bowser/src/utils.js @@ -0,0 +1,309 @@ +import { BROWSER_MAP, BROWSER_ALIASES_MAP } from './constants.js'; + +export default class Utils { + /** + * Get first matched item for a string + * @param {RegExp} regexp + * @param {String} ua + * @return {Array|{index: number, input: string}|*|boolean|string} + */ + static getFirstMatch(regexp, ua) { + const match = ua.match(regexp); + return (match && match.length > 0 && match[1]) || ''; + } + + /** + * Get second matched item for a string + * @param regexp + * @param {String} ua + * @return {Array|{index: number, input: string}|*|boolean|string} + */ + static getSecondMatch(regexp, ua) { + const match = ua.match(regexp); + return (match && match.length > 1 && match[2]) || ''; + } + + /** + * Match a regexp and return a constant or undefined + * @param {RegExp} regexp + * @param {String} ua + * @param {*} _const Any const that will be returned if regexp matches the string + * @return {*} + */ + static matchAndReturnConst(regexp, ua, _const) { + if (regexp.test(ua)) { + return _const; + } + return void (0); + } + + static getWindowsVersionName(version) { + switch (version) { + case 'NT': return 'NT'; + case 'XP': return 'XP'; + case 'NT 5.0': return '2000'; + case 'NT 5.1': return 'XP'; + case 'NT 5.2': return '2003'; + case 'NT 6.0': return 'Vista'; + case 'NT 6.1': return '7'; + case 'NT 6.2': return '8'; + case 'NT 6.3': return '8.1'; + case 'NT 10.0': return '10'; + default: return undefined; + } + } + + /** + * Get macOS version name + * 10.5 - Leopard + * 10.6 - Snow Leopard + * 10.7 - Lion + * 10.8 - Mountain Lion + * 10.9 - Mavericks + * 10.10 - Yosemite + * 10.11 - El Capitan + * 10.12 - Sierra + * 10.13 - High Sierra + * 10.14 - Mojave + * 10.15 - Catalina + * + * @example + * getMacOSVersionName("10.14") // 'Mojave' + * + * @param {string} version + * @return {string} versionName + */ + static getMacOSVersionName(version) { + const v = version.split('.').splice(0, 2).map(s => parseInt(s, 10) || 0); + v.push(0); + if (v[0] !== 10) return undefined; + switch (v[1]) { + case 5: return 'Leopard'; + case 6: return 'Snow Leopard'; + case 7: return 'Lion'; + case 8: return 'Mountain Lion'; + case 9: return 'Mavericks'; + case 10: return 'Yosemite'; + case 11: return 'El Capitan'; + case 12: return 'Sierra'; + case 13: return 'High Sierra'; + case 14: return 'Mojave'; + case 15: return 'Catalina'; + default: return undefined; + } + } + + /** + * Get Android version name + * 1.5 - Cupcake + * 1.6 - Donut + * 2.0 - Eclair + * 2.1 - Eclair + * 2.2 - Froyo + * 2.x - Gingerbread + * 3.x - Honeycomb + * 4.0 - Ice Cream Sandwich + * 4.1 - Jelly Bean + * 4.4 - KitKat + * 5.x - Lollipop + * 6.x - Marshmallow + * 7.x - Nougat + * 8.x - Oreo + * 9.x - Pie + * + * @example + * getAndroidVersionName("7.0") // 'Nougat' + * + * @param {string} version + * @return {string} versionName + */ + static getAndroidVersionName(version) { + const v = version.split('.').splice(0, 2).map(s => parseInt(s, 10) || 0); + v.push(0); + if (v[0] === 1 && v[1] < 5) return undefined; + if (v[0] === 1 && v[1] < 6) return 'Cupcake'; + if (v[0] === 1 && v[1] >= 6) return 'Donut'; + if (v[0] === 2 && v[1] < 2) return 'Eclair'; + if (v[0] === 2 && v[1] === 2) return 'Froyo'; + if (v[0] === 2 && v[1] > 2) return 'Gingerbread'; + if (v[0] === 3) return 'Honeycomb'; + if (v[0] === 4 && v[1] < 1) return 'Ice Cream Sandwich'; + if (v[0] === 4 && v[1] < 4) return 'Jelly Bean'; + if (v[0] === 4 && v[1] >= 4) return 'KitKat'; + if (v[0] === 5) return 'Lollipop'; + if (v[0] === 6) return 'Marshmallow'; + if (v[0] === 7) return 'Nougat'; + if (v[0] === 8) return 'Oreo'; + if (v[0] === 9) return 'Pie'; + return undefined; + } + + /** + * Get version precisions count + * + * @example + * getVersionPrecision("1.10.3") // 3 + * + * @param {string} version + * @return {number} + */ + static getVersionPrecision(version) { + return version.split('.').length; + } + + /** + * Calculate browser version weight + * + * @example + * compareVersions('1.10.2.1', '1.8.2.1.90') // 1 + * compareVersions('1.010.2.1', '1.09.2.1.90'); // 1 + * compareVersions('1.10.2.1', '1.10.2.1'); // 0 + * compareVersions('1.10.2.1', '1.0800.2'); // -1 + * compareVersions('1.10.2.1', '1.10', true); // 0 + * + * @param {String} versionA versions versions to compare + * @param {String} versionB versions versions to compare + * @param {boolean} [isLoose] enable loose comparison + * @return {Number} comparison result: -1 when versionA is lower, + * 1 when versionA is bigger, 0 when both equal + */ + /* eslint consistent-return: 1 */ + static compareVersions(versionA, versionB, isLoose = false) { + // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 + const versionAPrecision = Utils.getVersionPrecision(versionA); + const versionBPrecision = Utils.getVersionPrecision(versionB); + + let precision = Math.max(versionAPrecision, versionBPrecision); + let lastPrecision = 0; + + const chunks = Utils.map([versionA, versionB], (version) => { + const delta = precision - Utils.getVersionPrecision(version); + + // 2) "9" -> "9.0" (for precision = 2) + const _version = version + new Array(delta + 1).join('.0'); + + // 3) "9.0" -> ["000000000"", "000000009"] + return Utils.map(_version.split('.'), chunk => new Array(20 - chunk.length).join('0') + chunk).reverse(); + }); + + // adjust precision for loose comparison + if (isLoose) { + lastPrecision = precision - Math.min(versionAPrecision, versionBPrecision); + } + + // iterate in reverse order by reversed chunks array + precision -= 1; + while (precision >= lastPrecision) { + // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) + if (chunks[0][precision] > chunks[1][precision]) { + return 1; + } + + if (chunks[0][precision] === chunks[1][precision]) { + if (precision === lastPrecision) { + // all version chunks are same + return 0; + } + + precision -= 1; + } else if (chunks[0][precision] < chunks[1][precision]) { + return -1; + } + } + + return undefined; + } + + /** + * Array::map polyfill + * + * @param {Array} arr + * @param {Function} iterator + * @return {Array} + */ + static map(arr, iterator) { + const result = []; + let i; + if (Array.prototype.map) { + return Array.prototype.map.call(arr, iterator); + } + for (i = 0; i < arr.length; i += 1) { + result.push(iterator(arr[i])); + } + return result; + } + + /** + * Array::find polyfill + * + * @param {Array} arr + * @param {Function} predicate + * @return {Array} + */ + static find(arr, predicate) { + let i; + let l; + if (Array.prototype.find) { + return Array.prototype.find.call(arr, predicate); + } + for (i = 0, l = arr.length; i < l; i += 1) { + const value = arr[i]; + if (predicate(value, i)) { + return value; + } + } + return undefined; + } + + /** + * Object::assign polyfill + * + * @param {Object} obj + * @param {Object} ...objs + * @return {Object} + */ + static assign(obj, ...assigners) { + const result = obj; + let i; + let l; + if (Object.assign) { + return Object.assign(obj, ...assigners); + } + for (i = 0, l = assigners.length; i < l; i += 1) { + const assigner = assigners[i]; + if (typeof assigner === 'object' && assigner !== null) { + const keys = Object.keys(assigner); + keys.forEach((key) => { + result[key] = assigner[key]; + }); + } + } + return obj; + } + + /** + * Get short version/alias for a browser name + * + * @example + * getBrowserAlias('Microsoft Edge') // edge + * + * @param {string} browserName + * @return {string} + */ + static getBrowserAlias(browserName) { + return BROWSER_ALIASES_MAP[browserName]; + } + + /** + * Get short version/alias for a browser name + * + * @example + * getBrowserAlias('edge') // Microsoft Edge + * + * @param {string} browserAlias + * @return {string} + */ + static getBrowserTypeByAlias(browserAlias) { + return BROWSER_MAP[browserAlias] || ''; + } +} diff --git a/parent_dir/node_modules/brillout/json-serializer/dist/esm/parse.js b/parent_dir/node_modules/brillout/json-serializer/dist/esm/parse.js new file mode 100644 index 0000000..9c9be60 --- /dev/null +++ b/parent_dir/node_modules/brillout/json-serializer/dist/esm/parse.js @@ -0,0 +1,27 @@ +export { parse }; +import { types } from './types'; +function parse(str) { + // We don't use the reviver option in `JSON.parse(str, reviver)` because it doesn't support `undefined` values + const value = JSON.parse(str); + return modifier(value); +} +function modifier(value) { + if (typeof value === 'string') { + return reviver(value); + } + if (typeof value === 'object' && value !== null) { + Object.entries(value).forEach(([key, val]) => { + ; + value[key] = modifier(val); + }); + } + return value; +} +function reviver(value) { + for (const { match, deserialize } of types) { + if (match(value)) { + return deserialize(value, parse); + } + } + return value; +} diff --git a/parent_dir/node_modules/brillout/json-serializer/dist/esm/types.js b/parent_dir/node_modules/brillout/json-serializer/dist/esm/types.js new file mode 100644 index 0000000..2c8f4b9 --- /dev/null +++ b/parent_dir/node_modules/brillout/json-serializer/dist/esm/types.js @@ -0,0 +1,80 @@ +export { types }; +const types = [ + ts({ + is: (val) => val === undefined, + match: (str) => str === '!undefined', + serialize: () => '!undefined', + deserialize: () => undefined + }), + ts({ + is: (val) => val === Infinity, + match: (str) => str === '!Infinity', + serialize: () => '!Infinity', + deserialize: () => Infinity + }), + ts({ + is: (val) => val === -Infinity, + match: (str) => str === '!-Infinity', + serialize: () => '!-Infinity', + deserialize: () => -Infinity + }), + ts({ + is: (val) => typeof val === 'number' && isNaN(val), + match: (str) => str === '!NaN', + serialize: () => '!NaN', + deserialize: () => NaN + }), + ts({ + is: (val) => val instanceof Date, + match: (str) => str.startsWith('!Date:'), + serialize: (val) => '!Date:' + val.toISOString(), + deserialize: (str) => new Date(str.slice('!Date:'.length)) + }), + ts({ + is: (val) => typeof val === 'bigint', + match: (str) => str.startsWith('!BigInt:'), + serialize: (val) => '!BigInt:' + val.toString(), + deserialize: (str) => { + if (typeof BigInt === 'undefined') { + throw new Error('Your JavaScript environement does not support BigInt. Consider adding a polyfill.'); + } + return BigInt(str.slice('!BigInt:'.length)); + } + }), + ts({ + is: (val) => val instanceof RegExp, + match: (str) => str.startsWith('!RegExp:'), + serialize: (val) => '!RegExp:' + val.toString(), + deserialize: (str) => { + str = str.slice('!RegExp:'.length); + // const args: string[] = str.match(/\/(.*?)\/([gimy])?$/)! + const args = str.match(/\/(.*)\/(.*)?/); + const pattern = args[1]; + const flags = args[2]; + return new RegExp(pattern, flags); + } + }), + ts({ + is: (val) => val instanceof Map, + match: (str) => str.startsWith('!Map:'), + serialize: (val, serializer) => '!Map:' + serializer(Array.from(val.entries())), + deserialize: (str, deserializer) => new Map(deserializer(str.slice('!Map:'.length))) + }), + ts({ + is: (val) => val instanceof Set, + match: (str) => str.startsWith('!Set:'), + serialize: (val, serializer) => '!Set:' + serializer(Array.from(val.values())), + deserialize: (str, deserializer) => new Set(deserializer(str.slice('!Set:'.length))) + }), + // Avoid collisions with the special strings defined above + ts({ + is: (val) => typeof val === 'string' && val.startsWith('!'), + match: (str) => str.startsWith('!'), + serialize: (val) => '!' + val, + deserialize: (str) => str.slice(1) + }) +]; +// Type check +function ts(t) { + return t; +} diff --git a/parent_dir/node_modules/cdek-ui-kit/vue/dist/vue-ui-kit.es.js b/parent_dir/node_modules/cdek-ui-kit/vue/dist/vue-ui-kit.es.js new file mode 100644 index 0000000..9e8b0d2 --- /dev/null +++ b/parent_dir/node_modules/cdek-ui-kit/vue/dist/vue-ui-kit.es.js @@ -0,0 +1,7181 @@ +var gg = Object.defineProperty; +var mg = (r, o, i) => o in r ? gg(r, o, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[o] = i; +var Ge = (r, o, i) => (mg(r, typeof o != "symbol" ? o + "" : o, i), i); +import { openBlock as S, createElementBlock as R, createElementVNode as z, defineComponent as se, computed as B, normalizeClass as M, renderSlot as fe, createBlock as pe, resolveDynamicComponent as Xt, createTextVNode as lt, toDisplayString as we, normalizeStyle as Zs, createCommentVNode as ae, unref as ie, useSlots as cr, ref as oe, mergeProps as Qt, createVNode as ht, withDirectives as ci, vShow as zs, watch as Jt, onMounted as Dt, onBeforeUnmount as yg, createSlots as qs, renderList as pn, withCtx as ye, normalizeProps as fr, guardReactiveProps as fi, Transition as qa, Fragment as xt, createStaticVNode as bg, reactive as Ks, shallowRef as wg, watchEffect as di, cloneVNode as kg, h as lr, inject as hn, provide as Mn, onUnmounted as Ys, nextTick as Yt, toRaw as st, useCssVars as xg, withModifiers as Ka, toHandlers as $g, TransitionGroup as Ag, resolveComponent as Pa, createApp as Sg, getCurrentInstance as Tg } from "vue"; +const Cg = { + xmlns: "http://www.w3.org/2000/svg", + width: "20", + height: "20", + fill: "none" +}, Og = /* @__PURE__ */ z("path", { + stroke: "#F4A344", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2", + d: "M10 7.5v1.667m0 3.333v.008m-5.833 3.325h11.666a1.667 1.667 0 0 0 1.534-2.291L11.45 3.333a1.666 1.666 0 0 0-2.917 0L2.617 13.542a1.666 1.666 0 0 0 1.458 2.291" +}, null, -1), Eg = [ + Og +]; +function Ig(r, o) { + return S(), R("svg", Cg, Eg); +} +const Rg = { render: Ig }, Lg = { + xmlns: "http://www.w3.org/2000/svg", + width: "20", + height: "20", + fill: "none" +}, Mg = /* @__PURE__ */ z("path", { + stroke: "#17A000", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-opacity": ".7", + "stroke-width": "2", + d: "m4.167 10 4.167 4.167 8.333-8.334" +}, null, -1), Bg = [ + Mg +]; +function Pg(r, o) { + return S(), R("svg", Lg, Bg); +} +const Dg = { render: Pg }, Fg = { + xmlns: "http://www.w3.org/2000/svg", + width: "20", + height: "20", + fill: "none" +}, Ng = /* @__PURE__ */ z("path", { + stroke: "#E40029", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-opacity": ".5", + "stroke-width": "2", + d: "m4.75 4.75 10.5 10.5M17.5 10a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Z" +}, null, -1), Ug = [ + Ng +]; +function Wg(r, o) { + return S(), R("svg", Fg, Ug); +} +const Vg = { render: Wg }, Hg = { + xmlns: "http://www.w3.org/2000/svg", + width: "20", + height: "20", + fill: "none" +}, Gg = /* @__PURE__ */ z("path", { + stroke: "#4B3C87", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-opacity": ".5", + "stroke-width": "2", + d: "M10 6.667h.008M9.167 10H10v3.333h.833M17.5 10a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Z" +}, null, -1), Zg = [ + Gg +]; +function zg(r, o) { + return S(), R("svg", Hg, Zg); +} +const qg = { render: zg }, Kg = /* @__PURE__ */ se({ + __name: "BaseAlert", + props: { + title: {}, + type: { default: "attention" }, + style: { default: "surface" } + }, + setup(r) { + const o = r, i = { + negative: Vg, + positive: Dg, + attention: Rg, + info: qg + }, c = B(() => i[o.type]); + return (a, p) => (S(), R("div", { + class: M([ + a.$style["prefix-alert"], + a.$style[`prefix-alert--${a.type}`], + a.$style[`prefix-alert_${a.style}`] + ]) + }, [ + z("div", { + class: M(a.$style["prefix-alert__title"]) + }, [ + fe(a.$slots, "header", {}, () => [ + (S(), pe(Xt(c.value))), + lt(" " + we(a.title), 1) + ], !0) + ], 2), + z("div", { + class: M(a.$style["prefix-alert__content"]) + }, [ + fe(a.$slots, "default", {}, void 0, !0) + ], 2) + ], 2)); + } +}), Yg = { + "prefix-alert": "cdek-alert", + "prefix-alert--attention": "cdek-alert--attention", + "prefix-alert--positive": "cdek-alert--positive", + "prefix-alert--negative": "cdek-alert--negative", + "prefix-alert--info": "cdek-alert--info", + "prefix-alert_surface": "cdek-alert_surface", + "prefix-alert_line": "cdek-alert_line", + "prefix-alert__title": "cdek-alert__title", + "prefix-alert__content": "cdek-alert__content" +}, Ae = (r, o) => { + const i = r.__vccOpts || r; + for (const [c, a] of o) + i[c] = a; + return i; +}, Xg = { + $style: Yg +}, kw = /* @__PURE__ */ Ae(Kg, [["__cssModules", Xg], ["__scopeId", "data-v-6bd03bbf"]]); +var ir = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, li = { exports: {} }; +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +li.exports; +(function(r, o) { + (function() { + var i, c = "4.17.21", a = 200, p = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", y = "Expected a function", b = "Invalid `variable` option passed into `_.template`", T = "__lodash_hash_undefined__", g = 500, _ = "__lodash_placeholder__", C = 1, D = 2, Q = 4, ee = 1, O = 2, E = 1, W = 2, V = 4, F = 8, Z = 16, q = 32, ge = 64, Ee = 128, At = 256, Bn = 512, N = 30, Te = "...", vt = 800, St = 16, jt = 1, hi = 2, Su = 3, en = 1 / 0, Ft = 9007199254740991, Tu = 17976931348623157e292, pr = 0 / 0, gt = 4294967295, Cu = gt - 1, Ou = gt >>> 1, Eu = [ + ["ary", Ee], + ["bind", E], + ["bindKey", W], + ["curry", F], + ["curryRight", Z], + ["flip", Bn], + ["partial", q], + ["partialRight", ge], + ["rearg", At] + ], vn = "[object Arguments]", hr = "[object Array]", Iu = "[object AsyncFunction]", Pn = "[object Boolean]", Dn = "[object Date]", Ru = "[object DOMException]", _r = "[object Error]", vr = "[object Function]", io = "[object GeneratorFunction]", at = "[object Map]", Fn = "[object Number]", Lu = "[object Null]", Tt = "[object Object]", so = "[object Promise]", Mu = "[object Proxy]", Nn = "[object RegExp]", ut = "[object Set]", Un = "[object String]", gr = "[object Symbol]", Bu = "[object Undefined]", Wn = "[object WeakMap]", Pu = "[object WeakSet]", Vn = "[object ArrayBuffer]", gn = "[object DataView]", _i = "[object Float32Array]", vi = "[object Float64Array]", gi = "[object Int8Array]", mi = "[object Int16Array]", yi = "[object Int32Array]", bi = "[object Uint8Array]", wi = "[object Uint8ClampedArray]", ki = "[object Uint16Array]", xi = "[object Uint32Array]", Du = /\b__p \+= '';/g, Fu = /\b(__p \+=) '' \+/g, Nu = /(__e\(.*?\)|\b__t\)) \+\n'';/g, oo = /&(?:amp|lt|gt|quot|#39);/g, lo = /[&<>"']/g, Uu = RegExp(oo.source), Wu = RegExp(lo.source), Vu = /<%-([\s\S]+?)%>/g, Hu = /<%([\s\S]+?)%>/g, ao = /<%=([\s\S]+?)%>/g, Gu = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Zu = /^\w*$/, zu = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, $i = /[\\^$.*+?()[\]{}|]/g, qu = RegExp($i.source), Ai = /^\s+/, Ku = /\s/, Yu = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Xu = /\{\n\/\* \[wrapped with (.+)\] \*/, Ju = /,? & /, Qu = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, ju = /[()=,{}\[\]\/\s]/, ec = /\\(\\)?/g, tc = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, uo = /\w*$/, nc = /^[-+]0x[0-9a-f]+$/i, rc = /^0b[01]+$/i, ic = /^\[object .+?Constructor\]$/, sc = /^0o[0-7]+$/i, oc = /^(?:0|[1-9]\d*)$/, lc = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, mr = /($^)/, ac = /['\n\r\u2028\u2029\\]/g, yr = "\\ud800-\\udfff", uc = "\\u0300-\\u036f", cc = "\\ufe20-\\ufe2f", fc = "\\u20d0-\\u20ff", co = uc + cc + fc, fo = "\\u2700-\\u27bf", po = "a-z\\xdf-\\xf6\\xf8-\\xff", dc = "\\xac\\xb1\\xd7\\xf7", pc = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", hc = "\\u2000-\\u206f", _c = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", ho = "A-Z\\xc0-\\xd6\\xd8-\\xde", _o = "\\ufe0e\\ufe0f", vo = dc + pc + hc + _c, Si = "['’]", vc = "[" + yr + "]", go = "[" + vo + "]", br = "[" + co + "]", mo = "\\d+", gc = "[" + fo + "]", yo = "[" + po + "]", bo = "[^" + yr + vo + mo + fo + po + ho + "]", Ti = "\\ud83c[\\udffb-\\udfff]", mc = "(?:" + br + "|" + Ti + ")", wo = "[^" + yr + "]", Ci = "(?:\\ud83c[\\udde6-\\uddff]){2}", Oi = "[\\ud800-\\udbff][\\udc00-\\udfff]", mn = "[" + ho + "]", ko = "\\u200d", xo = "(?:" + yo + "|" + bo + ")", yc = "(?:" + mn + "|" + bo + ")", $o = "(?:" + Si + "(?:d|ll|m|re|s|t|ve))?", Ao = "(?:" + Si + "(?:D|LL|M|RE|S|T|VE))?", So = mc + "?", To = "[" + _o + "]?", bc = "(?:" + ko + "(?:" + [wo, Ci, Oi].join("|") + ")" + To + So + ")*", wc = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", kc = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", Co = To + So + bc, xc = "(?:" + [gc, Ci, Oi].join("|") + ")" + Co, $c = "(?:" + [wo + br + "?", br, Ci, Oi, vc].join("|") + ")", Ac = RegExp(Si, "g"), Sc = RegExp(br, "g"), Ei = RegExp(Ti + "(?=" + Ti + ")|" + $c + Co, "g"), Tc = RegExp([ + mn + "?" + yo + "+" + $o + "(?=" + [go, mn, "$"].join("|") + ")", + yc + "+" + Ao + "(?=" + [go, mn + xo, "$"].join("|") + ")", + mn + "?" + xo + "+" + $o, + mn + "+" + Ao, + kc, + wc, + mo, + xc + ].join("|"), "g"), Cc = RegExp("[" + ko + yr + co + _o + "]"), Oc = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, Ec = [ + "Array", + "Buffer", + "DataView", + "Date", + "Error", + "Float32Array", + "Float64Array", + "Function", + "Int8Array", + "Int16Array", + "Int32Array", + "Map", + "Math", + "Object", + "Promise", + "RegExp", + "Set", + "String", + "Symbol", + "TypeError", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "WeakMap", + "_", + "clearTimeout", + "isFinite", + "parseInt", + "setTimeout" + ], Ic = -1, _e = {}; + _e[_i] = _e[vi] = _e[gi] = _e[mi] = _e[yi] = _e[bi] = _e[wi] = _e[ki] = _e[xi] = !0, _e[vn] = _e[hr] = _e[Vn] = _e[Pn] = _e[gn] = _e[Dn] = _e[_r] = _e[vr] = _e[at] = _e[Fn] = _e[Tt] = _e[Nn] = _e[ut] = _e[Un] = _e[Wn] = !1; + var he = {}; + he[vn] = he[hr] = he[Vn] = he[gn] = he[Pn] = he[Dn] = he[_i] = he[vi] = he[gi] = he[mi] = he[yi] = he[at] = he[Fn] = he[Tt] = he[Nn] = he[ut] = he[Un] = he[gr] = he[bi] = he[wi] = he[ki] = he[xi] = !0, he[_r] = he[vr] = he[Wn] = !1; + var Rc = { + // Latin-1 Supplement block. + À: "A", + Á: "A", + Â: "A", + Ã: "A", + Ä: "A", + Å: "A", + à: "a", + á: "a", + â: "a", + ã: "a", + ä: "a", + å: "a", + Ç: "C", + ç: "c", + Ð: "D", + ð: "d", + È: "E", + É: "E", + Ê: "E", + Ë: "E", + è: "e", + é: "e", + ê: "e", + ë: "e", + Ì: "I", + Í: "I", + Î: "I", + Ï: "I", + ì: "i", + í: "i", + î: "i", + ï: "i", + Ñ: "N", + ñ: "n", + Ò: "O", + Ó: "O", + Ô: "O", + Õ: "O", + Ö: "O", + Ø: "O", + ò: "o", + ó: "o", + ô: "o", + õ: "o", + ö: "o", + ø: "o", + Ù: "U", + Ú: "U", + Û: "U", + Ü: "U", + ù: "u", + ú: "u", + û: "u", + ü: "u", + Ý: "Y", + ý: "y", + ÿ: "y", + Æ: "Ae", + æ: "ae", + Þ: "Th", + þ: "th", + ß: "ss", + // Latin Extended-A block. + Ā: "A", + Ă: "A", + Ą: "A", + ā: "a", + ă: "a", + ą: "a", + Ć: "C", + Ĉ: "C", + Ċ: "C", + Č: "C", + ć: "c", + ĉ: "c", + ċ: "c", + č: "c", + Ď: "D", + Đ: "D", + ď: "d", + đ: "d", + Ē: "E", + Ĕ: "E", + Ė: "E", + Ę: "E", + Ě: "E", + ē: "e", + ĕ: "e", + ė: "e", + ę: "e", + ě: "e", + Ĝ: "G", + Ğ: "G", + Ġ: "G", + Ģ: "G", + ĝ: "g", + ğ: "g", + ġ: "g", + ģ: "g", + Ĥ: "H", + Ħ: "H", + ĥ: "h", + ħ: "h", + Ĩ: "I", + Ī: "I", + Ĭ: "I", + Į: "I", + İ: "I", + ĩ: "i", + ī: "i", + ĭ: "i", + į: "i", + ı: "i", + Ĵ: "J", + ĵ: "j", + Ķ: "K", + ķ: "k", + ĸ: "k", + Ĺ: "L", + Ļ: "L", + Ľ: "L", + Ŀ: "L", + Ł: "L", + ĺ: "l", + ļ: "l", + ľ: "l", + ŀ: "l", + ł: "l", + Ń: "N", + Ņ: "N", + Ň: "N", + Ŋ: "N", + ń: "n", + ņ: "n", + ň: "n", + ŋ: "n", + Ō: "O", + Ŏ: "O", + Ő: "O", + ō: "o", + ŏ: "o", + ő: "o", + Ŕ: "R", + Ŗ: "R", + Ř: "R", + ŕ: "r", + ŗ: "r", + ř: "r", + Ś: "S", + Ŝ: "S", + Ş: "S", + Š: "S", + ś: "s", + ŝ: "s", + ş: "s", + š: "s", + Ţ: "T", + Ť: "T", + Ŧ: "T", + ţ: "t", + ť: "t", + ŧ: "t", + Ũ: "U", + Ū: "U", + Ŭ: "U", + Ů: "U", + Ű: "U", + Ų: "U", + ũ: "u", + ū: "u", + ŭ: "u", + ů: "u", + ű: "u", + ų: "u", + Ŵ: "W", + ŵ: "w", + Ŷ: "Y", + ŷ: "y", + Ÿ: "Y", + Ź: "Z", + Ż: "Z", + Ž: "Z", + ź: "z", + ż: "z", + ž: "z", + IJ: "IJ", + ij: "ij", + Œ: "Oe", + œ: "oe", + ʼn: "'n", + ſ: "s" + }, Lc = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'" + }, Mc = { + "&": "&", + "<": "<", + ">": ">", + """: '"', + "'": "'" + }, Bc = { + "\\": "\\", + "'": "'", + "\n": "n", + "\r": "r", + "\u2028": "u2028", + "\u2029": "u2029" + }, Pc = parseFloat, Dc = parseInt, Oo = typeof ir == "object" && ir && ir.Object === Object && ir, Fc = typeof self == "object" && self && self.Object === Object && self, Re = Oo || Fc || Function("return this")(), Ii = o && !o.nodeType && o, tn = Ii && !0 && r && !r.nodeType && r, Eo = tn && tn.exports === Ii, Ri = Eo && Oo.process, Je = function() { + try { + var v = tn && tn.require && tn.require("util").types; + return v || Ri && Ri.binding && Ri.binding("util"); + } catch { + } + }(), Io = Je && Je.isArrayBuffer, Ro = Je && Je.isDate, Lo = Je && Je.isMap, Mo = Je && Je.isRegExp, Bo = Je && Je.isSet, Po = Je && Je.isTypedArray; + function Ze(v, k, w) { + switch (w.length) { + case 0: + return v.call(k); + case 1: + return v.call(k, w[0]); + case 2: + return v.call(k, w[0], w[1]); + case 3: + return v.call(k, w[0], w[1], w[2]); + } + return v.apply(k, w); + } + function Nc(v, k, w, L) { + for (var K = -1, le = v == null ? 0 : v.length; ++K < le; ) { + var Ce = v[K]; + k(L, Ce, w(Ce), v); + } + return L; + } + function Qe(v, k) { + for (var w = -1, L = v == null ? 0 : v.length; ++w < L && k(v[w], w, v) !== !1; ) + ; + return v; + } + function Uc(v, k) { + for (var w = v == null ? 0 : v.length; w-- && k(v[w], w, v) !== !1; ) + ; + return v; + } + function Do(v, k) { + for (var w = -1, L = v == null ? 0 : v.length; ++w < L; ) + if (!k(v[w], w, v)) + return !1; + return !0; + } + function Nt(v, k) { + for (var w = -1, L = v == null ? 0 : v.length, K = 0, le = []; ++w < L; ) { + var Ce = v[w]; + k(Ce, w, v) && (le[K++] = Ce); + } + return le; + } + function wr(v, k) { + var w = v == null ? 0 : v.length; + return !!w && yn(v, k, 0) > -1; + } + function Li(v, k, w) { + for (var L = -1, K = v == null ? 0 : v.length; ++L < K; ) + if (w(k, v[L])) + return !0; + return !1; + } + function ve(v, k) { + for (var w = -1, L = v == null ? 0 : v.length, K = Array(L); ++w < L; ) + K[w] = k(v[w], w, v); + return K; + } + function Ut(v, k) { + for (var w = -1, L = k.length, K = v.length; ++w < L; ) + v[K + w] = k[w]; + return v; + } + function Mi(v, k, w, L) { + var K = -1, le = v == null ? 0 : v.length; + for (L && le && (w = v[++K]); ++K < le; ) + w = k(w, v[K], K, v); + return w; + } + function Wc(v, k, w, L) { + var K = v == null ? 0 : v.length; + for (L && K && (w = v[--K]); K--; ) + w = k(w, v[K], K, v); + return w; + } + function Bi(v, k) { + for (var w = -1, L = v == null ? 0 : v.length; ++w < L; ) + if (k(v[w], w, v)) + return !0; + return !1; + } + var Vc = Pi("length"); + function Hc(v) { + return v.split(""); + } + function Gc(v) { + return v.match(Qu) || []; + } + function Fo(v, k, w) { + var L; + return w(v, function(K, le, Ce) { + if (k(K, le, Ce)) + return L = le, !1; + }), L; + } + function kr(v, k, w, L) { + for (var K = v.length, le = w + (L ? 1 : -1); L ? le-- : ++le < K; ) + if (k(v[le], le, v)) + return le; + return -1; + } + function yn(v, k, w) { + return k === k ? nf(v, k, w) : kr(v, No, w); + } + function Zc(v, k, w, L) { + for (var K = w - 1, le = v.length; ++K < le; ) + if (L(v[K], k)) + return K; + return -1; + } + function No(v) { + return v !== v; + } + function Uo(v, k) { + var w = v == null ? 0 : v.length; + return w ? Fi(v, k) / w : pr; + } + function Pi(v) { + return function(k) { + return k == null ? i : k[v]; + }; + } + function Di(v) { + return function(k) { + return v == null ? i : v[k]; + }; + } + function Wo(v, k, w, L, K) { + return K(v, function(le, Ce, de) { + w = L ? (L = !1, le) : k(w, le, Ce, de); + }), w; + } + function zc(v, k) { + var w = v.length; + for (v.sort(k); w--; ) + v[w] = v[w].value; + return v; + } + function Fi(v, k) { + for (var w, L = -1, K = v.length; ++L < K; ) { + var le = k(v[L]); + le !== i && (w = w === i ? le : w + le); + } + return w; + } + function Ni(v, k) { + for (var w = -1, L = Array(v); ++w < v; ) + L[w] = k(w); + return L; + } + function qc(v, k) { + return ve(k, function(w) { + return [w, v[w]]; + }); + } + function Vo(v) { + return v && v.slice(0, zo(v) + 1).replace(Ai, ""); + } + function ze(v) { + return function(k) { + return v(k); + }; + } + function Ui(v, k) { + return ve(k, function(w) { + return v[w]; + }); + } + function Hn(v, k) { + return v.has(k); + } + function Ho(v, k) { + for (var w = -1, L = v.length; ++w < L && yn(k, v[w], 0) > -1; ) + ; + return w; + } + function Go(v, k) { + for (var w = v.length; w-- && yn(k, v[w], 0) > -1; ) + ; + return w; + } + function Kc(v, k) { + for (var w = v.length, L = 0; w--; ) + v[w] === k && ++L; + return L; + } + var Yc = Di(Rc), Xc = Di(Lc); + function Jc(v) { + return "\\" + Bc[v]; + } + function Qc(v, k) { + return v == null ? i : v[k]; + } + function bn(v) { + return Cc.test(v); + } + function jc(v) { + return Oc.test(v); + } + function ef(v) { + for (var k, w = []; !(k = v.next()).done; ) + w.push(k.value); + return w; + } + function Wi(v) { + var k = -1, w = Array(v.size); + return v.forEach(function(L, K) { + w[++k] = [K, L]; + }), w; + } + function Zo(v, k) { + return function(w) { + return v(k(w)); + }; + } + function Wt(v, k) { + for (var w = -1, L = v.length, K = 0, le = []; ++w < L; ) { + var Ce = v[w]; + (Ce === k || Ce === _) && (v[w] = _, le[K++] = w); + } + return le; + } + function xr(v) { + var k = -1, w = Array(v.size); + return v.forEach(function(L) { + w[++k] = L; + }), w; + } + function tf(v) { + var k = -1, w = Array(v.size); + return v.forEach(function(L) { + w[++k] = [L, L]; + }), w; + } + function nf(v, k, w) { + for (var L = w - 1, K = v.length; ++L < K; ) + if (v[L] === k) + return L; + return -1; + } + function rf(v, k, w) { + for (var L = w + 1; L--; ) + if (v[L] === k) + return L; + return L; + } + function wn(v) { + return bn(v) ? of(v) : Vc(v); + } + function ct(v) { + return bn(v) ? lf(v) : Hc(v); + } + function zo(v) { + for (var k = v.length; k-- && Ku.test(v.charAt(k)); ) + ; + return k; + } + var sf = Di(Mc); + function of(v) { + for (var k = Ei.lastIndex = 0; Ei.test(v); ) + ++k; + return k; + } + function lf(v) { + return v.match(Ei) || []; + } + function af(v) { + return v.match(Tc) || []; + } + var uf = function v(k) { + k = k == null ? Re : kn.defaults(Re.Object(), k, kn.pick(Re, Ec)); + var w = k.Array, L = k.Date, K = k.Error, le = k.Function, Ce = k.Math, de = k.Object, Vi = k.RegExp, cf = k.String, je = k.TypeError, $r = w.prototype, ff = le.prototype, xn = de.prototype, Ar = k["__core-js_shared__"], Sr = ff.toString, ce = xn.hasOwnProperty, df = 0, qo = function() { + var e = /[^.]+$/.exec(Ar && Ar.keys && Ar.keys.IE_PROTO || ""); + return e ? "Symbol(src)_1." + e : ""; + }(), Tr = xn.toString, pf = Sr.call(de), hf = Re._, _f = Vi( + "^" + Sr.call(ce).replace($i, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ), Cr = Eo ? k.Buffer : i, Vt = k.Symbol, Or = k.Uint8Array, Ko = Cr ? Cr.allocUnsafe : i, Er = Zo(de.getPrototypeOf, de), Yo = de.create, Xo = xn.propertyIsEnumerable, Ir = $r.splice, Jo = Vt ? Vt.isConcatSpreadable : i, Gn = Vt ? Vt.iterator : i, nn = Vt ? Vt.toStringTag : i, Rr = function() { + try { + var e = an(de, "defineProperty"); + return e({}, "", {}), e; + } catch { + } + }(), vf = k.clearTimeout !== Re.clearTimeout && k.clearTimeout, gf = L && L.now !== Re.Date.now && L.now, mf = k.setTimeout !== Re.setTimeout && k.setTimeout, Lr = Ce.ceil, Mr = Ce.floor, Hi = de.getOwnPropertySymbols, yf = Cr ? Cr.isBuffer : i, Qo = k.isFinite, bf = $r.join, wf = Zo(de.keys, de), Oe = Ce.max, Me = Ce.min, kf = L.now, xf = k.parseInt, jo = Ce.random, $f = $r.reverse, Gi = an(k, "DataView"), Zn = an(k, "Map"), Zi = an(k, "Promise"), $n = an(k, "Set"), zn = an(k, "WeakMap"), qn = an(de, "create"), Br = zn && new zn(), An = {}, Af = un(Gi), Sf = un(Zn), Tf = un(Zi), Cf = un($n), Of = un(zn), Pr = Vt ? Vt.prototype : i, Kn = Pr ? Pr.valueOf : i, el = Pr ? Pr.toString : i; + function u(e) { + if (ke(e) && !Y(e) && !(e instanceof ne)) { + if (e instanceof et) + return e; + if (ce.call(e, "__wrapped__")) + return ta(e); + } + return new et(e); + } + var Sn = function() { + function e() { + } + return function(t) { + if (!me(t)) + return {}; + if (Yo) + return Yo(t); + e.prototype = t; + var n = new e(); + return e.prototype = i, n; + }; + }(); + function Dr() { + } + function et(e, t) { + this.__wrapped__ = e, this.__actions__ = [], this.__chain__ = !!t, this.__index__ = 0, this.__values__ = i; + } + u.templateSettings = { + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + escape: Vu, + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + evaluate: Hu, + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + interpolate: ao, + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + variable: "", + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + imports: { + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + _: u + } + }, u.prototype = Dr.prototype, u.prototype.constructor = u, et.prototype = Sn(Dr.prototype), et.prototype.constructor = et; + function ne(e) { + this.__wrapped__ = e, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = gt, this.__views__ = []; + } + function Ef() { + var e = new ne(this.__wrapped__); + return e.__actions__ = Ue(this.__actions__), e.__dir__ = this.__dir__, e.__filtered__ = this.__filtered__, e.__iteratees__ = Ue(this.__iteratees__), e.__takeCount__ = this.__takeCount__, e.__views__ = Ue(this.__views__), e; + } + function If() { + if (this.__filtered__) { + var e = new ne(this); + e.__dir__ = -1, e.__filtered__ = !0; + } else + e = this.clone(), e.__dir__ *= -1; + return e; + } + function Rf() { + var e = this.__wrapped__.value(), t = this.__dir__, n = Y(e), s = t < 0, l = n ? e.length : 0, f = Gd(0, l, this.__views__), d = f.start, h = f.end, m = h - d, x = s ? h : d - 1, $ = this.__iteratees__, A = $.length, I = 0, P = Me(m, this.__takeCount__); + if (!n || !s && l == m && P == m) + return $l(e, this.__actions__); + var H = []; + e: + for (; m-- && I < P; ) { + x += t; + for (var J = -1, G = e[x]; ++J < A; ) { + var te = $[J], re = te.iteratee, Ye = te.type, Fe = re(G); + if (Ye == hi) + G = Fe; + else if (!Fe) { + if (Ye == jt) + continue e; + break e; + } + } + H[I++] = G; + } + return H; + } + ne.prototype = Sn(Dr.prototype), ne.prototype.constructor = ne; + function rn(e) { + var t = -1, n = e == null ? 0 : e.length; + for (this.clear(); ++t < n; ) { + var s = e[t]; + this.set(s[0], s[1]); + } + } + function Lf() { + this.__data__ = qn ? qn(null) : {}, this.size = 0; + } + function Mf(e) { + var t = this.has(e) && delete this.__data__[e]; + return this.size -= t ? 1 : 0, t; + } + function Bf(e) { + var t = this.__data__; + if (qn) { + var n = t[e]; + return n === T ? i : n; + } + return ce.call(t, e) ? t[e] : i; + } + function Pf(e) { + var t = this.__data__; + return qn ? t[e] !== i : ce.call(t, e); + } + function Df(e, t) { + var n = this.__data__; + return this.size += this.has(e) ? 0 : 1, n[e] = qn && t === i ? T : t, this; + } + rn.prototype.clear = Lf, rn.prototype.delete = Mf, rn.prototype.get = Bf, rn.prototype.has = Pf, rn.prototype.set = Df; + function Ct(e) { + var t = -1, n = e == null ? 0 : e.length; + for (this.clear(); ++t < n; ) { + var s = e[t]; + this.set(s[0], s[1]); + } + } + function Ff() { + this.__data__ = [], this.size = 0; + } + function Nf(e) { + var t = this.__data__, n = Fr(t, e); + if (n < 0) + return !1; + var s = t.length - 1; + return n == s ? t.pop() : Ir.call(t, n, 1), --this.size, !0; + } + function Uf(e) { + var t = this.__data__, n = Fr(t, e); + return n < 0 ? i : t[n][1]; + } + function Wf(e) { + return Fr(this.__data__, e) > -1; + } + function Vf(e, t) { + var n = this.__data__, s = Fr(n, e); + return s < 0 ? (++this.size, n.push([e, t])) : n[s][1] = t, this; + } + Ct.prototype.clear = Ff, Ct.prototype.delete = Nf, Ct.prototype.get = Uf, Ct.prototype.has = Wf, Ct.prototype.set = Vf; + function Ot(e) { + var t = -1, n = e == null ? 0 : e.length; + for (this.clear(); ++t < n; ) { + var s = e[t]; + this.set(s[0], s[1]); + } + } + function Hf() { + this.size = 0, this.__data__ = { + hash: new rn(), + map: new (Zn || Ct)(), + string: new rn() + }; + } + function Gf(e) { + var t = Xr(this, e).delete(e); + return this.size -= t ? 1 : 0, t; + } + function Zf(e) { + return Xr(this, e).get(e); + } + function zf(e) { + return Xr(this, e).has(e); + } + function qf(e, t) { + var n = Xr(this, e), s = n.size; + return n.set(e, t), this.size += n.size == s ? 0 : 1, this; + } + Ot.prototype.clear = Hf, Ot.prototype.delete = Gf, Ot.prototype.get = Zf, Ot.prototype.has = zf, Ot.prototype.set = qf; + function sn(e) { + var t = -1, n = e == null ? 0 : e.length; + for (this.__data__ = new Ot(); ++t < n; ) + this.add(e[t]); + } + function Kf(e) { + return this.__data__.set(e, T), this; + } + function Yf(e) { + return this.__data__.has(e); + } + sn.prototype.add = sn.prototype.push = Kf, sn.prototype.has = Yf; + function ft(e) { + var t = this.__data__ = new Ct(e); + this.size = t.size; + } + function Xf() { + this.__data__ = new Ct(), this.size = 0; + } + function Jf(e) { + var t = this.__data__, n = t.delete(e); + return this.size = t.size, n; + } + function Qf(e) { + return this.__data__.get(e); + } + function jf(e) { + return this.__data__.has(e); + } + function ed(e, t) { + var n = this.__data__; + if (n instanceof Ct) { + var s = n.__data__; + if (!Zn || s.length < a - 1) + return s.push([e, t]), this.size = ++n.size, this; + n = this.__data__ = new Ot(s); + } + return n.set(e, t), this.size = n.size, this; + } + ft.prototype.clear = Xf, ft.prototype.delete = Jf, ft.prototype.get = Qf, ft.prototype.has = jf, ft.prototype.set = ed; + function tl(e, t) { + var n = Y(e), s = !n && cn(e), l = !n && !s && qt(e), f = !n && !s && !l && En(e), d = n || s || l || f, h = d ? Ni(e.length, cf) : [], m = h.length; + for (var x in e) + (t || ce.call(e, x)) && !(d && // Safari 9 has enumerable `arguments.length` in strict mode. + (x == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. + l && (x == "offset" || x == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. + f && (x == "buffer" || x == "byteLength" || x == "byteOffset") || // Skip index properties. + Lt(x, m))) && h.push(x); + return h; + } + function nl(e) { + var t = e.length; + return t ? e[ns(0, t - 1)] : i; + } + function td(e, t) { + return Jr(Ue(e), on(t, 0, e.length)); + } + function nd(e) { + return Jr(Ue(e)); + } + function zi(e, t, n) { + (n !== i && !dt(e[t], n) || n === i && !(t in e)) && Et(e, t, n); + } + function Yn(e, t, n) { + var s = e[t]; + (!(ce.call(e, t) && dt(s, n)) || n === i && !(t in e)) && Et(e, t, n); + } + function Fr(e, t) { + for (var n = e.length; n--; ) + if (dt(e[n][0], t)) + return n; + return -1; + } + function rd(e, t, n, s) { + return Ht(e, function(l, f, d) { + t(s, l, n(l), d); + }), s; + } + function rl(e, t) { + return e && yt(t, Ie(t), e); + } + function id(e, t) { + return e && yt(t, Ve(t), e); + } + function Et(e, t, n) { + t == "__proto__" && Rr ? Rr(e, t, { + configurable: !0, + enumerable: !0, + value: n, + writable: !0 + }) : e[t] = n; + } + function qi(e, t) { + for (var n = -1, s = t.length, l = w(s), f = e == null; ++n < s; ) + l[n] = f ? i : Ts(e, t[n]); + return l; + } + function on(e, t, n) { + return e === e && (n !== i && (e = e <= n ? e : n), t !== i && (e = e >= t ? e : t)), e; + } + function tt(e, t, n, s, l, f) { + var d, h = t & C, m = t & D, x = t & Q; + if (n && (d = l ? n(e, s, l, f) : n(e)), d !== i) + return d; + if (!me(e)) + return e; + var $ = Y(e); + if ($) { + if (d = zd(e), !h) + return Ue(e, d); + } else { + var A = Be(e), I = A == vr || A == io; + if (qt(e)) + return Tl(e, h); + if (A == Tt || A == vn || I && !l) { + if (d = m || I ? {} : zl(e), !h) + return m ? Bd(e, id(d, e)) : Md(e, rl(d, e)); + } else { + if (!he[A]) + return l ? e : {}; + d = qd(e, A, h); + } + } + f || (f = new ft()); + var P = f.get(e); + if (P) + return P; + f.set(e, d), wa(e) ? e.forEach(function(G) { + d.add(tt(G, t, n, G, e, f)); + }) : ya(e) && e.forEach(function(G, te) { + d.set(te, tt(G, t, n, te, e, f)); + }); + var H = x ? m ? ps : ds : m ? Ve : Ie, J = $ ? i : H(e); + return Qe(J || e, function(G, te) { + J && (te = G, G = e[te]), Yn(d, te, tt(G, t, n, te, e, f)); + }), d; + } + function sd(e) { + var t = Ie(e); + return function(n) { + return il(n, e, t); + }; + } + function il(e, t, n) { + var s = n.length; + if (e == null) + return !s; + for (e = de(e); s--; ) { + var l = n[s], f = t[l], d = e[l]; + if (d === i && !(l in e) || !f(d)) + return !1; + } + return !0; + } + function sl(e, t, n) { + if (typeof e != "function") + throw new je(y); + return nr(function() { + e.apply(i, n); + }, t); + } + function Xn(e, t, n, s) { + var l = -1, f = wr, d = !0, h = e.length, m = [], x = t.length; + if (!h) + return m; + n && (t = ve(t, ze(n))), s ? (f = Li, d = !1) : t.length >= a && (f = Hn, d = !1, t = new sn(t)); + e: + for (; ++l < h; ) { + var $ = e[l], A = n == null ? $ : n($); + if ($ = s || $ !== 0 ? $ : 0, d && A === A) { + for (var I = x; I--; ) + if (t[I] === A) + continue e; + m.push($); + } else + f(t, A, s) || m.push($); + } + return m; + } + var Ht = Rl(mt), ol = Rl(Yi, !0); + function od(e, t) { + var n = !0; + return Ht(e, function(s, l, f) { + return n = !!t(s, l, f), n; + }), n; + } + function Nr(e, t, n) { + for (var s = -1, l = e.length; ++s < l; ) { + var f = e[s], d = t(f); + if (d != null && (h === i ? d === d && !Ke(d) : n(d, h))) + var h = d, m = f; + } + return m; + } + function ld(e, t, n, s) { + var l = e.length; + for (n = X(n), n < 0 && (n = -n > l ? 0 : l + n), s = s === i || s > l ? l : X(s), s < 0 && (s += l), s = n > s ? 0 : xa(s); n < s; ) + e[n++] = t; + return e; + } + function ll(e, t) { + var n = []; + return Ht(e, function(s, l, f) { + t(s, l, f) && n.push(s); + }), n; + } + function Le(e, t, n, s, l) { + var f = -1, d = e.length; + for (n || (n = Yd), l || (l = []); ++f < d; ) { + var h = e[f]; + t > 0 && n(h) ? t > 1 ? Le(h, t - 1, n, s, l) : Ut(l, h) : s || (l[l.length] = h); + } + return l; + } + var Ki = Ll(), al = Ll(!0); + function mt(e, t) { + return e && Ki(e, t, Ie); + } + function Yi(e, t) { + return e && al(e, t, Ie); + } + function Ur(e, t) { + return Nt(t, function(n) { + return Mt(e[n]); + }); + } + function ln(e, t) { + t = Zt(t, e); + for (var n = 0, s = t.length; e != null && n < s; ) + e = e[bt(t[n++])]; + return n && n == s ? e : i; + } + function ul(e, t, n) { + var s = t(e); + return Y(e) ? s : Ut(s, n(e)); + } + function Pe(e) { + return e == null ? e === i ? Bu : Lu : nn && nn in de(e) ? Hd(e) : np(e); + } + function Xi(e, t) { + return e > t; + } + function ad(e, t) { + return e != null && ce.call(e, t); + } + function ud(e, t) { + return e != null && t in de(e); + } + function cd(e, t, n) { + return e >= Me(t, n) && e < Oe(t, n); + } + function Ji(e, t, n) { + for (var s = n ? Li : wr, l = e[0].length, f = e.length, d = f, h = w(f), m = 1 / 0, x = []; d--; ) { + var $ = e[d]; + d && t && ($ = ve($, ze(t))), m = Me($.length, m), h[d] = !n && (t || l >= 120 && $.length >= 120) ? new sn(d && $) : i; + } + $ = e[0]; + var A = -1, I = h[0]; + e: + for (; ++A < l && x.length < m; ) { + var P = $[A], H = t ? t(P) : P; + if (P = n || P !== 0 ? P : 0, !(I ? Hn(I, H) : s(x, H, n))) { + for (d = f; --d; ) { + var J = h[d]; + if (!(J ? Hn(J, H) : s(e[d], H, n))) + continue e; + } + I && I.push(H), x.push(P); + } + } + return x; + } + function fd(e, t, n, s) { + return mt(e, function(l, f, d) { + t(s, n(l), f, d); + }), s; + } + function Jn(e, t, n) { + t = Zt(t, e), e = Xl(e, t); + var s = e == null ? e : e[bt(rt(t))]; + return s == null ? i : Ze(s, e, n); + } + function cl(e) { + return ke(e) && Pe(e) == vn; + } + function dd(e) { + return ke(e) && Pe(e) == Vn; + } + function pd(e) { + return ke(e) && Pe(e) == Dn; + } + function Qn(e, t, n, s, l) { + return e === t ? !0 : e == null || t == null || !ke(e) && !ke(t) ? e !== e && t !== t : hd(e, t, n, s, Qn, l); + } + function hd(e, t, n, s, l, f) { + var d = Y(e), h = Y(t), m = d ? hr : Be(e), x = h ? hr : Be(t); + m = m == vn ? Tt : m, x = x == vn ? Tt : x; + var $ = m == Tt, A = x == Tt, I = m == x; + if (I && qt(e)) { + if (!qt(t)) + return !1; + d = !0, $ = !1; + } + if (I && !$) + return f || (f = new ft()), d || En(e) ? Hl(e, t, n, s, l, f) : Wd(e, t, m, n, s, l, f); + if (!(n & ee)) { + var P = $ && ce.call(e, "__wrapped__"), H = A && ce.call(t, "__wrapped__"); + if (P || H) { + var J = P ? e.value() : e, G = H ? t.value() : t; + return f || (f = new ft()), l(J, G, n, s, f); + } + } + return I ? (f || (f = new ft()), Vd(e, t, n, s, l, f)) : !1; + } + function _d(e) { + return ke(e) && Be(e) == at; + } + function Qi(e, t, n, s) { + var l = n.length, f = l, d = !s; + if (e == null) + return !f; + for (e = de(e); l--; ) { + var h = n[l]; + if (d && h[2] ? h[1] !== e[h[0]] : !(h[0] in e)) + return !1; + } + for (; ++l < f; ) { + h = n[l]; + var m = h[0], x = e[m], $ = h[1]; + if (d && h[2]) { + if (x === i && !(m in e)) + return !1; + } else { + var A = new ft(); + if (s) + var I = s(x, $, m, e, t, A); + if (!(I === i ? Qn($, x, ee | O, s, A) : I)) + return !1; + } + } + return !0; + } + function fl(e) { + if (!me(e) || Jd(e)) + return !1; + var t = Mt(e) ? _f : ic; + return t.test(un(e)); + } + function vd(e) { + return ke(e) && Pe(e) == Nn; + } + function gd(e) { + return ke(e) && Be(e) == ut; + } + function md(e) { + return ke(e) && ri(e.length) && !!_e[Pe(e)]; + } + function dl(e) { + return typeof e == "function" ? e : e == null ? He : typeof e == "object" ? Y(e) ? _l(e[0], e[1]) : hl(e) : Ma(e); + } + function ji(e) { + if (!tr(e)) + return wf(e); + var t = []; + for (var n in de(e)) + ce.call(e, n) && n != "constructor" && t.push(n); + return t; + } + function yd(e) { + if (!me(e)) + return tp(e); + var t = tr(e), n = []; + for (var s in e) + s == "constructor" && (t || !ce.call(e, s)) || n.push(s); + return n; + } + function es(e, t) { + return e < t; + } + function pl(e, t) { + var n = -1, s = We(e) ? w(e.length) : []; + return Ht(e, function(l, f, d) { + s[++n] = t(l, f, d); + }), s; + } + function hl(e) { + var t = _s(e); + return t.length == 1 && t[0][2] ? Kl(t[0][0], t[0][1]) : function(n) { + return n === e || Qi(n, e, t); + }; + } + function _l(e, t) { + return gs(e) && ql(t) ? Kl(bt(e), t) : function(n) { + var s = Ts(n, e); + return s === i && s === t ? Cs(n, e) : Qn(t, s, ee | O); + }; + } + function Wr(e, t, n, s, l) { + e !== t && Ki(t, function(f, d) { + if (l || (l = new ft()), me(f)) + bd(e, t, d, n, Wr, s, l); + else { + var h = s ? s(ys(e, d), f, d + "", e, t, l) : i; + h === i && (h = f), zi(e, d, h); + } + }, Ve); + } + function bd(e, t, n, s, l, f, d) { + var h = ys(e, n), m = ys(t, n), x = d.get(m); + if (x) { + zi(e, n, x); + return; + } + var $ = f ? f(h, m, n + "", e, t, d) : i, A = $ === i; + if (A) { + var I = Y(m), P = !I && qt(m), H = !I && !P && En(m); + $ = m, I || P || H ? Y(h) ? $ = h : xe(h) ? $ = Ue(h) : P ? (A = !1, $ = Tl(m, !0)) : H ? (A = !1, $ = Cl(m, !0)) : $ = [] : rr(m) || cn(m) ? ($ = h, cn(h) ? $ = $a(h) : (!me(h) || Mt(h)) && ($ = zl(m))) : A = !1; + } + A && (d.set(m, $), l($, m, s, f, d), d.delete(m)), zi(e, n, $); + } + function vl(e, t) { + var n = e.length; + if (n) + return t += t < 0 ? n : 0, Lt(t, n) ? e[t] : i; + } + function gl(e, t, n) { + t.length ? t = ve(t, function(f) { + return Y(f) ? function(d) { + return ln(d, f.length === 1 ? f[0] : f); + } : f; + }) : t = [He]; + var s = -1; + t = ve(t, ze(U())); + var l = pl(e, function(f, d, h) { + var m = ve(t, function(x) { + return x(f); + }); + return { criteria: m, index: ++s, value: f }; + }); + return zc(l, function(f, d) { + return Ld(f, d, n); + }); + } + function wd(e, t) { + return ml(e, t, function(n, s) { + return Cs(e, s); + }); + } + function ml(e, t, n) { + for (var s = -1, l = t.length, f = {}; ++s < l; ) { + var d = t[s], h = ln(e, d); + n(h, d) && jn(f, Zt(d, e), h); + } + return f; + } + function kd(e) { + return function(t) { + return ln(t, e); + }; + } + function ts(e, t, n, s) { + var l = s ? Zc : yn, f = -1, d = t.length, h = e; + for (e === t && (t = Ue(t)), n && (h = ve(e, ze(n))); ++f < d; ) + for (var m = 0, x = t[f], $ = n ? n(x) : x; (m = l(h, $, m, s)) > -1; ) + h !== e && Ir.call(h, m, 1), Ir.call(e, m, 1); + return e; + } + function yl(e, t) { + for (var n = e ? t.length : 0, s = n - 1; n--; ) { + var l = t[n]; + if (n == s || l !== f) { + var f = l; + Lt(l) ? Ir.call(e, l, 1) : ss(e, l); + } + } + return e; + } + function ns(e, t) { + return e + Mr(jo() * (t - e + 1)); + } + function xd(e, t, n, s) { + for (var l = -1, f = Oe(Lr((t - e) / (n || 1)), 0), d = w(f); f--; ) + d[s ? f : ++l] = e, e += n; + return d; + } + function rs(e, t) { + var n = ""; + if (!e || t < 1 || t > Ft) + return n; + do + t % 2 && (n += e), t = Mr(t / 2), t && (e += e); + while (t); + return n; + } + function j(e, t) { + return bs(Yl(e, t, He), e + ""); + } + function $d(e) { + return nl(In(e)); + } + function Ad(e, t) { + var n = In(e); + return Jr(n, on(t, 0, n.length)); + } + function jn(e, t, n, s) { + if (!me(e)) + return e; + t = Zt(t, e); + for (var l = -1, f = t.length, d = f - 1, h = e; h != null && ++l < f; ) { + var m = bt(t[l]), x = n; + if (m === "__proto__" || m === "constructor" || m === "prototype") + return e; + if (l != d) { + var $ = h[m]; + x = s ? s($, m, h) : i, x === i && (x = me($) ? $ : Lt(t[l + 1]) ? [] : {}); + } + Yn(h, m, x), h = h[m]; + } + return e; + } + var bl = Br ? function(e, t) { + return Br.set(e, t), e; + } : He, Sd = Rr ? function(e, t) { + return Rr(e, "toString", { + configurable: !0, + enumerable: !1, + value: Es(t), + writable: !0 + }); + } : He; + function Td(e) { + return Jr(In(e)); + } + function nt(e, t, n) { + var s = -1, l = e.length; + t < 0 && (t = -t > l ? 0 : l + t), n = n > l ? l : n, n < 0 && (n += l), l = t > n ? 0 : n - t >>> 0, t >>>= 0; + for (var f = w(l); ++s < l; ) + f[s] = e[s + t]; + return f; + } + function Cd(e, t) { + var n; + return Ht(e, function(s, l, f) { + return n = t(s, l, f), !n; + }), !!n; + } + function Vr(e, t, n) { + var s = 0, l = e == null ? s : e.length; + if (typeof t == "number" && t === t && l <= Ou) { + for (; s < l; ) { + var f = s + l >>> 1, d = e[f]; + d !== null && !Ke(d) && (n ? d <= t : d < t) ? s = f + 1 : l = f; + } + return l; + } + return is(e, t, He, n); + } + function is(e, t, n, s) { + var l = 0, f = e == null ? 0 : e.length; + if (f === 0) + return 0; + t = n(t); + for (var d = t !== t, h = t === null, m = Ke(t), x = t === i; l < f; ) { + var $ = Mr((l + f) / 2), A = n(e[$]), I = A !== i, P = A === null, H = A === A, J = Ke(A); + if (d) + var G = s || H; + else + x ? G = H && (s || I) : h ? G = H && I && (s || !P) : m ? G = H && I && !P && (s || !J) : P || J ? G = !1 : G = s ? A <= t : A < t; + G ? l = $ + 1 : f = $; + } + return Me(f, Cu); + } + function wl(e, t) { + for (var n = -1, s = e.length, l = 0, f = []; ++n < s; ) { + var d = e[n], h = t ? t(d) : d; + if (!n || !dt(h, m)) { + var m = h; + f[l++] = d === 0 ? 0 : d; + } + } + return f; + } + function kl(e) { + return typeof e == "number" ? e : Ke(e) ? pr : +e; + } + function qe(e) { + if (typeof e == "string") + return e; + if (Y(e)) + return ve(e, qe) + ""; + if (Ke(e)) + return el ? el.call(e) : ""; + var t = e + ""; + return t == "0" && 1 / e == -en ? "-0" : t; + } + function Gt(e, t, n) { + var s = -1, l = wr, f = e.length, d = !0, h = [], m = h; + if (n) + d = !1, l = Li; + else if (f >= a) { + var x = t ? null : Nd(e); + if (x) + return xr(x); + d = !1, l = Hn, m = new sn(); + } else + m = t ? [] : h; + e: + for (; ++s < f; ) { + var $ = e[s], A = t ? t($) : $; + if ($ = n || $ !== 0 ? $ : 0, d && A === A) { + for (var I = m.length; I--; ) + if (m[I] === A) + continue e; + t && m.push(A), h.push($); + } else + l(m, A, n) || (m !== h && m.push(A), h.push($)); + } + return h; + } + function ss(e, t) { + return t = Zt(t, e), e = Xl(e, t), e == null || delete e[bt(rt(t))]; + } + function xl(e, t, n, s) { + return jn(e, t, n(ln(e, t)), s); + } + function Hr(e, t, n, s) { + for (var l = e.length, f = s ? l : -1; (s ? f-- : ++f < l) && t(e[f], f, e); ) + ; + return n ? nt(e, s ? 0 : f, s ? f + 1 : l) : nt(e, s ? f + 1 : 0, s ? l : f); + } + function $l(e, t) { + var n = e; + return n instanceof ne && (n = n.value()), Mi(t, function(s, l) { + return l.func.apply(l.thisArg, Ut([s], l.args)); + }, n); + } + function os(e, t, n) { + var s = e.length; + if (s < 2) + return s ? Gt(e[0]) : []; + for (var l = -1, f = w(s); ++l < s; ) + for (var d = e[l], h = -1; ++h < s; ) + h != l && (f[l] = Xn(f[l] || d, e[h], t, n)); + return Gt(Le(f, 1), t, n); + } + function Al(e, t, n) { + for (var s = -1, l = e.length, f = t.length, d = {}; ++s < l; ) { + var h = s < f ? t[s] : i; + n(d, e[s], h); + } + return d; + } + function ls(e) { + return xe(e) ? e : []; + } + function as(e) { + return typeof e == "function" ? e : He; + } + function Zt(e, t) { + return Y(e) ? e : gs(e, t) ? [e] : ea(ue(e)); + } + var Od = j; + function zt(e, t, n) { + var s = e.length; + return n = n === i ? s : n, !t && n >= s ? e : nt(e, t, n); + } + var Sl = vf || function(e) { + return Re.clearTimeout(e); + }; + function Tl(e, t) { + if (t) + return e.slice(); + var n = e.length, s = Ko ? Ko(n) : new e.constructor(n); + return e.copy(s), s; + } + function us(e) { + var t = new e.constructor(e.byteLength); + return new Or(t).set(new Or(e)), t; + } + function Ed(e, t) { + var n = t ? us(e.buffer) : e.buffer; + return new e.constructor(n, e.byteOffset, e.byteLength); + } + function Id(e) { + var t = new e.constructor(e.source, uo.exec(e)); + return t.lastIndex = e.lastIndex, t; + } + function Rd(e) { + return Kn ? de(Kn.call(e)) : {}; + } + function Cl(e, t) { + var n = t ? us(e.buffer) : e.buffer; + return new e.constructor(n, e.byteOffset, e.length); + } + function Ol(e, t) { + if (e !== t) { + var n = e !== i, s = e === null, l = e === e, f = Ke(e), d = t !== i, h = t === null, m = t === t, x = Ke(t); + if (!h && !x && !f && e > t || f && d && m && !h && !x || s && d && m || !n && m || !l) + return 1; + if (!s && !f && !x && e < t || x && n && l && !s && !f || h && n && l || !d && l || !m) + return -1; + } + return 0; + } + function Ld(e, t, n) { + for (var s = -1, l = e.criteria, f = t.criteria, d = l.length, h = n.length; ++s < d; ) { + var m = Ol(l[s], f[s]); + if (m) { + if (s >= h) + return m; + var x = n[s]; + return m * (x == "desc" ? -1 : 1); + } + } + return e.index - t.index; + } + function El(e, t, n, s) { + for (var l = -1, f = e.length, d = n.length, h = -1, m = t.length, x = Oe(f - d, 0), $ = w(m + x), A = !s; ++h < m; ) + $[h] = t[h]; + for (; ++l < d; ) + (A || l < f) && ($[n[l]] = e[l]); + for (; x--; ) + $[h++] = e[l++]; + return $; + } + function Il(e, t, n, s) { + for (var l = -1, f = e.length, d = -1, h = n.length, m = -1, x = t.length, $ = Oe(f - h, 0), A = w($ + x), I = !s; ++l < $; ) + A[l] = e[l]; + for (var P = l; ++m < x; ) + A[P + m] = t[m]; + for (; ++d < h; ) + (I || l < f) && (A[P + n[d]] = e[l++]); + return A; + } + function Ue(e, t) { + var n = -1, s = e.length; + for (t || (t = w(s)); ++n < s; ) + t[n] = e[n]; + return t; + } + function yt(e, t, n, s) { + var l = !n; + n || (n = {}); + for (var f = -1, d = t.length; ++f < d; ) { + var h = t[f], m = s ? s(n[h], e[h], h, n, e) : i; + m === i && (m = e[h]), l ? Et(n, h, m) : Yn(n, h, m); + } + return n; + } + function Md(e, t) { + return yt(e, vs(e), t); + } + function Bd(e, t) { + return yt(e, Gl(e), t); + } + function Gr(e, t) { + return function(n, s) { + var l = Y(n) ? Nc : rd, f = t ? t() : {}; + return l(n, e, U(s, 2), f); + }; + } + function Tn(e) { + return j(function(t, n) { + var s = -1, l = n.length, f = l > 1 ? n[l - 1] : i, d = l > 2 ? n[2] : i; + for (f = e.length > 3 && typeof f == "function" ? (l--, f) : i, d && De(n[0], n[1], d) && (f = l < 3 ? i : f, l = 1), t = de(t); ++s < l; ) { + var h = n[s]; + h && e(t, h, s, f); + } + return t; + }); + } + function Rl(e, t) { + return function(n, s) { + if (n == null) + return n; + if (!We(n)) + return e(n, s); + for (var l = n.length, f = t ? l : -1, d = de(n); (t ? f-- : ++f < l) && s(d[f], f, d) !== !1; ) + ; + return n; + }; + } + function Ll(e) { + return function(t, n, s) { + for (var l = -1, f = de(t), d = s(t), h = d.length; h--; ) { + var m = d[e ? h : ++l]; + if (n(f[m], m, f) === !1) + break; + } + return t; + }; + } + function Pd(e, t, n) { + var s = t & E, l = er(e); + function f() { + var d = this && this !== Re && this instanceof f ? l : e; + return d.apply(s ? n : this, arguments); + } + return f; + } + function Ml(e) { + return function(t) { + t = ue(t); + var n = bn(t) ? ct(t) : i, s = n ? n[0] : t.charAt(0), l = n ? zt(n, 1).join("") : t.slice(1); + return s[e]() + l; + }; + } + function Cn(e) { + return function(t) { + return Mi(Ra(Ia(t).replace(Ac, "")), e, ""); + }; + } + function er(e) { + return function() { + var t = arguments; + switch (t.length) { + case 0: + return new e(); + case 1: + return new e(t[0]); + case 2: + return new e(t[0], t[1]); + case 3: + return new e(t[0], t[1], t[2]); + case 4: + return new e(t[0], t[1], t[2], t[3]); + case 5: + return new e(t[0], t[1], t[2], t[3], t[4]); + case 6: + return new e(t[0], t[1], t[2], t[3], t[4], t[5]); + case 7: + return new e(t[0], t[1], t[2], t[3], t[4], t[5], t[6]); + } + var n = Sn(e.prototype), s = e.apply(n, t); + return me(s) ? s : n; + }; + } + function Dd(e, t, n) { + var s = er(e); + function l() { + for (var f = arguments.length, d = w(f), h = f, m = On(l); h--; ) + d[h] = arguments[h]; + var x = f < 3 && d[0] !== m && d[f - 1] !== m ? [] : Wt(d, m); + if (f -= x.length, f < n) + return Nl( + e, + t, + Zr, + l.placeholder, + i, + d, + x, + i, + i, + n - f + ); + var $ = this && this !== Re && this instanceof l ? s : e; + return Ze($, this, d); + } + return l; + } + function Bl(e) { + return function(t, n, s) { + var l = de(t); + if (!We(t)) { + var f = U(n, 3); + t = Ie(t), n = function(h) { + return f(l[h], h, l); + }; + } + var d = e(t, n, s); + return d > -1 ? l[f ? t[d] : d] : i; + }; + } + function Pl(e) { + return Rt(function(t) { + var n = t.length, s = n, l = et.prototype.thru; + for (e && t.reverse(); s--; ) { + var f = t[s]; + if (typeof f != "function") + throw new je(y); + if (l && !d && Yr(f) == "wrapper") + var d = new et([], !0); + } + for (s = d ? s : n; ++s < n; ) { + f = t[s]; + var h = Yr(f), m = h == "wrapper" ? hs(f) : i; + m && ms(m[0]) && m[1] == (Ee | F | q | At) && !m[4].length && m[9] == 1 ? d = d[Yr(m[0])].apply(d, m[3]) : d = f.length == 1 && ms(f) ? d[h]() : d.thru(f); + } + return function() { + var x = arguments, $ = x[0]; + if (d && x.length == 1 && Y($)) + return d.plant($).value(); + for (var A = 0, I = n ? t[A].apply(this, x) : $; ++A < n; ) + I = t[A].call(this, I); + return I; + }; + }); + } + function Zr(e, t, n, s, l, f, d, h, m, x) { + var $ = t & Ee, A = t & E, I = t & W, P = t & (F | Z), H = t & Bn, J = I ? i : er(e); + function G() { + for (var te = arguments.length, re = w(te), Ye = te; Ye--; ) + re[Ye] = arguments[Ye]; + if (P) + var Fe = On(G), Xe = Kc(re, Fe); + if (s && (re = El(re, s, l, P)), f && (re = Il(re, f, d, P)), te -= Xe, P && te < x) { + var $e = Wt(re, Fe); + return Nl( + e, + t, + Zr, + G.placeholder, + n, + re, + $e, + h, + m, + x - te + ); + } + var pt = A ? n : this, Pt = I ? pt[e] : e; + return te = re.length, h ? re = rp(re, h) : H && te > 1 && re.reverse(), $ && m < te && (re.length = m), this && this !== Re && this instanceof G && (Pt = J || er(Pt)), Pt.apply(pt, re); + } + return G; + } + function Dl(e, t) { + return function(n, s) { + return fd(n, e, t(s), {}); + }; + } + function zr(e, t) { + return function(n, s) { + var l; + if (n === i && s === i) + return t; + if (n !== i && (l = n), s !== i) { + if (l === i) + return s; + typeof n == "string" || typeof s == "string" ? (n = qe(n), s = qe(s)) : (n = kl(n), s = kl(s)), l = e(n, s); + } + return l; + }; + } + function cs(e) { + return Rt(function(t) { + return t = ve(t, ze(U())), j(function(n) { + var s = this; + return e(t, function(l) { + return Ze(l, s, n); + }); + }); + }); + } + function qr(e, t) { + t = t === i ? " " : qe(t); + var n = t.length; + if (n < 2) + return n ? rs(t, e) : t; + var s = rs(t, Lr(e / wn(t))); + return bn(t) ? zt(ct(s), 0, e).join("") : s.slice(0, e); + } + function Fd(e, t, n, s) { + var l = t & E, f = er(e); + function d() { + for (var h = -1, m = arguments.length, x = -1, $ = s.length, A = w($ + m), I = this && this !== Re && this instanceof d ? f : e; ++x < $; ) + A[x] = s[x]; + for (; m--; ) + A[x++] = arguments[++h]; + return Ze(I, l ? n : this, A); + } + return d; + } + function Fl(e) { + return function(t, n, s) { + return s && typeof s != "number" && De(t, n, s) && (n = s = i), t = Bt(t), n === i ? (n = t, t = 0) : n = Bt(n), s = s === i ? t < n ? 1 : -1 : Bt(s), xd(t, n, s, e); + }; + } + function Kr(e) { + return function(t, n) { + return typeof t == "string" && typeof n == "string" || (t = it(t), n = it(n)), e(t, n); + }; + } + function Nl(e, t, n, s, l, f, d, h, m, x) { + var $ = t & F, A = $ ? d : i, I = $ ? i : d, P = $ ? f : i, H = $ ? i : f; + t |= $ ? q : ge, t &= ~($ ? ge : q), t & V || (t &= ~(E | W)); + var J = [ + e, + t, + l, + P, + A, + H, + I, + h, + m, + x + ], G = n.apply(i, J); + return ms(e) && Jl(G, J), G.placeholder = s, Ql(G, e, t); + } + function fs(e) { + var t = Ce[e]; + return function(n, s) { + if (n = it(n), s = s == null ? 0 : Me(X(s), 292), s && Qo(n)) { + var l = (ue(n) + "e").split("e"), f = t(l[0] + "e" + (+l[1] + s)); + return l = (ue(f) + "e").split("e"), +(l[0] + "e" + (+l[1] - s)); + } + return t(n); + }; + } + var Nd = $n && 1 / xr(new $n([, -0]))[1] == en ? function(e) { + return new $n(e); + } : Ls; + function Ul(e) { + return function(t) { + var n = Be(t); + return n == at ? Wi(t) : n == ut ? tf(t) : qc(t, e(t)); + }; + } + function It(e, t, n, s, l, f, d, h) { + var m = t & W; + if (!m && typeof e != "function") + throw new je(y); + var x = s ? s.length : 0; + if (x || (t &= ~(q | ge), s = l = i), d = d === i ? d : Oe(X(d), 0), h = h === i ? h : X(h), x -= l ? l.length : 0, t & ge) { + var $ = s, A = l; + s = l = i; + } + var I = m ? i : hs(e), P = [ + e, + t, + n, + s, + l, + $, + A, + f, + d, + h + ]; + if (I && ep(P, I), e = P[0], t = P[1], n = P[2], s = P[3], l = P[4], h = P[9] = P[9] === i ? m ? 0 : e.length : Oe(P[9] - x, 0), !h && t & (F | Z) && (t &= ~(F | Z)), !t || t == E) + var H = Pd(e, t, n); + else + t == F || t == Z ? H = Dd(e, t, h) : (t == q || t == (E | q)) && !l.length ? H = Fd(e, t, n, s) : H = Zr.apply(i, P); + var J = I ? bl : Jl; + return Ql(J(H, P), e, t); + } + function Wl(e, t, n, s) { + return e === i || dt(e, xn[n]) && !ce.call(s, n) ? t : e; + } + function Vl(e, t, n, s, l, f) { + return me(e) && me(t) && (f.set(t, e), Wr(e, t, i, Vl, f), f.delete(t)), e; + } + function Ud(e) { + return rr(e) ? i : e; + } + function Hl(e, t, n, s, l, f) { + var d = n & ee, h = e.length, m = t.length; + if (h != m && !(d && m > h)) + return !1; + var x = f.get(e), $ = f.get(t); + if (x && $) + return x == t && $ == e; + var A = -1, I = !0, P = n & O ? new sn() : i; + for (f.set(e, t), f.set(t, e); ++A < h; ) { + var H = e[A], J = t[A]; + if (s) + var G = d ? s(J, H, A, t, e, f) : s(H, J, A, e, t, f); + if (G !== i) { + if (G) + continue; + I = !1; + break; + } + if (P) { + if (!Bi(t, function(te, re) { + if (!Hn(P, re) && (H === te || l(H, te, n, s, f))) + return P.push(re); + })) { + I = !1; + break; + } + } else if (!(H === J || l(H, J, n, s, f))) { + I = !1; + break; + } + } + return f.delete(e), f.delete(t), I; + } + function Wd(e, t, n, s, l, f, d) { + switch (n) { + case gn: + if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) + return !1; + e = e.buffer, t = t.buffer; + case Vn: + return !(e.byteLength != t.byteLength || !f(new Or(e), new Or(t))); + case Pn: + case Dn: + case Fn: + return dt(+e, +t); + case _r: + return e.name == t.name && e.message == t.message; + case Nn: + case Un: + return e == t + ""; + case at: + var h = Wi; + case ut: + var m = s & ee; + if (h || (h = xr), e.size != t.size && !m) + return !1; + var x = d.get(e); + if (x) + return x == t; + s |= O, d.set(e, t); + var $ = Hl(h(e), h(t), s, l, f, d); + return d.delete(e), $; + case gr: + if (Kn) + return Kn.call(e) == Kn.call(t); + } + return !1; + } + function Vd(e, t, n, s, l, f) { + var d = n & ee, h = ds(e), m = h.length, x = ds(t), $ = x.length; + if (m != $ && !d) + return !1; + for (var A = m; A--; ) { + var I = h[A]; + if (!(d ? I in t : ce.call(t, I))) + return !1; + } + var P = f.get(e), H = f.get(t); + if (P && H) + return P == t && H == e; + var J = !0; + f.set(e, t), f.set(t, e); + for (var G = d; ++A < m; ) { + I = h[A]; + var te = e[I], re = t[I]; + if (s) + var Ye = d ? s(re, te, I, t, e, f) : s(te, re, I, e, t, f); + if (!(Ye === i ? te === re || l(te, re, n, s, f) : Ye)) { + J = !1; + break; + } + G || (G = I == "constructor"); + } + if (J && !G) { + var Fe = e.constructor, Xe = t.constructor; + Fe != Xe && "constructor" in e && "constructor" in t && !(typeof Fe == "function" && Fe instanceof Fe && typeof Xe == "function" && Xe instanceof Xe) && (J = !1); + } + return f.delete(e), f.delete(t), J; + } + function Rt(e) { + return bs(Yl(e, i, ia), e + ""); + } + function ds(e) { + return ul(e, Ie, vs); + } + function ps(e) { + return ul(e, Ve, Gl); + } + var hs = Br ? function(e) { + return Br.get(e); + } : Ls; + function Yr(e) { + for (var t = e.name + "", n = An[t], s = ce.call(An, t) ? n.length : 0; s--; ) { + var l = n[s], f = l.func; + if (f == null || f == e) + return l.name; + } + return t; + } + function On(e) { + var t = ce.call(u, "placeholder") ? u : e; + return t.placeholder; + } + function U() { + var e = u.iteratee || Is; + return e = e === Is ? dl : e, arguments.length ? e(arguments[0], arguments[1]) : e; + } + function Xr(e, t) { + var n = e.__data__; + return Xd(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map; + } + function _s(e) { + for (var t = Ie(e), n = t.length; n--; ) { + var s = t[n], l = e[s]; + t[n] = [s, l, ql(l)]; + } + return t; + } + function an(e, t) { + var n = Qc(e, t); + return fl(n) ? n : i; + } + function Hd(e) { + var t = ce.call(e, nn), n = e[nn]; + try { + e[nn] = i; + var s = !0; + } catch { + } + var l = Tr.call(e); + return s && (t ? e[nn] = n : delete e[nn]), l; + } + var vs = Hi ? function(e) { + return e == null ? [] : (e = de(e), Nt(Hi(e), function(t) { + return Xo.call(e, t); + })); + } : Ms, Gl = Hi ? function(e) { + for (var t = []; e; ) + Ut(t, vs(e)), e = Er(e); + return t; + } : Ms, Be = Pe; + (Gi && Be(new Gi(new ArrayBuffer(1))) != gn || Zn && Be(new Zn()) != at || Zi && Be(Zi.resolve()) != so || $n && Be(new $n()) != ut || zn && Be(new zn()) != Wn) && (Be = function(e) { + var t = Pe(e), n = t == Tt ? e.constructor : i, s = n ? un(n) : ""; + if (s) + switch (s) { + case Af: + return gn; + case Sf: + return at; + case Tf: + return so; + case Cf: + return ut; + case Of: + return Wn; + } + return t; + }); + function Gd(e, t, n) { + for (var s = -1, l = n.length; ++s < l; ) { + var f = n[s], d = f.size; + switch (f.type) { + case "drop": + e += d; + break; + case "dropRight": + t -= d; + break; + case "take": + t = Me(t, e + d); + break; + case "takeRight": + e = Oe(e, t - d); + break; + } + } + return { start: e, end: t }; + } + function Zd(e) { + var t = e.match(Xu); + return t ? t[1].split(Ju) : []; + } + function Zl(e, t, n) { + t = Zt(t, e); + for (var s = -1, l = t.length, f = !1; ++s < l; ) { + var d = bt(t[s]); + if (!(f = e != null && n(e, d))) + break; + e = e[d]; + } + return f || ++s != l ? f : (l = e == null ? 0 : e.length, !!l && ri(l) && Lt(d, l) && (Y(e) || cn(e))); + } + function zd(e) { + var t = e.length, n = new e.constructor(t); + return t && typeof e[0] == "string" && ce.call(e, "index") && (n.index = e.index, n.input = e.input), n; + } + function zl(e) { + return typeof e.constructor == "function" && !tr(e) ? Sn(Er(e)) : {}; + } + function qd(e, t, n) { + var s = e.constructor; + switch (t) { + case Vn: + return us(e); + case Pn: + case Dn: + return new s(+e); + case gn: + return Ed(e, n); + case _i: + case vi: + case gi: + case mi: + case yi: + case bi: + case wi: + case ki: + case xi: + return Cl(e, n); + case at: + return new s(); + case Fn: + case Un: + return new s(e); + case Nn: + return Id(e); + case ut: + return new s(); + case gr: + return Rd(e); + } + } + function Kd(e, t) { + var n = t.length; + if (!n) + return e; + var s = n - 1; + return t[s] = (n > 1 ? "& " : "") + t[s], t = t.join(n > 2 ? ", " : " "), e.replace(Yu, `{ +/* [wrapped with ` + t + `] */ +`); + } + function Yd(e) { + return Y(e) || cn(e) || !!(Jo && e && e[Jo]); + } + function Lt(e, t) { + var n = typeof e; + return t = t ?? Ft, !!t && (n == "number" || n != "symbol" && oc.test(e)) && e > -1 && e % 1 == 0 && e < t; + } + function De(e, t, n) { + if (!me(n)) + return !1; + var s = typeof t; + return (s == "number" ? We(n) && Lt(t, n.length) : s == "string" && t in n) ? dt(n[t], e) : !1; + } + function gs(e, t) { + if (Y(e)) + return !1; + var n = typeof e; + return n == "number" || n == "symbol" || n == "boolean" || e == null || Ke(e) ? !0 : Zu.test(e) || !Gu.test(e) || t != null && e in de(t); + } + function Xd(e) { + var t = typeof e; + return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null; + } + function ms(e) { + var t = Yr(e), n = u[t]; + if (typeof n != "function" || !(t in ne.prototype)) + return !1; + if (e === n) + return !0; + var s = hs(n); + return !!s && e === s[0]; + } + function Jd(e) { + return !!qo && qo in e; + } + var Qd = Ar ? Mt : Bs; + function tr(e) { + var t = e && e.constructor, n = typeof t == "function" && t.prototype || xn; + return e === n; + } + function ql(e) { + return e === e && !me(e); + } + function Kl(e, t) { + return function(n) { + return n == null ? !1 : n[e] === t && (t !== i || e in de(n)); + }; + } + function jd(e) { + var t = ti(e, function(s) { + return n.size === g && n.clear(), s; + }), n = t.cache; + return t; + } + function ep(e, t) { + var n = e[1], s = t[1], l = n | s, f = l < (E | W | Ee), d = s == Ee && n == F || s == Ee && n == At && e[7].length <= t[8] || s == (Ee | At) && t[7].length <= t[8] && n == F; + if (!(f || d)) + return e; + s & E && (e[2] = t[2], l |= n & E ? 0 : V); + var h = t[3]; + if (h) { + var m = e[3]; + e[3] = m ? El(m, h, t[4]) : h, e[4] = m ? Wt(e[3], _) : t[4]; + } + return h = t[5], h && (m = e[5], e[5] = m ? Il(m, h, t[6]) : h, e[6] = m ? Wt(e[5], _) : t[6]), h = t[7], h && (e[7] = h), s & Ee && (e[8] = e[8] == null ? t[8] : Me(e[8], t[8])), e[9] == null && (e[9] = t[9]), e[0] = t[0], e[1] = l, e; + } + function tp(e) { + var t = []; + if (e != null) + for (var n in de(e)) + t.push(n); + return t; + } + function np(e) { + return Tr.call(e); + } + function Yl(e, t, n) { + return t = Oe(t === i ? e.length - 1 : t, 0), function() { + for (var s = arguments, l = -1, f = Oe(s.length - t, 0), d = w(f); ++l < f; ) + d[l] = s[t + l]; + l = -1; + for (var h = w(t + 1); ++l < t; ) + h[l] = s[l]; + return h[t] = n(d), Ze(e, this, h); + }; + } + function Xl(e, t) { + return t.length < 2 ? e : ln(e, nt(t, 0, -1)); + } + function rp(e, t) { + for (var n = e.length, s = Me(t.length, n), l = Ue(e); s--; ) { + var f = t[s]; + e[s] = Lt(f, n) ? l[f] : i; + } + return e; + } + function ys(e, t) { + if (!(t === "constructor" && typeof e[t] == "function") && t != "__proto__") + return e[t]; + } + var Jl = jl(bl), nr = mf || function(e, t) { + return Re.setTimeout(e, t); + }, bs = jl(Sd); + function Ql(e, t, n) { + var s = t + ""; + return bs(e, Kd(s, ip(Zd(s), n))); + } + function jl(e) { + var t = 0, n = 0; + return function() { + var s = kf(), l = St - (s - n); + if (n = s, l > 0) { + if (++t >= vt) + return arguments[0]; + } else + t = 0; + return e.apply(i, arguments); + }; + } + function Jr(e, t) { + var n = -1, s = e.length, l = s - 1; + for (t = t === i ? s : t; ++n < t; ) { + var f = ns(n, l), d = e[f]; + e[f] = e[n], e[n] = d; + } + return e.length = t, e; + } + var ea = jd(function(e) { + var t = []; + return e.charCodeAt(0) === 46 && t.push(""), e.replace(zu, function(n, s, l, f) { + t.push(l ? f.replace(ec, "$1") : s || n); + }), t; + }); + function bt(e) { + if (typeof e == "string" || Ke(e)) + return e; + var t = e + ""; + return t == "0" && 1 / e == -en ? "-0" : t; + } + function un(e) { + if (e != null) { + try { + return Sr.call(e); + } catch { + } + try { + return e + ""; + } catch { + } + } + return ""; + } + function ip(e, t) { + return Qe(Eu, function(n) { + var s = "_." + n[0]; + t & n[1] && !wr(e, s) && e.push(s); + }), e.sort(); + } + function ta(e) { + if (e instanceof ne) + return e.clone(); + var t = new et(e.__wrapped__, e.__chain__); + return t.__actions__ = Ue(e.__actions__), t.__index__ = e.__index__, t.__values__ = e.__values__, t; + } + function sp(e, t, n) { + (n ? De(e, t, n) : t === i) ? t = 1 : t = Oe(X(t), 0); + var s = e == null ? 0 : e.length; + if (!s || t < 1) + return []; + for (var l = 0, f = 0, d = w(Lr(s / t)); l < s; ) + d[f++] = nt(e, l, l += t); + return d; + } + function op(e) { + for (var t = -1, n = e == null ? 0 : e.length, s = 0, l = []; ++t < n; ) { + var f = e[t]; + f && (l[s++] = f); + } + return l; + } + function lp() { + var e = arguments.length; + if (!e) + return []; + for (var t = w(e - 1), n = arguments[0], s = e; s--; ) + t[s - 1] = arguments[s]; + return Ut(Y(n) ? Ue(n) : [n], Le(t, 1)); + } + var ap = j(function(e, t) { + return xe(e) ? Xn(e, Le(t, 1, xe, !0)) : []; + }), up = j(function(e, t) { + var n = rt(t); + return xe(n) && (n = i), xe(e) ? Xn(e, Le(t, 1, xe, !0), U(n, 2)) : []; + }), cp = j(function(e, t) { + var n = rt(t); + return xe(n) && (n = i), xe(e) ? Xn(e, Le(t, 1, xe, !0), i, n) : []; + }); + function fp(e, t, n) { + var s = e == null ? 0 : e.length; + return s ? (t = n || t === i ? 1 : X(t), nt(e, t < 0 ? 0 : t, s)) : []; + } + function dp(e, t, n) { + var s = e == null ? 0 : e.length; + return s ? (t = n || t === i ? 1 : X(t), t = s - t, nt(e, 0, t < 0 ? 0 : t)) : []; + } + function pp(e, t) { + return e && e.length ? Hr(e, U(t, 3), !0, !0) : []; + } + function hp(e, t) { + return e && e.length ? Hr(e, U(t, 3), !0) : []; + } + function _p(e, t, n, s) { + var l = e == null ? 0 : e.length; + return l ? (n && typeof n != "number" && De(e, t, n) && (n = 0, s = l), ld(e, t, n, s)) : []; + } + function na(e, t, n) { + var s = e == null ? 0 : e.length; + if (!s) + return -1; + var l = n == null ? 0 : X(n); + return l < 0 && (l = Oe(s + l, 0)), kr(e, U(t, 3), l); + } + function ra(e, t, n) { + var s = e == null ? 0 : e.length; + if (!s) + return -1; + var l = s - 1; + return n !== i && (l = X(n), l = n < 0 ? Oe(s + l, 0) : Me(l, s - 1)), kr(e, U(t, 3), l, !0); + } + function ia(e) { + var t = e == null ? 0 : e.length; + return t ? Le(e, 1) : []; + } + function vp(e) { + var t = e == null ? 0 : e.length; + return t ? Le(e, en) : []; + } + function gp(e, t) { + var n = e == null ? 0 : e.length; + return n ? (t = t === i ? 1 : X(t), Le(e, t)) : []; + } + function mp(e) { + for (var t = -1, n = e == null ? 0 : e.length, s = {}; ++t < n; ) { + var l = e[t]; + s[l[0]] = l[1]; + } + return s; + } + function sa(e) { + return e && e.length ? e[0] : i; + } + function yp(e, t, n) { + var s = e == null ? 0 : e.length; + if (!s) + return -1; + var l = n == null ? 0 : X(n); + return l < 0 && (l = Oe(s + l, 0)), yn(e, t, l); + } + function bp(e) { + var t = e == null ? 0 : e.length; + return t ? nt(e, 0, -1) : []; + } + var wp = j(function(e) { + var t = ve(e, ls); + return t.length && t[0] === e[0] ? Ji(t) : []; + }), kp = j(function(e) { + var t = rt(e), n = ve(e, ls); + return t === rt(n) ? t = i : n.pop(), n.length && n[0] === e[0] ? Ji(n, U(t, 2)) : []; + }), xp = j(function(e) { + var t = rt(e), n = ve(e, ls); + return t = typeof t == "function" ? t : i, t && n.pop(), n.length && n[0] === e[0] ? Ji(n, i, t) : []; + }); + function $p(e, t) { + return e == null ? "" : bf.call(e, t); + } + function rt(e) { + var t = e == null ? 0 : e.length; + return t ? e[t - 1] : i; + } + function Ap(e, t, n) { + var s = e == null ? 0 : e.length; + if (!s) + return -1; + var l = s; + return n !== i && (l = X(n), l = l < 0 ? Oe(s + l, 0) : Me(l, s - 1)), t === t ? rf(e, t, l) : kr(e, No, l, !0); + } + function Sp(e, t) { + return e && e.length ? vl(e, X(t)) : i; + } + var Tp = j(oa); + function oa(e, t) { + return e && e.length && t && t.length ? ts(e, t) : e; + } + function Cp(e, t, n) { + return e && e.length && t && t.length ? ts(e, t, U(n, 2)) : e; + } + function Op(e, t, n) { + return e && e.length && t && t.length ? ts(e, t, i, n) : e; + } + var Ep = Rt(function(e, t) { + var n = e == null ? 0 : e.length, s = qi(e, t); + return yl(e, ve(t, function(l) { + return Lt(l, n) ? +l : l; + }).sort(Ol)), s; + }); + function Ip(e, t) { + var n = []; + if (!(e && e.length)) + return n; + var s = -1, l = [], f = e.length; + for (t = U(t, 3); ++s < f; ) { + var d = e[s]; + t(d, s, e) && (n.push(d), l.push(s)); + } + return yl(e, l), n; + } + function ws(e) { + return e == null ? e : $f.call(e); + } + function Rp(e, t, n) { + var s = e == null ? 0 : e.length; + return s ? (n && typeof n != "number" && De(e, t, n) ? (t = 0, n = s) : (t = t == null ? 0 : X(t), n = n === i ? s : X(n)), nt(e, t, n)) : []; + } + function Lp(e, t) { + return Vr(e, t); + } + function Mp(e, t, n) { + return is(e, t, U(n, 2)); + } + function Bp(e, t) { + var n = e == null ? 0 : e.length; + if (n) { + var s = Vr(e, t); + if (s < n && dt(e[s], t)) + return s; + } + return -1; + } + function Pp(e, t) { + return Vr(e, t, !0); + } + function Dp(e, t, n) { + return is(e, t, U(n, 2), !0); + } + function Fp(e, t) { + var n = e == null ? 0 : e.length; + if (n) { + var s = Vr(e, t, !0) - 1; + if (dt(e[s], t)) + return s; + } + return -1; + } + function Np(e) { + return e && e.length ? wl(e) : []; + } + function Up(e, t) { + return e && e.length ? wl(e, U(t, 2)) : []; + } + function Wp(e) { + var t = e == null ? 0 : e.length; + return t ? nt(e, 1, t) : []; + } + function Vp(e, t, n) { + return e && e.length ? (t = n || t === i ? 1 : X(t), nt(e, 0, t < 0 ? 0 : t)) : []; + } + function Hp(e, t, n) { + var s = e == null ? 0 : e.length; + return s ? (t = n || t === i ? 1 : X(t), t = s - t, nt(e, t < 0 ? 0 : t, s)) : []; + } + function Gp(e, t) { + return e && e.length ? Hr(e, U(t, 3), !1, !0) : []; + } + function Zp(e, t) { + return e && e.length ? Hr(e, U(t, 3)) : []; + } + var zp = j(function(e) { + return Gt(Le(e, 1, xe, !0)); + }), qp = j(function(e) { + var t = rt(e); + return xe(t) && (t = i), Gt(Le(e, 1, xe, !0), U(t, 2)); + }), Kp = j(function(e) { + var t = rt(e); + return t = typeof t == "function" ? t : i, Gt(Le(e, 1, xe, !0), i, t); + }); + function Yp(e) { + return e && e.length ? Gt(e) : []; + } + function Xp(e, t) { + return e && e.length ? Gt(e, U(t, 2)) : []; + } + function Jp(e, t) { + return t = typeof t == "function" ? t : i, e && e.length ? Gt(e, i, t) : []; + } + function ks(e) { + if (!(e && e.length)) + return []; + var t = 0; + return e = Nt(e, function(n) { + if (xe(n)) + return t = Oe(n.length, t), !0; + }), Ni(t, function(n) { + return ve(e, Pi(n)); + }); + } + function la(e, t) { + if (!(e && e.length)) + return []; + var n = ks(e); + return t == null ? n : ve(n, function(s) { + return Ze(t, i, s); + }); + } + var Qp = j(function(e, t) { + return xe(e) ? Xn(e, t) : []; + }), jp = j(function(e) { + return os(Nt(e, xe)); + }), eh = j(function(e) { + var t = rt(e); + return xe(t) && (t = i), os(Nt(e, xe), U(t, 2)); + }), th = j(function(e) { + var t = rt(e); + return t = typeof t == "function" ? t : i, os(Nt(e, xe), i, t); + }), nh = j(ks); + function rh(e, t) { + return Al(e || [], t || [], Yn); + } + function ih(e, t) { + return Al(e || [], t || [], jn); + } + var sh = j(function(e) { + var t = e.length, n = t > 1 ? e[t - 1] : i; + return n = typeof n == "function" ? (e.pop(), n) : i, la(e, n); + }); + function aa(e) { + var t = u(e); + return t.__chain__ = !0, t; + } + function oh(e, t) { + return t(e), e; + } + function Qr(e, t) { + return t(e); + } + var lh = Rt(function(e) { + var t = e.length, n = t ? e[0] : 0, s = this.__wrapped__, l = function(f) { + return qi(f, e); + }; + return t > 1 || this.__actions__.length || !(s instanceof ne) || !Lt(n) ? this.thru(l) : (s = s.slice(n, +n + (t ? 1 : 0)), s.__actions__.push({ + func: Qr, + args: [l], + thisArg: i + }), new et(s, this.__chain__).thru(function(f) { + return t && !f.length && f.push(i), f; + })); + }); + function ah() { + return aa(this); + } + function uh() { + return new et(this.value(), this.__chain__); + } + function ch() { + this.__values__ === i && (this.__values__ = ka(this.value())); + var e = this.__index__ >= this.__values__.length, t = e ? i : this.__values__[this.__index__++]; + return { done: e, value: t }; + } + function fh() { + return this; + } + function dh(e) { + for (var t, n = this; n instanceof Dr; ) { + var s = ta(n); + s.__index__ = 0, s.__values__ = i, t ? l.__wrapped__ = s : t = s; + var l = s; + n = n.__wrapped__; + } + return l.__wrapped__ = e, t; + } + function ph() { + var e = this.__wrapped__; + if (e instanceof ne) { + var t = e; + return this.__actions__.length && (t = new ne(this)), t = t.reverse(), t.__actions__.push({ + func: Qr, + args: [ws], + thisArg: i + }), new et(t, this.__chain__); + } + return this.thru(ws); + } + function hh() { + return $l(this.__wrapped__, this.__actions__); + } + var _h = Gr(function(e, t, n) { + ce.call(e, n) ? ++e[n] : Et(e, n, 1); + }); + function vh(e, t, n) { + var s = Y(e) ? Do : od; + return n && De(e, t, n) && (t = i), s(e, U(t, 3)); + } + function gh(e, t) { + var n = Y(e) ? Nt : ll; + return n(e, U(t, 3)); + } + var mh = Bl(na), yh = Bl(ra); + function bh(e, t) { + return Le(jr(e, t), 1); + } + function wh(e, t) { + return Le(jr(e, t), en); + } + function kh(e, t, n) { + return n = n === i ? 1 : X(n), Le(jr(e, t), n); + } + function ua(e, t) { + var n = Y(e) ? Qe : Ht; + return n(e, U(t, 3)); + } + function ca(e, t) { + var n = Y(e) ? Uc : ol; + return n(e, U(t, 3)); + } + var xh = Gr(function(e, t, n) { + ce.call(e, n) ? e[n].push(t) : Et(e, n, [t]); + }); + function $h(e, t, n, s) { + e = We(e) ? e : In(e), n = n && !s ? X(n) : 0; + var l = e.length; + return n < 0 && (n = Oe(l + n, 0)), ii(e) ? n <= l && e.indexOf(t, n) > -1 : !!l && yn(e, t, n) > -1; + } + var Ah = j(function(e, t, n) { + var s = -1, l = typeof t == "function", f = We(e) ? w(e.length) : []; + return Ht(e, function(d) { + f[++s] = l ? Ze(t, d, n) : Jn(d, t, n); + }), f; + }), Sh = Gr(function(e, t, n) { + Et(e, n, t); + }); + function jr(e, t) { + var n = Y(e) ? ve : pl; + return n(e, U(t, 3)); + } + function Th(e, t, n, s) { + return e == null ? [] : (Y(t) || (t = t == null ? [] : [t]), n = s ? i : n, Y(n) || (n = n == null ? [] : [n]), gl(e, t, n)); + } + var Ch = Gr(function(e, t, n) { + e[n ? 0 : 1].push(t); + }, function() { + return [[], []]; + }); + function Oh(e, t, n) { + var s = Y(e) ? Mi : Wo, l = arguments.length < 3; + return s(e, U(t, 4), n, l, Ht); + } + function Eh(e, t, n) { + var s = Y(e) ? Wc : Wo, l = arguments.length < 3; + return s(e, U(t, 4), n, l, ol); + } + function Ih(e, t) { + var n = Y(e) ? Nt : ll; + return n(e, ni(U(t, 3))); + } + function Rh(e) { + var t = Y(e) ? nl : $d; + return t(e); + } + function Lh(e, t, n) { + (n ? De(e, t, n) : t === i) ? t = 1 : t = X(t); + var s = Y(e) ? td : Ad; + return s(e, t); + } + function Mh(e) { + var t = Y(e) ? nd : Td; + return t(e); + } + function Bh(e) { + if (e == null) + return 0; + if (We(e)) + return ii(e) ? wn(e) : e.length; + var t = Be(e); + return t == at || t == ut ? e.size : ji(e).length; + } + function Ph(e, t, n) { + var s = Y(e) ? Bi : Cd; + return n && De(e, t, n) && (t = i), s(e, U(t, 3)); + } + var Dh = j(function(e, t) { + if (e == null) + return []; + var n = t.length; + return n > 1 && De(e, t[0], t[1]) ? t = [] : n > 2 && De(t[0], t[1], t[2]) && (t = [t[0]]), gl(e, Le(t, 1), []); + }), ei = gf || function() { + return Re.Date.now(); + }; + function Fh(e, t) { + if (typeof t != "function") + throw new je(y); + return e = X(e), function() { + if (--e < 1) + return t.apply(this, arguments); + }; + } + function fa(e, t, n) { + return t = n ? i : t, t = e && t == null ? e.length : t, It(e, Ee, i, i, i, i, t); + } + function da(e, t) { + var n; + if (typeof t != "function") + throw new je(y); + return e = X(e), function() { + return --e > 0 && (n = t.apply(this, arguments)), e <= 1 && (t = i), n; + }; + } + var xs = j(function(e, t, n) { + var s = E; + if (n.length) { + var l = Wt(n, On(xs)); + s |= q; + } + return It(e, s, t, n, l); + }), pa = j(function(e, t, n) { + var s = E | W; + if (n.length) { + var l = Wt(n, On(pa)); + s |= q; + } + return It(t, s, e, n, l); + }); + function ha(e, t, n) { + t = n ? i : t; + var s = It(e, F, i, i, i, i, i, t); + return s.placeholder = ha.placeholder, s; + } + function _a(e, t, n) { + t = n ? i : t; + var s = It(e, Z, i, i, i, i, i, t); + return s.placeholder = _a.placeholder, s; + } + function va(e, t, n) { + var s, l, f, d, h, m, x = 0, $ = !1, A = !1, I = !0; + if (typeof e != "function") + throw new je(y); + t = it(t) || 0, me(n) && ($ = !!n.leading, A = "maxWait" in n, f = A ? Oe(it(n.maxWait) || 0, t) : f, I = "trailing" in n ? !!n.trailing : I); + function P($e) { + var pt = s, Pt = l; + return s = l = i, x = $e, d = e.apply(Pt, pt), d; + } + function H($e) { + return x = $e, h = nr(te, t), $ ? P($e) : d; + } + function J($e) { + var pt = $e - m, Pt = $e - x, Ba = t - pt; + return A ? Me(Ba, f - Pt) : Ba; + } + function G($e) { + var pt = $e - m, Pt = $e - x; + return m === i || pt >= t || pt < 0 || A && Pt >= f; + } + function te() { + var $e = ei(); + if (G($e)) + return re($e); + h = nr(te, J($e)); + } + function re($e) { + return h = i, I && s ? P($e) : (s = l = i, d); + } + function Ye() { + h !== i && Sl(h), x = 0, s = m = l = h = i; + } + function Fe() { + return h === i ? d : re(ei()); + } + function Xe() { + var $e = ei(), pt = G($e); + if (s = arguments, l = this, m = $e, pt) { + if (h === i) + return H(m); + if (A) + return Sl(h), h = nr(te, t), P(m); + } + return h === i && (h = nr(te, t)), d; + } + return Xe.cancel = Ye, Xe.flush = Fe, Xe; + } + var Nh = j(function(e, t) { + return sl(e, 1, t); + }), Uh = j(function(e, t, n) { + return sl(e, it(t) || 0, n); + }); + function Wh(e) { + return It(e, Bn); + } + function ti(e, t) { + if (typeof e != "function" || t != null && typeof t != "function") + throw new je(y); + var n = function() { + var s = arguments, l = t ? t.apply(this, s) : s[0], f = n.cache; + if (f.has(l)) + return f.get(l); + var d = e.apply(this, s); + return n.cache = f.set(l, d) || f, d; + }; + return n.cache = new (ti.Cache || Ot)(), n; + } + ti.Cache = Ot; + function ni(e) { + if (typeof e != "function") + throw new je(y); + return function() { + var t = arguments; + switch (t.length) { + case 0: + return !e.call(this); + case 1: + return !e.call(this, t[0]); + case 2: + return !e.call(this, t[0], t[1]); + case 3: + return !e.call(this, t[0], t[1], t[2]); + } + return !e.apply(this, t); + }; + } + function Vh(e) { + return da(2, e); + } + var Hh = Od(function(e, t) { + t = t.length == 1 && Y(t[0]) ? ve(t[0], ze(U())) : ve(Le(t, 1), ze(U())); + var n = t.length; + return j(function(s) { + for (var l = -1, f = Me(s.length, n); ++l < f; ) + s[l] = t[l].call(this, s[l]); + return Ze(e, this, s); + }); + }), $s = j(function(e, t) { + var n = Wt(t, On($s)); + return It(e, q, i, t, n); + }), ga = j(function(e, t) { + var n = Wt(t, On(ga)); + return It(e, ge, i, t, n); + }), Gh = Rt(function(e, t) { + return It(e, At, i, i, i, t); + }); + function Zh(e, t) { + if (typeof e != "function") + throw new je(y); + return t = t === i ? t : X(t), j(e, t); + } + function zh(e, t) { + if (typeof e != "function") + throw new je(y); + return t = t == null ? 0 : Oe(X(t), 0), j(function(n) { + var s = n[t], l = zt(n, 0, t); + return s && Ut(l, s), Ze(e, this, l); + }); + } + function qh(e, t, n) { + var s = !0, l = !0; + if (typeof e != "function") + throw new je(y); + return me(n) && (s = "leading" in n ? !!n.leading : s, l = "trailing" in n ? !!n.trailing : l), va(e, t, { + leading: s, + maxWait: t, + trailing: l + }); + } + function Kh(e) { + return fa(e, 1); + } + function Yh(e, t) { + return $s(as(t), e); + } + function Xh() { + if (!arguments.length) + return []; + var e = arguments[0]; + return Y(e) ? e : [e]; + } + function Jh(e) { + return tt(e, Q); + } + function Qh(e, t) { + return t = typeof t == "function" ? t : i, tt(e, Q, t); + } + function jh(e) { + return tt(e, C | Q); + } + function e_(e, t) { + return t = typeof t == "function" ? t : i, tt(e, C | Q, t); + } + function t_(e, t) { + return t == null || il(e, t, Ie(t)); + } + function dt(e, t) { + return e === t || e !== e && t !== t; + } + var n_ = Kr(Xi), r_ = Kr(function(e, t) { + return e >= t; + }), cn = cl(function() { + return arguments; + }()) ? cl : function(e) { + return ke(e) && ce.call(e, "callee") && !Xo.call(e, "callee"); + }, Y = w.isArray, i_ = Io ? ze(Io) : dd; + function We(e) { + return e != null && ri(e.length) && !Mt(e); + } + function xe(e) { + return ke(e) && We(e); + } + function s_(e) { + return e === !0 || e === !1 || ke(e) && Pe(e) == Pn; + } + var qt = yf || Bs, o_ = Ro ? ze(Ro) : pd; + function l_(e) { + return ke(e) && e.nodeType === 1 && !rr(e); + } + function a_(e) { + if (e == null) + return !0; + if (We(e) && (Y(e) || typeof e == "string" || typeof e.splice == "function" || qt(e) || En(e) || cn(e))) + return !e.length; + var t = Be(e); + if (t == at || t == ut) + return !e.size; + if (tr(e)) + return !ji(e).length; + for (var n in e) + if (ce.call(e, n)) + return !1; + return !0; + } + function u_(e, t) { + return Qn(e, t); + } + function c_(e, t, n) { + n = typeof n == "function" ? n : i; + var s = n ? n(e, t) : i; + return s === i ? Qn(e, t, i, n) : !!s; + } + function As(e) { + if (!ke(e)) + return !1; + var t = Pe(e); + return t == _r || t == Ru || typeof e.message == "string" && typeof e.name == "string" && !rr(e); + } + function f_(e) { + return typeof e == "number" && Qo(e); + } + function Mt(e) { + if (!me(e)) + return !1; + var t = Pe(e); + return t == vr || t == io || t == Iu || t == Mu; + } + function ma(e) { + return typeof e == "number" && e == X(e); + } + function ri(e) { + return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Ft; + } + function me(e) { + var t = typeof e; + return e != null && (t == "object" || t == "function"); + } + function ke(e) { + return e != null && typeof e == "object"; + } + var ya = Lo ? ze(Lo) : _d; + function d_(e, t) { + return e === t || Qi(e, t, _s(t)); + } + function p_(e, t, n) { + return n = typeof n == "function" ? n : i, Qi(e, t, _s(t), n); + } + function h_(e) { + return ba(e) && e != +e; + } + function __(e) { + if (Qd(e)) + throw new K(p); + return fl(e); + } + function v_(e) { + return e === null; + } + function g_(e) { + return e == null; + } + function ba(e) { + return typeof e == "number" || ke(e) && Pe(e) == Fn; + } + function rr(e) { + if (!ke(e) || Pe(e) != Tt) + return !1; + var t = Er(e); + if (t === null) + return !0; + var n = ce.call(t, "constructor") && t.constructor; + return typeof n == "function" && n instanceof n && Sr.call(n) == pf; + } + var Ss = Mo ? ze(Mo) : vd; + function m_(e) { + return ma(e) && e >= -Ft && e <= Ft; + } + var wa = Bo ? ze(Bo) : gd; + function ii(e) { + return typeof e == "string" || !Y(e) && ke(e) && Pe(e) == Un; + } + function Ke(e) { + return typeof e == "symbol" || ke(e) && Pe(e) == gr; + } + var En = Po ? ze(Po) : md; + function y_(e) { + return e === i; + } + function b_(e) { + return ke(e) && Be(e) == Wn; + } + function w_(e) { + return ke(e) && Pe(e) == Pu; + } + var k_ = Kr(es), x_ = Kr(function(e, t) { + return e <= t; + }); + function ka(e) { + if (!e) + return []; + if (We(e)) + return ii(e) ? ct(e) : Ue(e); + if (Gn && e[Gn]) + return ef(e[Gn]()); + var t = Be(e), n = t == at ? Wi : t == ut ? xr : In; + return n(e); + } + function Bt(e) { + if (!e) + return e === 0 ? e : 0; + if (e = it(e), e === en || e === -en) { + var t = e < 0 ? -1 : 1; + return t * Tu; + } + return e === e ? e : 0; + } + function X(e) { + var t = Bt(e), n = t % 1; + return t === t ? n ? t - n : t : 0; + } + function xa(e) { + return e ? on(X(e), 0, gt) : 0; + } + function it(e) { + if (typeof e == "number") + return e; + if (Ke(e)) + return pr; + if (me(e)) { + var t = typeof e.valueOf == "function" ? e.valueOf() : e; + e = me(t) ? t + "" : t; + } + if (typeof e != "string") + return e === 0 ? e : +e; + e = Vo(e); + var n = rc.test(e); + return n || sc.test(e) ? Dc(e.slice(2), n ? 2 : 8) : nc.test(e) ? pr : +e; + } + function $a(e) { + return yt(e, Ve(e)); + } + function $_(e) { + return e ? on(X(e), -Ft, Ft) : e === 0 ? e : 0; + } + function ue(e) { + return e == null ? "" : qe(e); + } + var A_ = Tn(function(e, t) { + if (tr(t) || We(t)) { + yt(t, Ie(t), e); + return; + } + for (var n in t) + ce.call(t, n) && Yn(e, n, t[n]); + }), Aa = Tn(function(e, t) { + yt(t, Ve(t), e); + }), si = Tn(function(e, t, n, s) { + yt(t, Ve(t), e, s); + }), S_ = Tn(function(e, t, n, s) { + yt(t, Ie(t), e, s); + }), T_ = Rt(qi); + function C_(e, t) { + var n = Sn(e); + return t == null ? n : rl(n, t); + } + var O_ = j(function(e, t) { + e = de(e); + var n = -1, s = t.length, l = s > 2 ? t[2] : i; + for (l && De(t[0], t[1], l) && (s = 1); ++n < s; ) + for (var f = t[n], d = Ve(f), h = -1, m = d.length; ++h < m; ) { + var x = d[h], $ = e[x]; + ($ === i || dt($, xn[x]) && !ce.call(e, x)) && (e[x] = f[x]); + } + return e; + }), E_ = j(function(e) { + return e.push(i, Vl), Ze(Sa, i, e); + }); + function I_(e, t) { + return Fo(e, U(t, 3), mt); + } + function R_(e, t) { + return Fo(e, U(t, 3), Yi); + } + function L_(e, t) { + return e == null ? e : Ki(e, U(t, 3), Ve); + } + function M_(e, t) { + return e == null ? e : al(e, U(t, 3), Ve); + } + function B_(e, t) { + return e && mt(e, U(t, 3)); + } + function P_(e, t) { + return e && Yi(e, U(t, 3)); + } + function D_(e) { + return e == null ? [] : Ur(e, Ie(e)); + } + function F_(e) { + return e == null ? [] : Ur(e, Ve(e)); + } + function Ts(e, t, n) { + var s = e == null ? i : ln(e, t); + return s === i ? n : s; + } + function N_(e, t) { + return e != null && Zl(e, t, ad); + } + function Cs(e, t) { + return e != null && Zl(e, t, ud); + } + var U_ = Dl(function(e, t, n) { + t != null && typeof t.toString != "function" && (t = Tr.call(t)), e[t] = n; + }, Es(He)), W_ = Dl(function(e, t, n) { + t != null && typeof t.toString != "function" && (t = Tr.call(t)), ce.call(e, t) ? e[t].push(n) : e[t] = [n]; + }, U), V_ = j(Jn); + function Ie(e) { + return We(e) ? tl(e) : ji(e); + } + function Ve(e) { + return We(e) ? tl(e, !0) : yd(e); + } + function H_(e, t) { + var n = {}; + return t = U(t, 3), mt(e, function(s, l, f) { + Et(n, t(s, l, f), s); + }), n; + } + function G_(e, t) { + var n = {}; + return t = U(t, 3), mt(e, function(s, l, f) { + Et(n, l, t(s, l, f)); + }), n; + } + var Z_ = Tn(function(e, t, n) { + Wr(e, t, n); + }), Sa = Tn(function(e, t, n, s) { + Wr(e, t, n, s); + }), z_ = Rt(function(e, t) { + var n = {}; + if (e == null) + return n; + var s = !1; + t = ve(t, function(f) { + return f = Zt(f, e), s || (s = f.length > 1), f; + }), yt(e, ps(e), n), s && (n = tt(n, C | D | Q, Ud)); + for (var l = t.length; l--; ) + ss(n, t[l]); + return n; + }); + function q_(e, t) { + return Ta(e, ni(U(t))); + } + var K_ = Rt(function(e, t) { + return e == null ? {} : wd(e, t); + }); + function Ta(e, t) { + if (e == null) + return {}; + var n = ve(ps(e), function(s) { + return [s]; + }); + return t = U(t), ml(e, n, function(s, l) { + return t(s, l[0]); + }); + } + function Y_(e, t, n) { + t = Zt(t, e); + var s = -1, l = t.length; + for (l || (l = 1, e = i); ++s < l; ) { + var f = e == null ? i : e[bt(t[s])]; + f === i && (s = l, f = n), e = Mt(f) ? f.call(e) : f; + } + return e; + } + function X_(e, t, n) { + return e == null ? e : jn(e, t, n); + } + function J_(e, t, n, s) { + return s = typeof s == "function" ? s : i, e == null ? e : jn(e, t, n, s); + } + var Ca = Ul(Ie), Oa = Ul(Ve); + function Q_(e, t, n) { + var s = Y(e), l = s || qt(e) || En(e); + if (t = U(t, 4), n == null) { + var f = e && e.constructor; + l ? n = s ? new f() : [] : me(e) ? n = Mt(f) ? Sn(Er(e)) : {} : n = {}; + } + return (l ? Qe : mt)(e, function(d, h, m) { + return t(n, d, h, m); + }), n; + } + function j_(e, t) { + return e == null ? !0 : ss(e, t); + } + function ev(e, t, n) { + return e == null ? e : xl(e, t, as(n)); + } + function tv(e, t, n, s) { + return s = typeof s == "function" ? s : i, e == null ? e : xl(e, t, as(n), s); + } + function In(e) { + return e == null ? [] : Ui(e, Ie(e)); + } + function nv(e) { + return e == null ? [] : Ui(e, Ve(e)); + } + function rv(e, t, n) { + return n === i && (n = t, t = i), n !== i && (n = it(n), n = n === n ? n : 0), t !== i && (t = it(t), t = t === t ? t : 0), on(it(e), t, n); + } + function iv(e, t, n) { + return t = Bt(t), n === i ? (n = t, t = 0) : n = Bt(n), e = it(e), cd(e, t, n); + } + function sv(e, t, n) { + if (n && typeof n != "boolean" && De(e, t, n) && (t = n = i), n === i && (typeof t == "boolean" ? (n = t, t = i) : typeof e == "boolean" && (n = e, e = i)), e === i && t === i ? (e = 0, t = 1) : (e = Bt(e), t === i ? (t = e, e = 0) : t = Bt(t)), e > t) { + var s = e; + e = t, t = s; + } + if (n || e % 1 || t % 1) { + var l = jo(); + return Me(e + l * (t - e + Pc("1e-" + ((l + "").length - 1))), t); + } + return ns(e, t); + } + var ov = Cn(function(e, t, n) { + return t = t.toLowerCase(), e + (n ? Ea(t) : t); + }); + function Ea(e) { + return Os(ue(e).toLowerCase()); + } + function Ia(e) { + return e = ue(e), e && e.replace(lc, Yc).replace(Sc, ""); + } + function lv(e, t, n) { + e = ue(e), t = qe(t); + var s = e.length; + n = n === i ? s : on(X(n), 0, s); + var l = n; + return n -= t.length, n >= 0 && e.slice(n, l) == t; + } + function av(e) { + return e = ue(e), e && Wu.test(e) ? e.replace(lo, Xc) : e; + } + function uv(e) { + return e = ue(e), e && qu.test(e) ? e.replace($i, "\\$&") : e; + } + var cv = Cn(function(e, t, n) { + return e + (n ? "-" : "") + t.toLowerCase(); + }), fv = Cn(function(e, t, n) { + return e + (n ? " " : "") + t.toLowerCase(); + }), dv = Ml("toLowerCase"); + function pv(e, t, n) { + e = ue(e), t = X(t); + var s = t ? wn(e) : 0; + if (!t || s >= t) + return e; + var l = (t - s) / 2; + return qr(Mr(l), n) + e + qr(Lr(l), n); + } + function hv(e, t, n) { + e = ue(e), t = X(t); + var s = t ? wn(e) : 0; + return t && s < t ? e + qr(t - s, n) : e; + } + function _v(e, t, n) { + e = ue(e), t = X(t); + var s = t ? wn(e) : 0; + return t && s < t ? qr(t - s, n) + e : e; + } + function vv(e, t, n) { + return n || t == null ? t = 0 : t && (t = +t), xf(ue(e).replace(Ai, ""), t || 0); + } + function gv(e, t, n) { + return (n ? De(e, t, n) : t === i) ? t = 1 : t = X(t), rs(ue(e), t); + } + function mv() { + var e = arguments, t = ue(e[0]); + return e.length < 3 ? t : t.replace(e[1], e[2]); + } + var yv = Cn(function(e, t, n) { + return e + (n ? "_" : "") + t.toLowerCase(); + }); + function bv(e, t, n) { + return n && typeof n != "number" && De(e, t, n) && (t = n = i), n = n === i ? gt : n >>> 0, n ? (e = ue(e), e && (typeof t == "string" || t != null && !Ss(t)) && (t = qe(t), !t && bn(e)) ? zt(ct(e), 0, n) : e.split(t, n)) : []; + } + var wv = Cn(function(e, t, n) { + return e + (n ? " " : "") + Os(t); + }); + function kv(e, t, n) { + return e = ue(e), n = n == null ? 0 : on(X(n), 0, e.length), t = qe(t), e.slice(n, n + t.length) == t; + } + function xv(e, t, n) { + var s = u.templateSettings; + n && De(e, t, n) && (t = i), e = ue(e), t = si({}, t, s, Wl); + var l = si({}, t.imports, s.imports, Wl), f = Ie(l), d = Ui(l, f), h, m, x = 0, $ = t.interpolate || mr, A = "__p += '", I = Vi( + (t.escape || mr).source + "|" + $.source + "|" + ($ === ao ? tc : mr).source + "|" + (t.evaluate || mr).source + "|$", + "g" + ), P = "//# sourceURL=" + (ce.call(t, "sourceURL") ? (t.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++Ic + "]") + ` +`; + e.replace(I, function(G, te, re, Ye, Fe, Xe) { + return re || (re = Ye), A += e.slice(x, Xe).replace(ac, Jc), te && (h = !0, A += `' + +__e(` + te + `) + +'`), Fe && (m = !0, A += `'; +` + Fe + `; +__p += '`), re && (A += `' + +((__t = (` + re + `)) == null ? '' : __t) + +'`), x = Xe + G.length, G; + }), A += `'; +`; + var H = ce.call(t, "variable") && t.variable; + if (!H) + A = `with (obj) { +` + A + ` +} +`; + else if (ju.test(H)) + throw new K(b); + A = (m ? A.replace(Du, "") : A).replace(Fu, "$1").replace(Nu, "$1;"), A = "function(" + (H || "obj") + `) { +` + (H ? "" : `obj || (obj = {}); +`) + "var __t, __p = ''" + (h ? ", __e = _.escape" : "") + (m ? `, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +` : `; +`) + A + `return __p +}`; + var J = La(function() { + return le(f, P + "return " + A).apply(i, d); + }); + if (J.source = A, As(J)) + throw J; + return J; + } + function $v(e) { + return ue(e).toLowerCase(); + } + function Av(e) { + return ue(e).toUpperCase(); + } + function Sv(e, t, n) { + if (e = ue(e), e && (n || t === i)) + return Vo(e); + if (!e || !(t = qe(t))) + return e; + var s = ct(e), l = ct(t), f = Ho(s, l), d = Go(s, l) + 1; + return zt(s, f, d).join(""); + } + function Tv(e, t, n) { + if (e = ue(e), e && (n || t === i)) + return e.slice(0, zo(e) + 1); + if (!e || !(t = qe(t))) + return e; + var s = ct(e), l = Go(s, ct(t)) + 1; + return zt(s, 0, l).join(""); + } + function Cv(e, t, n) { + if (e = ue(e), e && (n || t === i)) + return e.replace(Ai, ""); + if (!e || !(t = qe(t))) + return e; + var s = ct(e), l = Ho(s, ct(t)); + return zt(s, l).join(""); + } + function Ov(e, t) { + var n = N, s = Te; + if (me(t)) { + var l = "separator" in t ? t.separator : l; + n = "length" in t ? X(t.length) : n, s = "omission" in t ? qe(t.omission) : s; + } + e = ue(e); + var f = e.length; + if (bn(e)) { + var d = ct(e); + f = d.length; + } + if (n >= f) + return e; + var h = n - wn(s); + if (h < 1) + return s; + var m = d ? zt(d, 0, h).join("") : e.slice(0, h); + if (l === i) + return m + s; + if (d && (h += m.length - h), Ss(l)) { + if (e.slice(h).search(l)) { + var x, $ = m; + for (l.global || (l = Vi(l.source, ue(uo.exec(l)) + "g")), l.lastIndex = 0; x = l.exec($); ) + var A = x.index; + m = m.slice(0, A === i ? h : A); + } + } else if (e.indexOf(qe(l), h) != h) { + var I = m.lastIndexOf(l); + I > -1 && (m = m.slice(0, I)); + } + return m + s; + } + function Ev(e) { + return e = ue(e), e && Uu.test(e) ? e.replace(oo, sf) : e; + } + var Iv = Cn(function(e, t, n) { + return e + (n ? " " : "") + t.toUpperCase(); + }), Os = Ml("toUpperCase"); + function Ra(e, t, n) { + return e = ue(e), t = n ? i : t, t === i ? jc(e) ? af(e) : Gc(e) : e.match(t) || []; + } + var La = j(function(e, t) { + try { + return Ze(e, i, t); + } catch (n) { + return As(n) ? n : new K(n); + } + }), Rv = Rt(function(e, t) { + return Qe(t, function(n) { + n = bt(n), Et(e, n, xs(e[n], e)); + }), e; + }); + function Lv(e) { + var t = e == null ? 0 : e.length, n = U(); + return e = t ? ve(e, function(s) { + if (typeof s[1] != "function") + throw new je(y); + return [n(s[0]), s[1]]; + }) : [], j(function(s) { + for (var l = -1; ++l < t; ) { + var f = e[l]; + if (Ze(f[0], this, s)) + return Ze(f[1], this, s); + } + }); + } + function Mv(e) { + return sd(tt(e, C)); + } + function Es(e) { + return function() { + return e; + }; + } + function Bv(e, t) { + return e == null || e !== e ? t : e; + } + var Pv = Pl(), Dv = Pl(!0); + function He(e) { + return e; + } + function Is(e) { + return dl(typeof e == "function" ? e : tt(e, C)); + } + function Fv(e) { + return hl(tt(e, C)); + } + function Nv(e, t) { + return _l(e, tt(t, C)); + } + var Uv = j(function(e, t) { + return function(n) { + return Jn(n, e, t); + }; + }), Wv = j(function(e, t) { + return function(n) { + return Jn(e, n, t); + }; + }); + function Rs(e, t, n) { + var s = Ie(t), l = Ur(t, s); + n == null && !(me(t) && (l.length || !s.length)) && (n = t, t = e, e = this, l = Ur(t, Ie(t))); + var f = !(me(n) && "chain" in n) || !!n.chain, d = Mt(e); + return Qe(l, function(h) { + var m = t[h]; + e[h] = m, d && (e.prototype[h] = function() { + var x = this.__chain__; + if (f || x) { + var $ = e(this.__wrapped__), A = $.__actions__ = Ue(this.__actions__); + return A.push({ func: m, args: arguments, thisArg: e }), $.__chain__ = x, $; + } + return m.apply(e, Ut([this.value()], arguments)); + }); + }), e; + } + function Vv() { + return Re._ === this && (Re._ = hf), this; + } + function Ls() { + } + function Hv(e) { + return e = X(e), j(function(t) { + return vl(t, e); + }); + } + var Gv = cs(ve), Zv = cs(Do), zv = cs(Bi); + function Ma(e) { + return gs(e) ? Pi(bt(e)) : kd(e); + } + function qv(e) { + return function(t) { + return e == null ? i : ln(e, t); + }; + } + var Kv = Fl(), Yv = Fl(!0); + function Ms() { + return []; + } + function Bs() { + return !1; + } + function Xv() { + return {}; + } + function Jv() { + return ""; + } + function Qv() { + return !0; + } + function jv(e, t) { + if (e = X(e), e < 1 || e > Ft) + return []; + var n = gt, s = Me(e, gt); + t = U(t), e -= gt; + for (var l = Ni(s, t); ++n < e; ) + t(n); + return l; + } + function eg(e) { + return Y(e) ? ve(e, bt) : Ke(e) ? [e] : Ue(ea(ue(e))); + } + function tg(e) { + var t = ++df; + return ue(e) + t; + } + var ng = zr(function(e, t) { + return e + t; + }, 0), rg = fs("ceil"), ig = zr(function(e, t) { + return e / t; + }, 1), sg = fs("floor"); + function og(e) { + return e && e.length ? Nr(e, He, Xi) : i; + } + function lg(e, t) { + return e && e.length ? Nr(e, U(t, 2), Xi) : i; + } + function ag(e) { + return Uo(e, He); + } + function ug(e, t) { + return Uo(e, U(t, 2)); + } + function cg(e) { + return e && e.length ? Nr(e, He, es) : i; + } + function fg(e, t) { + return e && e.length ? Nr(e, U(t, 2), es) : i; + } + var dg = zr(function(e, t) { + return e * t; + }, 1), pg = fs("round"), hg = zr(function(e, t) { + return e - t; + }, 0); + function _g(e) { + return e && e.length ? Fi(e, He) : 0; + } + function vg(e, t) { + return e && e.length ? Fi(e, U(t, 2)) : 0; + } + return u.after = Fh, u.ary = fa, u.assign = A_, u.assignIn = Aa, u.assignInWith = si, u.assignWith = S_, u.at = T_, u.before = da, u.bind = xs, u.bindAll = Rv, u.bindKey = pa, u.castArray = Xh, u.chain = aa, u.chunk = sp, u.compact = op, u.concat = lp, u.cond = Lv, u.conforms = Mv, u.constant = Es, u.countBy = _h, u.create = C_, u.curry = ha, u.curryRight = _a, u.debounce = va, u.defaults = O_, u.defaultsDeep = E_, u.defer = Nh, u.delay = Uh, u.difference = ap, u.differenceBy = up, u.differenceWith = cp, u.drop = fp, u.dropRight = dp, u.dropRightWhile = pp, u.dropWhile = hp, u.fill = _p, u.filter = gh, u.flatMap = bh, u.flatMapDeep = wh, u.flatMapDepth = kh, u.flatten = ia, u.flattenDeep = vp, u.flattenDepth = gp, u.flip = Wh, u.flow = Pv, u.flowRight = Dv, u.fromPairs = mp, u.functions = D_, u.functionsIn = F_, u.groupBy = xh, u.initial = bp, u.intersection = wp, u.intersectionBy = kp, u.intersectionWith = xp, u.invert = U_, u.invertBy = W_, u.invokeMap = Ah, u.iteratee = Is, u.keyBy = Sh, u.keys = Ie, u.keysIn = Ve, u.map = jr, u.mapKeys = H_, u.mapValues = G_, u.matches = Fv, u.matchesProperty = Nv, u.memoize = ti, u.merge = Z_, u.mergeWith = Sa, u.method = Uv, u.methodOf = Wv, u.mixin = Rs, u.negate = ni, u.nthArg = Hv, u.omit = z_, u.omitBy = q_, u.once = Vh, u.orderBy = Th, u.over = Gv, u.overArgs = Hh, u.overEvery = Zv, u.overSome = zv, u.partial = $s, u.partialRight = ga, u.partition = Ch, u.pick = K_, u.pickBy = Ta, u.property = Ma, u.propertyOf = qv, u.pull = Tp, u.pullAll = oa, u.pullAllBy = Cp, u.pullAllWith = Op, u.pullAt = Ep, u.range = Kv, u.rangeRight = Yv, u.rearg = Gh, u.reject = Ih, u.remove = Ip, u.rest = Zh, u.reverse = ws, u.sampleSize = Lh, u.set = X_, u.setWith = J_, u.shuffle = Mh, u.slice = Rp, u.sortBy = Dh, u.sortedUniq = Np, u.sortedUniqBy = Up, u.split = bv, u.spread = zh, u.tail = Wp, u.take = Vp, u.takeRight = Hp, u.takeRightWhile = Gp, u.takeWhile = Zp, u.tap = oh, u.throttle = qh, u.thru = Qr, u.toArray = ka, u.toPairs = Ca, u.toPairsIn = Oa, u.toPath = eg, u.toPlainObject = $a, u.transform = Q_, u.unary = Kh, u.union = zp, u.unionBy = qp, u.unionWith = Kp, u.uniq = Yp, u.uniqBy = Xp, u.uniqWith = Jp, u.unset = j_, u.unzip = ks, u.unzipWith = la, u.update = ev, u.updateWith = tv, u.values = In, u.valuesIn = nv, u.without = Qp, u.words = Ra, u.wrap = Yh, u.xor = jp, u.xorBy = eh, u.xorWith = th, u.zip = nh, u.zipObject = rh, u.zipObjectDeep = ih, u.zipWith = sh, u.entries = Ca, u.entriesIn = Oa, u.extend = Aa, u.extendWith = si, Rs(u, u), u.add = ng, u.attempt = La, u.camelCase = ov, u.capitalize = Ea, u.ceil = rg, u.clamp = rv, u.clone = Jh, u.cloneDeep = jh, u.cloneDeepWith = e_, u.cloneWith = Qh, u.conformsTo = t_, u.deburr = Ia, u.defaultTo = Bv, u.divide = ig, u.endsWith = lv, u.eq = dt, u.escape = av, u.escapeRegExp = uv, u.every = vh, u.find = mh, u.findIndex = na, u.findKey = I_, u.findLast = yh, u.findLastIndex = ra, u.findLastKey = R_, u.floor = sg, u.forEach = ua, u.forEachRight = ca, u.forIn = L_, u.forInRight = M_, u.forOwn = B_, u.forOwnRight = P_, u.get = Ts, u.gt = n_, u.gte = r_, u.has = N_, u.hasIn = Cs, u.head = sa, u.identity = He, u.includes = $h, u.indexOf = yp, u.inRange = iv, u.invoke = V_, u.isArguments = cn, u.isArray = Y, u.isArrayBuffer = i_, u.isArrayLike = We, u.isArrayLikeObject = xe, u.isBoolean = s_, u.isBuffer = qt, u.isDate = o_, u.isElement = l_, u.isEmpty = a_, u.isEqual = u_, u.isEqualWith = c_, u.isError = As, u.isFinite = f_, u.isFunction = Mt, u.isInteger = ma, u.isLength = ri, u.isMap = ya, u.isMatch = d_, u.isMatchWith = p_, u.isNaN = h_, u.isNative = __, u.isNil = g_, u.isNull = v_, u.isNumber = ba, u.isObject = me, u.isObjectLike = ke, u.isPlainObject = rr, u.isRegExp = Ss, u.isSafeInteger = m_, u.isSet = wa, u.isString = ii, u.isSymbol = Ke, u.isTypedArray = En, u.isUndefined = y_, u.isWeakMap = b_, u.isWeakSet = w_, u.join = $p, u.kebabCase = cv, u.last = rt, u.lastIndexOf = Ap, u.lowerCase = fv, u.lowerFirst = dv, u.lt = k_, u.lte = x_, u.max = og, u.maxBy = lg, u.mean = ag, u.meanBy = ug, u.min = cg, u.minBy = fg, u.stubArray = Ms, u.stubFalse = Bs, u.stubObject = Xv, u.stubString = Jv, u.stubTrue = Qv, u.multiply = dg, u.nth = Sp, u.noConflict = Vv, u.noop = Ls, u.now = ei, u.pad = pv, u.padEnd = hv, u.padStart = _v, u.parseInt = vv, u.random = sv, u.reduce = Oh, u.reduceRight = Eh, u.repeat = gv, u.replace = mv, u.result = Y_, u.round = pg, u.runInContext = v, u.sample = Rh, u.size = Bh, u.snakeCase = yv, u.some = Ph, u.sortedIndex = Lp, u.sortedIndexBy = Mp, u.sortedIndexOf = Bp, u.sortedLastIndex = Pp, u.sortedLastIndexBy = Dp, u.sortedLastIndexOf = Fp, u.startCase = wv, u.startsWith = kv, u.subtract = hg, u.sum = _g, u.sumBy = vg, u.template = xv, u.times = jv, u.toFinite = Bt, u.toInteger = X, u.toLength = xa, u.toLower = $v, u.toNumber = it, u.toSafeInteger = $_, u.toString = ue, u.toUpper = Av, u.trim = Sv, u.trimEnd = Tv, u.trimStart = Cv, u.truncate = Ov, u.unescape = Ev, u.uniqueId = tg, u.upperCase = Iv, u.upperFirst = Os, u.each = ua, u.eachRight = ca, u.first = sa, Rs(u, function() { + var e = {}; + return mt(u, function(t, n) { + ce.call(u.prototype, n) || (e[n] = t); + }), e; + }(), { chain: !1 }), u.VERSION = c, Qe(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(e) { + u[e].placeholder = u; + }), Qe(["drop", "take"], function(e, t) { + ne.prototype[e] = function(n) { + n = n === i ? 1 : Oe(X(n), 0); + var s = this.__filtered__ && !t ? new ne(this) : this.clone(); + return s.__filtered__ ? s.__takeCount__ = Me(n, s.__takeCount__) : s.__views__.push({ + size: Me(n, gt), + type: e + (s.__dir__ < 0 ? "Right" : "") + }), s; + }, ne.prototype[e + "Right"] = function(n) { + return this.reverse()[e](n).reverse(); + }; + }), Qe(["filter", "map", "takeWhile"], function(e, t) { + var n = t + 1, s = n == jt || n == Su; + ne.prototype[e] = function(l) { + var f = this.clone(); + return f.__iteratees__.push({ + iteratee: U(l, 3), + type: n + }), f.__filtered__ = f.__filtered__ || s, f; + }; + }), Qe(["head", "last"], function(e, t) { + var n = "take" + (t ? "Right" : ""); + ne.prototype[e] = function() { + return this[n](1).value()[0]; + }; + }), Qe(["initial", "tail"], function(e, t) { + var n = "drop" + (t ? "" : "Right"); + ne.prototype[e] = function() { + return this.__filtered__ ? new ne(this) : this[n](1); + }; + }), ne.prototype.compact = function() { + return this.filter(He); + }, ne.prototype.find = function(e) { + return this.filter(e).head(); + }, ne.prototype.findLast = function(e) { + return this.reverse().find(e); + }, ne.prototype.invokeMap = j(function(e, t) { + return typeof e == "function" ? new ne(this) : this.map(function(n) { + return Jn(n, e, t); + }); + }), ne.prototype.reject = function(e) { + return this.filter(ni(U(e))); + }, ne.prototype.slice = function(e, t) { + e = X(e); + var n = this; + return n.__filtered__ && (e > 0 || t < 0) ? new ne(n) : (e < 0 ? n = n.takeRight(-e) : e && (n = n.drop(e)), t !== i && (t = X(t), n = t < 0 ? n.dropRight(-t) : n.take(t - e)), n); + }, ne.prototype.takeRightWhile = function(e) { + return this.reverse().takeWhile(e).reverse(); + }, ne.prototype.toArray = function() { + return this.take(gt); + }, mt(ne.prototype, function(e, t) { + var n = /^(?:filter|find|map|reject)|While$/.test(t), s = /^(?:head|last)$/.test(t), l = u[s ? "take" + (t == "last" ? "Right" : "") : t], f = s || /^find/.test(t); + l && (u.prototype[t] = function() { + var d = this.__wrapped__, h = s ? [1] : arguments, m = d instanceof ne, x = h[0], $ = m || Y(d), A = function(te) { + var re = l.apply(u, Ut([te], h)); + return s && I ? re[0] : re; + }; + $ && n && typeof x == "function" && x.length != 1 && (m = $ = !1); + var I = this.__chain__, P = !!this.__actions__.length, H = f && !I, J = m && !P; + if (!f && $) { + d = J ? d : new ne(this); + var G = e.apply(d, h); + return G.__actions__.push({ func: Qr, args: [A], thisArg: i }), new et(G, I); + } + return H && J ? e.apply(this, h) : (G = this.thru(A), H ? s ? G.value()[0] : G.value() : G); + }); + }), Qe(["pop", "push", "shift", "sort", "splice", "unshift"], function(e) { + var t = $r[e], n = /^(?:push|sort|unshift)$/.test(e) ? "tap" : "thru", s = /^(?:pop|shift)$/.test(e); + u.prototype[e] = function() { + var l = arguments; + if (s && !this.__chain__) { + var f = this.value(); + return t.apply(Y(f) ? f : [], l); + } + return this[n](function(d) { + return t.apply(Y(d) ? d : [], l); + }); + }; + }), mt(ne.prototype, function(e, t) { + var n = u[t]; + if (n) { + var s = n.name + ""; + ce.call(An, s) || (An[s] = []), An[s].push({ name: t, func: n }); + } + }), An[Zr(i, W).name] = [{ + name: "wrapper", + func: i + }], ne.prototype.clone = Ef, ne.prototype.reverse = If, ne.prototype.value = Rf, u.prototype.at = lh, u.prototype.chain = ah, u.prototype.commit = uh, u.prototype.next = ch, u.prototype.plant = dh, u.prototype.reverse = ph, u.prototype.toJSON = u.prototype.valueOf = u.prototype.value = hh, u.prototype.first = u.prototype.head, Gn && (u.prototype[Gn] = fh), u; + }, kn = uf(); + tn ? ((tn.exports = kn)._ = kn, Ii._ = kn) : Re._ = kn; + }).call(ir); +})(li, li.exports); +var Jg = li.exports; +const Qg = { + xmlns: "http://www.w3.org/2000/svg", + width: "24", + height: "24", + fill: "none" +}, jg = /* @__PURE__ */ z("path", { + stroke: "#1AB248", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "2", + d: "m5 12 5 5L20 7" +}, null, -1), e0 = [ + jg +]; +function t0(r, o) { + return S(), R("svg", Qg, e0); +} +const n0 = { render: t0 }, r0 = /* @__PURE__ */ se({ + __name: "BaseDropdownItem", + props: { + value: {}, + selected: { type: Boolean, default: !1 }, + active: { type: Boolean, default: !1 } + }, + emits: ["select"], + setup(r, { emit: o }) { + const i = r, c = B(() => ({ "--list-item-color": i.value.color })), a = () => { + i.value.disabled || o("select", i.value); + }; + return (p, y) => (S(), R("div", { + class: M([ + p.$style["prefix-dropdown-item"], + { + [p.$style["prefix-dropdown-item_active"]]: p.active, + [p.$style["prefix-dropdown-item_selected"]]: p.selected, + [p.$style["prefix-dropdown-item_disabled"]]: p.value.disabled, + [p.$style["prefix-dropdown-item_colored"]]: !!p.value.color + } + ]), + onClick: a, + style: Zs(c.value) + }, [ + p.value.icon ? (S(), R("div", { + key: 0, + class: M(p.$style["prefix-dropdown-item__left-icon"]) + }, [ + (S(), pe(Xt(p.value.icon))) + ], 2)) : ae("", !0), + z("div", { + class: M(p.$style["prefix-dropdown-item__content"]) + }, [ + fe(p.$slots, "default", {}, void 0, !0) + ], 2), + p.selected ? (S(), pe(ie(n0), { + key: 1, + class: M(p.$style["prefix-dropdown-item__checkmark"]) + }, null, 8, ["class"])) : ae("", !0) + ], 6)); + } +}), i0 = { + "prefix-dropdown-item": "cdek-dropdown-item", + "prefix-dropdown-item_disabled": "cdek-dropdown-item_disabled", + "prefix-dropdown-item_active": "cdek-dropdown-item_active", + "prefix-dropdown-item_selected": "cdek-dropdown-item_selected", + "prefix-dropdown-item_colored": "cdek-dropdown-item_colored", + "prefix-dropdown-item__left-icon": "cdek-dropdown-item__left-icon", + "prefix-dropdown-item__content": "cdek-dropdown-item__content", + "prefix-dropdown-item__checkmark": "cdek-dropdown-item__checkmark" +}, s0 = { + $style: i0 +}, Ya = /* @__PURE__ */ Ae(r0, [["__cssModules", s0], ["__scopeId", "data-v-c47f41d4"]]), o0 = { + "prefix-dropdown-box": "cdek-dropdown-box" +}, l0 = {}; +function a0(r, o) { + return S(), R("div", { + class: M(r.$style["prefix-dropdown-box"]) + }, [ + fe(r.$slots, "default", {}, void 0, !0) + ], 2); +} +const u0 = { + $style: o0 +}, Xa = /* @__PURE__ */ Ae(l0, [["render", a0], ["__cssModules", u0], ["__scopeId", "data-v-91fbc94e"]]), c0 = { + xmlns: "http://www.w3.org/2000/svg", + width: "16", + height: "16", + fill: "none" +}, f0 = /* @__PURE__ */ z("path", { + stroke: "#F47500", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "1.5", + d: "M8 6v1.333M8 10v.007m-4.667 2.66h9.334a1.332 1.332 0 0 0 1.226-1.833L9.16 2.667a1.333 1.333 0 0 0-2.333 0l-4.734 8.167a1.333 1.333 0 0 0 1.167 1.833" +}, null, -1), d0 = [ + f0 +]; +function p0(r, o) { + return S(), R("svg", c0, d0); +} +const h0 = { render: p0 }, _0 = { + xmlns: "http://www.w3.org/2000/svg", + width: "16", + height: "16", + fill: "none" +}, v0 = /* @__PURE__ */ z("path", { + stroke: "#E40029", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "1.5", + d: "m3.8 3.8 8.4 8.4M14 8A6 6 0 1 1 2 8a6 6 0 0 1 12 0Z" +}, null, -1), g0 = [ + v0 +]; +function m0(r, o) { + return S(), R("svg", _0, g0); +} +const y0 = { render: m0 }, b0 = { + xmlns: "http://www.w3.org/2000/svg", + width: "16", + height: "16", + fill: "none" +}, w0 = /* @__PURE__ */ z("path", { + stroke: "#17A000", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "1.5", + d: "m6 8 1.333 1.333L10 6.667M14 8A6 6 0 1 1 2 8a6 6 0 0 1 12 0Z" +}, null, -1), k0 = [ + w0 +]; +function x0(r, o) { + return S(), R("svg", b0, k0); +} +const $0 = { render: x0 }, A0 = { + xmlns: "http://www.w3.org/2000/svg", + width: "16", + height: "16", + fill: "none" +}, S0 = /* @__PURE__ */ z("path", { + stroke: "#627791", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "1.5", + d: "M8 5.333h.007M7.333 8H8v2.667h.667M14 8A6 6 0 1 1 2 8a6 6 0 0 1 12 0Z" +}, null, -1), T0 = [ + S0 +]; +function C0(r, o) { + return S(), R("svg", A0, T0); +} +const O0 = { render: C0 }, E0 = { + xmlns: "http://www.w3.org/2000/svg", + width: "24", + height: "24", + fill: "none" +}, I0 = /* @__PURE__ */ z("path", { + stroke: "#000", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-opacity": ".35", + "stroke-width": "1.75", + d: "m10 10 4 4m0-4-4 4m11-2a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" +}, null, -1), R0 = [ + I0 +]; +function L0(r, o) { + return S(), R("svg", E0, R0); +} +const M0 = { render: L0 }, B0 = ["value", "disabled"], P0 = ["innerHTML"], D0 = { + inheritAttrs: !1 +}, F0 = /* @__PURE__ */ se({ + ...D0, + __name: "BaseInput", + props: { + modelValue: {}, + label: {}, + validRes: { type: [Boolean, String] }, + hideErrorMessage: { type: Boolean }, + disabled: { type: Boolean }, + readonly: { type: Boolean }, + small: { type: Boolean }, + clearable: { type: Boolean }, + class: { default: "" } + }, + emits: ["update:modelValue"], + setup(r, { expose: o, emit: i }) { + const c = r, a = B(() => typeof c.validRes == "string"), p = B(() => !c.disabled && !c.readonly), y = B(() => c.modelValue), b = (O) => { + i("update:modelValue", O.target.value); + }, T = () => { + i("update:modelValue", ""); + }, g = cr(), _ = B(() => !!g["icons-right"]), C = B(() => !!g["icons-left"]), D = oe(), Q = B(() => c.clearable && y.value); + return o({ getControl: () => D.value }), (O, E) => (S(), R("div", { + class: M([ + O.$style["prefix-input"], + O.small && O.label ? O.$style["prefix-input_small"] : "", + c.class + ]) + }, [ + z("label", { + class: M([ + O.$style["prefix-input__control"], + a.value ? O.$style["prefix-input__control_error"] : "", + p.value ? O.$style["prefix-input__control_user-event"] : "", + O.disabled ? O.$style["prefix-input__control_disabled"] : "", + O.readonly ? O.$style["prefix-input__control_readonly"] : "", + _.value ? O.$style["prefix-input__control_right-icon"] : "", + O.small ? O.$style["prefix-input__control_small"] : "", + Q.value ? O.$style["prefix-input__control_clearable"] : "" + ]) + }, [ + O.label ? (S(), R("div", { + key: 0, + class: M([ + O.$style["prefix-input__label"], + y.value ? O.$style["prefix-input__label_filled"] : "", + a.value ? O.$style["prefix-input__label_error"] : "", + O.readonly ? O.$style["prefix-input__label_readonly"] : "", + O.small ? O.$style["prefix-input__label_small"] : "" + ]) + }, we(O.label), 3)) : ae("", !0), + C.value ? (S(), R("div", { + key: 1, + class: M(O.$style["prefix-input__left-icon"]) + }, [ + fe(O.$slots, "icons-left") + ], 2)) : ae("", !0), + z("input", Qt({ + class: [ + O.$style["prefix-input__input"], + a.value ? O.$style["prefix-input__input_error"] : "", + O.readonly ? O.$style["prefix-input__input_readonly"] : "", + O.label ? "" : O.$style["prefix-input__input_no-label"], + O.small ? O.$style["prefix-input__input_small"] : "" + ], + value: y.value, + onInput: b + }, O.$attrs, { + disabled: O.disabled || O.readonly, + ref_key: "inputRef", + ref: D + }), null, 16, B0), + Q.value ? (S(), R("button", { + key: 2, + class: M(O.$style["prefix-input__clear"]), + type: "button", + onClick: T + }, [ + ht(ie(M0)) + ], 2)) : ae("", !0), + _.value ? (S(), R("div", { + key: 3, + class: M([ + O.$style["prefix-input__right-icon"], + a.value ? O.$style["prefix-input__right-icon_red"] : "", + O.disabled || O.readonly ? O.$style["prefix-input__right-icon_grey"] : "", + Q.value ? O.$style["prefix-input__right-icon_clearable"] : "" + ]) + }, [ + fe(O.$slots, "icons-right") + ], 2)) : ae("", !0) + ], 2), + z("div", { + class: M(O.$style["prefix-input__tip"]) + }, [ + a.value ? ci((S(), R("div", { + key: 0, + class: M(O.$style.error), + innerHTML: O.validRes + }, null, 10, P0)), [ + [zs, !O.hideErrorMessage] + ]) : fe(O.$slots, "tip", { + key: 1, + alert: ie(h0), + ban: ie(y0), + circle: ie($0), + info: ie(O0) + }) + ], 2) + ], 2)); + } +}), N0 = "tertiary", U0 = "attention", W0 = "error", V0 = "success", H0 = { + "prefix-input": "cdek-input", + "prefix-input_small": "cdek-input_small", + "prefix-input__control": "cdek-input__control", + "prefix-input__control_user-event": "cdek-input__control_user-event", + "prefix-input__control_error": "cdek-input__control_error", + "prefix-input__control_disabled": "cdek-input__control_disabled", + "prefix-input__control_readonly": "cdek-input__control_readonly", + "prefix-input__control_right-icon": "cdek-input__control_right-icon", + "prefix-input__control_small": "cdek-input__control_small", + "prefix-input__control_clearable": "cdek-input__control_clearable", + "prefix-input__input": "cdek-input__input", + "prefix-input__input_error": "cdek-input__input_error", + "prefix-input__input_readonly": "cdek-input__input_readonly", + "prefix-input__input_no-label": "cdek-input__input_no-label", + "prefix-input__input_small": "cdek-input__input_small", + "prefix-input__label": "cdek-input__label", + "prefix-input__label_filled": "cdek-input__label_filled", + "prefix-input__label_error": "cdek-input__label_error", + "prefix-input__label_small": "cdek-input__label_small", + "prefix-input__label_readonly": "cdek-input__label_readonly", + "prefix-input__tip": "cdek-input__tip", + tertiary: N0, + attention: U0, + error: W0, + success: V0, + "prefix-input__clear": "cdek-input__clear", + "prefix-input__right-icon": "cdek-input__right-icon", + "prefix-input__right-icon_red": "cdek-input__right-icon_red", + "prefix-input__right-icon_grey": "cdek-input__right-icon_grey", + "prefix-input__right-icon_clearable": "cdek-input__right-icon_clearable", + "prefix-input__left-icon": "cdek-input__left-icon" +}, G0 = { + $style: H0 +}, Xs = /* @__PURE__ */ Ae(F0, [["__cssModules", G0], ["__scopeId", "data-v-a648ef84"]]); +var sr = /* @__PURE__ */ ((r) => (r.ArrowDown = "ArrowDown", r.ArrowUp = "ArrowUp", r.Enter = "Enter", r.Escape = "Escape", r))(sr || {}); +const Ja = (r, o, i) => r ? o && i ? r.map((c) => ({ + value: o(c), + title: i(c) +})) : typeof r[0] == "object" ? r : r.map((c) => ({ value: c, title: c })) : [], Z0 = (r, o, i, c) => !r || !o ? null : Ja(r, i, c).find((y) => y.value === o) || null, Da = (r, o, i, c) => { + const a = Z0(r, o, i, c); + return a ? a.title : ""; +}, z0 = (r, o, i) => r ? 0 : o ? i ? 2 : typeof o[0] == "string" ? 1 : typeof o[0] == "object" && "title" in o[0] ? 3 : 4 : 4, q0 = (r, o) => Promise.resolve( + o.filter((i) => i.toLowerCase().includes(r.toLowerCase())) +), K0 = (r, o) => Promise.resolve( + o.filter( + (i) => i.title.toLowerCase().includes(r.toLowerCase()) + ) +), Y0 = (r, o, i) => Promise.resolve( + i.filter( + (c) => r(c).toLowerCase().includes(o.toLowerCase()) + ) +), X0 = (r, o, i) => r === 0 && o ? o : r === 1 ? q0 : r === 2 && i ? Y0.bind(null, i) : r === 3 ? K0 : () => Promise.resolve([]), J0 = ["innerHTML"], Q0 = /* @__PURE__ */ se({ + inheritAttrs: !1, + __name: "BaseAutocomplete", + props: { + modelValue: {}, + items: {}, + fetchItems: {}, + getValue: {}, + getTitle: {}, + minLength: { default: 3 }, + class: {}, + enabledAccentQuery: { type: Boolean } + }, + emits: ["update:modelValue", "select"], + setup(r, { emit: o }) { + const i = r, c = B( + () => z0(i.fetchItems, i.items, i.getTitle) + ), a = oe(null), p = B( + () => Ja(a.value, i.getValue, i.getTitle) + ), y = oe( + Da(i.items, i.modelValue, i.getValue, i.getTitle) + ), b = oe(y.value || ""); + Jt( + () => i.modelValue, + (N) => { + if (!N) { + (y.value || b.value) && (y.value = "", b.value = ""); + return; + } + const Te = Da( + i.items, + N, + i.getValue, + i.getTitle + ); + Te && (y.value = Te, b.value = Te); + } + ); + const T = B(() => a.value ? Bn.value && !a.value.length ? !0 : a.value.length > 0 : !1), g = oe(-1), _ = oe(), C = oe(), D = oe(!1), Q = Jg.debounce(async (N) => { + g.value = -1; + const Te = X0( + c.value, + i.fetchItems, + i.getTitle + ); + try { + const vt = await Te(N, i.items); + if (D.value) { + a.value = vt; + return; + } + a.value = null; + } catch { + a.value = null; + } + }, 300), ee = (N) => { + if (b.value = N, N.length >= i.minLength) + return void Q(N); + N.length === 0 && (y.value = "", o("update:modelValue", "")), a.value = null; + }, O = () => { + if (a.value = null, !y.value) { + b.value = ""; + return; + } + b.value = y.value; + }, E = (N, Te) => { + var vt; + !N || N.disabled || (o("select", (vt = a.value) == null ? void 0 : vt[Te]), O(), y.value = String(N.title), b.value = String(N.title), o("update:modelValue", N.value)); + }, W = (N) => { + var Te; + (Te = C.value) != null && Te.contains(N.target) || O(); + }, V = (N) => { + N < 0 && (N = p.value.length - 1), N > p.value.length - 1 && (N = 0), g.value = N; + }, F = B( + () => new RegExp(`(${b.value})`, "iug") + ), Z = (N) => N.replace( + F.value, + '$1' + ), q = (N) => { + if (T.value) { + if (N.key === sr.ArrowDown) + return N.preventDefault(), void V(g.value + 1); + if (N.key === sr.ArrowUp) + return N.preventDefault(), void V(g.value - 1); + if (N.key === sr.Enter) + return N.stopImmediatePropagation(), g.value === -1 && p.value.length > 0 && V(0), void E( + p.value[g.value], + g.value + ); + if (N.key === sr.Escape) + return N.stopImmediatePropagation(), void O(); + } + }, ge = () => { + D.value = !0; + }, Ee = () => { + D.value = !1; + }; + Dt(() => { + var Te; + const N = (Te = _.value) == null ? void 0 : Te.getControl(); + N == null || N.addEventListener("keydown", q), document.addEventListener("click", W); + }), yg(() => { + var Te; + const N = (Te = _.value) == null ? void 0 : Te.getControl(); + N == null || N.removeEventListener("keydown", q), document.removeEventListener("click", W); + }); + const At = cr(), Bn = B(() => !!At["not-found"]); + return (N, Te) => (S(), R("div", { + class: M([N.$style["prefix-autocomplete"], i.class]), + ref_key: "autocompleteRef", + ref: C + }, [ + ht(Xs, Qt(N.$attrs, { + "model-value": b.value, + "onUpdate:modelValue": ee, + ref_key: "baseInputRef", + ref: _, + onFocus: ge, + onBlur: Ee + }), qs({ _: 2 }, [ + pn(N.$slots, (vt, St) => ({ + name: St, + fn: ye((jt) => [ + fe(N.$slots, St, fr(fi(jt))) + ]) + })) + ]), 1040, ["model-value"]), + ht(qa, null, { + default: ye(() => [ + T.value ? (S(), pe(Xa, { key: 0 }, { + default: ye(() => { + var vt; + return [ + p.value.length === 0 && ((vt = b.value) == null ? void 0 : vt.length) >= N.minLength ? (S(), R("div", { + key: 0, + class: M(N.$style["prefix-autocomplete__not-found"]) + }, [ + fe(N.$slots, "not-found") + ], 2)) : ae("", !0), + (S(!0), R(xt, null, pn(p.value, (St, jt) => (S(), pe(Ya, { + value: St, + active: jt === g.value, + key: St.value, + onSelect: (hi) => E(hi, jt) + }, { + default: ye(() => [ + N.enabledAccentQuery ? (S(), R("span", { + key: 0, + innerHTML: Z(St.title) + }, null, 8, J0)) : (S(), R(xt, { key: 1 }, [ + lt(we(St.title), 1) + ], 64)) + ]), + _: 2 + }, 1032, ["value", "active", "onSelect"]))), 128)) + ]; + }), + _: 3 + })) : ae("", !0) + ]), + _: 3 + }) + ], 2)); + } +}), j0 = { + "prefix-autocomplete": "cdek-autocomplete", + "prefix-autocomplete__not-found": "cdek-autocomplete__not-found", + "prefix-dropdown-box": "cdek-dropdown-box", + "v-enter-active": "v-enter-active", + "v-leave-active": "v-leave-active", + "v-enter-from": "v-enter-from", + "v-leave-to": "v-leave-to", + "accent-query": "accent-query" +}, e1 = { + $style: j0 +}, t1 = /* @__PURE__ */ Ae(Q0, [["__cssModules", e1], ["__scopeId", "data-v-4f422c0f"]]), n1 = /* @__PURE__ */ se({ + __name: "BaseBadge", + props: { + type: { default: "info" }, + variant: { default: "light" }, + text: { default: "" } + }, + setup(r) { + return (o, i) => (S(), R("div", { + class: M([o.$style["prefix-badge"], o.$style[o.type], o.$style[o.variant]]) + }, [ + fe(o.$slots, "default", {}, () => [ + lt(we(o.text), 1) + ], !0) + ], 2)); + } +}), r1 = "dark", i1 = "positive", s1 = "process", o1 = "negative", l1 = "info", a1 = "deactive", u1 = "neutral", c1 = "light", f1 = { + "prefix-badge": "cdek-badge", + dark: r1, + positive: i1, + process: s1, + negative: o1, + info: l1, + deactive: a1, + neutral: u1, + light: c1 +}, d1 = { + $style: f1 +}, p1 = /* @__PURE__ */ Ae(n1, [["__cssModules", d1], ["__scopeId", "data-v-fba7850b"]]), h1 = ["width", "height"], _1 = /* @__PURE__ */ bg('', 5), v1 = [ + _1 +], g1 = /* @__PURE__ */ se({ + __name: "BaseSpinner", + props: { + color: { default: "green" }, + size: { default: "small" } + }, + setup(r) { + const o = r, i = { + small: 24, + medium: 32, + big: 48 + }, c = B(() => i[o.size] || o.size), a = B(() => ["green", "white"].includes(o.color) ? {} : { + "--spinner-color": o.color + }); + return (p, y) => (S(), R("svg", { + class: M(["spinner", { white: p.color === "white" }]), + style: Zs(a.value), + width: c.value, + height: c.value, + viewBox: "0 0 48 48", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, v1, 14, h1)); + } +}); +const Qa = /* @__PURE__ */ Ae(g1, [["__scopeId", "data-v-762fb7d3"]]), m1 = /* @__PURE__ */ se({ + __name: "BaseButton", + props: { + theme: { default: "primary" }, + width: { default: "auto" }, + small: { type: Boolean }, + disabled: { type: Boolean }, + loading: { type: Boolean }, + spinnerBefore: { type: Boolean }, + icon: { type: Boolean }, + as: {} + }, + setup(r) { + const o = r, i = B(() => o.theme === "primary" || o.theme === "toaster" || o.disabled ? "white" : "green"); + return (c, a) => (S(), pe(Xt(c.as || "button"), { + class: M([ + c.$style["prefix-button"], + { + [c.$style[c.theme]]: !0, + [c.$style.small]: c.small, + [c.$style.inline]: c.width === "content", + [c.$style.icon]: c.icon, + [c.$style.disabled]: c.disabled + } + ]), + type: "button" + }, { + default: ye(() => [ + c.loading ? (S(), pe(Qa, { + key: 0, + color: i.value + }, null, 8, ["color"])) : ae("", !0), + !c.loading || c.spinnerBefore ? fe(c.$slots, "default", { key: 1 }, void 0, !0) : ae("", !0) + ]), + _: 3 + }, 8, ["class"])); + } +}), y1 = "disabled", b1 = "spinner", w1 = "inline", k1 = "small", x1 = "primary", $1 = "secondary", A1 = "outline", S1 = "ghost", T1 = "toaster", C1 = "icon", O1 = { + "prefix-button": "cdek-button", + disabled: y1, + spinner: b1, + inline: w1, + small: k1, + primary: x1, + secondary: $1, + outline: A1, + ghost: S1, + toaster: T1, + icon: C1 +}, E1 = { + $style: O1 +}, Ns = /* @__PURE__ */ Ae(m1, [["__cssModules", E1], ["__scopeId", "data-v-12337b30"]]), I1 = ["disabled"], R1 = /* @__PURE__ */ se({ + __name: "BaseChip", + props: { + label: {}, + modelValue: { type: Boolean, default: !1 }, + amount: {}, + disabled: { type: Boolean, default: !1 }, + small: { type: Boolean, default: !1 } + }, + emits: ["update:modelValue"], + setup(r, { emit: o }) { + const i = r, c = cr(), a = oe(i.disabled ? !1 : i.modelValue), p = (g) => { + o("update:modelValue", g), a.value = g; + }; + Jt( + () => i.modelValue, + (g) => { + if (i.disabled) { + p(!1); + return; + } + a.value = g; + } + ); + const y = () => { + i.disabled || p(!a.value); + }; + Jt( + () => i.disabled, + () => { + i.disabled && p(!1); + } + ); + const b = B( + () => typeof i.amount == "number" && !Number.isNaN(i.amount) + ), T = B(() => !!c.icon); + return (g, _) => (S(), R("button", { + class: M([ + g.$style["prefix-chip"], + { + [g.$style["prefix-chip_selected"]]: a.value, + [g.$style["prefix-chip_disabled"]]: g.disabled, + [g.$style["prefix-chip_small"]]: g.small + } + ]), + disabled: g.disabled, + type: "button", + onClick: y + }, [ + T.value ? (S(), R("span", { + key: 0, + class: M(g.$style["prefix-chip__icon__wrapper"]) + }, [ + fe(g.$slots, "icon", {}, void 0, !0) + ], 2)) : ae("", !0), + z("span", { + class: M(g.$style["prefix-chip__text"]) + }, we(g.label), 3), + b.value ? (S(), R("span", { + key: 1, + class: M(g.$style["prefix-chip__amount"]) + }, we(g.amount), 3)) : ae("", !0) + ], 10, I1)); + } +}), L1 = { + "prefix-chip": "cdek-chip", + "prefix-chip_disabled": "cdek-chip_disabled", + "prefix-chip_selected": "cdek-chip_selected", + "prefix-chip__icon__wrapper": "cdek-chip__icon__wrapper", + "prefix-chip__text": "cdek-chip__text", + "prefix-chip__amount": "cdek-chip__amount", + "prefix-chip_small": "cdek-chip_small" +}, M1 = { + $style: L1 +}, xw = /* @__PURE__ */ Ae(R1, [["__cssModules", M1], ["__scopeId", "data-v-9e264d89"]]), B1 = { + key: 0, + class: "headline-1" +}, P1 = /* @__PURE__ */ se({ + __name: "BaseHeadline", + props: { + size: { default: "1" } + }, + setup(r) { + return (o, i) => o.size === "1" ? (S(), R("h1", B1, [ + fe(o.$slots, "default", {}, void 0, !0) + ])) : (S(), R("div", { + key: 1, + class: M(`headline-${o.size}`) + }, [ + fe(o.$slots, "default", {}, void 0, !0) + ], 2)); + } +}); +const D1 = /* @__PURE__ */ Ae(P1, [["__scopeId", "data-v-09e77485"]]), F1 = { + "prefix-link": "cdek-link" +}, N1 = {}; +function U1(r, o) { + return S(), R("span", { + class: M(r.$style["prefix-link"]) + }, [ + fe(r.$slots, "default") + ], 2); +} +const W1 = { + $style: F1 +}, $w = /* @__PURE__ */ Ae(N1, [["render", U1], ["__cssModules", W1], ["__scopeId", "data-v-0ec8ba24"]]); +/*! maska v2.1.11 | (c) Alexander Shabunevich | Released under the MIT license */ +var V1 = Object.defineProperty, H1 = (r, o, i) => o in r ? V1(r, o, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[o] = i, or = (r, o, i) => (H1(r, typeof o != "symbol" ? o + "" : o, i), i); +const Fa = { + "#": { pattern: /[0-9]/ }, + "@": { pattern: /[a-zA-Z]/ }, + "*": { pattern: /[a-zA-Z0-9]/ } +}; +class Na { + constructor(o = {}) { + or(this, "opts", {}), or(this, "memo", /* @__PURE__ */ new Map()); + const i = { ...o }; + if (i.tokens != null) { + i.tokens = i.tokensReplace ? { ...i.tokens } : { ...Fa, ...i.tokens }; + for (const c of Object.values(i.tokens)) + typeof c.pattern == "string" && (c.pattern = new RegExp(c.pattern)); + } else + i.tokens = Fa; + Array.isArray(i.mask) && (i.mask.length > 1 ? i.mask = [...i.mask].sort((c, a) => c.length - a.length) : i.mask = i.mask[0] ?? ""), i.mask === "" && (i.mask = null), this.opts = i; + } + masked(o) { + return this.process(o, this.findMask(o)); + } + unmasked(o) { + return this.process(o, this.findMask(o), !1); + } + isEager() { + return this.opts.eager === !0; + } + isReversed() { + return this.opts.reversed === !0; + } + completed(o) { + const i = this.findMask(o); + if (this.opts.mask == null || i == null) + return !1; + const c = this.process(o, i).length; + return typeof this.opts.mask == "string" ? c >= this.opts.mask.length : typeof this.opts.mask == "function" ? c >= i.length : this.opts.mask.filter((a) => c >= a.length).length === this.opts.mask.length; + } + findMask(o) { + const i = this.opts.mask; + if (i == null) + return null; + if (typeof i == "string") + return i; + if (typeof i == "function") + return i(o); + const c = this.process(o, i.slice(-1).pop() ?? "", !1); + return i.find((a) => this.process(o, a, !1).length >= c.length) ?? ""; + } + escapeMask(o) { + const i = [], c = []; + return o.split("").forEach((a, p) => { + a === "!" && o[p - 1] !== "!" ? c.push(p - c.length) : i.push(a); + }), { mask: i.join(""), escaped: c }; + } + process(o, i, c = !0) { + if (i == null) + return o; + const a = `value=${o},mask=${i},masked=${c ? 1 : 0}`; + if (this.memo.has(a)) + return this.memo.get(a); + const { mask: p, escaped: y } = this.escapeMask(i), b = [], T = this.opts.tokens != null ? this.opts.tokens : {}, g = this.isReversed() ? -1 : 1, _ = this.isReversed() ? "unshift" : "push", C = this.isReversed() ? 0 : p.length - 1, D = this.isReversed() ? () => E > -1 && W > -1 : () => E < p.length && W < o.length, Q = (F) => !this.isReversed() && F <= C || this.isReversed() && F >= C; + let ee, O = -1, E = this.isReversed() ? p.length - 1 : 0, W = this.isReversed() ? o.length - 1 : 0, V = !1; + for (; D(); ) { + const F = p.charAt(E), Z = T[F], q = (Z == null ? void 0 : Z.transform) != null ? Z.transform(o.charAt(W)) : o.charAt(W); + if (!y.includes(E) && Z != null ? (q.match(Z.pattern) != null ? (b[_](q), Z.repeated ? (O === -1 ? O = E : E === C && E !== O && (E = O - g), C === O && (E -= g)) : Z.multiple && (V = !0, E -= g), E += g) : Z.multiple ? V && (E += g, W -= g, V = !1) : q === ee ? ee = void 0 : Z.optional && (E += g, W -= g), W += g) : (c && !this.isEager() && b[_](F), q === F && !this.isEager() ? W += g : ee = F, this.isEager() || (E += g)), this.isEager()) + for (; Q(E) && (T[p.charAt(E)] == null || y.includes(E)); ) + c ? b[_](p.charAt(E)) : p.charAt(E) === o.charAt(W) && (W += g), E += g; + } + return this.memo.set(a, b.join("")), this.memo.get(a); + } +} +const ja = (r) => JSON.parse(r.replaceAll("'", '"')), Ua = (r, o = {}) => { + const i = { ...o }; + return r.dataset.maska != null && r.dataset.maska !== "" && (i.mask = G1(r.dataset.maska)), r.dataset.maskaEager != null && (i.eager = Ps(r.dataset.maskaEager)), r.dataset.maskaReversed != null && (i.reversed = Ps(r.dataset.maskaReversed)), r.dataset.maskaTokensReplace != null && (i.tokensReplace = Ps(r.dataset.maskaTokensReplace)), r.dataset.maskaTokens != null && (i.tokens = Z1(r.dataset.maskaTokens)), i; +}, Ps = (r) => r !== "" ? !!JSON.parse(r) : !0, G1 = (r) => r.startsWith("[") && r.endsWith("]") ? ja(r) : r, Z1 = (r) => { + if (r.startsWith("{") && r.endsWith("}")) + return ja(r); + const o = {}; + return r.split("|").forEach((i) => { + const c = i.split(":"); + o[c[0]] = { + pattern: new RegExp(c[1]), + optional: c[2] === "optional", + multiple: c[2] === "multiple", + repeated: c[2] === "repeated" + }; + }), o; +}; +class z1 { + constructor(o, i = {}) { + or(this, "items", /* @__PURE__ */ new Map()), or(this, "beforeinputEvent", (c) => { + const a = c.target, p = this.items.get(a); + p.isEager() && "inputType" in c && c.inputType.startsWith("delete") && p.unmasked(a.value).length <= 1 && this.setMaskedValue(a, ""); + }), or(this, "inputEvent", (c) => { + if (c instanceof CustomEvent && c.type === "input" && c.detail != null && typeof c.detail == "object" && "masked" in c.detail) + return; + const a = c.target, p = this.items.get(a), y = a.value, b = a.selectionStart, T = a.selectionEnd; + let g = y; + if (p.isEager()) { + const _ = p.masked(y), C = p.unmasked(y); + C === "" && "data" in c && c.data != null ? g = c.data : C !== p.unmasked(_) && (g = C); + } + if (this.setMaskedValue(a, g), "inputType" in c && (c.inputType.startsWith("delete") || b != null && b < y.length)) + try { + a.setSelectionRange(b, T); + } catch { + } + }), this.options = i, typeof o == "string" ? this.init( + Array.from(document.querySelectorAll(o)), + this.getMaskOpts(i) + ) : this.init( + "length" in o ? Array.from(o) : [o], + this.getMaskOpts(i) + ); + } + destroy() { + for (const o of this.items.keys()) + o.removeEventListener("input", this.inputEvent), o.removeEventListener("beforeinput", this.beforeinputEvent); + this.items.clear(); + } + needUpdateOptions(o, i) { + const c = this.items.get(o), a = new Na(Ua(o, this.getMaskOpts(i))); + return JSON.stringify(c.opts) !== JSON.stringify(a.opts); + } + needUpdateValue(o) { + const i = o.dataset.maskaValue; + return i == null && o.value !== "" || i != null && i !== o.value; + } + getMaskOpts(o) { + const { onMaska: i, preProcess: c, postProcess: a, ...p } = o; + return p; + } + init(o, i) { + for (const c of o) { + const a = new Na(Ua(c, i)); + this.items.set(c, a), c.value !== "" && this.setMaskedValue(c, c.value), c.addEventListener("input", this.inputEvent), c.addEventListener("beforeinput", this.beforeinputEvent); + } + } + setMaskedValue(o, i) { + const c = this.items.get(o); + this.options.preProcess != null && (i = this.options.preProcess(i)); + const a = c.masked(i), p = c.unmasked(c.isEager() ? a : i), y = c.completed(i), b = { masked: a, unmasked: p, completed: y }; + i = a, this.options.postProcess != null && (i = this.options.postProcess(i)), o.value = i, o.dataset.maskaValue = i, this.options.onMaska != null && (Array.isArray(this.options.onMaska) ? this.options.onMaska.forEach((T) => T(b)) : this.options.onMaska(b)), o.dispatchEvent(new CustomEvent("maska", { detail: b })), o.dispatchEvent(new CustomEvent("input", { detail: b })); + } +} +const Us = /* @__PURE__ */ new WeakMap(), q1 = (r) => { + setTimeout(() => { + var o; + ((o = Us.get(r)) == null ? void 0 : o.needUpdateValue(r)) === !0 && r.dispatchEvent(new CustomEvent("input")); + }); +}, K1 = (r, o) => { + const i = r instanceof HTMLInputElement ? r : r.querySelector("input"), c = { ...o.arg }; + if (i == null || (i == null ? void 0 : i.type) === "file") + return; + q1(i); + const a = Us.get(i); + if (a != null) { + if (!a.needUpdateOptions(i, c)) + return; + a.destroy(); + } + if (o.value != null) { + const p = o.value, y = (b) => { + p.masked = b.masked, p.unmasked = b.unmasked, p.completed = b.completed; + }; + c.onMaska = c.onMaska == null ? y : Array.isArray(c.onMaska) ? [...c.onMaska, y] : [c.onMaska, y]; + } + Us.set(i, new z1(i, c)); +}, Aw = /* @__PURE__ */ se({ + __name: "BaseMaskedInput", + props: { + modelValue: {}, + mask: { type: [String, Array, Function, null] }, + tokens: {}, + preProcess: { type: Function }, + postProcess: { type: Function }, + type: {} + }, + emits: ["update:modelValue", "update:unmasked", "update:completed", "complete"], + setup(r, { emit: o }) { + const i = r, c = B(() => { + const b = { + mask: i.mask + }; + return typeof i.tokens == "object" && (b.tokens = i.tokens), i.preProcess && (b.preProcess = i.preProcess), i.postProcess && (b.postProcess = i.postProcess), b; + }), a = oe(i.modelValue || ""); + Jt( + () => i.modelValue, + (b) => { + b !== a.value && (a.value = b || ""); + } + ); + const p = (b) => { + a.value !== b.detail.masked && (a.value = b.detail.masked, o("update:modelValue", b.detail.masked), o("update:unmasked", b.detail.unmasked), o("update:completed", b.detail.completed), b.detail.completed && o("complete")); + }, y = B(() => i.type === "number" ? { + type: "text", + inputmode: "numeric" + } : i.type ? { + type: i.type + } : {}); + return (b, T) => ci((S(), pe(Xs, Qt({ + "model-value": a.value, + "data-maska-tokens": typeof b.tokens == "string" ? b.tokens : void 0, + onMaska: p + }, y.value), qs({ _: 2 }, [ + pn(b.$slots, (g, _) => ({ + name: _, + fn: ye((C) => [ + fe(b.$slots, _, fr(fi(C))) + ]) + })) + ]), 1040, ["model-value", "data-maska-tokens"])), [ + [ie(K1), void 0, c.value] + ]); + } +}); +class ai { + init() { + } +} +/** + * экземпляр класса + */ +Ge(ai, "instance", null), /** + * объект для хранения экземпляров по ключу + */ +Ge(ai, "scopedInstances", {}); +const eu = (r) => ( + /** + * Отдает существующий или новый экземпляр класса (если существующий еще не создан) + * + * @param key - ключ для получения именнованного экземпляря, иначе отдает общий + * @returns требуемый экземпляр класса + */ + (o = "") => o ? r.scopedInstances[o] || (r.scopedInstances[o] = new r()) : r.instance || (r.instance = new r()) +), Sw = (r) => ( + /** + * Уничтожение базового экземпляра или по ключам + * + * @param keys - если не передано ничего, то уничтожаем базовый, + * если переданы строки через запятую, то уничтожаем все экземпляры + * + * @example + * destroyServiceName(); + * destroyServiceName('someKey'); + * destroyServiceName('someKey', 'someAnotherKey'); + */ + (...o) => { + if (o.length > 0) + for (const i of o) + delete r.scopedInstances[i]; + else + r.instance = null; + } +); +function Y1(r, o) { + return () => { + var c; + o.instance || (o.isReactive = !1); + let i = r(); + return o.isReactive || (i = Ks(i), o.instance = i, o.isReactive = !0, (c = i.init) == null || c.call(i)), i; + }; +} +class tu extends ai { + constructor() { + super(...arguments); + Ge(this, "isOpen", !1); + Ge(this, "modalData", {}); + } + openModal(i, c) { + this.modalData = { + component: wg(i), + props: c == null ? void 0 : c.props, + settings: c == null ? void 0 : c.settings + }, this.isOpen = !0; + } + closeModal() { + this.modalData = {}, this.isOpen = !1; + } +} +const X1 = eu(tu), J1 = Y1( + X1, + tu +), Q1 = { + xmlns: "http://www.w3.org/2000/svg", + width: "14", + height: "14", + fill: "none" +}, j1 = /* @__PURE__ */ z("path", { + stroke: "#1AB248", + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "1.75", + d: "M13 1 1 13M1 1l12 12" +}, null, -1), em = [ + j1 +]; +function tm(r, o) { + return S(), R("svg", Q1, em); +} +const nm = { render: tm }, rm = /* @__PURE__ */ se({ + __name: "BaseModal", + setup(r) { + const o = J1(), i = oe(), c = () => { + o.closeModal(); + }, a = (g) => { + var _; + (_ = i.value) != null && _.contains(g.target) || c(); + }, p = (g) => { + g.key === "Escape" && c(); + }, y = B(() => { + var g, _; + return { + "--modal-width": (_ = (g = o.modalData) == null ? void 0 : g.settings) == null ? void 0 : _.width + }; + }), b = B(() => { + var g, _; + return ((_ = (g = o.modalData) == null ? void 0 : g.settings) == null ? void 0 : _.withoutCloseButton) || !1; + }), T = B(() => { + var g, _; + return ((_ = (g = o.modalData) == null ? void 0 : g.settings) == null ? void 0 : _.wrapperWithoutPaddings) || !1; + }); + return di(() => { + var g; + document.body.style.overflow = (g = o.modalData) != null && g.component ? "hidden" : "", o.isOpen ? document.addEventListener("keyup", p) : document.removeEventListener("keyup", p); + }), (g, _) => (S(), pe(qa, null, { + default: ye(() => { + var C, D; + return [ + ie(o).isOpen ? (S(), R("div", { + key: 0, + class: M(g.$style["prefix-modal"]) + }, [ + z("div", { + class: M([ + g.$style["prefix-modal__wrapper"], + T.value ? g.$style["prefix-modal__wrapper_disable-padding"] : "" + ]), + onClick: a + }, [ + z("div", { + class: M(g.$style["prefix-modal__box"]), + ref_key: "boxElement", + ref: i, + style: Zs(y.value) + }, [ + (S(), pe(Xt((C = ie(o).modalData) == null ? void 0 : C.component), fr(fi(((D = ie(o).modalData) == null ? void 0 : D.props) || {})), null, 16)), + b.value ? ae("", !0) : (S(), pe(ie(nm), { + key: 0, + class: M(g.$style["prefix-modal__box__close-trigger"]), + onClick: c + }, null, 8, ["class"])) + ], 6) + ], 2) + ], 2)) : ae("", !0) + ]; + }), + _: 1 + })); + } +}), im = { + "prefix-modal": "cdek-modal", + "prefix-modal__wrapper": "cdek-modal__wrapper", + "prefix-modal__wrapper_disable-padding": "cdek-modal__wrapper_disable-padding", + "prefix-modal__box": "cdek-modal__box", + "prefix-modal__box__close-trigger": "cdek-modal__box__close-trigger", + "v-enter-active": "v-enter-active", + "v-leave-active": "v-leave-active", + "v-enter-from": "v-enter-from", + "v-leave-to": "v-leave-to" +}, sm = { + $style: im +}, Tw = /* @__PURE__ */ Ae(rm, [["__cssModules", sm], ["__scopeId", "data-v-6d8da2e6"]]), om = /* @__PURE__ */ se({ + __name: "BaseConfirm", + props: { + title: {}, + badge: {}, + hint: {}, + content: {}, + footer: {} + }, + setup(r) { + return (o, i) => { + var c, a, p, y, b; + return S(), R("div", { + class: M(o.$style["prefix-confirm"]) + }, [ + o.title ? (S(), R("div", { + key: 0, + class: M(o.$style["prefix-confirm__header"]) + }, [ + z("div", { + class: M(o.$style["prefix-confirm__header__title"]) + }, [ + lt(we(o.title) + " ", 1), + o.badge ? (S(), pe(p1, fr(Qt({ key: 0 }, o.badge)), null, 16)) : ae("", !0) + ], 2), + o.hint ? (S(), R("div", { + key: 0, + class: M(o.$style["prefix-confirm__header__hint"]) + }, we(o.hint), 3)) : ae("", !0) + ], 2)) : ae("", !0), + z("div", { + class: M(o.$style["prefix-confirm__content"]) + }, we(o.content), 3), + o.footer ? (S(), R("div", { + key: 1, + class: M(o.$style["prefix-confirm__footer"]) + }, [ + o.footer.accept ? (S(), pe(Ns, { + key: 0, + theme: "primary", + onClick: (a = (c = o.footer) == null ? void 0 : c.accept) == null ? void 0 : a.onClick, + width: "content" + }, { + default: ye(() => { + var T, g; + return [ + lt(we((g = (T = o.footer) == null ? void 0 : T.accept) == null ? void 0 : g.text), 1) + ]; + }), + _: 1 + }, 8, ["onClick"])) : ae("", !0), + (p = o.footer) != null && p.cancel ? (S(), pe(Ns, { + key: 1, + theme: "outline", + onClick: (b = (y = o.footer) == null ? void 0 : y.cancel) == null ? void 0 : b.onClick, + width: "content" + }, { + default: ye(() => { + var T, g; + return [ + lt(we((g = (T = o.footer) == null ? void 0 : T.cancel) == null ? void 0 : g.text), 1) + ]; + }), + _: 1 + }, 8, ["onClick"])) : ae("", !0) + ], 2)) : ae("", !0) + ], 2); + }; + } +}), lm = { + "prefix-confirm": "cdek-confirm", + "prefix-confirm__header": "cdek-confirm__header", + "prefix-confirm__header__title": "cdek-confirm__header__title", + "prefix-badge": "cdek-badge", + "prefix-confirm__header__hint": "cdek-confirm__header__hint", + "prefix-confirm__footer": "cdek-confirm__footer", + "prefix-button": "cdek-button" +}, am = { + $style: lm +}, Cw = /* @__PURE__ */ Ae(om, [["__cssModules", am], ["__scopeId", "data-v-02e933a3"]]); +function _t(r, o, ...i) { + if (r in o) { + let a = o[r]; + return typeof a == "function" ? a(...i) : a; + } + let c = new Error(`Tried to handle "${r}" but there is no handler defined. Only defined handlers are: ${Object.keys(o).map((a) => `"${a}"`).join(", ")}.`); + throw Error.captureStackTrace && Error.captureStackTrace(c, _t), c; +} +var Ws = ((r) => (r[r.None = 0] = "None", r[r.RenderStrategy = 1] = "RenderStrategy", r[r.Static = 2] = "Static", r))(Ws || {}), um = ((r) => (r[r.Unmount = 0] = "Unmount", r[r.Hidden = 1] = "Hidden", r))(um || {}); +function $t({ visible: r = !0, features: o = 0, ourProps: i, theirProps: c, ...a }) { + var p; + let y = ru(c, i), b = Object.assign(a, { props: y }); + if (r || o & 2 && y.static) + return Ds(b); + if (o & 1) { + let T = (p = y.unmount) == null || p ? 0 : 1; + return _t(T, { 0() { + return null; + }, 1() { + return Ds({ ...a, props: { ...y, hidden: !0, style: { display: "none" } } }); + } }); + } + return Ds(b); +} +function Ds({ props: r, attrs: o, slots: i, slot: c, name: a }) { + var p, y; + let { as: b, ...T } = Js(r, ["unmount", "static"]), g = (p = i.default) == null ? void 0 : p.call(i, c), _ = {}; + if (c) { + let C = !1, D = []; + for (let [Q, ee] of Object.entries(c)) + typeof ee == "boolean" && (C = !0), ee === !0 && D.push(Q); + C && (_["data-headlessui-state"] = D.join(" ")); + } + if (b === "template") { + if (g = nu(g ?? []), Object.keys(T).length > 0 || Object.keys(o).length > 0) { + let [C, ...D] = g ?? []; + if (!cm(C) || D.length > 0) + throw new Error(['Passing props on "template"!', "", `The current component <${a} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(T).concat(Object.keys(o)).map((O) => O.trim()).filter((O, E, W) => W.indexOf(O) === E).sort((O, E) => O.localeCompare(E)).map((O) => ` - ${O}`).join(` +`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((O) => ` - ${O}`).join(` +`)].join(` +`)); + let Q = ru((y = C.props) != null ? y : {}, T), ee = kg(C, Q); + for (let O in Q) + O.startsWith("on") && (ee.props || (ee.props = {}), ee.props[O] = Q[O]); + return ee; + } + return Array.isArray(g) && g.length === 1 ? g[0] : g; + } + return lr(b, Object.assign({}, T, _), { default: () => g }); +} +function nu(r) { + return r.flatMap((o) => o.type === xt ? nu(o.children) : [o]); +} +function ru(...r) { + if (r.length === 0) + return {}; + if (r.length === 1) + return r[0]; + let o = {}, i = {}; + for (let c of r) + for (let a in c) + a.startsWith("on") && typeof c[a] == "function" ? (i[a] != null || (i[a] = []), i[a].push(c[a])) : o[a] = c[a]; + if (o.disabled || o["aria-disabled"]) + return Object.assign(o, Object.fromEntries(Object.keys(i).map((c) => [c, void 0]))); + for (let c in i) + Object.assign(o, { [c](a, ...p) { + let y = i[c]; + for (let b of y) { + if (a instanceof Event && a.defaultPrevented) + return; + b(a, ...p); + } + } }); + return o; +} +function iu(r) { + let o = Object.assign({}, r); + for (let i in o) + o[i] === void 0 && delete o[i]; + return o; +} +function Js(r, o = []) { + let i = Object.assign({}, r); + for (let c of o) + c in i && delete i[c]; + return i; +} +function cm(r) { + return r == null ? !1 : typeof r.type == "string" || typeof r.type == "object" || typeof r.type == "function"; +} +let fm = 0; +function dm() { + return ++fm; +} +function _n() { + return dm(); +} +var Se = ((r) => (r.Space = " ", r.Enter = "Enter", r.Escape = "Escape", r.Backspace = "Backspace", r.Delete = "Delete", r.ArrowLeft = "ArrowLeft", r.ArrowUp = "ArrowUp", r.ArrowRight = "ArrowRight", r.ArrowDown = "ArrowDown", r.Home = "Home", r.End = "End", r.PageUp = "PageUp", r.PageDown = "PageDown", r.Tab = "Tab", r))(Se || {}); +function pm(r) { + throw new Error("Unexpected object: " + r); +} +var Ne = ((r) => (r[r.First = 0] = "First", r[r.Previous = 1] = "Previous", r[r.Next = 2] = "Next", r[r.Last = 3] = "Last", r[r.Specific = 4] = "Specific", r[r.Nothing = 5] = "Nothing", r))(Ne || {}); +function hm(r, o) { + let i = o.resolveItems(); + if (i.length <= 0) + return null; + let c = o.resolveActiveIndex(), a = c ?? -1, p = (() => { + switch (r.focus) { + case 0: + return i.findIndex((y) => !o.resolveDisabled(y)); + case 1: { + let y = i.slice().reverse().findIndex((b, T, g) => a !== -1 && g.length - T - 1 >= a ? !1 : !o.resolveDisabled(b)); + return y === -1 ? y : i.length - 1 - y; + } + case 2: + return i.findIndex((y, b) => b <= a ? !1 : !o.resolveDisabled(y)); + case 3: { + let y = i.slice().reverse().findIndex((b) => !o.resolveDisabled(b)); + return y === -1 ? y : i.length - 1 - y; + } + case 4: + return i.findIndex((y) => o.resolveId(y) === r.id); + case 5: + return null; + default: + pm(r); + } + })(); + return p === -1 ? c : p; +} +function be(r) { + var o; + return r == null || r.value == null ? null : (o = r.value.$el) != null ? o : r.value; +} +let su = Symbol("Context"); +var ar = ((r) => (r[r.Open = 1] = "Open", r[r.Closed = 2] = "Closed", r[r.Closing = 4] = "Closing", r[r.Opening = 8] = "Opening", r))(ar || {}); +function _m() { + return hn(su, null); +} +function vm(r) { + Mn(su, r); +} +function Wa(r, o) { + if (r) + return r; + let i = o ?? "button"; + if (typeof i == "string" && i.toLowerCase() === "button") + return "button"; +} +function ou(r, o) { + let i = oe(Wa(r.value.type, r.value.as)); + return Dt(() => { + i.value = Wa(r.value.type, r.value.as); + }), di(() => { + var c; + i.value || be(o) && be(o) instanceof HTMLButtonElement && !((c = be(o)) != null && c.hasAttribute("type")) && (i.value = "button"); + }), i; +} +var gm = Object.defineProperty, mm = (r, o, i) => o in r ? gm(r, o, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[o] = i, Va = (r, o, i) => (mm(r, typeof o != "symbol" ? o + "" : o, i), i); +let ym = class { + constructor() { + Va(this, "current", this.detect()), Va(this, "currentId", 0); + } + set(o) { + this.current !== o && (this.currentId = 0, this.current = o); + } + reset() { + this.set(this.detect()); + } + nextId() { + return ++this.currentId; + } + get isServer() { + return this.current === "server"; + } + get isClient() { + return this.current === "client"; + } + detect() { + return typeof window > "u" || typeof document > "u" ? "server" : "client"; + } +}, lu = new ym(); +function bm(r) { + if (lu.isServer) + return null; + if (r instanceof Node) + return r.ownerDocument; + if (r != null && r.hasOwnProperty("value")) { + let o = be(r); + if (o) + return o.ownerDocument; + } + return document; +} +let Ha = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((r) => `${r}:not([tabindex='-1'])`).join(","); +var wm = ((r) => (r[r.First = 1] = "First", r[r.Previous = 2] = "Previous", r[r.Next = 4] = "Next", r[r.Last = 8] = "Last", r[r.WrapAround = 16] = "WrapAround", r[r.NoScroll = 32] = "NoScroll", r))(wm || {}), km = ((r) => (r[r.Error = 0] = "Error", r[r.Overflow = 1] = "Overflow", r[r.Success = 2] = "Success", r[r.Underflow = 3] = "Underflow", r))(km || {}), xm = ((r) => (r[r.Previous = -1] = "Previous", r[r.Next = 1] = "Next", r))(xm || {}), Qs = ((r) => (r[r.Strict = 0] = "Strict", r[r.Loose = 1] = "Loose", r))(Qs || {}); +function au(r, o = 0) { + var i; + return r === ((i = bm(r)) == null ? void 0 : i.body) ? !1 : _t(o, { 0() { + return r.matches(Ha); + }, 1() { + let c = r; + for (; c !== null; ) { + if (c.matches(Ha)) + return !0; + c = c.parentElement; + } + return !1; + } }); +} +function $m(r, o = (i) => i) { + return r.slice().sort((i, c) => { + let a = o(i), p = o(c); + if (a === null || p === null) + return 0; + let y = a.compareDocumentPosition(p); + return y & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : y & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0; + }); +} +function Fs(r, o, i) { + lu.isServer || di((c) => { + document.addEventListener(r, o, i), c(() => document.removeEventListener(r, o, i)); + }); +} +function Am(r, o, i = B(() => !0)) { + function c(p, y) { + if (!i.value || p.defaultPrevented) + return; + let b = y(p); + if (b === null || !b.getRootNode().contains(b)) + return; + let T = function g(_) { + return typeof _ == "function" ? g(_()) : Array.isArray(_) || _ instanceof Set ? _ : [_]; + }(r); + for (let g of T) { + if (g === null) + continue; + let _ = g instanceof HTMLElement ? g : be(g); + if (_ != null && _.contains(b) || p.composed && p.composedPath().includes(_)) + return; + } + return !au(b, Qs.Loose) && b.tabIndex !== -1 && p.preventDefault(), o(p, b); + } + let a = oe(null); + Fs("mousedown", (p) => { + var y, b; + i.value && (a.value = ((b = (y = p.composedPath) == null ? void 0 : y.call(p)) == null ? void 0 : b[0]) || p.target); + }, !0), Fs("click", (p) => { + a.value && (c(p, () => a.value), a.value = null); + }, !0), Fs("blur", (p) => c(p, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0); +} +var js = ((r) => (r[r.None = 1] = "None", r[r.Focusable = 2] = "Focusable", r[r.Hidden = 4] = "Hidden", r))(js || {}); +let uu = se({ name: "Hidden", props: { as: { type: [Object, String], default: "div" }, features: { type: Number, default: 1 } }, setup(r, { slots: o, attrs: i }) { + return () => { + let { features: c, ...a } = r, p = { "aria-hidden": (c & 2) === 2 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(c & 4) === 4 && (c & 2) !== 2 && { display: "none" } } }; + return $t({ ourProps: p, theirProps: a, slot: {}, attrs: i, slots: o, name: "Hidden" }); + }; +} }); +function cu(r = {}, o = null, i = []) { + for (let [c, a] of Object.entries(r)) + du(i, fu(o, c), a); + return i; +} +function fu(r, o) { + return r ? r + "[" + o + "]" : o; +} +function du(r, o, i) { + if (Array.isArray(i)) + for (let [c, a] of i.entries()) + du(r, fu(o, c.toString()), a); + else + i instanceof Date ? r.push([o, i.toISOString()]) : typeof i == "boolean" ? r.push([o, i ? "1" : "0"]) : typeof i == "string" ? r.push([o, i]) : typeof i == "number" ? r.push([o, `${i}`]) : i == null ? r.push([o, ""]) : cu(i, o, r); +} +function Sm(r) { + var o; + let i = (o = r == null ? void 0 : r.form) != null ? o : r.closest("form"); + if (i) { + for (let c of i.elements) + if (c.tagName === "INPUT" && c.type === "submit" || c.tagName === "BUTTON" && c.type === "submit" || c.nodeName === "INPUT" && c.type === "image") { + c.click(); + return; + } + } +} +function pu(r, o, i) { + let c = oe(i == null ? void 0 : i.value), a = B(() => r.value !== void 0); + return [B(() => a.value ? r.value : c.value), function(p) { + return a.value || (c.value = p), o == null ? void 0 : o(p); + }]; +} +function Ga(r) { + return [r.screenX, r.screenY]; +} +function Tm() { + let r = oe([-1, -1]); + return { wasMoved(o) { + let i = Ga(o); + return r.value[0] === i[0] && r.value[1] === i[1] ? !1 : (r.value = i, !0); + }, update(o) { + r.value = Ga(o); + } }; +} +let hu = Symbol("DescriptionContext"); +function Cm() { + let r = hn(hu, null); + if (r === null) + throw new Error("Missing parent"); + return r; +} +function Om({ slot: r = oe({}), name: o = "Description", props: i = {} } = {}) { + let c = oe([]); + function a(p) { + return c.value.push(p), () => { + let y = c.value.indexOf(p); + y !== -1 && c.value.splice(y, 1); + }; + } + return Mn(hu, { register: a, slot: r, name: o, props: i }), B(() => c.value.length > 0 ? c.value.join(" ") : void 0); +} +se({ name: "Description", props: { as: { type: [Object, String], default: "p" }, id: { type: String, default: () => `headlessui-description-${_n()}` } }, setup(r, { attrs: o, slots: i }) { + let c = Cm(); + return Dt(() => Ys(c.register(r.id))), () => { + let { name: a = "Description", slot: p = oe({}), props: y = {} } = c, { id: b, ...T } = r, g = { ...Object.entries(y).reduce((_, [C, D]) => Object.assign(_, { [C]: ie(D) }), {}), id: b }; + return $t({ ourProps: g, theirProps: T, slot: p.value, attrs: o, slots: i, name: a }); + }; +} }); +function Em(r, o) { + return r === o; +} +var Im = ((r) => (r[r.Open = 0] = "Open", r[r.Closed = 1] = "Closed", r))(Im || {}), Rm = ((r) => (r[r.Single = 0] = "Single", r[r.Multi = 1] = "Multi", r))(Rm || {}), Lm = ((r) => (r[r.Pointer = 0] = "Pointer", r[r.Other = 1] = "Other", r))(Lm || {}); +function Mm(r) { + requestAnimationFrame(() => requestAnimationFrame(r)); +} +let _u = Symbol("ListboxContext"); +function dr(r) { + let o = hn(_u, null); + if (o === null) { + let i = new Error(`<${r} /> is missing a parent component.`); + throw Error.captureStackTrace && Error.captureStackTrace(i, dr), i; + } + return o; +} +let Bm = se({ name: "Listbox", emits: { "update:modelValue": (r) => !0 }, props: { as: { type: [Object, String], default: "template" }, disabled: { type: [Boolean], default: !1 }, by: { type: [String, Function], default: () => Em }, horizontal: { type: [Boolean], default: !1 }, modelValue: { type: [Object, String, Number, Boolean], default: void 0 }, defaultValue: { type: [Object, String, Number, Boolean], default: void 0 }, name: { type: String, optional: !0 }, multiple: { type: [Boolean], default: !1 } }, inheritAttrs: !1, setup(r, { slots: o, attrs: i, emit: c }) { + let a = oe(1), p = oe(null), y = oe(null), b = oe(null), T = oe([]), g = oe(""), _ = oe(null), C = oe(1); + function D(V = (F) => F) { + let F = _.value !== null ? T.value[_.value] : null, Z = $m(V(T.value.slice()), (ge) => be(ge.dataRef.domRef)), q = F ? Z.indexOf(F) : null; + return q === -1 && (q = null), { options: Z, activeOptionIndex: q }; + } + let Q = B(() => r.multiple ? 1 : 0), [ee, O] = pu(B(() => r.modelValue === void 0 ? _t(Q.value, { 1: [], 0: void 0 }) : r.modelValue), (V) => c("update:modelValue", V), B(() => r.defaultValue)), E = { listboxState: a, value: ee, mode: Q, compare(V, F) { + if (typeof r.by == "string") { + let Z = r.by; + return (V == null ? void 0 : V[Z]) === (F == null ? void 0 : F[Z]); + } + return r.by(V, F); + }, orientation: B(() => r.horizontal ? "horizontal" : "vertical"), labelRef: p, buttonRef: y, optionsRef: b, disabled: B(() => r.disabled), options: T, searchQuery: g, activeOptionIndex: _, activationTrigger: C, closeListbox() { + r.disabled || a.value !== 1 && (a.value = 1, _.value = null); + }, openListbox() { + r.disabled || a.value !== 0 && (a.value = 0); + }, goToOption(V, F, Z) { + if (r.disabled || a.value === 1) + return; + let q = D(), ge = hm(V === Ne.Specific ? { focus: Ne.Specific, id: F } : { focus: V }, { resolveItems: () => q.options, resolveActiveIndex: () => q.activeOptionIndex, resolveId: (Ee) => Ee.id, resolveDisabled: (Ee) => Ee.dataRef.disabled }); + g.value = "", _.value = ge, C.value = Z ?? 1, T.value = q.options; + }, search(V) { + if (r.disabled || a.value === 1) + return; + let F = g.value !== "" ? 0 : 1; + g.value += V.toLowerCase(); + let Z = (_.value !== null ? T.value.slice(_.value + F).concat(T.value.slice(0, _.value + F)) : T.value).find((ge) => ge.dataRef.textValue.startsWith(g.value) && !ge.dataRef.disabled), q = Z ? T.value.indexOf(Z) : -1; + q === -1 || q === _.value || (_.value = q, C.value = 1); + }, clearSearch() { + r.disabled || a.value !== 1 && g.value !== "" && (g.value = ""); + }, registerOption(V, F) { + let Z = D((q) => [...q, { id: V, dataRef: F }]); + T.value = Z.options, _.value = Z.activeOptionIndex; + }, unregisterOption(V) { + let F = D((Z) => { + let q = Z.findIndex((ge) => ge.id === V); + return q !== -1 && Z.splice(q, 1), Z; + }); + T.value = F.options, _.value = F.activeOptionIndex, C.value = 1; + }, select(V) { + r.disabled || O(_t(Q.value, { 0: () => V, 1: () => { + let F = st(E.value.value).slice(), Z = st(V), q = F.findIndex((ge) => E.compare(Z, st(ge))); + return q === -1 ? F.push(Z) : F.splice(q, 1), F; + } })); + } }; + Am([y, b], (V, F) => { + var Z; + E.closeListbox(), au(F, Qs.Loose) || (V.preventDefault(), (Z = be(y)) == null || Z.focus()); + }, B(() => a.value === 0)), Mn(_u, E), vm(B(() => _t(a.value, { 0: ar.Open, 1: ar.Closed }))); + let W = B(() => { + var V; + return (V = be(y)) == null ? void 0 : V.closest("form"); + }); + return Dt(() => { + Jt([W], () => { + if (!W.value || r.defaultValue === void 0) + return; + function V() { + E.select(r.defaultValue); + } + return W.value.addEventListener("reset", V), () => { + var F; + (F = W.value) == null || F.removeEventListener("reset", V); + }; + }, { immediate: !0 }); + }), () => { + let { name: V, modelValue: F, disabled: Z, ...q } = r, ge = { open: a.value === 0, disabled: Z, value: ee.value }; + return lr(xt, [...V != null && ee.value != null ? cu({ [V]: ee.value }).map(([Ee, At]) => lr(uu, iu({ features: js.Hidden, key: Ee, as: "input", type: "hidden", hidden: !0, readOnly: !0, name: Ee, value: At }))) : [], $t({ ourProps: {}, theirProps: { ...i, ...Js(q, ["defaultValue", "onUpdate:modelValue", "horizontal", "multiple", "by"]) }, slot: ge, slots: o, attrs: i, name: "Listbox" })]); + }; +} }), Pm = se({ name: "ListboxLabel", props: { as: { type: [Object, String], default: "label" }, id: { type: String, default: () => `headlessui-listbox-label-${_n()}` } }, setup(r, { attrs: o, slots: i }) { + let c = dr("ListboxLabel"); + function a() { + var p; + (p = be(c.buttonRef)) == null || p.focus({ preventScroll: !0 }); + } + return () => { + let p = { open: c.listboxState.value === 0, disabled: c.disabled.value }, { id: y, ...b } = r, T = { id: y, ref: c.labelRef, onClick: a }; + return $t({ ourProps: T, theirProps: b, slot: p, attrs: o, slots: i, name: "ListboxLabel" }); + }; +} }), Dm = se({ name: "ListboxButton", props: { as: { type: [Object, String], default: "button" }, id: { type: String, default: () => `headlessui-listbox-button-${_n()}` } }, setup(r, { attrs: o, slots: i, expose: c }) { + let a = dr("ListboxButton"); + c({ el: a.buttonRef, $el: a.buttonRef }); + function p(g) { + switch (g.key) { + case Se.Space: + case Se.Enter: + case Se.ArrowDown: + g.preventDefault(), a.openListbox(), Yt(() => { + var _; + (_ = be(a.optionsRef)) == null || _.focus({ preventScroll: !0 }), a.value.value || a.goToOption(Ne.First); + }); + break; + case Se.ArrowUp: + g.preventDefault(), a.openListbox(), Yt(() => { + var _; + (_ = be(a.optionsRef)) == null || _.focus({ preventScroll: !0 }), a.value.value || a.goToOption(Ne.Last); + }); + break; + } + } + function y(g) { + switch (g.key) { + case Se.Space: + g.preventDefault(); + break; + } + } + function b(g) { + a.disabled.value || (a.listboxState.value === 0 ? (a.closeListbox(), Yt(() => { + var _; + return (_ = be(a.buttonRef)) == null ? void 0 : _.focus({ preventScroll: !0 }); + })) : (g.preventDefault(), a.openListbox(), Mm(() => { + var _; + return (_ = be(a.optionsRef)) == null ? void 0 : _.focus({ preventScroll: !0 }); + }))); + } + let T = ou(B(() => ({ as: r.as, type: o.type })), a.buttonRef); + return () => { + var g, _; + let C = { open: a.listboxState.value === 0, disabled: a.disabled.value, value: a.value.value }, { id: D, ...Q } = r, ee = { ref: a.buttonRef, id: D, type: T.value, "aria-haspopup": "listbox", "aria-controls": (g = be(a.optionsRef)) == null ? void 0 : g.id, "aria-expanded": a.disabled.value ? void 0 : a.listboxState.value === 0, "aria-labelledby": a.labelRef.value ? [(_ = be(a.labelRef)) == null ? void 0 : _.id, D].join(" ") : void 0, disabled: a.disabled.value === !0 ? !0 : void 0, onKeydown: p, onKeyup: y, onClick: b }; + return $t({ ourProps: ee, theirProps: Q, slot: C, attrs: o, slots: i, name: "ListboxButton" }); + }; +} }), Fm = se({ name: "ListboxOptions", props: { as: { type: [Object, String], default: "ul" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, id: { type: String, default: () => `headlessui-listbox-options-${_n()}` } }, setup(r, { attrs: o, slots: i, expose: c }) { + let a = dr("ListboxOptions"), p = oe(null); + c({ el: a.optionsRef, $el: a.optionsRef }); + function y(g) { + switch (p.value && clearTimeout(p.value), g.key) { + case Se.Space: + if (a.searchQuery.value !== "") + return g.preventDefault(), g.stopPropagation(), a.search(g.key); + case Se.Enter: + if (g.preventDefault(), g.stopPropagation(), a.activeOptionIndex.value !== null) { + let _ = a.options.value[a.activeOptionIndex.value]; + a.select(_.dataRef.value); + } + a.mode.value === 0 && (a.closeListbox(), Yt(() => { + var _; + return (_ = be(a.buttonRef)) == null ? void 0 : _.focus({ preventScroll: !0 }); + })); + break; + case _t(a.orientation.value, { vertical: Se.ArrowDown, horizontal: Se.ArrowRight }): + return g.preventDefault(), g.stopPropagation(), a.goToOption(Ne.Next); + case _t(a.orientation.value, { vertical: Se.ArrowUp, horizontal: Se.ArrowLeft }): + return g.preventDefault(), g.stopPropagation(), a.goToOption(Ne.Previous); + case Se.Home: + case Se.PageUp: + return g.preventDefault(), g.stopPropagation(), a.goToOption(Ne.First); + case Se.End: + case Se.PageDown: + return g.preventDefault(), g.stopPropagation(), a.goToOption(Ne.Last); + case Se.Escape: + g.preventDefault(), g.stopPropagation(), a.closeListbox(), Yt(() => { + var _; + return (_ = be(a.buttonRef)) == null ? void 0 : _.focus({ preventScroll: !0 }); + }); + break; + case Se.Tab: + g.preventDefault(), g.stopPropagation(); + break; + default: + g.key.length === 1 && (a.search(g.key), p.value = setTimeout(() => a.clearSearch(), 350)); + break; + } + } + let b = _m(), T = B(() => b !== null ? (b.value & ar.Open) === ar.Open : a.listboxState.value === 0); + return () => { + var g, _, C, D; + let Q = { open: a.listboxState.value === 0 }, { id: ee, ...O } = r, E = { "aria-activedescendant": a.activeOptionIndex.value === null || (g = a.options.value[a.activeOptionIndex.value]) == null ? void 0 : g.id, "aria-multiselectable": a.mode.value === 1 ? !0 : void 0, "aria-labelledby": (D = (_ = be(a.labelRef)) == null ? void 0 : _.id) != null ? D : (C = be(a.buttonRef)) == null ? void 0 : C.id, "aria-orientation": a.orientation.value, id: ee, onKeydown: y, role: "listbox", tabIndex: 0, ref: a.optionsRef }; + return $t({ ourProps: E, theirProps: O, slot: Q, attrs: o, slots: i, features: Ws.RenderStrategy | Ws.Static, visible: T.value, name: "ListboxOptions" }); + }; +} }), Nm = se({ name: "ListboxOption", props: { as: { type: [Object, String], default: "li" }, value: { type: [Object, String, Number, Boolean] }, disabled: { type: Boolean, default: !1 }, id: { type: String, default: () => `headlessui-listbox.option-${_n()}` } }, setup(r, { slots: o, attrs: i, expose: c }) { + let a = dr("ListboxOption"), p = oe(null); + c({ el: p, $el: p }); + let y = B(() => a.activeOptionIndex.value !== null ? a.options.value[a.activeOptionIndex.value].id === r.id : !1), b = B(() => _t(a.mode.value, { 0: () => a.compare(st(a.value.value), st(r.value)), 1: () => st(a.value.value).some((E) => a.compare(st(E), st(r.value))) })), T = B(() => _t(a.mode.value, { 1: () => { + var E; + let W = st(a.value.value); + return ((E = a.options.value.find((V) => W.some((F) => a.compare(st(F), st(V.dataRef.value))))) == null ? void 0 : E.id) === r.id; + }, 0: () => b.value })), g = B(() => ({ disabled: r.disabled, value: r.value, textValue: "", domRef: p })); + Dt(() => { + var E, W; + let V = (W = (E = be(p)) == null ? void 0 : E.textContent) == null ? void 0 : W.toLowerCase().trim(); + V !== void 0 && (g.value.textValue = V); + }), Dt(() => a.registerOption(r.id, g)), Ys(() => a.unregisterOption(r.id)), Dt(() => { + Jt([a.listboxState, b], () => { + a.listboxState.value === 0 && b.value && _t(a.mode.value, { 1: () => { + T.value && a.goToOption(Ne.Specific, r.id); + }, 0: () => { + a.goToOption(Ne.Specific, r.id); + } }); + }, { immediate: !0 }); + }), di(() => { + a.listboxState.value === 0 && y.value && a.activationTrigger.value !== 0 && Yt(() => { + var E, W; + return (W = (E = be(p)) == null ? void 0 : E.scrollIntoView) == null ? void 0 : W.call(E, { block: "nearest" }); + }); + }); + function _(E) { + if (r.disabled) + return E.preventDefault(); + a.select(r.value), a.mode.value === 0 && (a.closeListbox(), Yt(() => { + var W; + return (W = be(a.buttonRef)) == null ? void 0 : W.focus({ preventScroll: !0 }); + })); + } + function C() { + if (r.disabled) + return a.goToOption(Ne.Nothing); + a.goToOption(Ne.Specific, r.id); + } + let D = Tm(); + function Q(E) { + D.update(E); + } + function ee(E) { + D.wasMoved(E) && (r.disabled || y.value || a.goToOption(Ne.Specific, r.id, 0)); + } + function O(E) { + D.wasMoved(E) && (r.disabled || y.value && a.goToOption(Ne.Nothing)); + } + return () => { + let { disabled: E } = r, W = { active: y.value, selected: b.value, disabled: E }, { id: V, value: F, disabled: Z, ...q } = r, ge = { id: V, ref: p, role: "option", tabIndex: E === !0 ? void 0 : -1, "aria-disabled": E === !0 ? !0 : void 0, "aria-selected": b.value, disabled: void 0, onClick: _, onFocus: C, onPointerenter: Q, onMouseenter: Q, onPointermove: ee, onMousemove: ee, onPointerleave: O, onMouseleave: O }; + return $t({ ourProps: ge, theirProps: q, slot: W, attrs: i, slots: o, name: "ListboxOption" }); + }; +} }), vu = Symbol("LabelContext"); +function gu() { + let r = hn(vu, null); + if (r === null) { + let o = new Error("You used a