1import{r as v}from"./chunk-OIYGIGL5-gwPc8tBz.js";import{a as x,u as A}from"./trpc-tanstack-CcrFfedX.js";function O(e){return e}function q(e,o,n){if(typeof o!="object"||o===null)return;const y=e.getMutationCache(),r=e.getQueryCache(),u=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData??O,c=o.mutations||[],g=o.queries||[];c.forEach(({state:f,...t})=>{y.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...t},f)}),g.forEach(({queryKey:f,state:t,queryHash:d,meta:s,promise:a,dehydratedAt:h})=>{const m=a?x(a):void 0,l=t.data===void 0?m?.data:t.data,p=l===void 0?l:u(l);let i=r.get(d);const Q=i?.state.status==="pending",D=i?.state.fetchStatus==="fetching";if(i){const C=m&&h!==void 0&&h>i.state.dataUpdatedAt;if(t.dataUpdatedAt>i.state.dataUpdatedAt||C){const{fetchStatus:w,...U}=t;i.setState({...U,data:p})}}else i=r.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:f,queryHash:d,meta:s},{...t,data:p,fetchStatus:"idle",status:p!==void 0?"success":t.status});a&&!Q&&!D&&(h===void 0||h>i.state.dataUpdatedAt)&&i.fetch(void 0,{initialPromise:Promise.resolve(a).then(u)})})}var z=({children:e,options:o={},state:n,queryClient:y})=>{const r=A(y),u=v.useRef(o);u.current=o;const c=v.useMemo(()=>{if(n){if(typeof n!="object")return;const g=r.getQueryCache(),f=n.queries||[],t=[],d=[];for(const s of f){const a=g.get(s.queryHash);a?(s.state.dataUpdatedAt>a.state.dataUpdatedAt||s.promise&&a.state.status!=="pending"&&a.state.fetchStatus!=="fetching"&&s.dehydratedAt!==void 0&&s.dehydratedAt>a.state.dataUpdatedAt)&&d.push(s):t.push(s)}if(t.length>0&&q(r,{queries:t},u.current),d.length>0)return d}},[r,n]);return v.useEffect(()=>{c&&q(r,{queries:c},u.current)},[r,c]),e};export{z as H}; 2//# sourceMappingURL=HydrationBoundary-DibUe9ri.js.map
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.