class l{constructor(i){let{x:s,y:n,width:r,height:t}=i;this.x=s,this.y=n,this.width=r,this.height=t}get top(){return this.y}get bottom(){return this.y+this.height}get left(){return this.x}get right(){return this.x+this.width}}function w(e,i){return{x:{before:Math.max(0,i.left-e.left),after:Math.max(0,e.right-i.right)},y:{before:Math.max(0,i.top-e.top),after:Math.max(0,e.bottom-i.bottom)}}}function v(e){return Array.isArray(e)?new l({x:e[0],y:e[1],width:0,height:0}):e.getBoundingClientRect()}function x(e){if(e===document.documentElement)return visualViewport?new l({x:visualViewport.scale>1?0:visualViewport.offsetLeft,y:visualViewport.scale>1?0:visualViewport.offsetTop,width:visualViewport.width*visualViewport.scale,height:visualViewport.height*visualViewport.scale}):new l({x:0,y:0,width:document.documentElement.clientWidth,height:document.documentElement.clientHeight});{const i=e.getBoundingClientRect();return new l({x:i.x,y:i.y,width:e.clientWidth,height:e.clientHeight})}}function b(e){const i=e.getBoundingClientRect(),s=getComputedStyle(e),n=s.transform;if(n){let r,t,o,f,u;if(n.startsWith("matrix3d("))r=n.slice(9,-1).split(/, /),t=Number(r[0]),o=Number(r[5]),f=Number(r[12]),u=Number(r[13]);else if(n.startsWith("matrix("))r=n.slice(7,-1).split(/, /),t=Number(r[0]),o=Number(r[3]),f=Number(r[4]),u=Number(r[5]);else return new l(i);const a=s.transformOrigin,c=i.x-f-(1-t)*parseFloat(a),h=i.y-u-(1-o)*parseFloat(a.slice(a.indexOf(" ")+1)),d=t?i.width/t:e.offsetWidth+1,m=o?i.height/o:e.offsetHeight+1;return new l({x:c,y:h,width:d,height:m})}else return new l(i)}function R(e,i,s){if(typeof e.animate>"u")return{finished:Promise.resolve()};let n;try{n=e.animate(i,s)}catch{return{finished:Promise.resolve()}}return typeof n.finished>"u"&&(n.finished=new Promise(r=>{n.onfinish=()=>{r(n)}})),n}const p=Symbol("Forwarded refs");function g(e,i){let s=e;for(;s;){const n=Reflect.getOwnPropertyDescriptor(s,i);if(n)return n;s=Object.getPrototypeOf(s)}}function y(e){for(var i=arguments.length,s=new Array(i>1?i-1:0),n=1;n<i;n++)s[n-1]=arguments[n];return e[p]=s,new Proxy(e,{get(r,t){if(Reflect.has(r,t))return Reflect.get(r,t);if(!(typeof t=="symbol"||t.startsWith("$")||t.startsWith("__"))){for(const o of s)if(o.value&&Reflect.has(o.value,t)){const f=Reflect.get(o.value,t);return typeof f=="function"?f.bind(o.value):f}}},has(r,t){if(Reflect.has(r,t))return!0;if(typeof t=="symbol"||t.startsWith("$")||t.startsWith("__"))return!1;for(const o of s)if(o.value&&Reflect.has(o.value,t))return!0;return!1},set(r,t,o){if(Reflect.has(r,t))return Reflect.set(r,t,o);if(typeof t=="symbol"||t.startsWith("$")||t.startsWith("__"))return!1;for(const f of s)if(f.value&&Reflect.has(f.value,t))return Reflect.set(f.value,t,o);return!1},getOwnPropertyDescriptor(r,t){var f;const o=Reflect.getOwnPropertyDescriptor(r,t);if(o)return o;if(!(typeof t=="symbol"||t.startsWith("$")||t.startsWith("__"))){for(const u of s){if(!u.value)continue;const a=g(u.value,t)??("_"in u.value?g((f=u.value._)==null?void 0:f.setupState,t):void 0);if(a)return a}for(const u of s){const a=u.value&&u.value[p];if(!a)continue;const c=a.slice();for(;c.length;){const h=c.shift(),d=g(h.value,t);if(d)return d;const m=h.value&&h.value[p];m&&c.push(...m)}}}}})}export{l as B,x as a,w as b,R as c,y as f,v as g,b as n};
