// @bun
var __defProp = Object.defineProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, {
      get: all[name],
      enumerable: true,
      configurable: true,
      set: (newValue) => all[name] = () => newValue
    });
};
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
var __require = import.meta.require;

// src/i18n/locale.ts
function resolveLocale(specLocale, runtimeLocale) {
  const raw = runtimeLocale ?? specLocale ?? DEFAULT_LOCALE;
  if (isSupportedLocale(raw)) {
    return raw;
  }
  const base = raw.split("-")[0];
  if (base && isSupportedLocale(base)) {
    return base;
  }
  return DEFAULT_LOCALE;
}
function isSupportedLocale(locale) {
  return SUPPORTED_LOCALES.includes(locale);
}
var DEFAULT_LOCALE = "en", SUPPORTED_LOCALES;
var init_locale = __esm(() => {
  SUPPORTED_LOCALES = ["en", "fr", "es"];
});
init_locale();

export {
  resolveLocale,
  isSupportedLocale,
  SUPPORTED_LOCALES,
  DEFAULT_LOCALE
};
