@mcesystems/auth-g4 1.0.71 → 1.0.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -869,55 +869,172 @@ var require_src = __commonJS({
869
869
  }
870
870
  });
871
871
  var import_debug = __toESM2(require_src());
872
- var logInfo = (0, import_debug.default)("info");
873
- var logTask = (0, import_debug.default)("task");
874
- var logError = (0, import_debug.default)("error");
875
- var logDetail = (0, import_debug.default)("detail");
876
- var logDebug = (0, import_debug.default)("debug");
877
- var logWarning = (0, import_debug.default)("warning");
878
- var logColor = (0, import_debug.default)("color");
879
- logInfo.color = "19";
880
- logTask.color = "25";
881
- logError.color = "1";
882
- logDetail.color = "199";
883
- logWarning.color = "186";
884
- logDebug.color = "211";
885
- logColor.enabled = true;
886
- function logNamespace(namespace) {
887
- logInfo.namespace = `${namespace}:info`;
888
- logTask.namespace = `${namespace}:task`;
889
- logError.namespace = `${namespace}:error`;
890
- logDetail.namespace = `${namespace}:detail`;
891
- logWarning.namespace = `${namespace}:warning`;
892
- logDebug.namespace = `${namespace}:debug`;
893
- }
894
- function setLogLevel(level) {
895
- switch (level) {
896
- case "info":
897
- logInfo.enabled = true;
898
- logTask.enabled = true;
899
- logError.enabled = true;
900
- logWarning.enabled = true;
901
- logDetail.enabled = false;
902
- logDebug.enabled = false;
903
- break;
904
- case "debug":
905
- logInfo.enabled = true;
906
- logTask.enabled = true;
907
- logError.enabled = true;
908
- logWarning.enabled = true;
909
- logDetail.enabled = true;
910
- logDebug.enabled = true;
911
- break;
912
- case "none":
913
- logInfo.enabled = false;
914
- logTask.enabled = false;
915
- logError.enabled = false;
916
- logWarning.enabled = false;
917
- logDetail.enabled = false;
918
- logDebug.enabled = false;
919
- break;
872
+ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
873
+ const logInfo2 = (0, import_debug.default)(`${namespace}:info`);
874
+ const logTask = (0, import_debug.default)(`${namespace}:task`);
875
+ const logError = (0, import_debug.default)(`${namespace}:error`);
876
+ const logDetail = (0, import_debug.default)(`${namespace}:detail`);
877
+ const logDebug = (0, import_debug.default)(`${namespace}:debug`);
878
+ const logWarning = (0, import_debug.default)(`${namespace}:warning`);
879
+ const logColor = (0, import_debug.default)(`${namespace}:color`);
880
+ logInfo2.color = "19";
881
+ logTask.color = "25";
882
+ logError.color = "1";
883
+ logDetail.color = "199";
884
+ logWarning.color = "186";
885
+ logDebug.color = "211";
886
+ logColor.enabled = true;
887
+ function setNamespace(namespace2) {
888
+ logInfo2.namespace = `${namespace2}:info`;
889
+ logTask.namespace = `${namespace2}:task`;
890
+ logError.namespace = `${namespace2}:error`;
891
+ logDetail.namespace = `${namespace2}:detail`;
892
+ logWarning.namespace = `${namespace2}:warning`;
893
+ logDebug.namespace = `${namespace2}:debug`;
894
+ }
895
+ function setLogLevel(level) {
896
+ switch (level) {
897
+ case "info":
898
+ logInfo2.enabled = true;
899
+ logTask.enabled = true;
900
+ logError.enabled = true;
901
+ logWarning.enabled = true;
902
+ logDetail.enabled = false;
903
+ logDebug.enabled = false;
904
+ break;
905
+ case "debug":
906
+ logInfo2.enabled = true;
907
+ logTask.enabled = true;
908
+ logError.enabled = true;
909
+ logWarning.enabled = true;
910
+ logDetail.enabled = true;
911
+ logDebug.enabled = true;
912
+ break;
913
+ case "none":
914
+ logInfo2.enabled = false;
915
+ logTask.enabled = false;
916
+ logError.enabled = false;
917
+ logWarning.enabled = false;
918
+ logDetail.enabled = false;
919
+ logDebug.enabled = false;
920
+ break;
921
+ }
922
+ }
923
+ setLogLevel(logLevel);
924
+ function setColors(type, color) {
925
+ switch (type) {
926
+ case "info":
927
+ logInfo2.color = color;
928
+ break;
929
+ case "task":
930
+ logTask.color = color;
931
+ break;
932
+ case "error":
933
+ logError.color = color;
934
+ break;
935
+ case "detail":
936
+ logDetail.color = color;
937
+ break;
938
+ case "warning":
939
+ logWarning.color = color;
940
+ break;
941
+ case "debug":
942
+ logDebug.color = color;
943
+ break;
944
+ default:
945
+ throw new Error(`Invalid log type: ${type}`);
946
+ }
947
+ }
948
+ function printColors() {
949
+ for (let i = 0; i < 256; i++) {
950
+ logColor.color = `${i}`;
951
+ logColor(`${i}: ${i}`);
952
+ }
920
953
  }
954
+ function logDataDetail(data, prefix = "# ") {
955
+ if (data === null || data === void 0) {
956
+ return `${prefix}<null or undefined>`;
957
+ }
958
+ if (typeof data !== "object") {
959
+ return `${prefix}${String(data)}`;
960
+ }
961
+ const keys = Object.keys(data);
962
+ let result = "";
963
+ for (const key of keys) {
964
+ result += `${prefix}${key}: `;
965
+ if (key in data) {
966
+ let dataKey = key;
967
+ if (key in data) {
968
+ dataKey = key;
969
+ const value = data[dataKey];
970
+ if (value === null || value === void 0) {
971
+ result += `<${value === null ? "null" : "undefined"}>
972
+ `;
973
+ } else if (typeof value === "object") {
974
+ result += `
975
+ ${logDataDetail(value, `${prefix} `)}
976
+ `;
977
+ } else {
978
+ result += `${value}
979
+ `;
980
+ }
981
+ }
982
+ }
983
+ }
984
+ return result.trim();
985
+ }
986
+ function header(title, padding = 0) {
987
+ return `${" ".repeat(padding)}${"=".repeat(80)}
988
+ ${" ".repeat(40 - title.length / 2)}${title}
989
+ ${" ".repeat(padding)}${"=".repeat(80)}`;
990
+ }
991
+ function logHeader(title) {
992
+ logInfo2(`${header(title, 2)}`);
993
+ }
994
+ function logDataObject(title, ...args) {
995
+ const stack = new Error().stack?.split("\n")[2] || "";
996
+ const stackMatch = stack.match(/\((.*):(\d+):(\d+)\)$/) || stack.match(/at (.*):(\d+):(\d+)$/);
997
+ let callerDetails = "";
998
+ if (stackMatch) {
999
+ const functionMatch = stack.match(/at (.+) \(/);
1000
+ const functionName = functionMatch ? functionMatch[1] : "<anonymous>";
1001
+ callerDetails = `${functionName}`;
1002
+ }
1003
+ logDetail(`${header(`*${title}* ${callerDetails}`)}
1004
+ ${args.reduce((acc, arg) => `${acc}
1005
+ ${logDataDetail(arg)}`, "")}
1006
+
1007
+ ${"=".repeat(80)}`);
1008
+ }
1009
+ function logErrorObject(error, extraDetails) {
1010
+ if (error instanceof Error) {
1011
+ logError(`${extraDetails ? header(extraDetails, 1) : header(error.message, 1)}
1012
+ Error Message:
1013
+ ${error.message}
1014
+ Error Stack:
1015
+ ${error.stack}
1016
+ ${"=".repeat(80)}`);
1017
+ } else {
1018
+ logError(`${extraDetails ? header(extraDetails, 1) : header(String(error), 1)}
1019
+ ${"=".repeat(80)}`);
1020
+ }
1021
+ }
1022
+ return {
1023
+ logInfo: logInfo2,
1024
+ logTask,
1025
+ logError,
1026
+ logDetail,
1027
+ logDebug,
1028
+ logWarning,
1029
+ logColor,
1030
+ setColors,
1031
+ printColors,
1032
+ logHeader,
1033
+ logDataObject,
1034
+ logErrorObject,
1035
+ setLogLevel,
1036
+ setNamespace
1037
+ };
921
1038
  }
922
1039
 
923
1040
  // src/graphql/queries.ts
@@ -940,8 +1057,7 @@ var TOKEN_QUERY = `
940
1057
  `;
941
1058
 
942
1059
  // src/logic/authClient.ts
943
- setLogLevel(process.env.LOG_LEVEL ?? "none");
944
- logNamespace("auth");
1060
+ var { logInfo } = createLoggers("auth");
945
1061
  var random = (0, import_node_util.promisify)(import_node_crypto.randomBytes);
946
1062
  async function getAuthToken(credentials, apiUrl) {
947
1063
  const authApiUrl = apiUrl || process.env.AUTH_API_URL;
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/logic/authClient.ts", "../../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js", "../../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/common.js", "../../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/browser.js", "../../../node_modules/.pnpm/supports-color@10.2.2/node_modules/supports-color/index.js", "../../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/node.js", "../../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/index.js", "../../tool-debug/src/debug.ts", "../src/graphql/queries.ts"],
4
- "sourcesContent": ["export { getAuthToken, readCredentialsFromFile } from \"./logic/authClient\";\nexport type { AuthCredentials, TokenResponse } from \"./types/auth\";\n", "/**\n * Auth client for fetching MCE API tokens\n */\n\nimport { createHash, randomBytes } from \"node:crypto\";\nimport { promisify } from \"node:util\";\nimport { logInfo, logNamespace, setLogLevel } from \"@mcesystems/tool-debug-g4\";\nimport { AUTHORIZE_QUERY, TOKEN_QUERY } from \"../graphql/queries\";\nimport type { AuthCredentials, TokenResponse } from \"../types/auth\";\n\nsetLogLevel((process.env.LOG_LEVEL as \"info\" | \"debug\" | \"none\") ?? \"none\");\nlogNamespace(\"auth\");\n\nconst random = promisify(randomBytes);\n\nexport async function getAuthToken(\n\tcredentials: AuthCredentials,\n\tapiUrl?: string\n): Promise<TokenResponse> {\n\tconst authApiUrl = apiUrl || process.env.AUTH_API_URL;\n\tif (!authApiUrl) {\n\t\tthrow new Error(\"AUTH_API_URL is required. Set it in your env or pass apiUrl.\");\n\t}\n\tconst { clientDecorator, variantConfigurationKey } = credentials;\n\tconst frameworkId = credentials.frameworkId || `apple-kit-${Date.now()}`;\n\n\tlogInfo(`Getting auth token for identifiers: ${variantConfigurationKey}`);\n\n\tconst randomSecret = (await random(8)).toString(\"hex\");\n\tconst timestamp = new Date().toISOString();\n\tconst hash = createHash(\"sha256\");\n\thash.update(\n\t\t`${variantConfigurationKey}${frameworkId}${timestamp}${clientDecorator}${randomSecret}`\n\t);\n\tconst codeChallenge = hash.digest(\"hex\");\n\n\tconst authorizeResponse = await fetch(authApiUrl, {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tquery: AUTHORIZE_QUERY,\n\t\t\tvariables: {\n\t\t\t\tinput: {\n\t\t\t\t\tidentifiers: variantConfigurationKey,\n\t\t\t\t\tframework_id: frameworkId,\n\t\t\t\t\ttimestamp,\n\t\t\t\t\tcode_challenge: codeChallenge,\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t});\n\n\tif (!authorizeResponse.ok) {\n\t\tthrow new Error(\n\t\t\t`Authorize request failed: ${authorizeResponse.status} ${authorizeResponse.statusText}`\n\t\t);\n\t}\n\n\tconst authorizeData = (await authorizeResponse.json()) as {\n\t\tdata?: {\n\t\t\tauthorize?: {\n\t\t\t\tstatus: string;\n\t\t\t\tauthorization_code?: string;\n\t\t\t};\n\t\t};\n\t\terrors?: Array<{ message: string }>;\n\t};\n\n\tif (authorizeData.errors?.length) {\n\t\tthrow new Error(`Authorize error: ${authorizeData.errors.map((e) => e.message).join(\", \")}`);\n\t}\n\n\tconst authorizeResult = authorizeData.data?.authorize;\n\tif (authorizeResult?.status !== \"OK\" || !authorizeResult.authorization_code) {\n\t\tthrow new Error(`Authorize failed: ${JSON.stringify(authorizeResult)}`);\n\t}\n\n\tconst tokenResponse = await fetch(authApiUrl, {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tquery: TOKEN_QUERY,\n\t\t\tvariables: {\n\t\t\t\tinput: {\n\t\t\t\t\tauthorization_code: authorizeResult.authorization_code,\n\t\t\t\t\tcode_verifier: randomSecret,\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t});\n\n\tif (!tokenResponse.ok) {\n\t\tthrow new Error(`Token request failed: ${tokenResponse.status} ${tokenResponse.statusText}`);\n\t}\n\n\tconst tokenData = (await tokenResponse.json()) as {\n\t\tdata?: {\n\t\t\ttoken?: {\n\t\t\t\tstatus: string;\n\t\t\t\taccess_token?: string;\n\t\t\t\texpires_in?: number;\n\t\t\t};\n\t\t};\n\t\terrors?: Array<{ message: string }>;\n\t};\n\n\tif (tokenData.errors?.length) {\n\t\tthrow new Error(`Token error: ${tokenData.errors.map((e) => e.message).join(\", \")}`);\n\t}\n\n\tconst tokenResult = tokenData.data?.token;\n\tif (tokenResult?.status !== \"OK\" || !tokenResult.access_token) {\n\t\tthrow new Error(`Token failed: ${JSON.stringify(tokenResult)}`);\n\t}\n\n\treturn {\n\t\taccessToken: tokenResult.access_token,\n\t\texpiresIn: tokenResult.expires_in ?? 3600,\n\t};\n}\n\nexport async function readCredentialsFromFile(filePath: string): Promise<AuthCredentials> {\n\tconst fs = await import(\"node:fs/promises\");\n\n\tlogInfo(`Reading credentials from: ${filePath}`);\n\n\tconst content = await fs.readFile(filePath, \"utf-8\");\n\tconst credentials = JSON.parse(content) as AuthCredentials;\n\n\tif (!credentials.clientDecorator || !credentials.variantConfigurationKey) {\n\t\tthrow new Error(\"Invalid credentials file: missing clientDecorator or variantConfigurationKey\");\n\t}\n\n\treturn credentials;\n}\n", "/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n 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(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif (!('FORCE_COLOR' in env)) {\n\t\treturn;\n\t}\n\n\tif (env.FORCE_COLOR === 'true') {\n\t\treturn 1;\n\t}\n\n\tif (env.FORCE_COLOR === 'false') {\n\t\treturn 0;\n\t}\n\n\tif (env.FORCE_COLOR.length === 0) {\n\t\treturn 1;\n\t}\n\n\tconst level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\n\tif (![0, 1, 2, 3].includes(level)) {\n\t\treturn;\n\t}\n\n\treturn level;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-ghostty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'wezterm') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n", "/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n", "/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n", "import createDebug from \"debug\";\nimport type { LogsTypes } from \"../types/log\";\n\nexport const logInfo = createDebug(\"info\");\nexport const logTask = createDebug(\"task\");\nexport const logError = createDebug(\"error\");\nexport const logDetail = createDebug(\"detail\");\nexport const logDebug = createDebug(\"debug\");\nexport const logWarning = createDebug(\"warning\");\nconst logColor = createDebug(\"color\");\nlogInfo.color = \"19\"; // Purple\nlogTask.color = \"25\"; // Blue\nlogError.color = \"1\"; // Red\nlogDetail.color = \"199\"; // Pink\nlogWarning.color = \"186\"; // Yellow\nlogDebug.color = \"211\"; // Pink/Orange\n\nlogColor.enabled = true;\n\nexport function logNamespace(namespace: string) {\n\tlogInfo.namespace = `${namespace}:info`;\n\tlogTask.namespace = `${namespace}:task`;\n\tlogError.namespace = `${namespace}:error`;\n\tlogDetail.namespace = `${namespace}:detail`;\n\tlogWarning.namespace = `${namespace}:warning`;\n\tlogDebug.namespace = `${namespace}:debug`;\n}\n\nexport function setLogLevel(level: \"info\" | \"debug\" | \"none\") {\n\tswitch (level) {\n\t\tcase \"info\":\n\t\t\tlogInfo.enabled = true;\n\t\t\tlogTask.enabled = true;\n\t\t\tlogError.enabled = true;\n\t\t\tlogWarning.enabled = true;\n\t\t\tlogDetail.enabled = false;\n\t\t\tlogDebug.enabled = false;\n\t\t\tbreak;\n\t\tcase \"debug\":\n\t\t\tlogInfo.enabled = true;\n\t\t\tlogTask.enabled = true;\n\t\t\tlogError.enabled = true;\n\t\t\tlogWarning.enabled = true;\n\t\t\tlogDetail.enabled = true;\n\t\t\tlogDebug.enabled = true;\n\t\t\tbreak;\n\t\tcase \"none\":\n\t\t\tlogInfo.enabled = false;\n\t\t\tlogTask.enabled = false;\n\t\t\tlogError.enabled = false;\n\t\t\tlogWarning.enabled = false;\n\t\t\tlogDetail.enabled = false;\n\t\t\tlogDebug.enabled = false;\n\t\t\tbreak;\n\t}\n}\n\nexport function setColors(type: LogsTypes, color: string) {\n\tswitch (type) {\n\t\tcase \"info\":\n\t\t\tlogInfo.color = color;\n\t\t\tbreak;\n\t\tcase \"task\":\n\t\t\tlogTask.color = color;\n\t\t\tbreak;\n\t\tcase \"error\":\n\t\t\tlogError.color = color;\n\t\t\tbreak;\n\t\tcase \"detail\":\n\t\t\tlogDetail.color = color;\n\t\t\tbreak;\n\t\tcase \"warning\":\n\t\t\tlogWarning.color = color;\n\t\t\tbreak;\n\t\tcase \"debug\":\n\t\t\tlogDebug.color = color;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new Error(`Invalid log type: ${type}`);\n\t}\n}\n\nexport function printColors() {\n\tfor (let i = 0; i < 256; i++) {\n\t\tlogColor.color = `${i}`;\n\t\tlogColor(`${i}: ${i}`);\n\t}\n}\n\nfunction logDataDetail(data: unknown, prefix = \"# \"): string {\n\tif (data === null || data === undefined) {\n\t\treturn `${prefix}<null or undefined>`;\n\t}\n\tif (typeof data !== \"object\") {\n\t\treturn `${prefix}${String(data)}`;\n\t}\n\tconst keys = Object.keys(data);\n\tlet result = \"\";\n\tfor (const key of keys) {\n\t\tresult += `${prefix}${key}: `;\n\t\tif (key in data) {\n\t\t\tlet dataKey: keyof typeof data = key as keyof typeof data;\n\t\t\tif (key in data) {\n\t\t\t\tdataKey = key as keyof typeof data;\n\t\t\t\tconst value = data[dataKey];\n\t\t\t\tif (value === null || value === undefined) {\n\t\t\t\t\tresult += `<${value === null ? \"null\" : \"undefined\"}>\n`;\n\t\t\t\t} else if (typeof value === \"object\") {\n\t\t\t\t\tresult += `\n${logDataDetail(value, `${prefix} `)}\n`;\n\t\t\t\t} else {\n\t\t\t\t\tresult += `${value}\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn result.trim();\n}\n\nfunction header(title: string, padding = 0) {\n\treturn `${\" \".repeat(padding)}${\"=\".repeat(80)}\n${\" \".repeat(40 - title.length / 2)}${title}\n${\" \".repeat(padding)}${\"=\".repeat(80)}`;\n}\n\nexport function logHeader(title: string) {\n\tlogInfo(`${header(title, 2)}`);\n}\n\nexport function logDataObject(title: string, ...args: Record<string, unknown>[]) {\n\tconst stack = new Error().stack?.split(\"\\n\")[2] || \"\";\n\tconst stackMatch = stack.match(/\\((.*):(\\d+):(\\d+)\\)$/) || stack.match(/at (.*):(\\d+):(\\d+)$/);\n\tlet callerDetails = \"\";\n\tif (stackMatch) {\n\t\tconst functionMatch = stack.match(/at (.+) \\(/);\n\t\tconst functionName = functionMatch ? functionMatch[1] : \"<anonymous>\";\n\t\tcallerDetails = `${functionName}`;\n\t}\n\tlogDetail(`${header(`*${title}* ${callerDetails}`)}\n${args.reduce((acc, arg) => `${acc}\\n${logDataDetail(arg as Record<string, unknown>)}`, \"\")}\n\n${\"=\".repeat(80)}`);\n}\n\nexport function logErrorObject(error: unknown, extraDetails?: string) {\n\tif (error instanceof Error) {\n\t\tlogError(`${extraDetails ? header(extraDetails, 1) : header(error.message, 1)}\n Error Message:\n ${error.message}\n Error Stack:\n ${error.stack}\n ${\"=\".repeat(80)}`);\n\t} else {\n\t\tlogError(`${extraDetails ? header(extraDetails, 1) : header(String(error), 1)}\n ${\"=\".repeat(80)}`);\n\t}\n}\n", "export const AUTHORIZE_QUERY = `\n query Authorize($input: AuthorizeInput!) {\n authorize(input: $input) {\n status\n authorization_code\n }\n }\n`;\n\nexport const TOKEN_QUERY = `\n query Token($input: TokenInput!) {\n token(input: $input) {\n status\n access_token\n expires_in\n }\n }\n`;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIA,yBAAwC;AACxC,uBAA0B;;;AIL1B,0BAAoB;AACpB,qBAAe;AACf,sBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AHFhB,IAAA,aAAA,WAAA;EAAA,6DAAAA,UAAAC,SAAA;AAIA,QAAI,IAAI;AACR,QAAI,IAA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I,cAAc,UAAU,EAAE;AAAA,EAC5F;AAEA,QAAM,YAAa,MAAM,cAAc,KAAK;AAW5C,MAAI,UAAU,QAAQ,QAAQ;AAC7B,UAAM,IAAI,MAAM,gBAAgB,UAAU,OAAO,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC,EAAE;AAAA,EACpF;AAEA,QAAM,cAAc,UAAU,MAAM;AACpC,MAAI,aAAa,WAAW,QAAQ,CAAC,YAAY,cAAc;AAC9D,UAAM,IAAI,MAAM,iBAAiB,KAAK,UAAU,WAAW,CAAC,EAAE;AAAA,EAC/D;AAEA,SAAO;AAAA,IACN,aAAa,YAAY;AAAA,IACzB,WAAW,YAAY,cAAc;AAAA,EACtC;AACD;AAEA,eAAsB,wBAAwB,UAA4C;AACzF,QAAM,KAAK,MAAM,OAAO,kBAAkB;AAE1C,UAAQ,6BAA6B,QAAQ,EAAE;AAE/C,QAAM,UAAU,MAAM,GAAG,SAAS,UAAU,OAAO;AACnD,QAAM,cAAc,KAAK,MAAM,OAAO;AAEtC,MAAI,CAAC,YAAY,mBAAmB,CAAC,YAAY,yBAAyB;AACzE,UAAM,IAAI,MAAM,8EAA8E;AAAA,EAC/F;AAEA,SAAO;AACR;",
6
- "names": ["exports", "module", "env", "createDebug", "__export", "process", "os", "tty", "supportsColor", "__toCommonJS", "useColors", "__toESM"]
4
+ "sourcesContent": ["export { getAuthToken, readCredentialsFromFile } from \"./logic/authClient\";\nexport type { AuthCredentials, TokenResponse } from \"./types/auth\";\n", "/**\n * Auth client for fetching MCE API tokens\n */\n\nimport { createHash, randomBytes } from \"node:crypto\";\nimport { promisify } from \"node:util\";\nimport { createLoggers } from \"@mcesystems/tool-debug-g4\";\nimport { AUTHORIZE_QUERY, TOKEN_QUERY } from \"../graphql/queries\";\nimport type { AuthCredentials, TokenResponse } from \"../types/auth\";\n\nconst { logInfo } = createLoggers(\"auth\");\n\nconst random = promisify(randomBytes);\n\nexport async function getAuthToken(\n\tcredentials: AuthCredentials,\n\tapiUrl?: string\n): Promise<TokenResponse> {\n\tconst authApiUrl = apiUrl || process.env.AUTH_API_URL;\n\tif (!authApiUrl) {\n\t\tthrow new Error(\"AUTH_API_URL is required. Set it in your env or pass apiUrl.\");\n\t}\n\tconst { clientDecorator, variantConfigurationKey } = credentials;\n\tconst frameworkId = credentials.frameworkId || `apple-kit-${Date.now()}`;\n\n\tlogInfo(`Getting auth token for identifiers: ${variantConfigurationKey}`);\n\n\tconst randomSecret = (await random(8)).toString(\"hex\");\n\tconst timestamp = new Date().toISOString();\n\tconst hash = createHash(\"sha256\");\n\thash.update(\n\t\t`${variantConfigurationKey}${frameworkId}${timestamp}${clientDecorator}${randomSecret}`\n\t);\n\tconst codeChallenge = hash.digest(\"hex\");\n\n\tconst authorizeResponse = await fetch(authApiUrl, {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tquery: AUTHORIZE_QUERY,\n\t\t\tvariables: {\n\t\t\t\tinput: {\n\t\t\t\t\tidentifiers: variantConfigurationKey,\n\t\t\t\t\tframework_id: frameworkId,\n\t\t\t\t\ttimestamp,\n\t\t\t\t\tcode_challenge: codeChallenge,\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t});\n\n\tif (!authorizeResponse.ok) {\n\t\tthrow new Error(\n\t\t\t`Authorize request failed: ${authorizeResponse.status} ${authorizeResponse.statusText}`\n\t\t);\n\t}\n\n\tconst authorizeData = (await authorizeResponse.json()) as {\n\t\tdata?: {\n\t\t\tauthorize?: {\n\t\t\t\tstatus: string;\n\t\t\t\tauthorization_code?: string;\n\t\t\t};\n\t\t};\n\t\terrors?: Array<{ message: string }>;\n\t};\n\n\tif (authorizeData.errors?.length) {\n\t\tthrow new Error(`Authorize error: ${authorizeData.errors.map((e) => e.message).join(\", \")}`);\n\t}\n\n\tconst authorizeResult = authorizeData.data?.authorize;\n\tif (authorizeResult?.status !== \"OK\" || !authorizeResult.authorization_code) {\n\t\tthrow new Error(`Authorize failed: ${JSON.stringify(authorizeResult)}`);\n\t}\n\n\tconst tokenResponse = await fetch(authApiUrl, {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tquery: TOKEN_QUERY,\n\t\t\tvariables: {\n\t\t\t\tinput: {\n\t\t\t\t\tauthorization_code: authorizeResult.authorization_code,\n\t\t\t\t\tcode_verifier: randomSecret,\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t});\n\n\tif (!tokenResponse.ok) {\n\t\tthrow new Error(`Token request failed: ${tokenResponse.status} ${tokenResponse.statusText}`);\n\t}\n\n\tconst tokenData = (await tokenResponse.json()) as {\n\t\tdata?: {\n\t\t\ttoken?: {\n\t\t\t\tstatus: string;\n\t\t\t\taccess_token?: string;\n\t\t\t\texpires_in?: number;\n\t\t\t};\n\t\t};\n\t\terrors?: Array<{ message: string }>;\n\t};\n\n\tif (tokenData.errors?.length) {\n\t\tthrow new Error(`Token error: ${tokenData.errors.map((e) => e.message).join(\", \")}`);\n\t}\n\n\tconst tokenResult = tokenData.data?.token;\n\tif (tokenResult?.status !== \"OK\" || !tokenResult.access_token) {\n\t\tthrow new Error(`Token failed: ${JSON.stringify(tokenResult)}`);\n\t}\n\n\treturn {\n\t\taccessToken: tokenResult.access_token,\n\t\texpiresIn: tokenResult.expires_in ?? 3600,\n\t};\n}\n\nexport async function readCredentialsFromFile(filePath: string): Promise<AuthCredentials> {\n\tconst fs = await import(\"node:fs/promises\");\n\n\tlogInfo(`Reading credentials from: ${filePath}`);\n\n\tconst content = await fs.readFile(filePath, \"utf-8\");\n\tconst credentials = JSON.parse(content) as AuthCredentials;\n\n\tif (!credentials.clientDecorator || !credentials.variantConfigurationKey) {\n\t\tthrow new Error(\"Invalid credentials file: missing clientDecorator or variantConfigurationKey\");\n\t}\n\n\treturn credentials;\n}\n", "/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n 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(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif (!('FORCE_COLOR' in env)) {\n\t\treturn;\n\t}\n\n\tif (env.FORCE_COLOR === 'true') {\n\t\treturn 1;\n\t}\n\n\tif (env.FORCE_COLOR === 'false') {\n\t\treturn 0;\n\t}\n\n\tif (env.FORCE_COLOR.length === 0) {\n\t\treturn 1;\n\t}\n\n\tconst level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\n\tif (![0, 1, 2, 3].includes(level)) {\n\t\treturn;\n\t}\n\n\treturn level;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-ghostty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'wezterm') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n", "/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n", "/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n", "import createDebug from \"debug\";\nimport type { LogsTypes } from \"../types/log\";\n\nexport function createLoggers(\n\tnamespace: string,\n\tlogLevel: \"info\" | \"debug\" | \"none\" = (process.env.LOG_LEVEL as \"info\" | \"debug\" | \"none\") ??\n\t\t\"none\"\n) {\n\tconst logInfo = createDebug(`${namespace}:info`);\n\tconst logTask = createDebug(`${namespace}:task`);\n\tconst logError = createDebug(`${namespace}:error`);\n\tconst logDetail = createDebug(`${namespace}:detail`);\n\tconst logDebug = createDebug(`${namespace}:debug`);\n\tconst logWarning = createDebug(`${namespace}:warning`);\n\tconst logColor = createDebug(`${namespace}:color`);\n\tlogInfo.color = \"19\"; // Purple\n\tlogTask.color = \"25\"; // Blue\n\tlogError.color = \"1\"; // Red\n\tlogDetail.color = \"199\"; // Pink\n\tlogWarning.color = \"186\"; // Yellow\n\tlogDebug.color = \"211\"; // Pink/Orange\n\n\tlogColor.enabled = true;\n\n\tfunction setNamespace(namespace: string) {\n\t\tlogInfo.namespace = `${namespace}:info`;\n\t\tlogTask.namespace = `${namespace}:task`;\n\t\tlogError.namespace = `${namespace}:error`;\n\t\tlogDetail.namespace = `${namespace}:detail`;\n\t\tlogWarning.namespace = `${namespace}:warning`;\n\t\tlogDebug.namespace = `${namespace}:debug`;\n\t}\n\n\tfunction setLogLevel(level: \"info\" | \"debug\" | \"none\") {\n\t\tswitch (level) {\n\t\t\tcase \"info\":\n\t\t\t\tlogInfo.enabled = true;\n\t\t\t\tlogTask.enabled = true;\n\t\t\t\tlogError.enabled = true;\n\t\t\t\tlogWarning.enabled = true;\n\t\t\t\tlogDetail.enabled = false;\n\t\t\t\tlogDebug.enabled = false;\n\t\t\t\tbreak;\n\t\t\tcase \"debug\":\n\t\t\t\tlogInfo.enabled = true;\n\t\t\t\tlogTask.enabled = true;\n\t\t\t\tlogError.enabled = true;\n\t\t\t\tlogWarning.enabled = true;\n\t\t\t\tlogDetail.enabled = true;\n\t\t\t\tlogDebug.enabled = true;\n\t\t\t\tbreak;\n\t\t\tcase \"none\":\n\t\t\t\tlogInfo.enabled = false;\n\t\t\t\tlogTask.enabled = false;\n\t\t\t\tlogError.enabled = false;\n\t\t\t\tlogWarning.enabled = false;\n\t\t\t\tlogDetail.enabled = false;\n\t\t\t\tlogDebug.enabled = false;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetLogLevel(logLevel);\n\tfunction setColors(type: LogsTypes, color: string) {\n\t\tswitch (type) {\n\t\t\tcase \"info\":\n\t\t\t\tlogInfo.color = color;\n\t\t\t\tbreak;\n\t\t\tcase \"task\":\n\t\t\t\tlogTask.color = color;\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tlogError.color = color;\n\t\t\t\tbreak;\n\t\t\tcase \"detail\":\n\t\t\t\tlogDetail.color = color;\n\t\t\t\tbreak;\n\t\t\tcase \"warning\":\n\t\t\t\tlogWarning.color = color;\n\t\t\t\tbreak;\n\t\t\tcase \"debug\":\n\t\t\t\tlogDebug.color = color;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Invalid log type: ${type}`);\n\t\t}\n\t}\n\n\tfunction printColors() {\n\t\tfor (let i = 0; i < 256; i++) {\n\t\t\tlogColor.color = `${i}`;\n\t\t\tlogColor(`${i}: ${i}`);\n\t\t}\n\t}\n\n\tfunction logDataDetail(data: unknown, prefix = \"# \"): string {\n\t\tif (data === null || data === undefined) {\n\t\t\treturn `${prefix}<null or undefined>`;\n\t\t}\n\t\tif (typeof data !== \"object\") {\n\t\t\treturn `${prefix}${String(data)}`;\n\t\t}\n\t\tconst keys = Object.keys(data);\n\t\tlet result = \"\";\n\t\tfor (const key of keys) {\n\t\t\tresult += `${prefix}${key}: `;\n\t\t\tif (key in data) {\n\t\t\t\tlet dataKey: keyof typeof data = key as keyof typeof data;\n\t\t\t\tif (key in data) {\n\t\t\t\t\tdataKey = key as keyof typeof data;\n\t\t\t\t\tconst value = data[dataKey];\n\t\t\t\t\tif (value === null || value === undefined) {\n\t\t\t\t\t\tresult += `<${value === null ? \"null\" : \"undefined\"}>\n`;\n\t\t\t\t\t} else if (typeof value === \"object\") {\n\t\t\t\t\t\tresult += `\n\t\t\t\t\t${logDataDetail(value, `${prefix} `)}\n`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult += `${value}\n`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result.trim();\n\t}\n\n\tfunction header(title: string, padding = 0) {\n\t\treturn `${\" \".repeat(padding)}${\"=\".repeat(80)}\n${\" \".repeat(40 - title.length / 2)}${title}\n${\" \".repeat(padding)}${\"=\".repeat(80)}`;\n\t}\n\n\tfunction logHeader(title: string) {\n\t\tlogInfo(`${header(title, 2)}`);\n\t}\n\n\tfunction logDataObject(title: string, ...args: Record<string, unknown>[]) {\n\t\tconst stack = new Error().stack?.split(\"\\n\")[2] || \"\";\n\t\tconst stackMatch = stack.match(/\\((.*):(\\d+):(\\d+)\\)$/) || stack.match(/at (.*):(\\d+):(\\d+)$/);\n\t\tlet callerDetails = \"\";\n\t\tif (stackMatch) {\n\t\t\tconst functionMatch = stack.match(/at (.+) \\(/);\n\t\t\tconst functionName = functionMatch ? functionMatch[1] : \"<anonymous>\";\n\t\t\tcallerDetails = `${functionName}`;\n\t\t}\n\t\tlogDetail(`${header(`*${title}* ${callerDetails}`)}\n${args.reduce((acc, arg) => `${acc}\\n${logDataDetail(arg as Record<string, unknown>)}`, \"\")}\n\t\n${\"=\".repeat(80)}`);\n\t}\n\n\tfunction logErrorObject(error: unknown, extraDetails?: string) {\n\t\tif (error instanceof Error) {\n\t\t\tlogError(`${extraDetails ? header(extraDetails, 1) : header(error.message, 1)}\n\t\tError Message:\n\t\t${error.message}\n\t\tError Stack:\n\t\t${error.stack}\n\t\t${\"=\".repeat(80)}`);\n\t\t} else {\n\t\t\tlogError(`${extraDetails ? header(extraDetails, 1) : header(String(error), 1)}\n\t\t${\"=\".repeat(80)}`);\n\t\t}\n\t}\n\n\treturn {\n\t\tlogInfo,\n\t\tlogTask,\n\t\tlogError,\n\t\tlogDetail,\n\t\tlogDebug,\n\t\tlogWarning,\n\t\tlogColor,\n\t\tsetColors,\n\t\tprintColors,\n\t\tlogHeader,\n\t\tlogDataObject,\n\t\tlogErrorObject,\n\t\tsetLogLevel,\n\t\tsetNamespace,\n\t};\n}\n", "export const AUTHORIZE_QUERY = `\n query Authorize($input: AuthorizeInput!) {\n authorize(input: $input) {\n status\n authorization_code\n }\n }\n`;\n\nexport const TOKEN_QUERY = `\n query Token($input: TokenInput!) {\n token(input: $input) {\n status\n access_token\n expires_in\n }\n }\n`;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA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", "__export", "process", "os", "tty", "supportsColor", "__toCommonJS", "useColors", "__toESM", "logInfo", "namespace"]
7
7
  }
package/dist/index.mjs CHANGED
@@ -838,55 +838,172 @@ var require_src = __commonJS({
838
838
  }
839
839
  });
840
840
  var import_debug = __toESM(require_src());
841
- var logInfo = (0, import_debug.default)("info");
842
- var logTask = (0, import_debug.default)("task");
843
- var logError = (0, import_debug.default)("error");
844
- var logDetail = (0, import_debug.default)("detail");
845
- var logDebug = (0, import_debug.default)("debug");
846
- var logWarning = (0, import_debug.default)("warning");
847
- var logColor = (0, import_debug.default)("color");
848
- logInfo.color = "19";
849
- logTask.color = "25";
850
- logError.color = "1";
851
- logDetail.color = "199";
852
- logWarning.color = "186";
853
- logDebug.color = "211";
854
- logColor.enabled = true;
855
- function logNamespace(namespace) {
856
- logInfo.namespace = `${namespace}:info`;
857
- logTask.namespace = `${namespace}:task`;
858
- logError.namespace = `${namespace}:error`;
859
- logDetail.namespace = `${namespace}:detail`;
860
- logWarning.namespace = `${namespace}:warning`;
861
- logDebug.namespace = `${namespace}:debug`;
862
- }
863
- function setLogLevel(level) {
864
- switch (level) {
865
- case "info":
866
- logInfo.enabled = true;
867
- logTask.enabled = true;
868
- logError.enabled = true;
869
- logWarning.enabled = true;
870
- logDetail.enabled = false;
871
- logDebug.enabled = false;
872
- break;
873
- case "debug":
874
- logInfo.enabled = true;
875
- logTask.enabled = true;
876
- logError.enabled = true;
877
- logWarning.enabled = true;
878
- logDetail.enabled = true;
879
- logDebug.enabled = true;
880
- break;
881
- case "none":
882
- logInfo.enabled = false;
883
- logTask.enabled = false;
884
- logError.enabled = false;
885
- logWarning.enabled = false;
886
- logDetail.enabled = false;
887
- logDebug.enabled = false;
888
- break;
841
+ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
842
+ const logInfo2 = (0, import_debug.default)(`${namespace}:info`);
843
+ const logTask = (0, import_debug.default)(`${namespace}:task`);
844
+ const logError = (0, import_debug.default)(`${namespace}:error`);
845
+ const logDetail = (0, import_debug.default)(`${namespace}:detail`);
846
+ const logDebug = (0, import_debug.default)(`${namespace}:debug`);
847
+ const logWarning = (0, import_debug.default)(`${namespace}:warning`);
848
+ const logColor = (0, import_debug.default)(`${namespace}:color`);
849
+ logInfo2.color = "19";
850
+ logTask.color = "25";
851
+ logError.color = "1";
852
+ logDetail.color = "199";
853
+ logWarning.color = "186";
854
+ logDebug.color = "211";
855
+ logColor.enabled = true;
856
+ function setNamespace(namespace2) {
857
+ logInfo2.namespace = `${namespace2}:info`;
858
+ logTask.namespace = `${namespace2}:task`;
859
+ logError.namespace = `${namespace2}:error`;
860
+ logDetail.namespace = `${namespace2}:detail`;
861
+ logWarning.namespace = `${namespace2}:warning`;
862
+ logDebug.namespace = `${namespace2}:debug`;
863
+ }
864
+ function setLogLevel(level) {
865
+ switch (level) {
866
+ case "info":
867
+ logInfo2.enabled = true;
868
+ logTask.enabled = true;
869
+ logError.enabled = true;
870
+ logWarning.enabled = true;
871
+ logDetail.enabled = false;
872
+ logDebug.enabled = false;
873
+ break;
874
+ case "debug":
875
+ logInfo2.enabled = true;
876
+ logTask.enabled = true;
877
+ logError.enabled = true;
878
+ logWarning.enabled = true;
879
+ logDetail.enabled = true;
880
+ logDebug.enabled = true;
881
+ break;
882
+ case "none":
883
+ logInfo2.enabled = false;
884
+ logTask.enabled = false;
885
+ logError.enabled = false;
886
+ logWarning.enabled = false;
887
+ logDetail.enabled = false;
888
+ logDebug.enabled = false;
889
+ break;
890
+ }
891
+ }
892
+ setLogLevel(logLevel);
893
+ function setColors(type, color) {
894
+ switch (type) {
895
+ case "info":
896
+ logInfo2.color = color;
897
+ break;
898
+ case "task":
899
+ logTask.color = color;
900
+ break;
901
+ case "error":
902
+ logError.color = color;
903
+ break;
904
+ case "detail":
905
+ logDetail.color = color;
906
+ break;
907
+ case "warning":
908
+ logWarning.color = color;
909
+ break;
910
+ case "debug":
911
+ logDebug.color = color;
912
+ break;
913
+ default:
914
+ throw new Error(`Invalid log type: ${type}`);
915
+ }
916
+ }
917
+ function printColors() {
918
+ for (let i = 0; i < 256; i++) {
919
+ logColor.color = `${i}`;
920
+ logColor(`${i}: ${i}`);
921
+ }
889
922
  }
923
+ function logDataDetail(data, prefix = "# ") {
924
+ if (data === null || data === void 0) {
925
+ return `${prefix}<null or undefined>`;
926
+ }
927
+ if (typeof data !== "object") {
928
+ return `${prefix}${String(data)}`;
929
+ }
930
+ const keys = Object.keys(data);
931
+ let result = "";
932
+ for (const key of keys) {
933
+ result += `${prefix}${key}: `;
934
+ if (key in data) {
935
+ let dataKey = key;
936
+ if (key in data) {
937
+ dataKey = key;
938
+ const value = data[dataKey];
939
+ if (value === null || value === void 0) {
940
+ result += `<${value === null ? "null" : "undefined"}>
941
+ `;
942
+ } else if (typeof value === "object") {
943
+ result += `
944
+ ${logDataDetail(value, `${prefix} `)}
945
+ `;
946
+ } else {
947
+ result += `${value}
948
+ `;
949
+ }
950
+ }
951
+ }
952
+ }
953
+ return result.trim();
954
+ }
955
+ function header(title, padding = 0) {
956
+ return `${" ".repeat(padding)}${"=".repeat(80)}
957
+ ${" ".repeat(40 - title.length / 2)}${title}
958
+ ${" ".repeat(padding)}${"=".repeat(80)}`;
959
+ }
960
+ function logHeader(title) {
961
+ logInfo2(`${header(title, 2)}`);
962
+ }
963
+ function logDataObject(title, ...args) {
964
+ const stack = new Error().stack?.split("\n")[2] || "";
965
+ const stackMatch = stack.match(/\((.*):(\d+):(\d+)\)$/) || stack.match(/at (.*):(\d+):(\d+)$/);
966
+ let callerDetails = "";
967
+ if (stackMatch) {
968
+ const functionMatch = stack.match(/at (.+) \(/);
969
+ const functionName = functionMatch ? functionMatch[1] : "<anonymous>";
970
+ callerDetails = `${functionName}`;
971
+ }
972
+ logDetail(`${header(`*${title}* ${callerDetails}`)}
973
+ ${args.reduce((acc, arg) => `${acc}
974
+ ${logDataDetail(arg)}`, "")}
975
+
976
+ ${"=".repeat(80)}`);
977
+ }
978
+ function logErrorObject(error, extraDetails) {
979
+ if (error instanceof Error) {
980
+ logError(`${extraDetails ? header(extraDetails, 1) : header(error.message, 1)}
981
+ Error Message:
982
+ ${error.message}
983
+ Error Stack:
984
+ ${error.stack}
985
+ ${"=".repeat(80)}`);
986
+ } else {
987
+ logError(`${extraDetails ? header(extraDetails, 1) : header(String(error), 1)}
988
+ ${"=".repeat(80)}`);
989
+ }
990
+ }
991
+ return {
992
+ logInfo: logInfo2,
993
+ logTask,
994
+ logError,
995
+ logDetail,
996
+ logDebug,
997
+ logWarning,
998
+ logColor,
999
+ setColors,
1000
+ printColors,
1001
+ logHeader,
1002
+ logDataObject,
1003
+ logErrorObject,
1004
+ setLogLevel,
1005
+ setNamespace
1006
+ };
890
1007
  }
891
1008
 
892
1009
  // src/graphql/queries.ts
@@ -909,8 +1026,7 @@ var TOKEN_QUERY = `
909
1026
  `;
910
1027
 
911
1028
  // src/logic/authClient.ts
912
- setLogLevel(process.env.LOG_LEVEL ?? "none");
913
- logNamespace("auth");
1029
+ var { logInfo } = createLoggers("auth");
914
1030
  var random = promisify(randomBytes);
915
1031
  async function getAuthToken(credentials, apiUrl) {
916
1032
  const authApiUrl = apiUrl || process.env.AUTH_API_URL;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/logic/authClient.ts", "../../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js", "../../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/common.js", "../../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/browser.js", "../../../node_modules/.pnpm/supports-color@10.2.2/node_modules/supports-color/index.js", "../../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/node.js", "../../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/index.js", "../../tool-debug/src/debug.ts", "../src/graphql/queries.ts"],
4
- "sourcesContent": ["/**\n * Auth client for fetching MCE API tokens\n */\n\nimport { createHash, randomBytes } from \"node:crypto\";\nimport { promisify } from \"node:util\";\nimport { logInfo, logNamespace, setLogLevel } from \"@mcesystems/tool-debug-g4\";\nimport { AUTHORIZE_QUERY, TOKEN_QUERY } from \"../graphql/queries\";\nimport type { AuthCredentials, TokenResponse } from \"../types/auth\";\n\nsetLogLevel((process.env.LOG_LEVEL as \"info\" | \"debug\" | \"none\") ?? \"none\");\nlogNamespace(\"auth\");\n\nconst random = promisify(randomBytes);\n\nexport async function getAuthToken(\n\tcredentials: AuthCredentials,\n\tapiUrl?: string\n): Promise<TokenResponse> {\n\tconst authApiUrl = apiUrl || process.env.AUTH_API_URL;\n\tif (!authApiUrl) {\n\t\tthrow new Error(\"AUTH_API_URL is required. Set it in your env or pass apiUrl.\");\n\t}\n\tconst { clientDecorator, variantConfigurationKey } = credentials;\n\tconst frameworkId = credentials.frameworkId || `apple-kit-${Date.now()}`;\n\n\tlogInfo(`Getting auth token for identifiers: ${variantConfigurationKey}`);\n\n\tconst randomSecret = (await random(8)).toString(\"hex\");\n\tconst timestamp = new Date().toISOString();\n\tconst hash = createHash(\"sha256\");\n\thash.update(\n\t\t`${variantConfigurationKey}${frameworkId}${timestamp}${clientDecorator}${randomSecret}`\n\t);\n\tconst codeChallenge = hash.digest(\"hex\");\n\n\tconst authorizeResponse = await fetch(authApiUrl, {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tquery: AUTHORIZE_QUERY,\n\t\t\tvariables: {\n\t\t\t\tinput: {\n\t\t\t\t\tidentifiers: variantConfigurationKey,\n\t\t\t\t\tframework_id: frameworkId,\n\t\t\t\t\ttimestamp,\n\t\t\t\t\tcode_challenge: codeChallenge,\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t});\n\n\tif (!authorizeResponse.ok) {\n\t\tthrow new Error(\n\t\t\t`Authorize request failed: ${authorizeResponse.status} ${authorizeResponse.statusText}`\n\t\t);\n\t}\n\n\tconst authorizeData = (await authorizeResponse.json()) as {\n\t\tdata?: {\n\t\t\tauthorize?: {\n\t\t\t\tstatus: string;\n\t\t\t\tauthorization_code?: string;\n\t\t\t};\n\t\t};\n\t\terrors?: Array<{ message: string }>;\n\t};\n\n\tif (authorizeData.errors?.length) {\n\t\tthrow new Error(`Authorize error: ${authorizeData.errors.map((e) => e.message).join(\", \")}`);\n\t}\n\n\tconst authorizeResult = authorizeData.data?.authorize;\n\tif (authorizeResult?.status !== \"OK\" || !authorizeResult.authorization_code) {\n\t\tthrow new Error(`Authorize failed: ${JSON.stringify(authorizeResult)}`);\n\t}\n\n\tconst tokenResponse = await fetch(authApiUrl, {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tquery: TOKEN_QUERY,\n\t\t\tvariables: {\n\t\t\t\tinput: {\n\t\t\t\t\tauthorization_code: authorizeResult.authorization_code,\n\t\t\t\t\tcode_verifier: randomSecret,\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t});\n\n\tif (!tokenResponse.ok) {\n\t\tthrow new Error(`Token request failed: ${tokenResponse.status} ${tokenResponse.statusText}`);\n\t}\n\n\tconst tokenData = (await tokenResponse.json()) as {\n\t\tdata?: {\n\t\t\ttoken?: {\n\t\t\t\tstatus: string;\n\t\t\t\taccess_token?: string;\n\t\t\t\texpires_in?: number;\n\t\t\t};\n\t\t};\n\t\terrors?: Array<{ message: string }>;\n\t};\n\n\tif (tokenData.errors?.length) {\n\t\tthrow new Error(`Token error: ${tokenData.errors.map((e) => e.message).join(\", \")}`);\n\t}\n\n\tconst tokenResult = tokenData.data?.token;\n\tif (tokenResult?.status !== \"OK\" || !tokenResult.access_token) {\n\t\tthrow new Error(`Token failed: ${JSON.stringify(tokenResult)}`);\n\t}\n\n\treturn {\n\t\taccessToken: tokenResult.access_token,\n\t\texpiresIn: tokenResult.expires_in ?? 3600,\n\t};\n}\n\nexport async function readCredentialsFromFile(filePath: string): Promise<AuthCredentials> {\n\tconst fs = await import(\"node:fs/promises\");\n\n\tlogInfo(`Reading credentials from: ${filePath}`);\n\n\tconst content = await fs.readFile(filePath, \"utf-8\");\n\tconst credentials = JSON.parse(content) as AuthCredentials;\n\n\tif (!credentials.clientDecorator || !credentials.variantConfigurationKey) {\n\t\tthrow new Error(\"Invalid credentials file: missing clientDecorator or variantConfigurationKey\");\n\t}\n\n\treturn credentials;\n}\n", "/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n 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(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif (!('FORCE_COLOR' in env)) {\n\t\treturn;\n\t}\n\n\tif (env.FORCE_COLOR === 'true') {\n\t\treturn 1;\n\t}\n\n\tif (env.FORCE_COLOR === 'false') {\n\t\treturn 0;\n\t}\n\n\tif (env.FORCE_COLOR.length === 0) {\n\t\treturn 1;\n\t}\n\n\tconst level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\n\tif (![0, 1, 2, 3].includes(level)) {\n\t\treturn;\n\t}\n\n\treturn level;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-ghostty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'wezterm') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n", "/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n", "/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n", "import createDebug from \"debug\";\nimport type { LogsTypes } from \"../types/log\";\n\nexport const logInfo = createDebug(\"info\");\nexport const logTask = createDebug(\"task\");\nexport const logError = createDebug(\"error\");\nexport const logDetail = createDebug(\"detail\");\nexport const logDebug = createDebug(\"debug\");\nexport const logWarning = createDebug(\"warning\");\nconst logColor = createDebug(\"color\");\nlogInfo.color = \"19\"; // Purple\nlogTask.color = \"25\"; // Blue\nlogError.color = \"1\"; // Red\nlogDetail.color = \"199\"; // Pink\nlogWarning.color = \"186\"; // Yellow\nlogDebug.color = \"211\"; // Pink/Orange\n\nlogColor.enabled = true;\n\nexport function logNamespace(namespace: string) {\n\tlogInfo.namespace = `${namespace}:info`;\n\tlogTask.namespace = `${namespace}:task`;\n\tlogError.namespace = `${namespace}:error`;\n\tlogDetail.namespace = `${namespace}:detail`;\n\tlogWarning.namespace = `${namespace}:warning`;\n\tlogDebug.namespace = `${namespace}:debug`;\n}\n\nexport function setLogLevel(level: \"info\" | \"debug\" | \"none\") {\n\tswitch (level) {\n\t\tcase \"info\":\n\t\t\tlogInfo.enabled = true;\n\t\t\tlogTask.enabled = true;\n\t\t\tlogError.enabled = true;\n\t\t\tlogWarning.enabled = true;\n\t\t\tlogDetail.enabled = false;\n\t\t\tlogDebug.enabled = false;\n\t\t\tbreak;\n\t\tcase \"debug\":\n\t\t\tlogInfo.enabled = true;\n\t\t\tlogTask.enabled = true;\n\t\t\tlogError.enabled = true;\n\t\t\tlogWarning.enabled = true;\n\t\t\tlogDetail.enabled = true;\n\t\t\tlogDebug.enabled = true;\n\t\t\tbreak;\n\t\tcase \"none\":\n\t\t\tlogInfo.enabled = false;\n\t\t\tlogTask.enabled = false;\n\t\t\tlogError.enabled = false;\n\t\t\tlogWarning.enabled = false;\n\t\t\tlogDetail.enabled = false;\n\t\t\tlogDebug.enabled = false;\n\t\t\tbreak;\n\t}\n}\n\nexport function setColors(type: LogsTypes, color: string) {\n\tswitch (type) {\n\t\tcase \"info\":\n\t\t\tlogInfo.color = color;\n\t\t\tbreak;\n\t\tcase \"task\":\n\t\t\tlogTask.color = color;\n\t\t\tbreak;\n\t\tcase \"error\":\n\t\t\tlogError.color = color;\n\t\t\tbreak;\n\t\tcase \"detail\":\n\t\t\tlogDetail.color = color;\n\t\t\tbreak;\n\t\tcase \"warning\":\n\t\t\tlogWarning.color = color;\n\t\t\tbreak;\n\t\tcase \"debug\":\n\t\t\tlogDebug.color = color;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new Error(`Invalid log type: ${type}`);\n\t}\n}\n\nexport function printColors() {\n\tfor (let i = 0; i < 256; i++) {\n\t\tlogColor.color = `${i}`;\n\t\tlogColor(`${i}: ${i}`);\n\t}\n}\n\nfunction logDataDetail(data: unknown, prefix = \"# \"): string {\n\tif (data === null || data === undefined) {\n\t\treturn `${prefix}<null or undefined>`;\n\t}\n\tif (typeof data !== \"object\") {\n\t\treturn `${prefix}${String(data)}`;\n\t}\n\tconst keys = Object.keys(data);\n\tlet result = \"\";\n\tfor (const key of keys) {\n\t\tresult += `${prefix}${key}: `;\n\t\tif (key in data) {\n\t\t\tlet dataKey: keyof typeof data = key as keyof typeof data;\n\t\t\tif (key in data) {\n\t\t\t\tdataKey = key as keyof typeof data;\n\t\t\t\tconst value = data[dataKey];\n\t\t\t\tif (value === null || value === undefined) {\n\t\t\t\t\tresult += `<${value === null ? \"null\" : \"undefined\"}>\n`;\n\t\t\t\t} else if (typeof value === \"object\") {\n\t\t\t\t\tresult += `\n${logDataDetail(value, `${prefix} `)}\n`;\n\t\t\t\t} else {\n\t\t\t\t\tresult += `${value}\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn result.trim();\n}\n\nfunction header(title: string, padding = 0) {\n\treturn `${\" \".repeat(padding)}${\"=\".repeat(80)}\n${\" \".repeat(40 - title.length / 2)}${title}\n${\" \".repeat(padding)}${\"=\".repeat(80)}`;\n}\n\nexport function logHeader(title: string) {\n\tlogInfo(`${header(title, 2)}`);\n}\n\nexport function logDataObject(title: string, ...args: Record<string, unknown>[]) {\n\tconst stack = new Error().stack?.split(\"\\n\")[2] || \"\";\n\tconst stackMatch = stack.match(/\\((.*):(\\d+):(\\d+)\\)$/) || stack.match(/at (.*):(\\d+):(\\d+)$/);\n\tlet callerDetails = \"\";\n\tif (stackMatch) {\n\t\tconst functionMatch = stack.match(/at (.+) \\(/);\n\t\tconst functionName = functionMatch ? functionMatch[1] : \"<anonymous>\";\n\t\tcallerDetails = `${functionName}`;\n\t}\n\tlogDetail(`${header(`*${title}* ${callerDetails}`)}\n${args.reduce((acc, arg) => `${acc}\\n${logDataDetail(arg as Record<string, unknown>)}`, \"\")}\n\n${\"=\".repeat(80)}`);\n}\n\nexport function logErrorObject(error: unknown, extraDetails?: string) {\n\tif (error instanceof Error) {\n\t\tlogError(`${extraDetails ? header(extraDetails, 1) : header(error.message, 1)}\n Error Message:\n ${error.message}\n Error Stack:\n ${error.stack}\n ${\"=\".repeat(80)}`);\n\t} else {\n\t\tlogError(`${extraDetails ? header(extraDetails, 1) : header(String(error), 1)}\n ${\"=\".repeat(80)}`);\n\t}\n}\n", "export const AUTHORIZE_QUERY = `\n query Authorize($input: AuthorizeInput!) {\n authorize(input: $input) {\n status\n authorization_code\n }\n }\n`;\n\nexport const TOKEN_QUERY = `\n query Token($input: TokenInput!) {\n token(input: $input) {\n status\n access_token\n expires_in\n }\n }\n`;\n"],
5
- "mappings": ";;;;;;;;AAIA,SAAS,YAAY,mBAAmB;AACxC,SAAS,iBAAiB;;;AIL1B,OAAOA,cAAa;AACpB,OAAO,QAAQ;AACf,OAAO,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AHFhB,IAAA,aAAA,WAAA;EAAA,6DAAA,SAAA,QAAA;AAIA,QAAI,IAAI;AACR,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AAgBZ,WAAO,UAAU,SAAU,KAAK,SAAS;AACvC,gBAAU,WAAW,CAAC;AACtB,UAAI,OAAO,OAAO;AAClB,UAAI,SAAS,YAAY,IAAI,SAAS,GAAG;AACvC,eAAO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AAM,OAAO,kBAAkB;AAE1C,UAAQ,6BAA6B,QAAQ,EAAE;AAE/C,QAAM,UAAU,MAAM,GAAG,SAAS,UAAU,OAAO;AACnD,QAAM,cAAc,KAAK,MAAM,OAAO;AAEtC,MAAI,CAAC,YAAY,mBAAmB,CAAC,YAAY,yBAAyB;AACzE,UAAM,IAAI,MAAM,8EAA8E;AAAA,EAC/F;AAEA,SAAO;AACR;",
6
- "names": ["process", "env", "createDebug", "process", "tty", "__require", "supportsColor", "useColors"]
4
+ "sourcesContent": ["/**\n * Auth client for fetching MCE API tokens\n */\n\nimport { createHash, randomBytes } from \"node:crypto\";\nimport { promisify } from \"node:util\";\nimport { createLoggers } from \"@mcesystems/tool-debug-g4\";\nimport { AUTHORIZE_QUERY, TOKEN_QUERY } from \"../graphql/queries\";\nimport type { AuthCredentials, TokenResponse } from \"../types/auth\";\n\nconst { logInfo } = createLoggers(\"auth\");\n\nconst random = promisify(randomBytes);\n\nexport async function getAuthToken(\n\tcredentials: AuthCredentials,\n\tapiUrl?: string\n): Promise<TokenResponse> {\n\tconst authApiUrl = apiUrl || process.env.AUTH_API_URL;\n\tif (!authApiUrl) {\n\t\tthrow new Error(\"AUTH_API_URL is required. Set it in your env or pass apiUrl.\");\n\t}\n\tconst { clientDecorator, variantConfigurationKey } = credentials;\n\tconst frameworkId = credentials.frameworkId || `apple-kit-${Date.now()}`;\n\n\tlogInfo(`Getting auth token for identifiers: ${variantConfigurationKey}`);\n\n\tconst randomSecret = (await random(8)).toString(\"hex\");\n\tconst timestamp = new Date().toISOString();\n\tconst hash = createHash(\"sha256\");\n\thash.update(\n\t\t`${variantConfigurationKey}${frameworkId}${timestamp}${clientDecorator}${randomSecret}`\n\t);\n\tconst codeChallenge = hash.digest(\"hex\");\n\n\tconst authorizeResponse = await fetch(authApiUrl, {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tquery: AUTHORIZE_QUERY,\n\t\t\tvariables: {\n\t\t\t\tinput: {\n\t\t\t\t\tidentifiers: variantConfigurationKey,\n\t\t\t\t\tframework_id: frameworkId,\n\t\t\t\t\ttimestamp,\n\t\t\t\t\tcode_challenge: codeChallenge,\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t});\n\n\tif (!authorizeResponse.ok) {\n\t\tthrow new Error(\n\t\t\t`Authorize request failed: ${authorizeResponse.status} ${authorizeResponse.statusText}`\n\t\t);\n\t}\n\n\tconst authorizeData = (await authorizeResponse.json()) as {\n\t\tdata?: {\n\t\t\tauthorize?: {\n\t\t\t\tstatus: string;\n\t\t\t\tauthorization_code?: string;\n\t\t\t};\n\t\t};\n\t\terrors?: Array<{ message: string }>;\n\t};\n\n\tif (authorizeData.errors?.length) {\n\t\tthrow new Error(`Authorize error: ${authorizeData.errors.map((e) => e.message).join(\", \")}`);\n\t}\n\n\tconst authorizeResult = authorizeData.data?.authorize;\n\tif (authorizeResult?.status !== \"OK\" || !authorizeResult.authorization_code) {\n\t\tthrow new Error(`Authorize failed: ${JSON.stringify(authorizeResult)}`);\n\t}\n\n\tconst tokenResponse = await fetch(authApiUrl, {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tquery: TOKEN_QUERY,\n\t\t\tvariables: {\n\t\t\t\tinput: {\n\t\t\t\t\tauthorization_code: authorizeResult.authorization_code,\n\t\t\t\t\tcode_verifier: randomSecret,\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t});\n\n\tif (!tokenResponse.ok) {\n\t\tthrow new Error(`Token request failed: ${tokenResponse.status} ${tokenResponse.statusText}`);\n\t}\n\n\tconst tokenData = (await tokenResponse.json()) as {\n\t\tdata?: {\n\t\t\ttoken?: {\n\t\t\t\tstatus: string;\n\t\t\t\taccess_token?: string;\n\t\t\t\texpires_in?: number;\n\t\t\t};\n\t\t};\n\t\terrors?: Array<{ message: string }>;\n\t};\n\n\tif (tokenData.errors?.length) {\n\t\tthrow new Error(`Token error: ${tokenData.errors.map((e) => e.message).join(\", \")}`);\n\t}\n\n\tconst tokenResult = tokenData.data?.token;\n\tif (tokenResult?.status !== \"OK\" || !tokenResult.access_token) {\n\t\tthrow new Error(`Token failed: ${JSON.stringify(tokenResult)}`);\n\t}\n\n\treturn {\n\t\taccessToken: tokenResult.access_token,\n\t\texpiresIn: tokenResult.expires_in ?? 3600,\n\t};\n}\n\nexport async function readCredentialsFromFile(filePath: string): Promise<AuthCredentials> {\n\tconst fs = await import(\"node:fs/promises\");\n\n\tlogInfo(`Reading credentials from: ${filePath}`);\n\n\tconst content = await fs.readFile(filePath, \"utf-8\");\n\tconst credentials = JSON.parse(content) as AuthCredentials;\n\n\tif (!credentials.clientDecorator || !credentials.variantConfigurationKey) {\n\t\tthrow new Error(\"Invalid credentials file: missing clientDecorator or variantConfigurationKey\");\n\t}\n\n\treturn credentials;\n}\n", "/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n 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(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif (!('FORCE_COLOR' in env)) {\n\t\treturn;\n\t}\n\n\tif (env.FORCE_COLOR === 'true') {\n\t\treturn 1;\n\t}\n\n\tif (env.FORCE_COLOR === 'false') {\n\t\treturn 0;\n\t}\n\n\tif (env.FORCE_COLOR.length === 0) {\n\t\treturn 1;\n\t}\n\n\tconst level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\n\tif (![0, 1, 2, 3].includes(level)) {\n\t\treturn;\n\t}\n\n\treturn level;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-ghostty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'wezterm') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n", "/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n", "/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n", "import createDebug from \"debug\";\nimport type { LogsTypes } from \"../types/log\";\n\nexport function createLoggers(\n\tnamespace: string,\n\tlogLevel: \"info\" | \"debug\" | \"none\" = (process.env.LOG_LEVEL as \"info\" | \"debug\" | \"none\") ??\n\t\t\"none\"\n) {\n\tconst logInfo = createDebug(`${namespace}:info`);\n\tconst logTask = createDebug(`${namespace}:task`);\n\tconst logError = createDebug(`${namespace}:error`);\n\tconst logDetail = createDebug(`${namespace}:detail`);\n\tconst logDebug = createDebug(`${namespace}:debug`);\n\tconst logWarning = createDebug(`${namespace}:warning`);\n\tconst logColor = createDebug(`${namespace}:color`);\n\tlogInfo.color = \"19\"; // Purple\n\tlogTask.color = \"25\"; // Blue\n\tlogError.color = \"1\"; // Red\n\tlogDetail.color = \"199\"; // Pink\n\tlogWarning.color = \"186\"; // Yellow\n\tlogDebug.color = \"211\"; // Pink/Orange\n\n\tlogColor.enabled = true;\n\n\tfunction setNamespace(namespace: string) {\n\t\tlogInfo.namespace = `${namespace}:info`;\n\t\tlogTask.namespace = `${namespace}:task`;\n\t\tlogError.namespace = `${namespace}:error`;\n\t\tlogDetail.namespace = `${namespace}:detail`;\n\t\tlogWarning.namespace = `${namespace}:warning`;\n\t\tlogDebug.namespace = `${namespace}:debug`;\n\t}\n\n\tfunction setLogLevel(level: \"info\" | \"debug\" | \"none\") {\n\t\tswitch (level) {\n\t\t\tcase \"info\":\n\t\t\t\tlogInfo.enabled = true;\n\t\t\t\tlogTask.enabled = true;\n\t\t\t\tlogError.enabled = true;\n\t\t\t\tlogWarning.enabled = true;\n\t\t\t\tlogDetail.enabled = false;\n\t\t\t\tlogDebug.enabled = false;\n\t\t\t\tbreak;\n\t\t\tcase \"debug\":\n\t\t\t\tlogInfo.enabled = true;\n\t\t\t\tlogTask.enabled = true;\n\t\t\t\tlogError.enabled = true;\n\t\t\t\tlogWarning.enabled = true;\n\t\t\t\tlogDetail.enabled = true;\n\t\t\t\tlogDebug.enabled = true;\n\t\t\t\tbreak;\n\t\t\tcase \"none\":\n\t\t\t\tlogInfo.enabled = false;\n\t\t\t\tlogTask.enabled = false;\n\t\t\t\tlogError.enabled = false;\n\t\t\t\tlogWarning.enabled = false;\n\t\t\t\tlogDetail.enabled = false;\n\t\t\t\tlogDebug.enabled = false;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetLogLevel(logLevel);\n\tfunction setColors(type: LogsTypes, color: string) {\n\t\tswitch (type) {\n\t\t\tcase \"info\":\n\t\t\t\tlogInfo.color = color;\n\t\t\t\tbreak;\n\t\t\tcase \"task\":\n\t\t\t\tlogTask.color = color;\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tlogError.color = color;\n\t\t\t\tbreak;\n\t\t\tcase \"detail\":\n\t\t\t\tlogDetail.color = color;\n\t\t\t\tbreak;\n\t\t\tcase \"warning\":\n\t\t\t\tlogWarning.color = color;\n\t\t\t\tbreak;\n\t\t\tcase \"debug\":\n\t\t\t\tlogDebug.color = color;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Invalid log type: ${type}`);\n\t\t}\n\t}\n\n\tfunction printColors() {\n\t\tfor (let i = 0; i < 256; i++) {\n\t\t\tlogColor.color = `${i}`;\n\t\t\tlogColor(`${i}: ${i}`);\n\t\t}\n\t}\n\n\tfunction logDataDetail(data: unknown, prefix = \"# \"): string {\n\t\tif (data === null || data === undefined) {\n\t\t\treturn `${prefix}<null or undefined>`;\n\t\t}\n\t\tif (typeof data !== \"object\") {\n\t\t\treturn `${prefix}${String(data)}`;\n\t\t}\n\t\tconst keys = Object.keys(data);\n\t\tlet result = \"\";\n\t\tfor (const key of keys) {\n\t\t\tresult += `${prefix}${key}: `;\n\t\t\tif (key in data) {\n\t\t\t\tlet dataKey: keyof typeof data = key as keyof typeof data;\n\t\t\t\tif (key in data) {\n\t\t\t\t\tdataKey = key as keyof typeof data;\n\t\t\t\t\tconst value = data[dataKey];\n\t\t\t\t\tif (value === null || value === undefined) {\n\t\t\t\t\t\tresult += `<${value === null ? \"null\" : \"undefined\"}>\n`;\n\t\t\t\t\t} else if (typeof value === \"object\") {\n\t\t\t\t\t\tresult += `\n\t\t\t\t\t${logDataDetail(value, `${prefix} `)}\n`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult += `${value}\n`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result.trim();\n\t}\n\n\tfunction header(title: string, padding = 0) {\n\t\treturn `${\" \".repeat(padding)}${\"=\".repeat(80)}\n${\" \".repeat(40 - title.length / 2)}${title}\n${\" \".repeat(padding)}${\"=\".repeat(80)}`;\n\t}\n\n\tfunction logHeader(title: string) {\n\t\tlogInfo(`${header(title, 2)}`);\n\t}\n\n\tfunction logDataObject(title: string, ...args: Record<string, unknown>[]) {\n\t\tconst stack = new Error().stack?.split(\"\\n\")[2] || \"\";\n\t\tconst stackMatch = stack.match(/\\((.*):(\\d+):(\\d+)\\)$/) || stack.match(/at (.*):(\\d+):(\\d+)$/);\n\t\tlet callerDetails = \"\";\n\t\tif (stackMatch) {\n\t\t\tconst functionMatch = stack.match(/at (.+) \\(/);\n\t\t\tconst functionName = functionMatch ? functionMatch[1] : \"<anonymous>\";\n\t\t\tcallerDetails = `${functionName}`;\n\t\t}\n\t\tlogDetail(`${header(`*${title}* ${callerDetails}`)}\n${args.reduce((acc, arg) => `${acc}\\n${logDataDetail(arg as Record<string, unknown>)}`, \"\")}\n\t\n${\"=\".repeat(80)}`);\n\t}\n\n\tfunction logErrorObject(error: unknown, extraDetails?: string) {\n\t\tif (error instanceof Error) {\n\t\t\tlogError(`${extraDetails ? header(extraDetails, 1) : header(error.message, 1)}\n\t\tError Message:\n\t\t${error.message}\n\t\tError Stack:\n\t\t${error.stack}\n\t\t${\"=\".repeat(80)}`);\n\t\t} else {\n\t\t\tlogError(`${extraDetails ? header(extraDetails, 1) : header(String(error), 1)}\n\t\t${\"=\".repeat(80)}`);\n\t\t}\n\t}\n\n\treturn {\n\t\tlogInfo,\n\t\tlogTask,\n\t\tlogError,\n\t\tlogDetail,\n\t\tlogDebug,\n\t\tlogWarning,\n\t\tlogColor,\n\t\tsetColors,\n\t\tprintColors,\n\t\tlogHeader,\n\t\tlogDataObject,\n\t\tlogErrorObject,\n\t\tsetLogLevel,\n\t\tsetNamespace,\n\t};\n}\n", "export const AUTHORIZE_QUERY = `\n query Authorize($input: AuthorizeInput!) {\n authorize(input: $input) {\n status\n authorization_code\n }\n }\n`;\n\nexport const TOKEN_QUERY = `\n query Token($input: TokenInput!) {\n token(input: $input) {\n status\n access_token\n expires_in\n }\n }\n`;\n"],
5
+ "mappings": ";;;;;;;;AAIA,SAAS,YAAY,mBAAmB;AACxC,SAAS,iBAAiB;;;AIL1B,OAAOA,cAAa;AACpB,OAAO,QAAQ;AACf,OAAO,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AHFhB,IAAA,aAAA,WAAA;EAAA,6DAAA,SAAA,QAAA;AAIA,QAAI,IAAI;AACR,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AAgBZ,WAAO,UAAU,SAAU,KAAK,SAAS;AACvC,gBAAU,WAAW,CAAC;AACtB,UAAI,OAAO,OAAO;AAClB,UAAI,SAAS,YAAY,IAAI,SAAS,GAAG;AACvC,eAAO,MAAM,GAAG;MAClB,WAAW,SAAS,YAAY,SAAS,GAAG,GAAG;AAC7C,eAAO,QAAQ,OAAO,QAAQ,GAAG,IAAI,SAAS,GAAG;MACnD;AACA,YAAM,IAAI;QACR,0DACE,KAAK,UAAU,GAAG;M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AwB,UAA4C;AACzF,QAAM,KAAK,MAAM,OAAO,kBAAkB;AAE1C,UAAQ,6BAA6B,QAAQ,EAAE;AAE/C,QAAM,UAAU,MAAM,GAAG,SAAS,UAAU,OAAO;AACnD,QAAM,cAAc,KAAK,MAAM,OAAO;AAEtC,MAAI,CAAC,YAAY,mBAAmB,CAAC,YAAY,yBAAyB;AACzE,UAAM,IAAI,MAAM,8EAA8E;AAAA,EAC/F;AAEA,SAAO;AACR;",
6
+ "names": ["process", "env", "createDebug", "process", "tty", "__require", "supportsColor", "useColors", "logInfo", "namespace"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"authClient.d.ts","sourceRoot":"","sources":["../../../src/logic/authClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAOpE,wBAAsB,YAAY,CACjC,WAAW,EAAE,eAAe,EAC5B,MAAM,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,aAAa,CAAC,CAyGxB;AAED,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAaxF"}
1
+ {"version":3,"file":"authClient.d.ts","sourceRoot":"","sources":["../../../src/logic/authClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAMpE,wBAAsB,YAAY,CACjC,WAAW,EAAE,eAAe,EAC5B,MAAM,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,aAAa,CAAC,CAyGxB;AAED,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAaxF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcesystems/auth-g4",
3
- "version": "1.0.71",
3
+ "version": "1.0.73",
4
4
  "description": "Authentication toolkit for device management",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "dotenv": "^17.2.3",
30
30
  "tsx": "^4.21.0",
31
- "@mcesystems/tool-debug-g4": "1.0.71"
31
+ "@mcesystems/tool-debug-g4": "1.0.73"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^22.10.2",