import { cssVariableRegex as y } from "../../render/dom/utils/css-variables-conversion.es.js";
import { complex as m } from "../../../../../style-value-types/dist/es/complex/index.es.js";
import { mix as g } from "../../../../../popmotion/dist/es/utils/mix.es.js";
var x = "_$css", j = {
  correct: function(e, n) {
    var i = n.treeScale, t = n.projectionDelta, S = e, v = e.includes("var("), f = [];
    v && (e = e.replace(y, function(c) {
      return f.push(c), x;
    }));
    var r = m.parse(e);
    if (r.length > 5)
      return S;
    var b = m.createTransformer(e), a = typeof r[0] != "number" ? 1 : 0, p = t.x.scale * i.x, l = t.y.scale * i.y;
    r[0 + a] /= p, r[1 + a] /= l;
    var s = g(p, l, 0.5);
    typeof r[2 + a] == "number" && (r[2 + a] /= s), typeof r[3 + a] == "number" && (r[3 + a] /= s);
    var o = b(r);
    if (v) {
      var u = 0;
      o = o.replace(x, function() {
        var c = f[u];
        return u++, c;
      });
    }
    return o;
  }
};
export {
  j as correctBoxShadow
};
//# sourceMappingURL=scale-box-shadow.es.js.map
