!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fe0748be-864e-5183-bc29-3a2751b6c302")}catch(e){}}(); import{r as f}from"./index-DwaoyV61.js";import{h as w,T as p,o as E}from"./focus-management-os-Ivo5o.js";import{s as m}from"./render-C4qrFtWh.js";function g(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function L(){return/Android/gi.test(window.navigator.userAgent)}function h(){return g()||L()}function d(e,s,r){let c=m(s);f.useEffect(()=>{function u(i){c.current(i)}return document.addEventListener(e,u,r),()=>document.removeEventListener(e,u,r)},[e,r])}function P(e,s,r){let c=m(s);f.useEffect(()=>{function u(i){c.current(i)}return window.addEventListener(e,u,r),()=>window.removeEventListener(e,u,r)},[e,r])}function x(e,s,r=!0){let c=f.useRef(!1);f.useEffect(()=>{requestAnimationFrame(()=>{c.current=r})},[r]);function u(t,l){if(!c.current||t.defaultPrevented)return;let n=l(t);if(n===null||!n.getRootNode().contains(n)||!n.isConnected)return;let v=function a(o){return typeof o=="function"?a(o()):Array.isArray(o)||o instanceof Set?o:[o]}(e);for(let a of v){if(a===null)continue;let o=a instanceof HTMLElement?a:a.current;if(o!=null&&o.contains(n)||t.composed&&t.composedPath().includes(o))return}return!w(n,p.Loose)&&n.tabIndex!==-1&&t.preventDefault(),s(t,n)}let i=f.useRef(null);d("pointerdown",t=>{var l,n;c.current&&(i.current=((n=(l=t.composedPath)==null?void 0:l.call(t))==null?void 0:n[0])||t.target)},!0),d("mousedown",t=>{var l,n;c.current&&(i.current=((n=(l=t.composedPath)==null?void 0:l.call(t))==null?void 0:n[0])||t.target)},!0),d("click",t=>{h()||i.current&&(u(t,()=>i.current),i.current=null)},!0),d("touchend",t=>u(t,()=>t.target instanceof HTMLElement?t.target:null),!0),P("blur",t=>u(t,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function y(...e){return f.useMemo(()=>E(...e),[...e])}export{y as n,P as s,g as t,x as y}; //# sourceMappingURL=use-owner-B66e02Ou.js.map //# debugId=fe0748be-864e-5183-bc29-3a2751b6c302