1import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-CwJFpaho.js";import{m as n,t as r}from"./invariant-CFmDZ0Ja.js";import{t as i}from"./jsx-runtime-NZYk81nU.js";import{n as a,t as o}from"./useStore-B0PK_TSp.js";import{n as s,t as c}from"./matchContext-OwRsGrXk.js";var l=e(t(),1),u={};function d(e,t){let r=l.useRef();return i=>{let a=e?.select?e.select(i):i;return e?.structuralSharing??t.options.defaultStructuralSharing?r.current=n(r.current,a):a}}function f(e){let t=a(),n=l.useContext(e.from?c:s),i=e.from??n,f=t.stores.getMatchStore(i),p=d(e,t),m=o(f,e=>e?p(e):u);if(m!==u)return m;(e.shouldThrow??!0)&&r()}function p(e){return f({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}var m=i();function h(e){return typeof e==`string`?e:`${e.pathname??``}${e.search??``}${e.hash??``}`||`/`}var g=(0,l.createContext)(null);function _(){return a({warn:!1})}var v=``,y={pathname:`/`,searchStr:``,hash:``,state:void 0};function b(){if(typeof window>`u`)return y;let e=window.location.href;return e!==v&&(v=e,y={pathname:window.location.pathname,searchStr:window.location.search.replace(/^\?/,``),hash:window.location.hash.replace(/^#/,``),state:void 0}),y}function x(e,t){return e?.__store?.subscribe?e.__store.subscribe(t):typeof e?.subscribe==`function`?e.subscribe(`onResolved`,t):typeof window>`u`?()=>{}:(window.addEventListener(`popstate`,t),window.addEventListener(C,t),()=>{window.removeEventListener(`popstate`,t),window.removeEventListener(C,t)})}function S(){let e=_(),t=(0,l.useContext)(g),n=(0,l.useCallback)(t=>x(e,t),[e]),r=(0,l.useCallback)(()=>e?e.state.location:t?.location??b(),[e,t]);return(0,l.useSyncExternalStore)(n,r,r)}var C=`icoc:compat-navigate`;function w(e,t){typeof window>`u`||(t?window.history.replaceState({},``,e):window.history.pushState({},``,e),window.dispatchEvent(new Event(C)))}function T(){let e=_();return(0,l.useCallback)((t,n)=>{if(typeof t==`number`){typeof window<`u`&&window.history.go(t);return}if(!e){w(h(t),n?.replace??!1);return}e.navigate({href:h(t),replace:n?.replace??!1,state:n?.state??void 0})},[e])}function E(){let e=S();return(0,l.useMemo)(()=>({pathname:e.pathname,search:e.searchStr?`?${e.searchStr.replace(/^\?/,``)}`:``,hash:e.hash?`#${e.hash.replace(/^#/,``)}`:``,state:e.state,key:e.state?.key??`default`}),[e])}function D(){let e=_(),t=(0,l.useContext)(g);return e?p({strict:!1}):t?.params??{}}function O(){return`PUSH`}function k(){let e=S(),t=_();return[(0,l.useMemo)(()=>new URLSearchParams(e.searchStr??``),[e.searchStr]),(0,l.useCallback)((n,r)=>{let i=(typeof n==`function`?n(new URLSearchParams(e.searchStr??``)):n instanceof URLSearchParams?n:new URLSearchParams(n)).toString();if(!t){w(`${e.pathname}${i?`?${i}`:``}`,r?.replace??!1);return}t.navigate({href:`${e.pathname}${i?`?${i}`:``}`,replace:r?.replace??!1})},[e.pathname,e.searchStr,t])]}var A=(0,l.forwardRef)(function({to:e,replace:t,state:n,preventScrollReset:r,end:i,onClick:a,...o},s){let c=_(),l=h(e);return(0,m.jsx)(`a`,{...o,ref:s,href:l,onClick:e=>{if(a?.(e),!e.defaultPrevented&&!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||o.target===`_blank`||/^[a-z]+:\/\//i.test(l)||l.startsWith(`mailto:`)||l.startsWith(`tel:`))){if(e.preventDefault(),!c){w(l,t??!1);return}c.navigate({href:l,replace:t??!1,state:n??void 0})}}})});function j({to:e,replace:t,state:n}){let r=_(),i=h(e);return typeof window<`u`&&queueMicrotask(()=>{r?r.navigate({href:i,replace:t??!0,state:n??void 0}):w(i,t??!0)}),null}export{O as a,p as c,T as i,f as l,j as n,D as o,E as r,k as s,A as t,d as u};
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.