CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
bin.cjs92876 linesDownload Raw Back to drizzle-kit
1#!/usr/bin/env node2"use strict";3var __create = Object.create;4var __defProp = Object.defineProperty;5var __getOwnPropDesc = Object.getOwnPropertyDescriptor;6var __getOwnPropNames = Object.getOwnPropertyNames;7var __getProtoOf = Object.getPrototypeOf;8var __hasOwnProp = Object.prototype.hasOwnProperty;9var __esm = (fn, res) => function __init() {10  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;11};12var __commonJS = (cb, mod) => function __require() {13  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;14};15var __export = (target, all) => {16  for (var name in all)17    __defProp(target, name, { get: all[name], enumerable: true });18};19var __copyProps = (to, from, except, desc) => {20  if (from && typeof from === "object" || typeof from === "function") {21    for (let key of __getOwnPropNames(from))22      if (!__hasOwnProp.call(to, key) && key !== except)23        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });24  }25  return to;26};27var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(28  // If the importer is in node compatibility mode or this is not an ESM29  // file that has been converted to a CommonJS file using a Babel-30  // compatible transform (i.e. "__esModule" has not been set), then set31  // "default" to the CommonJS "module.exports" for node compatibility.32  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,33  mod34));35var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);36 37// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/ansi-styles/index.js38function assembleStyles() {39  const codes = /* @__PURE__ */ new Map();40  for (const [groupName, group] of Object.entries(styles)) {41    for (const [styleName, style] of Object.entries(group)) {42      styles[styleName] = {43        open: `\x1B[${style[0]}m`,44        close: `\x1B[${style[1]}m`45      };46      group[styleName] = styles[styleName];47      codes.set(style[0], style[1]);48    }49    Object.defineProperty(styles, groupName, {50      value: group,51      enumerable: false52    });53  }54  Object.defineProperty(styles, "codes", {55    value: codes,56    enumerable: false57  });58  styles.color.close = "\x1B[39m";59  styles.bgColor.close = "\x1B[49m";60  styles.color.ansi = wrapAnsi16();61  styles.color.ansi256 = wrapAnsi256();62  styles.color.ansi16m = wrapAnsi16m();63  styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);64  styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);65  styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);66  Object.defineProperties(styles, {67    rgbToAnsi256: {68      value(red, green, blue) {69        if (red === green && green === blue) {70          if (red < 8) {71            return 16;72          }73          if (red > 248) {74            return 231;75          }76          return Math.round((red - 8) / 247 * 24) + 232;77        }78        return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);79      },80      enumerable: false81    },82    hexToRgb: {83      value(hex) {84        const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));85        if (!matches) {86          return [0, 0, 0];87        }88        let [colorString] = matches;89        if (colorString.length === 3) {90          colorString = [...colorString].map((character) => character + character).join("");91        }92        const integer = Number.parseInt(colorString, 16);93        return [94          /* eslint-disable no-bitwise */95          integer >> 16 & 255,96          integer >> 8 & 255,97          integer & 25598          /* eslint-enable no-bitwise */99        ];100      },101      enumerable: false102    },103    hexToAnsi256: {104      value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),105      enumerable: false106    },107    ansi256ToAnsi: {108      value(code) {109        if (code < 8) {110          return 30 + code;111        }112        if (code < 16) {113          return 90 + (code - 8);114        }115        let red;116        let green;117        let blue;118        if (code >= 232) {119          red = ((code - 232) * 10 + 8) / 255;120          green = red;121          blue = red;122        } else {123          code -= 16;124          const remainder = code % 36;125          red = Math.floor(code / 36) / 5;126          green = Math.floor(remainder / 6) / 5;127          blue = remainder % 6 / 5;128        }129        const value = Math.max(red, green, blue) * 2;130        if (value === 0) {131          return 30;132        }133        let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));134        if (value === 2) {135          result += 60;136        }137        return result;138      },139      enumerable: false140    },141    rgbToAnsi: {142      value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),143      enumerable: false144    },145    hexToAnsi: {146      value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),147      enumerable: false148    }149  });150  return styles;151}152var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default;153var init_ansi_styles = __esm({154  "../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/ansi-styles/index.js"() {155    ANSI_BACKGROUND_OFFSET = 10;156    wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;157    wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;158    wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;159    styles = {160      modifier: {161        reset: [0, 0],162        // 21 isn't widely supported and 22 does the same thing163        bold: [1, 22],164        dim: [2, 22],165        italic: [3, 23],166        underline: [4, 24],167        overline: [53, 55],168        inverse: [7, 27],169        hidden: [8, 28],170        strikethrough: [9, 29]171      },172      color: {173        black: [30, 39],174        red: [31, 39],175        green: [32, 39],176        yellow: [33, 39],177        blue: [34, 39],178        magenta: [35, 39],179        cyan: [36, 39],180        white: [37, 39],181        // Bright color182        blackBright: [90, 39],183        gray: [90, 39],184        // Alias of `blackBright`185        grey: [90, 39],186        // Alias of `blackBright`187        redBright: [91, 39],188        greenBright: [92, 39],189        yellowBright: [93, 39],190        blueBright: [94, 39],191        magentaBright: [95, 39],192        cyanBright: [96, 39],193        whiteBright: [97, 39]194      },195      bgColor: {196        bgBlack: [40, 49],197        bgRed: [41, 49],198        bgGreen: [42, 49],199        bgYellow: [43, 49],200        bgBlue: [44, 49],201        bgMagenta: [45, 49],202        bgCyan: [46, 49],203        bgWhite: [47, 49],204        // Bright color205        bgBlackBright: [100, 49],206        bgGray: [100, 49],207        // Alias of `bgBlackBright`208        bgGrey: [100, 49],209        // Alias of `bgBlackBright`210        bgRedBright: [101, 49],211        bgGreenBright: [102, 49],212        bgYellowBright: [103, 49],213        bgBlueBright: [104, 49],214        bgMagentaBright: [105, 49],215        bgCyanBright: [106, 49],216        bgWhiteBright: [107, 49]217      }218    };219    modifierNames = Object.keys(styles.modifier);220    foregroundColorNames = Object.keys(styles.color);221    backgroundColorNames = Object.keys(styles.bgColor);222    colorNames = [...foregroundColorNames, ...backgroundColorNames];223    ansiStyles = assembleStyles();224    ansi_styles_default = ansiStyles;225  }226});227 228// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/supports-color/index.js229function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {230  const prefix2 = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";231  const position = argv.indexOf(prefix2 + flag);232  const terminatorPosition = argv.indexOf("--");233  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);234}235function envForceColor() {236  if ("FORCE_COLOR" in env) {237    if (env.FORCE_COLOR === "true") {238      return 1;239    }240    if (env.FORCE_COLOR === "false") {241      return 0;242    }243    return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);244  }245}246function translateLevel(level) {247  if (level === 0) {248    return false;249  }250  return {251    level,252    hasBasic: true,253    has256: level >= 2,254    has16m: level >= 3255  };256}257function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {258  const noFlagForceColor = envForceColor();259  if (noFlagForceColor !== void 0) {260    flagForceColor = noFlagForceColor;261  }262  const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;263  if (forceColor === 0) {264    return 0;265  }266  if (sniffFlags) {267    if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {268      return 3;269    }270    if (hasFlag("color=256")) {271      return 2;272    }273  }274  if ("TF_BUILD" in env && "AGENT_NAME" in env) {275    return 1;276  }277  if (haveStream && !streamIsTTY && forceColor === void 0) {278    return 0;279  }280  const min = forceColor || 0;281  if (env.TERM === "dumb") {282    return min;283  }284  if (import_node_process.default.platform === "win32") {285    const osRelease = import_node_os.default.release().split(".");286    if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {287      return Number(osRelease[2]) >= 14931 ? 3 : 2;288    }289    return 1;290  }291  if ("CI" in env) {292    if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {293      return 3;294    }295    if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {296      return 1;297    }298    return min;299  }300  if ("TEAMCITY_VERSION" in env) {301    return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;302  }303  if (env.COLORTERM === "truecolor") {304    return 3;305  }306  if (env.TERM === "xterm-kitty") {307    return 3;308  }309  if ("TERM_PROGRAM" in env) {310    const version3 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);311    switch (env.TERM_PROGRAM) {312      case "iTerm.app": {313        return version3 >= 3 ? 3 : 2;314      }315      case "Apple_Terminal": {316        return 2;317      }318    }319  }320  if (/-256(color)?$/i.test(env.TERM)) {321    return 2;322  }323  if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {324    return 1;325  }326  if ("COLORTERM" in env) {327    return 1;328  }329  return min;330}331function createSupportsColor(stream, options = {}) {332  const level = _supportsColor(stream, {333    streamIsTTY: stream && stream.isTTY,334    ...options335  });336  return translateLevel(level);337}338var import_node_process, import_node_os, import_node_tty, env, flagForceColor, supportsColor, supports_color_default;339var init_supports_color = __esm({340  "../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/supports-color/index.js"() {341    import_node_process = __toESM(require("node:process"), 1);342    import_node_os = __toESM(require("node:os"), 1);343    import_node_tty = __toESM(require("node:tty"), 1);344    ({ env } = import_node_process.default);345    if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {346      flagForceColor = 0;347    } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {348      flagForceColor = 1;349    }350    supportsColor = {351      stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),352      stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })353    };354    supports_color_default = supportsColor;355  }356});357 358// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/utilities.js359function stringReplaceAll(string2, substring, replacer) {360  let index6 = string2.indexOf(substring);361  if (index6 === -1) {362    return string2;363  }364  const substringLength = substring.length;365  let endIndex = 0;366  let returnValue = "";367  do {368    returnValue += string2.slice(endIndex, index6) + substring + replacer;369    endIndex = index6 + substringLength;370    index6 = string2.indexOf(substring, endIndex);371  } while (index6 !== -1);372  returnValue += string2.slice(endIndex);373  return returnValue;374}375function stringEncaseCRLFWithFirstIndex(string2, prefix2, postfix, index6) {376  let endIndex = 0;377  let returnValue = "";378  do {379    const gotCR = string2[index6 - 1] === "\r";380    returnValue += string2.slice(endIndex, gotCR ? index6 - 1 : index6) + prefix2 + (gotCR ? "\r\n" : "\n") + postfix;381    endIndex = index6 + 1;382    index6 = string2.indexOf("\n", endIndex);383  } while (index6 !== -1);384  returnValue += string2.slice(endIndex);385  return returnValue;386}387var init_utilities = __esm({388  "../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/utilities.js"() {389  }390});391 392// ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js393function createChalk(options) {394  return chalkFactory(options);395}396var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr, source_default;397var init_source = __esm({398  "../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js"() {399    init_ansi_styles();400    init_supports_color();401    init_utilities();402    ({ stdout: stdoutColor, stderr: stderrColor } = supports_color_default);403    GENERATOR = Symbol("GENERATOR");404    STYLER = Symbol("STYLER");405    IS_EMPTY = Symbol("IS_EMPTY");406    levelMapping = [407      "ansi",408      "ansi",409      "ansi256",410      "ansi16m"411    ];412    styles2 = /* @__PURE__ */ Object.create(null);413    applyOptions = (object, options = {}) => {414      if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {415        throw new Error("The `level` option should be an integer from 0 to 3");416      }417      const colorLevel = stdoutColor ? stdoutColor.level : 0;418      object.level = options.level === void 0 ? colorLevel : options.level;419    };420    chalkFactory = (options) => {421      const chalk2 = (...strings) => strings.join(" ");422      applyOptions(chalk2, options);423      Object.setPrototypeOf(chalk2, createChalk.prototype);424      return chalk2;425    };426    Object.setPrototypeOf(createChalk.prototype, Function.prototype);427    for (const [styleName, style] of Object.entries(ansi_styles_default)) {428      styles2[styleName] = {429        get() {430          const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);431          Object.defineProperty(this, styleName, { value: builder });432          return builder;433        }434      };435    }436    styles2.visible = {437      get() {438        const builder = createBuilder(this, this[STYLER], true);439        Object.defineProperty(this, "visible", { value: builder });440        return builder;441      }442    };443    getModelAnsi = (model, level, type, ...arguments_) => {444      if (model === "rgb") {445        if (level === "ansi16m") {446          return ansi_styles_default[type].ansi16m(...arguments_);447        }448        if (level === "ansi256") {449          return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));450        }451        return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));452      }453      if (model === "hex") {454        return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));455      }456      return ansi_styles_default[type][model](...arguments_);457    };458    usedModels = ["rgb", "hex", "ansi256"];459    for (const model of usedModels) {460      styles2[model] = {461        get() {462          const { level } = this;463          return function(...arguments_) {464            const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);465            return createBuilder(this, styler, this[IS_EMPTY]);466          };467        }468      };469      const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);470      styles2[bgModel] = {471        get() {472          const { level } = this;473          return function(...arguments_) {474            const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);475            return createBuilder(this, styler, this[IS_EMPTY]);476          };477        }478      };479    }480    proto = Object.defineProperties(() => {481    }, {482      ...styles2,483      level: {484        enumerable: true,485        get() {486          return this[GENERATOR].level;487        },488        set(level) {489          this[GENERATOR].level = level;490        }491      }492    });493    createStyler = (open, close, parent) => {494      let openAll;495      let closeAll;496      if (parent === void 0) {497        openAll = open;498        closeAll = close;499      } else {500        openAll = parent.openAll + open;501        closeAll = close + parent.closeAll;502      }503      return {504        open,505        close,506        openAll,507        closeAll,508        parent509      };510    };511    createBuilder = (self2, _styler, _isEmpty) => {512      const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));513      Object.setPrototypeOf(builder, proto);514      builder[GENERATOR] = self2;515      builder[STYLER] = _styler;516      builder[IS_EMPTY] = _isEmpty;517      return builder;518    };519    applyStyle = (self2, string2) => {520      if (self2.level <= 0 || !string2) {521        return self2[IS_EMPTY] ? "" : string2;522      }523      let styler = self2[STYLER];524      if (styler === void 0) {525        return string2;526      }527      const { openAll, closeAll } = styler;528      if (string2.includes("\x1B")) {529        while (styler !== void 0) {530          string2 = stringReplaceAll(string2, styler.close, styler.open);531          styler = styler.parent;532        }533      }534      const lfIndex = string2.indexOf("\n");535      if (lfIndex !== -1) {536        string2 = stringEncaseCRLFWithFirstIndex(string2, closeAll, openAll, lfIndex);537      }538      return openAll + string2 + closeAll;539    };540    Object.defineProperties(createChalk.prototype, styles2);541    chalk = createChalk();542    chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });543    source_default = chalk;544  }545});546 547// ../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/package.json548var require_package = __commonJS({549  "../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/package.json"(exports2, module2) {550    module2.exports = {551      name: "dotenv",552      version: "16.5.0",553      description: "Loads environment variables from .env file",554      main: "lib/main.js",555      types: "lib/main.d.ts",556      exports: {557        ".": {558          types: "./lib/main.d.ts",559          require: "./lib/main.js",560          default: "./lib/main.js"561        },562        "./config": "./config.js",563        "./config.js": "./config.js",564        "./lib/env-options": "./lib/env-options.js",565        "./lib/env-options.js": "./lib/env-options.js",566        "./lib/cli-options": "./lib/cli-options.js",567        "./lib/cli-options.js": "./lib/cli-options.js",568        "./package.json": "./package.json"569      },570      scripts: {571        "dts-check": "tsc --project tests/types/tsconfig.json",572        lint: "standard",573        pretest: "npm run lint && npm run dts-check",574        test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",575        "test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",576        prerelease: "npm test",577        release: "standard-version"578      },579      repository: {580        type: "git",581        url: "git://github.com/motdotla/dotenv.git"582      },583      homepage: "https://github.com/motdotla/dotenv#readme",584      funding: "https://dotenvx.com",585      keywords: [586        "dotenv",587        "env",588        ".env",589        "environment",590        "variables",591        "config",592        "settings"593      ],594      readmeFilename: "README.md",595      license: "BSD-2-Clause",596      devDependencies: {597        "@types/node": "^18.11.3",598        decache: "^4.6.2",599        sinon: "^14.0.1",600        standard: "^17.0.0",601        "standard-version": "^9.5.0",602        tap: "^19.2.0",603        typescript: "^4.8.4"604      },605      engines: {606        node: ">=12"607      },608      browser: {609        fs: false610      }611    };612  }613});614 615// ../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/main.js616var require_main = __commonJS({617  "../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/main.js"(exports2, module2) {618    var fs7 = require("fs");619    var path4 = require("path");620    var os3 = require("os");621    var crypto7 = require("crypto");622    var packageJson = require_package();623    var version3 = packageJson.version;624    var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;625    function parse4(src) {626      const obj = {};627      let lines = src.toString();628      lines = lines.replace(/\r\n?/mg, "\n");629      let match2;630      while ((match2 = LINE.exec(lines)) != null) {631        const key = match2[1];632        let value = match2[2] || "";633        value = value.trim();634        const maybeQuote = value[0];635        value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");636        if (maybeQuote === '"') {637          value = value.replace(/\\n/g, "\n");638          value = value.replace(/\\r/g, "\r");639        }640        obj[key] = value;641      }642      return obj;643    }644    function _parseVault(options) {645      const vaultPath = _vaultPath(options);646      const result = DotenvModule.configDotenv({ path: vaultPath });647      if (!result.parsed) {648        const err2 = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);649        err2.code = "MISSING_DATA";650        throw err2;651      }652      const keys = _dotenvKey(options).split(",");653      const length = keys.length;654      let decrypted;655      for (let i4 = 0; i4 < length; i4++) {656        try {657          const key = keys[i4].trim();658          const attrs = _instructions(result, key);659          decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);660          break;661        } catch (error2) {662          if (i4 + 1 >= length) {663            throw error2;664          }665        }666      }667      return DotenvModule.parse(decrypted);668    }669    function _warn(message) {670      console.log(`[dotenv@${version3}][WARN] ${message}`);671    }672    function _debug(message) {673      console.log(`[dotenv@${version3}][DEBUG] ${message}`);674    }675    function _dotenvKey(options) {676      if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {677        return options.DOTENV_KEY;678      }679      if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {680        return process.env.DOTENV_KEY;681      }682      return "";683    }684    function _instructions(result, dotenvKey) {685      let uri;686      try {687        uri = new URL(dotenvKey);688      } catch (error2) {689        if (error2.code === "ERR_INVALID_URL") {690          const err2 = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");691          err2.code = "INVALID_DOTENV_KEY";692          throw err2;693        }694        throw error2;695      }696      const key = uri.password;697      if (!key) {698        const err2 = new Error("INVALID_DOTENV_KEY: Missing key part");699        err2.code = "INVALID_DOTENV_KEY";700        throw err2;701      }702      const environment = uri.searchParams.get("environment");703      if (!environment) {704        const err2 = new Error("INVALID_DOTENV_KEY: Missing environment part");705        err2.code = "INVALID_DOTENV_KEY";706        throw err2;707      }708      const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;709      const ciphertext = result.parsed[environmentKey];710      if (!ciphertext) {711        const err2 = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);712        err2.code = "NOT_FOUND_DOTENV_ENVIRONMENT";713        throw err2;714      }715      return { ciphertext, key };716    }717    function _vaultPath(options) {718      let possibleVaultPath = null;719      if (options && options.path && options.path.length > 0) {720        if (Array.isArray(options.path)) {721          for (const filepath of options.path) {722            if (fs7.existsSync(filepath)) {723              possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;724            }725          }726        } else {727          possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;728        }729      } else {730        possibleVaultPath = path4.resolve(process.cwd(), ".env.vault");731      }732      if (fs7.existsSync(possibleVaultPath)) {733        return possibleVaultPath;734      }735      return null;736    }737    function _resolveHome(envPath) {738      return envPath[0] === "~" ? path4.join(os3.homedir(), envPath.slice(1)) : envPath;739    }740    function _configVault(options) {741      const debug = Boolean(options && options.debug);742      if (debug) {743        _debug("Loading env from encrypted .env.vault");744      }745      const parsed = DotenvModule._parseVault(options);746      let processEnv = process.env;747      if (options && options.processEnv != null) {748        processEnv = options.processEnv;749      }750      DotenvModule.populate(processEnv, parsed, options);751      return { parsed };752    }753    function configDotenv(options) {754      const dotenvPath = path4.resolve(process.cwd(), ".env");755      let encoding = "utf8";756      const debug = Boolean(options && options.debug);757      if (options && options.encoding) {758        encoding = options.encoding;759      } else {760        if (debug) {761          _debug("No encoding is specified. UTF-8 is used by default");762        }763      }764      let optionPaths = [dotenvPath];765      if (options && options.path) {766        if (!Array.isArray(options.path)) {767          optionPaths = [_resolveHome(options.path)];768        } else {769          optionPaths = [];770          for (const filepath of options.path) {771            optionPaths.push(_resolveHome(filepath));772          }773        }774      }775      let lastError;776      const parsedAll = {};777      for (const path5 of optionPaths) {778        try {779          const parsed = DotenvModule.parse(fs7.readFileSync(path5, { encoding }));780          DotenvModule.populate(parsedAll, parsed, options);781        } catch (e4) {782          if (debug) {783            _debug(`Failed to load ${path5} ${e4.message}`);784          }785          lastError = e4;786        }787      }788      let processEnv = process.env;789      if (options && options.processEnv != null) {790        processEnv = options.processEnv;791      }792      DotenvModule.populate(processEnv, parsedAll, options);793      if (lastError) {794        return { parsed: parsedAll, error: lastError };795      } else {796        return { parsed: parsedAll };797      }798    }799    function config(options) {800      if (_dotenvKey(options).length === 0) {801        return DotenvModule.configDotenv(options);802      }803      const vaultPath = _vaultPath(options);804      if (!vaultPath) {805        _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);806        return DotenvModule.configDotenv(options);807      }808      return DotenvModule._configVault(options);809    }810    function decrypt(encrypted, keyStr) {811      const key = Buffer.from(keyStr.slice(-64), "hex");812      let ciphertext = Buffer.from(encrypted, "base64");813      const nonce = ciphertext.subarray(0, 12);814      const authTag = ciphertext.subarray(-16);815      ciphertext = ciphertext.subarray(12, -16);816      try {817        const aesgcm = crypto7.createDecipheriv("aes-256-gcm", key, nonce);818        aesgcm.setAuthTag(authTag);819        return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;820      } catch (error2) {821        const isRange = error2 instanceof RangeError;822        const invalidKeyLength = error2.message === "Invalid key length";823        const decryptionFailed = error2.message === "Unsupported state or unable to authenticate data";824        if (isRange || invalidKeyLength) {825          const err2 = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");826          err2.code = "INVALID_DOTENV_KEY";827          throw err2;828        } else if (decryptionFailed) {829          const err2 = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");830          err2.code = "DECRYPTION_FAILED";831          throw err2;832        } else {833          throw error2;834        }835      }836    }837    function populate(processEnv, parsed, options = {}) {838      const debug = Boolean(options && options.debug);839      const override = Boolean(options && options.override);840      if (typeof parsed !== "object") {841        const err2 = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");842        err2.code = "OBJECT_REQUIRED";843        throw err2;844      }845      for (const key of Object.keys(parsed)) {846        if (Object.prototype.hasOwnProperty.call(processEnv, key)) {847          if (override === true) {848            processEnv[key] = parsed[key];849          }850          if (debug) {851            if (override === true) {852              _debug(`"${key}" is already defined and WAS overwritten`);853            } else {854              _debug(`"${key}" is already defined and was NOT overwritten`);855            }856          }857        } else {858          processEnv[key] = parsed[key];859        }860      }861    }862    var DotenvModule = {863      configDotenv,864      _configVault,865      _parseVault,866      config,867      decrypt,868      parse: parse4,869      populate870    };871    module2.exports.configDotenv = DotenvModule.configDotenv;872    module2.exports._configVault = DotenvModule._configVault;873    module2.exports._parseVault = DotenvModule._parseVault;874    module2.exports.config = DotenvModule.config;875    module2.exports.decrypt = DotenvModule.decrypt;876    module2.exports.parse = DotenvModule.parse;877    module2.exports.populate = DotenvModule.populate;878    module2.exports = DotenvModule;879  }880});881 882// ../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/env-options.js883var require_env_options = __commonJS({884  "../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/env-options.js"(exports2, module2) {885    var options = {};886    if (process.env.DOTENV_CONFIG_ENCODING != null) {887      options.encoding = process.env.DOTENV_CONFIG_ENCODING;888    }889    if (process.env.DOTENV_CONFIG_PATH != null) {890      options.path = process.env.DOTENV_CONFIG_PATH;891    }892    if (process.env.DOTENV_CONFIG_DEBUG != null) {893      options.debug = process.env.DOTENV_CONFIG_DEBUG;894    }895    if (process.env.DOTENV_CONFIG_OVERRIDE != null) {896      options.override = process.env.DOTENV_CONFIG_OVERRIDE;897    }898    if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) {899      options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY;900    }901    module2.exports = options;902  }903});904 905// ../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/cli-options.js906var require_cli_options = __commonJS({907  "../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/cli-options.js"(exports2, module2) {908    var re = /^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/;909    module2.exports = function optionMatcher(args) {910      return args.reduce(function(acc, cur) {911        const matches = cur.match(re);912        if (matches) {913          acc[matches[1]] = matches[2];914        }915        return acc;916      }, {});917    };918  }919});920 921// ../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/readline.js922var require_readline = __commonJS({923  "../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/readline.js"(exports2) {924    "use strict";925    var __importDefault2 = exports2 && exports2.__importDefault || function(mod) {926      return mod && mod.__esModule ? mod : { "default": mod };927    };928    Object.defineProperty(exports2, "__esModule", { value: true });929    exports2.createClosable = exports2.stdout = exports2.stdin = void 0;930    var readline_1 = __importDefault2(require("readline"));931    exports2.stdin = process.stdin;932    exports2.stdout = process.stdout;933    readline_1.default.emitKeypressEvents(exports2.stdin);934    var createClosable = () => {935      return readline_1.default.createInterface({936        input: exports2.stdin,937        escapeCodeTimeout: 50938      });939    };940    exports2.createClosable = createClosable;941  }942});943 944// ../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js945var require_src = __commonJS({946  "../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports2, module2) {947    "use strict";948    var ESC = "\x1B";949    var CSI = `${ESC}[`;950    var beep = "\x07";951    var cursor = {952      to(x4, y2) {953        if (!y2) return `${CSI}${x4 + 1}G`;954        return `${CSI}${y2 + 1};${x4 + 1}H`;955      },956      move(x4, y2) {957        let ret = "";958        if (x4 < 0) ret += `${CSI}${-x4}D`;959        else if (x4 > 0) ret += `${CSI}${x4}C`;960        if (y2 < 0) ret += `${CSI}${-y2}A`;961        else if (y2 > 0) ret += `${CSI}${y2}B`;962        return ret;963      },964      up: (count = 1) => `${CSI}${count}A`,965      down: (count = 1) => `${CSI}${count}B`,966      forward: (count = 1) => `${CSI}${count}C`,967      backward: (count = 1) => `${CSI}${count}D`,968      nextLine: (count = 1) => `${CSI}E`.repeat(count),969      prevLine: (count = 1) => `${CSI}F`.repeat(count),970      left: `${CSI}G`,971      hide: `${CSI}?25l`,972      show: `${CSI}?25h`,973      save: `${ESC}7`,974      restore: `${ESC}8`975    };976    var scroll = {977      up: (count = 1) => `${CSI}S`.repeat(count),978      down: (count = 1) => `${CSI}T`.repeat(count)979    };980    var erase = {981      screen: `${CSI}2J`,982      up: (count = 1) => `${CSI}1J`.repeat(count),983      down: (count = 1) => `${CSI}J`.repeat(count),984      line: `${CSI}2K`,985      lineEnd: `${CSI}K`,986      lineStart: `${CSI}1K`,987      lines(count) {988        let clear = "";989        for (let i4 = 0; i4 < count; i4++)990          clear += this.line + (i4 < count - 1 ? cursor.up() : "");991        if (count)992          clear += cursor.left;993        return clear;994      }995    };996    module2.exports = { cursor, scroll, erase, beep };997  }998});999 1000// ../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/utils.js1001var require_utils = __commonJS({1002  "../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/utils.js"(exports2) {1003    "use strict";1004    Object.defineProperty(exports2, "__esModule", { value: true });1005    exports2.clear = exports2.stringWidth = exports2.fallbackStringWidth = exports2.stripAnsi = exports2.strip = void 0;1006    var sisteransi_1 = require_src();1007    var strip = (str) => {1008      const pattern = [1009        "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",1010        "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"1011      ].join("|");1012      const RGX = new RegExp(pattern, "g");1013      return typeof str === "string" ? str.replace(RGX, "") : str;1014    };1015    exports2.strip = strip;1016    var stripAnsi = (str) => {1017      if (typeof Bun !== "undefined" && Bun.stripANSI) {1018        return Bun.stripANSI(str);1019      }1020      return (0, exports2.strip)(str);1021    };1022    exports2.stripAnsi = stripAnsi;1023    var fallbackStringWidth = (str) => {1024      let len = 0;1025      const stripped = (0, exports2.stripAnsi)(str);1026      for (const _3 of stripped)1027        len++;1028      return len;1029    };1030    exports2.fallbackStringWidth = fallbackStringWidth;1031    var stringWidth = (str) => {1032      if (typeof Bun !== "undefined" && Bun.stringWidth)1033        return Bun.stringWidth(str);1034      return (0, exports2.fallbackStringWidth)(str);1035    };1036    exports2.stringWidth = stringWidth;1037    var clear = function(prompt, perLine) {1038      if (!perLine)1039        return sisteransi_1.erase.line + sisteransi_1.cursor.to(0);1040      let rows = 0;1041      const lines = prompt.split(/\r?\n/);1042      for (let line of lines) {1043        rows += 1 + Math.floor(Math.max((0, exports2.stringWidth)(line) - 1, 0) / perLine);1044      }1045      return sisteransi_1.erase.lines(rows);1046    };1047    exports2.clear = clear;1048  }1049});1050 1051// ../node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js1052var require_lodash = __commonJS({1053  "../node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js"(exports2, module2) {1054    var FUNC_ERROR_TEXT = "Expected a function";1055    var NAN = 0 / 0;1056    var symbolTag = "[object Symbol]";1057    var reTrim = /^\s+|\s+$/g;1058    var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;1059    var reIsBinary = /^0b[01]+$/i;1060    var reIsOctal = /^0o[0-7]+$/i;1061    var freeParseInt = parseInt;1062    var freeGlobal = typeof global == "object" && global && global.Object === Object && global;1063    var freeSelf = typeof self == "object" && self && self.Object === Object && self;1064    var root = freeGlobal || freeSelf || Function("return this")();1065    var objectProto = Object.prototype;1066    var objectToString = objectProto.toString;1067    var nativeMax = Math.max;1068    var nativeMin = Math.min;1069    var now = function() {1070      return root.Date.now();1071    };1072    function debounce(func, wait, options) {1073      var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;1074      if (typeof func != "function") {1075        throw new TypeError(FUNC_ERROR_TEXT);1076      }1077      wait = toNumber(wait) || 0;1078      if (isObject(options)) {1079        leading = !!options.leading;1080        maxing = "maxWait" in options;1081        maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;1082        trailing = "trailing" in options ? !!options.trailing : trailing;1083      }1084      function invokeFunc(time) {1085        var args = lastArgs, thisArg = lastThis;1086        lastArgs = lastThis = void 0;1087        lastInvokeTime = time;1088        result = func.apply(thisArg, args);1089        return result;1090      }1091      function leadingEdge(time) {1092        lastInvokeTime = time;1093        timerId = setTimeout(timerExpired, wait);1094        return leading ? invokeFunc(time) : result;1095      }1096      function remainingWait(time) {1097        var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, result2 = wait - timeSinceLastCall;1098        return maxing ? nativeMin(result2, maxWait - timeSinceLastInvoke) : result2;1099      }1100      function shouldInvoke(time) {1101        var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;1102        return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;1103      }1104      function timerExpired() {1105        var time = now();1106        if (shouldInvoke(time)) {1107          return trailingEdge(time);1108        }1109        timerId = setTimeout(timerExpired, remainingWait(time));1110      }1111      function trailingEdge(time) {1112        timerId = void 0;1113        if (trailing && lastArgs) {1114          return invokeFunc(time);1115        }1116        lastArgs = lastThis = void 0;1117        return result;1118      }1119      function cancel() {1120        if (timerId !== void 0) {1121          clearTimeout(timerId);1122        }1123        lastInvokeTime = 0;1124        lastArgs = lastCallTime = lastThis = timerId = void 0;1125      }1126      function flush() {1127        return timerId === void 0 ? result : trailingEdge(now());1128      }1129      function debounced() {1130        var time = now(), isInvoking = shouldInvoke(time);1131        lastArgs = arguments;1132        lastThis = this;1133        lastCallTime = time;1134        if (isInvoking) {1135          if (timerId === void 0) {1136            return leadingEdge(lastCallTime);1137          }1138          if (maxing) {1139            timerId = setTimeout(timerExpired, wait);1140            return invokeFunc(lastCallTime);1141          }1142        }1143        if (timerId === void 0) {1144          timerId = setTimeout(timerExpired, wait);1145        }1146        return result;1147      }1148      debounced.cancel = cancel;1149      debounced.flush = flush;1150      return debounced;1151    }1152    function throttle(func, wait, options) {1153      var leading = true, trailing = true;1154      if (typeof func != "function") {1155        throw new TypeError(FUNC_ERROR_TEXT);1156      }1157      if (isObject(options)) {1158        leading = "leading" in options ? !!options.leading : leading;1159        trailing = "trailing" in options ? !!options.trailing : trailing;1160      }1161      return debounce(func, wait, {1162        "leading": leading,1163        "maxWait": wait,1164        "trailing": trailing1165      });1166    }1167    function isObject(value) {1168      var type = typeof value;1169      return !!value && (type == "object" || type == "function");1170    }1171    function isObjectLike(value) {1172      return !!value && typeof value == "object";1173    }1174    function isSymbol(value) {1175      return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;1176    }1177    function toNumber(value) {1178      if (typeof value == "number") {1179        return value;1180      }1181      if (isSymbol(value)) {1182        return NAN;1183      }1184      if (isObject(value)) {1185        var other = typeof value.valueOf == "function" ? value.valueOf() : value;1186        value = isObject(other) ? other + "" : other;1187      }1188      if (typeof value != "string") {1189        return value === 0 ? value : +value;1190      }1191      value = value.replace(reTrim, "");1192      var isBinary = reIsBinary.test(value);1193      return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;1194    }1195    module2.exports = throttle;1196  }1197});1198 1199// ../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/index.js1200var require_hanji = __commonJS({

Showing the first 1,200 of 92876 lines. Download the file for the rest.