PageSourceSearch

https://tiderne.dk/assets/components-CyoQZY2_.js

js tiderne.dk collected 2026-10-05 21:43:56 UTC 5,609 bytes, 1 lines download raw bytes

1import{g as A,i as H,p as N,s as W,w as z}from"./utils-BHFdIeSR.js";import{b as U,D as _,c as q,F as G,V as J,d as K,N as Q,L as X,e as Z,f as S,g as T,h as B,a as O,i as F,j as I}from"./hooks-TI7Yx1Lg.js";import{w as V}from"./warnings-COd-4g09.js";import{r as t}from"./radix-24O0SwKx.js";const ce=["HydrateFallback","hydrateFallbackElement"];var ee=class{status="pending";promise;resolve;reject;constructor(){this.promise=new Promise((e,a)=>{this.resolve=i=>{this.status==="pending"&&(this.status="resolved",e(i))},this.reject=i=>{this.status==="pending"&&(this.status="rejected",a(i))}})}};function fe({router:e,flushSync:a,onError:i,useTransitions:o}){o=U()||o;let[b,r]=t.useState(e.state),[f,l]=t.useOptimistic(b),[p,h]=t.useState(),[c,d]=t.useState({isTransitioning:!1}),[s,P]=t.useState(),[m,g]=t.useState(),[R,D]=t.useState(),E=t.useRef(new Map),k=t.useCallback((n,{deletedFetchers:L,newErrors:v,flushSync:y,viewTransitionOpts:x})=>{v&&i&&Object.values(v).forEach(u=>i(u,{location:n.location,params:n.matches[0]?.params??{},pattern:A(n.matches)})),n.fetchers.forEach((u,$)=>{u.data!==void 0&&E.current.set($,u.data)}),L.forEach(u=>E.current.delete(u)),V(y===!1||a!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable.  Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let M=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(V(x==null||M,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!x||!M){a&&y?a(()=>r(n)):o===!1?r(n):t.startTransition(()=>{o===!0&&l(u=>j(u,n)),r(n)});return}if(a&&y){a(()=>{m&&(s?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:x.currentLocation,nextLocation:x.nextLocation})});let u=e.window.document.startViewTransition(()=>{a(()=>r(n))});u.finished.finally(()=>{a(()=>{P(void 0),g(void 0),h(void 0),d({isTransitioning:!1})})}),a(()=>g(u));return}m?(s?.resolve(),m.skipTransition(),D({state:n,currentLocation:x.currentLocation,nextLocation:x.nextLocation})):(h(n),d({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}))},[e.window,a,m,s,o,l,i]);t.useLayoutEffect(()=>e.subscribe(k),[e,k]),t.useEffect(()=>{c.isTransitioning&&!c.flushSync&&P(new ee)},[c]),t.useEffect(()=>{if(s&&p&&e.window){let n=p,L=s.promise,v=e.window.document.startViewTransition(async()=>{o===!1?r(n):t.startTransition(()=>{o===!0&&l(y=>j(y,n)),r(n)}),await L});v.finished.finally(()=>{P(void 0),g(void 0),h(void 0),d({isTransitioning:!1})}),g(v)}},[p,s,e.window,o,l]),t.useEffect(()=>{s&&p&&f.location.key===p.location.key&&s.resolve()},[s,m,f.location,p]),t.useEffect(()=>{!c.isTransitioning&&R&&(h(R.state),d({isTransitioning:!0,flushSync:!1,currentLocation:R.currentLocation,nextLocation:R.nextLocation}),D(void 0))},[c.isTransitioning,R]);let C=t.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:n=>e.navigate(n),push:(n,L,v)=>e.navigate(n,{state:L,preventScrollReset:v?.preventScrollReset}),replace:(n,L,v)=>e.navigate(n,{replace:!0,state:L,preventScrollReset:v?.preventScrollReset})}),[e]),w=e.basename||"/",Y=t.useMemo(()=>({router:e,navigator:C,static:!1,basename:w,onError:i}),[e,C,w,i]);return t.createElement(t.Fragment,null,t.createElement(_.Provider,{value:Y},t.createElement(q.Provider,{value:f},t.createElement(G.Provider,{value:E.current},t.createElement(J.Provider,{value:c},t.createElement(ne,{basename:w,location:f.location,navigationType:f.historyAction,navigator:C,useTransitions:o},t.createElement(te,{routes:e.routes,manifest:e.manifest,future:e.future,state:f,isStatic:!1,onError:i})))))),null)}function j(e,a){return{...e,navigation:a.navigation.state!=="idle"?a.navigation:e.navigation,revalidation:a.revalidation!=="idle"?a.revalidation:e.revalidation,actionData:a.navigation.state!=="submitting"?a.actionData:e.actionData,fetchers:a.fetchers}}const te=t.memo(ae);function ae({routes:e,manifest:a,future:i,state:o,isStatic:b,onError:r}){return Z(e,void 0,{manifest:a,state:o,isStatic:b,onError:r})}function de(e){return F(e.context)}function ne({basename:e="/",children:a=null,location:i,navigationType:o="POP",navigator:b,static:r=!1,useTransitions:f}){H(!K(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),p=t.useMemo(()=>({basename:l,navigator:b,static:r,useTransitions:f,future:{}}),[l,b,r,f]);typeof i=="string"&&(i=N(i));let{pathname:h="/",search:c="",hash:d="",state:s=null,key:P="default",mask:m}=i,g=t.useMemo(()=>{let R=W(h,l);return R==null?null:{location:{pathname:R,search:c,hash:d,state:s,key:P,mask:m},navigationType:o}},[l,h,c,d,s,P,o,m]);
1return z(g!=null,`<Router basename="${l}"> is not able to match the URL "${h}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:t.createElement(Q.Provider,{value:p},t.createElement(X.Provider,{children:a,value:g}))}function ie(){return{params:O(),loaderData:B(),actionData:T(),matches:S()}}function me(e){return function(){const i=ie();return t.createElement(e,i)}}function oe(){return{params:O(),loaderData:B(),actionData:T(),error:I()}}function ve(e){return function(){const i=oe();return t.createElement(e,i)}}export{de as O,fe as R,ve as a,ce as h,me as w};

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.