import { getValueAsType as m } from "../../../value/types/utils/get-as-type.es.js";
import { numberValueTypes as p } from "../../../value/types/maps/number.es.js";
import { transformPropOrder as f } from "../../utils/keys-transform.es.js";
const y = {
  x: "translateX",
  y: "translateY",
  z: "translateZ",
  transformPerspective: "perspective"
}, d = f.length;
function h(u, l, n) {
  let e = "", o = !0;
  for (let i = 0; i < d; i++) {
    const t = f[i], r = u[t];
    if (r === void 0)
      continue;
    let a = !0;
    if (typeof r == "number")
      a = r === (t.startsWith("scale") ? 1 : 0);
    else {
      const s = parseFloat(r);
      a = t.startsWith("scale") ? s === 1 : s === 0;
    }
    if (!a || n) {
      const s = m(r, p[t]);
      if (!a) {
        o = !1;
        const c = y[t] || t;
        e += `${c}(${s}) `;
      }
      n && (l[t] = s);
    }
  }
  return e = e.trim(), n ? e = n(l, o ? "" : e) : o && (e = "none"), e;
}
export {
  h as buildTransform
};
//# sourceMappingURL=build-transform.es.js.map
