import {
  VERSION
} from "./chunk-Q6TYCTYR.js";
import {
  __commonJS,
  __require,
  __toESM
} from "./chunk-2ESYSVXG.js";

// ../../node_modules/os-paths/src/lib/index.js
var require_lib = __commonJS({
  "../../node_modules/os-paths/src/lib/index.js"(exports, module) {
    "use strict";
    var os2 = __require("os");
    var paths = __require("path");
    var isWinOS = /^win/i.test(process.platform);
    function normalize_path(path2) {
      return paths.normalize(paths.join(path2, "."));
    }
    var base = () => {
      const { env } = process;
      const object = {};
      object.home = () => normalize_path(os2.homedir ? os2.homedir() : env.HOME);
      object.temp = () => normalize_path(os2.tmpdir ? os2.tmpdir() : env.TMPDIR || env.TEMP || env.TMP);
      return object;
    };
    var windows = () => {
      const { env } = process;
      const object = {};
      object.home = () => normalize_path(
        os2.homedir ? os2.homedir() : env.USERPROFILE || paths.join(env.HOMEDRIVE, env.HOMEPATH) || env.HOME
      );
      object.temp = () => normalize_path(
        os2.tmpdir ? os2.tmpdir() : env.TEMP || env.TMP || paths.join(env.LOCALAPPDATA || env.SystemRoot || env.windir, "Temp")
      );
      return object;
    };
    var _OSPaths = class __OSPaths {
      constructor() {
        const OSPaths = function() {
          return new __OSPaths();
        };
        this._fn = OSPaths;
        const extension = isWinOS ? windows() : base();
        Object.keys(extension).forEach((key) => {
          this._fn[key] = extension[key];
        });
        return this._fn;
      }
    };
    module.exports = new _OSPaths();
  }
});

// ../../node_modules/xdg-portable/src/lib/index.js
var require_lib2 = __commonJS({
  "../../node_modules/xdg-portable/src/lib/index.js"(exports, module) {
    "use strict";
    var path2 = __require("path");
    var osPaths = require_lib();
    var linux = () => {
      const object = {};
      object.cache = () => process.env.XDG_CACHE_HOME || path2.join(osPaths.home() || osPaths.temp(), ".cache");
      object.config = () => process.env.XDG_CONFIG_HOME || path2.join(osPaths.home() || osPaths.temp(), ".config");
      object.data = () => process.env.XDG_DATA_HOME || path2.join(osPaths.home() || osPaths.temp(), ".local", "share");
      object.runtime = () => process.env.XDG_RUNTIME_DIR || void 0;
      object.state = () => process.env.XDG_STATE_HOME || path2.join(osPaths.home() || osPaths.temp(), ".local", "state");
      return object;
    };
    var macos = () => {
      const object = {};
      object.cache = () => process.env.XDG_CACHE_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "Caches");
      object.config = () => process.env.XDG_CONFIG_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "Preferences");
      object.data = () => process.env.XDG_DATA_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "Application Support");
      object.runtime = () => process.env.XDG_RUNTIME_DIR || void 0;
      object.state = () => process.env.XDG_STATE_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "State");
      return object;
    };
    var windows = () => {
      const object = {};
      object.cache = () => {
        const localAppData = process.env.LOCALAPPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Local");
        return process.env.XDG_CACHE_HOME || path2.join(localAppData, "xdg.cache");
      };
      object.config = () => {
        const appData = process.env.APPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Roaming");
        return process.env.XDG_CONFIG_HOME || path2.join(appData, "xdg.config");
      };
      object.data = () => {
        const appData = process.env.APPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Roaming");
        return process.env.XDG_DATA_HOME || path2.join(appData, "xdg.data");
      };
      object.runtime = () => process.env.XDG_RUNTIME_DIR || void 0;
      object.state = () => {
        const localAppData = process.env.LOCALAPPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Local");
        return process.env.XDG_STATE_HOME || path2.join(localAppData, "xdg.state");
      };
      return object;
    };
    var _XDGPortable = () => {
      const XDGPortable = function() {
        return _XDGPortable();
      };
      let extension = {};
      if (/^darwin$/i.test(process.platform)) {
        extension = macos();
      } else if (/^win/i.test(process.platform)) {
        extension = windows();
      } else {
        extension = linux();
      }
      extension.configDirs = () => {
        const dirs = [];
        dirs.push(extension.config());
        if (process.env.XDG_CONFIG_DIRS) {
          dirs.push(...process.env.XDG_CONFIG_DIRS.split(path2.delimiter));
        }
        return dirs;
      };
      extension.dataDirs = () => {
        const dirs = [];
        dirs.push(extension.data());
        if (process.env.XDG_DATA_DIRS) {
          dirs.push(...process.env.XDG_DATA_DIRS.split(path2.delimiter));
        }
        return dirs;
      };
      Object.keys(extension).forEach((key) => {
        XDGPortable[key] = extension[key];
      });
      return XDGPortable;
    };
    module.exports = _XDGPortable();
  }
});

// ../../node_modules/xdg-app-paths/index.js
var require_xdg_app_paths = __commonJS({
  "../../node_modules/xdg-app-paths/index.js"(exports, module) {
    "use strict";
    var path2 = __require("path");
    var os2 = __require("os");
    var xdg = require_lib2();
    var isWinOS = /^win/i.test(process.platform);
    function _normalizeOptions(options, isolated) {
      options = options || {};
      if (typeof options !== "object") {
        options = { isolated: options };
      }
      options.isolated = options.isolated === void 0 || options.isolated === null ? isolated : options.isolated;
      if (typeof options.isolated !== "boolean") {
        throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof options.isolated}`);
      }
      return options;
    }
    var base = (name, isolated) => {
      const object = {};
      object.cache = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        return path2.join(xdg.cache(), options.isolated ? name : "");
      };
      object.config = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        return path2.join(xdg.config(), options.isolated ? name : "");
      };
      object.data = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        return path2.join(xdg.data(), options.isolated ? name : "");
      };
      object.runtime = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        return xdg.runtime() ? path2.join(xdg.runtime(), options.isolated ? name : "") : void 0;
      };
      object.state = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        return path2.join(xdg.state(), options.isolated ? name : "");
      };
      object.configDirs = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        return xdg.configDirs().map((s) => path2.join(s, options.isolated ? name : ""));
      };
      object.dataDirs = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        return xdg.dataDirs().map((s) => path2.join(s, options.isolated ? name : ""));
      };
      return object;
    };
    var windows = (name, isolated) => {
      const { env } = process;
      const homedir2 = os2.homedir();
      const tmpdir = os2.tmpdir();
      const appData = env.APPDATA || path2.join(homedir2 || tmpdir, "AppData", "Roaming");
      const localAppData = env.LOCALAPPDATA || path2.join(homedir2 || tmpdir, "AppData", "Local");
      const object = {};
      object.cache = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        return !options.isolated || env.XDG_CACHE_HOME ? path2.join(xdg.cache(), options.isolated ? name : "") : path2.join(localAppData, options.isolated ? name : "", "Cache");
      };
      object.config = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        const config = !options.isolated || env.XDG_CONFIG_HOME ? path2.join(xdg.config(), options.isolated ? name : "") : path2.join(appData, options.isolated ? name : "", "Config");
        return config;
      };
      object.data = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        const data = !options.isolated || env.XDG_DATA_HOME ? path2.join(xdg.data(), options.isolated ? name : "") : path2.join(appData, options.isolated ? name : "", "Data");
        return data;
      };
      object.runtime = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        return xdg.runtime() ? path2.join(xdg.runtime(), options.isolated ? name : "") : void 0;
      };
      object.state = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        return !options.isolated || env.XDG_STATE_HOME ? path2.join(xdg.state(), options.isolated ? name : "") : path2.join(localAppData, options.isolated ? name : "", "State");
      };
      object.configDirs = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        const dirs = [object.config(options)];
        if (env.XDG_CONFIG_DIRS) {
          dirs.push(...env.XDG_CONFIG_DIRS.split(path2.delimiter).map((s) => path2.join(s, options.isolated ? name : "")));
        }
        return dirs;
      };
      object.dataDirs = (options = { isolated: null }) => {
        options = _normalizeOptions(options, isolated);
        const dirs = [object.data(options)];
        if (env.XDG_DATA_DIRS) {
          dirs.push(...env.XDG_DATA_DIRS.split(path2.delimiter).map((s) => path2.join(s, options.isolated ? name : "")));
        }
        return dirs;
      };
      return object;
    };
    var _XDGAppPaths = class __XDGAppPaths {
      constructor(options = { name: null, suffix: null, isolated: true }) {
        const XDGAppPaths2 = function(options2 = { name: null, suffix: null, isolated: true }) {
          return new __XDGAppPaths(options2);
        };
        this._fn = XDGAppPaths2;
        options = options || {};
        if (typeof options !== "object") {
          options = { name: options };
        }
        let name = options.name || "";
        if (typeof name !== "string") {
          throw new TypeError(`Expected string for "name" argument, got ${typeof name}`);
        }
        const suffix = options.suffix || "";
        if (typeof suffix !== "string") {
          throw new TypeError(`Expected string for "suffix" argument, got ${typeof suffix}`);
        }
        const isolated = options.isolated === void 0 || options.isolated === null ? true : options.isolated;
        if (typeof isolated !== "boolean") {
          throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof isolated}`);
        }
        if (!name) {
          name = path2.parse(process.pkg ? process.execPath : __require.main ? __require.main.filename : process.argv[0]).name;
        }
        if (suffix) {
          name += suffix;
        }
        this._fn.$name = () => name;
        this._fn.$isolated = () => isolated;
        const extension = isWinOS ? windows(name, isolated) : base(name, isolated);
        Object.keys(extension).forEach((key) => {
          this._fn[key] = extension[key];
        });
        return this._fn;
      }
    };
    module.exports = new _XDGAppPaths();
  }
});

// ../../node_modules/@vercel/sandbox/dist/auth/zod.js
import { z } from "zod";
var json = z.string().transform((jsonString, ctx) => {
  try {
    return JSON.parse(jsonString);
  } catch (err) {
    ctx.addIssue({
      code: z.ZodIssueCode.custom,
      message: `Invalid JSON: ${err.message}`
    });
    return z.NEVER;
  }
});

// ../../node_modules/@vercel/sandbox/dist/auth/file.js
var import_xdg_app_paths = __toESM(require_xdg_app_paths(), 1);
import { z as z2 } from "zod";
import path from "path";
import fs from "fs";
import { homedir } from "os";
var ZodDate = z2.number().transform((seconds) => /* @__PURE__ */ new Date(seconds * 1e3));
var AuthFile = z2.object({
  token: z2.string().min(1).optional(),
  refreshToken: z2.string().min(1).optional(),
  expiresAt: ZodDate.optional()
});
var StoredAuthFile = json.pipe(AuthFile);
var isDirectory = (path$12) => {
  try {
    return fs.lstatSync(path$12).isDirectory();
  } catch (_) {
    return false;
  }
};
var getGlobalPathConfig = () => {
  if (process.env.VERCEL_AUTH_CONFIG_DIR) return process.env.VERCEL_AUTH_CONFIG_DIR;
  const vercelDirectories = (0, import_xdg_app_paths.default)("com.vercel.cli").dataDirs();
  return [
    ...vercelDirectories,
    path.join(homedir(), ".now"),
    ...(0, import_xdg_app_paths.default)("now").dataDirs()
  ].find((configPath) => isDirectory(configPath)) || vercelDirectories[0];
};
var getAuth = () => {
  try {
    const pathname = path.join(getGlobalPathConfig(), "auth.json");
    return StoredAuthFile.parse(fs.readFileSync(pathname, "utf8"));
  } catch {
    return null;
  }
};
function updateAuthConfig(config) {
  const pathname = path.join(getGlobalPathConfig(), "auth.json");
  fs.mkdirSync(path.dirname(pathname), { recursive: true });
  const content = {
    token: config.token,
    expiresAt: config.expiresAt && Math.round(config.expiresAt.getTime() / 1e3),
    refreshToken: config.refreshToken
  };
  fs.writeFileSync(pathname, JSON.stringify(content) + "\n");
}

// ../../node_modules/@vercel/sandbox/dist/auth/oauth.js
import { z as z3 } from "zod";
import os from "os";
var USER_AGENT = `${os.hostname()} @ vercel/sandbox/${VERSION} node-${process.version} ${os.platform()} (${os.arch()})`;
var ISSUER = new URL("https://vercel.com");
var CLIENT_ID = "cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp";
var AuthorizationServerMetadata = z3.object({
  issuer: z3.string().url(),
  device_authorization_endpoint: z3.string().url(),
  token_endpoint: z3.string().url(),
  revocation_endpoint: z3.string().url(),
  jwks_uri: z3.string().url(),
  introspection_endpoint: z3.string().url()
});
var _as;
var DeviceAuthorization = z3.object({
  device_code: z3.string(),
  user_code: z3.string(),
  verification_uri: z3.string().url(),
  verification_uri_complete: z3.string().url(),
  expires_in: z3.number(),
  interval: z3.number()
});
var IntrospectionResponse = z3.object({
  active: z3.literal(true),
  client_id: z3.string(),
  session_id: z3.string()
}).or(z3.object({ active: z3.literal(false) }));
async function authorizationServerMetadata() {
  if (_as) return _as;
  const response = await fetch(new URL(".well-known/openid-configuration", ISSUER), { headers: {
    "Content-Type": "application/json",
    "user-agent": USER_AGENT
  } });
  _as = AuthorizationServerMetadata.parse(await response.json());
  return _as;
}
async function OAuth() {
  const as = await authorizationServerMetadata();
  return {
    async deviceAuthorizationRequest() {
      const json2 = await (await fetch(as.device_authorization_endpoint, {
        method: "POST",
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
          "user-agent": USER_AGENT
        },
        body: new URLSearchParams({
          client_id: CLIENT_ID,
          scope: "openid offline_access"
        })
      })).json();
      const parsed = DeviceAuthorization.safeParse(json2);
      if (!parsed.success) throw new OAuthError(`Failed to parse device authorization response: ${parsed.error.message}`, json2);
      return {
        device_code: parsed.data.device_code,
        user_code: parsed.data.user_code,
        verification_uri: parsed.data.verification_uri,
        verification_uri_complete: parsed.data.verification_uri_complete,
        expiresAt: Date.now() + parsed.data.expires_in * 1e3,
        interval: parsed.data.interval
      };
    },
    async deviceAccessTokenRequest(device_code) {
      try {
        return [null, await fetch(as.token_endpoint, {
          method: "POST",
          headers: {
            "Content-Type": "application/x-www-form-urlencoded",
            "user-agent": USER_AGENT
          },
          body: new URLSearchParams({
            client_id: CLIENT_ID,
            grant_type: "urn:ietf:params:oauth:grant-type:device_code",
            device_code
          }),
          signal: AbortSignal.timeout(10 * 1e3)
        })];
      } catch (error) {
        if (error instanceof Error) return [error];
        return [new Error("An unknown error occurred. See the logs for details.", { cause: error })];
      }
    },
    async processTokenResponse(response) {
      const json2 = await response.json();
      const processed = TokenSet.safeParse(json2);
      if (!processed.success) return [new OAuthError(`Failed to parse token response: ${processed.error.message}`, json2)];
      return [null, processed.data];
    },
    async revokeToken(token) {
      const response = await fetch(as.revocation_endpoint, {
        method: "POST",
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
          "user-agent": USER_AGENT
        },
        body: new URLSearchParams({
          token,
          client_id: CLIENT_ID
        })
      });
      if (response.ok) return;
      return new OAuthError("Revocation request failed", await response.json());
    },
    async refreshToken(token) {
      const response = await fetch(as.token_endpoint, {
        method: "POST",
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
          "user-agent": USER_AGENT
        },
        body: new URLSearchParams({
          client_id: CLIENT_ID,
          grant_type: "refresh_token",
          refresh_token: token
        })
      });
      const [tokensError, tokenSet] = await this.processTokenResponse(response);
      if (tokensError) throw tokensError;
      return tokenSet;
    },
    async introspectToken(token) {
      const json2 = await (await fetch(as.introspection_endpoint, {
        method: "POST",
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
          "user-agent": USER_AGENT
        },
        body: new URLSearchParams({ token })
      })).json();
      const processed = IntrospectionResponse.safeParse(json2);
      if (!processed.success) throw new OAuthError(`Failed to parse introspection response: ${processed.error.message}`, json2);
      return processed.data;
    }
  };
}
var TokenSet = z3.object({
  access_token: z3.string(),
  token_type: z3.literal("Bearer"),
  expires_in: z3.number(),
  refresh_token: z3.string().optional(),
  scope: z3.string().optional()
});
var OAuthErrorResponse = z3.object({
  error: z3.enum([
    "invalid_request",
    "invalid_client",
    "invalid_grant",
    "unauthorized_client",
    "unsupported_grant_type",
    "invalid_scope",
    "server_error",
    "authorization_pending",
    "slow_down",
    "access_denied",
    "expired_token",
    "unsupported_token_type"
  ]),
  error_description: z3.string().optional(),
  error_uri: z3.string().optional()
});
function processOAuthErrorResponse(json2) {
  try {
    return OAuthErrorResponse.parse(json2);
  } catch (error) {
    if (error instanceof z3.ZodError) return /* @__PURE__ */ new TypeError(`Invalid OAuth error response: ${error.message}`);
    return /* @__PURE__ */ new TypeError("Failed to parse OAuth error response");
  }
}
var OAuthError = class extends Error {
  constructor(message, response) {
    super(message);
    this.name = "OAuthError";
    const error = processOAuthErrorResponse(response);
    if (error instanceof TypeError) {
      const message$1 = `Unexpected server response: ${JSON.stringify(response)}`;
      this.cause = new Error(message$1, { cause: error });
      this.code = "server_error";
      return;
    }
    let cause = error.error;
    if (error.error_description) cause += `: ${error.error_description}`;
    if (error.error_uri) cause += ` (${error.error_uri})`;
    this.cause = new Error(cause);
    this.code = error.error;
  }
};
function isOAuthError(error) {
  return error instanceof OAuthError;
}

// ../../node_modules/@vercel/sandbox/dist/auth/poll-for-token.js
import { setTimeout } from "timers/promises";
async function* pollForToken({ request, oauth }) {
  const controller = new AbortController();
  try {
    let intervalMs = request.interval * 1e3;
    while (Date.now() < request.expiresAt) {
      const [tokenResponseError, tokenResponse] = await oauth.deviceAccessTokenRequest(request.device_code);
      if (tokenResponseError) {
        if (tokenResponseError.message.includes("timeout")) {
          intervalMs *= 2;
          yield {
            _tag: "Timeout",
            newInterval: intervalMs
          };
          await setTimeout(intervalMs, { signal: controller.signal });
          continue;
        }
        yield {
          _tag: "Error",
          error: tokenResponseError
        };
        return;
      }
      yield {
        _tag: "Response",
        response: tokenResponse.clone()
      };
      const [tokensError, tokens] = await oauth.processTokenResponse(tokenResponse);
      if (isOAuthError(tokensError)) {
        const { code } = tokensError;
        switch (code) {
          case "authorization_pending":
            await setTimeout(intervalMs, { signal: controller.signal });
            continue;
          case "slow_down":
            intervalMs += 5 * 1e3;
            yield {
              _tag: "SlowDown",
              newInterval: intervalMs
            };
            await setTimeout(intervalMs, { signal: controller.signal });
            continue;
          default:
            yield {
              _tag: "Error",
              error: tokensError.cause
            };
            return;
        }
      }
      if (tokensError) {
        yield {
          _tag: "Error",
          error: tokensError
        };
        return;
      }
      updateAuthConfig({
        token: tokens.access_token,
        expiresAt: new Date(Date.now() + tokens.expires_in * 1e3),
        refreshToken: tokens.refresh_token
      });
      return;
    }
    yield {
      _tag: "Error",
      error: /* @__PURE__ */ new Error("Timed out waiting for authentication. Please try again.")
    };
    return;
  } finally {
    controller.abort();
  }
}

// ../../node_modules/@vercel/sandbox/dist/auth/error.js
var NotOk = class extends Error {
  constructor(response) {
    super(`HTTP ${response.statusCode}: ${response.responseText}`);
    this.name = "NotOk";
    this.response = response;
  }
};

// ../../node_modules/@vercel/sandbox/dist/auth/api.js
async function fetchApi(opts) {
  const x = await fetch(`https://api.vercel.com${opts.endpoint}`, {
    method: opts.method,
    body: opts.body,
    headers: {
      Authorization: `Bearer ${opts.token}`,
      "Content-Type": "application/json"
    }
  });
  if (!x.ok) {
    let message = await x.text();
    try {
      const { error } = JSON.parse(message);
      message = `${error.code.toUpperCase()}: ${error.message}`;
    } catch {
    }
    throw new NotOk({
      responseText: message,
      statusCode: x.status
    });
  }
  return await x.json();
}

// ../../node_modules/@vercel/sandbox/dist/auth/linked-project.js
import { z as z4 } from "zod";
import * as path$1 from "path";
import * as fs2 from "fs/promises";
var LinkedProjectSchema = json.pipe(z4.object({
  projectId: z4.string(),
  orgId: z4.string()
}));
async function readLinkedProject(cwd) {
  const projectJsonPath = path$1.join(cwd, ".vercel", "project.json");
  let content;
  try {
    content = await fs2.readFile(projectJsonPath, "utf-8");
  } catch {
    return null;
  }
  const parsed = LinkedProjectSchema.safeParse(content);
  if (!parsed.success) return null;
  return {
    projectId: parsed.data.projectId,
    teamId: parsed.data.orgId
  };
}

// ../../node_modules/@vercel/sandbox/dist/auth/project.js
import { z as z5 } from "zod";
var TeamsSchema = z5.object({ teams: z5.array(z5.object({ slug: z5.string() })).min(1, `No teams found. Please create a team first.`) });
var DEFAULT_PROJECT_NAME = "vercel-sandbox-default-project";
async function inferScope(opts) {
  const linkedProject = await readLinkedProject(opts.cwd ?? process.cwd());
  if (linkedProject) return {
    ...linkedProject,
    created: false
  };
  const teamId = opts.teamId ?? await selectTeam(opts.token);
  let created = false;
  try {
    await fetchApi({
      token: opts.token,
      endpoint: `/v2/projects/${encodeURIComponent(DEFAULT_PROJECT_NAME)}?slug=${encodeURIComponent(teamId)}`
    });
  } catch (e) {
    if (!(e instanceof NotOk) || e.response.statusCode !== 404) throw e;
    await fetchApi({
      token: opts.token,
      endpoint: `/v11/projects?slug=${encodeURIComponent(teamId)}`,
      method: "POST",
      body: JSON.stringify({ name: DEFAULT_PROJECT_NAME })
    });
    created = true;
  }
  return {
    projectId: DEFAULT_PROJECT_NAME,
    teamId,
    created
  };
}
async function selectTeam(token) {
  const { teams: [team] } = await fetchApi({
    token,
    endpoint: "/v2/teams?limit=1"
  }).then(TeamsSchema.parse);
  return team.slug;
}
export {
  OAuth,
  getAuth,
  inferScope,
  isOAuthError,
  pollForToken,
  selectTeam,
  updateAuthConfig
};
