1 2!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]="2fc1c12f-9310-5c4e-8a87-6f4d7a5300c4")}catch(e){}}(); 3import{a as e}from"./jsx-runtime-CMgEUHpv.js";import{V as t}from"./dist-CAHjj65Z.js";import{A as n}from"./components-B8bHjdou.js";import{_ as r,c as i,d as a,g as o,h as s,i as c,l,m as u,p as d,t as f}from"./render-D-6lIDot.js";import{r as p,t as m}from"./use-owner-cdttaX9k.js";import{n as h,t as g}from"./hidden-tfADjw18.js";var _=e(t(),1);function v(e,t,n,r){let i=s(n);(0,_.useEffect)(()=>{e??=window;function n(e){i.current(e)}return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}var y=e(n(),1);function b(e){let t=u(e),n=(0,_.useRef)(!1);(0,_.useEffect)(()=>(n.current=!1,()=>{n.current=!0,d(()=>{n.current&&t()})}),[t])}var x=(e=>(e[e.Forwards=0]=`Forwards`,e[e.Backwards=1]=`Backwards`,e))(x||{});function S(){let e=(0,_.useRef)(0);return p(`keydown`,t=>{t.key===`Tab`&&(e.current=+!!t.shiftKey)},!0),e}var C=(0,_.createContext)(!1);function w(){return(0,_.useContext)(C)}function T(e){return _.createElement(C.Provider,{value:e.force},e.children)}function E(e){let t=w(),n=(0,_.useContext)(A),i=m(e),[a,o]=(0,_.useState)(()=>{if(!t&&n!==null||r.isServer)return null;let e=i?.getElementById(`headlessui-portal-root`);if(e)return e;if(i===null)return null;let a=i.createElement(`div`);return a.setAttribute(`id`,`headlessui-portal-root`),i.body.appendChild(a)});return(0,_.useEffect)(()=>{a!==null&&(i!=null&&i.body.contains(a)||i==null||i.body.appendChild(a))},[a,i]),(0,_.useEffect)(()=>{t||n!==null&&o(n.current)},[n,o,t]),a}var D=_.Fragment;function O(e,t){let n=e,s=(0,_.useRef)(null),c=l(i(e=>{s.current=e}),t),u=m(s),d=E(s),[p]=(0,_.useState)(()=>r.isServer?null:u?.createElement(`div`)??null),h=(0,_.useContext)(M),g=a();return o(()=>{!d||!p||d.contains(p)||(p.setAttribute(`data-headlessui-portal`,``),d.appendChild(p))},[d,p]),o(()=>{if(p&&h)return h.register(p)},[h,p]),b(()=>{var e;!d||!p||(p instanceof Node&&d.contains(p)&&d.removeChild(p),d.childNodes.length<=0&&((e=d.parentElement)==null||e.removeChild(d)))}),g?!d||!p?null:(0,y.createPortal)(f({ourProps:{ref:c},theirProps:n,defaultTag:D,name:`Portal`}),p):null}var k=_.Fragment,A=(0,_.createContext)(null);function j(e,t){let{target:n,...r}=e,i={ref:l(t)};return _.createElement(A.Provider,{value:n},f({ourProps:i,theirProps:r,defaultTag:k,name:`Popover.Group`}))}var M=(0,_.createContext)(null);function N(){let e=(0,_.useContext)(M),t=(0,_.useRef)([]),n=u(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=u(n=>{let r=t.current.indexOf(n);r!==-1&&t.current.splice(r,1),e&&e.unregister(n)}),i=(0,_.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,_.useMemo)(()=>function({children:e}){return _.createElement(M.Provider,{value:i},e)},[i])]}var P=c(O),F=c(j),I=Object.assign(P,{Group:F});function L({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){let r=(0,_.useRef)(n?.current??null),i=m(r),a=u(()=>{let n=[];for(let t of e)t!==null&&(t instanceof HTMLElement?n.push(t):`current`in t&&t.current instanceof HTMLElement&&n.push(t.current));if(t!=null&&t.current)for(let e of t.current)n.push(e);for(let e of i?.querySelectorAll(`html > *, body > *`)??[])e!==document.body&&e!==document.head&&e instanceof HTMLElement&&e.id!==`headlessui-portal-root`&&(e.contains(r.current)||e.contains(r.current?.getRootNode()?.host)||n.some(t=>e.contains(t))||n.push(e));return n});
3return{resolveContainers:a,contains:u(e=>a().some(t=>t.contains(e))),mainTreeNodeRef:r,MainTreeNode:(0,_.useMemo)(()=>function(){return n==null?_.createElement(h,{features:g.Hidden,ref:r}):null},[r,n])}}function R(){let e=(0,_.useRef)(null);return{mainTreeNodeRef:e,MainTreeNode:(0,_.useMemo)(()=>function(){return _.createElement(h,{features:g.Hidden,ref:e})},[e])}}export{T as a,b as c,I as i,v as l,R as n,S as o,N as r,x as s,L as t}; 4//# sourceMappingURL=use-root-containers-CiLTJdNj.js.map 5//# debugId=2fc1c12f-9310-5c4e-8a87-6f4d7a5300c4
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.