import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  logout
} from "./chunk-VZ3FZHJK.js";
import "./chunk-OWRWPLVG.js";
import "./chunk-CIOBCAOI.js";
import "./chunk-RPTAJN5Y.js";
import {
  Box_default,
  ConfirmInput,
  Spinner,
  Text,
  useAsyncCallback
} from "./chunk-2DKXIL7C.js";
import {
  require_react
} from "./chunk-7ZOEVDW3.js";
import "./chunk-AFPDHQYI.js";
import "./chunk-HYKBBZLS.js";
import "./chunk-C5RTKQVL.js";
import "./chunk-TMZBOD2B.js";
import "./chunk-DR2IE2NL.js";
import "./chunk-JWVFFICN.js";
import "./chunk-YRSNPU5L.js";
import {
  require_lib
} from "./chunk-PIOT47FJ.js";
import {
  __toESM,
  init_esm_shims
} from "./chunk-EXLZF52D.js";

// src/components/LogoutCommand/index.ts
init_esm_shims();

// src/components/LogoutCommand/LogoutCommand.tsx
init_esm_shims();
var import_react = __toESM(require_react(), 1);
var import_variant = __toESM(require_lib(), 1);
var LogoutCommand = ({ userInfo }) => {
  const logoutAction = useAsyncCallback(logout);
  if (userInfo == null) {
    return /* @__PURE__ */ import_react.default.createElement(Text, null, "Wix CLI is already logged out");
  }
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react.default.createElement(Text, null, "When you're logged out you cannot use Wix CLI commands")), /* @__PURE__ */ import_react.default.createElement(
    ConfirmInput,
    {
      label: "Proceed with logout?",
      initialValue: true,
      onSubmit: (confirmed) => {
        if (confirmed) {
          void logoutAction.execute();
        }
      }
    }
  ), (0, import_variant.match)(logoutAction.status, {
    NotRequested: () => null,
    Error: () => null,
    Loading: () => /* @__PURE__ */ import_react.default.createElement(Spinner, null),
    Success: () => /* @__PURE__ */ import_react.default.createElement(Text, null, "Wix CLI is logged out")
  }));
};
export {
  LogoutCommand
};
//# sourceMappingURL=LogoutCommand-EAQ45JZ7.js.map