import{eH as O,eI as B,r as p}from"./index-DR3HTfO6.js";import{_ as S}from"./typeof-QjJsDpFa.js";import{t as j}from"./redux-Ab4buSXY.js";function v(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,o=Array(r);t<r;t++)o[t]=e[t];return o}function M(e,r){if(e){if(typeof e=="string")return v(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?v(e,r):void 0}}function N(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&O(e,r)}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},g(e)}function k(e,r){if(r&&(S(r)=="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return B(e)}function q(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function b(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,j(o.key),o)}}function z(e,r,t){return r&&b(e.prototype,r),t&&b(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function C(e,r){if(e.length!==r.length)return!1;for(var t=0;t<e.length;t++)if(e[t]!==r[t])return!1;return!0}function h(e,r){var t=p.useState(function(){return{inputs:r,result:e()}})[0],o=p.useRef(!0),n=p.useRef(t),a=o.current||!!(r&&n.current.inputs&&C(r,n.current.inputs)),i=a?n.current:{inputs:r,result:e()};return p.useEffect(function(){o.current=!1,n.current=i},[i]),i.result}function A(e,r){return h(function(){return e},r)}var D=h,H=A,P="Invariant failed";function _(e,r){throw new Error(P)}var d=function(r){var t=r.top,o=r.right,n=r.bottom,a=r.left,i=o-a,f=n-t,c={top:t,right:o,bottom:n,left:a,width:i,height:f,x:a,y:t,center:{x:(o+a)/2,y:(n+t)/2}};return c},R=function(r,t){return{top:r.top-t.top,left:r.left-t.left,bottom:r.bottom+t.bottom,right:r.right+t.right}},m=function(r,t){return{top:r.top+t.top,left:r.left+t.left,bottom:r.bottom-t.bottom,right:r.right-t.right}},T=function(r,t){return{top:r.top+t.y,left:r.left+t.x,bottom:r.bottom+t.y,right:r.right+t.x}},l={top:0,right:0,bottom:0,left:0},x=function(r){var t=r.borderBox,o=r.margin,n=o===void 0?l:o,a=r.border,i=a===void 0?l:a,f=r.padding,c=f===void 0?l:f,w=d(R(t,n)),s=d(m(t,i)),y=d(m(s,c));return{marginBox:w,borderBox:d(t),paddingBox:s,contentBox:y,margin:n,border:i,padding:c}},u=function(r){var t=r.slice(0,-2),o=r.slice(-2);if(o!=="px")return 0;var n=Number(t);return isNaN(n)&&_(),n},E=function(){return{x:window.pageXOffset,y:window.pageYOffset}},W=function(r,t){var o=r.borderBox,n=r.border,a=r.margin,i=r.padding,f=T(o,t);return x({borderBox:f,border:n,margin:a,padding:i})},K=function(r,t){return t===void 0&&(t=E()),W(r,t)},F=function(r,t){var o={top:u(t.marginTop),right:u(t.marginRight),bottom:u(t.marginBottom),left:u(t.marginLeft)},n={top:u(t.paddingTop),right:u(t.paddingRight),bottom:u(t.paddingBottom),left:u(t.paddingLeft)},a={top:u(t.borderTopWidth),right:u(t.borderRightWidth),bottom:u(t.borderBottomWidth),left:u(t.borderLeftWidth)};return x({borderBox:r,margin:o,padding:n,border:a})},U=function(r){var t=r.getBoundingClientRect(),o=window.getComputedStyle(r);return F(t,o)},X=function(r){var t=[],o=null,n=function(){for(var i=arguments.length,f=new Array(i),c=0;c<i;c++)f[c]=arguments[c];t=f,!o&&(o=requestAnimationFrame(function(){o=null,r.apply(void 0,t)}))};return n.cancel=function(){o&&(cancelAnimationFrame(o),o=null)},n};export{N as _,z as a,q as b,k as c,g as d,v as e,M as f,H as g,U as h,d as i,R as j,x as k,F as l,W as o,X as r,D as u,K as w};
