// Force strict mode and setup for ESM
"use strict";
import {
  init_esbuild_shims
} from "./chunk-5O2XNYP6.js";
import {
  __name
} from "./chunk-J2S4EL5Y.js";

// packages/core/src/core/reasoning-effort.ts
init_esbuild_shims();
var REASONING_EFFORT_TIERS = [
  "low",
  "medium",
  "high",
  "xhigh",
  "max"
];
var REASONING_EFFORT_RANKS = {
  low: 20,
  medium: 30,
  high: 40,
  xhigh: 60,
  max: 70
};
function normalizeReasoningEffort(raw) {
  if (!raw || typeof raw !== "string") {
    return void 0;
  }
  const key = raw.trim().toLowerCase().replace(/[\s_-]+/g, "");
  switch (key) {
    case "low":
      return "low";
    case "medium":
    case "med":
      return "medium";
    case "high":
      return "high";
    case "xhigh":
    case "extrahigh":
      return "xhigh";
    case "max":
    case "maximum":
      return "max";
    default:
      return void 0;
  }
}
__name(normalizeReasoningEffort, "normalizeReasoningEffort");
function clampReasoningEffort(requested, supported) {
  const set = supported && supported.length > 0 ? supported : REASONING_EFFORT_TIERS;
  if (set.includes(requested)) {
    return requested;
  }
  const requestedRank = REASONING_EFFORT_RANKS[requested];
  const ranked = [...set].sort(
    (a, b) => REASONING_EFFORT_RANKS[a] - REASONING_EFFORT_RANKS[b]
  );
  for (const tier of ranked) {
    if (REASONING_EFFORT_RANKS[tier] >= requestedRank) {
      return tier;
    }
  }
  return ranked[ranked.length - 1];
}
__name(clampReasoningEffort, "clampReasoningEffort");

export {
  REASONING_EFFORT_TIERS,
  normalizeReasoningEffort,
  clampReasoningEffort
};
/**
 * @license
 * Copyright 2025 Qwen
 * SPDX-License-Identifier: Apache-2.0
 */
