try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`126f6fcd-4b71-4a0e-b30d-421839bb5172`,e._sentryDebugIdIdentifier=`sentry-dbid-126f6fcd-4b71-4a0e-b30d-421839bb5172`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{Jl as t,Sp as n,Zi as r,an as i,jg as a,ng as o,tn as s}from"./entry.client-mpghtlrl.js";var c=e(a(),1),l=o(),u=({children:e})=>{let a=n().history,{focusContainerRef:o}=r(),[u]=(0,c.useState)(()=>new s),d=(0,c.useRef)(a.index);(0,c.useEffect)(()=>{let e,t=a.subscribeInternal(()=>{let t=d.current,n=a.index;d.current=n,e!==void 0&&(cancelAnimationFrame(e),e=void 0),n>t?u.storeDataAtKey(t):n<t&&(e=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>{e=void 0,u.restoreDataAtKey(n)})}))});return()=>{e!==void 0&&cancelAnimationFrame(e),t()}},[a,u]);let f=(0,c.useCallback)(()=>o.current?.getLastRememberedFocus()?.getBoundingClientRect(),[o]),p=(0,c.useCallback)(e=>{let n=o.current;n&&e&&(n.setRefocusTargetRect(e),t())},[o]),m=(0,c.useMemo)(()=>({stateRestorationManager:u,storeLastFocusData:f,restoreLastFocusData:p}),[u,f,p]);return(0,l.jsx)(i.Provider,{value:m,children:e})};export{u as t};