import t from"../../tiny-invariant/dist/tiny-invariant.esm.js";var o=function(t){var o=t.top,r=t.right,i=t.bottom,n=t.left;return{top:o,right:r,bottom:i,left:n,width:r-n,height:i-o,x:n,y:o,center:{x:(r+n)/2,y:(i+o)/2}}},r=function(t,o){return{top:t.top-o.top,left:t.left-o.left,bottom:t.bottom+o.bottom,right:t.right+o.right}},i=function(t,o){return{top:t.top+o.top,left:t.left+o.left,bottom:t.bottom-o.bottom,right:t.right-o.right}},n={top:0,right:0,bottom:0,left:0},e=function(t){var e=t.borderBox,d=t.margin,g=void 0===d?n:d,a=t.border,p=void 0===a?n:a,f=t.padding,m=void 0===f?n:f,b=o(r(e,g)),u=o(i(e,p)),h=o(i(u,m));return{marginBox:b,borderBox:o(e),paddingBox:u,contentBox:h,margin:g,border:p,padding:m}},d=function(o){var r=o.slice(0,-2);if("px"!==o.slice(-2))return 0;var i=Number(r);return isNaN(i)&&("production"!==process.env.NODE_ENV?t(!1,"Could not parse value [raw: "+o+", without suffix: "+r+"]"):t(!1)),i},g=function(t,o){var r,i,n=t.borderBox,d=t.border,g=t.margin,a=t.padding,p=(i=o,{top:(r=n).top+i.y,left:r.left+i.x,bottom:r.bottom+i.y,right:r.right+i.x});return e({borderBox:p,border:d,margin:g,padding:a})},a=function(t,o){return void 0===o&&(o={x:window.pageXOffset,y:window.pageYOffset}),g(t,o)},p=function(t,o){var r={top:d(o.marginTop),right:d(o.marginRight),bottom:d(o.marginBottom),left:d(o.marginLeft)},i={top:d(o.paddingTop),right:d(o.paddingRight),bottom:d(o.paddingBottom),left:d(o.paddingLeft)},n={top:d(o.borderTopWidth),right:d(o.borderRightWidth),bottom:d(o.borderBottomWidth),left:d(o.borderLeftWidth)};return e({borderBox:t,margin:r,padding:i,border:n})},f=function(t){var o=t.getBoundingClientRect(),r=window.getComputedStyle(t);return p(o,r)};export{p as calculateBox,e as createBox,r as expand,f as getBox,o as getRect,g as offset,i as shrink,a as withScroll};
//# sourceMappingURL=css-box-model.esm.js.map
