"use strict";
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);
var border_exports = {};
__export(border_exports, {
  borderPropertyDataToStyle: () => borderPropertyDataToStyle
});
module.exports = __toCommonJS(border_exports);
var import_colorToString = require("../components/utils/colorToString");
function borderPropertyDataToStyle(data, defaultValue = {}) {
  const borderTop = data.borderTop ?? defaultValue.borderTop;
  const borderRight = data.borderRight ?? defaultValue.borderRight;
  const borderBottom = data.borderBottom ?? defaultValue.borderBottom;
  const borderLeft = data.borderLeft ?? defaultValue.borderLeft;
  const style = {};
  if (borderTop != null)
    style.borderTop = borderSideToString(borderTop);
  if (borderRight != null)
    style.borderRight = borderSideToString(borderRight);
  if (borderBottom != null)
    style.borderBottom = borderSideToString(borderBottom);
  if (borderLeft != null)
    style.borderLeft = borderSideToString(borderLeft);
  return style;
}
function borderSideToString(borderSide) {
  if (typeof borderSide === "string")
    return borderSide;
  if (typeof borderSide === "number")
    return `${borderSide}px`;
  const { width, color, style } = borderSide;
  return `${width != null ? width : 0}px ${style} ${color != null ? (0, import_colorToString.colorToString)(color) : "black"}`;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  borderPropertyDataToStyle
});
//# sourceMappingURL=border.js.map