UNPKG

@wix/cli

Version:

CLI tool for building Wix sites and applications

1,587 lines (1,553 loc) 150 kB
import { createRequire as _createRequire } from 'node:module'; const require = _createRequire(import.meta.url); import { init_tslib_es6, tslib_es6_exports } from "./chunk-RPTAJN5Y.js"; import { getTestOverrides } from "./chunk-XZUGLEBK.js"; import { zod_default } from "./chunk-SDLCFZRL.js"; import { require_verror } from "./chunk-CO5A7CZG.js"; import { __commonJS, __esm, __export, __require, __toCommonJS, __toESM, init_esm_shims } from "./chunk-EXLZF52D.js"; // ../../node_modules/@wix/http-client/dist/src/constants.js var require_constants = __commonJS({ "../../node_modules/@wix/http-client/dist/src/constants.js"(exports) { "use strict"; init_esm_shims(); Object.defineProperty(exports, "__esModule", { value: true }); exports.ORIGINAL_PROTOCOL_HEADER = exports.ORIGINAL_HOST_HEADER = exports.ORIGINAL_URL_HEADER = exports.SSR_PROTOCOL = exports.SSR_HOST = exports.NO_SCENARIO_FOUND = void 0; exports.NO_SCENARIO_FOUND = "NO_SCENARIO_FOUND"; exports.SSR_HOST = "www.wix.com"; exports.SSR_PROTOCOL = "http"; exports.ORIGINAL_URL_HEADER = "x-wix-metro-original-url"; exports.ORIGINAL_HOST_HEADER = "x-wix-metro-original-host"; exports.ORIGINAL_PROTOCOL_HEADER = "x-wix-metro-original-protocol"; } }); // ../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/globals.js function maybeGetDocument() { if (typeof document === "object") { return document; } return void 0; } function maybeGetGlobal() { if (typeof self === "object") { return self; } else { return global; } } var init_globals = __esm({ "../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/globals.js"() { "use strict"; init_esm_shims(); } }); // ../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/cookies.js function readCookie(name) { const cookieValue = getCookieByName(name); if (cookieValue) { return cookieValue.split("=")[1]; } return ""; } function loadCookies() { const documentObj = maybeGetDocument(); if (documentObj && documentObj.cookie) { return decodeURIComponent(documentObj.cookie).split(";"); } return []; } function getCookieByName(name) { return loadCookies().filter((cookie) => name === cookie.split("=")[0].trim())[0]; } var init_cookies = __esm({ "../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/cookies.js"() { "use strict"; init_esm_shims(); init_globals(); } }); // ../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/csrf.js function csrf() { const value = readCookie(XSRF_TOKEN_COOKIE_NAME); return { [XSRF_HEADER_NAME]: value }; } var XSRF_TOKEN_COOKIE_NAME, XSRF_HEADER_NAME; var init_csrf = __esm({ "../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/csrf.js"() { "use strict"; init_esm_shims(); init_cookies(); XSRF_TOKEN_COOKIE_NAME = "XSRF-TOKEN"; XSRF_HEADER_NAME = "x-xsrf-token"; } }); // ../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/x-wix-brand.js function xWixBrand() { const value = extractBrand(); return { [X_WIX_BRAND_NAME]: value }; } function extractBrand() { const globalObj = maybeGetGlobal(); if (globalObj && globalObj.commonConfig && typeof globalObj.commonConfig.brand === "string") { return globalObj.commonConfig.brand; } return ""; } var X_WIX_BRAND_NAME; var init_x_wix_brand = __esm({ "../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/x-wix-brand.js"() { "use strict"; init_esm_shims(); init_globals(); X_WIX_BRAND_NAME = "x-wix-brand"; } }); // ../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/consent-policy.js function consentPolicy() { return tryResolveNativeAPI() || tryResolveJsSDK() || none(); } function tryResolveJsSDK() { const globalObj = maybeGetGlobal(); if (globalObj && globalObj.Wix && globalObj.Wix.Utils && typeof globalObj.Wix.Utils._getConsentPolicyHeader === "function") { return globalObj.Wix.Utils._getConsentPolicyHeader(); } return void 0; } function tryResolveNativeAPI() { const globalObj = maybeGetGlobal(); if (globalObj && globalObj.consentPolicyManager && typeof globalObj.consentPolicyManager._getConsentPolicyHeader === "function") { return globalObj.consentPolicyManager._getConsentPolicyHeader(); } return void 0; } function none() { return {}; } var init_consent_policy = __esm({ "../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/consent-policy.js"() { "use strict"; init_esm_shims(); init_globals(); } }); // ../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/authorization.js function authorization(signedInstance) { return { authorization: signedInstance }; } var init_authorization = __esm({ "../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/authorization.js"() { "use strict"; init_esm_shims(); } }); // ../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/utils.js function isCI() { if (isNode()) { return !!process.env.TEAMCITY_VERSION || !!process.env.BUILDKITE; } return false; } function isNode() { return typeof process !== "undefined" && process.versions?.node != null; } var init_utils = __esm({ "../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/utils.js"() { "use strict"; init_esm_shims(); } }); // ../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/artifact-id.js function artifactId(override) { const artifactIdToUse = process.env.ARTIFACT_ID ?? process.env.APP_NAME ?? ""; return { "X-Wix-Client-Artifact-Id": override ?? (!isCI() ? artifactIdToUse : "") }; } var init_artifact_id = __esm({ "../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/artifact-id.js"() { "use strict"; init_esm_shims(); init_utils(); } }); // ../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/common-config.js function extractCommonConfigValues() { const globalObj = maybeGetGlobal(); const commonConfigObj = globalObj?.commonConfig; if (!commonConfigObj) { return null; } const res = {}; let addedKeys = false; Object.keys(commonConfigObj).forEach((key) => { const newKey = MAP_KEYS[key]; if (newKey) { res[newKey] = commonConfigObj[key]; addedKeys = true; } else if (IGNORE_KEYS.indexOf(key) < 0 && typeof commonConfigObj[key] !== "function") { res[key] = commonConfigObj[key]; addedKeys = true; } }); return addedKeys ? res : null; } var IGNORE_KEYS, COMMON_CONFIG_NAME, MAP_KEYS, commonConfig; var init_common_config = __esm({ "../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/common-config.js"() { "use strict"; init_esm_shims(); init_globals(); IGNORE_KEYS = ["consentPolicy", "consentPolicyHeader"]; COMMON_CONFIG_NAME = "commonConfig"; MAP_KEYS = { bsi: "BSI" }; commonConfig = () => { const commonConfigValues = extractCommonConfigValues(); const value = commonConfigValues ? JSON.stringify(commonConfigValues) : ""; return { [COMMON_CONFIG_NAME]: encodeURIComponent(value) }; }; } }); // ../../node_modules/base-64/base64.js var require_base64 = __commonJS({ "../../node_modules/base-64/base64.js"(exports, module) { "use strict"; init_esm_shims(); (function(root) { var freeExports = typeof exports == "object" && exports; var freeModule = typeof module == "object" && module && module.exports == freeExports && module; var freeGlobal = typeof global == "object" && global; if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { root = freeGlobal; } var InvalidCharacterError = function(message) { this.message = message; }; InvalidCharacterError.prototype = new Error(); InvalidCharacterError.prototype.name = "InvalidCharacterError"; var error = function(message) { throw new InvalidCharacterError(message); }; var TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var REGEX_SPACE_CHARACTERS = /[\t\n\f\r ]/g; var decode = function(input) { input = String(input).replace(REGEX_SPACE_CHARACTERS, ""); var length = input.length; if (length % 4 == 0) { input = input.replace(/==?$/, ""); length = input.length; } if (length % 4 == 1 || // http://whatwg.org/C#alphanumeric-ascii-characters /[^+a-zA-Z0-9/]/.test(input)) { error( "Invalid character: the string to be decoded is not correctly encoded." ); } var bitCounter = 0; var bitStorage; var buffer; var output = ""; var position = -1; while (++position < length) { buffer = TABLE.indexOf(input.charAt(position)); bitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer; if (bitCounter++ % 4) { output += String.fromCharCode( 255 & bitStorage >> (-2 * bitCounter & 6) ); } } return output; }; var encode = function(input) { input = String(input); if (/[^\0-\xFF]/.test(input)) { error( "The string to be encoded contains characters outside of the Latin1 range." ); } var padding = input.length % 3; var output = ""; var position = -1; var a; var b; var c; var buffer; var length = input.length - padding; while (++position < length) { a = input.charCodeAt(position) << 16; b = input.charCodeAt(++position) << 8; c = input.charCodeAt(++position); buffer = a + b + c; output += TABLE.charAt(buffer >> 18 & 63) + TABLE.charAt(buffer >> 12 & 63) + TABLE.charAt(buffer >> 6 & 63) + TABLE.charAt(buffer & 63); } if (padding == 2) { a = input.charCodeAt(position) << 8; b = input.charCodeAt(++position); buffer = a + b; output += TABLE.charAt(buffer >> 10) + TABLE.charAt(buffer >> 4 & 63) + TABLE.charAt(buffer << 2 & 63) + "="; } else if (padding == 1) { buffer = input.charCodeAt(position); output += TABLE.charAt(buffer >> 2) + TABLE.charAt(buffer << 4 & 63) + "=="; } return output; }; var base642 = { "encode": encode, "decode": decode, "version": "1.0.0" }; if (typeof define == "function" && typeof define.amd == "object" && define.amd) { define(function() { return base642; }); } else if (freeExports && !freeExports.nodeType) { if (freeModule) { freeModule.exports = base642; } else { for (var key in base642) { base642.hasOwnProperty(key) && (freeExports[key] = base642[key]); } } } else { root.base64 = base642; } })(exports); } }); // ../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/linguist.js function linguistHeader({ lang, locale, isPrimaryLanguage, signedInstance }) { if (isMultilingualOptionsAreValid({ lang, locale, isPrimaryLanguage })) { const instanceId = getInstanceIdFromSignedInstance(signedInstance); if (instanceId !== void 0) { return { [LINGUIST_HEADER_KEY]: [ lang, locale, isPrimaryLanguage?.toString(), instanceId ].join("|") }; } } return {}; } function isMultilingualOptionsAreValid({ lang, locale, isPrimaryLanguage }) { return lang && locale && /^(true|false)$/.test(isPrimaryLanguage?.toString() || ""); } function getInstanceIdFromSignedInstance(signedInstance) { try { const encodedInstance = signedInstance?.startsWith("wixcode") ? signedInstance?.split(".")[2] : signedInstance?.split(".")[1]; if (encodedInstance) { return JSON.parse(import_base_64.default.decode(encodedInstance)).instanceId; } } catch (e) { } } var import_base_64, LINGUIST_HEADER_KEY; var init_linguist = __esm({ "../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/headers/linguist.js"() { "use strict"; init_esm_shims(); import_base_64 = __toESM(require_base64()); LINGUIST_HEADER_KEY = "x-wix-linguist"; } }); // ../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/errors.js var WixHeadersValidationError; var init_errors = __esm({ "../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/errors.js"() { "use strict"; init_esm_shims(); WixHeadersValidationError = class extends Error { constructor(type, key, value) { super(`WixHeadersValidationError: expected ${key} to be ${type} but got ${JSON.stringify(value)}`); } }; } }); // ../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/assert.js function assertBoolean(key, value) { if (typeof value !== "boolean") { throw new WixHeadersValidationError("boolean", key, value); } } function assertString(key, value) { if (typeof value !== "string") { throw new WixHeadersValidationError("string", key, value); } } var init_assert = __esm({ "../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/assert.js"() { "use strict"; init_esm_shims(); init_errors(); } }); // ../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/index.js var esm_exports = {}; __export(esm_exports, { createHeaders: () => createHeaders }); function createHeaders(opts = {}) { opts = { csrf: true, signedInstance: "", ...opts }; verifyOptsOrThrow(opts); const headers = [ xWixBrand(), consentPolicy(), authorization(opts.signedInstance), artifactId(opts.artifactId), commonConfig(), linguistHeader({ signedInstance: opts.signedInstance, ...opts.multilingualOptions }) ]; if (opts.csrf) { headers.push(csrf()); } return headers.filter((hdrs) => Object.values(hdrs).every((v) => v)).reduce((result, hdrs) => ({ ...result, ...hdrs }), {}); } function verifyOptsOrThrow(opts) { assertBoolean("opts.csrf", opts.csrf); assertString("opts.signedInstance", opts.signedInstance); } var init_esm = __esm({ "../../node_modules/@wix/http-client/node_modules/@wix/headers/dist/esm/index.js"() { "use strict"; init_esm_shims(); init_csrf(); init_x_wix_brand(); init_consent_policy(); init_authorization(); init_artifact_id(); init_common_config(); init_linguist(); init_assert(); } }); // ../../node_modules/@wix/http-client/dist/src/env-util.js var require_env_util = __commonJS({ "../../node_modules/@wix/http-client/dist/src/env-util.js"(exports) { "use strict"; init_esm_shims(); Object.defineProperty(exports, "__esModule", { value: true }); exports.isNode = exports.isWebWorker = exports.isBrowser = void 0; function isBrowser() { return typeof window !== "undefined"; } exports.isBrowser = isBrowser; function isWebWorker() { var _a; return typeof self === "object" && ((_a = self === null || self === void 0 ? void 0 : self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope"; } exports.isWebWorker = isWebWorker; function isNode2() { var _a; return typeof process !== "undefined" && ((_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) != null; } exports.isNode = isNode2; } }); // ../../node_modules/@wix/http-client/dist/src/utils.js var require_utils = __commonJS({ "../../node_modules/@wix/http-client/dist/src/utils.js"(exports) { "use strict"; init_esm_shims(); Object.defineProperty(exports, "__esModule", { value: true }); exports.toSearchQueryParams = exports.shouldAllowUnmocked = exports.isHttpMockServerEnabled = exports.getGlobalConfig = exports.changeHost = exports.extractHost = exports.extractProtocol = exports.resolveProtocol = exports.resolveHost = exports.extractProp = exports.silent = exports.isAbsoluteUrl = void 0; var constants_1 = require_constants(); var env_util_1 = require_env_util(); function isAbsoluteUrl(url) { if (typeof url !== "string") { throw new TypeError(`Expected a \`string\`, got \`${typeof url}\``); } return /(^https?:)|(^\/\/)/.test(url); } exports.isAbsoluteUrl = isAbsoluteUrl; async function silent(fn) { try { await fn(); } catch (_a) { } } exports.silent = silent; function extractProp(data, path) { return path.split(".").filter((prop) => prop).reduce((result, prop) => result[prop], data); } exports.extractProp = extractProp; function resolveHost(opts) { if (opts.baseURL) { return extractHost(opts.baseURL); } else if (opts.isSSR) { return constants_1.SSR_HOST; } else if (typeof self !== "undefined" && !!self.location) { return self.location.host; } else { return ""; } } exports.resolveHost = resolveHost; function resolveProtocol(opts) { if (opts.baseURL) { return extractProtocol(opts.baseURL); } else if (opts.isSSR) { return constants_1.SSR_PROTOCOL; } else if (typeof self !== "undefined" && !!self.location) { return self.location.protocol; } else { return ""; } } exports.resolveProtocol = resolveProtocol; function extractProtocol(url) { try { const asUrl = new URL(url); return asUrl.protocol; } catch (_a) { const hostAndProtocol = extractHostAndProtocolUsingRegExp(url); return hostAndProtocol.protocol; } } exports.extractProtocol = extractProtocol; function extractHost(url) { let asUrl; try { asUrl = new URL(url); } catch (_a) { asUrl = new URL(`http:${url}`); } try { return asUrl.host; } catch (_b) { const hostAndProtocol = extractHostAndProtocolUsingRegExp(url); return hostAndProtocol.host; } } exports.extractHost = extractHost; function extractHostAndProtocolUsingRegExp(url) { const regExp = new RegExp("^(.*:)//([A-Za-z0-9-.]+)(:[0-9]+)?(.*)$"); try { const urlOptions = regExp.exec(url); return { protocol: urlOptions[1], host: urlOptions[2] }; } catch (_a) { return { protocol: "http:", host: "" }; } } function changeHost(urlOrPath, host) { let url; try { url = new URL(urlOrPath); url.host = host; url.protocol = "http"; } catch (_a) { url = new URL(`http://${host}`); url.pathname = urlOrPath; } return url.toString(); } exports.changeHost = changeHost; function getGlobalConfig() { const defaultConfig = { httpMockServer: { enabled: false } }; let globalConfig; if ((0, env_util_1.isNode)() && process.env.HTTP_CLIENT_GLOBAL_CONFIG) { try { globalConfig = JSON.parse(process.env.HTTP_CLIENT_GLOBAL_CONFIG); } catch (e) { } } if (!globalConfig) { if ((0, env_util_1.isBrowser)()) { globalConfig = window._httpClientGlobalConfig; } else if ((0, env_util_1.isWebWorker)()) { } } return globalConfig || defaultConfig; } exports.getGlobalConfig = getGlobalConfig; function isHttpMockServerEnabled() { const globalConfig = getGlobalConfig(); return globalConfig.httpMockServer.enabled; } exports.isHttpMockServerEnabled = isHttpMockServerEnabled; function shouldAllowUnmocked() { const globalConfig = getGlobalConfig(); return globalConfig.httpMockServer.allowUnmocked; } exports.shouldAllowUnmocked = shouldAllowUnmocked; function toSearchQueryParams(params) { return Object.entries(params).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).flat().join("&"); } exports.toSearchQueryParams = toSearchQueryParams; } }); // ../../node_modules/@wix/http-client/dist/src/whitelist.json var require_whitelist = __commonJS({ "../../node_modules/@wix/http-client/dist/src/whitelist.json"(exports, module) { module.exports = [ "wix.com", "editorx.com", "wix-code.com", "wixapps.net", "wixprod.net" ]; } }); // ../../node_modules/@wix/http-client/dist/src/headers.js var require_headers = __commonJS({ "../../node_modules/@wix/http-client/dist/src/headers.js"(exports) { "use strict"; init_esm_shims(); Object.defineProperty(exports, "__esModule", { value: true }); exports.isWixDomain = exports.composeHeaders = exports.requestIdOrEmptyString = void 0; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var headers_1 = (init_esm(), __toCommonJS(esm_exports)); var utils_1 = require_utils(); var whitelist_json_1 = tslib_1.__importDefault(require_whitelist()); function requestIdOrEmptyString(response) { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a["x-wix-request-id"]) || ""; } exports.requestIdOrEmptyString = requestIdOrEmptyString; var composeHeaders = ({ url, disableWixHeaders, wixHeadersOpts }) => { const shouldAssignWixHeaders = !disableWixHeaders && isWixDomain(url); return shouldAssignWixHeaders ? (0, headers_1.createHeaders)(wixHeadersOpts) : {}; }; exports.composeHeaders = composeHeaders; function isWixDomain(url) { const isRelative = !(0, utils_1.isAbsoluteUrl)(url); if (isRelative) { return true; } const host = `.${(0, utils_1.extractHost)(url)}`; const isWhitelisted = whitelist_json_1.default.find((wixHost) => host.endsWith(`.${wixHost}`)); return !!isWhitelisted; } exports.isWixDomain = isWixDomain; } }); // ../../node_modules/@wix/http-client/dist/src/error.js var require_error = __commonJS({ "../../node_modules/@wix/http-client/dist/src/error.js"(exports) { "use strict"; init_esm_shims(); Object.defineProperty(exports, "__esModule", { value: true }); exports.createHttpError = exports.HttpError = exports.axiosErrorFields = void 0; var headers_1 = require_headers(); exports.axiosErrorFields = [ "code", "config", "request", "response", "toJSON", "__CANCEL__" ]; var HttpError = class _HttpError extends Error { constructor(error) { super(error.message); this.isWixHttpError = true; Object.setPrototypeOf(this, _HttpError.prototype); exports.axiosErrorFields.forEach((key) => { this[key] = error[key]; }); } get requestId() { return (0, headers_1.requestIdOrEmptyString)(this.response); } }; exports.HttpError = HttpError; function createHttpError(...args) { return new HttpError(...args); } exports.createHttpError = createHttpError; } }); // ../../node_modules/axios/lib/helpers/bind.js var require_bind = __commonJS({ "../../node_modules/axios/lib/helpers/bind.js"(exports, module) { "use strict"; init_esm_shims(); module.exports = function bind(fn, thisArg) { return function wrap() { var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } return fn.apply(thisArg, args); }; }; } }); // ../../node_modules/axios/lib/utils.js var require_utils2 = __commonJS({ "../../node_modules/axios/lib/utils.js"(exports, module) { "use strict"; init_esm_shims(); var bind = require_bind(); var toString = Object.prototype.toString; function isArray(val) { return toString.call(val) === "[object Array]"; } function isUndefined(val) { return typeof val === "undefined"; } function isBuffer(val) { return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val); } function isArrayBuffer(val) { return toString.call(val) === "[object ArrayBuffer]"; } function isFormData(val) { return typeof FormData !== "undefined" && val instanceof FormData; } function isArrayBufferView(val) { var result; if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { result = ArrayBuffer.isView(val); } else { result = val && val.buffer && val.buffer instanceof ArrayBuffer; } return result; } function isString(val) { return typeof val === "string"; } function isNumber(val) { return typeof val === "number"; } function isObject(val) { return val !== null && typeof val === "object"; } function isPlainObject(val) { if (toString.call(val) !== "[object Object]") { return false; } var prototype = Object.getPrototypeOf(val); return prototype === null || prototype === Object.prototype; } function isDate(val) { return toString.call(val) === "[object Date]"; } function isFile(val) { return toString.call(val) === "[object File]"; } function isBlob(val) { return toString.call(val) === "[object Blob]"; } function isFunction(val) { return toString.call(val) === "[object Function]"; } function isStream(val) { return isObject(val) && isFunction(val.pipe); } function isURLSearchParams(val) { return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams; } function trim(str) { return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ""); } function isStandardBrowserEnv() { if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) { return false; } return typeof window !== "undefined" && typeof document !== "undefined"; } function forEach(obj, fn) { if (obj === null || typeof obj === "undefined") { return; } if (typeof obj !== "object") { obj = [obj]; } if (isArray(obj)) { for (var i = 0, l = obj.length; i < l; i++) { fn.call(null, obj[i], i, obj); } } else { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { fn.call(null, obj[key], key, obj); } } } } function merge() { var result = {}; function assignValue(val, key) { if (isPlainObject(result[key]) && isPlainObject(val)) { result[key] = merge(result[key], val); } else if (isPlainObject(val)) { result[key] = merge({}, val); } else if (isArray(val)) { result[key] = val.slice(); } else { result[key] = val; } } for (var i = 0, l = arguments.length; i < l; i++) { forEach(arguments[i], assignValue); } return result; } function extend(a, b, thisArg) { forEach(b, function assignValue(val, key) { if (thisArg && typeof val === "function") { a[key] = bind(val, thisArg); } else { a[key] = val; } }); return a; } function stripBOM(content) { if (content.charCodeAt(0) === 65279) { content = content.slice(1); } return content; } module.exports = { isArray, isArrayBuffer, isBuffer, isFormData, isArrayBufferView, isString, isNumber, isObject, isPlainObject, isUndefined, isDate, isFile, isBlob, isFunction, isStream, isURLSearchParams, isStandardBrowserEnv, forEach, merge, extend, trim, stripBOM }; } }); // ../../node_modules/axios/lib/core/enhanceError.js var require_enhanceError = __commonJS({ "../../node_modules/axios/lib/core/enhanceError.js"(exports, module) { "use strict"; init_esm_shims(); module.exports = function enhanceError(error, config, code, request, response) { error.config = config; if (code) { error.code = code; } error.request = request; error.response = response; error.isAxiosError = true; error.toJSON = function toJSON() { return { // 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: this.config, code: this.code }; }; return error; }; } }); // ../../node_modules/axios/lib/core/createError.js var require_createError = __commonJS({ "../../node_modules/axios/lib/core/createError.js"(exports, module) { "use strict"; init_esm_shims(); var enhanceError = require_enhanceError(); module.exports = function createError(message, config, code, request, response) { var error = new Error(message); return enhanceError(error, config, code, request, response); }; } }); // ../../node_modules/axios/lib/core/settle.js var require_settle = __commonJS({ "../../node_modules/axios/lib/core/settle.js"(exports, module) { "use strict"; init_esm_shims(); var createError = require_createError(); module.exports = function settle(resolve, reject, response) { var validateStatus = response.config.validateStatus; if (!response.status || !validateStatus || validateStatus(response.status)) { resolve(response); } else { reject(createError( "Request failed with status code " + response.status, response.config, null, response.request, response )); } }; } }); // ../../node_modules/axios/lib/helpers/isAbsoluteURL.js var require_isAbsoluteURL = __commonJS({ "../../node_modules/axios/lib/helpers/isAbsoluteURL.js"(exports, module) { "use strict"; init_esm_shims(); module.exports = function isAbsoluteURL(url) { return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); }; } }); // ../../node_modules/axios/lib/helpers/combineURLs.js var require_combineURLs = __commonJS({ "../../node_modules/axios/lib/helpers/combineURLs.js"(exports, module) { "use strict"; init_esm_shims(); module.exports = function combineURLs(baseURL, relativeURL) { return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; }; } }); // ../../node_modules/axios/lib/core/buildFullPath.js var require_buildFullPath = __commonJS({ "../../node_modules/axios/lib/core/buildFullPath.js"(exports, module) { "use strict"; init_esm_shims(); var isAbsoluteURL = require_isAbsoluteURL(); var combineURLs = require_combineURLs(); module.exports = function buildFullPath(baseURL, requestedURL) { if (baseURL && !isAbsoluteURL(requestedURL)) { return combineURLs(baseURL, requestedURL); } return requestedURL; }; } }); // ../../node_modules/axios/lib/helpers/buildURL.js var require_buildURL = __commonJS({ "../../node_modules/axios/lib/helpers/buildURL.js"(exports, module) { "use strict"; init_esm_shims(); var utils = require_utils2(); function encode(val) { return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); } module.exports = function buildURL(url, params, paramsSerializer) { if (!params) { return url; } var serializedParams; if (paramsSerializer) { serializedParams = paramsSerializer(params); } else if (utils.isURLSearchParams(params)) { serializedParams = params.toString(); } else { var parts = []; utils.forEach(params, function serialize(val, key) { if (val === null || typeof val === "undefined") { return; } if (utils.isArray(val)) { key = key + "[]"; } else { val = [val]; } utils.forEach(val, function parseValue(v) { if (utils.isDate(v)) { v = v.toISOString(); } else if (utils.isObject(v)) { v = JSON.stringify(v); } parts.push(encode(key) + "=" + encode(v)); }); }); serializedParams = parts.join("&"); } if (serializedParams) { var hashmarkIndex = url.indexOf("#"); if (hashmarkIndex !== -1) { url = url.slice(0, hashmarkIndex); } url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams; } return url; }; } }); // ../../node_modules/ms/index.js var require_ms = __commonJS({ "../../node_modules/ms/index.js"(exports, module) { "use strict"; init_esm_shims(); var s = 1e3; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === "string" && val.length > 0) { return parse(val); } else if (type === "number" && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) ); }; function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || "ms").toLowerCase(); switch (type) { case "years": case "year": case "yrs": case "yr": case "y": return n * y; case "weeks": case "week": case "w": return n * w; case "days": case "day": case "d": return n * d; case "hours": case "hour": case "hrs": case "hr": case "h": return n * h; case "minutes": case "minute": case "mins": case "min": case "m": return n * m; case "seconds": case "second": case "secs": case "sec": case "s": return n * s; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": return n; default: return void 0; } } function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + "d"; } if (msAbs >= h) { return Math.round(ms / h) + "h"; } if (msAbs >= m) { return Math.round(ms / m) + "m"; } if (msAbs >= s) { return Math.round(ms / s) + "s"; } return ms + "ms"; } function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, "day"); } if (msAbs >= h) { return plural(ms, msAbs, h, "hour"); } if (msAbs >= m) { return plural(ms, msAbs, m, "minute"); } if (msAbs >= s) { return plural(ms, msAbs, s, "second"); } return ms + " ms"; } function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } } }); // ../../node_modules/debug/src/common.js var require_common = __commonJS({ "../../node_modules/debug/src/common.js"(exports, module) { "use strict"; init_esm_shims(); function setup(env2) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require_ms(); createDebug.destroy = destroy; Object.keys(env2).forEach((key) => { createDebug[key] = env2[key]; }); createDebug.names = []; createDebug.skips = []; createDebug.formatters = {}; function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; function createDebug(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug(...args) { if (!debug.enabled) { return; } const self2 = debug; const curr = Number(/* @__PURE__ */ new Date()); const ms = curr - (prevTime || curr); self2.diff = ms; self2.prev = prevTime; self2.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== "string") { args.unshift("%O"); } let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { if (match === "%%") { return "%"; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === "function") { const val = args[index]; match = formatter.call(self2, val); args.splice(index, 1); index--; } return match; }); createDebug.formatArgs.call(self2, args); const logFn = self2.log || createDebug.log; logFn.apply(self2, args); } debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; Object.defineProperty(debug, "enabled", { enumerable: true, configurable: false, get: () => { if (enableOverride !== null) { return enableOverride; } if (namespacesCache !== createDebug.namespaces) { namespacesCache = createDebug.namespaces; enabledCache = createDebug.enabled(namespace); } return enabledCache; }, set: (v) => { enableOverride = v; } }); if (typeof createDebug.init === "function") { createDebug.init(debug); } return debug; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); newDebug.log = this.log; return newDebug; } function enable(namespaces) { createDebug.save(namespaces); createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean); for (const ns of split) { if (ns[0] === "-") { createDebug.skips.push(ns.slice(1)); } else { createDebug.names.push(ns); } } } function matchesTemplate(search, template) { let searchIndex = 0; let templateIndex = 0; let starIndex = -1; let matchIndex = 0; while (searchIndex < search.length) { if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { if (template[templateIndex] === "*") { starIndex = templateIndex; matchIndex = searchIndex; templateIndex++; } else { searchIndex++; templateIndex++; } } else if (starIndex !== -1) { templateIndex = starIndex + 1; matchIndex++; searchIndex = matchIndex; } else { return false; } } while (templateIndex < template.length && template[templateIndex] === "*") { templateIndex++; } return templateIndex === template.length; } function disable() { const namespaces = [ ...createDebug.names, ...createDebug.skips.map((namespace) => "-" + namespace) ].join(","); createDebug.enable(""); return namespaces; } function enabled(name) { for (const skip of createDebug.skips) { if (matchesTemplate(name, skip)) { return false; } } for (const ns of createDebug.names) { if (matchesTemplate(name, ns)) { return true; } } return false; } function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } function destroy() { console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; } }); // ../../node_modules/debug/src/browser.js var require_browser = __commonJS({ "../../node_modules/debug/src/browser.js"(exports, module) { "use strict"; init_esm_shims(); exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); exports.destroy = /* @__PURE__ */ (() => { let warned = false; return () => { if (!warned) { warned = true; console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } }; })(); exports.colors = [ "#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33" ]; function useColors() { if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { return true; } if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } let m; return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } function formatArgs(args) { args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = "color: " + this.color; args.splice(1, 0, c, "color: inherit"); let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, (match) => { if (match === "%%") { return; } index++; if (match === "%c") { lastC = index; } }); args.splice(lastC, 0, c); } exports.log = console.debug || console.log || (() => { }); function save(namespaces) { try { if (namespaces) { exports.storage.setItem("debug", namespaces); } else { exports.storage.removeItem("debug"); } } catch (error) { } } function load() { let r; try { r = exports.storage.getItem("debug"); } catch (error) { } if (!r && typeof process !== "undefined" && "env" in process) { r = process.env.DEBUG; } return r; } function localstorage() { try { return localStorage; } catch (error) { } } module.exports = require_common()(exports); var { formatters } = module.exports; formatters.j = function(v) { try { return JSON.stringify(v); } catch (error) { return "[UnexpectedJSONParseError]: " + error.message; } }; } }); // ../../node_modules/has-flag/index.js var require_has_flag = __commonJS({ "../../node_modules/has-flag/index.js"(exports, module) { "use strict"; init_esm_shims(); module.exports = (flag, argv = process.argv) => { const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; const position = argv.indexOf(prefix + flag); const terminatorPosition = argv.indexOf("--"); return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); }; } }); // ../../node_modules/supports-color/index.js var require_supports_color = __commonJS({ "../../node_modules/supports-color/index.js"(exports, module) { "use strict"; init_esm_shims(); var os = __require("os"); var tty = __require("tty"); var hasFlag = require_has_flag(); var { env: env2 } = process; var forceColor; if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { forceColor = 0; } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { forceColor = 1; } if ("FORCE_COLOR" in env2) { if (env2.FORCE_COLOR === "true") { forceColor = 1; } else if (env2.FORCE_COLOR === "false") { forceColor = 0; } else { forceColor = env2.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env2.FORCE_COLOR, 10), 3); } } function translateLevel(level) { if (level === 0) { return false; } return { level, hasBasic: true, has256: level >= 2, has16m: level >= 3 }; } function supportsColor(haveStream, streamIsTTY) { if (forceColor === 0) { return 0; } if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { return 3; } if (hasFlag("color=256")) { return 2; } if (haveStream && !streamIsTTY && forceColor === void 0) { return 0; } const min = forceColor || 0; if (env2.TERM === "dumb") { return min; } if (process.platform === "win32") { const osRelease = os.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } if ("CI" in env2) { if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") { return 1; } return min; } if ("TEAMCITY_VERSION" in