"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.slugifyFrameShape = exports.toFrameShapeListItem = void 0;
const toFrameShapeListItem = (row, media, productCount) => ({
    id: row.id,
    name: row.name,
    slug: row.slug,
    isActive: row.isActive,
    media: media.map((m) => ({
        id: m.id,
        url: m.url,
        altText: m.altText,
        isPrimary: m.isPrimary,
        sortOrder: m.sortOrder,
    })),
    productCount,
    createdAt: row.createdAt,
    updatedAt: row.updatedAt,
});
exports.toFrameShapeListItem = toFrameShapeListItem;
const slugifyFrameShape = (name) => {
    return name
        .toLowerCase()
        .trim()
        .replace(/[^a-z0-9\s-]/g, "")
        .replace(/\s+/g, "-")
        .replace(/-+/g, "-")
        .replace(/^-|-$/g, "");
};
exports.slugifyFrameShape = slugifyFrameShape;
//# sourceMappingURL=frameShapeSerializers.js.map