import { jsx, jsxs } from 'react/jsx-runtime';
import { pick } from '../characterTypes.js';

function pal(c) {
    return {
        base: pick(c, 0, "var(--anim-hair, #1F2937)"),
        accent: pick(c, 1, "var(--anim-hair-2, #2C3A4A)"),
    };
}
const HairNone = () => null;
const HairShort = ({ colors, scale = 1, transform }) => {
    const c = pal(colors);
    return (jsx("g", { transform: `${transform !== null && transform !== void 0 ? transform : ""} scale(${scale})`, children: jsx("path", { d: "M-28 -18 q0 -24 28 -28 q28 4 28 28 l-4 0 q0 -18 -24 -20 q-24 2 -24 20 z", fill: c.base }) }));
};
const HairLong = ({ colors, scale = 1, transform }) => {
    const c = pal(colors);
    return (jsxs("g", { transform: `${transform !== null && transform !== void 0 ? transform : ""} scale(${scale})`, children: [jsx("path", { d: "M-30 -18 q0 -26 30 -30 q30 4 30 30 l0 30 q-6 10 -10 0 l0 -20 l-4 0 q0 -18 -16 -24 q-16 6 -16 24 l-4 0 l0 20 q-4 10 -10 0 z", fill: c.base }), jsx("path", { d: "M-26 -12 q0 -16 26 -22", stroke: c.accent, strokeWidth: 2, fill: "none", opacity: 0.3 })] }));
};
const HairMohawk = ({ colors, scale = 1, transform }) => {
    const c = pal(colors);
    return (jsx("g", { transform: `${transform !== null && transform !== void 0 ? transform : ""} scale(${scale})`, children: jsx("path", { d: "M-8 -36 q0 -30 8 -44 q8 14 8 44 z", fill: c.base }) }));
};
const HairAfro = ({ colors, scale = 1, transform }) => {
    const c = pal(colors);
    return (jsx("g", { transform: `${transform !== null && transform !== void 0 ? transform : ""} scale(${scale})`, children: jsx("circle", { cx: 0, cy: -16, r: 44, fill: c.base }) }));
};
const HairBob = ({ colors, scale = 1, transform }) => {
    const c = pal(colors);
    return (jsx("g", { transform: `${transform !== null && transform !== void 0 ? transform : ""} scale(${scale})`, children: jsx("path", { d: "M-32 -12 q-2 -26 32 -30 q34 4 32 30 l0 12 q0 6 -6 4 l0 -10 l-4 0 q0 -16 -22 -20 q-22 4 -22 20 l-4 0 l0 10 q-6 2 -6 -4 z", fill: c.base }) }));
};
const HAIR_RENDERERS = {
    none: HairNone, short: HairShort, long: HairLong, curly: HairAfro,
    wavy: HairLong, mohawk: HairMohawk, afro: HairAfro, bunHigh: HairShort,
    bunLow: HairShort, bob: HairBob, pixie: HairShort, sidePart: HairShort,
    undercut: HairShort, spiky: HairMohawk, braids: HairLong, dreadlocks: HairLong,
    ponytail: HairLong, twinTails: HairLong, mullet: HairShort, balding: HairNone,
    bangs: HairBob,
};
const Hair = ({ variant, ...rest }) => {
    var _a;
    const Comp = (_a = HAIR_RENDERERS[variant]) !== null && _a !== void 0 ? _a : HairShort;
    return jsx(Comp, { ...rest });
};

export { HAIR_RENDERERS, Hair, HairAfro, HairBob, HairLong, HairMohawk, HairNone, HairShort };
//# sourceMappingURL=hair.js.map
