var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellDateTimeDisplay/utils/localeUtils.ts
var localeUtils_exports = {};
__export(localeUtils_exports, {
  getDayjsLocale: () => getDayjsLocale,
  isChinese: () => isChinese,
  normalizeLocale: () => normalizeLocale
});
module.exports = __toCommonJS(localeUtils_exports);
var import_utils = require("@pisell/utils");
var import_locale = require("../../../utils/locale");
function normalizeLocale(locale) {
  return locale.toLowerCase();
}
function isChinese(locale) {
  const normalizedLocale = normalizeLocale(locale);
  return normalizedLocale.startsWith("zh");
}
function toDayjsLoadedLocale(normalized) {
  if (normalized.startsWith("en")) return "en";
  return normalized;
}
function getDayjsLocale(locale) {
  if (!locale) {
    const fromMaterials = (0, import_locale.getCurrentLocale)();
    const fromUtils = typeof import_utils.locales.getLocale === "function" ? import_utils.locales.getLocale() : void 0;
    const raw = (fromMaterials && fromMaterials !== "en-US" ? fromMaterials : void 0) || (typeof fromUtils === "string" && fromUtils ? fromUtils : void 0) || fromMaterials;
    return toDayjsLoadedLocale(normalizeLocale(raw));
  }
  return toDayjsLoadedLocale(normalizeLocale(locale));
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  getDayjsLocale,
  isChinese,
  normalizeLocale
});
