import{__assign as r}from"../../../../../node_modules/tslib/tslib.es6.js";import{cssVariableRegex as e}from"../utils/css-variables-conversion.js";import{complex as t}from"../../../../../../style-value-types/dist/es/complex/index.js";import{mix as o}from"../../../../../../popmotion/dist/es/utils/mix.js";import{px as s}from"../../../../../../style-value-types/dist/es/numbers/units.js";function i(r,e){return r/(e.max-e.min)*100}function a(r,e,t){var o=t.target;if("string"==typeof r){if(!s.test(r))return r;r=parseFloat(r)}return i(r,o.x)+"% "+i(r,o.y)+"%"}function u(r,s){var i=s.delta,a=s.treeScale,u=r,n=r.includes("var("),p=[];n&&(r=r.replace(e,(function(r){return p.push(r),"_$css"})));var d=t.parse(r);if(d.length>5)return u;var m=t.createTransformer(r),f="number"!=typeof d[0]?1:0,l=i.x.scale*a.x,c=i.y.scale*a.y;d[0+f]/=l,d[1+f]/=c;var b=o(l,c,.5);"number"==typeof d[2+f]&&(d[2+f]/=b),"number"==typeof d[3+f]&&(d[3+f]/=b);var v=m(d);if(n){var R=0;v=v.replace("_$css",(function(){var r=p[R];return R++,r}))}return v}var n={process:a},p={borderRadius:r(r({},n),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:n,borderTopRightRadius:n,borderBottomLeftRadius:n,borderBottomRightRadius:n,boxShadow:{process:u}};export{a as correctBorderRadius,u as correctBoxShadow,i as pixelsToPercent,p as valueScaleCorrection};
//# sourceMappingURL=scale-correction.js.map
