"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const toHexadecimal = require("./lib-util-to-hexadecimal.cjs");
const toDecimal = require("./lib-util-to-decimal.cjs");
const toNamed = require("./lib-util-to-named.cjs");
function formatSmart(code, next, options) {
  let numeric = toHexadecimal.toHexadecimal(code, next, options.omitOptionalSemicolons);
  let named;
  if (options.useNamedReferences || options.useShortestReferences) {
    named = toNamed.toNamed(
      code,
      next,
      options.omitOptionalSemicolons,
      options.attribute
    );
  }
  if ((options.useShortestReferences || !named) && options.useShortestReferences) {
    const decimal = toDecimal.toDecimal(code, next, options.omitOptionalSemicolons);
    if (decimal.length < numeric.length) {
      numeric = decimal;
    }
  }
  return named && (!options.useShortestReferences || named.length < numeric.length) ? named : numeric;
}
exports.formatSmart = formatSmart;
//# sourceMappingURL=lib-util-format-smart.cjs.map
