#!/usr/bin/env node
import { createRequire as __cr } from 'node:module'; if (typeof globalThis.require === 'undefined') { globalThis.require = __cr(import.meta.url); }
import {
  wrapper_default
} from "./chunk-FEZK652I.js";
import "./chunk-TUK7OWJA.js";

// node_modules/ink/build/devtools-window-polyfill.js
var customGlobal = globalThis;
customGlobal.WebSocket ||= wrapper_default;
customGlobal.window ||= globalThis;
customGlobal.self ||= globalThis;
customGlobal.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = [
  {
    // ComponentFilterElementType
    type: 1,
    // ElementTypeHostComponent
    value: 7,
    isEnabled: true
  },
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "InternalApp",
    isEnabled: true,
    isValid: true
  },
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "InternalAppContext",
    isEnabled: true,
    isValid: true
  },
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "InternalStdoutContext",
    isEnabled: true,
    isValid: true
  },
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "InternalStderrContext",
    isEnabled: true,
    isValid: true
  },
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "InternalStdinContext",
    isEnabled: true,
    isValid: true
  },
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "InternalFocusContext",
    isEnabled: true,
    isValid: true
  }
];

// node_modules/ink/build/devtools.js
import devtools from "react-devtools-core";
var isDevToolsReachable = async () => new Promise((resolve) => {
  const socket = new wrapper_default("ws://localhost:8097");
  const timeout = setTimeout(() => {
    socket.terminate();
    resolve(false);
  }, 2e3);
  timeout.unref();
  socket.on("open", () => {
    clearTimeout(timeout);
    socket.terminate();
    resolve(true);
  });
  socket.on("error", () => {
    clearTimeout(timeout);
    socket.terminate();
    resolve(false);
  });
});
if (await isDevToolsReachable()) {
  devtools.initialize();
  devtools.connectToDevTools();
} else {
  console.warn("DEV is set to true, but the React DevTools server is not running. Start it with:\n\n$ npx react-devtools\n");
}
//# sourceMappingURL=devtools-HW3WDT3Q.js.map