1import{q as x,j as a,r as i}from"./react-vendor-BFwvXtXo.js";import{G as m}from"./GoogleSignInButton-Bc-Mrq4E.js";import{F as S}from"./FlaskWordmark-BlVhmbBk.js";import{b as y,c as w,a as h}from"./authStore-Bjnrau4i.js";import{B as b}from"./Button-DU1uYL1d.js";import{u as g,c as R}from"./mediaStore-BPfgOnGF.js";import{u as k}from"./recordingStore-C62SRxwV.js";import{u as c}from"./dashboardStore-OIXrN9Sk.js";import{f as d,q as p}from"./client-DNxjMqPF.js";import{queryClient as v}from"./queryClient-BuATLGw2.js";const U=({error:e,onSignIn:o})=>{const s=x(),n=y();return a.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-surface-2 relative",children:a.jsxs("div",{className:"flex flex-col items-center justify-center w-full z-10",children:[a.jsx(S,{height:20,className:"mb-6"}),a.jsx("p",{className:"text-fg-2 mb-8 max-w-xs text-center",children:"This item may not exist or you might not have permission to view it."}),e==="auth-required"&&o?a.jsx(m,{onClick:o}):e==="auth-required"?a.jsx(m,{onClick:()=>{const r=window.location.pathname;n(r)}}):null,a.jsx(b,{variant:"secondary",onClick:()=>s("/"),className:"mt-4 px-6 py-2 text-sm",children:"Back"})]})})},B=()=>{const e=w(),s=g(t=>t.toolbarState)==="recording",n=k(t=>t.isRecording),r=R(t=>t.saveStatus);i.useEffect(()=>{if(!e)return;const t=()=>!!(n||s||r==="error"),u=l=>{if(t()){const f="Are you sure you want to leave? There might be unsaved changes.";return l.preventDefault(),l.returnValue=f,f}};return window.addEventListener("beforeunload",u),()=>{window.removeEventListener("beforeunload",u)}},[e,s,n,r])};function D(e){const o=h(r=>r.user),s=i.useRef(null),n=i.useRef(null);i.useEffect(()=>{if(!e||!o?.id)return;const r=c.getState();if(r.assets[e]&&r.pushRecent({id:e,last_opened_at:new Date().toISOString()}),n.current!==e)return s.current=setTimeout(async()=>{try{(await d(`/api/folders/${e}/last-seen`,{method:"PUT"})).ok&&(n.current=e,v.invalidateQueries({queryKey:p.folders.recent()}))}catch(t){console.error("[useTrackFolderAccess]",t)}},5e3),()=>{s.current&&clearTimeout(s.current)}},[e,o?.id])}function W(e){const o=h(t=>t.user),s=g(t=>e&&t.currentAssetId===e?t.getCurrentAsset():null),n=i.useRef(null),r=c(t=>!!(e&&t.assets[e]?._isPending));i.useEffect(()=>{if(!e||!o?.id)return;const t=c.getState();!t.assets[e]&&s?.id===e&&t.upsertAsset(s),t.assets[e]&&t.pushRecent({id:e,last_opened_at:new Date().toISOString()}),!r&&n.current!==e&&(n.current=e,d(`/api/assets/${e}/last-seen`,{method:"PUT",body:JSON.stringify({last_seen_at:new Date().toISOString()})}).then(u=>{u.ok&&v.invalidateQueries({queryKey:p.assets.recent()})}).catch(()=>{}))},[e,o?.id,s,r])}export{U as F,B as a,D as b,W 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.