"use strict";
var import_vitest = require("vitest");
var import_chatgpt_rate_limit = require("./chatgpt-rate-limit.js");
(0, import_vitest.describe)("chatgpt-rate-limit utils", () => {
  (0, import_vitest.it)("shows footer hints when ChatGPT usage is approaching the cap", () => {
    (0, import_vitest.expect)(
      (0, import_chatgpt_rate_limit.shouldShowChatGPTRateLimitHint)({
        source: "chatgpt-login",
        usedPercent: 82,
        exceeded: false
      })
    ).toBe(true);
    (0, import_vitest.expect)(
      (0, import_chatgpt_rate_limit.getChatGPTRateLimitHint)({
        source: "chatgpt-login",
        usedPercent: 82,
        exceeded: false
      })
    ).toBe("ChatGPT cap 82% used");
  });
  (0, import_vitest.it)("formats a hard cap state without showing fake reset data", () => {
    (0, import_vitest.expect)(
      (0, import_chatgpt_rate_limit.getChatGPTRateLimitHint)({
        source: "chatgpt-login",
        usedPercent: 100,
        exceeded: true
      })
    ).toBe("ChatGPT cap reached");
  });
  (0, import_vitest.it)("keeps the same model when it is available via the OpenAI API", () => {
    (0, import_vitest.expect)((0, import_chatgpt_rate_limit.resolveChatGPTFallbackModel)("gpt-5")).toEqual({
      provider: "openai",
      model: "gpt-5",
      displayName: "GPT-5",
      usedDefaultFallback: false
    });
  });
  (0, import_vitest.it)("falls back to the default OpenAI model when the ChatGPT model is not available", () => {
    (0, import_vitest.expect)((0, import_chatgpt_rate_limit.resolveChatGPTFallbackModel)("nonexistent-chatgpt-model")).toEqual({
      provider: "openai",
      model: "gpt-5-mini",
      displayName: "GPT-5 Mini",
      usedDefaultFallback: true
    });
  });
});
