import CJS_COMPAT_NODE_URL from 'node:url';
import CJS_COMPAT_NODE_PATH from 'node:path';
import CJS_COMPAT_NODE_MODULE from "node:module";

const __filename = CJS_COMPAT_NODE_URL.fileURLToPath(import.meta.url);
const __dirname = CJS_COMPAT_NODE_PATH.dirname(__filename);
const require = CJS_COMPAT_NODE_MODULE.createRequire(import.meta.url);
// ------------------------------------------------------------
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
// ------------------------------------------------------------
import {
  a as f
} from "./chunk-HRN2KQZP.js";

// ../node_modules/camelcase/index.js
var p = /[\p{Lu}]/u, U = /[\p{Ll}]/u, L = /^[\p{Lu}](?![\p{Lu}])/gu, R = /([\p{Alpha}\p{N}_]|$)/u, C = /[_.\- ]+/, v = new RegExp("^" + C.source), h = new RegExp(C.source + R.source, "gu"), I = new RegExp("\\d+" + R.source, "gu"), _ = /* @__PURE__ */ f((e, r, a, t) => {
  let o = !1, s = !1, A = !1, E = !1;
  for (let l = 0; l < e.length; l++) {
    let c = e[l];
    E = l > 2 ? e[l - 3] === "-" : !0, o && p.test(c) ? (e = e.slice(0, l) + "-" + e.slice(l), o = !1, A = s, s = !0, l++) : s && A && U.test(c) && (!E || t) ? (e = e.slice(0, l - 1) + "-" + e.slice(l - 1), A = s, s = !1, o = !0) : (o = r(c) === c && a(c) !== c, A = s, s = a(c) === c && r(c) !== c);
  }
  return e;
}, "preserveCamelCase"), d = /* @__PURE__ */ f((e, r) => (L.lastIndex = 0, e.replaceAll(L, (a) => r(a))), "preserveConsecutiveUppercase"), x = /* @__PURE__ */ f((e, r) => (h.lastIndex = 0, I.lastIndex = 0, e.replaceAll(I, (a, t, o) => ["_", "-"].includes(e.charAt(o + a.length)) ? a : r(a)).replaceAll(h, (a, t) => r(t))), "postProcess");
function N(e, r) {
  if (!(typeof e == "string" || Array.isArray(e)))
    throw new TypeError("Expected the input to be `string | string[]`");
  if (r = {
    pascalCase: !1,
    preserveConsecutiveUppercase: !1,
    ...r
  }, Array.isArray(e) ? e = e.map((s) => s.trim()).filter((s) => s.length).join("-") : e = e.trim(), e.length === 0)
    return "";
  let a = r.locale === !1 ? (s) => s.toLowerCase() : (s) => s.toLocaleLowerCase(r.locale), t = r.locale === !1 ? (s) => s.toUpperCase() : (s) => s.toLocaleUpperCase(r.locale);
  return e.length === 1 ? C.test(e) ? "" : r.pascalCase ? t(e) : a(e) : (e !== a(e) && (e = _(e, a, t, r.preserveConsecutiveUppercase)), e = e.replace(v, ""), e = r.preserveConsecutiveUppercase ? d(e, a) : a(e), r.pascalCase && (e = t(e.charAt(0)) + e.slice(1)), x(e, t));
}
f(N, "camelCase");
export {
  N as default
};
