"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 compute_block_css_vars_exports = {};
__export(compute_block_css_vars_exports, {
  computeSmartBlockWrapperVars: () => computeSmartBlockWrapperVars
});
module.exports = __toCommonJS(compute_block_css_vars_exports);
var import_colors = require("./../../_shared/colors.js");
var import_resolve_smart_block_css_color = require("./resolve-smart-block-css-color.js");
const computeSmartBlockWrapperVars = (blockAttrs, themeSmartBlock, type, cellCount) => {
  const isJoinedBoxes = type === "SOLID_JOINED_BOXES";
  const borderColor = isJoinedBoxes ? blockAttrs.borderColor ?? themeSmartBlock?.borderColor : themeSmartBlock?.borderColor;
  const borderWidth = isJoinedBoxes ? blockAttrs.borderWidth : void 0;
  const borderRadius = isJoinedBoxes ? blockAttrs.borderRadius : void 0;
  const vars = {
    "--ricos-internal-sb-cols": cellCount
  };
  if (borderColor) {
    if (borderColor === import_colors.TRANSPARENT_HEX_COLOR) {
      vars["--ricos-internal-sb-block-border-color"] = "transparent";
    } else {
      const resolved = (0, import_resolve_smart_block_css_color.resolveSmartBlockCssColor)(borderColor);
      if (resolved) {
        vars["--ricos-internal-sb-block-border-color"] = resolved;
      }
    }
  }
  if (borderWidth && borderWidth > 0) {
    vars["--ricos-internal-sb-block-border-width"] = `${borderWidth}px`;
  }
  if (borderRadius && borderRadius > 0) {
    vars["--ricos-internal-sb-block-border-radius"] = `${borderRadius}px`;
  }
  return vars;
};
//# sourceMappingURL=compute-block-css-vars.js.map
