1import{a as i}from"./chunk-UIGDSWPH-Cvdthj3w.js";(function(){try{var 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]="7455a977-903a-4aa2-81f9-ab0ddf9ae890",e._sentryDebugIdIdentifier="sentry-dbid-7455a977-903a-4aa2-81f9-ab0ddf9ae890")}catch{}})();const E=e=>{const{topic:t,onEvent:u,onError:f,onOpen:d}=e,n=i.useRef(null),s=i.useRef(0),a=()=>{const r=new URL(`${window.location.origin}/api/sse/${t}`);e.params&&(r.search=e.params.toString());const o=new EventSource(r);o.onmessage=c=>{try{u(JSON.parse(c.data))}catch(l){console.error("Failed to parse SSE message:",l)}},o.onopen=()=>{s.current=0,console.info("SSE connection opened"),d&&d()},o.onerror=c=>{f?f(c):console.error("SSE connection error:",c),o.close(),n.current=null,s.current<5?(s.current++,setTimeout(()=>{console.info("Retrying SSE connection after error"),a()},2**s.current*1e3)):console.error("Max retries reached, refresh the page to reconnect")},n.current=o};i.useEffect(()=>{a();const r=()=>{(!n.current||n.current.readyState===EventSource.CLOSED)&&a()};return window.addEventListener("focus",r),()=>{console.info("Cleaning up SSE connection"),window.removeEventListener("focus",r),n.current&&n.current.close()}},[])};export{E as u}; 2//# sourceMappingURL=use-sse-CCu3qeKe.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.